Files
proxycast/lime-rs/crates/app-server-protocol/schema/json/v0/AgentSessionEventParams.json
T
2026-07-15 02:48:06 +08:00

1661 lines
35 KiB
JSON

{
"$defs": {
"AgentAttachment": {
"properties": {
"kind": {
"type": "string"
},
"metadata": true,
"uri": {
"type": [
"null",
"string"
]
}
},
"required": [
"kind"
],
"type": "object"
},
"AgentEvent": {
"properties": {
"eventId": {
"type": "string"
},
"payload": true,
"sequence": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"sessionId": {
"type": "string"
},
"threadId": {
"type": [
"null",
"string"
]
},
"timestamp": {
"type": "string"
},
"turnId": {
"type": [
"null",
"string"
]
},
"type": {
"type": "string"
}
},
"required": [
"eventId",
"payload",
"sequence",
"sessionId",
"timestamp",
"type"
],
"type": "object"
},
"AgentInput": {
"properties": {
"attachments": {
"default": [],
"items": {
"$ref": "#/$defs/AgentAttachment"
},
"type": "array"
},
"text": {
"type": "string"
}
},
"required": [
"text"
],
"type": "object"
},
"AgentSessionAgentMessageDeltaNotification": {
"properties": {
"delta": {
"type": "string"
},
"eventId": {
"type": "string"
},
"itemId": {
"type": "string"
},
"phase": {
"type": [
"null",
"string"
]
},
"sequence": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"sessionId": {
"type": "string"
},
"source": {
"type": [
"null",
"string"
]
},
"threadId": {
"type": [
"null",
"string"
]
},
"timestamp": {
"type": "string"
},
"turnId": {
"type": [
"null",
"string"
]
}
},
"required": [
"delta",
"eventId",
"itemId",
"sequence",
"sessionId",
"timestamp"
],
"type": "object"
},
"AgentSessionItemLifecycleNotification": {
"properties": {
"eventId": {
"type": "string"
},
"itemId": {
"type": "string"
},
"itemType": {
"type": [
"null",
"string"
]
},
"ordinal": {
"format": "uint64",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"sequence": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"sessionId": {
"type": "string"
},
"status": {
"type": [
"null",
"string"
]
},
"threadId": {
"type": [
"null",
"string"
]
},
"timestamp": {
"type": "string"
},
"turnId": {
"type": [
"null",
"string"
]
}
},
"required": [
"eventId",
"itemId",
"sequence",
"sessionId",
"timestamp"
],
"type": "object"
},
"AgentSessionMessageCreatedNotification": {
"properties": {
"eventId": {
"type": "string"
},
"input": {
"anyOf": [
{
"$ref": "#/$defs/AgentInput"
},
{
"type": "null"
}
]
},
"role": {
"type": [
"null",
"string"
]
},
"sequence": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"sessionId": {
"type": "string"
},
"text": {
"type": [
"null",
"string"
]
},
"threadId": {
"type": [
"null",
"string"
]
},
"timestamp": {
"type": "string"
},
"turnId": {
"type": [
"null",
"string"
]
}
},
"required": [
"eventId",
"sequence",
"sessionId",
"timestamp"
],
"type": "object"
},
"AgentSessionRuntimeEventNotification": {
"oneOf": [
{
"properties": {
"method": {
"const": "message/created",
"type": "string"
},
"params": {
"$ref": "#/$defs/AgentSessionMessageCreatedNotification"
}
},
"required": [
"method",
"params"
],
"type": "object"
},
{
"properties": {
"method": {
"const": "turn/accepted",
"type": "string"
},
"params": {
"$ref": "#/$defs/AgentSessionTurnLifecycleNotification"
}
},
"required": [
"method",
"params"
],
"type": "object"
},
{
"properties": {
"method": {
"const": "turn/started",
"type": "string"
},
"params": {
"$ref": "#/$defs/AgentSessionTurnLifecycleNotification"
}
},
"required": [
"method",
"params"
],
"type": "object"
},
{
"properties": {
"method": {
"const": "turn/completed",
"type": "string"
},
"params": {
"$ref": "#/$defs/AgentSessionTurnLifecycleNotification"
}
},
"required": [
"method",
"params"
],
"type": "object"
},
{
"properties": {
"method": {
"const": "turn/failed",
"type": "string"
},
"params": {
"$ref": "#/$defs/AgentSessionTurnLifecycleNotification"
}
},
"required": [
"method",
"params"
],
"type": "object"
},
{
"properties": {
"method": {
"const": "item/agentMessage/delta",
"type": "string"
},
"params": {
"$ref": "#/$defs/AgentSessionAgentMessageDeltaNotification"
}
},
"required": [
"method",
"params"
],
"type": "object"
},
{
"properties": {
"method": {
"const": "item/started",
"type": "string"
},
"params": {
"$ref": "#/$defs/AgentSessionItemLifecycleNotification"
}
},
"required": [
"method",
"params"
],
"type": "object"
},
{
"properties": {
"method": {
"const": "item/completed",
"type": "string"
},
"params": {
"$ref": "#/$defs/AgentSessionItemLifecycleNotification"
}
},
"required": [
"method",
"params"
],
"type": "object"
}
]
},
"AgentSessionTurnLifecycleNotification": {
"properties": {
"eventId": {
"type": "string"
},
"sequence": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"sessionId": {
"type": "string"
},
"status": {
"$ref": "#/$defs/AgentTurnStatus"
},
"threadId": {
"type": [
"null",
"string"
]
},
"timestamp": {
"type": "string"
},
"turnId": {
"type": [
"null",
"string"
]
}
},
"required": [
"eventId",
"sequence",
"sessionId",
"status",
"timestamp"
],
"type": "object"
},
"AgentTurnStatus": {
"enum": [
"accepted",
"canceled",
"completed",
"failed",
"queued",
"running",
"waitingAction"
],
"type": "string"
},
"ApprovalAction": {
"properties": {
"description": {
"type": "string"
},
"kind": {
"type": "string"
}
},
"required": [
"description",
"kind"
],
"type": "object"
},
"ApprovalDecision": {
"enum": [
"abort",
"approved",
"approvedForSession",
"denied",
"timedOut"
],
"type": "string"
},
"ApprovalScope": {
"enum": [
"once",
"session",
"turn"
],
"type": "string"
},
"CanonicalThreadEventNotification": {
"description": "Canonical live projection for Thread/Turn/Item consumers.\n\nThe projection only accepts fully typed canonical entities embedded by the\nruntime owner. It does not infer a canonical object from legacy payload\nfields; producers that do not yet emit a canonical entity remain visible\nthrough `event` until their owner migrates.",
"oneOf": [
{
"properties": {
"method": {
"const": "thread/updated",
"type": "string"
},
"params": {
"$ref": "#/$defs/Thread"
}
},
"required": [
"method",
"params"
],
"type": "object"
},
{
"properties": {
"method": {
"const": "turn/updated",
"type": "string"
},
"params": {
"$ref": "#/$defs/Turn"
}
},
"required": [
"method",
"params"
],
"type": "object"
},
{
"properties": {
"method": {
"const": "item/updated",
"type": "string"
},
"params": {
"$ref": "#/$defs/ThreadItem"
}
},
"required": [
"method",
"params"
],
"type": "object"
}
]
},
"CollabAgentOperation": {
"enum": [
"close",
"followUp",
"interrupt",
"resume",
"sendMessage",
"spawn",
"wait"
],
"type": "string"
},
"CollabAgentState": {
"properties": {
"message": {
"type": [
"null",
"string"
]
},
"status": {
"$ref": "#/$defs/CollabAgentStatus"
}
},
"required": [
"status"
],
"type": "object"
},
"CollabAgentStatus": {
"description": "Last known runtime status for an AgentControl child.\n\nThis mirrors Codex app-server's `CollabAgentStatus`; the optional message is\ncarried separately so the wire shape stays stable across terminal states.",
"enum": [
"completed",
"errored",
"interrupted",
"notFound",
"pendingInit",
"running",
"shutdown"
],
"type": "string"
},
"FileChangeStatus": {
"enum": [
"applied",
"failed",
"proposed",
"rejected"
],
"type": "string"
},
"ItemId": {
"description": "Stable canonical identity for a persisted ThreadItem.\n\nAdapted from Codex `ResponseItemId` (`5c19155cbd93bfa099016e7487259f61669823ff`),\nApache-2.0; see the repository's recorded provenance and NOTICE. New IDs are\nalways prefixed, while deserialization remains permissive for legacy history.",
"type": "string"
},
"ItemKind": {
"description": "Stable family name used by projections and selectors. The payload below is\ntagged and typed; consumers must not infer this value from rendered text.",
"enum": [
"agentMessage",
"approval",
"collabAgentToolCall",
"command",
"contextCompaction",
"extension",
"file",
"mcpToolCall",
"media",
"plan",
"reasoning",
"subAgent",
"tool",
"userMessage"
],
"type": "string"
},
"ItemStatus": {
"enum": [
"cancelled",
"completed",
"failed",
"inProgress",
"interrupted",
"pending"
],
"type": "string"
},
"PlanStep": {
"properties": {
"status": {
"$ref": "#/$defs/PlanStepStatus"
},
"step": {
"type": "string"
}
},
"required": [
"status",
"step"
],
"type": "object"
},
"PlanStepStatus": {
"enum": [
"completed",
"in_progress",
"pending"
],
"type": "string"
},
"SubAgentActivityKind": {
"enum": [
"interacted",
"interrupted",
"started"
],
"type": "string"
},
"Thread": {
"properties": {
"agentNickname": {
"type": [
"null",
"string"
]
},
"agentPath": {
"type": [
"null",
"string"
]
},
"agentRole": {
"type": [
"null",
"string"
]
},
"agentState": {
"anyOf": [
{
"$ref": "#/$defs/CollabAgentState"
},
{
"type": "null"
}
]
},
"archived": {
"type": "boolean"
},
"createdAtMs": {
"format": "int64",
"type": "integer"
},
"forkedFromId": {
"type": [
"null",
"string"
]
},
"lastTaskMessage": {
"type": [
"null",
"string"
]
},
"metadata": {
"default": null
},
"modelProvider": {
"default": "",
"type": "string"
},
"name": {
"type": [
"null",
"string"
]
},
"parentThreadId": {
"type": [
"null",
"string"
]
},
"preview": {
"default": "",
"type": "string"
},
"product": {
"type": [
"null",
"string"
]
},
"recencyAtMs": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"sessionId": {
"type": "string"
},
"status": {
"$ref": "#/$defs/ThreadStatus"
},
"threadId": {
"type": "string"
},
"turns": {
"default": [],
"items": {
"$ref": "#/$defs/Turn"
},
"type": "array"
},
"turnsView": {
"$ref": "#/$defs/ThreadTurnsView",
"default": "full"
},
"updatedAtMs": {
"format": "int64",
"type": "integer"
}
},
"required": [
"archived",
"createdAtMs",
"sessionId",
"status",
"threadId",
"updatedAtMs"
],
"type": "object"
},
"ThreadActiveFlag": {
"enum": [
"waitingOnApproval",
"waitingOnUserInput"
],
"type": "string"
},
"ThreadItem": {
"properties": {
"completedAtMs": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"createdAtMs": {
"format": "int64",
"type": "integer"
},
"itemId": {
"$ref": "#/$defs/ItemId"
},
"kind": {
"$ref": "#/$defs/ItemKind"
},
"metadata": {
"default": null
},
"ordinal": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"payload": {
"$ref": "#/$defs/ThreadItemPayload"
},
"sequence": {
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"sessionId": {
"type": "string"
},
"status": {
"$ref": "#/$defs/ItemStatus"
},
"threadId": {
"type": "string"
},
"turnId": {
"type": "string"
},
"updatedAtMs": {
"format": "int64",
"type": "integer"
}
},
"required": [
"createdAtMs",
"itemId",
"kind",
"ordinal",
"payload",
"sequence",
"sessionId",
"status",
"threadId",
"turnId",
"updatedAtMs"
],
"type": "object"
},
"ThreadItemPayload": {
"description": "Typed Item payload union. JSON `Value` is intentionally confined to the\nextension escape hatch; structured core families use explicit fields.",
"oneOf": [
{
"properties": {
"client_id": {
"type": [
"null",
"string"
]
},
"content": {
"type": "string"
},
"type": {
"const": "userMessage",
"type": "string"
}
},
"required": [
"content",
"type"
],
"type": "object"
},
{
"properties": {
"phase": {
"type": [
"null",
"string"
]
},
"text": {
"type": "string"
},
"type": {
"const": "agentMessage",
"type": "string"
}
},
"required": [
"text",
"type"
],
"type": "object"
},
{
"description": "Proposed plan content. The completed snapshot is authoritative and may\nnot equal the concatenation of preceding plan deltas.",
"properties": {
"explanation": {
"type": [
"null",
"string"
]
},
"plan": {
"default": [],
"items": {
"$ref": "#/$defs/PlanStep"
},
"type": "array"
},
"revision_id": {
"type": "string"
},
"source": {
"type": [
"null",
"string"
]
},
"source_item_id": {
"type": [
"null",
"string"
]
},
"text": {
"type": "string"
},
"tool_call_id": {
"type": [
"null",
"string"
]
},
"type": {
"const": "plan",
"type": "string"
}
},
"required": [
"revision_id",
"text",
"type"
],
"type": "object"
},
{
"properties": {
"content": {
"default": [],
"items": {
"type": "string"
},
"type": "array"
},
"summary": {
"default": [],
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"const": "reasoning",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"properties": {
"arguments": {
"default": [],
"items": {
"$ref": "#/$defs/ToolArgument"
},
"type": "array"
},
"call_id": {
"type": "string"
},
"name": {
"type": "string"
},
"output": {
"anyOf": [
{
"$ref": "#/$defs/ToolOutput"
},
{
"type": "null"
}
]
},
"type": {
"const": "tool",
"type": "string"
}
},
"required": [
"call_id",
"name",
"type"
],
"type": "object"
},
{
"properties": {
"arguments": {
"default": [],
"items": {
"$ref": "#/$defs/ToolArgument"
},
"type": "array"
},
"call_id": {
"type": "string"
},
"output": {
"anyOf": [
{
"$ref": "#/$defs/ToolOutput"
},
{
"type": "null"
}
]
},
"server_name": {
"type": "string"
},
"tool_name": {
"type": "string"
},
"type": {
"const": "mcpToolCall",
"type": "string"
}
},
"required": [
"call_id",
"server_name",
"tool_name",
"type"
],
"type": "object"
},
{
"properties": {
"call_id": {
"type": "string"
},
"message": {
"type": [
"null",
"string"
]
},
"operation": {
"$ref": "#/$defs/CollabAgentOperation"
},
"output": {
"anyOf": [
{
"$ref": "#/$defs/ToolOutput"
},
{
"type": "null"
}
]
},
"target_thread_id": {
"type": [
"null",
"string"
]
},
"type": {
"const": "collabAgentToolCall",
"type": "string"
}
},
"required": [
"call_id",
"operation",
"type"
],
"type": "object"
},
{
"properties": {
"action": {
"$ref": "#/$defs/ApprovalAction"
},
"available_decisions": {
"default": [],
"items": {
"$ref": "#/$defs/ApprovalDecision"
},
"type": "array"
},
"decision": {
"anyOf": [
{
"$ref": "#/$defs/ApprovalDecision"
},
{
"type": "null"
}
]
},
"expires_at_ms": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"reason_code": {
"type": [
"null",
"string"
]
},
"request_id": {
"type": "string"
},
"requested_at_ms": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"resolved_at_ms": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"scope": {
"$ref": "#/$defs/ApprovalScope",
"default": "once"
},
"type": {
"const": "approval",
"type": "string"
}
},
"required": [
"action",
"request_id",
"type"
],
"type": "object"
},
{
"properties": {
"command": {
"type": "string"
},
"cwd": {
"type": [
"null",
"string"
]
},
"exit_code": {
"format": "int32",
"type": [
"integer",
"null"
]
},
"output": {
"type": [
"null",
"string"
]
},
"type": {
"const": "command",
"type": "string"
}
},
"required": [
"command",
"type"
],
"type": "object"
},
{
"properties": {
"diff": {
"type": [
"null",
"string"
]
},
"path": {
"type": "string"
},
"status": {
"$ref": "#/$defs/FileChangeStatus"
},
"type": {
"const": "file",
"type": "string"
}
},
"required": [
"path",
"status",
"type"
],
"type": "object"
},
{
"properties": {
"mime_type": {
"type": "string"
},
"preview": {
"type": [
"null",
"string"
]
},
"type": {
"const": "media",
"type": "string"
},
"uri": {
"type": "string"
}
},
"required": [
"mime_type",
"type",
"uri"
],
"type": "object"
},
{
"properties": {
"activity": {
"$ref": "#/$defs/SubAgentActivityKind"
},
"child_thread_id": {
"type": "string"
},
"detail": {
"type": [
"null",
"string"
]
},
"type": {
"const": "subAgent",
"type": "string"
}
},
"required": [
"activity",
"child_thread_id",
"type"
],
"type": "object"
},
{
"properties": {
"summary": {
"type": [
"null",
"string"
]
},
"type": {
"const": "contextCompaction",
"type": "string"
},
"window_id": {
"type": [
"null",
"string"
]
}
},
"required": [
"type"
],
"type": "object"
},
{
"properties": {
"data": true,
"name": {
"type": "string"
},
"type": {
"const": "extension",
"type": "string"
}
},
"required": [
"data",
"name",
"type"
],
"type": "object"
}
]
},
"ThreadStatus": {
"description": "Codex runtime status for a thread. Persistence operations such as archive or\ndelete are commands, not runtime status values.",
"oneOf": [
{
"properties": {
"type": {
"const": "notLoaded",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"properties": {
"type": {
"const": "idle",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"properties": {
"type": {
"const": "systemError",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"properties": {
"activeFlags": {
"default": [],
"items": {
"$ref": "#/$defs/ThreadActiveFlag"
},
"type": "array"
},
"type": {
"const": "active",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
]
},
"ThreadTurnsView": {
"enum": [
"full",
"notLoaded",
"summary"
],
"type": "string"
},
"ToolArgument": {
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"ToolOutput": {
"properties": {
"durationMs": {
"format": "uint64",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"error": {
"type": [
"null",
"string"
]
},
"outputRef": {
"type": [
"null",
"string"
]
},
"structuredContent": true,
"text": {
"type": [
"null",
"string"
]
},
"truncated": {
"default": false,
"type": "boolean"
}
},
"type": "object"
},
"Turn": {
"properties": {
"admission": {
"$ref": "#/$defs/TurnAdmissionState",
"default": "accepted"
},
"approval": {
"$ref": "#/$defs/TurnApprovalState",
"default": "notRequired"
},
"completedAtMs": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"createdAtMs": {
"format": "int64",
"type": "integer"
},
"durationMs": {
"format": "uint64",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"error": {
"anyOf": [
{
"$ref": "#/$defs/TurnError"
},
{
"type": "null"
}
]
},
"items": {
"default": [],
"items": {
"$ref": "#/$defs/ThreadItem"
},
"type": "array"
},
"itemsView": {
"$ref": "#/$defs/TurnItemsView",
"default": "full"
},
"queue": {
"$ref": "#/$defs/TurnQueueState",
"default": {
"state": "notQueued"
}
},
"sessionId": {
"type": "string"
},
"startedAtMs": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"status": {
"$ref": "#/$defs/TurnStatus"
},
"threadId": {
"type": "string"
},
"turnId": {
"type": "string"
},
"updatedAtMs": {
"format": "int64",
"type": "integer"
}
},
"required": [
"createdAtMs",
"sessionId",
"status",
"threadId",
"turnId",
"updatedAtMs"
],
"type": "object"
},
"TurnAdmissionState": {
"enum": [
"accepted",
"rejected"
],
"type": "string"
},
"TurnApprovalState": {
"enum": [
"approved",
"cancelled",
"denied",
"notRequired",
"pending",
"resolved",
"timedOut"
],
"type": "string"
},
"TurnError": {
"properties": {
"code": {
"type": [
"null",
"string"
]
},
"details": {
"type": [
"null",
"string"
]
},
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
},
"TurnItemsView": {
"enum": [
"full",
"notLoaded",
"summary"
],
"type": "string"
},
"TurnQueueState": {
"oneOf": [
{
"properties": {
"state": {
"const": "notQueued",
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
},
{
"properties": {
"position": {
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"state": {
"const": "queued",
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
},
{
"properties": {
"state": {
"const": "running",
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
}
]
},
"TurnStatus": {
"description": "Canonical turn result. Admission, queue and approval controls are carried by\ntheir own fields on `Turn` and never become terminal result variants.",
"enum": [
"completed",
"failed",
"inProgress",
"interrupted"
],
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"canonicalEvent": {
"anyOf": [
{
"$ref": "#/$defs/CanonicalThreadEventNotification"
},
{
"type": "null"
}
]
},
"event": {
"$ref": "#/$defs/AgentEvent"
},
"typedEvent": {
"anyOf": [
{
"$ref": "#/$defs/AgentSessionRuntimeEventNotification"
},
{
"type": "null"
}
]
}
},
"required": [
"event"
],
"title": "AgentSessionEventParams",
"type": "object"
}