メインコンテンツへ移動
本文へ移動
イベントストリーム

Task Agent

イベントストリーム

SSE フレーム、切断後の再開、Event v2 の構造を確認します。

Task Agent は Server-Sent Events(SSE)で進捗を配信します。永続イベントは HAST Event v2 エンベロープを使い、GET /sessions/{id}/events と同じ構造です。

ストリームへ接続

クイックスタートに従って HAST_API_BASEHAST_API_KEYSESSION_ID を設定します。

curl -N --fail-with-body \
  "$HAST_API_BASE/sessions/$SESSION_ID/events/stream?after=0" \
  -H "Authorization: Bearer $HAST_API_KEY" \
  -H 'Accept: text/event-stream'

sessions:read が必要です。応答は text/event-stream で、イベント間に : keep-alive コメントも届きます。

SSE フレーム形式

id: 42
event: message.completed
data: {"schema_version":2,"event_id":"evt_123",...}

ここでは説明のため data を省略しています。実際は完全な JSON イベントで、空行でフレームを区切ります。

項目意味
id再開に使う永続シーケンス番号
eventエンベロープの type に対応する種別
dataHAST Event v2 JSON エンベロープ

再接続と再生

処理済みの永続シーケンス番号を保存します。再接続時に after または Last-Event-ID ヘッダーで渡します。event_id を番号として使わないでください。

curl -N --fail-with-body \
  "$HAST_API_BASE/sessions/$SESSION_ID/events/stream" \
  -H "Authorization: Bearer $HAST_API_KEY" \
  -H 'Accept: text/event-stream' \
  -H 'Last-Event-ID: 42'

JSON でイベントを取得

継続接続が不要なら GET /sessions/{id}/eventsafterlimit 付きで使えます。セッションとイベントを参照してください。

Event v2 と種別

エンベロープにはバージョン、イベント ID、ソース、エンジン、タスク識別子、種別、データがあります。sequence は永続イベントで正整数、一時イベントでは null です。replayable は再生可能性を表します。

type に応じて data の構造が変わります。メッセージ、ツール、計画、実行では項目が異なります。メッセージ完了を実行全体の完了とせず、run.completedrun.failedrun.interrupted で判断してください。

以下は同じ OpenAPI JSON から生成した構造です。展開すると項目、必須条件、例を確認できます。api.TaskAgentEventDoc 参照は共通エンベロープを指し、他の部分は種別固有のデータを表します。

