Skip to content

run

Generated reference page for spec/v1/schemas/resources/run.json.

Metadata

  • Type: JSON Schema
  • Source: spec/v1/schemas/resources/run.json
  • Raw: View Raw

Summary

Source

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agent-service.spec/v1/schemas/resources/run.json",
  "$defs": {
    "EphemeralToolDescriptor": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "description"],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "parametersSchema": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "AgentRunInput": {
      "type": "object",
      "additionalProperties": false,
      "required": ["mode", "messages"],
      "properties": {
        "mode": {
          "const": "agent"
        },
        "messages": {
          "type": "array",
          "items": {
            "$ref": "./message-record.json#/$defs/TaskInputMessage"
          }
        },
        "callableAliases": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalCallableRefs": {
          "type": "array",
          "items": {
            "$ref": "./agent-revision.json#/$defs/CallableRef"
          }
        },
        "ephemeralTools": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EphemeralToolDescriptor"
          }
        }
      }
    },
    "ToolRunInput": {
      "type": "object",
      "additionalProperties": false,
      "required": ["mode", "arguments"],
      "properties": {
        "mode": {
          "const": "tool"
        },
        "arguments": {
          "type": "object",
          "additionalProperties": true
        },
        "callerContext": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "McpServerRunInput": {
      "type": "object",
      "additionalProperties": false,
      "required": ["mode", "clientInfo", "clientCapabilities"],
      "properties": {
        "mode": {
          "const": "mcp_server"
        },
        "clientInfo": {
          "type": "object",
          "additionalProperties": true
        },
        "clientCapabilities": {
          "type": "object",
          "additionalProperties": true
        },
        "sessionContext": {
          "type": "object",
          "additionalProperties": true
        },
        "metadata": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "RunInput": {
      "oneOf": [
        {
          "$ref": "#/$defs/AgentRunInput"
        },
        {
          "$ref": "#/$defs/ToolRunInput"
        },
        {
          "$ref": "#/$defs/McpServerRunInput"
        }
      ]
    },
    "Attempt": {
      "type": "object",
      "additionalProperties": false,
      "required": ["attemptId", "attemptNo", "status"],
      "properties": {
        "attemptId": {
          "$ref": "../common/identity.json#/$defs/attemptId"
        },
        "attemptNo": {
          "type": "integer",
          "minimum": 1
        },
        "status": {
          "$ref": "../common/enums.json#/$defs/taskStatus"
        },
        "runEnv": {
          "$ref": "../common/enums.json#/$defs/taskRunEnv"
        },
        "providerType": {
          "$ref": "../common/enums.json#/$defs/providerType"
        },
        "runSpaceId": {
          "$ref": "../common/identity.json#/$defs/runSpaceId"
        },
        "sessionId": {
          "$ref": "../common/identity.json#/$defs/sessionId"
        },
        "runtimeConnectionId": {
          "$ref": "../common/identity.json#/$defs/runtimeConnectionId"
        },
        "startedAt": {
          "$ref": "../common/identity.json#/$defs/timestamp"
        },
        "finishedAt": {
          "$ref": "../common/identity.json#/$defs/timestamp"
        },
        "lastKeepAliveAt": {
          "$ref": "../common/identity.json#/$defs/timestamp"
        },
        "sdkCapabilitySnapshot": {
          "type": "array",
          "items": {
            "$ref": "../commands/runtime-connection.json#/$defs/SDKCapabilityDescriptor"
          }
        },
        "errorSummary": {
          "type": "string"
        }
      }
    }
  },
  "type": "object",
  "additionalProperties": false,
  "required": [
    "runId",
    "orgId",
    "resourceType",
    "resourceId",
    "input",
    "attempts",
    "eventSequence",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "runId": {
      "$ref": "../common/identity.json#/$defs/runId"
    },
    "orgId": {
      "$ref": "../common/identity.json#/$defs/orgId"
    },
    "resourceType": {
      "$ref": "../common/enums.json#/$defs/taskResourceType"
    },
    "resourceId": {
      "$ref": "../common/identity.json#/$defs/opaqueId"
    },
    "resourceRevisionId": {
      "$ref": "../common/identity.json#/$defs/opaqueId"
    },
    "releaseChannelId": {
      "$ref": "../common/identity.json#/$defs/releaseChannelId"
    },
    "threadId": {
      "$ref": "../common/identity.json#/$defs/threadId"
    },
    "contextId": {
      "$ref": "../common/identity.json#/$defs/opaqueId"
    },
    "status": {
      "$ref": "../common/enums.json#/$defs/taskStatus"
    },
    "input": {
      "$ref": "#/$defs/RunInput"
    },
    "executionProfileSnapshot": {
      "$ref": "../common/execution-profile.json#/$defs/ExecutionProfile"
    },
    "runPolicySnapshot": {
      "$ref": "../common/execution-profile.json#/$defs/RunPolicy"
    },
    "attempts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Attempt"
      }
    },
    "currentAttemptId": {
      "$ref": "../common/identity.json#/$defs/attemptId"
    },
    "blockingInteractionId": {
      "$ref": "../common/identity.json#/$defs/interactionId"
    },
    "blockedReason": {
      "$ref": "../common/enums.json#/$defs/taskBlockedReason"
    },
    "waitingSince": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    },
    "openInteractionCount": {
      "type": "integer",
      "minimum": 0
    },
    "deadlineAt": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    },
    "eventSequence": {
      "$ref": "../common/identity.json#/$defs/sequence"
    },
    "version": {
      "$ref": "../common/identity.json#/$defs/version"
    },
    "webhook": {
      "$ref": "./webhook-subscription.json"
    },
    "createdAt": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    },
    "updatedAt": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    },
    "finishedAt": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    },
    "statusMessage": {
      "type": "string"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "resourceType": {
            "const": "agent"
          }
        },
        "required": ["resourceType"]
      },
      "then": {
        "properties": {
          "input": {
            "$ref": "#/$defs/AgentRunInput"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resourceType": {
            "const": "tool"
          }
        },
        "required": ["resourceType"]
      },
      "then": {
        "properties": {
          "input": {
            "$ref": "#/$defs/ToolRunInput"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resourceType": {
            "const": "mcp_server"
          }
        },
        "required": ["resourceType"]
      },
      "then": {
        "properties": {
          "input": {
            "$ref": "#/$defs/McpServerRunInput"
          }
        }
      }
    }
  ]
}

白皮书与规范内容以仓库真源为准。