{ "$schema": "../../schemas/core/event-definition.schema.json", "topic": "agent.side.updated", "version": 1, "direction": "server->client", "owner": "agent", "scope": "workspace", "payloadSchema": { "type": "object", "required": [ "workspaceId", "sideAgentSessionId", "sourceAgentSessionId", "sequence", "eventType", "data" ], "properties": { "workspaceId": { "type": "string", "minLength": 1 }, "sideAgentSessionId": { "type": "string", "minLength": 1 }, "sourceAgentSessionId": { "type": "string", "minLength": 1 }, "sequence": { "type": "integer", "minimum": 1 }, "eventType": { "enum": [ "message_delta", "message_update", "state_patch", "available_commands_update", "config_options_update", "session_audit" ] }, "data": { "type": "object", "additionalProperties": true } }, "oneOf": [ { "type": "object", "additionalProperties": false, "required": [ "workspaceId", "sideAgentSessionId", "sourceAgentSessionId", "sequence", "eventType", "data" ], "properties": { "workspaceId": { "type": "string", "minLength": 1 }, "sideAgentSessionId": { "type": "string", "minLength": 1 }, "sourceAgentSessionId": { "type": "string", "minLength": 1 }, "sequence": { "type": "integer", "minimum": 1 }, "eventType": { "const": "message_delta" }, "data": { "type": "object", "additionalProperties": true, "required": ["messageId", "turnId", "role"], "properties": { "messageId": { "type": "string", "minLength": 1 }, "turnId": { "type": "string", "minLength": 1 }, "role": { "type": "string", "minLength": 1 }, "kind": { "type": "string" }, "occurredAtUnixMs": { "type": "integer", "minimum": 1 }, "content": { "type": "object", "additionalProperties": false, "required": ["operation"], "properties": { "operation": { "enum": ["append_text", "set"] }, "text": { "type": "string" }, "value": true } }, "payloadSet": { "type": "object", "additionalProperties": true }, "payloadUnset": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }, "semantics": { "type": "object", "additionalProperties": true }, "toolOutput": { "type": "object", "additionalProperties": false, "required": ["operation", "text"], "properties": { "operation": { "type": "string", "minLength": 1 }, "text": { "type": "string" }, "offsetBytes": { "type": "integer", "minimum": 0 } } }, "status": { "type": "string" }, "startedAtUnixMs": { "type": "integer", "minimum": 1 }, "completedAtUnixMs": { "type": "integer", "minimum": 1 } } } } }, { "type": "object", "additionalProperties": false, "required": [ "workspaceId", "sideAgentSessionId", "sourceAgentSessionId", "sequence", "eventType", "data" ], "properties": { "workspaceId": { "type": "string", "minLength": 1 }, "sideAgentSessionId": { "type": "string", "minLength": 1 }, "sourceAgentSessionId": { "type": "string", "minLength": 1 }, "sequence": { "type": "integer", "minimum": 1 }, "eventType": { "const": "message_update" }, "data": { "type": "object", "additionalProperties": true, "required": ["messageId", "role"], "properties": { "messageId": { "type": "string", "minLength": 1 }, "turnId": { "type": "string" }, "role": { "type": "string", "minLength": 1 }, "kind": { "type": "string" }, "status": { "type": "string" }, "seq": { "type": "integer", "minimum": 1 }, "callId": { "type": "string" }, "parentCallId": { "type": "string" }, "rootCallId": { "type": "string" }, "title": { "type": "string" }, "semantics": { "type": "object", "additionalProperties": true }, "contentDelta": { "type": "string" }, "payload": { "type": "object", "additionalProperties": true }, "occurredAtUnixMs": { "type": "integer", "minimum": 1 }, "startedAtUnixMs": { "type": "integer", "minimum": 1 }, "completedAtUnixMs": { "type": "integer", "minimum": 1 } } } } }, { "type": "object", "additionalProperties": false, "required": [ "workspaceId", "sideAgentSessionId", "sourceAgentSessionId", "sequence", "eventType", "data" ], "properties": { "workspaceId": { "type": "string", "minLength": 1 }, "sideAgentSessionId": { "type": "string", "minLength": 1 }, "sourceAgentSessionId": { "type": "string", "minLength": 1 }, "sequence": { "type": "integer", "minimum": 1 }, "eventType": { "const": "state_patch" }, "data": { "type": "object", "additionalProperties": true, "properties": { "provider": { "type": "string" }, "cwd": { "type": "string" }, "title": { "type": "string" }, "lifecycleStatus": { "type": "string" }, "currentPhase": { "type": "string" }, "status": { "type": "string" }, "occurredAtUnixMs": { "type": "integer", "minimum": 1 }, "turnLifecycle": { "type": "object", "additionalProperties": true, "properties": { "activeTurnId": { "type": ["string", "null"] } } }, "turn": { "type": "object", "additionalProperties": true, "required": ["turnId"], "properties": { "turnId": { "type": "string", "minLength": 1 }, "activeTurnId": { "type": ["string", "null"] }, "phase": { "type": "string" }, "outcome": { "type": "string" }, "origin": { "type": "string" }, "error": { "type": ["object", "null"], "additionalProperties": true }, "fileChanges": { "type": ["object", "null"], "additionalProperties": true }, "startedAtUnixMs": { "type": "integer", "minimum": 1 }, "completedAtUnixMs": { "type": "integer", "minimum": 1 }, "updatedAtUnixMs": { "type": "integer", "minimum": 1 } } }, "interactionTransition": { "type": "object", "additionalProperties": true, "required": ["requestId", "turnId", "kind", "status"], "properties": { "requestId": { "type": "string", "minLength": 1 }, "turnId": { "type": "string", "minLength": 1 }, "kind": { "enum": ["approval", "question", "plan"] }, "status": { "type": "string", "minLength": 1 }, "toolName": { "type": "string" }, "input": { "type": "object", "additionalProperties": true }, "metadata": { "type": "object", "additionalProperties": true }, "output": { "type": "object", "additionalProperties": true } } } } } } }, { "type": "object", "additionalProperties": false, "required": [ "workspaceId", "sideAgentSessionId", "sourceAgentSessionId", "sequence", "eventType", "data" ], "properties": { "workspaceId": { "type": "string", "minLength": 1 }, "sideAgentSessionId": { "type": "string", "minLength": 1 }, "sourceAgentSessionId": { "type": "string", "minLength": 1 }, "sequence": { "type": "integer", "minimum": 1 }, "eventType": { "const": "available_commands_update" }, "data": { "type": "object", "additionalProperties": true } } }, { "type": "object", "additionalProperties": false, "required": [ "workspaceId", "sideAgentSessionId", "sourceAgentSessionId", "sequence", "eventType", "data" ], "properties": { "workspaceId": { "type": "string", "minLength": 1 }, "sideAgentSessionId": { "type": "string", "minLength": 1 }, "sourceAgentSessionId": { "type": "string", "minLength": 1 }, "sequence": { "type": "integer", "minimum": 1 }, "eventType": { "const": "config_options_update" }, "data": { "type": "object", "additionalProperties": true } } }, { "type": "object", "additionalProperties": false, "required": [ "workspaceId", "sideAgentSessionId", "sourceAgentSessionId", "sequence", "eventType", "data" ], "properties": { "workspaceId": { "type": "string", "minLength": 1 }, "sideAgentSessionId": { "type": "string", "minLength": 1 }, "sourceAgentSessionId": { "type": "string", "minLength": 1 }, "sequence": { "type": "integer", "minimum": 1 }, "eventType": { "const": "session_audit" }, "data": { "type": "object", "additionalProperties": true } } } ] } }