# This file is AUTO-GENERATED. Do not edit manually.
# Source of truth: shared/*.ts
# Regenerate with: npm run generate:pydantic
#
# Generated on: 2026-03-25T13:30:56.734Z

# generated by datamodel-codegen:
#   filename:  _schema.json
#   timestamp: 2026-03-25T13:30:56+00:00

from __future__ import annotations

from typing import Annotated, Any, Literal

from pydantic import BaseModel, ConfigDict, Field, RootModel


class Model(RootModel[Any]):
    root: Any


class AgentPrompt(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    text: str


class ApiToken(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    createdAt: str
    id: str
    lastUsedAt: str | None
    name: str
    tokenPrefix: str


class ApiTokenCreateResponse(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    rawToken: str
    token: ApiToken


class ApprovalActionType(RootModel[Literal["open_run_history", "approve_action", "reject_action"]]):
    root: Literal["open_run_history", "approve_action", "reject_action"]


class ApprovalRequestStatus(RootModel[Literal["pending", "in_progress", "completed"]]):
    root: Literal["pending", "in_progress", "completed"]


class AttioAttribute(BaseModel):
    api_slug: str | None = None
    is_required: bool | None = None
    is_unique: bool | None = None
    title: str | None = None
    type: str | None = None


class AttioObjectWithAttributes(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    api_slug: str
    attributes: list[AttioAttribute] | None = None
    plural_noun: str
    singular_noun: str


class AttioRecordIdentifier(BaseModel):
    object_id: str | None = None
    record_id: str | None = None
    workspace_id: str | None = None


class ChangeEventType(RootModel[Literal["CREATED", "UPDATED", "ACTION_EXECUTED"]]):
    root: Literal["CREATED", "UPDATED", "ACTION_EXECUTED"]


class ConfigType(
    RootModel[
        Literal[
            "gmail",
            "gmail_output",
            "gmail_draft_output",
            "figma",
            "slack",
            "slack_output",
            "notion",
            "linear_input",
            "linear_output",
            "github",
            "jira",
            "confluence",
            "POSTHOG",
            "DATADOG",
            "time_trigger",
            "launchdarkly",
            "terse",
            "workos_input",
            "workos_output",
            "attio_output",
            "snowflake_output",
        ]
    ]
):
    root: Literal[
        "gmail",
        "gmail_output",
        "gmail_draft_output",
        "figma",
        "slack",
        "slack_output",
        "notion",
        "linear_input",
        "linear_output",
        "github",
        "jira",
        "confluence",
        "POSTHOG",
        "DATADOG",
        "time_trigger",
        "launchdarkly",
        "terse",
        "workos_input",
        "workos_output",
        "attio_output",
        "snowflake_output",
    ]


class EntityType(RootModel[Literal["ticket", "comment", "user", "action_event", "run_history_action"]]):
    root: Literal["ticket", "comment", "user", "action_event", "run_history_action"]


class Error(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    message: str
    name: str
    stack: str | None = None


class FigmaEventType(RootModel[Literal["file_comment"]]):
    root: Literal["file_comment"]


class GitHubEventType(
    RootModel[
        Literal["push", "pull_request.opened", "pull_request.merged", "pull_request.closed", "pull_request.synchronize"]
    ]
):
    root: Literal[
        "push", "pull_request.opened", "pull_request.merged", "pull_request.closed", "pull_request.synchronize"
    ]


class GmailEventType(RootModel[Literal["email.received"]]):
    root: Literal["email.received"]


class IntegrationType(
    RootModel[
        Literal[
            "github",
            "gmail",
            "linear",
            "atlassian",
            "slack",
            "notion",
            "figma",
            "terse",
            "posthog",
            "datadog",
            "cron_job",
            "launchdarkly",
            "workos",
            "attio",
            "snowflake",
        ]
    ]
):
    root: Literal[
        "github",
        "gmail",
        "linear",
        "atlassian",
        "slack",
        "notion",
        "figma",
        "terse",
        "posthog",
        "datadog",
        "cron_job",
        "launchdarkly",
        "workos",
        "attio",
        "snowflake",
    ]


class JiraEventType(RootModel[Literal["issue.created", "issue.updated"]]):
    root: Literal["issue.created", "issue.updated"]


class LinearEventType(RootModel[Literal["issue.created", "issue.updated", "comment.created"]]):
    root: Literal["issue.created", "issue.updated", "comment.created"]


class MultipleChoiceOption(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    label: str
    value: str


class NotificationDestinationType(RootModel[Literal["email", "slack"]]):
    root: Literal["email", "slack"]


class PartialSdkAgentRunEventPayload(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    debugLog: str | None = None
    formattedContent: str | None = None
    integrationType: IntegrationType | None = None


class PickUserExcludeIdWorkosIdOrganizationIdOrganizationNameEmailDisplayNameFirstNameLastNameDisplayPhotoUrlRolesOrganizationIdOrganizationNameRoles(
    BaseModel
):
    model_config = ConfigDict(
        extra="forbid",
    )
    displayName: str
    displayPhotoUrl: str
    email: str
    firstName: str | None
    id: str
    lastName: str | None
    workosId: str


class RecordStringUnknown(RootModel[dict[str, Any]]):
    root: dict[str, Any]


class Repository(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: float
    name: str
    owner: str


class Role(RootModel[Literal["admin", "user"]]):
    root: Literal["admin", "user"]


class RunError(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    code: str | None = None
    error: str
    timestamp: float


class OutputItem(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    output_item_id: str
    output_item_type: ConfigType


class RunHistoryActionType(RootModel[Literal["create", "update", "delete", "read", "approve", "error"]]):
    root: Literal["create", "update", "delete", "read", "approve", "error"]


class RunHistoryDecisionAction(RootModel[Literal["processed", "skipped"]]):
    root: Literal["processed", "skipped"]


class RunHistoryStatus(
    RootModel[Literal["success", "failed", "cancelled", "skipped", "in_progress", "awaiting_approval"]]
):
    root: Literal["success", "failed", "cancelled", "skipped", "in_progress", "awaiting_approval"]


class RunHistoryTrigger(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    event: str
    integration: IntegrationType
    source: str
    subheader: str | None = None
    title: str | None = None
    url: str | None = None


class SdkAgentRunEventPayload(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    debugLog: str
    formattedContent: str
    integrationType: IntegrationType


class SdkAgentRunOptionsPayload(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    maxTurns: float | None = None
    requireApproval: bool | None = None


class Contract(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    responseMode: Literal["streaming"]
    supportsInterruptions: bool


class Options(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    maxTurns: float
    requireApproval: bool


class RemovedItem(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    name: str


class Result(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    automationId: str
    isUpdate: bool
    jobName: str


class SdkDeployResponseBody(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    details: str | None = None
    error: str | None = None
    removed: list[RemovedItem]
    results: list[Result]
    success: bool


class SharedErrorContext(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    error: Error | Any


class SlackEventType(RootModel[Literal["message", "app_mention", "reaction_added"]]):
    root: Literal["message", "app_mention", "reaction_added"]


class TextDelta(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    delta: str
    step_id: str
    timestamp: float


class Assignee(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    name: str


class Label(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    color: str
    id: str
    name: str


class Project(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    name: str


class State(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    name: str


class Team(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    key: str
    name: str


class Ticket(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    assignee: Assignee | None = None
    createdAt: str
    description: str | None = None
    dueDate: str | None = None
    estimate: float | None = None
    id: str
    identifier: str
    labels: list[Label] | None = None
    priority: float | None = None
    project: Project | None = None
    state: State
    team: Team | None = None
    title: str
    updatedAt: str


class TicketState(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    name: str


class TicketSystemType(RootModel[Literal["jira", "linear"]]):
    root: Literal["jira", "linear"]


class ToolCall(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    integration: str
    parameters: str
    step_id: str
    summary: str
    timestamp: float


class ToolCallExecutionStatus(RootModel[Literal["completed", "incomplete", "failed", "unknown"]]):
    root: Literal["completed", "incomplete", "failed", "unknown"]


class User(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    displayName: str
    displayPhotoUrl: str
    email: str
    firstName: str | None
    id: str
    lastName: str | None
    organizationId: str
    organizationName: str
    roles: list[Role]
    workosId: str


class WorkOSEventType(
    RootModel[
        Literal[
            "user.created",
            "user.updated",
            "user.deleted",
            "organization.created",
            "organization_membership.created",
            "organization_membership.updated",
            "organization_membership.deleted",
            "invitation.created",
            "invitation.accepted",
            "invitation.resent",
            "invitation.revoked",
        ]
    ]
):
    root: Literal[
        "user.created",
        "user.updated",
        "user.deleted",
        "organization.created",
        "organization_membership.created",
        "organization_membership.updated",
        "organization_membership.deleted",
        "invitation.created",
        "invitation.accepted",
        "invitation.resent",
        "invitation.revoked",
    ]


class ChatSnippetButton(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str | None = None
    label: str
    selectedValue: str | None = None
    step_id: str | None = None
    type: Literal["button"]
    url: str


class ChatSnippetIntegrationPrompt(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str | None = None
    integration: str
    message: str
    selectedValue: str | None = None
    stateToken: str | None = None
    step_id: str | None = None
    type: Literal["integration_prompt"]


class ChatSnippetNavigate(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str | None = None
    path: str
    selectedValue: str | None = None
    step_id: str | None = None
    type: Literal["navigate"]


class ChatSnippetMultipleChoice(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    allowMultiple: bool | None = None
    id: str | None = None
    options: list[MultipleChoiceOption]
    question: str
    questionId: str
    selectedValue: str | None = None
    step_id: str | None = None
    type: Literal["multiple_choice"]


class ChatSnippetImage(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    id: str | None = None
    selectedValue: str | None = None
    step_id: str | None = None
    type: Literal["image"]
    url: str


class ModelEventToolApprovalResponse(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    approved: bool
    step_id: str
    timestamp: float
    type: Literal["ToolApprovalResponse"]


class ModelEventToolApprovalRequest(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    arguments: str
    name: str
    step_id: str
    timestamp: float
    type: Literal["ToolApprovalRequest"]


class ModelEventToolCallGenerating(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    step_id: str
    timestamp: float
    tool_name: str
    type: Literal["ToolCallGenerating"]


class ModelEventToolCall(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    integration: str
    parameters: str
    step_id: str
    summary: str
    timestamp: float
    type: Literal["ToolCall"]


class ModelEventTextDelta(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    delta: str
    step_id: str
    timestamp: float
    type: Literal["TextDelta"]


class ModelEventRunError(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    code: str | None = None
    error: str
    timestamp: float
    type: Literal["RunError"]


class ModelEventCancelled(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    reason: str | None = None
    timestamp: float
    type: Literal["Cancelled"]


class ModelEventNaturalStop(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    step_id: str
    timestamp: float
    type: Literal["NaturalStop"]


class ModelEventFilterResult(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    confidence: float
    isRelevant: bool
    reason: str
    step_id: str
    timestamp: float
    type: Literal["FilterResult"]


class ModelEventUserMessage(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    client_turn_id: str
    message: str
    step_id: str
    timestamp: float
    type: Literal["UserMessage"]


class ModelEventThinking(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    step_id: str
    timestamp: float
    type: Literal["Thinking"]


class SdkAgentStreamEventText(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    text: str
    type: Literal["text"]


class SdkAgentStreamEventFinalOutput(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    finalOutput: str
    type: Literal["final_output"]


class SdkAgentStreamEventToolCallParams(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    toolCallParams: str
    type: Literal["tool_call_params"]


class SdkAgentStreamEventToolCallStarted(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    toolCallStarted: str
    type: Literal["tool_call_started"]


class SdkAgentStreamEventToolCallCompleted(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    toolCallCompleted: str
    type: Literal["tool_call_completed"]


class SdkAgentStreamEventError(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    message: str
    type: Literal["error"]


class SdkAgentStreamEventDone(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    type: Literal["done"]


class Partial3CSdkAgentRunEventPayload3E(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    debugLog: str | None = None
    formattedContent: str | None = None
    integrationType: IntegrationType | None = None


class Pick3CUser2CExclude3C22id227C22workosId227C22organizationId227C22organizationName227C22email227C22displayName227C22firstName227C22lastName227C22displayPhotoUrl227C22roles222C22organizationId227C22organizationName227C22roles223E3E(
    BaseModel
):
    model_config = ConfigDict(
        extra="forbid",
    )
    displayName: str
    displayPhotoUrl: str
    email: str
    firstName: str | None
    id: str
    lastName: str | None
    workosId: str


class Record3Cstring2Cunknown3E(RootModel[dict[str, Any]]):
    root: dict[str, Any]


class AgentNotificationSettings(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    actionTypes: list[RunHistoryActionType]
    enabled: bool


class ApprovalAction(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    deepLink: str
    label: str
    type: ApprovalActionType


class ApprovalRequest(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    actions: list[ApprovalAction]
    agentId: str
    icon: IntegrationType
    id: str
    runId: str
    status: ApprovalRequestStatus
    subheader: str
    timestamp: str
    title: str


class AttioRecord(BaseModel):
    created_at: str | None = None
    id: AttioRecordIdentifier | None = None
    values: Record3Cstring2Cunknown3E | None = None
    web_url: str | None = None


class ChangedItem(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    change_event_type: ChangeEventType
    id: str
    type_name: EntityType


class ChatSnippet(
    RootModel[
        ChatSnippetButton
        | ChatSnippetIntegrationPrompt
        | ChatSnippetNavigate
        | ChatSnippetMultipleChoice
        | ChatSnippetImage
    ]
):
    root: Annotated[
        ChatSnippetButton
        | ChatSnippetIntegrationPrompt
        | ChatSnippetNavigate
        | ChatSnippetMultipleChoice
        | ChatSnippetImage,
        Field(discriminator="type"),
    ]


class ConfigDetails(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    configType: ConfigType
    description: str
    integrationType: IntegrationType
    isInput: bool
    isOutput: bool
    name: str


class ConfigInstance(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    configType: ConfigType
    integrationId: str
    integrationType: IntegrationType


class IntegrationDetails(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    description: str
    isInput: bool | None = None
    isOutput: bool | None = None
    name: str
    type: IntegrationType


class NotificationSettings(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    agentDefaultNotifications: list[RunHistoryActionType]
    id: str
    weeklyAgentImprovements: bool


class OmitUserOrganizationIdOrganizationNameRoles(
    RootModel[
        Pick3CUser2CExclude3C22id227C22workosId227C22organizationId227C22organizationName227C22email227C22displayName227C22firstName227C22lastName227C22displayPhotoUrl227C22roles222C22organizationId227C22organizationName227C22roles223E3E
    ]
):
    root: Pick3CUser2CExclude3C22id227C22workosId227C22organizationId227C22organizationName227C22email227C22displayName227C22firstName227C22lastName227C22displayPhotoUrl227C22roles222C22organizationId227C22organizationName227C22roles223E3E


class RunHistoryAction(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    action: str
    details: str
    integration: IntegrationType
    isReadOnly: bool | None = None
    output_items: list[OutputItem] | None = None
    step_id: str | None = None
    target: str
    type: RunHistoryActionType
    url: str | None = None


class RunHistoryDecision(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    action: RunHistoryDecisionAction
    reasoning: str


class RunHistoryRecord(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    actions: list[RunHistoryAction] | None = None
    agentId: str
    decision: RunHistoryDecision
    filtered: bool
    id: str
    isManuallyTriggered: bool
    status: RunHistoryStatus
    timestamp: str
    trigger: RunHistoryTrigger


class SdkAgentSkillPayload(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    config: Record3Cstring2Cunknown3E
    configType: ConfigType


class SdkDeployTrigger(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    config: Record3Cstring2Cunknown3E
    configType: str
    integrationId: str
    integrationType: str


class SerializedEvent(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    debugLog: str
    eventType: str | None = None
    formattedContent: str
    integrationType: IntegrationType
    metadata: Record3Cstring2Cunknown3E | None = None


class SnowflakeExecuteQueryToolOutput(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    actions: list[RunHistoryAction] | None = None
    columns: list[str]
    rowCount: float
    rows: list[Record3Cstring2Cunknown3E]
    success: bool


class SnowflakeExplainQueryToolOutput(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    actions: list[RunHistoryAction] | None = None
    columns: list[str]
    explainPlan: list[Record3Cstring2Cunknown3E]
    rowCount: float
    success: bool


class ToolOutputBase(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    actions: list[RunHistoryAction] | None = None
    success: bool


class TriggerPayload(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    config: Record3Cstring2Cunknown3E
    integrationId: str
    integrationType: IntegrationType


class ModelEventToolCallComplete(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    changed_items: list[ChangedItem]
    errorContext: SharedErrorContext | None = None
    integration: str
    result: str | None = None
    status: ToolCallExecutionStatus
    step_id: str
    timestamp: float
    tool_name: str
    type: Literal["ToolCallComplete"]
    url: str | None = None


class ModelEventSnippet(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    snippet: ChatSnippet
    timestamp: float
    type: Literal["Snippet"]


class SdkAgentStreamEventAction(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    action: RunHistoryAction
    type: Literal["action"]


class Omit3CUser2C22organizationId227C22organizationName227C22roles223E(
    RootModel[
        Pick3CUser2CExclude3C22id227C22workosId227C22organizationId227C22organizationName227C22email227C22displayName227C22firstName227C22lastName227C22displayPhotoUrl227C22roles222C22organizationId227C22organizationName227C22roles223E3E
    ]
):
    root: Pick3CUser2CExclude3C22id227C22workosId227C22organizationId227C22organizationName227C22email227C22displayName227C22firstName227C22lastName227C22displayPhotoUrl227C22roles222C22organizationId227C22organizationName227C22roles223E3E


class AgentOutput(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    config: ConfigInstance
    id: str


class AgentTrigger(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    config: ConfigInstance
    id: str


class AgentUpdate(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    isActive: bool | None = None
    name: str | None = None
    notificationSettings: AgentNotificationSettings | None = None
    outputs: list[AgentOutput] | None = None
    prompt: AgentPrompt | None = None
    requireApproval: bool | None = None
    toolApprovals: list[str] | None = None
    triggers: list[AgentTrigger] | None = None


class AttioListObjectsToolOutput(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    actions: list[RunHistoryAction] | None = None
    count: float
    objects: list[AttioObjectWithAttributes]
    success: bool


class AttioQueryRecordsToolOutput(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    actions: list[RunHistoryAction] | None = None
    count: float
    records: list[AttioRecord]
    success: bool


class AttioUpsertRecordToolOutput(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    actions: list[RunHistoryAction] | None = None
    record: AttioRecord | None = None
    success: bool


class ModelEvent(
    RootModel[
        ModelEventToolApprovalResponse
        | ModelEventToolApprovalRequest
        | ModelEventToolCallGenerating
        | ModelEventToolCall
        | ModelEventToolCallComplete
        | ModelEventTextDelta
        | ModelEventRunError
        | ModelEventCancelled
        | ModelEventNaturalStop
        | ModelEventFilterResult
        | ModelEventUserMessage
        | ModelEventThinking
        | ModelEventSnippet
    ]
):
    root: Annotated[
        ModelEventToolApprovalResponse
        | ModelEventToolApprovalRequest
        | ModelEventToolCallGenerating
        | ModelEventToolCall
        | ModelEventToolCallComplete
        | ModelEventTextDelta
        | ModelEventRunError
        | ModelEventCancelled
        | ModelEventNaturalStop
        | ModelEventFilterResult
        | ModelEventUserMessage
        | ModelEventThinking
        | ModelEventSnippet,
        Field(discriminator="type"),
    ]


class SdkAgentRunRequestBody(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    event: Partial3CSdkAgentRunEventPayload3E | None = None
    options: SdkAgentRunOptionsPayload | None = None
    prompt: str | None = None
    skills: list[SdkAgentSkillPayload] | None = None


class NormalizedRequest(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    event: SdkAgentRunEventPayload
    options: Options
    prompt: str
    skills: list[SdkAgentSkillPayload]


class SdkAgentRunResponseBody(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    contract: Contract | None = None
    details: list[str] | None = None
    error: str | None = None
    normalizedRequest: NormalizedRequest | None = None
    success: bool


class SdkAgentStreamEvent(
    RootModel[
        SdkAgentStreamEventText
        | SdkAgentStreamEventFinalOutput
        | SdkAgentStreamEventToolCallParams
        | SdkAgentStreamEventToolCallStarted
        | SdkAgentStreamEventToolCallCompleted
        | SdkAgentStreamEventAction
        | SdkAgentStreamEventError
        | SdkAgentStreamEventDone
    ]
):
    root: Annotated[
        SdkAgentStreamEventText
        | SdkAgentStreamEventFinalOutput
        | SdkAgentStreamEventToolCallParams
        | SdkAgentStreamEventToolCallStarted
        | SdkAgentStreamEventToolCallCompleted
        | SdkAgentStreamEventAction
        | SdkAgentStreamEventError
        | SdkAgentStreamEventDone,
        Field(discriminator="type"),
    ]


class SdkDeployJob(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    jobName: str
    triggers: list[SdkDeployTrigger]
    webhookURL: str | None = None


class SdkDeployRequestBody(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    jobs: list[SdkDeployJob]
    sourceZipBase64: str


class UserNoOrganization(RootModel[Omit3CUser2C22organizationId227C22organizationName227C22roles223E]):
    root: Omit3CUser2C22organizationId227C22organizationName227C22roles223E


class Agent(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    createdByUserId: str
    id: str
    isActive: bool
    name: str
    notificationSettings: AgentNotificationSettings | None = None
    outputs: list[AgentOutput]
    prompt: AgentPrompt
    requireApproval: bool
    source: Literal["WEB_UI", "SDK"] | None = None
    toolApprovals: list[str] | None = None
    triggers: list[AgentTrigger]
    updatedAt: str | None = None
