{
  "contractVersion": "v1",
  "schemaVersion": 1,
  "operationRegistryVersion": 3,
  "runtimeOperationRegistryVersion": 5,
  "sourceDigest": "8c57c4929bc859d307490158a857edaeaf7499fc94565a91196b3a771183c09c",
  "schemas": {
    "AgentOperationRequest": {
      "type": "object",
      "additionalProperties": false,
      "description": "Bounded operation input; opaque resource references only.",
      "properties": {
        "resourceRef": {
          "type": "string",
          "maxLength": 256
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 512
        },
        "idempotencyKey": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        },
        "input": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "AgentOperationResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operationId",
        "status",
        "availability"
      ],
      "properties": {
        "operationId": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "implemented",
            "planned"
          ]
        },
        "availability": {
          "type": "string"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "resource": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "nextAction": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    },
    "AgentAuthChallenge": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "audience",
        "resource",
        "scopes",
        "scheme"
      ],
      "properties": {
        "audience": {
          "type": "string"
        },
        "resource": {
          "type": "string"
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "scheme": {
          "type": "string",
          "const": "Bearer"
        },
        "authorizationUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "verificationUri": {
          "type": [
            "string",
            "null"
          ]
        },
        "userCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentAuthError": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "requestId": {
          "type": [
            "string",
            "null"
          ]
        },
        "requiredScope": {
          "type": [
            "string",
            "null"
          ]
        },
        "challenge": {
          "$ref": "#/schemas/AgentAuthChallenge"
        },
        "action": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    },
    "AgentAuthFlowRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "provider": {
          "type": [
            "string",
            "null"
          ]
        },
        "audience": {
          "type": [
            "string",
            "null"
          ]
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "verificationCode": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 32
        }
      }
    },
    "AgentAuthFlowResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "audience",
        "expiresAt"
      ],
      "properties": {
        "status": {
          "type": "string"
        },
        "audience": {
          "type": [
            "string",
            "null"
          ]
        },
        "accessToken": {
          "type": [
            "string",
            "null"
          ],
          "description": "Redacted in public fixtures and documentation."
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentAuthClaimResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "claim_required",
            "claim_pending",
            "claimed",
            "expired",
            "conflict"
          ]
        },
        "verificationUri": {
          "type": [
            "string",
            "null"
          ]
        },
        "userCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "nextPollAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentAuthRevokeResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "revoked"
      ],
      "properties": {
        "revoked": {
          "type": "boolean"
        },
        "registrationId": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentRunnerResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "runnerId",
        "state",
        "generation",
        "lastSeenAt"
      ],
      "properties": {
        "runnerId": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "enrolling",
            "active",
            "offline",
            "revoked"
          ]
        },
        "generation": {
          "type": "integer",
          "minimum": 1
        },
        "lastSeenAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "capabilitiesDigest": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentIntegrationResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "connectionId",
        "providerId",
        "state"
      ],
      "properties": {
        "connectionId": {
          "type": "string"
        },
        "providerId": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "not_connected",
            "setup_requested",
            "human_action_required",
            "authorizing",
            "connected",
            "attached",
            "available",
            "reconnect_required",
            "suspended",
            "revoked"
          ]
        },
        "targetRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "generation": {
          "type": "integer",
          "minimum": 1
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "company"
          ]
        },
        "scopeRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "grantedCapabilities": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "attachedAgentIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      }
    },
    "AgentModelResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "modelRef",
        "displayName",
        "provider",
        "tier",
        "availability",
        "reason",
        "credentialState",
        "default"
      ],
      "properties": {
        "modelRef": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "tier": {
          "type": "string",
          "enum": [
            "basic",
            "standard",
            "premium"
          ]
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "claim_required",
            "setup_required",
            "plan_required",
            "approval_required",
            "temporarily_disabled"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "credentialState": {
          "type": "string",
          "enum": [
            "managed",
            "configured",
            "missing"
          ]
        },
        "default": {
          "type": "boolean"
        }
      }
    },
    "AgentSkillResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "skillId",
        "displayName",
        "description",
        "version",
        "availability",
        "reason",
        "requiredOperations",
        "requiredConnections",
        "requiredModels",
        "missingConfigurationFields",
        "localArtifacts",
        "humanAction"
      ],
      "properties": {
        "skillId": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "claim_required",
            "setup_required",
            "plan_required",
            "approval_required",
            "temporarily_disabled"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "requiredOperations": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "requiredConnections": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "providerId",
              "capabilities"
            ],
            "properties": {
              "providerId": {
                "type": "string"
              },
              "capabilities": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              }
            }
          }
        },
        "requiredModels": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "missingConfigurationFields": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "localArtifacts": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "state"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "state": {
                "type": "string",
                "enum": [
                  "bundled",
                  "install_required",
                  "unsupported"
                ]
              }
            }
          }
        },
        "humanAction": {
          "type": "null"
        }
      }
    },
    "AgentSkillsResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "skills",
        "keyMode"
      ],
      "properties": {
        "skills": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentSkillResource"
          }
        },
        "keyMode": {
          "type": "string",
          "enum": [
            "user",
            "system"
          ]
        }
      }
    },
    "AgentModelsResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "models",
        "plan",
        "defaultModel"
      ],
      "properties": {
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentModelResource"
          }
        },
        "plan": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "tier",
            "keyMode"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "tier": {
              "type": "string",
              "enum": [
                "basic",
                "standard",
                "premium"
              ]
            },
            "keyMode": {
              "type": "string",
              "enum": [
                "user",
                "system"
              ]
            }
          }
        },
        "defaultModel": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "DesktopDownloadOptionsResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operationId",
        "status",
        "availability",
        "reason",
        "release",
        "downloads",
        "integrity"
      ],
      "properties": {
        "operationId": {
          "type": "string",
          "const": "listDesktopDownloadOptions"
        },
        "status": {
          "type": "string",
          "const": "available"
        },
        "availability": {
          "type": "string",
          "const": "available"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "release": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "owner",
            "repository",
            "version",
            "tagName",
            "publishedAt",
            "releaseUrl"
          ],
          "properties": {
            "owner": {
              "type": "string"
            },
            "repository": {
              "type": "string"
            },
            "version": {
              "type": "string"
            },
            "tagName": {
              "type": "string"
            },
            "publishedAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "releaseUrl": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "downloads": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mac",
            "windows",
            "linux"
          ],
          "properties": {
            "mac": {
              "type": "array",
              "items": {
                "$ref": "#/schemas/DesktopDownloadAsset"
              }
            },
            "windows": {
              "type": "array",
              "items": {
                "$ref": "#/schemas/DesktopDownloadAsset"
              }
            },
            "linux": {
              "type": "array",
              "items": {
                "$ref": "#/schemas/DesktopDownloadAsset"
              }
            }
          }
        },
        "integrity": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "verified",
            "manifestVersion",
            "signatureAlgorithm",
            "signatureKeyId",
            "expiresAt"
          ],
          "properties": {
            "verified": {
              "type": "boolean",
              "const": true
            },
            "manifestVersion": {
              "type": "integer",
              "const": 2
            },
            "signatureAlgorithm": {
              "type": "string",
              "const": "Ed25519"
            },
            "signatureKeyId": {
              "type": "string"
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      }
    },
    "DesktopDownloadAsset": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "url"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "AgentCheckoutHandoffRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operation"
      ],
      "properties": {
        "operation": {
          "type": "string",
          "enum": [
            "analytics.advanced",
            "audit_logs.read",
            "companies.create",
            "cron.create",
            "sso.configure"
          ]
        },
        "requiredFeature": {
          "type": "string",
          "description": "Optional assertion that must match the server-owned operation catalog."
        }
      }
    },
    "AgentPlanRequiredResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "code",
            "message",
            "operation",
            "requiredFeature",
            "eligiblePlans",
            "checkoutUrl"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "plan_required"
            },
            "message": {
              "type": "string"
            },
            "operation": {
              "type": "string"
            },
            "requiredFeature": {
              "type": "string"
            },
            "eligiblePlans": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "individual",
                  "business",
                  "enterprise"
                ]
              }
            },
            "checkoutUrl": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      }
    },
    "AgentSkillConfigurationRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "requestedFields": {
          "type": "array",
          "maxItems": 64,
          "items": {
            "type": "string"
          }
        },
        "reason": {
          "type": "string",
          "maxLength": 1000
        }
      }
    },
    "AgentSkillConfigurationResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operationId",
        "status",
        "availability",
        "reason",
        "skill",
        "requestedFields",
        "missingConfigurationFields",
        "requiredFields",
        "humanAction"
      ],
      "properties": {
        "operationId": {
          "type": "string",
          "const": "requestAgentSkillConfiguration"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "available"
          ]
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "setup_required"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "skill": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "skillId",
            "displayName",
            "description",
            "authMode",
            "requiredConnections"
          ],
          "properties": {
            "skillId": {
              "type": "string"
            },
            "displayName": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "authMode": {
              "type": "string"
            },
            "requiredConnections": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "requestedFields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "missingConfigurationFields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "requiredFields": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "key",
              "label",
              "description",
              "sensitive"
            ],
            "properties": {
              "key": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "sensitive": {
                "type": "boolean"
              }
            }
          }
        },
        "humanAction": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "required": {
              "type": "boolean"
            },
            "type": {
              "type": "string"
            },
            "authority": {
              "type": "string",
              "const": "human_only"
            },
            "url": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "requestReason": {
          "type": "string"
        }
      }
    },
    "AgentMcpCatalogResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ok",
        "operationId",
        "status",
        "availability",
        "reason",
        "version",
        "entries"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "operationId": {
          "type": "string",
          "const": "getAgentMcpCatalog"
        },
        "status": {
          "type": "string",
          "const": "available"
        },
        "availability": {
          "type": "string",
          "const": "available"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "version": {
          "type": "string"
        },
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMcpCatalogEntry"
          }
        }
      }
    },
    "AgentMcpCatalogEntry": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "providerKey",
        "slug",
        "name",
        "category",
        "description",
        "capabilityDescription",
        "authProvider",
        "reviewedAuthClassification",
        "status",
        "tools",
        "toolCount",
        "toolsSource",
        "toolsObservedAt"
      ],
      "properties": {
        "providerKey": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "category": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "capabilityDescription": {
          "type": [
            "string",
            "null"
          ]
        },
        "authProvider": {
          "type": "string"
        },
        "reviewedAuthClassification": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string"
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "toolCount": {
          "type": "integer",
          "minimum": 0
        },
        "toolsSource": {
          "type": "string",
          "enum": [
            "static",
            "live"
          ]
        },
        "toolsObservedAt": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentCliMetadataResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operationId",
        "status",
        "availability",
        "reason",
        "contract",
        "auth",
        "distribution",
        "commands",
        "runner",
        "compatibility"
      ],
      "properties": {
        "operationId": {
          "type": "string",
          "const": "getAgentCliMetadata"
        },
        "status": {
          "type": "string",
          "const": "available"
        },
        "availability": {
          "type": "string",
          "const": "available"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "contract": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "version",
            "restResource",
            "mcpResource",
            "capabilitiesPath"
          ],
          "properties": {
            "version": {
              "type": "string"
            },
            "restResource": {
              "type": "string",
              "format": "uri"
            },
            "mcpResource": {
              "type": "string",
              "format": "uri"
            },
            "capabilitiesPath": {
              "type": "string"
            }
          }
        },
        "auth": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "scheme",
            "restAudience",
            "mcpAudience",
            "registration"
          ],
          "properties": {
            "scheme": {
              "type": "string",
              "const": "Bearer"
            },
            "restAudience": {
              "type": "string",
              "format": "uri"
            },
            "mcpAudience": {
              "type": "string",
              "format": "uri"
            },
            "registration": {
              "type": "string"
            }
          }
        },
        "distribution": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status",
            "reason",
            "channels"
          ],
          "properties": {
            "status": {
              "type": "string"
            },
            "reason": {
              "type": [
                "string",
                "null"
              ]
            },
            "channels": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "commands": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "runner": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "hmacBoundary"
          ],
          "properties": {
            "hmacBoundary": {
              "type": "string"
            }
          }
        },
        "compatibility": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "electronGateway",
            "mcp"
          ],
          "properties": {
            "electronGateway": {
              "type": "boolean"
            },
            "mcp": {
              "type": "boolean"
            }
          }
        }
      }
    },
    "AgentModelSetRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "model"
      ],
      "properties": {
        "model": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      }
    },
    "AgentModelSetResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "agent"
      ],
      "properties": {
        "agent": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "model",
            "provider"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "model": {
              "type": "string"
            },
            "provider": {
              "type": "string"
            }
          }
        }
      }
    },
    "AgentMailResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ref",
        "state"
      ],
      "properties": {
        "ref": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "companyRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "unreadCount": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        }
      }
    },
    "AgentMailMembershipResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "membershipId",
        "status",
        "company",
        "agent",
        "requestedAt",
        "approvedAt",
        "suspendedAt",
        "leftAt",
        "revokedAt",
        "lastTransitionAt",
        "reason"
      ],
      "properties": {
        "membershipId": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "active",
            "suspended",
            "left",
            "revoked"
          ]
        },
        "company": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "name"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "agent": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string"
            }
          }
        },
        "requestedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "approvedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "suspendedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "leftAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "revokedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastTransitionAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentMailMembershipRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "companyRef"
      ],
      "properties": {
        "companyRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      }
    },
    "AgentMailMembershipJoinRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "membershipId"
      ],
      "properties": {
        "membershipId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      }
    },
    "AgentMailMembershipMutationRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "membershipId"
      ],
      "properties": {
        "membershipId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "reason": {
          "type": "string",
          "maxLength": 512
        }
      }
    },
    "AgentMailMembershipLeaveRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "membershipId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      }
    },
    "AgentMailMembershipResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "membership"
      ],
      "properties": {
        "membership": {
          "$ref": "#/schemas/AgentMailMembershipResource"
        }
      }
    },
    "AgentMailMembershipListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "memberships"
      ],
      "properties": {
        "memberships": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailMembershipResource"
          }
        }
      }
    },
    "AgentMailThreadResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "thread": {
          "$ref": "#/schemas/AgentMailThread"
        },
        "messages": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailMessage"
          },
          "maxItems": 100
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "thread",
        "messages",
        "nextCursor"
      ]
    },
    "AgentMailMessageResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "message",
        "delivery"
      ],
      "properties": {
        "message": {
          "$ref": "#/schemas/AgentMailMessage"
        },
        "delivery": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "recipientCount"
          ],
          "properties": {
            "recipientCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        }
      }
    },
    "AgentMailEventsRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 512
            },
            {
              "type": "null"
            }
          ]
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "waitMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        },
        "wait_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        },
        "threadId": {
          "type": "string",
          "maxLength": 512
        },
        "thread_id": {
          "type": "string",
          "maxLength": 512
        }
      },
      "required": []
    },
    "AgentMailEventsResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "events",
        "nextCursor"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "message"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "message"
              },
              "message": {
                "$ref": "#/schemas/AgentMailMessage"
              }
            }
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentMailThreadSearchRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "query"
      ],
      "properties": {
        "query": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentMailThreadSearchResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "matches": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "threadId": {
                "type": "string"
              },
              "message": {
                "$ref": "#/schemas/AgentMailMessage"
              }
            },
            "required": [
              "threadId",
              "message"
            ]
          },
          "maxItems": 100
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "matches",
        "nextCursor"
      ]
    },
    "AgentMailThreadSummaryRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    },
    "AgentMailThreadSummaryResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "threadId",
        "summary",
        "generatedAt"
      ],
      "properties": {
        "threadId": {
          "type": "string"
        },
        "summary": {
          "type": "string",
          "maxLength": 4096
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AgentMailContactRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "toAgentId"
      ],
      "properties": {
        "toAgentId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      }
    },
    "AgentMailContactResponseRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "decision"
      ],
      "properties": {
        "decision": {
          "type": "string",
          "enum": [
            "accepted",
            "denied"
          ]
        }
      }
    },
    "AgentMailContactResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "contact": {
          "$ref": "#/schemas/AgentMailContact"
        }
      },
      "required": [
        "contact"
      ]
    },
    "AgentMailContactsResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "contacts": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailContact"
          },
          "maxItems": 100
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "contacts",
        "nextCursor"
      ]
    },
    "AgentMailContactPolicyRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "open",
            "approval_required",
            "deny"
          ]
        },
        "allowAgentIds": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string"
          }
        },
        "expectedRevision": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "AgentMailContactPolicyResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "policy": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "open",
                "approval_required",
                "deny"
              ]
            },
            "allowAgentIds": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 100
            },
            "revision": {
              "type": "integer",
              "minimum": 1
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "mode",
            "allowAgentIds",
            "revision",
            "updatedAt"
          ]
        }
      },
      "required": [
        "policy"
      ]
    },
    "AgentMailSectorsResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "sectors": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailSector"
          },
          "maxItems": 100
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "sectors",
        "nextCursor"
      ]
    },
    "AgentMailSectorFeedResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "sector": {
          "$ref": "#/schemas/AgentMailSector"
        },
        "messages": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailMessage"
          },
          "maxItems": 100
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "sector",
        "messages",
        "nextCursor"
      ]
    },
    "AgentMailSectorBroadcastRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "subject",
        "bodyMd"
      ],
      "properties": {
        "subject": {
          "type": "string",
          "maxLength": 512
        },
        "bodyMd": {
          "type": "string",
          "maxLength": 100000
        }
      }
    },
    "AgentMailHandoffRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "subject",
        "summary",
        "subjectRef"
      ],
      "properties": {
        "subject": {
          "type": "string",
          "maxLength": 512
        },
        "summary": {
          "type": "string",
          "maxLength": 8000
        },
        "subjectRef": {
          "type": "string",
          "minLength": 6,
          "maxLength": 256,
          "pattern": "^(task|run|goal):"
        },
        "targetAgentIds": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string"
          }
        },
        "threadId": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentMailHandoffResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "handoff": {
          "$ref": "#/schemas/AgentMailHandoff"
        },
        "message": {
          "$ref": "#/schemas/AgentMailMessage"
        }
      },
      "required": [
        "handoff"
      ]
    },
    "AgentMailTraceRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "traceRef": {
          "type": "string",
          "maxLength": 128
        },
        "trace_id": {
          "type": "string",
          "maxLength": 128
        },
        "runId": {
          "type": "string",
          "maxLength": 256
        },
        "taskId": {
          "type": "string",
          "maxLength": 256
        },
        "goalId": {
          "type": "string",
          "maxLength": 256
        },
        "sessionId": {
          "type": "string",
          "maxLength": 256
        },
        "taskRunId": {
          "type": "string",
          "maxLength": 256
        },
        "agentTurnId": {
          "type": "string",
          "maxLength": 256
        },
        "run_id": {
          "type": "string",
          "maxLength": 256
        },
        "task_id": {
          "type": "string",
          "maxLength": 256
        },
        "goal_id": {
          "type": "string",
          "maxLength": 256
        },
        "session_id": {
          "type": "string",
          "maxLength": 256
        },
        "task_run_id": {
          "type": "string",
          "maxLength": 256
        },
        "agent_turn_id": {
          "type": "string",
          "maxLength": 256
        }
      },
      "required": [],
      "anyOf": [
        {
          "required": [
            "runId"
          ],
          "properties": {
            "runId": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        {
          "required": [
            "taskRunId"
          ],
          "properties": {
            "taskRunId": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        {
          "required": [
            "taskId"
          ],
          "properties": {
            "taskId": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        {
          "required": [
            "goalId"
          ],
          "properties": {
            "goalId": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        {
          "required": [
            "run_id"
          ],
          "properties": {
            "run_id": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        {
          "required": [
            "task_run_id"
          ],
          "properties": {
            "task_run_id": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        {
          "required": [
            "task_id"
          ],
          "properties": {
            "task_id": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        {
          "required": [
            "goal_id"
          ],
          "properties": {
            "goal_id": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      ]
    },
    "AgentMailTraceResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "trace": {
          "$ref": "#/schemas/AgentMailTrace"
        },
        "handoffRef": {
          "type": "string"
        }
      },
      "required": [
        "trace",
        "handoffRef"
      ]
    },
    "AgentMailExportRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        }
      }
    },
    "AgentMailExportResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "exportRef": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "const": "ready"
        },
        "snapshotDigest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "data": {
          "$ref": "#/schemas/AgentMailExportSnapshot"
        }
      },
      "required": [
        "exportRef",
        "status",
        "snapshotDigest",
        "expiresAt",
        "data"
      ]
    },
    "AgentMailErasureRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "confirm": {
          "enum": [
            true,
            "ERASE"
          ]
        }
      },
      "required": [
        "confirm"
      ]
    },
    "AgentMailErasureResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "erasureRef": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "const": "completed"
        },
        "counts": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "messages": {
              "type": "integer",
              "minimum": 0
            },
            "deliveries": {
              "type": "integer",
              "minimum": 0
            },
            "threads": {
              "type": "integer",
              "minimum": 0
            },
            "identities": {
              "type": "integer",
              "minimum": 0
            },
            "memberships": {
              "type": "integer",
              "minimum": 0
            },
            "sectors": {
              "type": "integer",
              "minimum": 0
            },
            "contacts": {
              "type": "integer",
              "minimum": 0
            },
            "handoffs": {
              "type": "integer",
              "minimum": 0
            },
            "traces": {
              "type": "integer",
              "minimum": 0
            },
            "policies": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "messages",
            "deliveries",
            "threads",
            "identities",
            "memberships",
            "sectors",
            "contacts",
            "handoffs",
            "traces",
            "policies"
          ]
        },
        "completedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "erasureRef",
        "status",
        "counts",
        "completedAt"
      ]
    },
    "AgentMailAccessRevocationRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "reason": {
          "type": "string",
          "maxLength": 512
        }
      }
    },
    "AgentMailAccessRevocationResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "revoked",
        "memberships",
        "identities",
        "reason"
      ],
      "properties": {
        "revoked": {
          "type": "boolean",
          "const": true
        },
        "memberships": {
          "type": "integer",
          "minimum": 0
        },
        "identities": {
          "type": "integer",
          "minimum": 0
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "requestAgentMailMembership.request.v1": {
      "$ref": "#/schemas/AgentMailMembershipRequest"
    },
    "requestAgentMailMembership.response.v1": {
      "$ref": "#/schemas/AgentMailMembershipResponse"
    },
    "joinAgentMailMembership.request.v1": {
      "$ref": "#/schemas/AgentMailMembershipJoinRequest"
    },
    "joinAgentMailMembership.response.v1": {
      "$ref": "#/schemas/AgentMailMembershipResponse"
    },
    "getAgentMailMembership.response.v1": {
      "$ref": "#/schemas/AgentMailMembershipListResponse"
    },
    "approveAgentMailMembership.request.v1": {
      "$ref": "#/schemas/AgentMailMembershipMutationRequest"
    },
    "approveAgentMailMembership.response.v1": {
      "$ref": "#/schemas/AgentMailMembershipResponse"
    },
    "suspendAgentMailMembership.request.v1": {
      "$ref": "#/schemas/AgentMailMembershipMutationRequest"
    },
    "suspendAgentMailMembership.response.v1": {
      "$ref": "#/schemas/AgentMailMembershipResponse"
    },
    "leaveAgentMailMembership.request.v1": {
      "$ref": "#/schemas/AgentMailMembershipLeaveRequest"
    },
    "leaveAgentMailMembership.response.v1": {
      "$ref": "#/schemas/AgentMailMembershipResponse"
    },
    "revokeAgentMailMembership.request.v1": {
      "$ref": "#/schemas/AgentMailMembershipMutationRequest"
    },
    "revokeAgentMailMembership.response.v1": {
      "$ref": "#/schemas/AgentMailMembershipResponse"
    },
    "announceAgentMailHandoff.request.v1": {
      "$ref": "#/schemas/AgentMailHandoffRequest"
    },
    "announceAgentMailHandoff.response.v1": {
      "$ref": "#/schemas/AgentMailHandoffResponse"
    },
    "attachAgentMailTrace.request.v1": {
      "$ref": "#/schemas/AgentMailTraceRequest"
    },
    "attachAgentMailTrace.response.v1": {
      "$ref": "#/schemas/AgentMailTraceResponse"
    },
    "broadcastAgentMailSector.request.v1": {
      "$ref": "#/schemas/AgentMailSectorBroadcastRequest"
    },
    "broadcastAgentMailSector.response.v1": {
      "$ref": "#/schemas/AgentMailSectorBroadcastResponse"
    },
    "eraseAgentMailData.request.v1": {
      "$ref": "#/schemas/AgentMailErasureRequest"
    },
    "eraseAgentMailData.response.v1": {
      "$ref": "#/schemas/AgentMailErasureResponse"
    },
    "exportAgentMailData.request.v1": {
      "$ref": "#/schemas/AgentMailExportRequest"
    },
    "exportAgentMailData.response.v1": {
      "$ref": "#/schemas/AgentMailExportResponse"
    },
    "getAgentMailSectorFeed.response.v1": {
      "$ref": "#/schemas/AgentMailSectorFeedResponse"
    },
    "getAgentMailThread.response.v1": {
      "$ref": "#/schemas/AgentMailThreadResponse"
    },
    "listAgentMailContacts.response.v1": {
      "$ref": "#/schemas/AgentMailContactsResponse"
    },
    "listAgentMailSectors.response.v1": {
      "$ref": "#/schemas/AgentMailSectorsResponse"
    },
    "recoverAgentMailEvents.request.v1": {
      "$ref": "#/schemas/AgentMailEventsRequest"
    },
    "recoverAgentMailEvents.response.v1": {
      "$ref": "#/schemas/AgentMailEventsResponse"
    },
    "requestAgentMailContact.request.v1": {
      "$ref": "#/schemas/AgentMailContactRequest"
    },
    "requestAgentMailContact.response.v1": {
      "$ref": "#/schemas/AgentMailContactResponse"
    },
    "respondAgentMailContact.request.v1": {
      "$ref": "#/schemas/AgentMailContactResponseRequest"
    },
    "respondAgentMailContact.response.v1": {
      "$ref": "#/schemas/AgentMailContactResponse"
    },
    "revokeAgentMailAccess.request.v1": {
      "$ref": "#/schemas/AgentMailAccessRevocationRequest"
    },
    "revokeAgentMailAccess.response.v1": {
      "$ref": "#/schemas/AgentMailAccessRevocationResponse"
    },
    "searchAgentMailThreads.request.v1": {
      "$ref": "#/schemas/AgentMailThreadSearchRequest"
    },
    "searchAgentMailThreads.response.v1": {
      "$ref": "#/schemas/AgentMailThreadSearchResponse"
    },
    "setAgentMailContactPolicy.request.v1": {
      "$ref": "#/schemas/AgentMailContactPolicyRequest"
    },
    "setAgentMailContactPolicy.response.v1": {
      "$ref": "#/schemas/AgentMailContactPolicyResponse"
    },
    "summarizeAgentMailThread.request.v1": {
      "$ref": "#/schemas/AgentMailThreadSummaryRequest"
    },
    "summarizeAgentMailThread.response.v1": {
      "$ref": "#/schemas/AgentMailThreadSummaryResponse"
    },
    "waitForAgentMailEvents.request.v1": {
      "$ref": "#/schemas/AgentMailEventsRequest"
    },
    "waitForAgentMailEvents.response.v1": {
      "$ref": "#/schemas/AgentMailWaitEventsResponse"
    },
    "AgentApprovalResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "approvalRef",
        "state",
        "title"
      ],
      "properties": {
        "approvalRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "state": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "denied",
            "expired",
            "auto_executed"
          ]
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "approvalType": {
          "type": "string",
          "enum": [
            "confirm",
            "message_input",
            "toggle",
            "select"
          ]
        },
        "riskLevel": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high",
            "critical"
          ]
        },
        "toolName": {
          "type": "string"
        },
        "toolParams": {},
        "options": {
          "type": "array",
          "items": {}
        },
        "operationId": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "resolvedAt": {
          "type": "string",
          "format": "date-time"
        },
        "resolvedBy": {
          "type": "string",
          "enum": [
            "agent",
            "human"
          ]
        },
        "resolution": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "decision"
          ],
          "properties": {
            "decision": {
              "type": "string",
              "enum": [
                "approved",
                "denied"
              ]
            },
            "message": {
              "type": "string"
            },
            "toggleValue": {
              "type": "boolean"
            },
            "selectedOption": {
              "type": "string"
            }
          }
        }
      }
    },
    "AgentApprovalHandoffResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "handoffRef",
        "approvalRef",
        "status",
        "purpose",
        "audience",
        "authority",
        "expiresAt"
      ],
      "properties": {
        "handoffRef": {
          "type": "string",
          "minLength": 32,
          "maxLength": 128
        },
        "approvalRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "completed",
            "cancelled",
            "expired"
          ]
        },
        "purpose": {
          "type": "string",
          "const": "agent_approval_review"
        },
        "audience": {
          "type": "string",
          "const": "neotask-human-agent-approval-v1"
        },
        "authority": {
          "type": "string",
          "const": "none"
        },
        "handoffUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "reason": {
          "type": "string",
          "maxLength": 1000
        },
        "completedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "cancelledAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentApprovalHandoffCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "reason": {
          "type": "string",
          "maxLength": 1000
        }
      }
    },
    "AgentApprovalHandoffCreateResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "handoff",
        "handoffRef",
        "handoffUrl",
        "authority"
      ],
      "properties": {
        "handoff": {
          "$ref": "#/schemas/AgentApprovalHandoffResource"
        },
        "handoffRef": {
          "type": "string",
          "minLength": 32,
          "maxLength": 128
        },
        "handoffUrl": {
          "type": "string",
          "format": "uri"
        },
        "authority": {
          "type": "string",
          "const": "none"
        }
      }
    },
    "AgentApprovalHandoffStatusResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "handoff",
        "approval",
        "authority"
      ],
      "properties": {
        "handoff": {
          "$ref": "#/schemas/AgentApprovalHandoffResource"
        },
        "approval": {
          "$ref": "#/schemas/AgentApprovalResource"
        },
        "authority": {
          "type": "string",
          "const": "none"
        }
      }
    },
    "AgentApprovalHandoffCancelRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    },
    "AgentApprovalHandoffCancelResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "handoff",
        "authority"
      ],
      "properties": {
        "handoff": {
          "$ref": "#/schemas/AgentApprovalHandoffResource"
        },
        "authority": {
          "type": "string",
          "const": "none"
        },
        "idempotent": {
          "type": "boolean"
        }
      }
    },
    "AgentApprovalEventListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "channel",
        "approvalRef",
        "events",
        "nextCursor",
        "hasMore",
        "retentionFloor",
        "snapshotUrl"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "approvalRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "events": {
          "type": "array",
          "maxItems": 200,
          "items": {
            "$ref": "#/schemas/AgentEventEnvelope"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 1024
        },
        "hasMore": {
          "type": "boolean"
        },
        "retentionFloor": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 1024
        },
        "snapshotUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "AgentApprovalEventStreamResponse": {
      "$ref": "#/schemas/AgentEventEnvelope"
    },
    "AgentPublicArtifactRef": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "href"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "implemented",
            "planned",
            "not_exposed"
          ]
        },
        "href": {
          "type": "string"
        }
      }
    },
    "AgentPublicOperation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operationId",
        "surface",
        "authClass",
        "method",
        "path",
        "routePath",
        "requiredScope",
        "idempotencyRequired",
        "mcpToolName",
        "availabilityPolicy",
        "status",
        "launchState",
        "domain",
        "requiredRolePolicy",
        "approvalClass",
        "approvalMode",
        "billingRequirement",
        "trustRequirement",
        "availability",
        "reason",
        "summary",
        "description",
        "requestSchemaRef",
        "responseSchemaRef",
        "eventChannelRefs",
        "artifactRefs",
        "recommendsPairingFor",
        "rest",
        "mcp",
        "cli"
      ],
      "properties": {
        "operationId": {
          "type": "string"
        },
        "surface": {
          "type": "string",
          "enum": [
            "agent_rest",
            "human_rest"
          ]
        },
        "authClass": {
          "type": "string",
          "enum": [
            "agent_bearer",
            "human_session"
          ]
        },
        "method": {
          "type": "string",
          "enum": [
            "GET",
            "POST",
            "PUT",
            "PATCH",
            "DELETE"
          ]
        },
        "path": {
          "type": "string"
        },
        "routePath": {
          "type": "string"
        },
        "requiredScope": {
          "type": [
            "string",
            "null"
          ]
        },
        "idempotencyRequired": {
          "type": "boolean"
        },
        "mcpToolName": {
          "type": [
            "string",
            "null"
          ]
        },
        "availabilityPolicy": {
          "type": "string",
          "enum": [
            "scope",
            "run_execution",
            "agent_onboarding_read",
            "coordination_mail",
            "autonomy_plan",
            "autonomy_runtime",
            "human_session"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "implemented",
            "planned"
          ]
        },
        "launchState": {
          "type": "string",
          "enum": [
            "feature-gated",
            "sandbox",
            "live"
          ]
        },
        "domain": {
          "type": "string",
          "enum": [
            "account",
            "onboarding",
            "billing",
            "runner",
            "integration",
            "skills",
            "models",
            "chat",
            "cron",
            "task_flow",
            "automation",
            "autonomy",
            "approvals",
            "coordination_mail",
            "mcp",
            "cli"
          ]
        },
        "requiredRolePolicy": {
          "type": [
            "string",
            "null"
          ]
        },
        "approvalClass": {
          "type": "string",
          "enum": [
            "none",
            "policy_eligible",
            "delegate_eligible",
            "human_required"
          ]
        },
        "approvalMode": {
          "type": "string",
          "enum": [
            "none",
            "policy",
            "delegate",
            "relay_only",
            "human"
          ]
        },
        "billingRequirement": {
          "type": "string",
          "enum": [
            "included",
            "claim_required",
            "plan_required",
            "paid_plan"
          ]
        },
        "trustRequirement": {
          "type": "string",
          "enum": [
            "registered",
            "claimed",
            "company_member",
            "human_control",
            "runner_enrolled",
            "account_security"
          ]
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "claim_required",
            "setup_required",
            "approval_required",
            "plan_required",
            "quota_exhausted",
            "model_not_allowed",
            "temporarily_disabled"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "summary": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "requestSchemaRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "responseSchemaRef": {
          "type": "string"
        },
        "eventChannelRefs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "artifactRefs": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "openApi",
            "jsonSchema",
            "arazzo",
            "asyncApi",
            "mcp",
            "cli",
            "markdown"
          ],
          "properties": {
            "openApi": {
              "$ref": "#/schemas/AgentPublicArtifactRef"
            },
            "jsonSchema": {
              "$ref": "#/schemas/AgentPublicArtifactRef"
            },
            "arazzo": {
              "$ref": "#/schemas/AgentPublicArtifactRef"
            },
            "asyncApi": {
              "$ref": "#/schemas/AgentPublicArtifactRef"
            },
            "mcp": {
              "$ref": "#/schemas/AgentPublicArtifactRef"
            },
            "cli": {
              "$ref": "#/schemas/AgentPublicArtifactRef"
            },
            "markdown": {
              "$ref": "#/schemas/AgentPublicArtifactRef"
            }
          }
        },
        "recommendsPairingFor": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "rest": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status",
            "resource"
          ],
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "implemented",
                "planned",
                "not_exposed"
              ]
            },
            "resource": {
              "type": "string"
            },
            "pendingReason": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "mcp": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status",
            "resource",
            "resourceRef",
            "toolName"
          ],
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "implemented",
                "planned",
                "not_exposed"
              ]
            },
            "resource": {
              "type": "string"
            },
            "resourceRef": {
              "type": [
                "string",
                "null"
              ]
            },
            "toolName": {
              "type": [
                "string",
                "null"
              ]
            },
            "pendingReason": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "cli": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status",
            "command",
            "outputSchemaRef"
          ],
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "implemented",
                "planned",
                "not_exposed"
              ]
            },
            "command": {
              "type": [
                "string",
                "null"
              ]
            },
            "outputSchemaRef": {
              "type": "string",
              "const": "AgentCliEnvelope.v1"
            },
            "pendingReason": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      }
    },
    "AgentEventChannel": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "channel",
        "domain",
        "eventTypes",
        "eventSchemaRef",
        "status",
        "launchState",
        "jsonRecoveryPath",
        "ssePath",
        "mcpResource",
        "sourceOfTruth",
        "cursor"
      ],
      "properties": {
        "channel": {
          "type": "string"
        },
        "domain": {
          "type": "string"
        },
        "eventTypes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "eventSchemaRef": {
          "type": "string",
          "const": "AgentEventEnvelope.v1"
        },
        "status": {
          "type": "string",
          "enum": [
            "implemented",
            "planned",
            "not_exposed"
          ]
        },
        "launchState": {
          "type": "string",
          "enum": [
            "feature-gated",
            "sandbox",
            "live"
          ]
        },
        "jsonRecoveryPath": {
          "type": "string"
        },
        "ssePath": {
          "type": "string"
        },
        "mcpResource": {
          "type": [
            "string",
            "null"
          ]
        },
        "sourceOfTruth": {
          "type": "string"
        },
        "cursor": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "replayWindow",
            "deduplicationKey"
          ],
          "properties": {
            "mode": {
              "type": "string",
              "const": "opaque"
            },
            "replayWindow": {
              "type": "string"
            },
            "deduplicationKey": {
              "type": "string"
            }
          }
        }
      }
    },
    "AgentFixtureOperation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operationId",
        "availability",
        "reason",
        "status"
      ],
      "properties": {
        "operationId": {
          "type": "string"
        },
        "availability": {
          "type": "string"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "implemented",
            "planned"
          ]
        }
      }
    },
    "AgentFixtureState": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "fixtureId",
        "principalPhase",
        "grantedScopes",
        "operations"
      ],
      "properties": {
        "fixtureId": {
          "type": "string"
        },
        "principalPhase": {
          "type": "string"
        },
        "grantedScopes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "operations": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentFixtureOperation"
          }
        }
      }
    },
    "AgentAuthFlowRequest.v1": {
      "$ref": "#/schemas/AgentAuthFlowRequest"
    },
    "AgentAuthFlowResponse.v1": {
      "$ref": "#/schemas/AgentAuthFlowResponse"
    },
    "AgentAuthClaimResponse.v1": {
      "$ref": "#/schemas/AgentAuthClaimResponse"
    },
    "AgentAuthRevokeResponse.v1": {
      "$ref": "#/schemas/AgentAuthRevokeResponse"
    },
    "AgentPublicOperation.v1": {
      "$ref": "#/schemas/AgentPublicOperation"
    },
    "AgentEventChannel.v1": {
      "$ref": "#/schemas/AgentEventChannel"
    },
    "AgentFixtureOperation.v1": {
      "$ref": "#/schemas/AgentFixtureOperation"
    },
    "listAgentCompanies.response.v1": {
      "$ref": "#/schemas/AgentCompanyListResponse"
    },
    "getAgentCompany.response.v1": {
      "$ref": "#/schemas/AgentCompanyResponse"
    },
    "listAgentCompanyAgents.response.v1": {
      "$ref": "#/schemas/AgentCompanyAgentListResponse"
    },
    "listAgentCompanyTasks.response.v1": {
      "$ref": "#/schemas/AgentCompanyTaskListResponse"
    },
    "getAgentCompanyTask.response.v1": {
      "$ref": "#/schemas/AgentCompanyTaskResponse"
    },
    "listAgentCompanyRuns.response.v1": {
      "$ref": "#/schemas/AgentCompanyRunListResponse"
    },
    "getAgentCompanyRun.response.v1": {
      "$ref": "#/schemas/AgentCompanyRunResponse"
    },
    "listInsightBoards.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "boards": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "boardId": {
                "type": "string",
                "maxLength": 2000
              },
              "scopeType": {
                "type": "string",
                "enum": [
                  "company",
                  "agent"
                ]
              },
              "scopeId": {
                "type": "string",
                "maxLength": 2000
              },
              "title": {
                "type": "string",
                "maxLength": 2000
              },
              "description": {
                "type": "string",
                "maxLength": 2000
              },
              "currentVersionId": {
                "type": "string",
                "maxLength": 2000
              },
              "publication": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "private_owner",
                      "link_public",
                      "authenticated",
                      "email_list",
                      "organization"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "unpublished",
                      "publishing",
                      "published",
                      "unpublishing",
                      "failed"
                    ]
                  },
                  "generation": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "publishedVersionId": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "publishedAt": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "publishedBy": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "unpublishedAt": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "hipaaDeniedAt": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "lastJobId": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "visibility",
                  "state",
                  "generation"
                ]
              },
              "updatedAt": {
                "type": "string",
                "maxLength": 2000
              },
              "definition": {
                "type": "object",
                "description": "Validated board definition owned by the tenant; secret-like metadata is omitted."
              }
            },
            "required": [
              "boardId",
              "scopeType",
              "scopeId",
              "title",
              "publication"
            ]
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        }
      },
      "required": [
        "boards",
        "nextCursor"
      ]
    },
    "getInsightBoard.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "board": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "boardId": {
              "type": "string",
              "maxLength": 2000
            },
            "scopeType": {
              "type": "string",
              "enum": [
                "company",
                "agent"
              ]
            },
            "scopeId": {
              "type": "string",
              "maxLength": 2000
            },
            "title": {
              "type": "string",
              "maxLength": 2000
            },
            "description": {
              "type": "string",
              "maxLength": 2000
            },
            "currentVersionId": {
              "type": "string",
              "maxLength": 2000
            },
            "publication": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "visibility": {
                  "type": "string",
                  "enum": [
                    "private_owner",
                    "link_public",
                    "authenticated",
                    "email_list",
                    "organization"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "unpublished",
                    "publishing",
                    "published",
                    "unpublishing",
                    "failed"
                  ]
                },
                "generation": {
                  "type": "integer",
                  "minimum": 0
                },
                "publishedVersionId": {
                  "type": "string",
                  "maxLength": 2000
                },
                "publishedAt": {
                  "type": "string",
                  "maxLength": 2000
                },
                "publishedBy": {
                  "type": "string",
                  "maxLength": 2000
                },
                "unpublishedAt": {
                  "type": "string",
                  "maxLength": 2000
                },
                "hipaaDeniedAt": {
                  "type": "string",
                  "maxLength": 2000
                },
                "lastJobId": {
                  "type": "string",
                  "maxLength": 2000
                }
              },
              "required": [
                "visibility",
                "state",
                "generation"
              ]
            },
            "updatedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "definition": {
              "type": "object",
              "description": "Validated board definition owned by the tenant; secret-like metadata is omitted."
            }
          },
          "required": [
            "boardId",
            "scopeType",
            "scopeId",
            "title",
            "publication"
          ]
        }
      },
      "required": [
        "board"
      ]
    },
    "getInsightBoardPublication.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "publication": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "visibility": {
              "type": "string",
              "enum": [
                "private_owner",
                "link_public",
                "authenticated",
                "email_list",
                "organization"
              ]
            },
            "state": {
              "type": "string",
              "enum": [
                "unpublished",
                "publishing",
                "published",
                "unpublishing",
                "failed"
              ]
            },
            "generation": {
              "type": "integer",
              "minimum": 0
            },
            "publishedVersionId": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedBy": {
              "type": "string",
              "maxLength": 2000
            },
            "unpublishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "hipaaDeniedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "lastJobId": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "required": [
            "visibility",
            "state",
            "generation"
          ]
        },
        "link": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "linkId": {
              "type": "string",
              "maxLength": 2000
            },
            "generation": {
              "type": "integer"
            },
            "hostGeneration": {
              "type": "integer"
            },
            "createdAt": {
              "type": "string",
              "maxLength": 2000
            },
            "expiresAt": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            }
          },
          "required": []
        },
        "grants": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "active": {
              "type": "integer"
            }
          },
          "required": [
            "active"
          ]
        },
        "lastJob": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "jobId": {
              "type": "string",
              "maxLength": 2000
            },
            "operation": {
              "type": "string",
              "maxLength": 2000
            },
            "state": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "required": []
        },
        "viewerOrigin": {
          "type": "string",
          "maxLength": 2000
        },
        "viewerPath": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        }
      },
      "required": [
        "publication",
        "link",
        "grants",
        "lastJob",
        "viewerOrigin",
        "viewerPath"
      ]
    },
    "publishInsightBoard.request.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "versionId": {
          "type": "string",
          "description": "Saved version identifier."
        },
        "visibility": {
          "type": "string",
          "enum": [
            "private_owner",
            "link_public",
            "authenticated",
            "email_list",
            "organization"
          ]
        },
        "approvalReference": {
          "type": "string",
          "description": "Human approval bound to public or anyone-signed-in publication."
        }
      },
      "required": []
    },
    "publishInsightBoard.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "replayed": {
          "type": "boolean"
        },
        "noop": {
          "type": "boolean"
        },
        "refreshDeferred": {
          "type": "boolean"
        },
        "jobId": {
          "type": "string",
          "maxLength": 2000
        },
        "publication": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "visibility": {
              "type": "string",
              "enum": [
                "private_owner",
                "link_public",
                "authenticated",
                "email_list",
                "organization"
              ]
            },
            "state": {
              "type": "string",
              "enum": [
                "unpublished",
                "publishing",
                "published",
                "unpublishing",
                "failed"
              ]
            },
            "generation": {
              "type": "integer",
              "minimum": 0
            },
            "publishedVersionId": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedBy": {
              "type": "string",
              "maxLength": 2000
            },
            "unpublishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "hipaaDeniedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "lastJobId": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "required": [
            "visibility",
            "state",
            "generation"
          ]
        },
        "link": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "linkId": {
              "type": "string",
              "maxLength": 2000
            },
            "generation": {
              "type": "integer"
            },
            "hostGeneration": {
              "type": "integer"
            },
            "createdAt": {
              "type": "string",
              "maxLength": 2000
            },
            "expiresAt": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            }
          },
          "required": []
        },
        "secret": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "viewerOrigin": {
          "type": "string",
          "maxLength": 2000
        },
        "viewerPath": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "viewerUrl": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "revokedLinks": {
          "type": "integer"
        }
      },
      "required": [
        "replayed",
        "jobId",
        "publication"
      ]
    },
    "unpublishInsightBoard.request.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {},
      "required": []
    },
    "unpublishInsightBoard.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "replayed": {
          "type": "boolean"
        },
        "noop": {
          "type": "boolean"
        },
        "refreshDeferred": {
          "type": "boolean"
        },
        "jobId": {
          "type": "string",
          "maxLength": 2000
        },
        "publication": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "visibility": {
              "type": "string",
              "enum": [
                "private_owner",
                "link_public",
                "authenticated",
                "email_list",
                "organization"
              ]
            },
            "state": {
              "type": "string",
              "enum": [
                "unpublished",
                "publishing",
                "published",
                "unpublishing",
                "failed"
              ]
            },
            "generation": {
              "type": "integer",
              "minimum": 0
            },
            "publishedVersionId": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedBy": {
              "type": "string",
              "maxLength": 2000
            },
            "unpublishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "hipaaDeniedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "lastJobId": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "required": [
            "visibility",
            "state",
            "generation"
          ]
        },
        "link": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "linkId": {
              "type": "string",
              "maxLength": 2000
            },
            "generation": {
              "type": "integer"
            },
            "hostGeneration": {
              "type": "integer"
            },
            "createdAt": {
              "type": "string",
              "maxLength": 2000
            },
            "expiresAt": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            }
          },
          "required": []
        },
        "secret": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "viewerOrigin": {
          "type": "string",
          "maxLength": 2000
        },
        "viewerPath": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "viewerUrl": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "revokedLinks": {
          "type": "integer"
        }
      },
      "required": [
        "replayed",
        "jobId",
        "publication"
      ]
    },
    "rotateInsightBoardLink.request.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {},
      "required": []
    },
    "rotateInsightBoardLink.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "replayed": {
          "type": "boolean"
        },
        "noop": {
          "type": "boolean"
        },
        "refreshDeferred": {
          "type": "boolean"
        },
        "jobId": {
          "type": "string",
          "maxLength": 2000
        },
        "publication": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "visibility": {
              "type": "string",
              "enum": [
                "private_owner",
                "link_public",
                "authenticated",
                "email_list",
                "organization"
              ]
            },
            "state": {
              "type": "string",
              "enum": [
                "unpublished",
                "publishing",
                "published",
                "unpublishing",
                "failed"
              ]
            },
            "generation": {
              "type": "integer",
              "minimum": 0
            },
            "publishedVersionId": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedBy": {
              "type": "string",
              "maxLength": 2000
            },
            "unpublishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "hipaaDeniedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "lastJobId": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "required": [
            "visibility",
            "state",
            "generation"
          ]
        },
        "link": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "linkId": {
              "type": "string",
              "maxLength": 2000
            },
            "generation": {
              "type": "integer"
            },
            "hostGeneration": {
              "type": "integer"
            },
            "createdAt": {
              "type": "string",
              "maxLength": 2000
            },
            "expiresAt": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            }
          },
          "required": []
        },
        "secret": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "viewerOrigin": {
          "type": "string",
          "maxLength": 2000
        },
        "viewerPath": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "viewerUrl": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "revokedLinks": {
          "type": "integer"
        }
      },
      "required": [
        "replayed",
        "jobId",
        "publication"
      ]
    },
    "setInsightBoardVisibility.request.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "visibility": {
          "type": "string",
          "enum": [
            "private_owner",
            "link_public",
            "authenticated",
            "email_list",
            "organization"
          ]
        },
        "approvalReference": {
          "type": "string",
          "description": "Human approval bound to public or anyone-signed-in visibility."
        }
      },
      "required": [
        "visibility"
      ]
    },
    "setInsightBoardVisibility.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "replayed": {
          "type": "boolean"
        },
        "noop": {
          "type": "boolean"
        },
        "refreshDeferred": {
          "type": "boolean"
        },
        "jobId": {
          "type": "string",
          "maxLength": 2000
        },
        "publication": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "visibility": {
              "type": "string",
              "enum": [
                "private_owner",
                "link_public",
                "authenticated",
                "email_list",
                "organization"
              ]
            },
            "state": {
              "type": "string",
              "enum": [
                "unpublished",
                "publishing",
                "published",
                "unpublishing",
                "failed"
              ]
            },
            "generation": {
              "type": "integer",
              "minimum": 0
            },
            "publishedVersionId": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "publishedBy": {
              "type": "string",
              "maxLength": 2000
            },
            "unpublishedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "hipaaDeniedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "lastJobId": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "required": [
            "visibility",
            "state",
            "generation"
          ]
        },
        "link": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "linkId": {
              "type": "string",
              "maxLength": 2000
            },
            "generation": {
              "type": "integer"
            },
            "hostGeneration": {
              "type": "integer"
            },
            "createdAt": {
              "type": "string",
              "maxLength": 2000
            },
            "expiresAt": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            }
          },
          "required": []
        },
        "secret": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "viewerOrigin": {
          "type": "string",
          "maxLength": 2000
        },
        "viewerPath": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "viewerUrl": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "revokedLinks": {
          "type": "integer"
        }
      },
      "required": [
        "replayed",
        "jobId",
        "publication"
      ]
    },
    "listInsightBoardGrants.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "grants": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "grantId": {
                "type": "string",
                "maxLength": 2000
              },
              "tenantId": {
                "type": "string",
                "maxLength": 2000
              },
              "boardId": {
                "type": "string",
                "maxLength": 2000
              },
              "granteeType": {
                "type": "string",
                "enum": [
                  "email",
                  "user",
                  "organization"
                ]
              },
              "granteeEmail": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 4000
              },
              "granteeEmailHash": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 4000
              },
              "granteeUserId": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 4000
              },
              "granteeOrganizationRef": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "tenantId": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "workosOrgId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 4000
                  }
                },
                "required": []
              },
              "accessLevel": {
                "const": "viewer",
                "type": "string"
              },
              "grantedBy": {
                "type": "string",
                "maxLength": 2000
              },
              "grantedAt": {
                "type": "string",
                "maxLength": 2000
              },
              "revokedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 4000
              },
              "revokedBy": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 4000
              },
              "lastOpenedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 4000
              }
            },
            "required": [
              "grantId",
              "boardId",
              "accessLevel"
            ]
          }
        }
      },
      "required": [
        "grants"
      ]
    },
    "createInsightBoardGrant.request.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "granteeType": {
          "type": "string",
          "enum": [
            "email",
            "user",
            "organization"
          ]
        },
        "granteeEmail": {
          "type": "string",
          "description": "Exact email address."
        },
        "granteeUserId": {
          "type": "string",
          "description": "User identifier."
        },
        "organization": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "tenant_members",
                "workos_org"
              ]
            },
            "workosOrgId": {
              "type": "string",
              "description": "The same tenant WorkOS organization."
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "granteeType"
      ]
    },
    "createInsightBoardGrant.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "replayed": {
          "type": "boolean"
        },
        "refreshDeferred": {
          "type": "boolean"
        },
        "jobId": {
          "type": "string",
          "maxLength": 2000
        },
        "grant": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "grantId": {
              "type": "string",
              "maxLength": 2000
            },
            "tenantId": {
              "type": "string",
              "maxLength": 2000
            },
            "boardId": {
              "type": "string",
              "maxLength": 2000
            },
            "granteeType": {
              "type": "string",
              "enum": [
                "email",
                "user",
                "organization"
              ]
            },
            "granteeEmail": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "granteeEmailHash": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "granteeUserId": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "granteeOrganizationRef": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "type": "string",
                  "maxLength": 2000
                },
                "tenantId": {
                  "type": "string",
                  "maxLength": 2000
                },
                "workosOrgId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 4000
                }
              },
              "required": []
            },
            "accessLevel": {
              "const": "viewer",
              "type": "string"
            },
            "grantedBy": {
              "type": "string",
              "maxLength": 2000
            },
            "grantedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "revokedAt": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "revokedBy": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "lastOpenedAt": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            }
          },
          "required": [
            "grantId",
            "boardId",
            "accessLevel"
          ]
        }
      },
      "required": [
        "replayed",
        "jobId",
        "grant"
      ]
    },
    "revokeInsightBoardGrant.request.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {},
      "required": []
    },
    "revokeInsightBoardGrant.response.v1": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "replayed": {
          "type": "boolean"
        },
        "jobId": {
          "type": "string",
          "maxLength": 2000
        },
        "grant": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "grantId": {
              "type": "string",
              "maxLength": 2000
            },
            "tenantId": {
              "type": "string",
              "maxLength": 2000
            },
            "boardId": {
              "type": "string",
              "maxLength": 2000
            },
            "granteeType": {
              "type": "string",
              "enum": [
                "email",
                "user",
                "organization"
              ]
            },
            "granteeEmail": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "granteeEmailHash": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "granteeUserId": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "granteeOrganizationRef": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "type": "string",
                  "maxLength": 2000
                },
                "tenantId": {
                  "type": "string",
                  "maxLength": 2000
                },
                "workosOrgId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 4000
                }
              },
              "required": []
            },
            "accessLevel": {
              "const": "viewer",
              "type": "string"
            },
            "grantedBy": {
              "type": "string",
              "maxLength": 2000
            },
            "grantedAt": {
              "type": "string",
              "maxLength": 2000
            },
            "revokedAt": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "revokedBy": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            },
            "lastOpenedAt": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4000
            }
          },
          "required": [
            "grantId",
            "boardId",
            "accessLevel"
          ]
        }
      },
      "required": [
        "replayed",
        "jobId",
        "grant"
      ]
    },
    "getAgentProfile.response.v1": {
      "$ref": "#/schemas/AgentProfileResponse"
    },
    "getAgentCapabilities.response.v1": {
      "$ref": "#/schemas/AgentCapabilitySnapshot"
    },
    "getAgentOnboarding.response.v1": {
      "$ref": "#/schemas/AgentOnboardingResponse"
    },
    "listAgents.response.v1": {
      "$ref": "#/schemas/AgentListResponse"
    },
    "createAgent.request.v1": {
      "$ref": "#/schemas/AgentCreateRequest"
    },
    "createAgent.response.v1": {
      "$ref": "#/schemas/AgentCreateResponse"
    },
    "getAgent.response.v1": {
      "$ref": "#/schemas/ManagedAgentResponse"
    },
    "updateAgent.request.v1": {
      "$ref": "#/schemas/ManagedAgentUpdateRequest"
    },
    "updateAgent.response.v1": {
      "$ref": "#/schemas/ManagedAgentResponse"
    },
    "archiveAgent.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "archiveAgent.response.v1": {
      "$ref": "#/schemas/ManagedAgentResponse"
    },
    "restoreAgent.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "restoreAgent.response.v1": {
      "$ref": "#/schemas/ManagedAgentResponse"
    },
    "getAgentEffectiveTools.response.v1": {
      "$ref": "#/schemas/AgentEffectiveToolsResponse"
    },
    "getAgentToolPolicy.response.v1": {
      "$ref": "#/schemas/AgentToolPolicyResponse"
    },
    "updateAgentToolPolicy.request.v1": {
      "$ref": "#/schemas/AgentToolPolicyUpdateRequest"
    },
    "updateAgentToolPolicy.response.v1": {
      "$ref": "#/schemas/AgentToolPolicyResponse"
    },
    "listAgentConversations.response.v1": {
      "$ref": "#/schemas/AgentConversationListResponse"
    },
    "createAgentConversation.request.v1": {
      "$ref": "#/schemas/AgentConversationCreateRequest"
    },
    "createAgentConversation.response.v1": {
      "$ref": "#/schemas/AgentConversationResponse"
    },
    "getAgentConversation.response.v1": {
      "$ref": "#/schemas/AgentConversationResponse"
    },
    "archiveAgentConversation.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "archiveAgentConversation.response.v1": {
      "$ref": "#/schemas/AgentConversationResponse"
    },
    "restoreAgentConversation.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "restoreAgentConversation.response.v1": {
      "$ref": "#/schemas/AgentConversationResponse"
    },
    "listAgentConversationMessages.response.v1": {
      "$ref": "#/schemas/AgentConversationMessageListResponse"
    },
    "createAgentConversationTurn.request.v1": {
      "$ref": "#/schemas/AgentConversationTurnCreateRequest"
    },
    "createAgentConversationTurn.response.v1": {
      "$ref": "#/schemas/AgentConversationTurnResponse"
    },
    "getAgentConversationTurn.response.v1": {
      "$ref": "#/schemas/AgentConversationTurnResponse"
    },
    "cancelAgentConversationTurn.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "cancelAgentConversationTurn.response.v1": {
      "$ref": "#/schemas/AgentConversationTurnResponse"
    },
    "listAgentConversationTurnEvents.response.v1": {
      "$ref": "#/schemas/AgentEventListResponse"
    },
    "streamAgentConversationTurnEvents.response.v1": {
      "$ref": "#/schemas/AgentEventEnvelope"
    },
    "listTasks.response.v1": {
      "$ref": "#/schemas/TaskListResponse"
    },
    "createTask.request.v1": {
      "$ref": "#/schemas/TaskCreateRequest"
    },
    "createTask.response.v1": {
      "$ref": "#/schemas/TaskCreateResponse"
    },
    "listAgentCronJobs.response.v1": {
      "$ref": "#/schemas/AgentCronJobListResponse"
    },
    "createAgentCronJob.request.v1": {
      "$ref": "#/schemas/AgentCronJobCreateRequest"
    },
    "createAgentCronJob.response.v1": {
      "$ref": "#/schemas/AgentCronJobResponse"
    },
    "getAgentCronJob.response.v1": {
      "$ref": "#/schemas/AgentCronJobResponse"
    },
    "updateAgentCronJob.request.v1": {
      "$ref": "#/schemas/AgentCronJobUpdateRequest"
    },
    "updateAgentCronJob.response.v1": {
      "$ref": "#/schemas/AgentCronJobResponse"
    },
    "enableAgentCronJob.request.v1": {
      "$ref": "#/schemas/AgentCronJobEnableRequest"
    },
    "enableAgentCronJob.response.v1": {
      "$ref": "#/schemas/AgentCronJobResponse"
    },
    "disableAgentCronJob.request.v1": {
      "$ref": "#/schemas/AgentCronJobDisableRequest"
    },
    "disableAgentCronJob.response.v1": {
      "$ref": "#/schemas/AgentCronJobResponse"
    },
    "runAgentCronJob.request.v1": {
      "$ref": "#/schemas/AgentCronRunRequest"
    },
    "runAgentCronJob.response.v1": {
      "$ref": "#/schemas/AgentCronRunResponse"
    },
    "listAgentCronJobRuns.response.v1": {
      "$ref": "#/schemas/AgentCronRunListResponse"
    },
    "deleteAgentCronJob.request.v1": {
      "$ref": "#/schemas/AgentCronJobDeleteRequest"
    },
    "deleteAgentCronJob.response.v1": {
      "$ref": "#/schemas/AgentCronJobDeleteResponse"
    },
    "listAgentAutomationCatalog.response.v1": {
      "$ref": "#/schemas/AgentAutomationCatalogResponse"
    },
    "listAgentAutomations.response.v1": {
      "$ref": "#/schemas/AgentAutomationListResponse"
    },
    "createAgentAutomation.request.v1": {
      "$ref": "#/schemas/AgentAutomationCreateRequest"
    },
    "createAgentAutomation.response.v1": {
      "$ref": "#/schemas/AgentAutomationResponse"
    },
    "getAgentAutomation.response.v1": {
      "$ref": "#/schemas/AgentAutomationResponse"
    },
    "updateAgentAutomation.request.v1": {
      "$ref": "#/schemas/AgentAutomationUpdateRequest"
    },
    "updateAgentAutomation.response.v1": {
      "$ref": "#/schemas/AgentAutomationResponse"
    },
    "deleteAgentAutomation.request.v1": {
      "$ref": "#/schemas/AgentAutomationRevisionRequest"
    },
    "deleteAgentAutomation.response.v1": {
      "$ref": "#/schemas/AgentAutomationMutationResponse"
    },
    "startAgentAutomation.request.v1": {
      "$ref": "#/schemas/AgentAutomationStartRequest"
    },
    "startAgentAutomation.response.v1": {
      "$ref": "#/schemas/AgentAutomationStartResponse"
    },
    "getAgentAutomationStatus.response.v1": {
      "$ref": "#/schemas/AgentAutomationStatusResponse"
    },
    "pauseAgentAutomation.request.v1": {
      "$ref": "#/schemas/AgentAutomationRevisionRequest"
    },
    "pauseAgentAutomation.response.v1": {
      "$ref": "#/schemas/AgentAutomationMutationResponse"
    },
    "resumeAgentAutomation.request.v1": {
      "$ref": "#/schemas/AgentAutomationRevisionRequest"
    },
    "resumeAgentAutomation.response.v1": {
      "$ref": "#/schemas/AgentAutomationMutationResponse"
    },
    "cancelAgentAutomation.request.v1": {
      "$ref": "#/schemas/AgentAutomationRevisionRequest"
    },
    "cancelAgentAutomation.response.v1": {
      "$ref": "#/schemas/AgentAutomationCancelResponse"
    },
    "listAgentAutomationRuns.response.v1": {
      "$ref": "#/schemas/AgentAutomationRunListResponse"
    },
    "getRun.response.v1": {
      "$ref": "#/schemas/RunResponse"
    },
    "createRun.request.v1": {
      "$ref": "#/schemas/RunCreateRequest"
    },
    "createRun.response.v1": {
      "$ref": "#/schemas/RunCreateResponse"
    },
    "listAgentRunEvents.response.v1": {
      "$ref": "#/schemas/AgentEventListResponse"
    },
    "streamAgentRunEvents.response.v1": {
      "$ref": "#/schemas/AgentEventEnvelope"
    },
    "listAgentAutonomyGoals.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalListResponse"
    },
    "createAgentAutonomyGoal.request.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalCreateRequest"
    },
    "createAgentAutonomyGoal.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalResponse"
    },
    "getAgentAutonomyGoal.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalResponse"
    },
    "updateAgentAutonomyGoal.request.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalUpdateRequest"
    },
    "updateAgentAutonomyGoal.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalResponse"
    },
    "startAgentAutonomyGoal.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "startAgentAutonomyGoal.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalStartResponse"
    },
    "getAgentAutonomyGoalStatus.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalStatusResponse"
    },
    "steerAgentAutonomyGoal.request.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalSteerRequest"
    },
    "steerAgentAutonomyGoal.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalSteerResponse"
    },
    "pauseAgentAutonomyGoal.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "pauseAgentAutonomyGoal.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalResponse"
    },
    "resumeAgentAutonomyGoal.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "resumeAgentAutonomyGoal.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalResponse"
    },
    "cancelAgentAutonomyGoal.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "cancelAgentAutonomyGoal.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalCancelResponse"
    },
    "listAgentAutonomyGoalRuns.response.v1": {
      "$ref": "#/schemas/AgentAutonomyGoalRunListResponse"
    },
    "listAgentApprovals.response.v1": {
      "$ref": "#/schemas/AgentApprovalListResponse"
    },
    "getAgentApproval.response.v1": {
      "$ref": "#/schemas/AgentApprovalResponse"
    },
    "createAgentApprovalHandoff.request.v1": {
      "$ref": "#/schemas/AgentApprovalHandoffCreateRequest"
    },
    "createAgentApprovalHandoff.response.v1": {
      "$ref": "#/schemas/AgentApprovalHandoffCreateResponse"
    },
    "getAgentApprovalHandoff.response.v1": {
      "$ref": "#/schemas/AgentApprovalHandoffStatusResponse"
    },
    "cancelAgentApprovalHandoff.request.v1": {
      "$ref": "#/schemas/AgentApprovalHandoffCancelRequest"
    },
    "cancelAgentApprovalHandoff.response.v1": {
      "$ref": "#/schemas/AgentApprovalHandoffCancelResponse"
    },
    "listAgentApprovalEvents.response.v1": {
      "$ref": "#/schemas/AgentApprovalEventListResponse"
    },
    "streamAgentApprovalEvents.response.v1": {
      "$ref": "#/schemas/AgentApprovalEventStreamResponse"
    },
    "getEffectiveAgentApprovalPolicy.response.v1": {
      "$ref": "#/schemas/AgentApprovalPolicyResponse"
    },
    "createAgentApprovalSettingsHandoff.request.v1": {
      "$ref": "#/schemas/AgentApprovalSettingsHandoffRequest"
    },
    "createAgentApprovalSettingsHandoff.response.v1": {
      "$ref": "#/schemas/AgentApprovalSettingsHandoffResponse"
    },
    "getAgentApprovalSettingsHandoff.response.v1": {
      "$ref": "#/schemas/AgentApprovalSettingsHandoffResponse"
    },
    "cancelAgentApprovalSettingsHandoff.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "cancelAgentApprovalSettingsHandoff.response.v1": {
      "$ref": "#/schemas/AgentApprovalSettingsHandoffResponse"
    },
    "decideAgentApproval.request.v1": {
      "$ref": "#/schemas/AgentApprovalDecisionRequest"
    },
    "decideAgentApproval.response.v1": {
      "$ref": "#/schemas/AgentApprovalDecisionResponse"
    },
    "getUsage.response.v1": {
      "$ref": "#/schemas/UsageResponse"
    },
    "listAgentSkills.response.v1": {
      "$ref": "#/schemas/AgentSkillsResponse"
    },
    "listDesktopDownloadOptions.response.v1": {
      "$ref": "#/schemas/DesktopDownloadOptionsResponse"
    },
    "requestAgentSkillConfiguration.request.v1": {
      "$ref": "#/schemas/AgentSkillConfigurationRequest"
    },
    "requestAgentSkillConfiguration.response.v1": {
      "$ref": "#/schemas/AgentSkillConfigurationResponse"
    },
    "getAgentMcpCatalog.response.v1": {
      "$ref": "#/schemas/AgentMcpCatalogResponse"
    },
    "getAgentCliMetadata.response.v1": {
      "$ref": "#/schemas/AgentCliMetadataResponse"
    },
    "listAgentModels.response.v1": {
      "$ref": "#/schemas/AgentModelsResponse"
    },
    "setAgentModel.request.v1": {
      "$ref": "#/schemas/AgentModelSetRequest"
    },
    "setAgentModel.response.v1": {
      "$ref": "#/schemas/AgentModelSetResponse"
    },
    "getAgentMailCapabilities.response.v1": {
      "$ref": "#/schemas/AgentMailCapabilitiesResponse"
    },
    "listAgentMailIdentities.response.v1": {
      "$ref": "#/schemas/AgentMailIdentityListResponse"
    },
    "getAgentMailIdentity.response.v1": {
      "$ref": "#/schemas/AgentMailIdentityResponse"
    },
    "listAgentMailPeers.response.v1": {
      "$ref": "#/schemas/AgentMailPeerListResponse"
    },
    "getAgentMailPeer.response.v1": {
      "$ref": "#/schemas/AgentMailPeerResponse"
    },
    "sendAgentMailMessage.request.v1": {
      "$ref": "#/schemas/AgentMailMessageCreateRequest"
    },
    "sendAgentMailMessage.response.v1": {
      "$ref": "#/schemas/AgentMailMessageResponse"
    },
    "replyAgentMailMessage.request.v1": {
      "$ref": "#/schemas/AgentMailReplyRequest"
    },
    "replyAgentMailMessage.response.v1": {
      "$ref": "#/schemas/AgentMailMessageResponse"
    },
    "listAgentMailInbox.response.v1": {
      "$ref": "#/schemas/AgentMailInboxResponse"
    },
    "getAgentMailEvents.response.v1": {
      "$ref": "#/schemas/AgentMailEventsResponse"
    },
    "getAgentMailDelivery.response.v1": {
      "$ref": "#/schemas/AgentMailDeliveryResponse"
    },
    "acknowledgeAgentMailDelivery.request.v1": {
      "$ref": "#/schemas/AgentMailEmptyMutationRequest"
    },
    "acknowledgeAgentMailDelivery.response.v1": {
      "$ref": "#/schemas/AgentMailDeliveryMutationResponse"
    },
    "markAgentMailRead.request.v1": {
      "$ref": "#/schemas/AgentMailEmptyMutationRequest"
    },
    "markAgentMailRead.response.v1": {
      "$ref": "#/schemas/AgentMailDeliveryMutationResponse"
    },
    "revokeAgentRegistration.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "revokeAgentRegistration.response.v1": {
      "$ref": "#/schemas/RegistrationRevocationResponse"
    },
    "createAgentAccountPairingHandoff.request.v1": {
      "$ref": "#/schemas/AgentAccountPairingHandoffCreateRequest"
    },
    "createAgentAccountPairingHandoff.response.v1": {
      "$ref": "#/schemas/AgentAccountPairingHandoffCreateResponse"
    },
    "requestAgentCheckoutHandoff.request.v1": {
      "$ref": "#/schemas/AgentCheckoutHandoffRequest"
    },
    "requestAgentCheckoutHandoff.response.v1": {
      "$ref": "#/schemas/AgentPlanRequiredResponse"
    },
    "getAgentAccountPairingHandoff.response.v1": {
      "$ref": "#/schemas/AgentAccountPairingHandoffStatusResponse"
    },
    "cancelAgentAccountPairingHandoff.request.v1": {
      "$ref": "#/schemas/AgentAccountPairingHandoffCancelRequest"
    },
    "cancelAgentAccountPairingHandoff.response.v1": {
      "$ref": "#/schemas/AgentAccountPairingHandoffStatusResponse"
    },
    "createRunnerEnrollment.request.v1": {
      "$ref": "#/schemas/AgentRunnerEnrollmentRequest"
    },
    "createRunnerEnrollment.response.v1": {
      "$ref": "#/schemas/AgentRunnerEnrollmentResponse"
    },
    "listAgentRunners.response.v1": {
      "$ref": "#/schemas/AgentRunnerListResponse"
    },
    "rotateAgentRunner.request.v1": {
      "$ref": "#/schemas/AgentRunnerRotateRequest"
    },
    "rotateAgentRunner.response.v1": {
      "$ref": "#/schemas/AgentRunnerResponse"
    },
    "revokeAgentRunner.request.v1": {
      "$ref": "#/schemas/AgentRunnerRevokeRequest"
    },
    "revokeAgentRunner.response.v1": {
      "$ref": "#/schemas/AgentRunnerResponse"
    },
    "listAgentIntegrationCatalog.response.v1": {
      "$ref": "#/schemas/AgentIntegrationCatalogResponse"
    },
    "listAgentIntegrationConnections.response.v1": {
      "$ref": "#/schemas/AgentIntegrationConnectionsResponse"
    },
    "createAgentIntegrationAttempt.request.v1": {
      "$ref": "#/schemas/AgentIntegrationAttemptCreateRequest"
    },
    "createAgentIntegrationAttempt.response.v1": {
      "$ref": "#/schemas/AgentIntegrationAttemptResponse"
    },
    "getAgentIntegrationAttempt.response.v1": {
      "$ref": "#/schemas/AgentIntegrationAttemptResponse"
    },
    "cancelAgentIntegrationAttempt.request.v1": {
      "$ref": "#/schemas/AgentIntegrationAttemptCancelRequest"
    },
    "cancelAgentIntegrationAttempt.response.v1": {
      "$ref": "#/schemas/AgentIntegrationAttemptResponse"
    },
    "attachAgentIntegration.request.v1": {
      "$ref": "#/schemas/AgentIntegrationAttachRequest"
    },
    "attachAgentIntegration.response.v1": {
      "$ref": "#/schemas/AgentIntegrationConnectionResponse"
    },
    "detachAgentIntegration.request.v1": {
      "$ref": "#/schemas/AgentIntegrationDetachRequest"
    },
    "detachAgentIntegration.response.v1": {
      "$ref": "#/schemas/AgentIntegrationConnectionResponse"
    },
    "revokeAgentIntegration.request.v1": {
      "$ref": "#/schemas/AgentIntegrationRevokeRequest"
    },
    "revokeAgentIntegration.response.v1": {
      "$ref": "#/schemas/AgentIntegrationRevokeResponse"
    },
    "searchConstructPackages.response.v1": {
      "$ref": "#/schemas/ConstructPackageSearchResponse"
    },
    "getConstructPackage.response.v1": {
      "$ref": "#/schemas/ConstructPackageDetailResponse"
    },
    "listConstructPackageVersions.response.v1": {
      "$ref": "#/schemas/ConstructReleaseListResponse"
    },
    "getConstructReleaseReadiness.response.v1": {
      "$ref": "#/schemas/ConstructReleaseReadinessReport"
    },
    "matchConstructContent.response.v1": {
      "$ref": "#/schemas/ConstructContentMatchResponse"
    },
    "resolveConstructArtifact.response.v1": {
      "$ref": "#/schemas/ConstructResolveResponse"
    },
    "getConstructGrantManifest.response.v1": {
      "$ref": "#/schemas/ConstructSignedGrantManifestEnvelope"
    },
    "reportConstructInstall.request.v1": {
      "$ref": "#/schemas/ConstructInstallReport"
    },
    "reportConstructInstall.response.v1": {
      "$ref": "#/schemas/ConstructInstallReportResponse"
    },
    "reportConstructPackage.request.v1": {
      "type": "object",
      "properties": {
        "package": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "reason": {
          "type": "string",
          "enum": [
            "malware",
            "security",
            "credential_theft",
            "impersonation",
            "spam",
            "license",
            "broken",
            "other"
          ]
        },
        "details": {
          "type": "string",
          "maxLength": 4000
        }
      },
      "required": [
        "package",
        "reason",
        "details"
      ],
      "additionalProperties": false
    },
    "reportConstructPackage.response.v1": {
      "$ref": "#/schemas/ConstructReportResponse"
    },
    "getHumanAgentIntegrationCredentialHandoff.response.v1": {
      "$ref": "#/schemas/HumanAgentIntegrationCredentialHandoff"
    },
    "completeHumanAgentIntegrationCredentialHandoff.request.v1": {
      "$ref": "#/schemas/HumanAgentIntegrationCredentialRequest"
    },
    "completeHumanAgentIntegrationCredentialHandoff.response.v1": {
      "$ref": "#/schemas/HumanAgentIntegrationCredentialHandoff"
    },
    "getHumanAgentAccountPairingHandoff.response.v1": {
      "$ref": "#/schemas/HumanAgentAccountPairingHandoff"
    },
    "confirmHumanAgentAccountPairingHandoff.request.v1": {
      "$ref": "#/schemas/HumanAgentAccountPairingConfirmRequest"
    },
    "confirmHumanAgentAccountPairingHandoff.response.v1": {
      "$ref": "#/schemas/HumanAgentAccountPairingConfirmResponse"
    },
    "listHumanAgentRegistrations.response.v1": {
      "$ref": "#/schemas/HumanAgentRegistrationListResponse"
    },
    "updateHumanAgentRegistrationLabel.request.v1": {
      "$ref": "#/schemas/HumanAgentSecurityLabelRequest"
    },
    "updateHumanAgentRegistrationLabel.response.v1": {
      "$ref": "#/schemas/HumanAgentRegistrationResponse"
    },
    "revokeHumanAgentRegistration.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "revokeHumanAgentRegistration.response.v1": {
      "$ref": "#/schemas/HumanAgentRegistrationRevokeResponse"
    },
    "listHumanAgentRunners.response.v1": {
      "$ref": "#/schemas/HumanAgentRunnerListResponse"
    },
    "inspectHumanRunnerEnrollmentReview.response.v1": {
      "$ref": "#/schemas/HumanRunnerEnrollmentReview"
    },
    "resolveHumanRunnerEnrollmentReview.request.v1": {
      "$ref": "#/schemas/HumanRunnerEnrollmentDecisionRequest"
    },
    "resolveHumanRunnerEnrollmentReview.response.v1": {
      "$ref": "#/schemas/HumanRunnerEnrollmentReview"
    },
    "inspectHumanAgentClaimMove.response.v1": {
      "$ref": "#/schemas/HumanAgentClaimMove"
    },
    "resolveHumanAgentClaimMove.request.v1": {
      "$ref": "#/schemas/HumanAgentClaimMoveDecisionRequest"
    },
    "resolveHumanAgentClaimMove.response.v1": {
      "$ref": "#/schemas/HumanAgentClaimMove"
    },
    "updateHumanAgentRunnerLabel.request.v1": {
      "$ref": "#/schemas/HumanAgentSecurityLabelRequest"
    },
    "updateHumanAgentRunnerLabel.response.v1": {
      "$ref": "#/schemas/HumanAgentRunnerResponse"
    },
    "rotateHumanAgentRunner.request.v1": {
      "$ref": "#/schemas/HumanAgentRunnerRotateRequest"
    },
    "rotateHumanAgentRunner.response.v1": {
      "$ref": "#/schemas/HumanAgentRunnerResponse"
    },
    "revokeHumanAgentRunner.request.v1": {
      "$ref": "#/schemas/AgentRunnerRevokeRequest"
    },
    "revokeHumanAgentRunner.response.v1": {
      "$ref": "#/schemas/HumanAgentRunnerResponse"
    },
    "cancelHumanAgentApprovalSettingsHandoff.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalSettingsCancellationResponse"
    },
    "prepareHumanAgentApprovalReview.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalPreparedReviewResponse"
    },
    "getHumanAgentApprovalReview.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalReviewResponse"
    },
    "decideHumanAgentApprovalReview.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalReviewResponse"
    },
    "getHumanAgentApprovalSettings.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalSettingsResponse"
    },
    "updateHumanAgentApprovalSettings.request.v1": {
      "$ref": "#/schemas/HumanAgentApprovalSettingsUpdateRequest"
    },
    "updateHumanAgentApprovalSettings.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalSettingsUpdateResponse"
    },
    "listHumanAgentApprovalDelegations.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalDelegationListResponse"
    },
    "createHumanAgentApprovalDelegation.request.v1": {
      "$ref": "#/schemas/HumanAgentApprovalDelegationCreateRequest"
    },
    "createHumanAgentApprovalDelegation.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalDelegationCreateResponse"
    },
    "getHumanAgentApprovalDelegation.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalDelegationResponse"
    },
    "revokeHumanAgentApprovalDelegation.request.v1": {
      "$ref": "#/schemas/HumanAgentApprovalDelegationRevokeRequest"
    },
    "revokeHumanAgentApprovalDelegation.response.v1": {
      "$ref": "#/schemas/HumanAgentApprovalDelegationRevokeResponse"
    },
    "AgentPrincipal": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "registrationId",
        "identityMode",
        "trustLevel",
        "authorityPhase",
        "role",
        "credential"
      ],
      "properties": {
        "registrationId": {
          "type": "string"
        },
        "identityMode": {
          "type": "string",
          "enum": [
            "service_auth",
            "anonymous"
          ]
        },
        "trustLevel": {
          "type": "string",
          "enum": [
            "trusted",
            "untrusted"
          ]
        },
        "authorityPhase": {
          "type": "string",
          "enum": [
            "claimed",
            "pre_claim"
          ]
        },
        "role": {
          "type": "string"
        },
        "credential": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "issuedAt",
            "expiresAt"
          ],
          "properties": {
            "issuedAt": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAt": {
              "type": "integer",
              "minimum": 0
            }
          }
        }
      }
    },
    "AgentAccount": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "tenantId",
        "userId",
        "name",
        "status",
        "keyMode"
      ],
      "properties": {
        "tenantId": {
          "type": "string"
        },
        "userId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "keyMode": {
          "type": "string"
        }
      }
    },
    "AgentPlan": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "displayName",
        "features",
        "limits",
        "models"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "features": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "limits": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "maxAgents",
            "maxChannels",
            "maxDevices",
            "maxRequestsPerMinute",
            "maxPromptBytes",
            "messageLimit",
            "usedMessages",
            "remainingMessages",
            "historyDays",
            "maxCompanies"
          ],
          "properties": {
            "maxAgents": {
              "type": [
                "integer",
                "null"
              ]
            },
            "maxChannels": {
              "type": [
                "integer",
                "null"
              ]
            },
            "maxDevices": {
              "type": "integer",
              "minimum": 0
            },
            "maxRequestsPerMinute": {
              "type": "integer",
              "minimum": 0
            },
            "maxPromptBytes": {
              "type": "integer",
              "minimum": 0
            },
            "messageLimit": {
              "type": [
                "integer",
                "null"
              ]
            },
            "usedMessages": {
              "type": "integer",
              "minimum": 0
            },
            "remainingMessages": {
              "type": [
                "integer",
                "null"
              ]
            },
            "messageQuota": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "phase",
                "limit",
                "used",
                "remaining",
                "resetAt",
                "timezone",
                "introUsed",
                "introLimit",
                "dailyUsed",
                "dailyLimit",
                "totalMessages"
              ],
              "properties": {
                "phase": {
                  "type": "string",
                  "enum": [
                    "intro_lifetime",
                    "daily"
                  ]
                },
                "limit": {
                  "type": "integer",
                  "minimum": 0
                },
                "used": {
                  "type": "integer",
                  "minimum": 0
                },
                "remaining": {
                  "type": "integer",
                  "minimum": 0
                },
                "resetAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "timezone": {
                  "type": "string"
                },
                "introUsed": {
                  "type": "integer",
                  "minimum": 0
                },
                "introLimit": {
                  "type": "integer",
                  "minimum": 0
                },
                "dailyUsed": {
                  "type": "integer",
                  "minimum": 0
                },
                "dailyLimit": {
                  "type": "integer",
                  "minimum": 0
                },
                "totalMessages": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "historyDays": {
              "type": [
                "integer",
                "null"
              ]
            },
            "maxCompanies": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        },
        "models": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "tier",
            "allowed"
          ],
          "properties": {
            "tier": {
              "type": "string",
              "enum": [
                "basic",
                "standard",
                "premium"
              ]
            },
            "allowed": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            }
          }
        }
      }
    },
    "AgentCapabilityState": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "availability",
        "available",
        "reason"
      ],
      "properties": {
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "claim_required",
            "setup_required",
            "approval_required",
            "plan_required",
            "quota_exhausted",
            "model_not_allowed",
            "temporarily_disabled"
          ]
        },
        "available": {
          "type": "boolean"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "requiredScope": {
          "type": "string"
        },
        "requiredFeature": {
          "type": "string"
        },
        "upgrade": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "required",
            "checkoutUrl"
          ],
          "properties": {
            "required": {
              "type": "boolean"
            },
            "checkoutUrl": {
              "type": [
                "string",
                "null"
              ],
              "format": "uri"
            }
          }
        }
      }
    },
    "AgentEffectiveOperation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operationId",
        "method",
        "path",
        "requiredScope",
        "scopeGranted",
        "availability",
        "reason",
        "idempotencyRequired"
      ],
      "properties": {
        "operationId": {
          "type": "string",
          "enum": [
            "listAgentCompanies",
            "getAgentCompany",
            "listAgentCompanyAgents",
            "listAgentCompanyTasks",
            "getAgentCompanyTask",
            "listAgentCompanyRuns",
            "getAgentCompanyRun",
            "listInsightBoards",
            "getInsightBoard",
            "getInsightBoardPublication",
            "publishInsightBoard",
            "unpublishInsightBoard",
            "rotateInsightBoardLink",
            "setInsightBoardVisibility",
            "listInsightBoardGrants",
            "createInsightBoardGrant",
            "revokeInsightBoardGrant",
            "getAgentProfile",
            "getAgentCapabilities",
            "getAgentOnboarding",
            "listAgents",
            "createAgent",
            "getAgent",
            "updateAgent",
            "archiveAgent",
            "restoreAgent",
            "getAgentEffectiveTools",
            "getAgentToolPolicy",
            "updateAgentToolPolicy",
            "listAgentConversations",
            "createAgentConversation",
            "getAgentConversation",
            "archiveAgentConversation",
            "restoreAgentConversation",
            "listAgentConversationMessages",
            "createAgentConversationTurn",
            "getAgentConversationTurn",
            "cancelAgentConversationTurn",
            "listAgentConversationTurnEvents",
            "streamAgentConversationTurnEvents",
            "listTasks",
            "createTask",
            "listAgentCronJobs",
            "createAgentCronJob",
            "getAgentCronJob",
            "updateAgentCronJob",
            "enableAgentCronJob",
            "disableAgentCronJob",
            "runAgentCronJob",
            "listAgentCronJobRuns",
            "deleteAgentCronJob",
            "listAgentAutomationCatalog",
            "listAgentAutomations",
            "createAgentAutomation",
            "getAgentAutomation",
            "updateAgentAutomation",
            "deleteAgentAutomation",
            "startAgentAutomation",
            "getAgentAutomationStatus",
            "pauseAgentAutomation",
            "resumeAgentAutomation",
            "cancelAgentAutomation",
            "listAgentAutomationRuns",
            "getRun",
            "createRun",
            "listAgentRunEvents",
            "streamAgentRunEvents",
            "listAgentAutonomyGoals",
            "createAgentAutonomyGoal",
            "getAgentAutonomyGoal",
            "updateAgentAutonomyGoal",
            "startAgentAutonomyGoal",
            "getAgentAutonomyGoalStatus",
            "steerAgentAutonomyGoal",
            "pauseAgentAutonomyGoal",
            "resumeAgentAutonomyGoal",
            "cancelAgentAutonomyGoal",
            "listAgentAutonomyGoalRuns",
            "listAgentApprovals",
            "getAgentApproval",
            "createAgentApprovalHandoff",
            "getAgentApprovalHandoff",
            "cancelAgentApprovalHandoff",
            "listAgentApprovalEvents",
            "streamAgentApprovalEvents",
            "getEffectiveAgentApprovalPolicy",
            "createAgentApprovalSettingsHandoff",
            "getAgentApprovalSettingsHandoff",
            "cancelAgentApprovalSettingsHandoff",
            "decideAgentApproval",
            "getUsage",
            "listAgentSkills",
            "listDesktopDownloadOptions",
            "requestAgentSkillConfiguration",
            "getAgentMcpCatalog",
            "getAgentCliMetadata",
            "listAgentModels",
            "setAgentModel",
            "getAgentMailCapabilities",
            "requestAgentMailMembership",
            "joinAgentMailMembership",
            "getAgentMailMembership",
            "approveAgentMailMembership",
            "suspendAgentMailMembership",
            "leaveAgentMailMembership",
            "revokeAgentMailMembership",
            "listAgentMailIdentities",
            "getAgentMailIdentity",
            "listAgentMailPeers",
            "getAgentMailPeer",
            "sendAgentMailMessage",
            "replyAgentMailMessage",
            "listAgentMailInbox",
            "getAgentMailEvents",
            "getAgentMailDelivery",
            "acknowledgeAgentMailDelivery",
            "markAgentMailRead",
            "revokeAgentRegistration",
            "createAgentAccountPairingHandoff",
            "requestAgentCheckoutHandoff",
            "getAgentAccountPairingHandoff",
            "cancelAgentAccountPairingHandoff",
            "createRunnerEnrollment",
            "listAgentRunners",
            "rotateAgentRunner",
            "revokeAgentRunner",
            "listAgentIntegrationCatalog",
            "listAgentIntegrationConnections",
            "createAgentIntegrationAttempt",
            "getAgentIntegrationAttempt",
            "cancelAgentIntegrationAttempt",
            "attachAgentIntegration",
            "detachAgentIntegration",
            "revokeAgentIntegration",
            "getAgentMailThread",
            "searchAgentMailThreads",
            "summarizeAgentMailThread",
            "requestAgentMailContact",
            "respondAgentMailContact",
            "listAgentMailContacts",
            "setAgentMailContactPolicy",
            "listAgentMailSectors",
            "getAgentMailSectorFeed",
            "broadcastAgentMailSector",
            "announceAgentMailHandoff",
            "attachAgentMailTrace",
            "waitForAgentMailEvents",
            "recoverAgentMailEvents",
            "exportAgentMailData",
            "eraseAgentMailData",
            "revokeAgentMailAccess",
            "searchConstructPackages",
            "getConstructPackage",
            "listConstructPackageVersions",
            "getConstructReleaseReadiness",
            "matchConstructContent",
            "resolveConstructArtifact",
            "getConstructGrantManifest",
            "reportConstructInstall",
            "reportConstructPackage"
          ]
        },
        "method": {
          "type": "string",
          "enum": [
            "GET",
            "POST",
            "PUT",
            "PATCH",
            "DELETE"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/api/agent/v1/companies",
            "/api/agent/v1/companies/{companyRef}",
            "/api/agent/v1/companies/{companyRef}/agents",
            "/api/agent/v1/companies/{companyRef}/tasks",
            "/api/agent/v1/companies/{companyRef}/tasks/{taskRef}",
            "/api/agent/v1/companies/{companyRef}/runs",
            "/api/agent/v1/companies/{companyRef}/runs/{runRef}",
            "/api/agent/v1/boards",
            "/api/agent/v1/boards/{boardId}",
            "/api/agent/v1/boards/{boardId}/publication",
            "/api/agent/v1/boards/{boardId}/publish",
            "/api/agent/v1/boards/{boardId}/unpublish",
            "/api/agent/v1/boards/{boardId}/rotate-link",
            "/api/agent/v1/boards/{boardId}/visibility",
            "/api/agent/v1/boards/{boardId}/grants",
            "/api/agent/v1/boards/{boardId}/grants/{grantId}",
            "/api/agent/v1/me",
            "/api/agent/v1/capabilities",
            "/api/agent/v1/onboarding",
            "/api/agent/v1/agents",
            "/api/agent/v1/agents/{agentRef}",
            "/api/agent/v1/agents/{agentRef}/archive",
            "/api/agent/v1/agents/{agentRef}/restore",
            "/api/agent/v1/agents/{agentRef}/tools",
            "/api/agent/v1/agents/{agentRef}/tool-policy",
            "/api/agent/v1/conversations",
            "/api/agent/v1/conversations/{conversationRef}",
            "/api/agent/v1/conversations/{conversationRef}/archive",
            "/api/agent/v1/conversations/{conversationRef}/restore",
            "/api/agent/v1/conversations/{conversationRef}/messages",
            "/api/agent/v1/conversations/{conversationRef}/turns",
            "/api/agent/v1/conversations/{conversationRef}/turns/{turnRef}",
            "/api/agent/v1/conversations/{conversationRef}/turns/{turnRef}/cancel",
            "/api/agent/v1/conversations/{conversationRef}/turns/{turnRef}/events",
            "/api/agent/v1/conversations/{conversationRef}/turns/{turnRef}/events/stream",
            "/api/agent/v1/tasks",
            "/api/agent/v1/automations/cron",
            "/api/agent/v1/automations/cron/{cronJobRef}",
            "/api/agent/v1/automations/cron/{cronJobRef}/enable",
            "/api/agent/v1/automations/cron/{cronJobRef}/disable",
            "/api/agent/v1/automations/cron/{cronJobRef}/runs",
            "/api/agent/v1/automations/flows/catalog",
            "/api/agent/v1/automations/flows",
            "/api/agent/v1/automations/flows/{automationRef}",
            "/api/agent/v1/automations/flows/{automationRef}/start",
            "/api/agent/v1/automations/flows/{automationRef}/status",
            "/api/agent/v1/automations/flows/{automationRef}/pause",
            "/api/agent/v1/automations/flows/{automationRef}/resume",
            "/api/agent/v1/automations/flows/{automationRef}/cancel",
            "/api/agent/v1/automations/flows/{automationRef}/runs",
            "/api/agent/v1/runs/{runId}",
            "/api/agent/v1/runs",
            "/api/agent/v1/runs/{runRef}/events",
            "/api/agent/v1/runs/{runRef}/events/stream",
            "/api/agent/v1/autonomy/goals",
            "/api/agent/v1/autonomy/goals/{goalRef}",
            "/api/agent/v1/autonomy/goals/{goalRef}/start",
            "/api/agent/v1/autonomy/goals/{goalRef}/status",
            "/api/agent/v1/autonomy/goals/{goalRef}/steer",
            "/api/agent/v1/autonomy/goals/{goalRef}/pause",
            "/api/agent/v1/autonomy/goals/{goalRef}/resume",
            "/api/agent/v1/autonomy/goals/{goalRef}/cancel",
            "/api/agent/v1/autonomy/goals/{goalRef}/runs",
            "/api/agent/v1/approvals",
            "/api/agent/v1/approvals/{approvalRef}",
            "/api/agent/v1/approvals/{approvalRef}/human-handoffs",
            "/api/agent/v1/approvals/{approvalRef}/human-handoffs/{handoffRef}",
            "/api/agent/v1/approvals/{approvalRef}/human-handoffs/{handoffRef}/cancel",
            "/api/agent/v1/approvals/{approvalRef}/events",
            "/api/agent/v1/approvals/{approvalRef}/events/stream",
            "/api/agent/v1/agents/{agentRef}/approval-policy",
            "/api/agent/v1/agents/{agentRef}/approval-settings-handoffs",
            "/api/agent/v1/agents/{agentRef}/approval-settings-handoffs/{handoffRef}",
            "/api/agent/v1/agents/{agentRef}/approval-settings-handoffs/{handoffRef}/cancel",
            "/api/agent/v1/approvals/{approvalRef}/decisions",
            "/api/agent/v1/usage",
            "/api/agent/v1/skills",
            "/api/agent/v1/desktop/downloads",
            "/api/agent/v1/skills/{skillId}/configure",
            "/api/agent/v1/mcp/catalog",
            "/api/agent/v1/cli",
            "/api/agent/v1/models",
            "/api/agent/v1/agents/{agentRef}/model",
            "/api/agent/v1/mail/capabilities",
            "/api/agent/v1/mail/membership-requests",
            "/api/agent/v1/mail/membership/join",
            "/api/agent/v1/mail/membership",
            "/api/agent/v1/mail/membership/{membershipId}/approve",
            "/api/agent/v1/mail/membership/{membershipId}/suspend",
            "/api/agent/v1/mail/membership/leave",
            "/api/agent/v1/mail/membership/{membershipId}/revoke",
            "/api/agent/v1/mail/identities",
            "/api/agent/v1/mail/identities/self",
            "/api/agent/v1/mail/peers",
            "/api/agent/v1/mail/peers/{peerId}",
            "/api/agent/v1/mail/messages",
            "/api/agent/v1/mail/messages/{messageId}/reply",
            "/api/agent/v1/mail/inbox",
            "/api/agent/v1/mail/events",
            "/api/agent/v1/mail/deliveries/{messageId}",
            "/api/agent/v1/mail/deliveries/{messageId}/ack",
            "/api/agent/v1/mail/messages/{messageId}/read",
            "/api/agent/v1/registration",
            "/api/agent/v1/account/pairing-handoffs",
            "/api/agent/checkout-handoffs/request",
            "/api/agent/v1/account/pairing-handoffs/{handoffRef}",
            "/api/agent/v1/account/pairing-handoffs/{handoffRef}/cancel",
            "/api/agent/v1/runners",
            "/api/agent/v1/runners/{runnerId}/rotate",
            "/api/agent/v1/runners/{runnerId}",
            "/api/agent/v1/integrations/catalog",
            "/api/agent/v1/integrations/connections",
            "/api/agent/v1/integrations/attempts",
            "/api/agent/v1/integrations/attempts/{attemptId}",
            "/api/agent/v1/integrations/attempts/{attemptId}/cancel",
            "/api/agent/v1/integrations/connections/{connectionId}/attach",
            "/api/agent/v1/integrations/connections/{connectionId}/detach",
            "/api/agent/v1/integrations/connections/{connectionId}/revoke",
            "/api/agent/v1/mail/threads/{threadId}",
            "/api/agent/v1/mail/threads/search",
            "/api/agent/v1/mail/threads/{threadId}/summarize",
            "/api/agent/v1/mail/contacts/requests",
            "/api/agent/v1/mail/contacts/{contactId}/respond",
            "/api/agent/v1/mail/contacts",
            "/api/agent/v1/mail/contacts/policy",
            "/api/agent/v1/mail/sectors",
            "/api/agent/v1/mail/sectors/{sectorId}/feed",
            "/api/agent/v1/mail/sectors/{sectorId}/broadcast",
            "/api/agent/v1/mail/handoffs",
            "/api/agent/v1/mail/handoffs/{handoffRef}/trace",
            "/api/agent/v1/mail/events/wait",
            "/api/agent/v1/mail/events/recover",
            "/api/agent/v1/mail/export",
            "/api/agent/v1/mail/erase",
            "/api/agent/v1/mail/access/revoke",
            "/api/agent/v1/construct/packages/search",
            "/api/agent/v1/construct/packages/{ref}",
            "/api/agent/v1/construct/packages/{ref}/versions",
            "/api/agent/v1/construct/packages/{ref}/release-readiness",
            "/api/agent/v1/construct/packages/{ref}/content-match",
            "/api/agent/v1/construct/resolve",
            "/api/agent/v1/construct/entitlements/manifest",
            "/api/agent/v1/construct/installs",
            "/api/agent/v1/construct/reports"
          ]
        },
        "requiredScope": {
          "type": "string",
          "enum": [
            "neotask:companies:read",
            "neotask:boards:read",
            "neotask:boards:publish",
            "neotask:boards:share",
            "neotask:profile:read",
            "neotask:catalog:read",
            "neotask:agents:read",
            "neotask:agents:write",
            "neotask:agents:configure",
            "neotask:conversations:read",
            "neotask:conversations:write",
            "neotask:tasks:read",
            "neotask:tasks:write",
            "neotask:cron:read",
            "neotask:cron:write",
            "neotask:cron:run",
            "neotask:automations:read",
            "neotask:automations:write",
            "neotask:runs:read",
            "neotask:runs:write",
            "neotask:autonomy:read",
            "neotask:autonomy:write",
            "neotask:autonomy:steer",
            "neotask:approvals:read",
            "neotask:approvals:handoff",
            "neotask:approvals:decide",
            "neotask:usage:read",
            "neotask:skills:write",
            "neotask:models:read",
            "neotask:models:write",
            "neotask:mail:read",
            "neotask:mail:security",
            "neotask:mail:write",
            "neotask:registration:revoke",
            "neotask:account:pair",
            "neotask:billing:handoff",
            "neotask:runners:write",
            "neotask:runners:read",
            "neotask:integrations:read",
            "neotask:integrations:write",
            "neotask:integrations:security",
            "neotask:mail:contacts",
            "neotask:mail:sectors",
            "neotask:mail:handoffs",
            "neotask:construct:read",
            "neotask:construct:install",
            "neotask:construct:feedback"
          ]
        },
        "scopeGranted": {
          "type": "boolean"
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "claim_required",
            "setup_required",
            "approval_required",
            "plan_required",
            "quota_exhausted",
            "model_not_allowed",
            "temporarily_disabled"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "idempotencyRequired": {
          "type": "boolean"
        }
      }
    },
    "AgentRunExecutionModeState": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "availability",
        "reason"
      ],
      "properties": {
        "id": {
          "type": "string",
          "enum": [
            "local_runner",
            "cloud_runner"
          ]
        },
        "availability": {
          "$ref": "#/schemas/AgentCapabilityState/properties/availability"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "setupUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "AgentRunExecutionSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "recommendedMode",
        "modes"
      ],
      "properties": {
        "recommendedMode": {
          "type": "string",
          "enum": [
            "local_runner",
            "cloud_runner"
          ]
        },
        "modes": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "$ref": "#/schemas/AgentRunExecutionModeState"
          }
        }
      }
    },
    "AgentProfileResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "principal",
        "account",
        "plan",
        "capabilitiesUrl"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 3
        },
        "principal": {
          "$ref": "#/schemas/AgentPrincipal"
        },
        "account": {
          "$ref": "#/schemas/AgentAccount"
        },
        "plan": {
          "$ref": "#/schemas/AgentPlan"
        },
        "capabilitiesUrl": {
          "type": "string",
          "const": "/api/agent/v1/capabilities"
        }
      }
    },
    "AgentCapabilitySnapshot": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "operationRegistryVersion",
        "principal",
        "account",
        "plan",
        "capabilities",
        "execution",
        "operations"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 3
        },
        "principal": {
          "$ref": "#/schemas/AgentPrincipal"
        },
        "account": {
          "$ref": "#/schemas/AgentAccount"
        },
        "plan": {
          "$ref": "#/schemas/AgentPlan"
        },
        "operationRegistryVersion": {
          "type": "integer",
          "const": 5
        },
        "capabilities": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "accountClaim",
            "profileRead",
            "catalogRead",
            "generalApiAccess",
            "companyAccess",
            "coding",
            "messageUsage"
          ],
          "properties": {
            "accountClaim": {
              "$ref": "#/schemas/AgentCapabilityState"
            },
            "profileRead": {
              "$ref": "#/schemas/AgentCapabilityState"
            },
            "catalogRead": {
              "$ref": "#/schemas/AgentCapabilityState"
            },
            "generalApiAccess": {
              "$ref": "#/schemas/AgentCapabilityState"
            },
            "companyAccess": {
              "$ref": "#/schemas/AgentCapabilityState"
            },
            "coding": {
              "$ref": "#/schemas/AgentCapabilityState"
            },
            "messageUsage": {
              "$ref": "#/schemas/AgentCapabilityState"
            }
          }
        },
        "execution": {
          "$ref": "#/schemas/AgentExecutionSummary"
        },
        "operations": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "$ref": "#/schemas/AgentEffectiveOperation"
          }
        }
      }
    },
    "AgentOnboardingCount": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "count",
        "truncated"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "truncated": {
          "type": "boolean"
        }
      }
    },
    "AgentOnboardingResourceSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "agents",
        "tasks",
        "runs",
        "runners",
        "integrationAttempts",
        "integrationConnections",
        "skills",
        "models",
        "effectiveTools",
        "conversations",
        "turns",
        "cron",
        "automations",
        "autonomyGoals",
        "approvals",
        "coordinationMail",
        "pairing"
      ],
      "properties": {
        "agents": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "activeCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "tasks": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "activeCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "runs": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "successfulCount",
            "inProgressCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "successfulCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "inProgressCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "runners": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "enrolledCount",
            "connectedCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "enrolledCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "connectedCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "integrationAttempts": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "activeCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "integrationConnections": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "activeCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "skills": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "publishedCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "publishedCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "models": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "availableCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "availableCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "effectiveTools": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "availableCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "availableCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "conversations": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "activeCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "turns": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "inProgressCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "inProgressCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "cron": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "enabledCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "enabledCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "automations": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "activeCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "autonomyGoals": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "activeCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "approvals": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "pendingCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "pendingCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "coordinationMail": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "count",
            "truncated",
            "activeCount"
          ],
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "truncated": {
              "type": "boolean"
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          }
        },
        "pairing": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "state"
          ],
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "not_requested",
                "pending",
                "paired",
                "cancelled",
                "expired"
              ]
            }
          }
        }
      }
    },
    "AgentOnboardingIdentity": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "authorityPhase",
        "registrationMethod",
        "identityState",
        "lifecycleState",
        "tenantKind",
        "humanControl",
        "freePolicy",
        "claimRequiredFor",
        "claimAvailable",
        "claim"
      ],
      "properties": {
        "authorityPhase": {
          "type": "string",
          "enum": [
            "pre_claim",
            "claim_pending",
            "claimed",
            "revoked"
          ]
        },
        "registrationMethod": {
          "type": "string",
          "enum": [
            "anonymous",
            "service_auth",
            "identity_assertion"
          ]
        },
        "identityState": {
          "type": "string",
          "enum": [
            "unauthenticated",
            "agent_trial",
            "claim_required",
            "claim_pending",
            "agent_registered",
            "human_linked",
            "suspended",
            "revoked"
          ]
        },
        "lifecycleState": {
          "type": "string",
          "enum": [
            "agent_trial",
            "agent_registered",
            "claim_required",
            "claim_pending",
            "revoked"
          ]
        },
        "tenantKind": {
          "type": "string",
          "const": "standard"
        },
        "humanControl": {
          "type": "string",
          "enum": [
            "not_linked",
            "pairing_pending",
            "paired"
          ]
        },
        "freePolicy": {
          "type": "string",
          "const": "ordinary"
        },
        "claimRequiredFor": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "claimAvailable": {
          "type": "boolean"
        },
        "claim": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "verification"
          ],
          "properties": {
            "verification": {
              "type": "string",
              "const": "workos_uri_and_user_code_polling"
            }
          }
        }
      }
    },
    "AgentOnboardingExecution": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "recommendedMode",
        "modes"
      ],
      "properties": {
        "recommendedMode": {
          "type": "string",
          "enum": [
            "local_runner",
            "cloud_runner"
          ]
        },
        "modes": {
          "type": "array",
          "minItems": 1,
          "maxItems": 2,
          "items": {
            "$ref": "#/schemas/AgentRunExecutionModeState"
          }
        }
      }
    },
    "AgentOnboardingNextAction": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "stepId",
        "operationId",
        "scopeGranted",
        "availability",
        "reason",
        "idempotencyRequired",
        "documentationUrl"
      ],
      "properties": {
        "stepId": {
          "type": "string"
        },
        "operationId": {
          "type": "string"
        },
        "scopeGranted": {
          "type": "boolean"
        },
        "availability": {
          "$ref": "#/schemas/AgentCapabilityState/properties/availability"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "idempotencyRequired": {
          "type": "boolean"
        },
        "documentationUrl": {
          "type": "string",
          "format": "uri-reference"
        }
      }
    },
    "AgentOnboardingBlocker": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operationId",
        "availability",
        "reason"
      ],
      "properties": {
        "operationId": {
          "type": "string"
        },
        "availability": {
          "$ref": "#/schemas/AgentCapabilityState/properties/availability"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentOnboardingHumanAction": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "action",
        "reason",
        "requiredFor"
      ],
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "claim",
            "pairing",
            "runner_approval",
            "approval",
            "upgrade"
          ]
        },
        "reason": {
          "type": "string"
        },
        "requiredFor": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      }
    },
    "AgentOnboardingProgress": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "state",
        "completedMilestones",
        "successDefinition"
      ],
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "account_ready",
            "agent_needed",
            "task_needed",
            "run_ready",
            "first_value_blocked",
            "run_in_progress",
            "first_value_complete"
          ]
        },
        "completedMilestones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "successDefinition": {
          "type": "string",
          "const": "first_successful_run"
        },
        "blockingOperationId": {
          "type": "string"
        },
        "availability": {
          "$ref": "#/schemas/AgentCapabilityState/properties/availability"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "nextOperationId": {
          "type": "string"
        }
      }
    },
    "AgentOnboardingResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "generatedAt",
        "operationRegistryVersion",
        "service",
        "identity",
        "execution",
        "progress",
        "nextActions",
        "blockers",
        "humanActions",
        "resources"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "operationRegistryVersion": {
          "type": "integer",
          "const": 5
        },
        "service": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "launchState",
            "restResource",
            "mcpResource"
          ],
          "properties": {
            "launchState": {
              "type": "string",
              "enum": [
                "feature_gated",
                "sandbox",
                "live"
              ]
            },
            "restResource": {
              "type": "string",
              "format": "uri"
            },
            "mcpResource": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "identity": {
          "$ref": "#/schemas/AgentOnboardingIdentity"
        },
        "execution": {
          "$ref": "#/schemas/AgentOnboardingExecution"
        },
        "progress": {
          "$ref": "#/schemas/AgentOnboardingProgress"
        },
        "nextActions": {
          "type": "array",
          "maxItems": 4,
          "items": {
            "$ref": "#/schemas/AgentOnboardingNextAction"
          }
        },
        "blockers": {
          "type": "array",
          "maxItems": 4,
          "items": {
            "$ref": "#/schemas/AgentOnboardingBlocker"
          }
        },
        "humanActions": {
          "type": "array",
          "maxItems": 4,
          "items": {
            "$ref": "#/schemas/AgentOnboardingHumanAction"
          }
        },
        "resources": {
          "$ref": "#/schemas/AgentOnboardingResourceSummary"
        }
      }
    },
    "AgentResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "scopeType",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "standalone",
            "company"
          ]
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "agentId": {
          "type": "string",
          "maxLength": 200
        },
        "name": {
          "type": "string",
          "maxLength": 160
        },
        "description": {
          "type": "string",
          "maxLength": 2000
        },
        "model": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "AgentCreateResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "agent"
      ],
      "properties": {
        "agent": {
          "$ref": "#/schemas/AgentResource"
        }
      }
    },
    "AgentListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "agents",
        "nextCursor"
      ],
      "properties": {
        "agents": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentResource"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "TaskResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "instruction",
        "status",
        "enabled",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "instruction": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "agentId": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "TaskCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "instruction"
      ],
      "properties": {
        "taskId": {
          "type": "string",
          "maxLength": 200
        },
        "agentId": {
          "type": "string",
          "maxLength": 200
        },
        "name": {
          "type": "string",
          "maxLength": 160
        },
        "instruction": {
          "type": "string",
          "maxLength": 30000
        },
        "description": {
          "type": "string",
          "maxLength": 1000
        },
        "model": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "TaskCreateResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "task"
      ],
      "properties": {
        "task": {
          "$ref": "#/schemas/TaskResource"
        }
      }
    },
    "TaskListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "tasks",
        "nextCursor"
      ],
      "properties": {
        "tasks": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/TaskResource"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentTaskFlowDescriptor": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "goal",
        "currentStep",
        "notifyPolicy",
        "stateJson"
      ],
      "properties": {
        "goal": {
          "type": "string",
          "minLength": 1,
          "maxLength": 16384
        },
        "currentStep": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        },
        "notifyPolicy": {
          "type": "string",
          "enum": [
            "done_only",
            "state_changes",
            "silent"
          ]
        },
        "stateJson": {
          "type": [
            "object",
            "array",
            "string",
            "number",
            "boolean",
            "null"
          ],
          "description": "Bounded JSON checkpoint state (maximum 16 KiB)."
        }
      }
    },
    "AgentAutomationRun": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "runRef",
        "status",
        "terminal",
        "createdAt",
        "updatedAt",
        "startedAt",
        "terminalAt"
      ],
      "properties": {
        "runRef": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "terminal": {
          "type": "boolean"
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "terminalAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "terminalReason": {
          "type": "string"
        }
      }
    },
    "AgentAutomationResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "automationRef",
        "kind",
        "name",
        "description",
        "agentRef",
        "instruction",
        "model",
        "taskFlow",
        "status",
        "revision",
        "createdAt",
        "updatedAt",
        "latestRun"
      ],
      "properties": {
        "automationRef": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "task_flow",
            "automation"
          ]
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "agentRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "instruction": {
          "type": [
            "string",
            "null"
          ]
        },
        "model": {
          "type": [
            "string",
            "null"
          ]
        },
        "taskFlow": {
          "$ref": "#/schemas/AgentTaskFlowDescriptor"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "paused",
            "archived"
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 0
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "latestRun": {
          "oneOf": [
            {
              "$ref": "#/schemas/AgentAutomationRun"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "AgentAutomationCatalogResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "kinds",
        "unsupportedInputs"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "kinds": {
          "type": "array",
          "maxItems": 2,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind",
              "name",
              "description",
              "requiredFields"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "task_flow",
                  "automation"
                ]
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "requiredFields": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              }
            }
          }
        },
        "unsupportedInputs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      }
    },
    "AgentAutomationListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "automations",
        "nextCursor"
      ],
      "properties": {
        "automations": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentAutomationResource"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentAutomationCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "agentRef",
        "kind",
        "name",
        "instruction"
      ],
      "properties": {
        "agentRef": {
          "type": "string",
          "maxLength": 200
        },
        "kind": {
          "type": "string",
          "enum": [
            "task_flow",
            "automation"
          ]
        },
        "name": {
          "type": "string",
          "maxLength": 160
        },
        "instruction": {
          "type": "string",
          "maxLength": 30000
        },
        "description": {
          "type": "string",
          "maxLength": 1000
        },
        "model": {
          "type": "string",
          "maxLength": 200
        },
        "goal": {
          "type": "string",
          "maxLength": 16384
        },
        "currentStep": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        },
        "notifyPolicy": {
          "type": "string",
          "enum": [
            "done_only",
            "state_changes",
            "silent"
          ]
        },
        "stateJson": {
          "type": [
            "object",
            "array",
            "string",
            "number",
            "boolean",
            "null"
          ],
          "description": "Bounded JSON checkpoint state (maximum 16 KiB)."
        }
      }
    },
    "AgentAutomationUpdateRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "expectedRevision"
      ],
      "properties": {
        "expectedRevision": {
          "type": "integer",
          "minimum": 1
        },
        "agentRef": {
          "type": "string",
          "maxLength": 200
        },
        "name": {
          "type": "string",
          "maxLength": 160
        },
        "instruction": {
          "type": "string",
          "maxLength": 30000
        },
        "description": {
          "type": "string",
          "maxLength": 1000
        },
        "model": {
          "type": "string",
          "maxLength": 200
        },
        "goal": {
          "type": "string",
          "maxLength": 16384
        },
        "currentStep": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        },
        "notifyPolicy": {
          "type": "string",
          "enum": [
            "done_only",
            "state_changes",
            "silent"
          ]
        },
        "stateJson": {
          "type": [
            "object",
            "array",
            "string",
            "number",
            "boolean",
            "null"
          ],
          "description": "Bounded JSON checkpoint state (maximum 16 KiB)."
        }
      }
    },
    "AgentAutomationRevisionRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "expectedRevision"
      ],
      "properties": {
        "expectedRevision": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "AgentAutomationStartRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "input": {
          "type": "string",
          "maxLength": 30000
        },
        "model": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "AgentAutomationResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "automation"
      ],
      "properties": {
        "automation": {
          "$ref": "#/schemas/AgentAutomationResource"
        }
      }
    },
    "AgentAutomationMutationResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "automation",
        "changed"
      ],
      "properties": {
        "automation": {
          "$ref": "#/schemas/AgentAutomationResource"
        },
        "changed": {
          "type": "boolean"
        }
      }
    },
    "AgentAutomationStartResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "automationRef",
        "kind",
        "revision",
        "run",
        "eventsUrl"
      ],
      "properties": {
        "automationRef": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "task_flow",
            "automation"
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 0
        },
        "run": {
          "$ref": "#/schemas/RunResponse"
        },
        "eventsUrl": {
          "type": "string"
        }
      }
    },
    "AgentAutomationStatusResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "automationRef",
        "kind",
        "status",
        "revision",
        "run"
      ],
      "properties": {
        "automationRef": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "task_flow",
            "automation"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "paused",
            "archived"
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 0
        },
        "run": {
          "oneOf": [
            {
              "$ref": "#/schemas/AgentAutomationRun"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "AgentAutomationCancelResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "automationRef",
        "cancelled"
      ],
      "properties": {
        "automationRef": {
          "type": "string"
        },
        "cancelled": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "run": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "AgentAutomationRunListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "automationRef",
        "runs",
        "nextCursor"
      ],
      "properties": {
        "automationRef": {
          "type": "string"
        },
        "runs": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentAutomationRun"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "RunCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "taskId"
      ],
      "properties": {
        "taskId": {
          "type": "string",
          "maxLength": 200
        },
        "input": {
          "type": "string",
          "maxLength": 30000
        },
        "model": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "RunResponse": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "id",
        "taskId",
        "status",
        "terminal"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "taskId": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "terminal": {
          "type": "boolean"
        },
        "terminalReason": {
          "type": "string"
        },
        "startedAt": {
          "type": "string",
          "format": "date-time"
        },
        "terminalAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "RunCreateResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "run"
      ],
      "properties": {
        "run": {
          "$ref": "#/schemas/RunResponse"
        }
      }
    },
    "UsageResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "plan",
        "usage"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 3
        },
        "plan": {
          "$ref": "#/schemas/AgentPlan"
        },
        "usage": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "messageLimit",
            "usedMessages",
            "remainingMessages"
          ],
          "properties": {
            "messageLimit": {
              "type": [
                "integer",
                "null"
              ]
            },
            "usedMessages": {
              "type": "integer",
              "minimum": 0
            },
            "remainingMessages": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        }
      }
    },
    "RegistrationRevocationResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "revoked",
        "registrationId"
      ],
      "properties": {
        "revoked": {
          "type": "boolean"
        },
        "registrationId": {
          "type": "string"
        }
      }
    },
    "AgentAccountPairingHandoffCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "description": "No caller-selected tenant, account, or provider fields are accepted."
    },
    "AgentAccountPairingHandoffCancelRequest": {
      "type": "object",
      "additionalProperties": false
    },
    "AgentAccountPairingHandoffCreateResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "handoffRef",
        "handoffUrl",
        "status",
        "expiresAt",
        "audience"
      ],
      "properties": {
        "handoffRef": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{43}$"
        },
        "handoffUrl": {
          "type": "string",
          "format": "uri"
        },
        "status": {
          "type": "string",
          "const": "pending"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "audience": {
          "type": "string",
          "const": "neotask-human-account-pairing-v1"
        }
      }
    },
    "AgentAccountPairingHandoffStatusResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "handoffRef",
        "status",
        "expiresAt"
      ],
      "properties": {
        "handoffRef": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{43}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "consumed",
            "cancelled",
            "expired"
          ]
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "consumedAt": {
          "type": "string",
          "format": "date-time"
        },
        "confirmedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AgentApiError": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "object",
          "additionalProperties": true,
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "retryable": {
              "type": "boolean"
            },
            "requestId": {
              "type": [
                "string",
                "null"
              ]
            },
            "requiredScope": {
              "type": [
                "string",
                "null"
              ]
            },
            "availability": {
              "type": [
                "string",
                "null"
              ]
            },
            "reason": {
              "type": [
                "string",
                "null"
              ]
            },
            "claim": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": true
            },
            "approval": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": true
            },
            "checkout": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": true
            },
            "action": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": true
            },
            "retryAfterSeconds": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0
            }
          }
        }
      }
    },
    "AgentEventEnvelope": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "channel",
        "eventVersion",
        "eventRef",
        "sequence",
        "cursor",
        "type",
        "occurredAt",
        "resourceGeneration",
        "data"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "eventVersion": {
          "type": "integer",
          "const": 1
        },
        "eventRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "sequence": {
          "type": "integer",
          "minimum": 1
        },
        "cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "runRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "conversationRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "turnRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "approvalRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "actorRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "occurredAt": {
          "type": "string",
          "format": "date-time"
        },
        "resourceGeneration": {
          "type": "integer",
          "minimum": 0
        },
        "data": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "AgentEventListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "events",
        "nextCursor"
      ],
      "properties": {
        "events": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/schemas/AgentEventEnvelope"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 1024
        }
      }
    },
    "AgentEventStreamResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "event"
      ],
      "properties": {
        "event": {
          "$ref": "#/schemas/AgentEventEnvelope"
        }
      }
    },
    "AgentCliEnvelope": {
      "type": "object",
      "description": "The result a neotask command prints with --json, as its last line. Streaming commands print AgentCliStreamEvent lines before it. Check ok and state before using data; relay nextAction to the person it names.",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "contractVersion",
        "ok",
        "commandId",
        "state",
        "availability"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "contractVersion": {
          "type": "string",
          "const": "agent-public-contracts/v1"
        },
        "ok": {
          "type": "boolean",
          "description": "True exactly when state is ready or human_action_required."
        },
        "commandId": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
          "maxLength": 64,
          "description": "The command that ran (for example api-profile), or parse-error when the arguments were rejected."
        },
        "state": {
          "type": "string",
          "enum": [
            "ready",
            "human_action_required",
            "unavailable",
            "feature_gated",
            "unsupported",
            "error"
          ]
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "claim_required",
            "setup_required",
            "approval_required",
            "plan_required",
            "quota_exhausted",
            "model_not_allowed",
            "temporarily_disabled",
            "feature_gated",
            "unsupported",
            "site_client_not_configured",
            "credential_store_unavailable",
            "credential_missing",
            "credential_expired",
            "credential_audience_mismatch",
            "error"
          ]
        },
        "data": {
          "description": "The redacted, key-sorted result or Site payload. Any JSON value; absent when there is none."
        },
        "nextAction": {
          "$ref": "#/schemas/AgentCliNextAction"
        },
        "error": {
          "$ref": "#/schemas/AgentCliError"
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "state": {
                "enum": [
                  "ready",
                  "human_action_required"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "ok": {
                "const": true
              }
            }
          },
          "else": {
            "properties": {
              "ok": {
                "const": false
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "commandId": {
                "enum": [
                  "account-login",
                  "account-status",
                  "account-claim-start",
                  "account-claim-status"
                ]
              }
            }
          },
          "else": {
            "properties": {
              "nextAction": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "pattern": "^https://(?:neotask\\.ai|www\\.neotask\\.ai|api\\.neotask\\.ai|auth\\.neotask\\.ai|auth\\.workos\\.com|staging\\.neotask\\.ai)(?::[0-9]{1,5})?/\\S*$"
                  }
                }
              }
            }
          }
        }
      ]
    },
    "AgentCliStreamEvent": {
      "type": "object",
      "description": "One line per event that a streaming command prints before its final AgentCliEnvelope line: chat watch, api runs watch, approvals wait --stream, and api turns events, api runs events or approvals events with --watch.",
      "additionalProperties": false,
      "required": [
        "type",
        "id",
        "event",
        "data",
        "cursor"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "event"
        },
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "event": {
          "type": [
            "string",
            "null"
          ]
        },
        "data": {
          "description": "The redacted, key-sorted event payload. Any JSON value."
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentCliNextAction": {
      "type": "object",
      "description": "The next step, often a human one. For a refused agent it is the Site error.action, for example the claim-move link to give the claimer.",
      "additionalProperties": false,
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "open_url",
            "confirm",
            "download",
            "retry",
            "sign_in",
            "upgrade_gateway"
          ]
        },
        "url": {
          "type": "string",
          "anyOf": [
            {
              "pattern": "^https://(?:neotask\\.ai|www\\.neotask\\.ai|api\\.neotask\\.ai|auth\\.neotask\\.ai|auth\\.workos\\.com|staging\\.neotask\\.ai)(?::[0-9]{1,5})?/\\S*$"
            },
            {
              "pattern": "^https://[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.authkit\\.app/agent-claim\\?&*(?:t|%74)(?:o|%6[Ff])(?:k|%6[Bb])(?:e|%65)(?:n|%6[Ee])=(?=(?:(?:[A-Za-z0-9_~-]|%(?:3[0-9]|4[1-9A-Fa-f]|5[0-9Aa]|6[1-9A-Fa-f]|7[0-9Aa]|2[Dd]|5[Ff]|7[Ee]))|(?:\\.|%2[Ee])){1,512}&*$)(?!(?:[A-Za-z0-9_~-]|%(?:3[0-9]|4[1-9A-Fa-f]|5[0-9Aa]|6[1-9A-Fa-f]|7[0-9Aa]|2[Dd]|5[Ff]|7[Ee]))*(?:\\.|%2[Ee])(?:[A-Za-z0-9_~-]|%(?:3[0-9]|4[1-9A-Fa-f]|5[0-9Aa]|6[1-9A-Fa-f]|7[0-9Aa]|2[Dd]|5[Ff]|7[Ee]))*(?:\\.|%2[Ee])(?:[A-Za-z0-9_~-]|%(?:3[0-9]|4[1-9A-Fa-f]|5[0-9Aa]|6[1-9A-Fa-f]|7[0-9Aa]|2[Dd]|5[Ff]|7[Ee]))*&*$)(?:(?:[A-Za-z0-9_~-]|%(?:3[0-9]|4[1-9A-Fa-f]|5[0-9Aa]|6[1-9A-Fa-f]|7[0-9Aa]|2[Dd]|5[Ff]|7[Ee]))|(?:\\.|%2[Ee]))+&*$"
            }
          ],
          "description": "A reviewed https link; relay it unchanged."
        },
        "handoffRef": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._~-]{0,255}$"
        },
        "expiresAt": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$"
        },
        "instructions": {
          "type": "string"
        }
      }
    },
    "AgentCliError": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._-]{1,96}$"
        },
        "message": {
          "type": "string",
          "maxLength": 512
        },
        "reason": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,63}$",
          "description": "The Site reason refining code, for example claim_move_confirmation_required under identity_conflict."
        }
      }
    },
    "AgentEventEnvelope.v1": {
      "$ref": "#/schemas/AgentEventEnvelope"
    },
    "AgentCliEnvelope.v1": {
      "$ref": "#/schemas/AgentCliEnvelope"
    },
    "AgentCliStreamEvent.v1": {
      "$ref": "#/schemas/AgentCliStreamEvent"
    },
    "AgentExecutionModeState": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "availability",
        "reason"
      ],
      "properties": {
        "id": {
          "type": "string",
          "enum": [
            "local_runner",
            "cloud_runner"
          ]
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "setup_required",
            "temporarily_disabled"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "setupUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "AgentExecutionSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "recommendedMode",
        "modes"
      ],
      "properties": {
        "recommendedMode": {
          "type": "string",
          "enum": [
            "local_runner",
            "cloud_runner"
          ]
        },
        "modes": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "$ref": "#/schemas/AgentExecutionModeState"
          }
        }
      }
    },
    "AgentConversationResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "agentId",
        "status",
        "createdAt",
        "updatedAt",
        "lastActivityAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "agentId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 240
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "archived"
          ]
        },
        "lastTurnRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastActivityAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentConversationResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "conversation"
      ],
      "properties": {
        "conversation": {
          "$ref": "#/schemas/AgentConversationResource"
        }
      }
    },
    "AgentConversationListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "conversations",
        "nextCursor"
      ],
      "properties": {
        "conversations": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/schemas/AgentConversationResource"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentConversationCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "agentRef"
      ],
      "properties": {
        "agentRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "title": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 240
        }
      }
    },
    "AgentConversationMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "role",
        "content",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "role": {
          "type": "string",
          "enum": [
            "user",
            "assistant",
            "system"
          ]
        },
        "content": {
          "type": "string"
        },
        "runId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentConversationMessageListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "messages",
        "nextCursor"
      ],
      "properties": {
        "messages": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/schemas/AgentConversationMessage"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentConversationTurn": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "conversationRef",
        "status",
        "sequence",
        "model",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "conversationRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "running",
            "completed",
            "failed",
            "cancel_requested",
            "cancelled",
            "execution_unknown"
          ]
        },
        "sequence": {
          "type": "integer",
          "minimum": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "model": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "completedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "output": {
          "type": "string"
        },
        "terminalReason": {
          "type": "string"
        }
      }
    },
    "AgentConversationTurnResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "turn"
      ],
      "properties": {
        "turn": {
          "$ref": "#/schemas/AgentConversationTurn"
        }
      }
    },
    "AgentConversationTurnCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "anyOf": [
        {
          "required": [
            "input"
          ],
          "properties": {
            "input": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          }
        },
        {
          "required": [
            "content"
          ],
          "properties": {
            "input": {
              "type": "null"
            },
            "content": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          }
        }
      ],
      "properties": {
        "input": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 30000
        },
        "content": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 30000
        },
        "model": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200
        }
      }
    },
    "AgentCheckoutHandoffInspection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operation",
        "requiredFeature",
        "mode",
        "currentPlan",
        "eligiblePlans",
        "planOptions",
        "expiresAt",
        "confirmation"
      ],
      "properties": {
        "operation": {
          "type": "string"
        },
        "requiredFeature": {
          "type": "string"
        },
        "mode": {
          "type": "string",
          "enum": [
            "checkout",
            "plan_change"
          ]
        },
        "currentPlan": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "displayName"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "enum": [
                    "individual",
                    "business",
                    "enterprise"
                  ]
                },
                "displayName": {
                  "type": "string"
                }
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "eligiblePlans": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "individual",
              "business",
              "enterprise"
            ]
          }
        },
        "planOptions": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "displayName",
              "monthlyPrice",
              "currency"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "monthlyPrice": {
                "type": "number"
              },
              "currency": {
                "type": "string",
                "const": "USD"
              },
              "quote": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "amountDueNowCents",
                  "currency",
                  "prorationDate",
                  "nextRenewalAt",
                  "nextRenewalAmountCents",
                  "trialing"
                ],
                "properties": {
                  "amountDueNowCents": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "currency": {
                    "type": "string"
                  },
                  "prorationDate": {
                    "type": "integer"
                  },
                  "nextRenewalAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "nextRenewalAmountCents": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "trialing": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "confirmation": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "method",
            "path",
            "body"
          ],
          "properties": {
            "method": {
              "type": "string",
              "const": "POST"
            },
            "path": {
              "type": "string"
            },
            "body": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "planId"
              ],
              "properties": {
                "planId": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "AgentCheckoutConfirmationRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "planId"
      ],
      "properties": {
        "planId": {
          "type": "string",
          "enum": [
            "individual",
            "business",
            "enterprise"
          ]
        },
        "prorationDate": {
          "type": "integer"
        }
      }
    },
    "AgentCheckoutConfirmationResponse": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "ok",
            "mode",
            "planId",
            "checkoutUrl",
            "reused"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": true
            },
            "mode": {
              "type": "string",
              "const": "checkout"
            },
            "planId": {
              "type": "string",
              "enum": [
                "individual",
                "business",
                "enterprise"
              ]
            },
            "checkoutUrl": {
              "type": "string",
              "format": "uri"
            },
            "reused": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "ok",
            "mode",
            "planId",
            "planChangeId",
            "status",
            "paymentUrl",
            "amountDueCents",
            "currency"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": true
            },
            "mode": {
              "type": "string",
              "const": "plan_change"
            },
            "planId": {
              "type": "string",
              "enum": [
                "individual",
                "business",
                "enterprise"
              ]
            },
            "planChangeId": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "status": {
              "type": "string",
              "enum": [
                "processing",
                "payment_action_required"
              ]
            },
            "paymentUrl": {
              "type": [
                "string",
                "null"
              ],
              "format": "uri"
            },
            "amountDueCents": {
              "type": [
                "integer",
                "null"
              ]
            },
            "currency": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      ]
    },
    "AgentCheckoutCompletionRequest": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "sessionId"
          ],
          "properties": {
            "sessionId": {
              "type": "string",
              "pattern": "^cs_[A-Za-z0-9_]{1,255}$"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "planChangeId"
          ],
          "properties": {
            "planChangeId": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            }
          }
        }
      ]
    },
    "AgentCheckoutCompletionResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "purchaseRecorded",
        "planId",
        "planDisplayName",
        "operation",
        "requiredFeature"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "applied",
            "already_active",
            "processing",
            "no_longer_active",
            "payment_processing",
            "payment_failed",
            "not_paid",
            "expired",
            "payment_action_required",
            "refunded",
            "refund_failed"
          ]
        },
        "refundReason": {
          "type": "string",
          "enum": [
            "app_store_subscription",
            "account_mismatch"
          ]
        },
        "subscriptionCancelled": {
          "type": "boolean"
        },
        "paymentUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "purchaseRecorded": {
          "type": "boolean"
        },
        "planId": {
          "type": "string",
          "enum": [
            "individual",
            "business",
            "enterprise"
          ]
        },
        "planDisplayName": {
          "type": "string"
        },
        "operation": {
          "type": [
            "string",
            "null"
          ]
        },
        "requiredFeature": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentMailCompany": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentMailIdentity": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "agentId",
        "label",
        "program",
        "model",
        "parentAgentId",
        "sessionId",
        "runId",
        "capabilities",
        "status",
        "firstSeenAt",
        "lastSeenAt"
      ],
      "properties": {
        "agentId": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "program": {
          "type": "string"
        },
        "model": {
          "type": [
            "string",
            "null"
          ]
        },
        "parentAgentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "sessionId": {
          "type": [
            "string",
            "null"
          ]
        },
        "runId": {
          "type": [
            "string",
            "null"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 256
        },
        "status": {
          "type": "string"
        },
        "firstSeenAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastSeenAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentMailMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "messageId",
        "threadId",
        "senderAgentId",
        "to",
        "cc",
        "subject",
        "bodyMd",
        "importance",
        "ackRequired",
        "artifactRefs",
        "trace",
        "sentAt",
        "retainedUntil"
      ],
      "properties": {
        "messageId": {
          "type": "string"
        },
        "threadId": {
          "type": "string"
        },
        "senderAgentId": {
          "type": "string"
        },
        "to": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "agentId"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "agent"
              },
              "agentId": {
                "type": "string"
              }
            }
          },
          "maxItems": 100
        },
        "cc": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "agentId"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "agent"
              },
              "agentId": {
                "type": "string"
              }
            }
          },
          "maxItems": 100
        },
        "subject": {
          "type": "string",
          "maxLength": 512
        },
        "bodyMd": {
          "type": "string",
          "maxLength": 100000
        },
        "importance": {
          "type": "string",
          "enum": [
            "low",
            "normal",
            "high",
            "urgent"
          ]
        },
        "ackRequired": {
          "type": "boolean"
        },
        "artifactRefs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 100
        },
        "trace": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "sentAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "retainedUntil": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentMailDelivery": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "messageId",
        "recipientAgentId",
        "state",
        "stateAt"
      ],
      "properties": {
        "messageId": {
          "type": "string"
        },
        "recipientAgentId": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "pending_relay",
            "delivered",
            "fetched",
            "acked",
            "read"
          ]
        },
        "stateAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "AgentMailCapabilitiesResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mail",
        "operations"
      ],
      "properties": {
        "mail": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "availability",
            "available",
            "reason"
          ],
          "properties": {
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "claim_required",
                "setup_required",
                "temporarily_disabled"
              ]
            },
            "available": {
              "type": "boolean"
            },
            "reason": {
              "type": [
                "string",
                "null"
              ]
            },
            "company": {
              "$ref": "#/schemas/AgentMailCompany"
            },
            "identity": {
              "$ref": "#/schemas/AgentMailIdentity"
            }
          }
        },
        "operations": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentEffectiveOperation"
          }
        }
      }
    },
    "AgentMailIdentityListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "identities",
        "nextCursor"
      ],
      "properties": {
        "identities": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailIdentity"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentMailIdentityResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "identity",
        "company"
      ],
      "properties": {
        "identity": {
          "$ref": "#/schemas/AgentMailIdentity"
        },
        "company": {
          "$ref": "#/schemas/AgentMailCompany"
        }
      }
    },
    "AgentMailPeerListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "peers",
        "nextCursor"
      ],
      "properties": {
        "peers": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailIdentity"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentMailPeerResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "peer",
        "company"
      ],
      "properties": {
        "peer": {
          "$ref": "#/schemas/AgentMailIdentity"
        },
        "company": {
          "$ref": "#/schemas/AgentMailCompany"
        }
      }
    },
    "AgentMailMessageCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "to",
        "subject",
        "bodyMd"
      ],
      "properties": {
        "to": {
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "items": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "agentId"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "agent"
                  },
                  "agentId": {
                    "type": "string",
                    "maxLength": 256
                  }
                }
              }
            ]
          }
        },
        "cc": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "agentId"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "agent"
                  },
                  "agentId": {
                    "type": "string",
                    "maxLength": 256
                  }
                }
              }
            ]
          }
        },
        "subject": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "bodyMd": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100000
        },
        "importance": {
          "type": "string",
          "enum": [
            "low",
            "normal",
            "high",
            "urgent"
          ]
        },
        "ackRequired": {
          "type": "boolean"
        },
        "artifactRefs": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "threadId": {
          "type": "string",
          "maxLength": 512
        },
        "trace": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "runId": {
              "type": "string",
              "maxLength": 256
            },
            "sessionId": {
              "type": "string",
              "maxLength": 256
            },
            "taskRunId": {
              "type": "string",
              "maxLength": 256
            },
            "agentTurnId": {
              "type": "string",
              "maxLength": 256
            }
          }
        }
      }
    },
    "AgentMailReplyRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "bodyMd"
      ],
      "properties": {
        "to": {
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "items": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "agentId"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "agent"
                  },
                  "agentId": {
                    "type": "string",
                    "maxLength": 256
                  }
                }
              }
            ]
          }
        },
        "cc": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "agentId"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "agent"
                  },
                  "agentId": {
                    "type": "string",
                    "maxLength": 256
                  }
                }
              }
            ]
          }
        },
        "subject": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "bodyMd": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100000
        },
        "importance": {
          "type": "string",
          "enum": [
            "low",
            "normal",
            "high",
            "urgent"
          ]
        },
        "ackRequired": {
          "type": "boolean"
        },
        "artifactRefs": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "trace": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "runId": {
              "type": "string",
              "maxLength": 256
            },
            "sessionId": {
              "type": "string",
              "maxLength": 256
            },
            "taskRunId": {
              "type": "string",
              "maxLength": 256
            },
            "agentTurnId": {
              "type": "string",
              "maxLength": 256
            }
          }
        }
      }
    },
    "AgentMailInboxResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "messages",
        "nextCursor"
      ],
      "properties": {
        "messages": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "message",
              "delivery"
            ],
            "properties": {
              "message": {
                "$ref": "#/schemas/AgentMailMessage"
              },
              "delivery": {
                "$ref": "#/schemas/AgentMailDelivery"
              }
            }
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentMailDeliveryResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "messageId",
        "deliveries"
      ],
      "properties": {
        "messageId": {
          "type": "string"
        },
        "deliveries": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailDelivery"
          }
        }
      }
    },
    "AgentMailDeliveryMutationResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "delivery"
      ],
      "properties": {
        "delivery": {
          "$ref": "#/schemas/AgentMailDelivery"
        }
      }
    },
    "AgentMailEmptyMutationRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    },
    "AgentIntegrationTarget": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "scopeType",
        "scopeRef"
      ],
      "properties": {
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "company"
          ]
        },
        "scopeRef": {
          "type": "string",
          "maxLength": 512
        },
        "label": {
          "type": "string",
          "maxLength": 160
        }
      }
    },
    "AgentIntegrationCatalogEntry": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "providerId",
        "name",
        "description",
        "category",
        "authType",
        "authProvider",
        "capabilities",
        "scopesSupported",
        "tools",
        "serviceUrl",
        "authDocsUrl",
        "connectReady",
        "compatibility",
        "reason",
        "targetTypes"
      ],
      "properties": {
        "providerId": {
          "type": "string",
          "maxLength": 128
        },
        "name": {
          "type": "string",
          "maxLength": 160
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000
        },
        "category": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 128
        },
        "authType": {
          "type": "string",
          "enum": [
            "oauth",
            "api_key",
            "credentials",
            "none"
          ]
        },
        "authProvider": {
          "type": "string",
          "maxLength": 128
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128
          },
          "maxItems": 64,
          "uniqueItems": true
        },
        "scopesSupported": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128
          },
          "maxItems": 64,
          "uniqueItems": true
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 256
          },
          "maxItems": 64,
          "uniqueItems": true
        },
        "serviceUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "authDocsUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "connectReady": {
          "type": "boolean"
        },
        "compatibility": {
          "type": "string",
          "enum": [
            "supported",
            "configuration_required",
            "incompatible",
            "informational"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        },
        "targetTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "tenant",
              "company"
            ]
          },
          "uniqueItems": true
        }
      }
    },
    "AgentIntegrationCatalogResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "catalogVersion",
        "targets",
        "entries"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "catalogVersion": {
          "type": "string",
          "const": "agent-integrations-v1"
        },
        "targets": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentIntegrationTarget"
          },
          "maxItems": 256
        },
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentIntegrationCatalogEntry"
          },
          "maxItems": 4096
        }
      }
    },
    "AgentIntegrationConnectionsResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "scope",
        "connections"
      ],
      "properties": {
        "scope": {
          "$ref": "#/schemas/AgentIntegrationTarget"
        },
        "connections": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentIntegrationConnection"
          },
          "maxItems": 4096
        }
      }
    },
    "AgentIntegrationConnection": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "connectionId",
        "providerId",
        "authType",
        "scopeType",
        "scopeRef",
        "state",
        "grantedCapabilities",
        "attachedAgentIds",
        "accountLabel",
        "expiresAt",
        "lastVerifiedAt",
        "generation"
      ],
      "properties": {
        "connectionId": {
          "type": "string",
          "pattern": "^ic_[A-Za-z0-9_-]+$"
        },
        "providerId": {
          "type": "string",
          "maxLength": 128
        },
        "authType": {
          "type": "string",
          "enum": [
            "oauth",
            "api_key",
            "credentials",
            "none"
          ]
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "company"
          ]
        },
        "scopeRef": {
          "type": "string",
          "maxLength": 512
        },
        "state": {
          "type": "string",
          "enum": [
            "not_connected",
            "setup_requested",
            "human_action_required",
            "authorizing",
            "connected",
            "attached",
            "available",
            "reconnect_required",
            "suspended",
            "revoked"
          ]
        },
        "grantedCapabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128
          },
          "maxItems": 64,
          "uniqueItems": true
        },
        "attachedAgentIds": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 256
          },
          "maxItems": 256,
          "uniqueItems": true
        },
        "accountLabel": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 512
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastVerifiedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "generation": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "AgentIntegrationAttempt": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "attemptId",
        "providerId",
        "authType",
        "scopeType",
        "scopeRef",
        "requestedCapabilities",
        "state"
      ],
      "properties": {
        "attemptId": {
          "type": "string",
          "pattern": "^ia_[A-Za-z0-9_-]+$"
        },
        "providerId": {
          "type": "string",
          "maxLength": 128
        },
        "authType": {
          "type": "string",
          "enum": [
            "oauth",
            "api_key",
            "credentials",
            "none"
          ]
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "company"
          ]
        },
        "scopeRef": {
          "type": "string",
          "maxLength": 512
        },
        "requestedCapabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128
          },
          "maxItems": 64,
          "uniqueItems": true
        },
        "state": {
          "type": "string",
          "enum": [
            "setup_requested",
            "human_action_required",
            "authorizing",
            "connected",
            "cancelled",
            "expired",
            "failed"
          ]
        },
        "connectionId": {
          "type": "string",
          "pattern": "^ic_[A-Za-z0-9_-]+$"
        },
        "connectionGeneration": {
          "type": "integer",
          "minimum": 1
        },
        "humanAction": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "url",
            "expiresAt"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "open_url"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "pollAfterMs": {
          "type": "integer",
          "minimum": 1000
        },
        "error": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        }
      }
    },
    "AgentIntegrationAttemptResponse": {
      "$ref": "#/schemas/AgentIntegrationAttempt"
    },
    "AgentIntegrationAttemptCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "providerId"
      ],
      "properties": {
        "providerId": {
          "type": "string",
          "maxLength": 128
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "company"
          ]
        },
        "companyRef": {
          "type": "string",
          "maxLength": 512
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128
          },
          "maxItems": 64,
          "uniqueItems": true
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128
          },
          "maxItems": 64,
          "uniqueItems": true
        }
      }
    },
    "AgentIntegrationAttemptCancelRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    },
    "AgentIntegrationAttachRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "agentRef",
        "generation"
      ],
      "properties": {
        "agentRef": {
          "type": "string",
          "maxLength": 256
        },
        "generation": {
          "type": "integer",
          "minimum": 1
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "company"
          ]
        },
        "companyRef": {
          "type": "string",
          "maxLength": 512
        }
      }
    },
    "AgentIntegrationDetachRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "agentRef",
        "generation"
      ],
      "properties": {
        "agentRef": {
          "type": "string",
          "maxLength": 256
        },
        "generation": {
          "type": "integer",
          "minimum": 1
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "company"
          ]
        },
        "companyRef": {
          "type": "string",
          "maxLength": 512
        }
      }
    },
    "AgentIntegrationRevokeRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "generation"
      ],
      "properties": {
        "generation": {
          "type": "integer",
          "minimum": 1
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "company"
          ]
        },
        "companyRef": {
          "type": "string",
          "maxLength": 512
        }
      }
    },
    "AgentIntegrationConnectionResponse": {
      "$ref": "#/schemas/AgentIntegrationConnection"
    },
    "AgentIntegrationRevokeResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "connection",
        "providerRevocation"
      ],
      "properties": {
        "connection": {
          "$ref": "#/schemas/AgentIntegrationConnection"
        },
        "providerRevocation": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "completed",
                "pending"
              ]
            },
            "reason": {
              "type": "string",
              "maxLength": 128
            }
          }
        }
      }
    },
    "AgentApprovalListResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "approvals",
        "nextCursor"
      ],
      "properties": {
        "approvals": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentApprovalResource"
          },
          "maxItems": 100
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentApprovalResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "approval"
      ],
      "properties": {
        "approval": {
          "$ref": "#/schemas/AgentApprovalResource"
        }
      }
    },
    "AgentApprovalPolicyResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "agentRef",
        "effective",
        "source",
        "revision"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "agentRef": {
          "type": "string"
        },
        "effective": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "deterministic",
            "hardGates"
          ],
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "human_only",
                "policy_auto",
                "agent_delegate"
              ]
            },
            "deterministic": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "operationIds",
                "toolNames"
              ],
              "properties": {
                "operationIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "uniqueItems": true
                },
                "toolNames": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "uniqueItems": true
                }
              }
            },
            "hardGates": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            }
          }
        },
        "source": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "tenantDefault",
            "agentOverride",
            "tenantRevision",
            "agentRevision"
          ],
          "properties": {
            "tenantDefault": {
              "type": "string",
              "enum": [
                "configured",
                "implicit"
              ]
            },
            "agentOverride": {
              "type": "string",
              "enum": [
                "configured",
                "none"
              ]
            },
            "tenantRevision": {
              "type": "integer",
              "minimum": 1
            },
            "agentRevision": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 1
            }
          }
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedBy": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AgentApprovalSettingsHandoffRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "requestedPolicy": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "human_only",
                "policy_auto",
                "agent_delegate"
              ]
            },
            "operationIds": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 128
              },
              "maxItems": 64,
              "uniqueItems": true
            },
            "toolNames": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 256
              },
              "maxItems": 64,
              "uniqueItems": true
            }
          }
        },
        "policy": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "human_only",
                "policy_auto",
                "agent_delegate"
              ]
            },
            "operationIds": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 128
              },
              "maxItems": 64,
              "uniqueItems": true
            },
            "toolNames": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 256
              },
              "maxItems": 64,
              "uniqueItems": true
            }
          }
        },
        "mode": {
          "type": "string",
          "enum": [
            "human_only",
            "policy_auto",
            "agent_delegate"
          ]
        },
        "operationIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 64,
          "uniqueItems": true
        },
        "toolNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 64,
          "uniqueItems": true
        },
        "reason": {
          "type": "string",
          "maxLength": 1000
        }
      }
    },
    "AgentApprovalSettingsHandoffResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "handoffRef",
        "status",
        "purpose",
        "audience",
        "expiresAt",
        "authority"
      ],
      "properties": {
        "handoffRef": {
          "type": "string",
          "minLength": 32,
          "maxLength": 128
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "completed",
            "cancelled",
            "expired"
          ]
        },
        "purpose": {
          "type": "string",
          "const": "agent_approval_settings_change"
        },
        "audience": {
          "type": "string",
          "const": "neotask-human-agent-approval-settings-v1"
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "completedAt": {
          "type": "string",
          "format": "date-time"
        },
        "cancelledAt": {
          "type": "string",
          "format": "date-time"
        },
        "requestedPolicy": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "human_only",
                "policy_auto",
                "agent_delegate"
              ]
            },
            "operationIds": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 128
              },
              "maxItems": 64,
              "uniqueItems": true
            },
            "toolNames": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 256
              },
              "maxItems": 64,
              "uniqueItems": true
            }
          }
        },
        "reason": {
          "type": "string"
        },
        "handoffUrl": {
          "type": "string",
          "format": "uri"
        },
        "authority": {
          "type": "string",
          "const": "none"
        }
      }
    },
    "AgentApprovalSettingsHandoffResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "handoff"
      ],
      "properties": {
        "handoff": {
          "$ref": "#/schemas/AgentApprovalSettingsHandoffResource"
        },
        "handoffRef": {
          "type": "string"
        },
        "handoffUrl": {
          "type": "string",
          "format": "uri"
        },
        "authority": {
          "type": "string",
          "const": "none"
        }
      }
    },
    "AgentApprovalDecisionRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "decision",
        "operationId",
        "normalizedArgsDigest",
        "scopeType",
        "policyRevision"
      ],
      "properties": {
        "decision": {
          "type": "string",
          "enum": [
            "approved",
            "denied"
          ]
        },
        "operationId": {
          "type": "string"
        },
        "toolName": {
          "type": "string"
        },
        "normalizedArgsDigest": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "standalone_agent",
            "company"
          ]
        },
        "scopeRef": {
          "type": "string"
        },
        "policyRevision": {
          "type": "integer",
          "minimum": 1
        },
        "agentRef": {
          "type": "string"
        },
        "message": {
          "type": "string",
          "maxLength": 2000
        }
      }
    },
    "AgentApprovalDecisionResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "approval",
        "delegation"
      ],
      "properties": {
        "approval": {
          "$ref": "#/schemas/AgentApprovalResource"
        },
        "delegation": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "usesRemaining"
          ],
          "properties": {
            "delegationRef": {
              "type": "string"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "readOnly": true,
              "description": "The server-owned grant version consumed by this decision. A later revocation can increase the current grant version."
            },
            "usesRemaining": {
              "type": "integer",
              "minimum": 0
            }
          }
        }
      }
    },
    "SharedRateLimitError": {
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "object",
          "additionalProperties": true,
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "quota_exhausted"
            },
            "reason": {
              "type": "string",
              "const": "request_rate_limit"
            },
            "message": {
              "type": "string"
            }
          }
        }
      },
      "description": "Shared HTTP admission response. This response can be produced before the request reaches the Agent API router."
    },
    "AgentPreparedToolsView": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "agentRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "runRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "capabilityDigest": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "complete": {
          "type": "boolean",
          "const": true
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "prepared_capability_required"
            },
            {
              "type": "null"
            }
          ]
        },
        "tools": {
          "maxItems": 4096,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "toolId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "source": {
                "type": "string",
                "enum": [
                  "gateway_core",
                  "reviewed_plugin",
                  "mcp"
                ]
              },
              "availability": {
                "type": "string",
                "enum": [
                  "available",
                  "claim_required",
                  "setup_required",
                  "plan_required",
                  "temporarily_disabled"
                ]
              },
              "reason": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "tool_inventory_unavailable",
                      "tool_not_prepared",
                      "runner_tool_unavailable",
                      "tool_source_unreviewed",
                      "runtime_profile_stale",
                      "tool_policy_denied",
                      "verified_user_claim_required",
                      "company_access_denied",
                      "company_context_required",
                      "hipaa_disabled",
                      "plan_feature_required",
                      "integration_scope_mismatch",
                      "integration_connection_required",
                      "integration_unavailable",
                      "integration_inventory_stale",
                      "prepared_capability_required"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "approvalClass": {
                "type": "string",
                "const": "request_specific"
              },
              "approvalPolicyOperationId": {
                "type": "string",
                "const": "getEffectiveAgentApprovalPolicy"
              },
              "setupOperationIds": {
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9]{0,159}$"
                }
              },
              "documentationUrl": {
                "type": "string",
                "maxLength": 512,
                "pattern": "^https:\\/\\/neotask\\.ai\\/docs\\/api\\/[A-Za-z0-9/_-]+\\.md$"
              },
              "actions": {
                "minItems": 9,
                "maxItems": 9,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "actionId": {
                      "type": "string",
                      "enum": [
                        "status",
                        "list",
                        "get",
                        "add",
                        "update",
                        "remove",
                        "run",
                        "runs",
                        "wake"
                      ]
                    },
                    "availability": {
                      "type": "string",
                      "enum": [
                        "available",
                        "plan_required",
                        "temporarily_disabled",
                        "setup_required"
                      ]
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "plan_required",
                            "subscription_blocked",
                            "overage_recovery_required",
                            "tenant_not_found",
                            "action_authority_unavailable",
                            "prepared_capability_required"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvalClass": {
                      "type": "string",
                      "const": "request_specific"
                    },
                    "requestExceptions": {
                      "maxItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "const": "managed_memory_dreaming"
                      }
                    },
                    "setupOperationIds": {
                      "maxItems": 16,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z][A-Za-z0-9]{0,159}$"
                      }
                    },
                    "documentationUrl": {
                      "type": "string",
                      "maxLength": 512,
                      "pattern": "^https:\\/\\/neotask\\.ai\\/docs\\/api\\/[A-Za-z0-9/_-]+\\.md$"
                    }
                  },
                  "required": [
                    "actionId",
                    "availability",
                    "reason",
                    "approvalClass",
                    "requestExceptions",
                    "setupOperationIds",
                    "documentationUrl"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "toolId",
              "source",
              "availability",
              "reason",
              "approvalClass",
              "approvalPolicyOperationId",
              "setupOperationIds",
              "documentationUrl"
            ],
            "additionalProperties": false
          }
        },
        "skills": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "instructions"
            },
            "executionAuthority": {
              "type": "string",
              "const": "none"
            },
            "providerReadiness": {
              "type": "string",
              "const": "request_specific"
            },
            "complete": {
              "type": "boolean"
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "prepared_capability_required",
                    "skill_inventory_unavailable"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "entries": {
              "maxItems": 4096,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "skillId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "source": {
                    "type": "string",
                    "const": "skill"
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "setup_required"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "prepared_capability_required"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "approvalClass": {
                    "type": "string",
                    "const": "none"
                  },
                  "setupOperationIds": {
                    "maxItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "const": "getRun"
                    }
                  },
                  "documentationUrl": {
                    "type": "string",
                    "maxLength": 512,
                    "pattern": "^https:\\/\\/neotask\\.ai\\/docs\\/api\\/[A-Za-z0-9/_-]+\\.md$"
                  }
                },
                "required": [
                  "skillId",
                  "source",
                  "availability",
                  "reason",
                  "approvalClass",
                  "setupOperationIds",
                  "documentationUrl"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "kind",
            "executionAuthority",
            "providerReadiness",
            "complete",
            "reason",
            "entries"
          ],
          "additionalProperties": false
        },
        "approval": {
          "type": "object",
          "properties": {
            "schemaVersion": {
              "type": "number",
              "const": 1
            },
            "agentRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
            },
            "observedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            "policy": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "human_only",
                    "policy_auto",
                    "agent_delegate"
                  ]
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "tenantRevision": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "agentRevision": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "tenantRevision",
                    "agentRevision"
                  ],
                  "additionalProperties": false
                },
                "deterministic": {
                  "type": "object",
                  "properties": {
                    "operationIds": {
                      "maxItems": 64,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160,
                        "pattern": "^(?![\\s\\S]*[*?[\\]{}])[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      }
                    },
                    "toolNames": {
                      "maxItems": 64,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160,
                        "pattern": "^(?![\\s\\S]*[*?[\\]{}])[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      }
                    }
                  },
                  "required": [
                    "operationIds",
                    "toolNames"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "mode",
                "source",
                "deterministic"
              ],
              "additionalProperties": false
            },
            "runtimeApprovalReview": {
              "type": "string",
              "const": "human_required"
            },
            "workloadMcpApprovalReview": {
              "type": "string",
              "const": "human_required"
            },
            "delegations": {
              "type": "object",
              "properties": {
                "appliesTo": {
                  "type": "string",
                  "const": "public_agent_approval_decisions"
                },
                "authority": {
                  "type": "string",
                  "const": "none"
                },
                "complete": {
                  "type": "boolean",
                  "const": true
                },
                "grants": {
                  "maxItems": 4096,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "delegationRef": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      "operationId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160,
                        "pattern": "^(?![\\s\\S]*[*?[\\]{}])[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      "toolName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 160,
                            "pattern": "^(?![\\s\\S]*[*?[\\]{}])[\\u0020-\\u007e\\u0080-\\uffff]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "normalizedArgsDigest": {
                        "type": "string",
                        "pattern": "^sha256:[a-f0-9]{64}$"
                      },
                      "scope": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "tenant",
                              "standalone_agent",
                              "company"
                            ]
                          },
                          "ref": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 256,
                                "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "ref"
                        ],
                        "additionalProperties": false
                      },
                      "generation": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "expiresAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      },
                      "limits": {
                        "type": "object",
                        "properties": {
                          "maxUses": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "used": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "remaining": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "maxUses",
                          "used",
                          "remaining"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "delegationRef",
                      "operationId",
                      "toolName",
                      "normalizedArgsDigest",
                      "scope",
                      "generation",
                      "expiresAt",
                      "limits"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "appliesTo",
                "authority",
                "complete",
                "grants"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "schemaVersion",
            "agentRef",
            "observedAt",
            "policy",
            "runtimeApprovalReview",
            "workloadMcpApprovalReview",
            "delegations"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "schemaVersion",
        "agentRef",
        "runRef",
        "capabilityDigest",
        "complete",
        "reason",
        "tools",
        "skills",
        "approval"
      ],
      "additionalProperties": false
    },
    "EmptyOperationRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {},
      "required": []
    },
    "AgentMailWaitEventsResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "events": {
          "$ref": "#/schemas/AgentMailEventsResponse/properties/events"
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "waitedMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000,
          "description": "Requested wait budget in milliseconds; already available events return immediately."
        }
      },
      "required": [
        "events",
        "nextCursor",
        "waitedMs"
      ]
    },
    "ManagedAgentResource": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "behaviorSummary": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "standalone",
            "company"
          ]
        },
        "lifecycleState": {
          "type": "string",
          "enum": [
            "active",
            "archived"
          ]
        },
        "companyId": {
          "type": "string"
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "name",
        "scopeType",
        "lifecycleState",
        "createdAt",
        "updatedAt"
      ]
    },
    "ManagedAgentResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "agent": {
          "$ref": "#/schemas/ManagedAgentResource"
        }
      },
      "required": [
        "agent"
      ]
    },
    "ManagedAgentUpdateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000
        },
        "behaviorSummary": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "emoji": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000
        },
        "avatar": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000
        },
        "workspace": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000
        }
      },
      "required": [],
      "minProperties": 1
    },
    "AgentToolPolicyEntry": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "allowedTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "An empty list permits all tools for an enabled provider. Agent updates may not widen the current effective rule."
        },
        "deniedTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Explicit denials take precedence over allowedTools."
        }
      },
      "required": [
        "enabled",
        "allowedTools",
        "deniedTools"
      ]
    },
    "AgentToolPolicy": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "integer",
          "const": 1
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "companyId": {
          "type": "string"
        },
        "defaultMode": {
          "type": "string",
          "enum": [
            "allow_all_connected",
            "deny_all"
          ]
        },
        "appPolicies": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/schemas/AgentToolPolicyEntry"
          }
        },
        "updatedAt": {
          "type": "number"
        },
        "updatedBy": {
          "type": "string"
        }
      },
      "required": [
        "version",
        "revision",
        "companyId",
        "defaultMode",
        "appPolicies",
        "updatedAt"
      ]
    },
    "AgentToolPolicyResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "agentId": {
          "type": "string"
        },
        "policy": {
          "$ref": "#/schemas/AgentToolPolicy"
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "runtimePolicy": {
          "$ref": "#/schemas/AgentRuntimeToolPolicy"
        }
      },
      "required": [
        "agentId",
        "policy",
        "runtimePolicy",
        "revision"
      ]
    },
    "AgentRuntimeToolPolicy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "profile",
        "allow",
        "deny"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "profile": {
          "type": "string",
          "enum": [
            "full",
            "minimal",
            "coding",
            "messaging"
          ],
          "description": "An additional runtime profile restriction. Full leaves the other execution checks unchanged."
        },
        "allow": {
          "type": [
            "array",
            "null"
          ],
          "maxItems": 4096,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "description": "Exact case-sensitive runtime tool names, each at most 512 UTF-8 bytes. Null retains the profile; an empty array denies every tool. Wildcards are literal names."
        },
        "deny": {
          "type": "array",
          "maxItems": 4096,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "description": "Exact runtime tool names to deny. Denials take precedence. The combined serialized name lists must fit in 256 KiB."
        }
      }
    },
    "AgentToolPolicyUpdateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "expectedRevision": {
          "type": "integer",
          "minimum": 1
        },
        "defaultMode": {
          "type": "string",
          "enum": [
            "allow_all_connected",
            "deny_all"
          ]
        },
        "appPolicies": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "allowedTools": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "An empty list permits all tools for an enabled provider. Agent updates may not widen the current effective rule."
              },
              "deniedTools": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Explicit denials take precedence over allowedTools."
              }
            },
            "required": []
          }
        },
        "runtimePolicy": {
          "$ref": "#/schemas/AgentRuntimeToolPolicy"
        }
      },
      "required": []
    },
    "AgentEffectiveTool": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "toolName": {
          "type": "string"
        },
        "canonicalName": {
          "type": "string"
        },
        "allowed": {
          "type": "boolean"
        },
        "reasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "toolName",
        "canonicalName",
        "allowed",
        "reasons"
      ]
    },
    "AgentEffectiveToolProvider": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "providerKey": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "ready": {
          "type": "boolean"
        },
        "toolAccessMode": {
          "type": "string",
          "enum": [
            "allowed",
            "partial",
            "blocked"
          ]
        },
        "allowedToolNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "deniedToolNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "staleToolNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentEffectiveTool"
          }
        }
      },
      "required": [
        "providerKey",
        "displayName",
        "ready",
        "toolAccessMode",
        "allowedToolNames",
        "deniedToolNames",
        "staleToolNames",
        "tools"
      ]
    },
    "AgentEffectiveToolsResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "agentRef": {
          "type": "string",
          "maxLength": 200
        },
        "runRef": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200
        },
        "capabilityDigest": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[a-f0-9]{64}$",
          "description": "The server-checked prepared capability digest for the selected run. Null when no bound preparation was selected."
        },
        "complete": {
          "type": "boolean",
          "description": "Whether tools contains a complete selected-run inventory. False with run_selection_required means no runtime was selected."
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "run_selection_required",
            "prepared_capability_required",
            null
          ]
        },
        "tools": {
          "type": "array",
          "maxItems": 4096,
          "items": {
            "$ref": "#/schemas/AgentEffectiveRuntimeTool"
          }
        },
        "skills": {
          "$ref": "#/schemas/AgentEffectiveSkills"
        },
        "approval": {
          "$ref": "#/schemas/AgentEffectiveToolApproval"
        },
        "agentId": {
          "type": "string"
        },
        "policyRevision": {
          "type": "integer",
          "minimum": 1
        },
        "providers": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentEffectiveToolProvider"
          }
        },
        "allowedToolNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "deniedToolNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "staleToolNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "preparedRun": {
          "$ref": "#/schemas/AgentPreparedRunTools"
        }
      },
      "required": [
        "agentId",
        "policyRevision",
        "providers",
        "allowedToolNames",
        "deniedToolNames",
        "staleToolNames"
      ]
    },
    "AgentEffectiveToolApproval": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "agentRef": {
          "type": "string",
          "maxLength": 256
        },
        "observedAt": {
          "type": "string",
          "format": "date-time"
        },
        "policy": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "human_only",
                "policy_auto",
                "agent_delegate"
              ]
            },
            "source": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "tenantRevision": {
                  "type": "integer",
                  "minimum": 1
                },
                "agentRevision": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1
                }
              },
              "required": [
                "tenantRevision",
                "agentRevision"
              ]
            },
            "deterministic": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "operationIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 64
                },
                "toolNames": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 64
                }
              },
              "required": [
                "operationIds",
                "toolNames"
              ]
            }
          },
          "required": [
            "mode",
            "source",
            "deterministic"
          ]
        },
        "runtimeApprovalReview": {
          "type": "string",
          "const": "human_required"
        },
        "workloadMcpApprovalReview": {
          "type": "string",
          "const": "human_required"
        },
        "delegations": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "appliesTo": {
              "type": "string",
              "const": "public_agent_approval_decisions"
            },
            "authority": {
              "type": "string",
              "const": "none"
            },
            "complete": {
              "type": "boolean",
              "const": true
            },
            "grants": {
              "type": "array",
              "maxItems": 4096,
              "items": {
                "$ref": "#/schemas/AgentEffectiveApprovalGrant"
              }
            }
          },
          "required": [
            "appliesTo",
            "authority",
            "complete",
            "grants"
          ]
        }
      },
      "required": [
        "schemaVersion",
        "agentRef",
        "observedAt",
        "policy",
        "runtimeApprovalReview",
        "workloadMcpApprovalReview",
        "delegations"
      ]
    },
    "AgentEffectiveSkills": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "type": "string",
          "const": "instructions"
        },
        "executionAuthority": {
          "type": "string",
          "const": "none"
        },
        "providerReadiness": {
          "type": "string",
          "const": "request_specific"
        },
        "complete": {
          "type": "boolean"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "run_selection_required",
            "prepared_capability_required",
            "skill_inventory_unavailable",
            null
          ]
        },
        "entries": {
          "type": "array",
          "maxItems": 4096,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "skillId": {
                "type": "string",
                "maxLength": 512,
                "minLength": 1
              },
              "source": {
                "type": "string",
                "const": "skill"
              },
              "availability": {
                "type": "string",
                "enum": [
                  "available",
                  "setup_required"
                ]
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "prepared_capability_required",
                  null
                ]
              },
              "approvalClass": {
                "type": "string",
                "const": "none"
              },
              "setupOperationIds": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "const": "getRun"
                }
              },
              "documentationUrl": {
                "type": "string",
                "pattern": "^https://neotask\\.ai/docs/api/[^?#]+\\.md$"
              }
            },
            "required": [
              "skillId",
              "source",
              "availability",
              "reason",
              "approvalClass",
              "setupOperationIds",
              "documentationUrl"
            ]
          }
        }
      },
      "required": [
        "kind",
        "executionAuthority",
        "providerReadiness",
        "complete",
        "reason",
        "entries"
      ]
    },
    "AgentEffectiveApprovalGrant": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "delegationRef": {
          "type": "string",
          "maxLength": 128
        },
        "operationId": {
          "type": "string",
          "maxLength": 160
        },
        "toolName": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 160
        },
        "normalizedArgsDigest": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        },
        "scope": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "tenant",
                "standalone_agent",
                "company"
              ]
            },
            "ref": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 256
            }
          },
          "required": [
            "type",
            "ref"
          ]
        },
        "generation": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "limits": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "maxUses": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "used": {
              "type": "integer",
              "minimum": 0,
              "maximum": 99
            },
            "remaining": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          "required": [
            "maxUses",
            "used",
            "remaining"
          ]
        }
      },
      "required": [
        "delegationRef",
        "operationId",
        "toolName",
        "normalizedArgsDigest",
        "scope",
        "generation",
        "expiresAt",
        "limits"
      ]
    },
    "AgentEffectiveRuntimeTool": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "toolId": {
          "type": "string",
          "maxLength": 512,
          "minLength": 1
        },
        "source": {
          "type": "string",
          "enum": [
            "gateway_core",
            "reviewed_plugin",
            "mcp"
          ]
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "claim_required",
            "setup_required",
            "approval_required",
            "plan_required",
            "quota_exhausted",
            "model_not_allowed",
            "temporarily_disabled"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "tool_inventory_unavailable",
            "tool_not_prepared",
            "runner_tool_unavailable",
            "tool_source_unreviewed",
            "runtime_profile_stale",
            "tool_policy_denied",
            "verified_user_claim_required",
            "company_access_denied",
            "company_context_required",
            "hipaa_disabled",
            "plan_feature_required",
            "integration_scope_mismatch",
            "integration_connection_required",
            "integration_unavailable",
            "integration_inventory_stale",
            "run_selection_required",
            "prepared_capability_required",
            null
          ]
        },
        "approvalClass": {
          "type": "string",
          "const": "request_specific",
          "description": "The exact invocation must pass current approval checks. This read cannot approve arguments or claim a matching delegation."
        },
        "approvalPolicyOperationId": {
          "type": "string",
          "const": "getEffectiveAgentApprovalPolicy"
        },
        "actions": {
          "type": "array",
          "minItems": 9,
          "maxItems": 9,
          "items": {
            "$ref": "#/schemas/AgentEffectiveRuntimeToolAction"
          },
          "allOf": [
            {
              "contains": {
                "type": "object",
                "properties": {
                  "actionId": {
                    "const": "status"
                  }
                },
                "required": [
                  "actionId"
                ]
              }
            },
            {
              "contains": {
                "type": "object",
                "properties": {
                  "actionId": {
                    "const": "list"
                  }
                },
                "required": [
                  "actionId"
                ]
              }
            },
            {
              "contains": {
                "type": "object",
                "properties": {
                  "actionId": {
                    "const": "get"
                  }
                },
                "required": [
                  "actionId"
                ]
              }
            },
            {
              "contains": {
                "type": "object",
                "properties": {
                  "actionId": {
                    "const": "add"
                  }
                },
                "required": [
                  "actionId"
                ]
              }
            },
            {
              "contains": {
                "type": "object",
                "properties": {
                  "actionId": {
                    "const": "update"
                  }
                },
                "required": [
                  "actionId"
                ]
              }
            },
            {
              "contains": {
                "type": "object",
                "properties": {
                  "actionId": {
                    "const": "remove"
                  }
                },
                "required": [
                  "actionId"
                ]
              }
            },
            {
              "contains": {
                "type": "object",
                "properties": {
                  "actionId": {
                    "const": "run"
                  }
                },
                "required": [
                  "actionId"
                ]
              }
            },
            {
              "contains": {
                "type": "object",
                "properties": {
                  "actionId": {
                    "const": "runs"
                  }
                },
                "required": [
                  "actionId"
                ]
              }
            },
            {
              "contains": {
                "type": "object",
                "properties": {
                  "actionId": {
                    "const": "wake"
                  }
                },
                "required": [
                  "actionId"
                ]
              }
            }
          ]
        },
        "setupOperationIds": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "enum": [
              "listAgentCompanies",
              "getAgentCompany",
              "listAgentCompanyAgents",
              "listAgentCompanyTasks",
              "getAgentCompanyTask",
              "listAgentCompanyRuns",
              "getAgentCompanyRun",
              "listInsightBoards",
              "getInsightBoard",
              "getInsightBoardPublication",
              "publishInsightBoard",
              "unpublishInsightBoard",
              "rotateInsightBoardLink",
              "setInsightBoardVisibility",
              "listInsightBoardGrants",
              "createInsightBoardGrant",
              "revokeInsightBoardGrant",
              "getAgentProfile",
              "getAgentCapabilities",
              "getAgentOnboarding",
              "listAgents",
              "createAgent",
              "getAgent",
              "updateAgent",
              "archiveAgent",
              "restoreAgent",
              "getAgentEffectiveTools",
              "getAgentToolPolicy",
              "updateAgentToolPolicy",
              "listAgentConversations",
              "createAgentConversation",
              "getAgentConversation",
              "archiveAgentConversation",
              "restoreAgentConversation",
              "listAgentConversationMessages",
              "createAgentConversationTurn",
              "getAgentConversationTurn",
              "cancelAgentConversationTurn",
              "listAgentConversationTurnEvents",
              "streamAgentConversationTurnEvents",
              "listTasks",
              "createTask",
              "listAgentCronJobs",
              "createAgentCronJob",
              "getAgentCronJob",
              "updateAgentCronJob",
              "enableAgentCronJob",
              "disableAgentCronJob",
              "runAgentCronJob",
              "listAgentCronJobRuns",
              "deleteAgentCronJob",
              "listAgentAutomationCatalog",
              "listAgentAutomations",
              "createAgentAutomation",
              "getAgentAutomation",
              "updateAgentAutomation",
              "deleteAgentAutomation",
              "startAgentAutomation",
              "getAgentAutomationStatus",
              "pauseAgentAutomation",
              "resumeAgentAutomation",
              "cancelAgentAutomation",
              "listAgentAutomationRuns",
              "getRun",
              "createRun",
              "listAgentRunEvents",
              "streamAgentRunEvents",
              "listAgentAutonomyGoals",
              "createAgentAutonomyGoal",
              "getAgentAutonomyGoal",
              "updateAgentAutonomyGoal",
              "startAgentAutonomyGoal",
              "getAgentAutonomyGoalStatus",
              "steerAgentAutonomyGoal",
              "pauseAgentAutonomyGoal",
              "resumeAgentAutonomyGoal",
              "cancelAgentAutonomyGoal",
              "listAgentAutonomyGoalRuns",
              "listAgentApprovals",
              "getAgentApproval",
              "createAgentApprovalHandoff",
              "getAgentApprovalHandoff",
              "cancelAgentApprovalHandoff",
              "listAgentApprovalEvents",
              "streamAgentApprovalEvents",
              "getEffectiveAgentApprovalPolicy",
              "createAgentApprovalSettingsHandoff",
              "getAgentApprovalSettingsHandoff",
              "cancelAgentApprovalSettingsHandoff",
              "decideAgentApproval",
              "getUsage",
              "listAgentSkills",
              "listDesktopDownloadOptions",
              "requestAgentSkillConfiguration",
              "getAgentMcpCatalog",
              "getAgentCliMetadata",
              "listAgentModels",
              "setAgentModel",
              "getAgentMailCapabilities",
              "requestAgentMailMembership",
              "joinAgentMailMembership",
              "getAgentMailMembership",
              "approveAgentMailMembership",
              "suspendAgentMailMembership",
              "leaveAgentMailMembership",
              "revokeAgentMailMembership",
              "listAgentMailIdentities",
              "getAgentMailIdentity",
              "listAgentMailPeers",
              "getAgentMailPeer",
              "sendAgentMailMessage",
              "replyAgentMailMessage",
              "listAgentMailInbox",
              "getAgentMailEvents",
              "getAgentMailDelivery",
              "acknowledgeAgentMailDelivery",
              "markAgentMailRead",
              "revokeAgentRegistration",
              "createAgentAccountPairingHandoff",
              "requestAgentCheckoutHandoff",
              "getAgentAccountPairingHandoff",
              "cancelAgentAccountPairingHandoff",
              "createRunnerEnrollment",
              "listAgentRunners",
              "rotateAgentRunner",
              "revokeAgentRunner",
              "listAgentIntegrationCatalog",
              "listAgentIntegrationConnections",
              "createAgentIntegrationAttempt",
              "getAgentIntegrationAttempt",
              "cancelAgentIntegrationAttempt",
              "attachAgentIntegration",
              "detachAgentIntegration",
              "revokeAgentIntegration",
              "getAgentMailThread",
              "searchAgentMailThreads",
              "summarizeAgentMailThread",
              "requestAgentMailContact",
              "respondAgentMailContact",
              "listAgentMailContacts",
              "setAgentMailContactPolicy",
              "listAgentMailSectors",
              "getAgentMailSectorFeed",
              "broadcastAgentMailSector",
              "announceAgentMailHandoff",
              "attachAgentMailTrace",
              "waitForAgentMailEvents",
              "recoverAgentMailEvents",
              "exportAgentMailData",
              "eraseAgentMailData",
              "revokeAgentMailAccess",
              "searchConstructPackages",
              "getConstructPackage",
              "listConstructPackageVersions",
              "getConstructReleaseReadiness",
              "matchConstructContent",
              "resolveConstructArtifact",
              "getConstructGrantManifest",
              "reportConstructInstall",
              "reportConstructPackage"
            ]
          }
        },
        "documentationUrl": {
          "type": "string",
          "pattern": "^https://neotask\\.ai/docs/api/[^?#]+\\.md$"
        }
      },
      "required": [
        "toolId",
        "source",
        "availability",
        "reason",
        "approvalClass",
        "approvalPolicyOperationId",
        "setupOperationIds",
        "documentationUrl"
      ],
      "anyOf": [
        {
          "properties": {
            "availability": {
              "const": "available"
            },
            "reason": {
              "type": "null"
            }
          }
        },
        {
          "properties": {
            "availability": {
              "enum": [
                "claim_required",
                "setup_required",
                "approval_required",
                "plan_required",
                "quota_exhausted",
                "model_not_allowed",
                "temporarily_disabled"
              ]
            },
            "reason": {
              "type": "string"
            }
          }
        }
      ],
      "allOf": [
        {
          "if": {
            "required": [
              "actions"
            ]
          },
          "then": {
            "properties": {
              "toolId": {
                "const": "cron"
              },
              "source": {
                "const": "gateway_core"
              }
            }
          }
        }
      ]
    },
    "AgentEffectiveRuntimeToolAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "actionId": {
          "type": "string",
          "enum": [
            "status",
            "list",
            "get",
            "add",
            "update",
            "remove",
            "run",
            "runs",
            "wake"
          ]
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "plan_required",
            "temporarily_disabled",
            "setup_required"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "plan_required",
            "subscription_blocked",
            "overage_recovery_required",
            "tenant_not_found",
            "action_authority_unavailable",
            "prepared_capability_required",
            null
          ]
        },
        "approvalClass": {
          "type": "string",
          "const": "request_specific"
        },
        "requestExceptions": {
          "type": "array",
          "maxItems": 1,
          "items": {
            "type": "string",
            "const": "managed_memory_dreaming"
          }
        },
        "setupOperationIds": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "enum": [
              "listAgentCompanies",
              "getAgentCompany",
              "listAgentCompanyAgents",
              "listAgentCompanyTasks",
              "getAgentCompanyTask",
              "listAgentCompanyRuns",
              "getAgentCompanyRun",
              "listInsightBoards",
              "getInsightBoard",
              "getInsightBoardPublication",
              "publishInsightBoard",
              "unpublishInsightBoard",
              "rotateInsightBoardLink",
              "setInsightBoardVisibility",
              "listInsightBoardGrants",
              "createInsightBoardGrant",
              "revokeInsightBoardGrant",
              "getAgentProfile",
              "getAgentCapabilities",
              "getAgentOnboarding",
              "listAgents",
              "createAgent",
              "getAgent",
              "updateAgent",
              "archiveAgent",
              "restoreAgent",
              "getAgentEffectiveTools",
              "getAgentToolPolicy",
              "updateAgentToolPolicy",
              "listAgentConversations",
              "createAgentConversation",
              "getAgentConversation",
              "archiveAgentConversation",
              "restoreAgentConversation",
              "listAgentConversationMessages",
              "createAgentConversationTurn",
              "getAgentConversationTurn",
              "cancelAgentConversationTurn",
              "listAgentConversationTurnEvents",
              "streamAgentConversationTurnEvents",
              "listTasks",
              "createTask",
              "listAgentCronJobs",
              "createAgentCronJob",
              "getAgentCronJob",
              "updateAgentCronJob",
              "enableAgentCronJob",
              "disableAgentCronJob",
              "runAgentCronJob",
              "listAgentCronJobRuns",
              "deleteAgentCronJob",
              "listAgentAutomationCatalog",
              "listAgentAutomations",
              "createAgentAutomation",
              "getAgentAutomation",
              "updateAgentAutomation",
              "deleteAgentAutomation",
              "startAgentAutomation",
              "getAgentAutomationStatus",
              "pauseAgentAutomation",
              "resumeAgentAutomation",
              "cancelAgentAutomation",
              "listAgentAutomationRuns",
              "getRun",
              "createRun",
              "listAgentRunEvents",
              "streamAgentRunEvents",
              "listAgentAutonomyGoals",
              "createAgentAutonomyGoal",
              "getAgentAutonomyGoal",
              "updateAgentAutonomyGoal",
              "startAgentAutonomyGoal",
              "getAgentAutonomyGoalStatus",
              "steerAgentAutonomyGoal",
              "pauseAgentAutonomyGoal",
              "resumeAgentAutonomyGoal",
              "cancelAgentAutonomyGoal",
              "listAgentAutonomyGoalRuns",
              "listAgentApprovals",
              "getAgentApproval",
              "createAgentApprovalHandoff",
              "getAgentApprovalHandoff",
              "cancelAgentApprovalHandoff",
              "listAgentApprovalEvents",
              "streamAgentApprovalEvents",
              "getEffectiveAgentApprovalPolicy",
              "createAgentApprovalSettingsHandoff",
              "getAgentApprovalSettingsHandoff",
              "cancelAgentApprovalSettingsHandoff",
              "decideAgentApproval",
              "getUsage",
              "listAgentSkills",
              "listDesktopDownloadOptions",
              "requestAgentSkillConfiguration",
              "getAgentMcpCatalog",
              "getAgentCliMetadata",
              "listAgentModels",
              "setAgentModel",
              "getAgentMailCapabilities",
              "requestAgentMailMembership",
              "joinAgentMailMembership",
              "getAgentMailMembership",
              "approveAgentMailMembership",
              "suspendAgentMailMembership",
              "leaveAgentMailMembership",
              "revokeAgentMailMembership",
              "listAgentMailIdentities",
              "getAgentMailIdentity",
              "listAgentMailPeers",
              "getAgentMailPeer",
              "sendAgentMailMessage",
              "replyAgentMailMessage",
              "listAgentMailInbox",
              "getAgentMailEvents",
              "getAgentMailDelivery",
              "acknowledgeAgentMailDelivery",
              "markAgentMailRead",
              "revokeAgentRegistration",
              "createAgentAccountPairingHandoff",
              "requestAgentCheckoutHandoff",
              "getAgentAccountPairingHandoff",
              "cancelAgentAccountPairingHandoff",
              "createRunnerEnrollment",
              "listAgentRunners",
              "rotateAgentRunner",
              "revokeAgentRunner",
              "listAgentIntegrationCatalog",
              "listAgentIntegrationConnections",
              "createAgentIntegrationAttempt",
              "getAgentIntegrationAttempt",
              "cancelAgentIntegrationAttempt",
              "attachAgentIntegration",
              "detachAgentIntegration",
              "revokeAgentIntegration",
              "getAgentMailThread",
              "searchAgentMailThreads",
              "summarizeAgentMailThread",
              "requestAgentMailContact",
              "respondAgentMailContact",
              "listAgentMailContacts",
              "setAgentMailContactPolicy",
              "listAgentMailSectors",
              "getAgentMailSectorFeed",
              "broadcastAgentMailSector",
              "announceAgentMailHandoff",
              "attachAgentMailTrace",
              "waitForAgentMailEvents",
              "recoverAgentMailEvents",
              "exportAgentMailData",
              "eraseAgentMailData",
              "revokeAgentMailAccess",
              "searchConstructPackages",
              "getConstructPackage",
              "listConstructPackageVersions",
              "getConstructReleaseReadiness",
              "matchConstructContent",
              "resolveConstructArtifact",
              "getConstructGrantManifest",
              "reportConstructInstall",
              "reportConstructPackage"
            ]
          }
        },
        "documentationUrl": {
          "type": "string",
          "pattern": "^https://neotask\\.ai/docs/api/[^?#]+\\.md$"
        }
      },
      "required": [
        "actionId",
        "availability",
        "reason",
        "approvalClass",
        "requestExceptions",
        "setupOperationIds",
        "documentationUrl"
      ],
      "anyOf": [
        {
          "properties": {
            "availability": {
              "const": "available"
            },
            "reason": {
              "type": "null"
            },
            "requestExceptions": {
              "maxItems": 0
            }
          }
        },
        {
          "properties": {
            "actionId": {
              "enum": [
                "add",
                "update",
                "remove",
                "run"
              ]
            },
            "availability": {
              "const": "plan_required"
            },
            "reason": {
              "const": "plan_required"
            },
            "requestExceptions": {
              "minItems": 1
            }
          }
        },
        {
          "properties": {
            "actionId": {
              "const": "wake"
            },
            "availability": {
              "const": "plan_required"
            },
            "reason": {
              "const": "plan_required"
            },
            "requestExceptions": {
              "maxItems": 0
            }
          }
        },
        {
          "properties": {
            "actionId": {
              "enum": [
                "add",
                "update",
                "remove",
                "run",
                "wake"
              ]
            },
            "availability": {
              "const": "temporarily_disabled"
            },
            "reason": {
              "enum": [
                "subscription_blocked",
                "overage_recovery_required",
                "tenant_not_found",
                "action_authority_unavailable"
              ]
            },
            "requestExceptions": {
              "maxItems": 0
            }
          }
        },
        {
          "properties": {
            "availability": {
              "const": "setup_required"
            },
            "reason": {
              "const": "prepared_capability_required"
            },
            "requestExceptions": {
              "maxItems": 0
            }
          }
        }
      ]
    },
    "AgentPreparedRunTools": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runRef": {
          "type": "string",
          "maxLength": 200
        },
        "runtimeFlavor": {
          "type": "string",
          "enum": [
            "electron-managed",
            "standalone-agent-runner"
          ]
        },
        "catalogDigest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "runtimeProfileDigest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "runnerInventoryDigest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "preparedInventoryDigest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "capabilityDigest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$",
          "description": "The current lease-bound prepared source decision digest, present when the dispatch requires prepared capability binding. It grants no execution or approval authority."
        },
        "tools": {
          "type": "array",
          "maxItems": 4096,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "toolId": {
                "type": "string",
                "maxLength": 512
              },
              "source": {
                "type": "string",
                "enum": [
                  "core",
                  "plugin",
                  "mcp"
                ]
              },
              "sourceAllowed": {
                "type": "boolean",
                "description": "The reported source passes current profile, catalog and applicable connection checks. Execution and request-specific approval remain separate."
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "tool_inventory_unavailable",
                  "tool_not_prepared",
                  "runner_tool_unavailable",
                  "tool_source_unreviewed",
                  "runtime_profile_stale",
                  "tool_policy_denied",
                  "verified_user_claim_required",
                  "company_access_denied",
                  "company_context_required",
                  "hipaa_disabled",
                  "plan_feature_required",
                  "integration_scope_mismatch",
                  "integration_connection_required",
                  "integration_unavailable",
                  "integration_inventory_stale",
                  null
                ],
                "description": "The same server-authored source denial reason returned by live tool authorization. Null means the source check passed, not that request-specific approval was granted."
              }
            },
            "required": [
              "toolId",
              "source",
              "sourceAllowed",
              "reason"
            ]
          }
        }
      },
      "required": [
        "runRef",
        "runtimeFlavor",
        "catalogDigest",
        "runtimeProfileDigest",
        "runnerInventoryDigest",
        "preparedInventoryDigest",
        "tools"
      ]
    },
    "AgentCronJob": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "taskId": {
          "type": "string"
        },
        "agentId": {
          "type": "string"
        },
        "schedule": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "kind": {
              "type": "string",
              "const": "cron"
            },
            "expression": {
              "type": "string"
            },
            "timezone": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "expression",
            "timezone"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "nextRunAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastRunAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastStatus": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "taskId",
        "schedule",
        "enabled",
        "nextRunAt",
        "lastRunAt",
        "lastStatus"
      ]
    },
    "AgentCronJobListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "cronJobs": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/schemas/AgentCronJob"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "cronJobs",
        "nextCursor"
      ]
    },
    "AgentCronJobResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "cronJob": {
          "$ref": "#/schemas/AgentCronJob"
        }
      },
      "required": [
        "cronJob"
      ]
    },
    "AgentCronJobCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "taskId": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 160
        },
        "scheduleCron": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200
        },
        "cronExpression": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200
        },
        "scheduleTimezone": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100
        },
        "enabled": {
          "type": "boolean"
        }
      },
      "required": [
        "taskId"
      ],
      "anyOf": [
        {
          "required": [
            "scheduleCron"
          ],
          "properties": {
            "scheduleCron": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1
            }
          }
        },
        {
          "required": [
            "cronExpression"
          ],
          "properties": {
            "cronExpression": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1
            }
          }
        }
      ]
    },
    "AgentCronJobUpdateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1
        },
        "scheduleCron": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200
        },
        "cronExpression": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200
        },
        "scheduleTimezone": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100
        },
        "enabled": {
          "type": "boolean"
        }
      },
      "required": []
    },
    "AgentCronJobDeleteRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {},
      "required": []
    },
    "AgentCronJobEnableRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {},
      "required": []
    },
    "AgentCronJobDisableRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {},
      "required": []
    },
    "AgentCronRunRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {},
      "required": []
    },
    "AgentCronJobDeleteResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "deleted": {
          "type": "boolean",
          "const": true
        },
        "cronJobRef": {
          "type": "string"
        }
      },
      "required": [
        "deleted",
        "cronJobRef"
      ]
    },
    "AgentCronRunResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "run": {
          "$ref": "#/schemas/RunResponse"
        },
        "cronJob": {
          "$ref": "#/schemas/AgentCronJob"
        }
      },
      "required": [
        "run",
        "cronJob"
      ]
    },
    "AgentCronRunListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runs": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/schemas/RunResponse"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "runs",
        "nextCursor"
      ]
    },
    "AgentRunnerEnrollmentRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "installationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "runnerSecret": {
          "type": "string",
          "minLength": 32,
          "maxLength": 4096,
          "writeOnly": true
        },
        "hmacSecret": {
          "type": "string",
          "minLength": 32,
          "maxLength": 4096,
          "writeOnly": true
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "clientType": {
          "type": "string",
          "enum": [
            "cli",
            "electron",
            "cloud"
          ]
        },
        "runtimeOwner": {
          "type": "string",
          "enum": [
            "cli",
            "electron",
            "cloud"
          ]
        },
        "platform": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32
        },
        "architecture": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32
        },
        "runnerVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "gatewayProtocolVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "runnerProtocolVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "maxItems": 100
        },
        "capabilityHash": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "maxConcurrency": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      },
      "required": [
        "installationId"
      ],
      "anyOf": [
        {
          "required": [
            "runnerSecret"
          ]
        },
        {
          "required": [
            "hmacSecret"
          ]
        }
      ]
    },
    "AgentRunnerEnrollmentResponse": {
      "anyOf": [
        {
          "$ref": "#/schemas/AgentRunnerEnrollmentCreated"
        },
        {
          "$ref": "#/schemas/AgentRunnerEnrollmentReview"
        }
      ]
    },
    "AgentRunnerEnrollmentReview": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "state": {
          "type": "string",
          "const": "human_action_required"
        },
        "availability": {
          "type": "string",
          "const": "setup_required"
        },
        "reviewRef": {
          "type": "string",
          "pattern": "^rer_[a-f0-9]{32}$"
        },
        "reviewStatus": {
          "type": "string",
          "enum": [
            "pending",
            "denied",
            "expired"
          ]
        },
        "installationFingerprint": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "nextAction": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "type": "string",
                  "const": "open_url"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "instructions": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "url",
                "instructions"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "type": "string",
                  "const": "retry"
                },
                "instructions": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "instructions"
              ]
            }
          ]
        }
      },
      "required": [
        "schemaVersion",
        "state",
        "availability",
        "reviewRef",
        "reviewStatus",
        "installationFingerprint",
        "expiresAt",
        "nextAction"
      ]
    },
    "AgentRunnerEnrollmentCreated": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runnerId": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "const": "enrolling"
        },
        "hmacGeneration": {
          "type": "integer",
          "minimum": 1
        },
        "runnerGeneration": {
          "type": "integer",
          "minimum": 1
        },
        "leaseGeneration": {
          "type": "integer",
          "minimum": 1
        },
        "confirmation": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "required": {
              "const": true,
              "type": "boolean"
            },
            "challenge": {
              "type": "string"
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "required",
            "challenge",
            "expiresAt"
          ]
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "runnerId",
        "status",
        "hmacGeneration",
        "runnerGeneration",
        "leaseGeneration",
        "confirmation",
        "expiresAt"
      ]
    },
    "AgentRunner": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runnerId": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "clientType": {
          "type": "string",
          "enum": [
            "cli",
            "electron",
            "cloud"
          ]
        },
        "runtimeOwner": {
          "type": "string",
          "enum": [
            "cli",
            "electron",
            "cloud"
          ]
        },
        "platform": {
          "type": "string"
        },
        "architecture": {
          "type": "string"
        },
        "runnerVersion": {
          "type": "string"
        },
        "gatewayProtocolVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "runnerProtocolVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 100
        },
        "capabilityHash": {
          "type": "string"
        },
        "maxConcurrency": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "status": {
          "type": "string"
        },
        "hmacGeneration": {
          "type": "integer",
          "minimum": 1
        },
        "runnerGeneration": {
          "type": "integer",
          "minimum": 1
        },
        "leaseGeneration": {
          "type": "integer",
          "minimum": 1
        },
        "lastSeenAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "heartbeatExpiresAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "revokedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "runnerId",
        "label",
        "clientType",
        "runtimeOwner",
        "platform",
        "architecture",
        "runnerVersion",
        "gatewayProtocolVersion",
        "runnerProtocolVersion",
        "capabilities",
        "capabilityHash",
        "maxConcurrency",
        "status",
        "hmacGeneration",
        "runnerGeneration",
        "leaseGeneration",
        "lastSeenAt",
        "heartbeatExpiresAt",
        "revokedAt"
      ]
    },
    "AgentRunnerResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runner": {
          "$ref": "#/schemas/AgentRunner"
        }
      },
      "required": [
        "runner"
      ]
    },
    "AgentRunnerListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runners": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentRunner"
          },
          "maxItems": 100
        }
      },
      "required": [
        "runners"
      ]
    },
    "AgentRunnerRotateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "newRunnerSecret": {
          "type": "string",
          "minLength": 32,
          "maxLength": 4096,
          "writeOnly": true
        },
        "runnerSecret": {
          "type": "string",
          "minLength": 32,
          "maxLength": 4096,
          "writeOnly": true
        },
        "hmacSecret": {
          "type": "string",
          "minLength": 32,
          "maxLength": 4096,
          "writeOnly": true
        }
      },
      "required": [],
      "anyOf": [
        {
          "required": [
            "newRunnerSecret"
          ]
        },
        {
          "required": [
            "runnerSecret"
          ]
        },
        {
          "required": [
            "hmacSecret"
          ]
        }
      ]
    },
    "AgentRunnerRevokeRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        }
      },
      "required": []
    },
    "AgentAutonomyGoal": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "companyRef": {
          "type": "string"
        },
        "companyName": {
          "type": "string"
        },
        "objective": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "strategy": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "priority": {
          "type": "number"
        },
        "deadlineMs": {
          "type": "number"
        },
        "completion": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "type": "string"
                },
                "criterion": {
                  "type": "string"
                },
                "threshold": {
                  "type": "number"
                },
                "countMetric": {
                  "type": "string"
                },
                "satisfied": {
                  "type": "boolean"
                }
              },
              "required": []
            },
            {
              "type": "null"
            }
          ]
        },
        "dependsOn": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "taskPlan": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "status": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "revision": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "tasksTotal": {
                  "type": "integer",
                  "minimum": 0
                },
                "tasksDone": {
                  "type": "integer",
                  "minimum": 0
                },
                "tasksScheduled": {
                  "type": "integer",
                  "minimum": 0
                },
                "tasksRemaining": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "gatedCount": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "status",
                "revision",
                "tasksTotal",
                "tasksDone",
                "tasksScheduled",
                "tasksRemaining",
                "gatedCount"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "companyRef",
        "objective",
        "status",
        "completion",
        "dependsOn",
        "taskPlan",
        "createdAt",
        "updatedAt"
      ]
    },
    "AgentAutonomyGoalListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "goals": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentAutonomyGoal"
          },
          "maxItems": 100
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "goals",
        "nextCursor"
      ]
    },
    "AgentAutonomyGoalResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "goal": {
          "$ref": "#/schemas/AgentAutonomyGoal"
        }
      },
      "required": [
        "goal"
      ]
    },
    "AgentAutonomyGoalCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "companyRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "objective": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000
        },
        "strategy": {
          "type": "string",
          "minLength": 1,
          "maxLength": 10000
        },
        "priority": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "deadlineMs": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ],
          "description": "A future Unix timestamp in milliseconds, at most ten years from the request."
        },
        "completion": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "freetext"
                },
                "criterion": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 2000
                }
              },
              "required": [
                "criterion"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "dependsOn": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "maxItems": 25
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "companyRef",
        "objective"
      ]
    },
    "AgentAutonomyGoalUpdateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "objective": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "description": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 5000
            },
            {
              "type": "null"
            }
          ]
        },
        "strategy": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 10000
            },
            {
              "type": "null"
            }
          ]
        },
        "priority": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "deadlineMs": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ],
          "description": "A future Unix timestamp in milliseconds, at most ten years from the request."
        },
        "completion": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "freetext"
                },
                "criterion": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 2000
                }
              },
              "required": [
                "criterion"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "dependsOn": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "maxItems": 25
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [],
      "minProperties": 1
    },
    "AgentAutonomyGoalStartResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "goal": {
          "$ref": "#/schemas/AgentAutonomyGoal"
        },
        "execution": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "executionRef": {
              "type": "string"
            },
            "runRef": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "accepted",
                "running"
              ]
            }
          },
          "required": [
            "executionRef",
            "status"
          ]
        }
      },
      "required": [
        "goal",
        "execution"
      ]
    },
    "AgentAutonomyGoalStatusResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "goal": {
          "$ref": "#/schemas/AgentAutonomyGoal"
        },
        "execution": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "active": {
              "type": "boolean"
            },
            "runCount": {
              "type": "integer",
              "minimum": 0
            },
            "activeRun": {
              "anyOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "taskId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "stateSeq": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "startedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "taskId",
                    "status",
                    "stateSeq",
                    "startedAt",
                    "updatedAt"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "taskPlan": {
              "anyOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "taskCount": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "authoredAt": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "revision",
                    "taskCount",
                    "authoredAt",
                    "updatedAt"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "active",
            "runCount",
            "activeRun",
            "taskPlan"
          ]
        }
      },
      "required": [
        "goal",
        "execution"
      ]
    },
    "AgentAutonomyGoalSteerRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 8000
        },
        "kind": {
          "type": "string",
          "enum": [
            "note",
            "redirect",
            "approve_edit"
          ]
        }
      },
      "required": [
        "text"
      ]
    },
    "AgentAutonomyGoalSteerResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "goal": {
          "$ref": "#/schemas/AgentAutonomyGoal"
        },
        "run": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "runRef": {
              "type": "string"
            },
            "state": {
              "type": "string"
            },
            "stateSeq": {
              "type": "integer",
              "minimum": 0
            },
            "delivered": {
              "type": "boolean"
            }
          },
          "required": [
            "runRef",
            "state",
            "stateSeq",
            "delivered"
          ]
        }
      },
      "required": [
        "goal",
        "run"
      ]
    },
    "AgentAutonomyGoalCancelResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "goal": {
          "$ref": "#/schemas/AgentAutonomyGoal"
        },
        "cancelledRun": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "runRef": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                }
              },
              "required": [
                "runRef",
                "state"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "goal",
        "cancelledRun"
      ]
    },
    "AgentAutonomyGoalRun": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "taskId": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "terminal": {
          "type": "boolean"
        },
        "terminalReason": {
          "type": "string"
        },
        "startedAt": {
          "type": "string",
          "format": "date-time"
        },
        "terminalAt": {
          "type": "string",
          "format": "date-time"
        },
        "outcome": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "title": {
              "type": "string",
              "maxLength": 500
            },
            "value": {}
          },
          "required": [],
          "minProperties": 1
        }
      },
      "required": [
        "id",
        "taskId",
        "status",
        "terminal"
      ]
    },
    "AgentAutonomyGoalRunListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runs": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentAutonomyGoalRun"
          },
          "maxItems": 100
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "runs",
        "nextCursor"
      ]
    },
    "AgentCompany": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "companyRef": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "timezone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string"
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "companyRef",
        "name",
        "description",
        "timezone",
        "status",
        "createdAt",
        "updatedAt"
      ]
    },
    "AgentCompanyListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "companies": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/schemas/AgentCompany"
          }
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "companies",
        "nextCursor"
      ]
    },
    "AgentCompanyResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "company": {
          "$ref": "#/schemas/AgentCompany"
        },
        "agentCount": {
          "type": "integer",
          "minimum": 0
        },
        "runsByState": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": 0
          }
        },
        "heartbeat": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "status": {
              "type": "string"
            },
            "lastCompletedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "nextPlannedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "status",
            "lastCompletedAt",
            "nextPlannedAt"
          ]
        },
        "readOnly": {
          "type": "boolean",
          "const": true
        }
      },
      "required": [
        "company",
        "agentCount",
        "runsByState",
        "heartbeat",
        "readOnly"
      ]
    },
    "AgentCompanyAgent": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "companyRef": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "archived": {
          "type": "boolean"
        },
        "lastActiveAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "runtimeState": {
          "type": "string",
          "const": "unknown"
        }
      },
      "required": [
        "id",
        "companyRef",
        "name",
        "description",
        "model",
        "archived",
        "lastActiveAt",
        "runtimeState"
      ]
    },
    "AgentCompanyAgentListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "companyRef": {
          "type": "string"
        },
        "agents": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/schemas/AgentCompanyAgent"
          }
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "companyRef",
        "agents",
        "nextCursor"
      ]
    },
    "AgentCompanyTask": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "taskRef": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "companyRef": {
          "type": "string"
        },
        "source": {
          "type": "string",
          "enum": [
            "plan",
            "goal",
            "agent"
          ]
        },
        "parentRef": {
          "type": "string"
        },
        "parentStatus": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "instruction": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string"
        },
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "agentId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "scheduleCron": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "scheduleTimezone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "nextRunAt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "latestRunId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "executionTaskId": {
          "type": "string"
        },
        "gateState": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "taskRef",
        "id",
        "companyRef",
        "source",
        "parentRef",
        "parentStatus",
        "name",
        "description",
        "instruction",
        "status",
        "enabled",
        "agentId",
        "model",
        "scheduleCron",
        "scheduleTimezone",
        "nextRunAt",
        "latestRunId",
        "executionTaskId",
        "gateState",
        "createdAt",
        "updatedAt"
      ]
    },
    "AgentCompanyTaskListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "companyRef": {
          "type": "string"
        },
        "tasks": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/schemas/AgentCompanyTask"
          }
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "companyRef",
        "tasks",
        "nextCursor"
      ]
    },
    "AgentCompanyTaskResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "task": {
          "$ref": "#/schemas/AgentCompanyTask"
        }
      },
      "required": [
        "task"
      ]
    },
    "AgentCompanyRun": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "companyRef": {
          "type": "string"
        },
        "taskId": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "stateSeq": {
          "type": "integer",
          "minimum": 0
        },
        "terminal": {
          "type": "boolean"
        },
        "terminalReason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastStepLabel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "startedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "terminalAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "retryAtMs": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "retryReason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "outcome": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "title": {
                  "type": "string"
                },
                "value": {}
              }
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "companyRef",
        "taskId",
        "status",
        "stateSeq",
        "terminal",
        "terminalReason",
        "lastStepLabel",
        "startedAt",
        "terminalAt",
        "updatedAt",
        "retryAtMs",
        "retryReason",
        "outcome"
      ]
    },
    "AgentCompanyRunListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "companyRef": {
          "type": "string"
        },
        "runs": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/schemas/AgentCompanyRun"
          }
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "companyRef",
        "runs",
        "nextCursor"
      ]
    },
    "AgentCompanyRunResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "run": {
          "$ref": "#/schemas/AgentCompanyRun"
        }
      },
      "required": [
        "run"
      ]
    },
    "HumanRunnerEnrollmentReview": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "authority": {
          "type": "string",
          "const": "human_session"
        },
        "reviewRef": {
          "type": "string",
          "pattern": "^rer_[a-f0-9]{32}$"
        },
        "reviewHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "denied",
            "consumed",
            "expired"
          ]
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
        },
        "installation": {
          "type": "object",
          "properties": {
            "installationFingerprint": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "label": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "clientType": {
              "type": "string",
              "enum": [
                "cli",
                "electron",
                "cloud"
              ]
            },
            "runtimeOwner": {
              "type": "string",
              "enum": [
                "cli",
                "electron",
                "cloud"
              ]
            },
            "platform": {
              "type": "string",
              "minLength": 1,
              "maxLength": 32
            },
            "architecture": {
              "type": "string",
              "minLength": 1,
              "maxLength": 32
            },
            "runnerVersion": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "gatewayProtocolVersion": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "runnerProtocolVersion": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "capabilities": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              }
            },
            "capabilityHash": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "maxConcurrency": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          "required": [
            "installationFingerprint",
            "label",
            "clientType",
            "runtimeOwner",
            "platform",
            "architecture",
            "runnerVersion",
            "gatewayProtocolVersion",
            "runnerProtocolVersion",
            "capabilities",
            "capabilityHash",
            "maxConcurrency"
          ],
          "additionalProperties": false
        },
        "resolvedAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
        },
        "runnerId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        }
      },
      "required": [
        "schemaVersion",
        "authority",
        "reviewRef",
        "reviewHash",
        "status",
        "expiresAt",
        "installation"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "status": {
                "const": "consumed"
              }
            }
          },
          "then": {
            "required": [
              "runnerId"
            ]
          },
          "else": {
            "not": {
              "required": [
                "runnerId"
              ]
            }
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "enum": [
                  "approved",
                  "denied",
                  "consumed"
                ]
              }
            }
          },
          "then": {
            "required": [
              "resolvedAt"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "pending"
              }
            }
          },
          "then": {
            "not": {
              "required": [
                "resolvedAt"
              ]
            }
          }
        },
        {
          "properties": {
            "installation": {
              "properties": {
                "capabilities": {
                  "uniqueItems": true,
                  "items": {
                    "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
                  }
                },
                "label": {
                  "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
                },
                "platform": {
                  "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
                },
                "architecture": {
                  "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
                },
                "runnerVersion": {
                  "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
                },
                "capabilityHash": {
                  "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
                }
              }
            },
            "runnerId": {
              "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
            }
          }
        }
      ]
    },
    "HumanRunnerEnrollmentDecisionRequest": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "reviewHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "decision": {
          "type": "string",
          "enum": [
            "approve",
            "deny"
          ]
        }
      },
      "required": [
        "reviewHash",
        "decision"
      ],
      "additionalProperties": false
    },
    "HumanAgentClaimMove": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "authority": {
          "type": "string",
          "const": "human_session"
        },
        "moveRef": {
          "type": "string",
          "pattern": "^acm_[a-f0-9]{32}$"
        },
        "reviewHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "completed",
            "cancelled",
            "expired"
          ]
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
        },
        "account": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "selection": {
              "type": "string",
              "enum": [
                "workos_account",
                "signed_in_account"
              ]
            },
            "plan": {
              "type": "object",
              "properties": {
                "displayName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "freeMessageQuota": {
                  "type": "boolean"
                }
              },
              "required": [
                "displayName",
                "freeMessageQuota"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "name",
            "selection"
          ],
          "additionalProperties": false
        },
        "claimer": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320,
              "pattern": "^[^\\s@\\u0000-\\u001f\\u007f][^\\s\\u0000-\\u001f\\u007f]*@[^\\s\\u0000-\\u001f\\u007f]*[^\\s@\\u0000-\\u001f\\u007f]$"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "required": [
            "email"
          ],
          "additionalProperties": false
        },
        "agent": {
          "type": "object",
          "properties": {
            "label": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "registrationSuffix": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{1,8}$"
            }
          },
          "required": [
            "registrationSuffix"
          ],
          "additionalProperties": false
        },
        "contents": {
          "type": "object",
          "properties": {
            "agents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "conversations": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "messages": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "tasks": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "runs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "runners": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "freeMessagesUsed": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "agents",
            "conversations",
            "messages",
            "tasks",
            "runs",
            "runners",
            "freeMessagesUsed"
          ],
          "additionalProperties": false
        },
        "resolvedAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
        },
        "cancelledBy": {
          "type": "string",
          "enum": [
            "person",
            "agent"
          ]
        }
      },
      "required": [
        "schemaVersion",
        "authority",
        "moveRef",
        "reviewHash",
        "status",
        "expiresAt",
        "account",
        "agent",
        "contents"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "status": {
                "enum": [
                  "completed",
                  "cancelled"
                ]
              }
            }
          },
          "then": {
            "required": [
              "resolvedAt"
            ]
          },
          "else": {
            "not": {
              "required": [
                "resolvedAt"
              ]
            }
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "cancelled"
              }
            }
          },
          "then": {
            "required": [
              "cancelledBy"
            ]
          },
          "else": {
            "not": {
              "required": [
                "cancelledBy"
              ]
            }
          }
        },
        {
          "properties": {
            "account": {
              "properties": {
                "name": {
                  "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
                },
                "plan": {
                  "properties": {
                    "displayName": {
                      "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
                    }
                  }
                }
              }
            },
            "agent": {
              "properties": {
                "label": {
                  "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
                }
              }
            }
          }
        }
      ]
    },
    "HumanAgentClaimMoveDecisionRequest": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "reviewHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "decision": {
          "type": "string",
          "enum": [
            "confirm",
            "cancel"
          ]
        }
      },
      "required": [
        "reviewHash",
        "decision"
      ],
      "additionalProperties": false
    },
    "HumanAgentApprovalSettingsResponse": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "agentRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "allOf": [
            {
              "type": "string",
              "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
            },
            {
              "type": "string",
              "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9][A-Za-z0-9._:-]*$"
            }
          ]
        },
        "effective": {
          "type": "object",
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "human_only",
                "policy_auto",
                "agent_delegate"
              ]
            },
            "deterministic": {
              "type": "object",
              "properties": {
                "operationIds": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                },
                "toolNames": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                }
              },
              "required": [
                "operationIds",
                "toolNames"
              ],
              "additionalProperties": false
            },
            "hardGates": {
              "maxItems": 64,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
              }
            }
          },
          "required": [
            "mode",
            "deterministic",
            "hardGates"
          ],
          "additionalProperties": false
        },
        "source": {
          "type": "object",
          "properties": {
            "tenantRevision": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "agentRevision": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "tenantDefault": {
              "type": "string",
              "enum": [
                "configured",
                "implicit"
              ]
            },
            "agentOverride": {
              "type": "string",
              "enum": [
                "configured",
                "none"
              ]
            }
          },
          "required": [
            "tenantRevision",
            "agentRevision",
            "tenantDefault",
            "agentOverride"
          ],
          "additionalProperties": false
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "updatedBy": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "editor": {
          "type": "object",
          "properties": {
            "tenant": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "human_only",
                    "policy_auto",
                    "agent_delegate"
                  ]
                },
                "operationIds": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                },
                "toolNames": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                }
              },
              "required": [
                "mode",
                "operationIds",
                "toolNames"
              ],
              "additionalProperties": false
            },
            "agent": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "human_only",
                    "policy_auto",
                    "agent_delegate"
                  ]
                },
                "operationIds": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                },
                "toolNames": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                }
              },
              "required": [
                "mode",
                "operationIds",
                "toolNames"
              ],
              "additionalProperties": false
            },
            "reviewedAuto": {
              "type": "object",
              "properties": {
                "operationIds": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                },
                "toolNames": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                }
              },
              "required": [
                "operationIds",
                "toolNames"
              ],
              "additionalProperties": false
            },
            "delegableOperationIds": {
              "maxItems": 512,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "allOf": [
                  {
                    "type": "string",
                    "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[^*?[\\]{}]+$"
                  }
                ]
              }
            },
            "scope": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "standalone_agent",
                    "company"
                  ]
                },
                "ref": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                }
              },
              "required": [
                "type",
                "ref"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "tenant",
            "agent",
            "reviewedAuto",
            "delegableOperationIds",
            "scope"
          ],
          "additionalProperties": false
        },
        "handoff": {
          "type": "object",
          "properties": {
            "handoffRef": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32,128}$"
            },
            "status": {
              "type": "string",
              "enum": [
                "pending",
                "completed",
                "cancelled",
                "expired"
              ]
            },
            "purpose": {
              "type": "string",
              "const": "agent_approval_settings_change"
            },
            "audience": {
              "type": "string",
              "const": "neotask-human-agent-approval-settings-v1"
            },
            "authority": {
              "type": "string",
              "const": "none"
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            "requestedPolicy": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "human_only",
                    "policy_auto",
                    "agent_delegate"
                  ]
                },
                "operationIds": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                },
                "toolNames": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                }
              },
              "additionalProperties": false
            },
            "reason": {
              "type": "string",
              "maxLength": 1000
            },
            "completedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            "cancelledAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            }
          },
          "required": [
            "handoffRef",
            "status",
            "purpose",
            "audience",
            "authority",
            "expiresAt",
            "requestedPolicy"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "schemaVersion",
        "agentRef",
        "effective",
        "source",
        "revision",
        "updatedAt",
        "updatedBy",
        "editor"
      ],
      "additionalProperties": false
    },
    "HumanAgentApprovalSettingsCancellationResponse": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "handoff": {
          "type": "object",
          "properties": {
            "handoffRef": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32,128}$"
            },
            "status": {
              "type": "string",
              "enum": [
                "pending",
                "completed",
                "cancelled",
                "expired"
              ]
            },
            "purpose": {
              "type": "string",
              "const": "agent_approval_settings_change"
            },
            "audience": {
              "type": "string",
              "const": "neotask-human-agent-approval-settings-v1"
            },
            "authority": {
              "type": "string",
              "const": "none"
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            "requestedPolicy": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "human_only",
                    "policy_auto",
                    "agent_delegate"
                  ]
                },
                "operationIds": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                },
                "toolNames": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160,
                    "allOf": [
                      {
                        "type": "string",
                        "pattern": "^[\\u0020-\\u007e\\u0080-\\uffff]+$"
                      },
                      {
                        "type": "string",
                        "pattern": "^[^*?[\\]{}]+$"
                      }
                    ]
                  }
                }
              },
              "additionalProperties": false
            },
            "reason": {
              "type": "string",
              "maxLength": 1000
            },
            "completedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            "cancelledAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            }
          },
          "required": [
            "handoffRef",
            "status",
            "purpose",
            "audience",
            "authority",
            "expiresAt",
            "requestedPolicy"
          ],
          "additionalProperties": false
        },
        "authority": {
          "type": "string",
          "const": "none"
        }
      },
      "required": [
        "handoff",
        "authority"
      ],
      "additionalProperties": false
    },
    "HumanAgentApprovalReview": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "authority": {
          "type": "string",
          "const": "human_session"
        },
        "approvalRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "reviewHash": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "denied",
            "expired",
            "auto_executed"
          ]
        },
        "handoff": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "pending",
                "completed",
                "cancelled",
                "expired"
              ]
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            }
          },
          "required": [
            "status",
            "expiresAt"
          ],
          "additionalProperties": false
        },
        "request": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "minLength": 1,
              "maxLength": 8388608
            },
            "description": {
              "type": "string",
              "maxLength": 8388608
            },
            "kind": {
              "type": "string",
              "enum": [
                "confirm",
                "message_input",
                "toggle",
                "select"
              ]
            },
            "type": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "riskLevel": {
              "type": "string",
              "enum": [
                "low",
                "medium",
                "high",
                "critical"
              ]
            },
            "agentRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "toolName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "prompt": {
              "type": "string",
              "maxLength": 8388608
            },
            "options": {
              "maxItems": 4096,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 8388608
              }
            },
            "toggleLabel": {
              "type": "string",
              "maxLength": 8388608
            },
            "toggleDefault": {
              "type": "boolean"
            },
            "parameters": {
              "type": "string",
              "maxLength": 8388608
            },
            "intentSummary": {
              "type": "string",
              "maxLength": 8388608
            },
            "intentDetail": {
              "type": "string",
              "maxLength": 8388608
            },
            "intentFields": {
              "maxItems": 4096,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8388608
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 8388608
                  },
                  "before": {
                    "type": "string",
                    "maxLength": 8388608
                  },
                  "after": {
                    "type": "string",
                    "maxLength": 8388608
                  },
                  "format": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "language": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "required": [
                  "label",
                  "value"
                ],
                "additionalProperties": false
              }
            },
            "operationId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "companyRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "required": [
            "title",
            "kind",
            "type",
            "riskLevel",
            "agentRef",
            "intentFields"
          ],
          "additionalProperties": false
        },
        "resolution": {
          "type": "object",
          "properties": {
            "decision": {
              "type": "string",
              "enum": [
                "approved",
                "denied",
                "auto_executed",
                "expired"
              ]
            },
            "at": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            "by": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "message": {
              "type": "string",
              "maxLength": 8388608
            },
            "toggleValue": {
              "type": "boolean"
            },
            "selectedOption": {
              "type": "string",
              "maxLength": 8388608
            }
          },
          "required": [
            "decision",
            "at",
            "by"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "schemaVersion",
        "authority",
        "approvalRef",
        "reviewHash",
        "status",
        "handoff",
        "request"
      ],
      "additionalProperties": false
    },
    "HumanAgentApprovalReviewDecisionRequest": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "expectedReviewHash": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        },
        "decision": {
          "type": "string",
          "enum": [
            "approved",
            "denied"
          ]
        },
        "message": {
          "type": "string",
          "maxLength": 2000
        },
        "toggleValue": {
          "type": "boolean"
        },
        "selectedOption": {
          "type": "string",
          "maxLength": 8388608
        }
      },
      "required": [
        "expectedReviewHash",
        "decision"
      ],
      "additionalProperties": false,
      "description": "The exact displayed review hash is required. Approving message_input requires a nonblank message; toggle requires toggleValue; select requires an offered selectedOption. Other request types and denials reject toggle/selection fields."
    },
    "HumanAgentApprovalReviewResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "review": {
          "$ref": "#/schemas/HumanAgentApprovalReview"
        }
      },
      "required": [
        "ok",
        "review"
      ]
    },
    "HumanAgentApprovalPreparedReviewResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "handoffRef": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{43}$"
        },
        "review": {
          "$ref": "#/schemas/HumanAgentApprovalReview"
        }
      },
      "required": [
        "ok",
        "handoffRef",
        "review"
      ]
    },
    "HumanAgentIntegrationCredentialHandoff": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "attemptId": {
          "type": "string"
        },
        "providerId": {
          "type": "string"
        },
        "authType": {
          "type": "string",
          "const": "api_key"
        },
        "state": {
          "type": "string",
          "enum": [
            "setup_requested",
            "human_action_required",
            "authorizing",
            "connected",
            "cancelled",
            "expired",
            "failed"
          ]
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "company"
          ]
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "configured": {
          "type": "boolean"
        },
        "fingerprint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastVerifiedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "missingFields": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 100
        },
        "connectionId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "attemptId",
        "providerId",
        "authType",
        "state",
        "scopeType",
        "expiresAt",
        "configured",
        "fingerprint",
        "lastVerifiedAt",
        "missingFields",
        "connectionId"
      ]
    },
    "HumanAgentIntegrationCredentialRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "apiKey": {
          "type": "string",
          "minLength": 4,
          "maxLength": 65536,
          "writeOnly": true
        }
      },
      "required": [
        "apiKey"
      ]
    },
    "HumanAgentAccountPairingHandoff": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "consumed",
            "cancelled",
            "expired"
          ]
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "workspace": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "existingTenant": {
              "type": "boolean",
              "const": true
            },
            "selected": {
              "type": "boolean",
              "const": true
            },
            "createsNewTenant": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "existingTenant",
            "selected",
            "createsNewTenant"
          ]
        },
        "agent": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "registered": {
              "type": "boolean",
              "const": true
            },
            "status": {
              "type": "string",
              "const": "active"
            },
            "control": {
              "type": "string",
              "const": "pending"
            }
          },
          "required": [
            "registered",
            "status",
            "control"
          ]
        },
        "account": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "preservesExistingTenant": {
              "type": "boolean",
              "const": true
            },
            "changesBilling": {
              "type": "boolean",
              "const": false
            },
            "mergesAccounts": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "preservesExistingTenant",
            "changesBilling",
            "mergesAccounts"
          ]
        },
        "resources": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "preserved": {
              "type": "boolean",
              "const": true
            }
          },
          "required": [
            "preserved"
          ]
        },
        "runner": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "adoption": {
              "type": "string",
              "const": "separate_human_confirmed_step"
            }
          },
          "required": [
            "adoption"
          ]
        },
        "confirmation": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "required": {
              "type": "boolean",
              "const": true
            },
            "method": {
              "type": "string",
              "const": "POST"
            },
            "path": {
              "type": "string",
              "const": "/api/account/agent-pairing-handoffs/{handoffRef}/confirm"
            }
          },
          "required": [
            "required",
            "method",
            "path"
          ]
        }
      },
      "required": [
        "status",
        "expiresAt",
        "workspace",
        "agent",
        "account",
        "resources",
        "runner",
        "confirmation"
      ]
    },
    "HumanAgentAccountPairingConfirmRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "state": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{43}$"
        }
      },
      "required": []
    },
    "HumanAgentAccountPairingConfirmResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "status": {
          "type": "string",
          "const": "consumed"
        },
        "tenantLinked": {
          "type": "boolean",
          "const": true
        },
        "idempotent": {
          "type": "boolean"
        },
        "electron": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "status": {
              "type": "string",
              "const": "not_available"
            },
            "nextAction": {
              "type": "string",
              "const": "human_confirmed_adoption_required"
            }
          },
          "required": [
            "status",
            "nextAction"
          ]
        }
      },
      "required": [
        "status",
        "tenantLinked",
        "idempotent",
        "electron"
      ]
    },
    "HumanAgentSecurityLabelRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        }
      },
      "required": [
        "label"
      ]
    },
    "HumanAgentRegistration": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "registrationRef": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "identityMode": {
          "type": "string",
          "enum": [
            "service_auth",
            "anonymous"
          ]
        },
        "trustLevel": {
          "type": "string",
          "enum": [
            "trusted",
            "untrusted"
          ]
        },
        "authorityPhase": {
          "type": "string",
          "enum": [
            "claimed",
            "pre_claim"
          ]
        },
        "status": {
          "type": "string"
        },
        "firstClaimedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastAuthenticatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastUsedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "revokedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "registrationRef",
        "label",
        "identityMode",
        "trustLevel",
        "authorityPhase",
        "status",
        "firstClaimedAt",
        "lastAuthenticatedAt",
        "lastUsedAt",
        "revokedAt",
        "createdAt",
        "updatedAt"
      ]
    },
    "HumanAgentRegistrationResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "registration": {
          "$ref": "#/schemas/HumanAgentRegistration"
        }
      },
      "required": [
        "registration"
      ]
    },
    "HumanAgentRegistrationListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "registrations": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/HumanAgentRegistration"
          },
          "maxItems": 100
        }
      },
      "required": [
        "registrations"
      ]
    },
    "HumanAgentRegistrationRevokeResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "registration": {
          "$ref": "#/schemas/HumanAgentRegistration"
        },
        "revoked": {
          "type": "boolean"
        }
      },
      "required": [
        "registration",
        "revoked"
      ]
    },
    "HumanAgentRunner": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runnerRef": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "clientType": {
          "type": "string",
          "enum": [
            "cli",
            "electron",
            "cloud"
          ]
        },
        "runtimeOwner": {
          "type": "string",
          "enum": [
            "cli",
            "electron",
            "cloud"
          ]
        },
        "platform": {
          "type": "string"
        },
        "architecture": {
          "type": "string"
        },
        "runnerVersion": {
          "type": "string"
        },
        "gatewayProtocolVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "runnerProtocolVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 100
        },
        "capabilityHash": {
          "type": "string"
        },
        "maxConcurrency": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "status": {
          "type": "string"
        },
        "hmacGeneration": {
          "type": "integer",
          "minimum": 1
        },
        "lastSeenAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastLeaseAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastUsedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "heartbeatExpiresAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "revokedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "runnerRef",
        "label",
        "clientType",
        "runtimeOwner",
        "platform",
        "architecture",
        "runnerVersion",
        "gatewayProtocolVersion",
        "runnerProtocolVersion",
        "capabilities",
        "capabilityHash",
        "maxConcurrency",
        "status",
        "hmacGeneration",
        "lastSeenAt",
        "lastLeaseAt",
        "lastUsedAt",
        "heartbeatExpiresAt",
        "revokedAt"
      ]
    },
    "HumanAgentRunnerResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runner": {
          "$ref": "#/schemas/HumanAgentRunner"
        }
      },
      "required": [
        "runner"
      ]
    },
    "HumanAgentRunnerListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runners": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/HumanAgentRunner"
          },
          "maxItems": 100
        }
      },
      "required": [
        "runners"
      ]
    },
    "HumanAgentRunnerRotateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "newRunnerSecret": {
          "type": "string",
          "minLength": 32,
          "maxLength": 4096,
          "writeOnly": true
        }
      },
      "required": [
        "newRunnerSecret"
      ]
    },
    "HumanAgentApprovalSettingsUpdateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "human_only",
            "policy_auto",
            "agent_delegate"
          ]
        },
        "defaultMode": {
          "type": "string",
          "enum": [
            "human_only",
            "policy_auto",
            "agent_delegate"
          ]
        },
        "operationIds": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[^*?\\[\\]{}]+$"
              },
              "maxItems": 64,
              "uniqueItems": true
            },
            {
              "type": "null"
            }
          ]
        },
        "toolNames": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[^*?\\[\\]{}]+$"
              },
              "maxItems": 64,
              "uniqueItems": true
            },
            {
              "type": "null"
            }
          ]
        },
        "deterministicOperationIds": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[^*?\\[\\]{}]+$"
              },
              "maxItems": 64,
              "uniqueItems": true
            },
            {
              "type": "null"
            }
          ]
        },
        "deterministicToolNames": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[^*?\\[\\]{}]+$"
              },
              "maxItems": 64,
              "uniqueItems": true
            },
            {
              "type": "null"
            }
          ]
        },
        "scope": {
          "type": "string",
          "enum": [
            "tenant",
            "default",
            "agent"
          ]
        },
        "expectedRevision": {
          "type": "integer",
          "minimum": 1
        },
        "handoffRef": {
          "type": "string",
          "minLength": 32,
          "maxLength": 128
        },
        "expectedSource": {
          "$schema": "http://json-schema.org/draft-07/schema#",
          "type": "object",
          "properties": {
            "tenantRevision": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "agentRevision": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "tenantRevision",
            "agentRevision"
          ],
          "additionalProperties": false
        }
      },
      "required": [],
      "anyOf": [
        {
          "required": [
            "mode"
          ],
          "properties": {
            "mode": {
              "not": {
                "type": "null"
              }
            }
          }
        },
        {
          "required": [
            "defaultMode"
          ],
          "properties": {
            "defaultMode": {
              "not": {
                "type": "null"
              }
            }
          }
        },
        {
          "required": [
            "operationIds"
          ],
          "properties": {
            "operationIds": {
              "not": {
                "type": "null"
              }
            }
          }
        },
        {
          "required": [
            "toolNames"
          ],
          "properties": {
            "toolNames": {
              "not": {
                "type": "null"
              }
            }
          }
        },
        {
          "required": [
            "deterministicOperationIds"
          ],
          "properties": {
            "deterministicOperationIds": {
              "not": {
                "type": "null"
              }
            }
          }
        },
        {
          "required": [
            "deterministicToolNames"
          ],
          "properties": {
            "deterministicToolNames": {
              "not": {
                "type": "null"
              }
            }
          }
        }
      ]
    },
    "HumanAgentApprovalSettingsUpdateResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaVersion": {
          "$ref": "#/schemas/AgentApprovalPolicyResponse/properties/schemaVersion"
        },
        "agentRef": {
          "$ref": "#/schemas/AgentApprovalPolicyResponse/properties/agentRef"
        },
        "effective": {
          "$ref": "#/schemas/AgentApprovalPolicyResponse/properties/effective"
        },
        "source": {
          "$ref": "#/schemas/AgentApprovalPolicyResponse/properties/source"
        },
        "revision": {
          "$ref": "#/schemas/AgentApprovalPolicyResponse/properties/revision"
        },
        "updatedAt": {
          "$ref": "#/schemas/AgentApprovalPolicyResponse/properties/updatedAt"
        },
        "updatedBy": {
          "$ref": "#/schemas/AgentApprovalPolicyResponse/properties/updatedBy"
        },
        "updated": {
          "type": "string",
          "enum": [
            "tenant",
            "agent"
          ]
        },
        "savedRevision": {
          "type": "integer",
          "minimum": 1
        },
        "handoff": {
          "$ref": "#/schemas/AgentApprovalSettingsHandoffResource"
        }
      },
      "required": [
        "schemaVersion",
        "agentRef",
        "effective",
        "source",
        "revision",
        "updatedAt",
        "updatedBy",
        "updated",
        "savedRevision"
      ]
    },
    "HumanAgentApprovalDelegation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "delegationRef": {
          "type": "string"
        },
        "agentRef": {
          "type": "string"
        },
        "principalRef": {
          "type": "string"
        },
        "operationId": {
          "type": "string"
        },
        "toolName": {
          "type": "string"
        },
        "normalizedArgsDigest": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        },
        "scope": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "tenant",
                "standalone_agent",
                "company"
              ]
            },
            "ref": {
              "type": "string"
            }
          },
          "required": [
            "type"
          ]
        },
        "authorityGeneration": {
          "type": "integer",
          "minimum": 0
        },
        "policyRevision": {
          "type": "integer",
          "minimum": 1
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991,
          "readOnly": true,
          "description": "Server-owned grant version. New grants start at one; legacy grants without a stored version read as zero. Revoking an active grant increments it."
        },
        "limits": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "maxUses": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "used": {
              "type": "integer",
              "minimum": 0
            },
            "remaining": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "maxUses",
            "used",
            "remaining"
          ]
        },
        "expiresAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string"
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "revokedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "delegationRef",
        "agentRef",
        "principalRef",
        "operationId",
        "normalizedArgsDigest",
        "scope",
        "authorityGeneration",
        "policyRevision",
        "limits",
        "expiresAt",
        "status",
        "createdAt"
      ]
    },
    "HumanAgentApprovalDelegationListResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "delegations": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/HumanAgentApprovalDelegation"
          },
          "maxItems": 100
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,12}:[a-f0-9]{24}$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "delegations",
        "nextCursor"
      ]
    },
    "HumanAgentApprovalDelegationResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "delegation": {
          "$ref": "#/schemas/HumanAgentApprovalDelegation"
        }
      },
      "required": [
        "delegation"
      ]
    },
    "HumanAgentApprovalDelegationCreateResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "delegation": {
          "$ref": "#/schemas/HumanAgentApprovalDelegation"
        },
        "delegationRef": {
          "type": "string"
        }
      },
      "required": [
        "delegation",
        "delegationRef"
      ]
    },
    "HumanAgentApprovalDelegationRevokeResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "delegation": {
          "$ref": "#/schemas/HumanAgentApprovalDelegation"
        },
        "idempotent": {
          "type": "boolean",
          "const": true
        }
      },
      "required": [
        "delegation"
      ]
    },
    "HumanAgentApprovalDelegationCreateRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "agentRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "principalRef": {
          "type": "string",
          "pattern": "^[a-fA-F0-9]{24}$"
        },
        "registrationRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "expectedSource": {
          "$schema": "http://json-schema.org/draft-07/schema#",
          "type": "object",
          "properties": {
            "tenantRevision": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "agentRevision": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "tenantRevision",
            "agentRevision"
          ],
          "additionalProperties": false
        },
        "operationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        },
        "toolName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160,
          "pattern": "^[^*?\\[\\]{}]+$"
        },
        "normalizedArgs": {},
        "normalizedArgsDigest": {
          "type": "string",
          "pattern": "^sha256:[a-fA-F0-9]{64}$"
        },
        "scopeType": {
          "type": "string",
          "enum": [
            "tenant",
            "standalone_agent",
            "company"
          ]
        },
        "scopeRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "policyRevision": {
          "type": "integer",
          "minimum": 1
        },
        "maxUses": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "description": "A future expiry no more than thirty days from the request."
        }
      },
      "required": [
        "agentRef",
        "operationId",
        "expiresAt"
      ],
      "anyOf": [
        {
          "required": [
            "normalizedArgs"
          ]
        },
        {
          "required": [
            "normalizedArgsDigest"
          ]
        }
      ],
      "allOf": [
        {
          "anyOf": [
            {
              "required": [
                "principalRef"
              ]
            },
            {
              "required": [
                "registrationRef"
              ]
            }
          ]
        }
      ],
      "if": {
        "required": [
          "scopeType"
        ],
        "properties": {
          "scopeType": {
            "const": "company"
          }
        }
      },
      "then": {
        "required": [
          "scopeRef"
        ]
      }
    },
    "HumanAgentApprovalDelegationRevokeRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": []
    },
    "AgentMailThread": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "threadId": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "refId": {
          "type": "string"
        },
        "subject": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "participantAgentIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 100
        },
        "lastActivityAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "retainedUntil": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "threadId",
        "kind",
        "refId",
        "subject",
        "participantAgentIds",
        "lastActivityAt",
        "retainedUntil"
      ]
    },
    "AgentMailContact": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "contactId": {
          "type": "string"
        },
        "fromAgentId": {
          "type": "string"
        },
        "toAgentId": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "contactId",
        "fromAgentId",
        "toAgentId",
        "state",
        "updatedAt"
      ]
    },
    "AgentMailSector": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "sectorId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "memberCount": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "sectorId",
        "name",
        "description",
        "memberCount",
        "updatedAt"
      ]
    },
    "AgentMailSectorBroadcastResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "message": {
          "$ref": "#/schemas/AgentMailMessage"
        },
        "delivery": {
          "$ref": "#/schemas/AgentMailMessageResponse/properties/delivery"
        },
        "sectorId": {
          "type": "string"
        },
        "recipientCount": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        }
      },
      "required": [
        "message",
        "delivery",
        "sectorId",
        "recipientCount"
      ]
    },
    "AgentMailHandoff": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "handoffRef": {
          "type": "string"
        },
        "agentId": {
          "type": "string"
        },
        "subjectRef": {
          "type": "string"
        },
        "subjectKind": {
          "type": "string"
        },
        "taskId": {
          "type": "string"
        },
        "runId": {
          "type": "string"
        },
        "goalId": {
          "type": "string"
        },
        "targetAgentIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 100
        },
        "status": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "threadId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "traceRefs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 100
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "retainedUntil": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "handoffRef",
        "agentId",
        "subjectRef",
        "subjectKind",
        "targetAgentIds",
        "status",
        "subject",
        "summary",
        "threadId",
        "traceRefs",
        "createdAt",
        "retainedUntil"
      ]
    },
    "AgentMailTrace": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "traceRef": {
          "type": "string"
        },
        "handoffRef": {
          "type": "string"
        },
        "runId": {
          "type": "string",
          "maxLength": 256
        },
        "taskId": {
          "type": "string",
          "maxLength": 256
        },
        "goalId": {
          "type": "string",
          "maxLength": 256
        },
        "sessionId": {
          "type": "string",
          "maxLength": 256
        },
        "taskRunId": {
          "type": "string",
          "maxLength": 256
        },
        "agentTurnId": {
          "type": "string",
          "maxLength": 256
        },
        "attachedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "retainedUntil": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "traceRef",
        "handoffRef",
        "attachedAt",
        "retainedUntil"
      ]
    },
    "AgentMailExportSnapshot": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "const": 1
        },
        "company": {
          "$ref": "#/schemas/AgentMailCompany"
        },
        "exportedAt": {
          "type": "string",
          "format": "date-time"
        },
        "messages": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailMessage"
          },
          "maxItems": 1000
        },
        "deliveries": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailDelivery"
          },
          "maxItems": 1000
        },
        "threads": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailThread"
          },
          "maxItems": 1000
        },
        "contacts": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailContact"
          },
          "maxItems": 1000
        },
        "sectors": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailSector"
          },
          "maxItems": 1000
        },
        "handoffs": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailHandoff"
          },
          "maxItems": 1000
        },
        "traces": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/AgentMailTrace"
          },
          "maxItems": 1000
        },
        "truncated": {
          "type": "boolean",
          "const": true
        }
      },
      "required": [
        "schemaVersion",
        "company",
        "exportedAt",
        "messages",
        "deliveries",
        "threads",
        "contacts",
        "sectors",
        "handoffs",
        "traces"
      ]
    },
    "ConstructCompatibility": {
      "type": "object",
      "properties": {
        "pluginApiRange": {
          "type": "string"
        },
        "minGatewayVersion": {
          "type": "string"
        },
        "builtWithVersion": {
          "type": "string"
        }
      },
      "required": [
        "pluginApiRange",
        "minGatewayVersion",
        "builtWithVersion"
      ],
      "additionalProperties": true
    },
    "ConstructContentMatchRequest": {
      "type": "object",
      "properties": {
        "contentSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "fileCount": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "contentSha256",
        "fileCount"
      ],
      "additionalProperties": false
    },
    "ConstructContentMatchResponse": {
      "type": "object",
      "properties": {
        "match": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "version": {
                  "type": "string"
                },
                "releaseSeq": {
                  "type": "integer",
                  "minimum": 0
                },
                "channel": {
                  "type": "string",
                  "enum": [
                    "stable",
                    "beta"
                  ]
                }
              },
              "required": [
                "version",
                "releaseSeq",
                "channel"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "match"
      ],
      "additionalProperties": false
    },
    "ConstructFinding": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warn",
            "high",
            "critical"
          ]
        },
        "target": {
          "type": "string",
          "enum": [
            "universal",
            "darwin-arm64",
            "darwin-x64",
            "linux-x64-glibc",
            "linux-arm64-glibc",
            "linux-x64-musl",
            "linux-arm64-musl",
            "windows-x64",
            "windows-arm64"
          ]
        },
        "path": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "severity"
      ],
      "additionalProperties": true
    },
    "ConstructGrantManifestEntry": {
      "type": "object",
      "properties": {
        "pluginId": {
          "type": "string"
        },
        "versionRange": {
          "type": "string"
        },
        "channels": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "stable",
              "beta"
            ]
          },
          "minItems": 1,
          "maxItems": 2
        },
        "notBefore": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAt": {
          "type": "integer",
          "minimum": 0
        },
        "artifactSha256": {
          "type": "string",
          "pattern": "^([a-f0-9]{64})?$"
        },
        "minReleaseSeq": {
          "type": "integer",
          "minimum": 0
        },
        "source": {
          "type": "string",
          "enum": [
            "org_membership",
            "purchase",
            "access_request",
            "contract",
            "neotask_admin",
            "free_catalog"
          ]
        },
        "blockedReleases": {
          "type": "array",
          "maxItems": 64,
          "items": {
            "type": "object",
            "properties": {
              "releaseSeq": {
                "type": "integer",
                "minimum": 0
              },
              "artifactSha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "releaseSeq",
              "artifactSha256"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "pluginId",
        "versionRange",
        "channels",
        "notBefore",
        "expiresAt",
        "artifactSha256",
        "minReleaseSeq",
        "source",
        "blockedReleases"
      ],
      "additionalProperties": false
    },
    "ConstructGrantManifestV1": {
      "type": "object",
      "properties": {
        "domain": {
          "const": "NEOTASK-CONSTRUCT-GRANTS-V1"
        },
        "issuer": {
          "type": "string"
        },
        "audience": {
          "const": "neotask-gateway"
        },
        "tenantId": {
          "type": "string"
        },
        "installationId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{22}$"
        },
        "issuedAt": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAt": {
          "type": "integer",
          "minimum": 0
        },
        "grants": {
          "type": "array",
          "maxItems": 2000,
          "items": {
            "$ref": "#/schemas/ConstructGrantManifestEntry"
          }
        }
      },
      "required": [
        "domain",
        "issuer",
        "audience",
        "tenantId",
        "installationId",
        "issuedAt",
        "expiresAt",
        "grants"
      ],
      "additionalProperties": false
    },
    "ConstructHeadRef": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        },
        "releaseSeq": {
          "type": "integer",
          "minimum": 0
        },
        "publishedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "version",
        "releaseSeq",
        "publishedAt"
      ],
      "additionalProperties": true
    },
    "ConstructInstallReport": {
      "type": "object",
      "properties": {
        "package": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "releaseSeq": {
          "type": "integer",
          "minimum": 0
        },
        "targetKey": {
          "type": "string"
        },
        "channel": {
          "type": "string",
          "enum": [
            "stable",
            "beta"
          ]
        },
        "event": {
          "type": "string",
          "enum": [
            "install",
            "update",
            "uninstall"
          ]
        },
        "installationId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{22}$"
        },
        "source": {
          "type": "string",
          "enum": [
            "desktop",
            "cli",
            "dashboard"
          ]
        },
        "gatewayVersion": {
          "type": "string"
        }
      },
      "required": [
        "package",
        "version",
        "releaseSeq",
        "targetKey",
        "channel",
        "event",
        "installationId",
        "source",
        "gatewayVersion"
      ],
      "additionalProperties": false
    },
    "ConstructInstallReportResponse": {
      "type": "object",
      "properties": {
        "accepted": {
          "const": true
        },
        "deduplicated": {
          "type": "boolean"
        }
      },
      "required": [
        "accepted",
        "deduplicated"
      ],
      "additionalProperties": true
    },
    "ConstructInstalledReleaseState": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        },
        "releaseSeq": {
          "type": "integer",
          "minimum": 0
        },
        "state": {
          "type": "string",
          "enum": [
            "installable",
            "withdrawn",
            "quarantined",
            "revoked"
          ]
        },
        "reasonCode": {
          "type": "string"
        }
      },
      "required": [
        "version",
        "releaseSeq",
        "state"
      ],
      "additionalProperties": true
    },
    "ConstructPackageDetail": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "orgSlug": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "displayName": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "family": {
          "type": "string",
          "enum": [
            "code-plugin",
            "bundle-plugin",
            "skill"
          ]
        },
        "visibility": {
          "type": "string",
          "enum": [
            "workspace",
            "org",
            "catalog"
          ]
        },
        "fulfillment": {
          "type": "string",
          "enum": [
            "free",
            "self_serve",
            "request_access",
            "contract",
            "managed_setup"
          ]
        },
        "packaging": {
          "type": "string",
          "enum": [
            "bundled",
            "native"
          ]
        },
        "pendingApproval": {
          "type": "boolean"
        },
        "ref": {
          "type": "string"
        },
        "official": {
          "type": "boolean"
        },
        "publisher": {
          "$ref": "#/schemas/ConstructPublisherRef"
        },
        "iconUrl": {
          "type": "string"
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "channels": {
          "type": "object",
          "properties": {
            "stable": {
              "anyOf": [
                {
                  "$ref": "#/schemas/ConstructHeadRef"
                },
                {
                  "type": "null"
                }
              ]
            },
            "beta": {
              "anyOf": [
                {
                  "$ref": "#/schemas/ConstructHeadRef"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "stable",
            "beta"
          ],
          "additionalProperties": true
        },
        "stats": {
          "type": "object",
          "properties": {
            "installs30d": {
              "type": "integer",
              "minimum": 0
            },
            "downloads": {
              "type": "integer",
              "minimum": 0
            },
            "stars": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "installs30d",
            "downloads",
            "stars"
          ],
          "additionalProperties": true
        },
        "provenance": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "inspected",
                "source-linked",
                "attested",
                "reproduced"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "includedWith": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "desktop",
              "cli"
            ]
          },
          "maxItems": 2
        },
        "description": {
          "type": "string"
        },
        "links": {
          "type": "object",
          "properties": {
            "homepage": {
              "type": "string"
            },
            "source": {
              "type": "string"
            },
            "docs": {
              "type": "string"
            },
            "support": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": true
        },
        "license": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "heads": {
          "type": "object",
          "properties": {
            "stable": {
              "anyOf": [
                {
                  "$ref": "#/schemas/ConstructReleaseSummary"
                },
                {
                  "type": "null"
                }
              ]
            },
            "beta": {
              "anyOf": [
                {
                  "$ref": "#/schemas/ConstructReleaseSummary"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "stable",
            "beta"
          ],
          "additionalProperties": true
        },
        "docs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "slug": {
                "type": "string"
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "slug",
              "title"
            ],
            "additionalProperties": true
          }
        },
        "install": {
          "type": "object",
          "properties": {
            "cli": {
              "type": "string"
            },
            "cliBeta": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "requiresSignIn": {
              "const": true
            },
            "desktopDeepLink": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "cli",
            "cliBeta",
            "requiresSignIn",
            "desktopDeepLink"
          ],
          "additionalProperties": true
        },
        "latestVersion": {
          "type": "string"
        },
        "movedTo": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "showcase": {
          "type": "string",
          "maxLength": 20000,
          "description": "Formatted showcase (Markdown): the package showcase when set, else the displayed head release manifest showcase (stable, else beta), else empty."
        },
        "readme": {
          "type": "string",
          "maxLength": 65536,
          "description": "The displayed head release README.md (Markdown, rendered without raw HTML, never executed), or empty."
        },
        "entitlement": {
          "type": "object",
          "properties": {
            "entitled": {
              "type": "boolean"
            },
            "source": {
              "type": "string",
              "enum": [
                "org_membership",
                "purchase",
                "access_request",
                "contract",
                "neotask_admin",
                "free_catalog"
              ]
            },
            "channels": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "stable",
                  "beta"
                ]
              }
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "entitled"
          ],
          "additionalProperties": true
        },
        "viewer": {
          "type": "object",
          "properties": {
            "starred": {
              "type": "boolean"
            },
            "canPublish": {
              "type": "boolean"
            },
            "canApprove": {
              "type": "boolean"
            }
          },
          "required": [
            "starred",
            "canPublish",
            "canApprove"
          ],
          "additionalProperties": true
        }
      },
      "required": [
        "name",
        "orgSlug",
        "displayName",
        "summary",
        "family",
        "visibility",
        "fulfillment",
        "packaging",
        "pendingApproval",
        "ref",
        "official",
        "publisher",
        "iconUrl",
        "categories",
        "channels",
        "stats",
        "provenance",
        "updatedAt",
        "description",
        "links",
        "license",
        "heads",
        "docs",
        "install",
        "latestVersion",
        "movedTo",
        "showcase",
        "readme"
      ],
      "additionalProperties": true
    },
    "ConstructPackageDetailResponse": {
      "type": "object",
      "properties": {
        "package": {
          "$ref": "#/schemas/ConstructPackageDetail"
        }
      },
      "required": [
        "package"
      ],
      "additionalProperties": true
    },
    "ConstructPackageSearchResponse": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/ConstructPackageSummary"
          }
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "sort": {
          "type": "string"
        }
      },
      "required": [
        "results",
        "nextCursor",
        "sort"
      ],
      "additionalProperties": true
    },
    "ConstructPackageSummary": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "orgSlug": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "displayName": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "family": {
          "type": "string",
          "enum": [
            "code-plugin",
            "bundle-plugin",
            "skill"
          ]
        },
        "visibility": {
          "type": "string",
          "enum": [
            "workspace",
            "org",
            "catalog"
          ]
        },
        "fulfillment": {
          "type": "string",
          "enum": [
            "free",
            "self_serve",
            "request_access",
            "contract",
            "managed_setup"
          ]
        },
        "packaging": {
          "type": "string",
          "enum": [
            "bundled",
            "native"
          ]
        },
        "pendingApproval": {
          "type": "boolean"
        },
        "ref": {
          "type": "string"
        },
        "official": {
          "type": "boolean"
        },
        "publisher": {
          "$ref": "#/schemas/ConstructPublisherRef"
        },
        "iconUrl": {
          "type": "string"
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "channels": {
          "type": "object",
          "properties": {
            "stable": {
              "anyOf": [
                {
                  "$ref": "#/schemas/ConstructHeadRef"
                },
                {
                  "type": "null"
                }
              ]
            },
            "beta": {
              "anyOf": [
                {
                  "$ref": "#/schemas/ConstructHeadRef"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "stable",
            "beta"
          ],
          "additionalProperties": true
        },
        "stats": {
          "type": "object",
          "properties": {
            "installs30d": {
              "type": "integer",
              "minimum": 0
            },
            "downloads": {
              "type": "integer",
              "minimum": 0
            },
            "stars": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "installs30d",
            "downloads",
            "stars"
          ],
          "additionalProperties": true
        },
        "provenance": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "inspected",
                "source-linked",
                "attested",
                "reproduced"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "includedWith": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "desktop",
              "cli"
            ]
          },
          "maxItems": 2
        }
      },
      "required": [
        "name",
        "orgSlug",
        "displayName",
        "summary",
        "family",
        "visibility",
        "fulfillment",
        "packaging",
        "pendingApproval",
        "ref",
        "official",
        "publisher",
        "iconUrl",
        "categories",
        "channels",
        "stats",
        "provenance",
        "updatedAt"
      ],
      "additionalProperties": true
    },
    "ConstructPublisherRef": {
      "type": "object",
      "properties": {
        "handle": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "neotask",
            "organization"
          ]
        },
        "official": {
          "type": "boolean"
        },
        "verified": {
          "type": "boolean"
        }
      },
      "required": [
        "handle",
        "displayName",
        "kind",
        "official",
        "verified"
      ],
      "additionalProperties": true
    },
    "ConstructReleaseListResponse": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/ConstructReleaseSummary"
          }
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "items",
        "nextCursor"
      ],
      "additionalProperties": true
    },
    "ConstructReleaseManifestV2": {
      "type": "object",
      "properties": {
        "domain": {
          "const": "NEOTASK-RELEASE-V2"
        },
        "issuer": {
          "type": "string"
        },
        "audience": {
          "const": "neotask-gateway"
        },
        "name": {
          "type": "string"
        },
        "orgSlug": {
          "type": "string"
        },
        "family": {
          "type": "string",
          "enum": [
            "code-plugin",
            "bundle-plugin",
            "skill"
          ]
        },
        "version": {
          "type": "string"
        },
        "releaseSeq": {
          "type": "integer",
          "minimum": 1
        },
        "channel": {
          "type": "string",
          "enum": [
            "stable",
            "beta"
          ]
        },
        "targetKey": {
          "type": "string",
          "enum": [
            "universal",
            "darwin-arm64",
            "darwin-x64",
            "linux-x64-glibc",
            "linux-arm64-glibc",
            "linux-x64-musl",
            "linux-arm64-musl",
            "windows-x64",
            "windows-arm64"
          ]
        },
        "artifactSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "artifactSize": {
          "type": "integer",
          "minimum": 1
        },
        "artifactFormat": {
          "const": "ntpkg"
        },
        "pluginApiRange": {
          "type": "string"
        },
        "minGatewayVersion": {
          "type": "string"
        },
        "builtWithVersion": {
          "type": "string"
        },
        "capabilityManifestSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "dependencyInventorySha256": {
          "type": "string",
          "pattern": "^(?:[a-f0-9]{64})?$"
        },
        "contentSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "scanAttestationSha256": {
          "type": "string",
          "pattern": "^(?:[a-f0-9]{64})?$"
        },
        "provenanceLevel": {
          "type": "string",
          "enum": [
            "inspected",
            "source-linked",
            "attested",
            "reproduced"
          ]
        },
        "sourceRepository": {
          "type": "string"
        },
        "sourceCommit": {
          "type": "string"
        },
        "publisherId": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "domain",
        "issuer",
        "audience",
        "name",
        "orgSlug",
        "family",
        "version",
        "releaseSeq",
        "channel",
        "targetKey",
        "artifactSha256",
        "artifactSize",
        "artifactFormat",
        "pluginApiRange",
        "minGatewayVersion",
        "builtWithVersion",
        "capabilityManifestSha256",
        "dependencyInventorySha256",
        "contentSha256",
        "scanAttestationSha256",
        "provenanceLevel",
        "sourceRepository",
        "sourceCommit",
        "publisherId",
        "createdAt"
      ],
      "additionalProperties": false
    },
    "ConstructReleaseReadinessReport": {
      "type": "object",
      "properties": {
        "package": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "channel": {
          "type": "string",
          "enum": [
            "stable",
            "beta"
          ]
        },
        "ready": {
          "type": "boolean"
        },
        "evaluatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "checks": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pass",
                  "fail",
                  "warn",
                  "not_applicable"
                ]
              },
              "detail": {
                "type": "string"
              },
              "findings": {
                "type": "array",
                "items": {
                  "$ref": "#/schemas/ConstructFinding"
                }
              }
            },
            "required": [
              "id",
              "status"
            ],
            "additionalProperties": true
          }
        }
      },
      "required": [
        "package",
        "version",
        "channel",
        "ready",
        "evaluatedAt",
        "checks"
      ],
      "additionalProperties": true
    },
    "ConstructReleaseSummary": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        },
        "releaseSeq": {
          "type": "integer",
          "minimum": 0
        },
        "channel": {
          "type": "string",
          "enum": [
            "stable",
            "beta"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "installable",
            "withdrawn",
            "quarantined",
            "revoked",
            "pending_approval",
            "rejected"
          ]
        },
        "publishedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "changelog": {
          "type": "string"
        },
        "compatibility": {
          "$ref": "#/schemas/ConstructCompatibility"
        },
        "targets": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "enum": [
                  "universal",
                  "darwin-arm64",
                  "darwin-x64",
                  "linux-x64-glibc",
                  "linux-arm64-glibc",
                  "linux-x64-musl",
                  "linux-arm64-musl",
                  "windows-x64",
                  "windows-arm64"
                ]
              },
              "artifactSize": {
                "type": "integer",
                "minimum": 0
              },
              "artifactSha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "key",
              "artifactSize",
              "artifactSha256"
            ],
            "additionalProperties": true
          }
        },
        "provenance": {
          "type": "string",
          "enum": [
            "inspected",
            "source-linked",
            "attested",
            "reproduced"
          ]
        },
        "scan": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "pending",
                "clean",
                "suspicious",
                "malicious",
                "not-run"
              ]
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": true
        },
        "manifestVersions": {
          "type": "array",
          "items": {
            "type": "integer",
            "enum": [
              1,
              2
            ]
          }
        },
        "moderation": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "none",
                "approved",
                "quarantined",
                "revoked"
              ]
            },
            "reason": {
              "type": "string"
            },
            "at": {
              "type": "string",
              "format": "date-time"
            },
            "eventId": {
              "type": "string"
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": true
        }
      },
      "required": [
        "version",
        "releaseSeq",
        "channel",
        "state",
        "publishedAt",
        "changelog",
        "compatibility",
        "targets",
        "provenance",
        "scan",
        "manifestVersions"
      ],
      "additionalProperties": true
    },
    "ConstructReport": {
      "type": "object",
      "properties": {
        "reportId": {
          "type": "string",
          "pattern": "^rpt_[a-f0-9]{32}$"
        },
        "package": {
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "reason": {
          "type": "string",
          "enum": [
            "malware",
            "security",
            "credential_theft",
            "impersonation",
            "spam",
            "license",
            "broken",
            "other"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "open",
            "triaged",
            "confirmed",
            "dismissed"
          ]
        },
        "outcome": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "none",
                "quarantine",
                "revoke"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "reportId",
        "package",
        "version",
        "reason",
        "state",
        "outcome",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": true
    },
    "ConstructReportResponse": {
      "type": "object",
      "properties": {
        "report": {
          "$ref": "#/schemas/ConstructReport"
        }
      },
      "required": [
        "report"
      ],
      "additionalProperties": true
    },
    "ConstructResolution": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "install",
            "update"
          ]
        },
        "channel": {
          "type": "string",
          "enum": [
            "stable",
            "beta"
          ]
        },
        "hostTarget": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "universal",
                "darwin-arm64",
                "darwin-x64",
                "linux-x64-glibc",
                "linux-arm64-glibc",
                "linux-x64-musl",
                "linux-arm64-musl",
                "windows-x64",
                "windows-arm64"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "targetKey": {
          "type": "string",
          "enum": [
            "universal",
            "darwin-arm64",
            "darwin-x64",
            "linux-x64-glibc",
            "linux-arm64-glibc",
            "linux-x64-musl",
            "linux-arm64-musl",
            "windows-x64",
            "windows-arm64"
          ]
        },
        "manifestVersion": {
          "type": "integer",
          "enum": [
            1,
            2
          ]
        },
        "floorReleaseSeq": {
          "type": "integer",
          "minimum": 0
        },
        "rollbackAuthorizedBy": {
          "anyOf": [
            {
              "const": "revocation"
            },
            {
              "type": "null"
            }
          ]
        },
        "grantSource": {
          "type": "string",
          "enum": [
            "org_membership",
            "purchase",
            "access_request",
            "contract",
            "neotask_admin",
            "free_catalog",
            "assignment"
          ]
        }
      },
      "required": [
        "mode",
        "channel",
        "hostTarget",
        "targetKey",
        "manifestVersion",
        "floorReleaseSeq",
        "rollbackAuthorizedBy",
        "grantSource"
      ],
      "additionalProperties": true
    },
    "ConstructResolveResponse": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "package": {
              "type": "object"
            },
            "version": {
              "$ref": "#/schemas/ConstructResolvedVersion"
            },
            "download": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "expiresInSeconds": {
                  "const": 60
                }
              },
              "required": [
                "url",
                "expiresInSeconds"
              ],
              "additionalProperties": true
            },
            "assignment": {
              "type": "object"
            },
            "resolution": {
              "$ref": "#/schemas/ConstructResolution"
            },
            "installed": {
              "anyOf": [
                {
                  "$ref": "#/schemas/ConstructInstalledReleaseState"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "package",
            "version",
            "download"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "package": {
              "type": "object"
            },
            "upToDate": {
              "const": true
            },
            "resolution": {
              "$ref": "#/schemas/ConstructResolution"
            },
            "installed": {
              "$ref": "#/schemas/ConstructInstalledReleaseState"
            }
          },
          "required": [
            "package",
            "upToDate",
            "resolution",
            "installed"
          ],
          "additionalProperties": true
        }
      ]
    },
    "ConstructResolvedVersion": {
      "type": "object",
      "properties": {
        "publishState": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "releaseSeq": {
          "type": "integer",
          "minimum": 0
        },
        "changelog": {
          "type": "string"
        },
        "artifactSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "artifactSize": {
          "type": "integer",
          "minimum": 0
        },
        "artifactFormat": {
          "const": "ntpkg"
        },
        "signature": {
          "type": "string"
        },
        "signatureKeyId": {
          "type": "string"
        },
        "publisherUserId": {
          "type": "string"
        },
        "createdAt": {
          "type": "string"
        },
        "compatibility": {
          "type": "object"
        },
        "capabilityManifest": {
          "type": "object"
        },
        "scanState": {
          "type": "string"
        },
        "channel": {
          "type": "string",
          "enum": [
            "stable",
            "beta"
          ]
        },
        "target": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "enum": [
                "universal",
                "darwin-arm64",
                "darwin-x64",
                "linux-x64-glibc",
                "linux-arm64-glibc",
                "linux-x64-musl",
                "linux-arm64-musl",
                "windows-x64",
                "windows-arm64"
              ]
            },
            "os": {
              "type": "string"
            },
            "arch": {
              "type": "string"
            },
            "libc": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "os",
            "arch",
            "libc"
          ],
          "additionalProperties": true
        },
        "signedRelease": {
          "$ref": "#/schemas/ConstructSignedReleaseEnvelope"
        }
      },
      "required": [
        "publishState",
        "version",
        "releaseSeq",
        "artifactSha256",
        "artifactSize",
        "signature",
        "signatureKeyId",
        "capabilityManifest"
      ],
      "additionalProperties": true
    },
    "ConstructSignedGrantManifestEnvelope": {
      "type": "object",
      "properties": {
        "format": {
          "const": "NEOTASK-CONSTRUCT-GRANTS-V1"
        },
        "manifest": {
          "$ref": "#/schemas/ConstructGrantManifestV1"
        },
        "signatures": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "keyId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "algorithm": {
                "const": "Ed25519"
              },
              "signature": {
                "type": "string"
              }
            },
            "required": [
              "keyId",
              "algorithm",
              "signature"
            ],
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 4
        }
      },
      "required": [
        "format",
        "manifest",
        "signatures"
      ],
      "additionalProperties": false
    },
    "ConstructSignedReleaseEnvelope": {
      "type": "object",
      "properties": {
        "format": {
          "const": "NEOTASK-RELEASE-V2"
        },
        "manifest": {
          "$ref": "#/schemas/ConstructReleaseManifestV2"
        },
        "signatures": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "keyId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "algorithm": {
                "const": "Ed25519"
              },
              "signature": {
                "type": "string"
              }
            },
            "required": [
              "keyId",
              "algorithm",
              "signature"
            ],
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 4
        }
      },
      "required": [
        "format",
        "manifest",
        "signatures"
      ],
      "additionalProperties": false
    },
    "matchConstructContent.request.v1": {
      "$ref": "#/schemas/ConstructContentMatchRequest"
    },
    "cancelHumanAgentApprovalSettingsHandoff.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "prepareHumanAgentApprovalReview.request.v1": {
      "$ref": "#/schemas/EmptyOperationRequest"
    },
    "decideHumanAgentApprovalReview.request.v1": {
      "$ref": "#/schemas/HumanAgentApprovalReviewDecisionRequest"
    }
  }
}
