{"meta":{"title":"스트리밍 세션 이벤트","intro":"Copilot 에이전트 수행하는 모든 작업(생각, 코드 작성, 실행 도구)은 구독할 수 있는 session 이벤트로 내보내집니다. 이 가이드는 각 이벤트 유형에 대한 필드 수준 참조이므로 SDK 원본을 읽지 않고도 예상되는 데이터를 정확하게 알 수 있습니다.","product":"GitHub Copilot","breadcrumbs":[{"href":"/ko/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/ko/enterprise-cloud@latest/copilot/how-tos","title":"방법"},{"href":"/ko/enterprise-cloud@latest/copilot/how-tos/copilot-sdk","title":"코필로트 SDK"},{"href":"/ko/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/features","title":"기능"},{"href":"/ko/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/features/streaming-events","title":"스트리밍 이벤트"}],"documentType":"article"},"body":"# 스트리밍 세션 이벤트\n\nCopilot 에이전트 수행하는 모든 작업(생각, 코드 작성, 실행 도구)은 구독할 수 있는 session 이벤트로 내보내집니다. 이 가이드는 각 이벤트 유형에 대한 필드 수준 참조이므로 SDK 원본을 읽지 않고도 예상되는 데이터를 정확하게 알 수 있습니다.\n\n<!-- markdownlint-disable GHD046 GHD005 -->\n\n<!-- Suppressed: GHD046 (outdated release terminology), GHD005 (hardcoded data variable) -->\n\n## Overview\n\n세션에서 설정되면 `streaming: true` SDK는 **지속**형 이벤트(전체 메시지, 도구 결과)와 함께 **임시** 이벤트(델타, 진행률 업데이트)를 실시간으로 내보냅니다. 모든 이벤트는 공통 엔벨로프를 공유하며, 이벤트 `data` 형식에 따라 달라지는 `type` 페이로드를 전달합니다.\n\n![다이어그램: 설명된 프로세스를 보여 주는 시퀀스 다이어그램](/assets/images/help/copilot/copilot-sdk/features-streaming-events-diagram-0.png)\n\n| Concept           | Description                                                       |\n| ----------------- | ----------------------------------------------------------------- |\n| **임시 이벤트**        | 일시적인; 실시간으로 스트리밍되지만 세션 로그에 유지 **되지 않습니다** . 세션 다시 시작에서 재생되지 않습니다. |\n| **지속형 이벤트**       | 디스크의 세션 이벤트 로그에 저장됩니다. 세션을 다시 열 때 재생됩니다.                          |\n| **델타 이벤트**        | 임시 스트리밍 청크(텍스트 또는 추론)입니다. 델타를 누적하여 전체 콘텐츠를 빌드합니다.                 |\n| **`parentId` 체인** | 각 이벤트는 `parentId` 이전 이벤트를 가리키며 걸을 수 있는 연결된 목록을 형성합니다.             |\n\n## 이벤트 봉투\n\n형식에 관계없이 모든 세션 이벤트에는 다음 필드가 포함됩니다.\n\n| Field                                      | Type             | Description                                                         |\n| ------------------------------------------ | ---------------- | ------------------------------------------------------------------- |\n| `id`                                       |                  |                                                                     |\n| `string` (UUID v4)                         | 고유 이벤트 식별자       |                                                                     |\n| `timestamp`                                |                  |                                                                     |\n| `string` (ISO 8601)                        | 이벤트를 만든 경우       |                                                                     |\n| `parentId`                                 | `string \\| null` | 체인에 있는 이전 이벤트의 ID입니다. `null` 첫 번째 이벤트에 대한                           |\n| `agentId`                                  | `string?`        | 하위 에이전트에서 시작된 이벤트에 대한 하위 에이전트 인스턴스 ID; 루트/주 에이전트 및 세션 수준 이벤트에 대한 없음 |\n| `ephemeral`                                | `boolean?`       |                                                                     |\n| `true` 일시적 이벤트의 경우 없음; 지속형 이벤트의 경우 `false` |                  |                                                                     |\n| `type`                                     | `string`         | 이벤트 유형 판별자(아래 표 참조)                                                 |\n| `data`                                     | `object`         | 이벤트별 페이로드                                                           |\n\n## 이벤트 구독\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"typescript\" data-label=\"TypeScript\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">TypeScript</div>\n\n```typescript\n// All events\nsession.on((event) => {\n    console.log(event.type, event.data);\n});\n\n// Specific event type — data is narrowed automatically\nsession.on(\"assistant.message_delta\", (event) => {\n    process.stdout.write(event.data.deltaContent);\n});\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n```python\nfrom copilot.session_events import SessionEventType\n\ndef handle(event):\n    if event.type == SessionEventType.ASSISTANT_MESSAGE_DELTA:\n        print(event.data.delta_content, end=\"\", flush=True)\n\nsession.on(handle)\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"go\" data-label=\"Go\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Go</div>\n\n```golang\nsession.On(func(event copilot.SessionEvent) {\n    if d, ok := event.Data.(*copilot.AssistantMessageDeltaData); ok {\n        fmt.Print(d.DeltaContent)\n    }\n})\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n```csharp\nsession.On<SessionEvent>(evt =>\n{\n    if (evt is AssistantMessageDeltaEvent delta)\n    {\n        Console.Write(delta.Data.DeltaContent);\n    }\n});\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n<!-- docs-validate: skip -->\n\n```java\n// All events\nsession.on(event -> System.out.println(event.getType()));\n\n// Specific event type — data is narrowed to the matching class\nsession.on(AssistantMessageDeltaEvent.class, event ->\n    System.out.print(event.getData().deltaContent())\n);\n```\n\n</div>\n\n</div>\n\n> \\[!TIP]\n> **(Python/Go)** 이러한 SDK는 별도의 이벤트별 데이터 형식(예`AssistantMessageDeltaData`: )을 사용하므로 각 형식에 관련 필드만 존재합니다.\n>\n> \\[!TIP]\n> **(.NET)** .NET SDK는 이벤트당 강력한 형식의 별도의 데이터 클래스(예: `AssistantMessageDeltaData`)를 사용하므로 각 형식에 관련 필드만 존재합니다.\n>\n> \\[!TIP]\n> **(TypeScript)** TypeScript SDK는 태그된 유니온을 사용합니다. `event.type`을 기준으로 매칭하면 `data` 페이로드가 자동으로 올바른 형태로 좁혀집니다.\n\n## 부모 에이전트 응답만 렌더링\n\n하위 에이전트 이벤트는 상위 세션 스트림을 공유하며, 엔벌로프 수준의 `agentId`를 포함합니다. 루트/메인 에이전트 이벤트와 세션 수준 이벤트에는 `agentId`가 포함되지 않으므로, 메인 채팅 렌더러는 `agentId`가 설정된 assistant 이벤트를 무시하고 대신 해당 이벤트를 트레이스 또는 진행률 UI로 라우팅할 수 있습니다.\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"typescript\" data-label=\"TypeScript\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">TypeScript</div>\n\n```typescript\nimport type { CopilotSession } from \"@github/copilot-sdk\";\n\nexport function subscribeParentResponse(session: CopilotSession): void {\n    session.on(\"assistant.message_delta\", (event) => {\n        if (!event.agentId) {\n            process.stdout.write(event.data.deltaContent);\n        }\n    });\n}\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n```python\nfrom copilot import CopilotSession, SessionEvent, SessionEventType\nfrom copilot.session_events import AssistantMessageDeltaData\n\ndef subscribe_parent_response(session: CopilotSession) -> None:\n    def handle(event: SessionEvent) -> None:\n        if event.type == SessionEventType.ASSISTANT_MESSAGE_DELTA and event.agent_id is None:\n            data = event.data\n            if isinstance(data, AssistantMessageDeltaData):\n                print(data.delta_content, end=\"\", flush=True)\n\n    session.on(handle)\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"go\" data-label=\"Go\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Go</div>\n\n```golang\npackage example\n\nimport (\n    \"fmt\"\n\n    copilot \"github.com/github/copilot-sdk/go\"\n)\n\nfunc subscribeParentResponse(session *copilot.Session) {\n    session.On(func(event copilot.SessionEvent) {\n        if event.AgentID != nil {\n            return\n        }\n\n        if d, ok := event.Data.(*copilot.AssistantMessageDeltaData); ok {\n            fmt.Print(d.DeltaContent)\n        }\n    })\n}\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n```csharp\nusing System;\nusing GitHub.Copilot;\n\nstatic class ParentAgentResponseExample\n{\n    public static void SubscribeParentResponse(CopilotSession session)\n    {\n        session.On<AssistantMessageDeltaEvent>(evt =>\n        {\n            if (evt.AgentId is null)\n            {\n                Console.Write(evt.Data.DeltaContent);\n            }\n        });\n    }\n}\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n```java\nimport com.github.copilot.CopilotSession;\nimport com.github.copilot.generated.AssistantMessageDeltaEvent;\n\nfinal class ParentAgentResponseExample {\n    static void subscribeParentResponse(CopilotSession session) {\n        session.on(AssistantMessageDeltaEvent.class, event -> {\n            if (event.getAgentId() == null) {\n                System.out.print(event.getData().deltaContent());\n            }\n        });\n    }\n}\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"rust\" data-label=\"Rust\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Rust</div>\n\n```rust\nuse github_copilot_sdk::session::Session;\n\nasync fn subscribe_parent_response(session: &Session) {\n    let mut events = session.subscribe();\n\n    while let Ok(event) = events.recv().await {\n        if event.event_type == \"assistant.message_delta\" && event.agent_id.is_none() {\n            if let Some(delta) = event.data.get(\"deltaContent\").and_then(|v| v.as_str()) {\n                print!(\"{delta}\");\n            }\n        }\n    }\n}\n```\n\n</div>\n\n</div>\n\n## 도우미 이벤트\n\n이러한 이벤트는 턴 시작부터 스트리밍 청크를 거쳐 최종 메시지까지 에이전트의 응답 수명 주기를 추적합니다.\n\n### `assistant.turn_start`\n\n에이전트가 턴 처리를 시작할 때 내보내집니다.\n\n| 데이터 필드                        | Type     | Required | Description             |\n| ----------------------------- | -------- | -------- | ----------------------- |\n| `turnId`                      | `string` | ✅        | 턴 식별자(일반적으로 문자열화된 턴 번호) |\n| `interactionId`               | `string` |          |                         |\n| 원격 분석 상관 관계에 대한 CAPI 상호 작용 ID |          |          |                         |\n\n### `assistant.intent`\n\n임시. 에이전트가 현재 수행하는 작업에 대한 간단한 설명이며 작동하면서 업데이트됩니다.\n\n| 데이터 필드   | Type     | Required | Description                   |\n| -------- | -------- | -------- | ----------------------------- |\n| `intent` | `string` | ✅        | 사람이 읽을 수 있는 의도(예: \"코드베이스 탐색\") |\n\n### `assistant.reasoning`\n\n모델에서 확장된 사고 블록을 완성합니다. 추론이 완료된 후 내보냅니다.\n\n| 데이터 필드        | Type     | Required | Description     |\n| ------------- | -------- | -------- | --------------- |\n| `reasoningId` | `string` | ✅        | 이 추론 블록의 고유 식별자 |\n| `content`     | `string` | ✅        | 확장된 사고 전체 텍스트   |\n\n### `assistant.reasoning_delta`\n\n임시. 실시간으로 스트리밍되는 모델의 확장된 사고의 증분 조각.\n\n| 데이터 필드         | Type     | Required | Description                      |\n| -------------- | -------- | -------- | -------------------------------- |\n| `reasoningId`  | `string` | ✅        | 해당 이벤트와 일치 `assistant.reasoning` |\n| `deltaContent` | `string` | ✅        | 추론 콘텐츠에 추가할 텍스트 청크               |\n\n### `assistant.message`\n\n이 LLM 호출에 대한 도우미의 전체 응답입니다. 도구 호출 요청을 포함할 수 있습니다.\n\n| 데이터 필드                                       | Type            | Required | Description   |\n| -------------------------------------------- | --------------- | -------- | ------------- |\n| `messageId`                                  | `string`        | ✅        | 이 메시지의 고유 식별자 |\n| `content`                                    | `string`        | ✅        | 도우미의 텍스트 응답   |\n| `toolRequests`                               | `ToolRequest[]` |          |               |\n| 도우미가 수행하려는 도구 호출(아래 참조)                      |                 |          |               |\n| `reasoningOpaque`                            | `string`        |          |               |\n| 암호화된 확장 사고(인류 모델); 세션 바인딩                    |                 |          |               |\n| `reasoningText`                              | `string`        |          |               |\n| 확장된 사고에서 읽을 수 있는 추론 텍스트                      |                 |          |               |\n| `encryptedContent`                           | `string`        |          |               |\n| 암호화된 추론 콘텐츠(OpenAI 모델); 세션 바인딩               |                 |          |               |\n| `phase`                                      | `string`        |          |               |\n| 생성 단계(예: `\"thinking\"` 대 `\"response\"`)        |                 |          |               |\n| `outputTokens`                               | `number`        |          |               |\n| API 응답의 실제 출력 토큰 수                           |                 |          |               |\n| `interactionId`                              | `string`        |          |               |\n| 원격 분석에 대한 CAPI 상호 작용 ID                      |                 |          |               |\n| `parentToolCallId`                           | `string`        |          |               |\n| Deprecated. 하위 에이전트 귀속에 엔벌로프 수준 `agentId` 사용 |                 |          |               |\n\n\\*\\*\n`ToolRequest` 필드:\\*\\*\n\n| Field                               | Type                     | Required | Description                            |\n| ----------------------------------- | ------------------------ | -------- | -------------------------------------- |\n| `toolCallId`                        | `string`                 | ✅        | 이 도구 호출의 고유 ID                         |\n| `name`                              | `string`                 | ✅        | 도구 이름(예: , `\"bash\"`, `\"edit\"``\"grep\"`) |\n| `arguments`                         | `object`                 |          |                                        |\n| 구문 분석된 도구의 인수                       |                          |          |                                        |\n| `type`                              | `\"function\" \\| \"custom\"` |          |                                        |\n| 호출 유형; 없는 경우 기본값은 `\"function\"` 입니다. |                          |          |                                        |\n\n### `assistant.message_delta`\n\n임시. 실시간으로 스트리밍되는 도우미 텍스트 응답의 증분 조각.\n\n| 데이터 필드                                       | Type     | Required | Description                    |\n| -------------------------------------------- | -------- | -------- | ------------------------------ |\n| `messageId`                                  | `string` | ✅        | 해당 이벤트와 일치 `assistant.message` |\n| `deltaContent`                               | `string` | ✅        | 메시지에 추가할 텍스트 청크                |\n| `parentToolCallId`                           | `string` |          |                                |\n| Deprecated. 하위 에이전트 귀속에 엔벌로프 수준 `agentId` 사용 |          |          |                                |\n\n### `assistant.turn_end`\n\n에이전트가 턴을 완료할 때 내보내집니다(모든 도구 실행이 완료되고 최종 응답이 전달됨).\n\n| 데이터 필드   | Type     | Required | Description                       |\n| -------- | -------- | -------- | --------------------------------- |\n| `turnId` | `string` | ✅        | 해당 이벤트와 일치 `assistant.turn_start` |\n\n### `assistant.usage`\n\n임시. 개별 API 호출에 대한 토큰 사용량 및 비용 정보입니다.\n\n| 데이터 필드                                                                  | Type                                                                       | Required | Description            |\n| ----------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------- | ---------------------- |\n| `model`                                                                 | `string`                                                                   | ✅        | 모델 식별자(예: `\"gpt-5.4\"`) |\n| `inputTokens`                                                           | `number`                                                                   |          |                        |\n| 사용된 입력 토큰                                                               |                                                                            |          |                        |\n| `outputTokens`                                                          | `number`                                                                   |          |                        |\n| 생성된 출력 토큰                                                               |                                                                            |          |                        |\n| `reasoningTokens`                                                       | `number`                                                                   |          |                        |\n| 추론/사고 과정에 사용되는 출력 토큰 (`outputTokens`의 일부)                               |                                                                            |          |                        |\n| `cacheReadTokens`                                                       | `number`                                                                   |          |                        |\n| 프롬프트 캐시에서 읽은 토큰                                                         |                                                                            |          |                        |\n| `cacheWriteTokens`                                                      | `number`                                                                   |          |                        |\n| 프롬프트 캐시에 기록된 토큰                                                         |                                                                            |          |                        |\n| `cacheExpiresAt`                                                        | `string`                                                                   |          |                        |\n| 이 모델 호출의 프롬프트 캐시가 만료되는 시점의 ISO 8601 타임스탬프                               |                                                                            |          |                        |\n| `contentFilterTriggered`                                                | `boolean`                                                                  |          |                        |\n| 콘텐츠 필터링에 의해 응답이 차단되었는지 또는 잘렸는지 여부(`finish_reason === 'content_filter'`) |                                                                            |          |                        |\n| `finishReason`                                                          | `string`                                                                   |          |                        |\n| 모델 완료 이유(예: `\"stop\"`, `\"length\"`, `\"tool_calls\"`, `\"content_filter\"`)   |                                                                            |          |                        |\n| `cost`                                                                  | `number`                                                                   |          |                        |\n| 비용 청구를 위한 모델 승수 비용                                                      |                                                                            |          |                        |\n| `duration`                                                              | `number`                                                                   |          |                        |\n| API 호출 기간(밀리초)                                                          |                                                                            |          |                        |\n| `timeToFirstTokenMs`                                                    | `number`                                                                   |          |                        |\n| 요청 디스패치에서 받은 첫 번째 토큰까지의 시간(스트리밍 대기 시간)                                  |                                                                            |          |                        |\n| `interTokenLatencyMs`                                                   | `number`                                                                   |          |                        |\n| 연속 토큰 간의 평균 대기 시간(스트리밍 처리량)                                             |                                                                            |          |                        |\n| `reasoningEffort`                                                       | `string`                                                                   |          |                        |\n| 이 호출에 사용되는 추론 작업 수준(예: `\"low\"`, , `\"medium\"``\"high\"`)                   |                                                                            |          |                        |\n| `initiator`                                                             | `string`                                                                   |          |                        |\n| 이 호출을 발생시킨 항목(예: `\"sub-agent\"`); 사용자가 시작한 경우에는 없음                       |                                                                            |          |                        |\n| `apiCallId`                                                             | `string`                                                                   |          |                        |\n| 공급자의 완료 ID(예: `chatcmpl-abc123`)                                        |                                                                            |          |                        |\n| `serviceRequestId`                                                      | `string`                                                                   |          |                        |\n| CAPI 로그 상관 관계에 대한 Copilot 서비스 요청 ID(`x-copilot-service-request-id`)     |                                                                            |          |                        |\n| `apiEndpoint`                                                           | `\"/chat/completions\" \\| \"/v1/messages\" \\| \"/responses\" \\| \"ws:/responses\"` |          |                        |\n| 모델 호출에 사용되는 API 엔드포인트; 는 관찰 가능성 및 비용 특성에 유용합니다.                         |                                                                            |          |                        |\n| `ws:/responses` 는 응답 API의 websocket 변형입니다.                              |                                                                            |          |                        |\n| `providerCallId`                                                        | `string`                                                                   |          |                        |\n| GitHub 요청 추적 ID(`x-github-request-id`)                                  |                                                                            |          |                        |\n| `parentToolCallId`                                                      | `string`                                                                   |          |                        |\n| Deprecated. 하위 에이전트 귀속에 엔벌로프 수준 `agentId` 사용                            |                                                                            |          |                        |\n| `quotaSnapshots`                                                        | `Record<string, QuotaSnapshot>`                                            |          |                        |\n| 할당량별 리소스 사용량( 할당량 식별자 키 지정)                                             |                                                                            |          |                        |\n| `copilotUsage`                                                          | `CopilotUsage`                                                             |          |                        |\n| API의 항목별 토큰 비용 분석                                                       |                                                                            |          |                        |\n\n### `assistant.streaming_delta`\n\n임시. 낮은 수준의 네트워크 진행률 표시기 - 스트리밍 API 응답에서 받은 총 바이트 수입니다.\n\n| 데이터 필드                   | Type     | Required | Description    |\n| ------------------------ | -------- | -------- | -------------- |\n| `totalResponseSizeBytes` | `number` | ✅        | 지금까지 받은 누적 바이트 |\n\n## 도구 실행 이벤트\n\n이러한 이벤트는 실행부터 완료까지 도구 호출을 요청하는 모델에서 각 도구 호출의 전체 수명 주기를 추적합니다.\n\n### `tool.execution_start`\n\n도구 실행을 시작할 때 내보냅니다.\n\n| 데이터 필드                                       | Type     | Required | Description                             |\n| -------------------------------------------- | -------- | -------- | --------------------------------------- |\n| `toolCallId`                                 | `string` | ✅        | 이 도구 호출에 대한 고유 식별자                      |\n| `toolName`                                   | `string` | ✅        | 도구의 이름(예: `\"bash\"`, , `\"edit\"``\"grep\"`) |\n| `arguments`                                  | `object` |          |                                         |\n| 구문 분석된 인수가 도구에 전달됨                           |          |          |                                         |\n| `mcpServerName`                              | `string` |          |                                         |\n| MCP 서버에서 도구를 제공하는 경우 MCP 서버 이름               |          |          |                                         |\n| `mcpToolName`                                | `string` |          |                                         |\n| MCP 서버의 원래 도구 이름                             |          |          |                                         |\n| `parentToolCallId`                           | `string` |          |                                         |\n| Deprecated. 하위 에이전트 귀속에 엔벌로프 수준 `agentId` 사용 |          |          |                                         |\n\n### `tool.execution_partial_result`\n\n임시. 실행 중인 도구의 점진적 출력(예: 스트리밍되는 bash 출력).\n\n| 데이터 필드          | Type     | Required | Description                      |\n| --------------- | -------- | -------- | -------------------------------- |\n| `toolCallId`    | `string` | ✅        | 해당 항목과 일치 `tool.execution_start` |\n| `partialOutput` | `string` | ✅        | 증분 출력 청크                         |\n\n### `tool.execution_progress`\n\n임시. 실행 중인 도구에서 사람이 읽을 수 있는 진행 상태(예: MCP 서버 진행률 알림).\n\n| 데이터 필드            | Type     | Required | Description                      |\n| ----------------- | -------- | -------- | -------------------------------- |\n| `toolCallId`      | `string` | ✅        | 해당 항목과 일치 `tool.execution_start` |\n| `progressMessage` | `string` | ✅        | 진행 상태 메시지                        |\n\n### `tool.execution_complete`\n\n도구 실행이 성공적으로 또는 오류와 함께 완료될 때 내보냅니다.\n\n| 데이터 필드                                       | Type                 | Required | Description                      |\n| -------------------------------------------- | -------------------- | -------- | -------------------------------- |\n| `toolCallId`                                 | `string`             | ✅        | 해당 항목과 일치 `tool.execution_start` |\n| `success`                                    | `boolean`            | ✅        | 실행 성공 여부                         |\n| `model`                                      | `string`             |          |                                  |\n| 이 도구 호출을 생성한 모델                              |                      |          |                                  |\n| `interactionId`                              | `string`             |          |                                  |\n| CAPI 상호 작용 ID                                |                      |          |                                  |\n| `isUserRequested`                            | `boolean`            |          |                                  |\n|                                              |                      |          |                                  |\n| `true` 사용자가 이 도구 호출을 명시적으로 요청한 경우            |                      |          |                                  |\n| `result`                                     | `Result`             |          |                                  |\n| 성공 시 프레젠테이션(아래 참조)                           |                      |          |                                  |\n| `error`                                      | `{ message, code? }` |          |                                  |\n| 실패 시 표시됨                                     |                      |          |                                  |\n| `toolTelemetry`                              | `object`             |          |                                  |\n| 도구별 텔레메트리(예: CodeQL 검사 수)                    |                      |          |                                  |\n| `parentToolCallId`                           | `string`             |          |                                  |\n| Deprecated. 하위 에이전트 귀속에 엔벌로프 수준 `agentId` 사용 |                      |          |                                  |\n\n\\*\\*\n`Result` 필드:\\*\\*\n\n| Field                               | Type             | Required | Description                           |\n| ----------------------------------- | ---------------- | -------- | ------------------------------------- |\n| `content`                           | `string`         | ✅        | LLM으로 전송된 간결한 결과(토큰 효율성을 위해 잘려질 수 있음) |\n| `detailedContent`                   | `string`         |          |                                       |\n| 전체 표시 결과, diffs와 같은 전체 콘텐츠 유지       |                  |          |                                       |\n| `contents`                          | `ContentBlock[]` |          |                                       |\n| 구조적 콘텐츠 블록(텍스트, 터미널, 이미지, 오디오, 리소스) |                  |          |                                       |\n\n### `tool.user_requested`\n\n사용자가 도구 호출을 명시적으로 요청할 때 내보내집니다(모델이 호출하도록 선택하는 대신).\n\n| 데이터 필드       | Type     | Required | Description        |\n| ------------ | -------- | -------- | ------------------ |\n| `toolCallId` | `string` | ✅        | 이 도구 호출에 대한 고유 식별자 |\n| `toolName`   | `string` | ✅        | 사용자가 호출하려는 도구의 이름  |\n| `arguments`  | `object` |          |                    |\n| 호출에 대한 인수    |          |          |                    |\n\n## 세션 수명 주기 이벤트\n\n### `session.idle`\n\n임시. 에이전트가 모든 처리를 완료했으며 다음 메시지를 준비했습니다. 이는 턴이 완전히 완료되었다는 신호입니다.\n\n| 데이터 필드                          | Type      | Required | Description |\n| ------------------------------- | --------- | -------- | ----------- |\n| `aborted`                       | `boolean` |          |             |\n| 중단 신호를 통해 이전 턴이 취소된 경우 True입니다. |           |          |             |\n\n### `session.error`\n\n세션 처리 중에 오류가 발생했습니다.\n\n| 데이터 필드                            | Type     | Required | Description                                             |\n| --------------------------------- | -------- | -------- | ------------------------------------------------------- |\n| `errorType`                       | `string` | ✅        | 오류 범주(예: , `\"authentication\"`, `\"quota\"``\"rate_limit\"`) |\n| `message`                         | `string` | ✅        | 사람이 읽을 수 있는 오류 메시지                                      |\n| `stack`                           | `string` |          |                                                         |\n| 오류 스택 추적                          |          |          |                                                         |\n| `statusCode`                      | `number` |          |                                                         |\n| 업스트림 요청의 HTTP 상태 코드               |          |          |                                                         |\n| `providerCallId`                  | `string` |          |                                                         |\n| 서버 쪽 로그 상관 관계에 대한 GitHub 요청 추적 ID |          |          |                                                         |\n\n### `session.compaction_start`\n\n컨텍스트 창 압축이 시작되었습니다.\n**데이터 페이로드가 비어 있습니다(`{}`)**.\n\n### `session.compaction_complete`\n\n컨텍스트 창 압축이 완료되었습니다.\n\n| 데이터 필드                        | Type                             | Required | Description |\n| ----------------------------- | -------------------------------- | -------- | ----------- |\n| `success`                     | `boolean`                        | ✅        | 압축 성공 여부    |\n| `error`                       | `string`                         |          |             |\n| 압축에 실패한 경우 오류 메시지             |                                  |          |             |\n| `preCompactionTokens`         | `number`                         |          |             |\n| 압축 전 토큰                       |                                  |          |             |\n| `postCompactionTokens`        | `number`                         |          |             |\n| 압축 후 토큰                       |                                  |          |             |\n| `preCompactionMessagesLength` | `number`                         |          |             |\n| 압축 전 메시지 수                    |                                  |          |             |\n| `messagesRemoved`             | `number`                         |          |             |\n| 제거된 메시지                       |                                  |          |             |\n| `tokensRemoved`               | `number`                         |          |             |\n| 제거된 토큰                        |                                  |          |             |\n| `summaryContent`              | `string`                         |          |             |\n| 압축된 기록의 LLM 생성 요약             |                                  |          |             |\n| `checkpointNumber`            | `number`                         |          |             |\n| 복구를 위해 만든 검사점 스냅샷 번호          |                                  |          |             |\n| `checkpointPath`              | `string`                         |          |             |\n| 검사점이 저장된 파일 경로                |                                  |          |             |\n| `compactionTokensUsed`        | `{ input, output, cachedInput }` |          |             |\n| 압축 LLM 호출에 대한 토큰 사용량          |                                  |          |             |\n| `requestId`                   | `string`                         |          |             |\n| 컴팩션 호출에 대한 GitHub 요청 추적 ID    |                                  |          |             |\n\n### `session.title_changed`\n\n임시. 세션의 자동 생성된 타이틀이 업데이트되었습니다.\n\n| 데이터 필드  | Type     | Required | Description |\n| ------- | -------- | -------- | ----------- |\n| `title` | `string` | ✅        | 새 세션 제목     |\n\n### `session.context_changed`\n\n세션의 작업 디렉터리 또는 리포지토리 컨텍스트가 변경되었습니다.\n\n| 데이터 필드                   | Type     | Required | Description |\n| ------------------------ | -------- | -------- | ----------- |\n| `cwd`                    | `string` | ✅        | 현재 작업 디렉터리  |\n| `gitRoot`                | `string` |          |             |\n| Git 리포지토리 루트             |          |          |             |\n| `repository`             | `string` |          |             |\n| 형식의 `\"owner/name\"` 리포지토리 |          |          |             |\n| `branch`                 | `string` |          |             |\n| 현재 Git 브랜치               |          |          |             |\n\n### `session.usage_info`\n\n임시. 컨텍스트 창 사용률 스냅샷\n\n| 데이터 필드           | Type     | Required | Description          |\n| ---------------- | -------- | -------- | -------------------- |\n| `tokenLimit`     | `number` | ✅        | 모델의 컨텍스트 창에 대한 최대 토큰 |\n| `currentTokens`  | `number` | ✅        | 컨텍스트 창의 현재 토큰        |\n| `messagesLength` | `number` | ✅        | 대화의 현재 메시지 수         |\n\n### `session.session_limits_changed`\n\n현재 회계 기간의 세션 제한이 변경되었습니다. 값은 `null``sessionLimits` 제한이 활성화되지 않음을 의미합니다.\n\n| 데이터 필드                         | Type                          | Required | Description                           |\n| ------------------------------ | ----------------------------- | -------- | ------------------------------------- |\n| `sessionLimits`                | `SessionLimitsConfig \\| null` | ✅        | 현재 세션 제한 또는 제한이 활성화되어 있지 않은 경우 `null` |\n| `sessionLimits.maxAiCredits`   | `number`                      |          |                                       |\n| 세션의 현재 회계 기간 동안 허용되는 최대 AI 크레딧 |                               |          |                                       |\n\n### `session.usage_checkpoint`\n\n세션이 다시 시작될 때 회계를 다시 구성하는 데 사용되는 지속성 집계 사용 검사점입니다.\n\n| 데이터 필드                      | Type     | Required | Description                         |\n| --------------------------- | -------- | -------- | ----------------------------------- |\n| `totalNanoAiu`              | `number` | ✅        | 체크포인트 시점의 세션 전반에 걸쳐 누적된 나노-AI 단위 비용 |\n| `totalPremiumRequests`      | `number` |          |                                     |\n| 검사점 시간에 사용된 총 프리미엄 API 요청 수 |          |          |                                     |\n\n### `session.task_complete`\n\n에이전트가 할당된 작업을 완료했습니다.\n\n| 데이터 필드     | Type     | Required | Description |\n| ---------- | -------- | -------- | ----------- |\n| `summary`  | `string` |          |             |\n| 완료된 작업의 요약 |          |          |             |\n\n### `session.shutdown`\n\n세션이 종료되었습니다.\n\n| 데이터 필드                             | Type                                          | Required | Description               |\n| ---------------------------------- | --------------------------------------------- | -------- | ------------------------- |\n| `shutdownType`                     | `\"routine\" \\| \"error\"`                        | ✅        | 정상적인 종료 또는 충돌             |\n| `errorReason`                      | `string`                                      |          |                           |\n|                                    |                                               |          |                           |\n| `shutdownType`이 `\"error\"`일 때 오류 설명 |                                               |          |                           |\n| `totalPremiumRequests`             | `number`                                      | ✅        | 사용된 총 프리미엄 API 요청         |\n| `totalApiDurationMs`               | `number`                                      | ✅        | 누적 API 호출 시간(밀리초)         |\n| `sessionStartTime`                 | `number`                                      | ✅        | 세션이 시작된 때의 Unix 타임스탬프(ms) |\n| `codeChanges`                      | `{ linesAdded, linesRemoved, filesModified }` | ✅        | 집계 코드 변경 메트릭              |\n| `modelMetrics`                     | `Record<string, ModelMetric>`                 | ✅        | 모델별 사용량 분석                |\n| `currentModel`                     | `string`                                      |          |                           |\n| 종료 시 선택한 모델                        |                                               |          |                           |\n\n## 권한 및 사용자 입력 이벤트\n\n이러한 이벤트는 에이전트가 계속하기 전에 사용자의 승인 또는 입력이 필요할 때 내보내집니다.\n\n### `permission.requested`\n\n에이전트는 작업을 수행할 수 있는 권한이 필요합니다(명령 실행, 파일 쓰기 등).\n\n| 데이터 필드              | Type                | Required | Description                                  |\n| ------------------- | ------------------- | -------- | -------------------------------------------- |\n| `requestId`         | `string`            | ✅        | 이를 통해 응답하세요. `session.respondToPermission()` |\n| `permissionRequest` | `PermissionRequest` | ✅        | 요청되는 권한의 세부 정보                               |\n\n`permissionRequest`는 `kind`에 대한 구별된 합집합입니다.\n\n| `kind`                                                            | 핵심 필드         | Description |\n| ----------------------------------------------------------------- | ------------- | ----------- |\n| `\"shell\"`                                                         |               |             |\n| `fullCommandText`, `intention`, , `commands[]`, `possiblePaths[]` | 셸 명령 실행       |             |\n| `\"write\"`                                                         |               |             |\n| `fileName`, `diff`, , `intention`, `newFileContents?`             | 파일 쓰기/수정      |             |\n| `\"read\"`                                                          |               |             |\n| `path`, `intention`                                               | 파일 또는 디렉터리 읽기 |             |\n| `\"mcp\"`                                                           |               |             |\n| `serverName`, `toolName`, `toolTitle`, `args?``readOnly`          | MCP 도구 호출     |             |\n| `\"url\"`                                                           |               |             |\n| `url`, `intention`                                                | URL 가져오기      |             |\n| `\"memory\"`                                                        |               |             |\n| `subject`, `fact`, `citations`                                    | 메모리 저장        |             |\n| `\"custom-tool\"`                                                   |               |             |\n| `toolName`, `toolDescription`, `args?`                            | 사용자 지정 도구 호출  |             |\n\n또한 모든 `kind` 변형에는 요청을 트리거한 도구 호출에 대한 선택적 `toolCallId` 연결도 포함됩니다.\n\n### `permission.completed`\n\n권한 요청이 해결되었습니다.\n\n| 데이터 필드        | Type     | Required | Description                                                                                                                                                                     |\n| ------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `requestId`   | `string` | ✅        | 해당 항목과 일치 `permission.requested`                                                                                                                                                |\n| `result.kind` | `string` | ✅        | 다음 중 하나: `\"approved\"`, `\"denied-by-rules\"`, `\"denied-interactively-by-user\"`, `\"denied-no-approval-rule-and-could-not-request-from-user\"``\"denied-by-content-exclusion-policy\"` |\n\n### `user_input.requested`\n\n임시. 에이전트가 사용자에게 질문을 하고 있습니다.\n\n| 데이터 필드             | Type       | Required | Description                                 |\n| ------------------ | ---------- | -------- | ------------------------------------------- |\n| `requestId`        | `string`   | ✅        | 이를 통해 응답하세요. `session.respondToUserInput()` |\n| `question`         | `string`   | ✅        | 사용자에게 제시할 질문                                |\n| `choices`          | `string[]` |          |                                             |\n| 사용자에 대해 미리 정의된 선택  |            |          |                                             |\n| `allowFreeform`    | `boolean`  |          |                                             |\n| 자유 형식 텍스트 입력 허용 여부 |            |          |                                             |\n\n### `user_input.completed`\n\n임시. 사용자 입력 요청이 확인되었습니다.\n\n| 데이터 필드      | Type     | Required | Description                      |\n| ----------- | -------- | -------- | -------------------------------- |\n| `requestId` | `string` | ✅        | 해당 항목과 일치 `user_input.requested` |\n\n### `elicitation.requested`\n\n임시. 에이전트에는 사용자의 구조적 양식 입력이 필요합니다(MCP 유도 프로토콜).\n\n| 데이터 필드                  | Type                                        | Required | Description                                   |\n| ----------------------- | ------------------------------------------- | -------- | --------------------------------------------- |\n| `requestId`             | `string`                                    | ✅        | 이를 통해 응답하세요. `session.respondToElicitation()` |\n| `message`               | `string`                                    | ✅        | 필요한 정보에 대한 설명                                 |\n| `mode`                  | `\"form\"`                                    |          |                                               |\n| 유도 모드(현재는 `\"form\"`만 가능) |                                             |          |                                               |\n| `requestedSchema`       | `{ type: \"object\", properties, required? }` | ✅        | 양식 필드를 설명하는 JSON 스키마                          |\n\n### `elicitation.completed`\n\n임시. 유도 요청이 해결되었습니다.\n\n| 데이터 필드      | Type     | Required | Description                       |\n| ----------- | -------- | -------- | --------------------------------- |\n| `requestId` | `string` | ✅        | 해당 항목과 일치 `elicitation.requested` |\n\n## 하위 에이전트 및 기술 이벤트\n\n### `subagent.started`\n\n사용자 지정 에이전트가 하위 에이전트로 호출되었습니다.\n\n| 데이터 필드                       | Type     | Required | Description             |\n| ---------------------------- | -------- | -------- | ----------------------- |\n| `toolCallId`                 | `string` | ✅        | 이 하위 에이전트를 생성한 부모 도구 호출 |\n| `agentName`                  | `string` | ✅        | 하위 에이전트의 내부 이름          |\n| `agentDisplayName`           | `string` | ✅        | 사람이 읽을 수 있는 표시 이름       |\n| `agentDescription`           | `string` | ✅        | 하위 에이전트가 수행하는 작업 설명     |\n| `model`                      | `string` |          |                         |\n| 하위 에이전트가 실행될 모델(시작 시 알려진 경우) |          |          |                         |\n\n### `subagent.completed`\n\n하위 에이전트가 성공적으로 완료되었습니다.\n\n| 데이터 필드             | Type     | Required | Description                  |\n| ------------------ | -------- | -------- | ---------------------------- |\n| `toolCallId`       | `string` | ✅        | 해당 항목과 일치 `subagent.started` |\n| `agentName`        | `string` | ✅        | 내부 이름                        |\n| `agentDisplayName` | `string` | ✅        | 표시 이름                        |\n| `model`            | `string` |          |                              |\n| 하위 에이전트에서 사용하는 모델  |          |          |                              |\n| `durationMs`       | `number` |          |                              |\n| 벽시계 실행 기간(밀리초)     |          |          |                              |\n| `totalTokens`      | `number` |          |                              |\n| 사용된 총 입력 및 출력 토큰   |          |          |                              |\n| `totalToolCalls`   | `number` |          |                              |\n| 총 도구 호출 수          |          |          |                              |\n\n### `subagent.failed`\n\n하위 에이전트에 오류가 발생했습니다.\n\n| 데이터 필드                     | Type     | Required | Description                  |\n| -------------------------- | -------- | -------- | ---------------------------- |\n| `toolCallId`               | `string` | ✅        | 해당 항목과 일치 `subagent.started` |\n| `agentName`                | `string` | ✅        | 내부 이름                        |\n| `agentDisplayName`         | `string` | ✅        | 표시 이름                        |\n| `error`                    | `string` | ✅        | 오류 메시지                       |\n| `model`                    | `string` |          |                              |\n| 하위 에이전트에 대해 선택된 모델(알려진 경우) |          |          |                              |\n| `durationMs`               | `number` |          |                              |\n| 벽시계 실행 기간(밀리초)             |          |          |                              |\n| `totalTokens`              | `number` |          |                              |\n| 실패하기 전에 사용된 총 입력 및 출력 토큰   |          |          |                              |\n| `totalToolCalls`           | `number` |          |                              |\n| 실패하기 전에 수행한 총 도구 호출        |          |          |                              |\n\n### `subagent.selected`\n\n현재 요청을 처리하기 위해 사용자 지정 에이전트를 선택(유추)했습니다.\n\n| 데이터 필드             | Type               | Required | Description                               |\n| ------------------ | ------------------ | -------- | ----------------------------------------- |\n| `agentName`        | `string`           | ✅        | 선택한 에이전트의 내부 이름                           |\n| `agentDisplayName` | `string`           | ✅        | 표시 이름                                     |\n| `tools`            | `string[] \\| null` | ✅        | 이 에이전트에서 사용할 수 있는 도구 이름; `null` 모든 도구에 대해 |\n\n### `subagent.deselected`\n\n사용자 지정 에이전트가 선택 취소되어 기본 에이전트로 돌아갑니다.\n**데이터 페이로드가 비어 있습니다(`{}`)**.\n\n### `skill.invoked`\n\n현재 대화에 대한 기술이 활성화되었습니다.\n\n| 데이터 필드                     | Type       | Required | Description           |\n| -------------------------- | ---------- | -------- | --------------------- |\n| `name`                     | `string`   | ✅        | 기술 이름                 |\n| `path`                     | `string`   | ✅        | SKILL.md 정의에 대한 파일 경로 |\n| `content`                  | `string`   | ✅        | 기술 콘텐츠 전체가 대화에 삽입됨    |\n| `allowedTools`             | `string[]` |          |                       |\n| 이 기술이 활성 상태일 때 자동으로 승인된 도구 |            |          |                       |\n| `pluginName`               | `string`   |          |                       |\n| 스킬이 기원한 플러그인               |            |          |                       |\n| `pluginVersion`            | `string`   |          |                       |\n| 플러그 인 버전                   |            |          |                       |\n\n## 기타 이벤트\n\n### `abort`\n\n현재 턴이 중단되었습니다.\n\n| 데이터 필드   | Type     | Required | Description                      |\n| -------- | -------- | -------- | -------------------------------- |\n| `reason` | `string` | ✅        | 턴이 중단된 이유(예: `\"user initiated\"`) |\n\n### `user.message`\n\n사용자가 메시지를 보냈습니다. 세션 타임라인을 위해 기록됩니다.\n\n| 데이터 필드                                                        | Type           | Required | Description  |\n| ------------------------------------------------------------- | -------------- | -------- | ------------ |\n| `content`                                                     | `string`       | ✅        | 사용자의 메시지 텍스트 |\n| `transformedContent`                                          | `string`       |          |              |\n| 전처리 후 변환된 버전                                                  |                |          |              |\n| `attachments`                                                 | `Attachment[]` |          |              |\n| 파일, 디렉터리, 선택 영역, Blob 또는 GitHub 참조 첨부 파일                      |                |          |              |\n| `source`                                                      | `string`       |          |              |\n| 메시지 원본 식별자                                                    |                |          |              |\n| `agentMode`                                                   | `string`       |          |              |\n| 에이전트 모드: `\"interactive\"`, `\"plan\"`, `\"autopilot\"`또는 `\"shell\"` |                |          |              |\n| `interactionId`                                               | `string`       |          |              |\n| CAPI 상호 작용 ID                                                 |                |          |              |\n\n### `system.message`\n\n시스템 또는 개발자 프롬프트가 대화에 삽입되었습니다.\n\n| 데이터 필드         | Type                             | Required | Description |\n| -------------- | -------------------------------- | -------- | ----------- |\n| `content`      | `string`                         | ✅        | 프롬프트 텍스트    |\n| `role`         | `\"system\" \\| \"developer\"`        | ✅        | 메시지 역할      |\n| `name`         | `string`                         |          |             |\n| 원본 식별자         |                                  |          |             |\n| `metadata`     | `{ promptVersion?, variables? }` |          |             |\n| 프롬프트 템플릿 메타데이터 |                                  |          |             |\n\n### `external_tool.requested`\n\n에이전트는 외부 도구(SDK 소비자가 제공하는 도구)를 호출하려고 합니다.\n\n| 데이터 필드       | Type     | Required | Description                                    |\n| ------------ | -------- | -------- | ---------------------------------------------- |\n| `requestId`  | `string` | ✅        | 이를 통해 응답하세요. `session.respondToExternalTool()` |\n| `sessionId`  | `string` | ✅        | 이 요청이 속한 세션                                    |\n| `toolCallId` | `string` | ✅        | 이 호출에 대한 도구 호출 ID                              |\n| `toolName`   | `string` | ✅        | 외부 도구의 이름                                      |\n| `arguments`  | `object` |          |                                                |\n| 도구의 인수       |          |          |                                                |\n\n### `external_tool.completed`\n\n외부 도구 요청이 확인되었습니다.\n\n| 데이터 필드      | Type     | Required | Description                         |\n| ----------- | -------- | -------- | ----------------------------------- |\n| `requestId` | `string` | ✅        | 해당 항목과 일치 `external_tool.requested` |\n\n### `exit_plan_mode.requested`\n\n임시. 에이전트가 계획을 만들고 계획 모드를 종료하려고 합니다.\n\n| 데이터 필드              | Type       | Required | Description                                    |\n| ------------------- | ---------- | -------- | ---------------------------------------------- |\n| `requestId`         | `string`   | ✅        | 이를 통해 응답하세요. `session.respondToExitPlanMode()` |\n| `summary`           | `string`   | ✅        | 계획 요약                                          |\n| `planContent`       | `string`   | ✅        | 전체 계획 파일 콘텐츠                                   |\n| `actions`           | `string[]` | ✅        | 사용 가능한 사용자 작업(예: 승인, 편집, 거부)                   |\n| `recommendedAction` | `string`   | ✅        | 권장 작업                                          |\n\n### `exit_plan_mode.completed`\n\n임시. 종료 계획 모드 요청이 해결되었습니다.\n\n| 데이터 필드      | Type     | Required | Description                          |\n| ----------- | -------- | -------- | ------------------------------------ |\n| `requestId` | `string` | ✅        | 해당 항목과 일치 `exit_plan_mode.requested` |\n\n### `command.queued`\n\n임시. 슬래시 명령이 실행을 위해 큐에 대기되었습니다.\n\n| 데이터 필드      | Type     | Required | Description                                     |\n| ----------- | -------- | -------- | ----------------------------------------------- |\n| `requestId` | `string` | ✅        | 이를 통해 응답하세요. `session.respondToQueuedCommand()` |\n| `command`   | `string` | ✅        | 슬래시 명령 텍스트(예: `/help`, `/clear`)                |\n\n### `command.completed`\n\n임시. 큐에 대기된 명령이 해결되었습니다.\n\n| 데이터 필드      | Type     | Required | Description                |\n| ----------- | -------- | -------- | -------------------------- |\n| `requestId` | `string` | ✅        | 해당 항목과 일치 `command.queued` |\n\n### `session_limits_exhausted.requested`\n\n임시. 현재 세션 예산이 소진되었으며 계속하기 전에 런타임에 사용자 결정이 필요합니다.\n\n| 데이터 필드          | Type     | Required | Description                   |\n| --------------- | -------- | -------- | ----------------------------- |\n| `requestId`     | `string` | ✅        | 보류 중인 고갈 제한 요청에 응답할 때 이 ID 사용 |\n| `maxAiCredits`  | `number` | ✅        | 현재 회계 창에 대해 구성된 최대 AI 크레딧     |\n| `usedAiCredits` | `number` | ✅        | 현재 집계 기간에 이미 소진된 AI 크레딧       |\n\n### `session_limits_exhausted.completed`\n\n임시. 대기 중인 한도 초과 요청이 해결되었습니다.\n\n| 데이터 필드                                              | Type                                    | Required | Description                                     |\n| --------------------------------------------------- | --------------------------------------- | -------- | ----------------------------------------------- |\n| `requestId`                                         | `string`                                | ✅        | 해당 이벤트와 일치 `session_limits_exhausted.requested` |\n| `response.action`                                   | `\"add\" \\| \"set\" \\| \"unset\" \\| \"cancel\"` | ✅        | 고갈된 제한 요청에 대해 선택한 작업                            |\n| `response.additionalAiCredits`                      | `number`                                |          |                                                 |\n|                                                     |                                         |          |                                                 |\n| `response.action`이(가) `\"add\"`일 때 현재 최대치에 추가할 AI 크레딧 |                                         |          |                                                 |\n| `response.maxAiCredits`                             | `number`                                |          |                                                 |\n|                                                     |                                         |          |                                                 |\n| `response.action`이(가) `\"set\"`일 때의 새로운 절대 최대 AI 크레딧  |                                         |          |                                                 |\n\n## 빠른 참조: 에이전시적 단계 흐름\n\n일반적인 에이전트 동작은 다음 순서로 이벤트를 발생시킵니다.\n\n```text\nassistant.turn_start          → Turn begins\n├── assistant.intent          → What the agent plans to do (ephemeral)\n├── assistant.reasoning_delta → Streaming thinking chunks (ephemeral, repeated)\n├── assistant.reasoning       → Complete thinking block\n├── assistant.message_delta   → Streaming response chunks (ephemeral, repeated)\n├── assistant.message         → Complete response (may include toolRequests)\n├── assistant.usage           → Token usage for this API call (ephemeral)\n│\n├── [If tools were requested:]\n│   ├── permission.requested  → Needs user approval\n│   ├── permission.completed  → Approval result\n│   ├── tool.execution_start  → Tool begins\n│   ├── tool.execution_partial_result  → Streaming tool output (ephemeral, repeated)\n│   ├── tool.execution_progress        → Progress updates (ephemeral, repeated)\n│   ├── tool.execution_complete        → Tool finished\n│   │\n│   └── [Agent loops: more reasoning → message → tool calls...]\n│\nassistant.turn_end            → Turn complete\nsession.idle                  → Ready for next message (ephemeral)\n```\n\n## 모든 이벤트 유형 한눈에 보기\n\n이 표에는 키 `data` 페이로드 필드가 나열됩니다. 일반적인 봉투 필드는 위에 설명되어 있습니다.\n\n| 이벤트 유형                                                                                                  | 임시              | 카테고리    | 키 데이터 필드                 |\n| ------------------------------------------------------------------------------------------------------- | --------------- | ------- | ------------------------ |\n| `assistant.turn_start`                                                                                  |                 |         |                          |\n| 도우미                                                                                                     |                 |         |                          |\n| `turnId`, `interactionId?`                                                                              |                 |         |                          |\n| `assistant.intent`                                                                                      | ✅               | 도우미     | `intent`                 |\n| `assistant.reasoning`                                                                                   |                 |         |                          |\n| 도우미                                                                                                     |                 |         |                          |\n| `reasoningId`, `content`                                                                                |                 |         |                          |\n| `assistant.reasoning_delta`                                                                             | ✅               | 도우미     |                          |\n| `reasoningId`, `deltaContent`                                                                           |                 |         |                          |\n| `assistant.streaming_delta`                                                                             | ✅               | 도우미     | `totalResponseSizeBytes` |\n| `assistant.message`                                                                                     |                 |         |                          |\n| 도우미                                                                                                     |                 |         |                          |\n| `messageId`, `content`, `toolRequests?`, `outputTokens?``phase?`                                        |                 |         |                          |\n| `assistant.message_delta`                                                                               | ✅               | 도우미     |                          |\n| `messageId`, `deltaContent`                                                                             |                 |         |                          |\n| `assistant.turn_end`                                                                                    |                 |         |                          |\n| 도우미                                                                                                     | `turnId`        |         |                          |\n| `assistant.usage`                                                                                       | ✅               | 도우미     |                          |\n| `model`, `apiEndpoint?`, `inputTokens?`, `outputTokens?`, `cost?``duration?`                            |                 |         |                          |\n| `tool.user_requested`                                                                                   |                 |         |                          |\n| Tool                                                                                                    |                 |         |                          |\n| `toolCallId`, `toolName`, `arguments?`                                                                  |                 |         |                          |\n| `tool.execution_start`                                                                                  |                 |         |                          |\n| Tool                                                                                                    |                 |         |                          |\n| `toolCallId`, `toolName`, , `arguments?`, `mcpServerName?`                                              |                 |         |                          |\n| `tool.execution_partial_result`                                                                         | ✅               | Tool    |                          |\n| `toolCallId`, `partialOutput`                                                                           |                 |         |                          |\n| `tool.execution_progress`                                                                               | ✅               | Tool    |                          |\n| `toolCallId`, `progressMessage`                                                                         |                 |         |                          |\n| `tool.execution_complete`                                                                               |                 |         |                          |\n| Tool                                                                                                    |                 |         |                          |\n| `toolCallId`, `success`, , `result?`, `error?`                                                          |                 |         |                          |\n| `session.idle`                                                                                          | ✅               | Session | `aborted?`               |\n| `session.error`                                                                                         |                 |         |                          |\n| Session                                                                                                 |                 |         |                          |\n| `errorType`, `message`, `statusCode?`                                                                   |                 |         |                          |\n| `session.compaction_start`                                                                              |                 |         |                          |\n| Session                                                                                                 |                 |         |                          |\n| *(비어 있음)*                                                                                               |                 |         |                          |\n| `session.compaction_complete`                                                                           |                 |         |                          |\n| Session                                                                                                 |                 |         |                          |\n| `success`, `preCompactionTokens?`, `summaryContent?`                                                    |                 |         |                          |\n| `session.title_changed`                                                                                 | ✅               | Session | `title`                  |\n| `session.context_changed`                                                                               |                 |         |                          |\n| Session                                                                                                 |                 |         |                          |\n| `cwd`, `gitRoot?`, , `repository?`, `branch?`                                                           |                 |         |                          |\n| `session.usage_info`                                                                                    | ✅               | Session |                          |\n| `tokenLimit`, `currentTokens`, `messagesLength`                                                         |                 |         |                          |\n| `session.session_limits_changed`                                                                        |                 |         |                          |\n| Session                                                                                                 | `sessionLimits` |         |                          |\n| `session.usage_checkpoint`                                                                              |                 |         |                          |\n| Session                                                                                                 |                 |         |                          |\n| `totalNanoAiu`, `totalPremiumRequests?`                                                                 |                 |         |                          |\n| `session.task_complete`                                                                                 |                 |         |                          |\n| Session                                                                                                 | `summary?`      |         |                          |\n| `session.shutdown`                                                                                      |                 |         |                          |\n| Session                                                                                                 |                 |         |                          |\n| `shutdownType`, `codeChanges`, `modelMetrics`                                                           |                 |         |                          |\n| `permission.requested`                                                                                  |                 |         |                          |\n| 허가                                                                                                      |                 |         |                          |\n| `requestId`, `permissionRequest`                                                                        |                 |         |                          |\n| `permission.completed`                                                                                  |                 |         |                          |\n| 허가                                                                                                      |                 |         |                          |\n| `requestId`, `result.kind`                                                                              |                 |         |                          |\n| `user_input.requested`                                                                                  | ✅               | 사용자 입력  |                          |\n| `requestId`, `question`, `choices?`                                                                     |                 |         |                          |\n| `user_input.completed`                                                                                  | ✅               | 사용자 입력  | `requestId`              |\n| `elicitation.requested`                                                                                 | ✅               | 사용자 입력  |                          |\n| `requestId`, `message`, `requestedSchema`                                                               |                 |         |                          |\n| `elicitation.completed`                                                                                 | ✅               | 사용자 입력  | `requestId`              |\n| `subagent.started`                                                                                      |                 |         |                          |\n| 하위 에이전트                                                                                                 |                 |         |                          |\n| `toolCallId`, `agentName`, , `agentDisplayName`, `model?`                                               |                 |         |                          |\n| `subagent.completed`                                                                                    |                 |         |                          |\n| 하위 에이전트                                                                                                 |                 |         |                          |\n| `toolCallId`, `agentName`, `agentDisplayName`, `model?`, `durationMs?`, `totalTokens?``totalToolCalls?` |                 |         |                          |\n| `subagent.failed`                                                                                       |                 |         |                          |\n| 하위 에이전트                                                                                                 |                 |         |                          |\n| `toolCallId`, `agentName`, `error`, `model?`, `durationMs?`, `totalTokens?``totalToolCalls?`            |                 |         |                          |\n| `subagent.selected`                                                                                     |                 |         |                          |\n| 하위 에이전트                                                                                                 |                 |         |                          |\n| `agentName`, `agentDisplayName`, `tools`                                                                |                 |         |                          |\n| `subagent.deselected`                                                                                   |                 |         |                          |\n| 하위 에이전트                                                                                                 |                 |         |                          |\n| *(비어 있음)*                                                                                               |                 |         |                          |\n| `skill.invoked`                                                                                         |                 |         |                          |\n| 기술                                                                                                      |                 |         |                          |\n| `name`, `path`, , `content`, `allowedTools?`                                                            |                 |         |                          |\n| `abort`                                                                                                 |                 |         |                          |\n| 제어                                                                                                      | `reason`        |         |                          |\n| `user.message`                                                                                          |                 |         |                          |\n| 사용자                                                                                                     |                 |         |                          |\n| `content`, `attachments?`, `agentMode?`                                                                 |                 |         |                          |\n| `system.message`                                                                                        |                 |         |                          |\n| System                                                                                                  |                 |         |                          |\n| `content`, `role`                                                                                       |                 |         |                          |\n| `external_tool.requested`                                                                               |                 |         |                          |\n| 외부 도구                                                                                                   |                 |         |                          |\n| `requestId`, `toolName`, `arguments?`                                                                   |                 |         |                          |\n| `external_tool.completed`                                                                               |                 |         |                          |\n| 외부 도구                                                                                                   | `requestId`     |         |                          |\n| `command.queued`                                                                                        | ✅               | Command |                          |\n| `requestId`, `command`                                                                                  |                 |         |                          |\n| `command.completed`                                                                                     | ✅               | Command | `requestId`              |\n| `session_limits_exhausted.requested`                                                                    | ✅               | Session |                          |\n| `requestId`, `maxAiCredits`, `usedAiCredits`                                                            |                 |         |                          |\n| `session_limits_exhausted.completed`                                                                    | ✅               | Session |                          |\n| `requestId`, `response.action`                                                                          |                 |         |                          |\n| `exit_plan_mode.requested`                                                                              | ✅               | 계획 모드   |                          |\n| `requestId`, `summary`, , `planContent`, `actions`                                                      |                 |         |                          |\n| `exit_plan_mode.completed`                                                                              | ✅               | 계획 모드   | `requestId`              |"}