Event v2 の完全なエンベロープ
JSON
{
  "discriminator": "type",
  "properties": {
    "created_at": {
      "example": "2026-08-16T12:00:00Z",
      "format": "date-time",
      "type": "string"
    },
    "data": {
      "allOf": [
        {
          "properties": {
            "attempt": {
              "minimum": 1,
              "type": "integer"
            },
            "attempts": {
              "minimum": 1,
              "type": "integer"
            },
            "channel": {
              "enum": [
                "stdout",
                "stderr",
                "progress"
              ],
              "type": "string"
            },
            "code": {
              "type": "string"
            },
            "context_window": {
              "minimum": 0,
              "type": "integer"
            },
            "cost": {},
            "delta": {
              "type": "string"
            },
            "duration_ms": {
              "minimum": 0,
              "type": "integer"
            },
            "error": {
              "type": "string"
            },
            "exit_code": {
              "type": "integer"
            },
            "files": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "final_message_id": {
              "type": "string"
            },
            "finish_reason": {
              "type": "string"
            },
            "input": {},
            "is_error": {
              "type": "boolean"
            },
            "kind": {
              "type": "string"
            },
            "last": {
              "properties": {
                "cache_read_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cache_write_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "input_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "output_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "reasoning_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "total_tokens": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "cache_read_tokens",
                "cache_write_tokens",
                "input_tokens",
                "output_tokens",
                "reasoning_tokens",
                "total_tokens"
              ],
              "type": "object"
            },
            "message": {
              "type": "string"
            },
            "message_id": {
              "type": "string"
            },
            "model": {
              "type": "string"
            },
            "model_source": {
              "type": "string"
            },
            "modified_at": {
              "format": "date-time",
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "operation": {
              "enum": [
                "update",
                "delete"
              ],
              "type": "string"
            },
            "options": {
              "items": {},
              "type": "array"
            },
            "output": {},
            "parent_tool_call_id": {
              "type": "string"
            },
            "path": {
              "type": "string"
            },
            "plan_id": {
              "type": "string"
            },
            "prompt": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "reasoning_id": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            },
            "retryable": {
              "type": "boolean"
            },
            "role": {
              "enum": [
                "user",
                "assistant",
                "system"
              ],
              "type": "string"
            },
            "scope": {
              "type": "string"
            },
            "size_bytes": {
              "minimum": 0,
              "type": "integer"
            },
            "status": {
              "enum": [
                "starting",
                "ready",
                "failed",
                "released",
                "succeeded",
                "interrupted"
              ],
              "type": "string"
            },
            "steps": {
              "items": {
                "properties": {
                  "status": {
                    "enum": [
                      "pending",
                      "in_progress",
                      "completed"
                    ],
                    "example": "in_progress",
                    "type": "string"
                  },
                  "step": {
                    "type": "string"
                  }
                },
                "required": [
                  "status",
                  "step"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "text": {
              "type": "string"
            },
            "tokens_after": {
              "minimum": 0,
              "type": "integer"
            },
            "tokens_before": {
              "minimum": 0,
              "type": "integer"
            },
            "tool_call_id": {
              "type": "string"
            },
            "total": {
              "properties": {
                "cache_read_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cache_write_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "input_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "output_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "reasoning_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "total_tokens": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "cache_read_tokens",
                "cache_write_tokens",
                "input_tokens",
                "output_tokens",
                "reasoning_tokens",
                "total_tokens"
              ],
              "type": "object"
            },
            "turn_type": {
              "type": "string"
            }
          },
          "type": "object"
        }
      ],
      "description": "Data is the HAST-owned payload union; Type selects its required shape as\ndefined in docs/reference/task-agent-event-v2.md."
    },
    "engine": {
      "enum": [
        "codex_cli",
        "pi_agent_cli"
      ],
      "example": "codex_cli",
      "type": "string"
    },
    "event_id": {
      "example": "evt_123",
      "type": "string"
    },
    "replayable": {
      "example": true,
      "type": "boolean"
    },
    "run_id": {
      "example": "run_123",
      "type": "string"
    },
    "schema_version": {
      "enum": [
        2
      ],
      "example": 2,
      "type": "integer"
    },
    "sequence": {
      "description": "Sequence is a positive durable order, or null for volatile events.",
      "example": 42,
      "minimum": 1,
      "type": "integer",
      "x-nullable": true
    },
    "session_id": {
      "example": "session_123",
      "type": "string"
    },
    "source": {
      "enum": [
        "runtime",
        "backplane",
        "workspace"
      ],
      "example": "runtime",
      "type": "string"
    },
    "task_id": {
      "example": "task_123",
      "type": "string"
    },
    "type": {
      "enum": [
        "runtime.status",
        "run.queued",
        "run.started",
        "run.retrying",
        "run.completed",
        "run.failed",
        "run.interrupted",
        "message.started",
        "message.delta",
        "message.completed",
        "reasoning.started",
        "reasoning.delta",
        "reasoning.completed",
        "tool.started",
        "tool.updated",
        "tool.completed",
        "plan.updated",
        "plan.completed",
        "usage.updated",
        "file.changed",
        "input.requested",
        "context.compacted",
        "warning",
        "error"
      ],
      "example": "message.completed",
      "type": "string"
    }
  },
  "required": [
    "created_at",
    "data",
    "engine",
    "event_id",
    "replayable",
    "schema_version",
    "sequence",
    "source",
    "task_id",
    "type"
  ],
  "type": "object"
}
context.compacted
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reason"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "context.compacted"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
error
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "scope",
                "code",
                "message",
                "retryable"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "error"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
file.changed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "path",
                "operation"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "file.changed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
input.requested
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "request_id",
                "kind",
                "prompt"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "input.requested"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
message.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "message_id",
                "role",
                "text"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "message.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
message.delta
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "message_id",
                "role",
                "delta"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "message.delta"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
message.started
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "message_id",
                "role"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "message.started"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
plan.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "plan_id"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "plan.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
plan.updated
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "plan_id"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "plan.updated"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
reasoning.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reasoning_id",
                "text"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "reasoning.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
reasoning.delta
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reasoning_id",
                "delta"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "reasoning.delta"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
reasoning.started
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reasoning_id"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "reasoning.started"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "final_message_id",
                "finish_reason",
                "attempts"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.failed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "code",
                "message",
                "retryable",
                "attempts"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.failed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.interrupted
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reason"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.interrupted"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.queued
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "request_id",
                "turn_type"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.queued"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.retrying
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "attempt",
                "code",
                "message"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.retrying"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.started
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "request_id",
                "turn_type"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.started"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
runtime.status
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "properties": {
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "status"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "runtime.status"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
tool.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "properties": {
                "status": {
                  "enum": [
                    "succeeded",
                    "failed",
                    "interrupted"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "tool_call_id",
                "kind",
                "name",
                "status",
                "is_error"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "tool.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
tool.started
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "tool_call_id",
                "kind",
                "name"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "tool.started"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
tool.updated
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "tool_call_id",
                "channel",
                "delta"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "tool.updated"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
usage.updated
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "model",
                "context_window",
                "total"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "usage.updated"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
warning
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "scope",
                "code",
                "message",
                "retryable"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "warning"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
Hast についてHast AIP、Hast Agent、Hast GTM と、FDE チームによる導入支援を紹介します。AIP の紹介FDE の導入ワークベンチで Agent を設定し、業務システムを接続します。最初の Agent を作成外部サービスを使わずに、設定・保存・デバッグを試します。Agent の設定と管理役割、モデル、機能を設定し、現在有効な設定を管理します。Skills の管理Agent が使うスキルファイルを作成、インポート、選択します。ナレッジベースの追加URL やファイルを索引化し、Agent が資料を検索できるようにします。業務シークレットの管理認証情報を保存して Agent にバインドし、設定例に実際の値を含めないようにします。業務ツールの接続入力と認証方法を指定して、Agent から既存の HTTP サービスを呼び出します。長期メモリの設定Agent が読めるメモリと、新しいメモリの保存先を指定します。Agent のデバッグ保存した設定、会話の継続、ツールの結果を検証します。インポート・エクスポート・複製設定を再利用し、移行後にリソースと認証情報を再確認します。HTTP 接続サーバーから Agent を呼び出し、会話の継続、応答の取得、停止を行います。MCP 接続Public API Key で外部 Agent クライアントから AIP ツールを利用します。Task Agent の紹介計画から実行、成果物まで、ツール・ファイル・継続的な文脈を使って作業を進めます。最初のタスクを完了依頼を送信し、計画を確認して、最終成果物を検証します。会話の計画・実行・管理計画の調整、実行の停止、会話履歴の管理を行います。ファイルのアップロード・閲覧・取得入力資料を渡し、タスクが作成した成果物を保存します。アプリ接続と機能設定外部アプリを認証し、タスク間で使う背景情報を管理します。定期タスクの作成周期とタイムゾーンを設定し、各実行の結果を確認します。Task Agent のトラブルシューティング権限、接続、タスク状態、ファイルを確認します。API クイックスタートキーを作成し、タスクを送信して実行結果を読み取ります。イベントストリームSSE フレーム、切断後の再開、Event v2 の構造を確認します。API リファレンス公開 API の引数、認証、応答スキーマを確認します。GTM の紹介Web サイトの共通プロジェクトで調査、露出分析、マーケティング原稿を扱います。最初の GTM プロジェクトを作成サイトを入力し、初期化を待って最初の結果を確認します。プロジェクトとサイト資料の管理プロジェクトの切り替え、サイト情報の更新、設定の管理を行います。会社分析とプロジェクト文書製品、競合、マーケティング資料を確認し、コンテンツ作成の背景に使います。SEO とサイト性能モバイルとデスクトップの PageSpeed レポートを確認します。AI によるブランド言及購買者の質問と、モデル回答でのブランド言及を確認します。Google Analytics の接続アカウントを認証し、GA プロパティを選んでトラフィックを確認します。X 原稿の生成と公開投稿を生成し、プレビューを確認して X で公開します。記事の下書きを生成スタイル、言語、読者を指定し、Markdown を確認してコピーします。Growth Agent の利用会話でプロジェクト資料を参照し、対応するバックグラウンド操作を開始します。実行状態とトラブルシューティングキュー、依存関係、結果を確認し、未完了をデータなしと混同しないようにします。プランと使用量現在の Profile の利用権限、使用量、請求を確認します。