@github/copilot-sdk 0.1.33-unstable.1 → 0.2.1-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,9 @@ export type SessionEvent = {
20
20
  */
21
21
  ephemeral?: boolean;
22
22
  type: "session.start";
23
+ /**
24
+ * Session initialization metadata including context and configuration
25
+ */
23
26
  data: {
24
27
  /**
25
28
  * Unique identifier for the session
@@ -45,6 +48,10 @@ export type SessionEvent = {
45
48
  * Model selected at session creation time, if any
46
49
  */
47
50
  selectedModel?: string;
51
+ /**
52
+ * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
53
+ */
54
+ reasoningEffort?: string;
48
55
  /**
49
56
  * Working directory and git context at session start
50
57
  */
@@ -58,14 +65,29 @@ export type SessionEvent = {
58
65
  */
59
66
  gitRoot?: string;
60
67
  /**
61
- * Repository identifier in "owner/name" format, derived from the git remote URL
68
+ * Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps)
62
69
  */
63
70
  repository?: string;
71
+ /**
72
+ * Hosting platform type of the repository (github or ado)
73
+ */
74
+ hostType?: "github" | "ado";
64
75
  /**
65
76
  * Current git branch name
66
77
  */
67
78
  branch?: string;
79
+ /**
80
+ * Head commit of current git branch at session start time
81
+ */
82
+ headCommit?: string;
83
+ /**
84
+ * Base commit of current git branch at session start time
85
+ */
86
+ baseCommit?: string;
68
87
  };
88
+ /**
89
+ * Whether the session was already in use by another client at start time
90
+ */
69
91
  alreadyInUse?: boolean;
70
92
  };
71
93
  } | {
@@ -86,6 +108,9 @@ export type SessionEvent = {
86
108
  */
87
109
  ephemeral?: boolean;
88
110
  type: "session.resume";
111
+ /**
112
+ * Session resume metadata including current context and event count
113
+ */
89
114
  data: {
90
115
  /**
91
116
  * ISO 8601 timestamp when the session was resumed
@@ -95,6 +120,14 @@ export type SessionEvent = {
95
120
  * Total number of persisted events in the session at the time of resume
96
121
  */
97
122
  eventCount: number;
123
+ /**
124
+ * Model currently selected at resume time
125
+ */
126
+ selectedModel?: string;
127
+ /**
128
+ * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
129
+ */
130
+ reasoningEffort?: string;
98
131
  /**
99
132
  * Updated working directory and git context at resume time
100
133
  */
@@ -108,14 +141,29 @@ export type SessionEvent = {
108
141
  */
109
142
  gitRoot?: string;
110
143
  /**
111
- * Repository identifier in "owner/name" format, derived from the git remote URL
144
+ * Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps)
112
145
  */
113
146
  repository?: string;
147
+ /**
148
+ * Hosting platform type of the repository (github or ado)
149
+ */
150
+ hostType?: "github" | "ado";
114
151
  /**
115
152
  * Current git branch name
116
153
  */
117
154
  branch?: string;
155
+ /**
156
+ * Head commit of current git branch at session start time
157
+ */
158
+ headCommit?: string;
159
+ /**
160
+ * Base commit of current git branch at session start time
161
+ */
162
+ baseCommit?: string;
118
163
  };
164
+ /**
165
+ * Whether the session was already in use by another client at resume time
166
+ */
119
167
  alreadyInUse?: boolean;
120
168
  };
121
169
  } | {
@@ -136,6 +184,9 @@ export type SessionEvent = {
136
184
  */
137
185
  ephemeral?: boolean;
138
186
  type: "session.error";
187
+ /**
188
+ * Error details for timeline display including message and optional diagnostic information
189
+ */
139
190
  data: {
140
191
  /**
141
192
  * Category of error (e.g., "authentication", "authorization", "quota", "rate_limit", "query")
@@ -157,6 +208,10 @@ export type SessionEvent = {
157
208
  * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
158
209
  */
159
210
  providerCallId?: string;
211
+ /**
212
+ * Optional URL associated with this error that the user can open in a browser
213
+ */
214
+ url?: string;
160
215
  };
161
216
  } | {
162
217
  /**
@@ -228,6 +283,9 @@ export type SessionEvent = {
228
283
  parentId: string | null;
229
284
  ephemeral: true;
230
285
  type: "session.title_changed";
286
+ /**
287
+ * Session title change payload containing the new display title
288
+ */
231
289
  data: {
232
290
  /**
233
291
  * The new display title for the session
@@ -252,6 +310,9 @@ export type SessionEvent = {
252
310
  */
253
311
  ephemeral?: boolean;
254
312
  type: "session.info";
313
+ /**
314
+ * Informational message for timeline display with categorization
315
+ */
255
316
  data: {
256
317
  /**
257
318
  * Category of informational message (e.g., "notification", "timing", "context_window", "mcp", "snapshot", "configuration", "authentication", "model")
@@ -261,6 +322,10 @@ export type SessionEvent = {
261
322
  * Human-readable informational message for display in the timeline
262
323
  */
263
324
  message: string;
325
+ /**
326
+ * Optional URL associated with this message that the user can open in a browser
327
+ */
328
+ url?: string;
264
329
  };
265
330
  } | {
266
331
  /**
@@ -280,6 +345,9 @@ export type SessionEvent = {
280
345
  */
281
346
  ephemeral?: boolean;
282
347
  type: "session.warning";
348
+ /**
349
+ * Warning message for timeline display with categorization
350
+ */
283
351
  data: {
284
352
  /**
285
353
  * Category of warning (e.g., "subscription", "policy", "mcp")
@@ -289,6 +357,10 @@ export type SessionEvent = {
289
357
  * Human-readable warning message for display in the timeline
290
358
  */
291
359
  message: string;
360
+ /**
361
+ * Optional URL associated with this warning that the user can open in a browser
362
+ */
363
+ url?: string;
292
364
  };
293
365
  } | {
294
366
  /**
@@ -308,6 +380,9 @@ export type SessionEvent = {
308
380
  */
309
381
  ephemeral?: boolean;
310
382
  type: "session.model_change";
383
+ /**
384
+ * Model change details including previous and new model identifiers
385
+ */
311
386
  data: {
312
387
  /**
313
388
  * Model that was previously selected, if any
@@ -317,6 +392,14 @@ export type SessionEvent = {
317
392
  * Newly selected model identifier
318
393
  */
319
394
  newModel: string;
395
+ /**
396
+ * Reasoning effort level before the model change, if applicable
397
+ */
398
+ previousReasoningEffort?: string;
399
+ /**
400
+ * Reasoning effort level after the model change, if applicable
401
+ */
402
+ reasoningEffort?: string;
320
403
  };
321
404
  } | {
322
405
  /**
@@ -336,6 +419,9 @@ export type SessionEvent = {
336
419
  */
337
420
  ephemeral?: boolean;
338
421
  type: "session.mode_changed";
422
+ /**
423
+ * Agent mode change details including previous and new modes
424
+ */
339
425
  data: {
340
426
  /**
341
427
  * Agent mode before the change (e.g., "interactive", "plan", "autopilot")
@@ -364,6 +450,9 @@ export type SessionEvent = {
364
450
  */
365
451
  ephemeral?: boolean;
366
452
  type: "session.plan_changed";
453
+ /**
454
+ * Plan file operation details indicating what changed
455
+ */
367
456
  data: {
368
457
  /**
369
458
  * The type of operation performed on the plan file
@@ -388,6 +477,9 @@ export type SessionEvent = {
388
477
  */
389
478
  ephemeral?: boolean;
390
479
  type: "session.workspace_file_changed";
480
+ /**
481
+ * Workspace file change details including path and operation type
482
+ */
391
483
  data: {
392
484
  /**
393
485
  * Relative path within the session workspace files directory
@@ -416,6 +508,9 @@ export type SessionEvent = {
416
508
  */
417
509
  ephemeral?: boolean;
418
510
  type: "session.handoff";
511
+ /**
512
+ * Session handoff metadata including source, context, and repository information
513
+ */
419
514
  data: {
420
515
  /**
421
516
  * ISO 8601 timestamp when the handoff occurred
@@ -454,6 +549,10 @@ export type SessionEvent = {
454
549
  * Session ID of the remote session being handed off
455
550
  */
456
551
  remoteSessionId?: string;
552
+ /**
553
+ * GitHub host URL for the source session (e.g., https://github.com or https://tenant.ghe.com)
554
+ */
555
+ host?: string;
457
556
  };
458
557
  } | {
459
558
  /**
@@ -473,6 +572,9 @@ export type SessionEvent = {
473
572
  */
474
573
  ephemeral?: boolean;
475
574
  type: "session.truncation";
575
+ /**
576
+ * Conversation truncation statistics including token counts and removed content metrics
577
+ */
476
578
  data: {
477
579
  /**
478
580
  * Maximum token count for the model's context window
@@ -522,6 +624,9 @@ export type SessionEvent = {
522
624
  parentId: string | null;
523
625
  ephemeral: true;
524
626
  type: "session.snapshot_rewind";
627
+ /**
628
+ * Session rewind details including target event and count of removed events
629
+ */
525
630
  data: {
526
631
  /**
527
632
  * Event ID that was rewound to; all events after this one were removed
@@ -550,6 +655,9 @@ export type SessionEvent = {
550
655
  */
551
656
  ephemeral?: boolean;
552
657
  type: "session.shutdown";
658
+ /**
659
+ * Session termination metrics including usage statistics, code changes, and shutdown reason
660
+ */
553
661
  data: {
554
662
  /**
555
663
  * Whether the session ended normally ("routine") or due to a crash/fatal error ("error")
@@ -633,6 +741,22 @@ export type SessionEvent = {
633
741
  * Model that was selected at the time of shutdown
634
742
  */
635
743
  currentModel?: string;
744
+ /**
745
+ * Total tokens in context window at shutdown
746
+ */
747
+ currentTokens?: number;
748
+ /**
749
+ * System message token count at shutdown
750
+ */
751
+ systemTokens?: number;
752
+ /**
753
+ * Non-system message token count at shutdown
754
+ */
755
+ conversationTokens?: number;
756
+ /**
757
+ * Tool definitions token count at shutdown
758
+ */
759
+ toolDefinitionsTokens?: number;
636
760
  };
637
761
  } | {
638
762
  /**
@@ -652,6 +776,9 @@ export type SessionEvent = {
652
776
  */
653
777
  ephemeral?: boolean;
654
778
  type: "session.context_changed";
779
+ /**
780
+ * Updated working directory and git context after the change
781
+ */
655
782
  data: {
656
783
  /**
657
784
  * Current working directory path
@@ -662,13 +789,25 @@ export type SessionEvent = {
662
789
  */
663
790
  gitRoot?: string;
664
791
  /**
665
- * Repository identifier in "owner/name" format, derived from the git remote URL
792
+ * Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps)
666
793
  */
667
794
  repository?: string;
795
+ /**
796
+ * Hosting platform type of the repository (github or ado)
797
+ */
798
+ hostType?: "github" | "ado";
668
799
  /**
669
800
  * Current git branch name
670
801
  */
671
802
  branch?: string;
803
+ /**
804
+ * Head commit of current git branch at session start time
805
+ */
806
+ headCommit?: string;
807
+ /**
808
+ * Base commit of current git branch at session start time
809
+ */
810
+ baseCommit?: string;
672
811
  };
673
812
  } | {
674
813
  /**
@@ -685,6 +824,9 @@ export type SessionEvent = {
685
824
  parentId: string | null;
686
825
  ephemeral: true;
687
826
  type: "session.usage_info";
827
+ /**
828
+ * Current context window usage statistics including token and message counts
829
+ */
688
830
  data: {
689
831
  /**
690
832
  * Maximum token count for the model's context window
@@ -698,6 +840,22 @@ export type SessionEvent = {
698
840
  * Current number of messages in the conversation
699
841
  */
700
842
  messagesLength: number;
843
+ /**
844
+ * Token count from system message(s)
845
+ */
846
+ systemTokens?: number;
847
+ /**
848
+ * Token count from non-system messages (user, assistant, tool)
849
+ */
850
+ conversationTokens?: number;
851
+ /**
852
+ * Token count from tool definitions
853
+ */
854
+ toolDefinitionsTokens?: number;
855
+ /**
856
+ * Whether this is the first usage_info event emitted in this session
857
+ */
858
+ isInitial?: boolean;
701
859
  };
702
860
  } | {
703
861
  /**
@@ -718,9 +876,22 @@ export type SessionEvent = {
718
876
  ephemeral?: boolean;
719
877
  type: "session.compaction_start";
720
878
  /**
721
- * Empty payload; the event signals that LLM-powered conversation compaction has begun
879
+ * Context window breakdown at the start of LLM-powered conversation compaction
722
880
  */
723
- data: {};
881
+ data: {
882
+ /**
883
+ * Token count from system message(s) at compaction start
884
+ */
885
+ systemTokens?: number;
886
+ /**
887
+ * Token count from non-system messages (user, assistant, tool) at compaction start
888
+ */
889
+ conversationTokens?: number;
890
+ /**
891
+ * Token count from tool definitions at compaction start
892
+ */
893
+ toolDefinitionsTokens?: number;
894
+ };
724
895
  } | {
725
896
  /**
726
897
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -739,6 +910,9 @@ export type SessionEvent = {
739
910
  */
740
911
  ephemeral?: boolean;
741
912
  type: "session.compaction_complete";
913
+ /**
914
+ * Conversation compaction results including success status, metrics, and optional error details
915
+ */
742
916
  data: {
743
917
  /**
744
918
  * Whether compaction completed successfully
@@ -801,6 +975,18 @@ export type SessionEvent = {
801
975
  * GitHub request tracing ID (x-github-request-id header) for the compaction LLM call
802
976
  */
803
977
  requestId?: string;
978
+ /**
979
+ * Token count from system message(s) after compaction
980
+ */
981
+ systemTokens?: number;
982
+ /**
983
+ * Token count from non-system messages (user, assistant, tool) after compaction
984
+ */
985
+ conversationTokens?: number;
986
+ /**
987
+ * Token count from tool definitions after compaction
988
+ */
989
+ toolDefinitionsTokens?: number;
804
990
  };
805
991
  } | {
806
992
  /**
@@ -820,11 +1006,18 @@ export type SessionEvent = {
820
1006
  */
821
1007
  ephemeral?: boolean;
822
1008
  type: "session.task_complete";
1009
+ /**
1010
+ * Task completion notification with summary from the agent
1011
+ */
823
1012
  data: {
824
1013
  /**
825
- * Optional summary of the completed task, provided by the agent
1014
+ * Summary of the completed task, provided by the agent
826
1015
  */
827
1016
  summary?: string;
1017
+ /**
1018
+ * Whether the tool call succeeded. False when validation failed (e.g., invalid arguments)
1019
+ */
1020
+ success?: boolean;
828
1021
  };
829
1022
  } | {
830
1023
  /**
@@ -857,9 +1050,12 @@ export type SessionEvent = {
857
1050
  * Files, selections, or GitHub references attached to the message
858
1051
  */
859
1052
  attachments?: ({
1053
+ /**
1054
+ * Attachment type discriminator
1055
+ */
860
1056
  type: "file";
861
1057
  /**
862
- * Absolute file or directory path
1058
+ * Absolute file path
863
1059
  */
864
1060
  path: string;
865
1061
  /**
@@ -880,28 +1076,18 @@ export type SessionEvent = {
880
1076
  end: number;
881
1077
  };
882
1078
  } | {
1079
+ /**
1080
+ * Attachment type discriminator
1081
+ */
883
1082
  type: "directory";
884
1083
  /**
885
- * Absolute file or directory path
1084
+ * Absolute directory path
886
1085
  */
887
1086
  path: string;
888
1087
  /**
889
1088
  * User-facing display name for the attachment
890
1089
  */
891
1090
  displayName: string;
892
- /**
893
- * Optional line range to scope the attachment to a specific section of the file
894
- */
895
- lineRange?: {
896
- /**
897
- * Start line number (1-based)
898
- */
899
- start: number;
900
- /**
901
- * End line number (1-based, inclusive)
902
- */
903
- end: number;
904
- };
905
1091
  } | {
906
1092
  /**
907
1093
  * Attachment type discriminator
@@ -923,6 +1109,9 @@ export type SessionEvent = {
923
1109
  * Position range of the selection within the file
924
1110
  */
925
1111
  selection: {
1112
+ /**
1113
+ * Start position of the selection
1114
+ */
926
1115
  start: {
927
1116
  /**
928
1117
  * Start line number (0-based)
@@ -933,6 +1122,9 @@ export type SessionEvent = {
933
1122
  */
934
1123
  character: number;
935
1124
  };
1125
+ /**
1126
+ * End position of the selection
1127
+ */
936
1128
  end: {
937
1129
  /**
938
1130
  * End line number (0-based)
@@ -969,6 +1161,23 @@ export type SessionEvent = {
969
1161
  * URL to the referenced item on GitHub
970
1162
  */
971
1163
  url: string;
1164
+ } | {
1165
+ /**
1166
+ * Attachment type discriminator
1167
+ */
1168
+ type: "blob";
1169
+ /**
1170
+ * Base64-encoded content
1171
+ */
1172
+ data: string;
1173
+ /**
1174
+ * MIME type of the inline data
1175
+ */
1176
+ mimeType: string;
1177
+ /**
1178
+ * User-facing display name for the attachment
1179
+ */
1180
+ displayName?: string;
972
1181
  })[];
973
1182
  /**
974
1183
  * Origin of this message, used for timeline filtering (e.g., "skill-pdf" for skill-injected messages that should be hidden from the user)
@@ -1020,6 +1229,9 @@ export type SessionEvent = {
1020
1229
  */
1021
1230
  ephemeral?: boolean;
1022
1231
  type: "assistant.turn_start";
1232
+ /**
1233
+ * Turn initialization metadata including identifier and interaction tracking
1234
+ */
1023
1235
  data: {
1024
1236
  /**
1025
1237
  * Identifier for this turn within the agentic loop, typically a stringified turn number
@@ -1045,6 +1257,9 @@ export type SessionEvent = {
1045
1257
  parentId: string | null;
1046
1258
  ephemeral: true;
1047
1259
  type: "assistant.intent";
1260
+ /**
1261
+ * Agent intent description for current activity or plan
1262
+ */
1048
1263
  data: {
1049
1264
  /**
1050
1265
  * Short description of what the agent is currently doing or planning to do
@@ -1069,6 +1284,9 @@ export type SessionEvent = {
1069
1284
  */
1070
1285
  ephemeral?: boolean;
1071
1286
  type: "assistant.reasoning";
1287
+ /**
1288
+ * Assistant reasoning content for timeline display with complete thinking text
1289
+ */
1072
1290
  data: {
1073
1291
  /**
1074
1292
  * Unique identifier for this reasoning block
@@ -1094,6 +1312,9 @@ export type SessionEvent = {
1094
1312
  parentId: string | null;
1095
1313
  ephemeral: true;
1096
1314
  type: "assistant.reasoning_delta";
1315
+ /**
1316
+ * Streaming reasoning delta for incremental extended thinking updates
1317
+ */
1097
1318
  data: {
1098
1319
  /**
1099
1320
  * Reasoning block ID this delta belongs to, matching the corresponding assistant.reasoning event
@@ -1119,6 +1340,9 @@ export type SessionEvent = {
1119
1340
  parentId: string | null;
1120
1341
  ephemeral: true;
1121
1342
  type: "assistant.streaming_delta";
1343
+ /**
1344
+ * Streaming response progress with cumulative byte count
1345
+ */
1122
1346
  data: {
1123
1347
  /**
1124
1348
  * Cumulative total bytes received from the streaming response so far
@@ -1143,6 +1367,9 @@ export type SessionEvent = {
1143
1367
  */
1144
1368
  ephemeral?: boolean;
1145
1369
  type: "assistant.message";
1370
+ /**
1371
+ * Assistant response containing text content, optional tool requests, and interaction metadata
1372
+ */
1146
1373
  data: {
1147
1374
  /**
1148
1375
  * Unique identifier for this assistant message
@@ -1174,6 +1401,14 @@ export type SessionEvent = {
1174
1401
  * Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent.
1175
1402
  */
1176
1403
  type?: "function" | "custom";
1404
+ /**
1405
+ * Human-readable display title for the tool
1406
+ */
1407
+ toolTitle?: string;
1408
+ /**
1409
+ * Resolved intention summary describing what this specific call does
1410
+ */
1411
+ intentionSummary?: string | null;
1177
1412
  }[];
1178
1413
  /**
1179
1414
  * Opaque/encrypted extended thinking data from Anthropic models. Session-bound and stripped on resume.
@@ -1219,6 +1454,9 @@ export type SessionEvent = {
1219
1454
  parentId: string | null;
1220
1455
  ephemeral: true;
1221
1456
  type: "assistant.message_delta";
1457
+ /**
1458
+ * Streaming assistant message delta for incremental response updates
1459
+ */
1222
1460
  data: {
1223
1461
  /**
1224
1462
  * Message ID this delta belongs to, matching the corresponding assistant.message event
@@ -1251,6 +1489,9 @@ export type SessionEvent = {
1251
1489
  */
1252
1490
  ephemeral?: boolean;
1253
1491
  type: "assistant.turn_end";
1492
+ /**
1493
+ * Turn completion metadata including the turn identifier
1494
+ */
1254
1495
  data: {
1255
1496
  /**
1256
1497
  * Identifier of the turn that has ended, matching the corresponding assistant.turn_start event
@@ -1272,6 +1513,9 @@ export type SessionEvent = {
1272
1513
  parentId: string | null;
1273
1514
  ephemeral: true;
1274
1515
  type: "assistant.usage";
1516
+ /**
1517
+ * LLM API call usage metrics including tokens, costs, quotas, and billing information
1518
+ */
1275
1519
  data: {
1276
1520
  /**
1277
1521
  * Model identifier used for this API call
@@ -1386,6 +1630,10 @@ export type SessionEvent = {
1386
1630
  */
1387
1631
  totalNanoAiu: number;
1388
1632
  };
1633
+ /**
1634
+ * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
1635
+ */
1636
+ reasoningEffort?: string;
1389
1637
  };
1390
1638
  } | {
1391
1639
  /**
@@ -1405,6 +1653,9 @@ export type SessionEvent = {
1405
1653
  */
1406
1654
  ephemeral?: boolean;
1407
1655
  type: "abort";
1656
+ /**
1657
+ * Turn abort information including the reason for termination
1658
+ */
1408
1659
  data: {
1409
1660
  /**
1410
1661
  * Reason the current turn was aborted (e.g., "user initiated")
@@ -1429,6 +1680,9 @@ export type SessionEvent = {
1429
1680
  */
1430
1681
  ephemeral?: boolean;
1431
1682
  type: "tool.user_requested";
1683
+ /**
1684
+ * User-initiated tool invocation request with tool name and arguments
1685
+ */
1432
1686
  data: {
1433
1687
  /**
1434
1688
  * Unique identifier for this tool call
@@ -1463,6 +1717,9 @@ export type SessionEvent = {
1463
1717
  */
1464
1718
  ephemeral?: boolean;
1465
1719
  type: "tool.execution_start";
1720
+ /**
1721
+ * Tool execution startup details including MCP server information when applicable
1722
+ */
1466
1723
  data: {
1467
1724
  /**
1468
1725
  * Unique identifier for this tool call
@@ -1506,6 +1763,9 @@ export type SessionEvent = {
1506
1763
  parentId: string | null;
1507
1764
  ephemeral: true;
1508
1765
  type: "tool.execution_partial_result";
1766
+ /**
1767
+ * Streaming tool execution output for incremental result display
1768
+ */
1509
1769
  data: {
1510
1770
  /**
1511
1771
  * Tool call ID this partial result belongs to
@@ -1531,6 +1791,9 @@ export type SessionEvent = {
1531
1791
  parentId: string | null;
1532
1792
  ephemeral: true;
1533
1793
  type: "tool.execution_progress";
1794
+ /**
1795
+ * Tool execution progress notification with status message
1796
+ */
1534
1797
  data: {
1535
1798
  /**
1536
1799
  * Tool call ID this progress notification belongs to
@@ -1559,6 +1822,9 @@ export type SessionEvent = {
1559
1822
  */
1560
1823
  ephemeral?: boolean;
1561
1824
  type: "tool.execution_complete";
1825
+ /**
1826
+ * Tool execution completion results including success status, detailed output, and error information
1827
+ */
1562
1828
  data: {
1563
1829
  /**
1564
1830
  * Unique identifier for the completed tool call
@@ -1776,6 +2042,9 @@ export type SessionEvent = {
1776
2042
  */
1777
2043
  ephemeral?: boolean;
1778
2044
  type: "skill.invoked";
2045
+ /**
2046
+ * Skill invocation details including content, allowed tools, and plugin metadata
2047
+ */
1779
2048
  data: {
1780
2049
  /**
1781
2050
  * Name of the invoked skill
@@ -1801,6 +2070,10 @@ export type SessionEvent = {
1801
2070
  * Version of the plugin this skill originated from, when applicable
1802
2071
  */
1803
2072
  pluginVersion?: string;
2073
+ /**
2074
+ * Description of the skill from its SKILL.md frontmatter
2075
+ */
2076
+ description?: string;
1804
2077
  };
1805
2078
  } | {
1806
2079
  /**
@@ -1820,6 +2093,9 @@ export type SessionEvent = {
1820
2093
  */
1821
2094
  ephemeral?: boolean;
1822
2095
  type: "subagent.started";
2096
+ /**
2097
+ * Sub-agent startup details including parent tool call and agent information
2098
+ */
1823
2099
  data: {
1824
2100
  /**
1825
2101
  * Tool call ID of the parent tool invocation that spawned this sub-agent
@@ -1856,6 +2132,9 @@ export type SessionEvent = {
1856
2132
  */
1857
2133
  ephemeral?: boolean;
1858
2134
  type: "subagent.completed";
2135
+ /**
2136
+ * Sub-agent completion details for successful execution
2137
+ */
1859
2138
  data: {
1860
2139
  /**
1861
2140
  * Tool call ID of the parent tool invocation that spawned this sub-agent
@@ -1869,6 +2148,22 @@ export type SessionEvent = {
1869
2148
  * Human-readable display name of the sub-agent
1870
2149
  */
1871
2150
  agentDisplayName: string;
2151
+ /**
2152
+ * Model used by the sub-agent
2153
+ */
2154
+ model?: string;
2155
+ /**
2156
+ * Total number of tool calls made by the sub-agent
2157
+ */
2158
+ totalToolCalls?: number;
2159
+ /**
2160
+ * Total tokens (input + output) consumed by the sub-agent
2161
+ */
2162
+ totalTokens?: number;
2163
+ /**
2164
+ * Wall-clock duration of the sub-agent execution in milliseconds
2165
+ */
2166
+ durationMs?: number;
1872
2167
  };
1873
2168
  } | {
1874
2169
  /**
@@ -1888,6 +2183,9 @@ export type SessionEvent = {
1888
2183
  */
1889
2184
  ephemeral?: boolean;
1890
2185
  type: "subagent.failed";
2186
+ /**
2187
+ * Sub-agent failure details including error message and agent information
2188
+ */
1891
2189
  data: {
1892
2190
  /**
1893
2191
  * Tool call ID of the parent tool invocation that spawned this sub-agent
@@ -1905,6 +2203,22 @@ export type SessionEvent = {
1905
2203
  * Error message describing why the sub-agent failed
1906
2204
  */
1907
2205
  error: string;
2206
+ /**
2207
+ * Model used by the sub-agent (if any model calls succeeded before failure)
2208
+ */
2209
+ model?: string;
2210
+ /**
2211
+ * Total number of tool calls made before the sub-agent failed
2212
+ */
2213
+ totalToolCalls?: number;
2214
+ /**
2215
+ * Total tokens (input + output) consumed before the sub-agent failed
2216
+ */
2217
+ totalTokens?: number;
2218
+ /**
2219
+ * Wall-clock duration of the sub-agent execution in milliseconds
2220
+ */
2221
+ durationMs?: number;
1908
2222
  };
1909
2223
  } | {
1910
2224
  /**
@@ -1924,6 +2238,9 @@ export type SessionEvent = {
1924
2238
  */
1925
2239
  ephemeral?: boolean;
1926
2240
  type: "subagent.selected";
2241
+ /**
2242
+ * Custom agent selection details including name and available tools
2243
+ */
1927
2244
  data: {
1928
2245
  /**
1929
2246
  * Internal name of the selected custom agent
@@ -1978,6 +2295,9 @@ export type SessionEvent = {
1978
2295
  */
1979
2296
  ephemeral?: boolean;
1980
2297
  type: "hook.start";
2298
+ /**
2299
+ * Hook invocation start details including type and input data
2300
+ */
1981
2301
  data: {
1982
2302
  /**
1983
2303
  * Unique identifier for this hook invocation
@@ -2012,6 +2332,9 @@ export type SessionEvent = {
2012
2332
  */
2013
2333
  ephemeral?: boolean;
2014
2334
  type: "hook.end";
2335
+ /**
2336
+ * Hook invocation completion details including output, success status, and error information
2337
+ */
2015
2338
  data: {
2016
2339
  /**
2017
2340
  * Identifier matching the corresponding hook.start event
@@ -2063,6 +2386,9 @@ export type SessionEvent = {
2063
2386
  */
2064
2387
  ephemeral?: boolean;
2065
2388
  type: "system.message";
2389
+ /**
2390
+ * System or developer message content with role and optional template metadata
2391
+ */
2066
2392
  data: {
2067
2393
  /**
2068
2394
  * The system or developer prompt text
@@ -2110,6 +2436,9 @@ export type SessionEvent = {
2110
2436
  */
2111
2437
  ephemeral?: boolean;
2112
2438
  type: "system.notification";
2439
+ /**
2440
+ * System-generated notification for runtime events like background task completion
2441
+ */
2113
2442
  data: {
2114
2443
  /**
2115
2444
  * The notification text, typically wrapped in <system_notification> XML tags
@@ -2140,6 +2469,20 @@ export type SessionEvent = {
2140
2469
  * The full prompt given to the background agent
2141
2470
  */
2142
2471
  prompt?: string;
2472
+ } | {
2473
+ type: "agent_idle";
2474
+ /**
2475
+ * Unique identifier of the background agent
2476
+ */
2477
+ agentId: string;
2478
+ /**
2479
+ * Type of the agent (e.g., explore, task, general-purpose)
2480
+ */
2481
+ agentType: string;
2482
+ /**
2483
+ * Human-readable description of the agent task
2484
+ */
2485
+ description?: string;
2143
2486
  } | {
2144
2487
  type: "shell_completed";
2145
2488
  /**
@@ -2181,6 +2524,9 @@ export type SessionEvent = {
2181
2524
  parentId: string | null;
2182
2525
  ephemeral: true;
2183
2526
  type: "permission.requested";
2527
+ /**
2528
+ * Permission request notification requiring client approval with request details
2529
+ */
2184
2530
  data: {
2185
2531
  /**
2186
2532
  * Unique identifier for this permission request; used to respond via session.respondToPermission()
@@ -2378,6 +2724,29 @@ export type SessionEvent = {
2378
2724
  args?: {
2379
2725
  [k: string]: unknown;
2380
2726
  };
2727
+ } | {
2728
+ /**
2729
+ * Permission kind discriminator
2730
+ */
2731
+ kind: "hook";
2732
+ /**
2733
+ * Tool call ID that triggered this permission request
2734
+ */
2735
+ toolCallId?: string;
2736
+ /**
2737
+ * Name of the tool the hook is gating
2738
+ */
2739
+ toolName: string;
2740
+ /**
2741
+ * Arguments of the tool call being gated
2742
+ */
2743
+ toolArgs?: {
2744
+ [k: string]: unknown;
2745
+ };
2746
+ /**
2747
+ * Optional message from the hook explaining why confirmation is needed
2748
+ */
2749
+ hookMessage?: string;
2381
2750
  };
2382
2751
  };
2383
2752
  } | {
@@ -2395,6 +2764,9 @@ export type SessionEvent = {
2395
2764
  parentId: string | null;
2396
2765
  ephemeral: true;
2397
2766
  type: "permission.completed";
2767
+ /**
2768
+ * Permission request completion notification signaling UI dismissal
2769
+ */
2398
2770
  data: {
2399
2771
  /**
2400
2772
  * Request ID of the resolved permission request; clients should dismiss any UI for this request
@@ -2425,6 +2797,9 @@ export type SessionEvent = {
2425
2797
  parentId: string | null;
2426
2798
  ephemeral: true;
2427
2799
  type: "user_input.requested";
2800
+ /**
2801
+ * User input request notification with question and optional predefined choices
2802
+ */
2428
2803
  data: {
2429
2804
  /**
2430
2805
  * Unique identifier for this input request; used to respond via session.respondToUserInput()
@@ -2442,6 +2817,10 @@ export type SessionEvent = {
2442
2817
  * Whether the user can provide a free-form text response in addition to predefined choices
2443
2818
  */
2444
2819
  allowFreeform?: boolean;
2820
+ /**
2821
+ * The LLM-assigned tool call ID that triggered this request; used by remote UIs to correlate responses
2822
+ */
2823
+ toolCallId?: string;
2445
2824
  };
2446
2825
  } | {
2447
2826
  /**
@@ -2458,6 +2837,9 @@ export type SessionEvent = {
2458
2837
  parentId: string | null;
2459
2838
  ephemeral: true;
2460
2839
  type: "user_input.completed";
2840
+ /**
2841
+ * User input request completion notification signaling UI dismissal
2842
+ */
2461
2843
  data: {
2462
2844
  /**
2463
2845
  * Request ID of the resolved user input request; clients should dismiss any UI for this request
@@ -2479,23 +2861,37 @@ export type SessionEvent = {
2479
2861
  parentId: string | null;
2480
2862
  ephemeral: true;
2481
2863
  type: "elicitation.requested";
2864
+ /**
2865
+ * Elicitation request; may be form-based (structured input) or URL-based (browser redirect)
2866
+ */
2482
2867
  data: {
2483
2868
  /**
2484
2869
  * Unique identifier for this elicitation request; used to respond via session.respondToElicitation()
2485
2870
  */
2486
2871
  requestId: string;
2872
+ /**
2873
+ * Tool call ID from the LLM completion; used to correlate with CompletionChunk.toolCall.id for remote UIs
2874
+ */
2875
+ toolCallId?: string;
2876
+ /**
2877
+ * The source that initiated the request (MCP server name, or absent for agent-initiated)
2878
+ */
2879
+ elicitationSource?: string;
2487
2880
  /**
2488
2881
  * Message describing what information is needed from the user
2489
2882
  */
2490
2883
  message: string;
2491
2884
  /**
2492
- * Elicitation mode; currently only "form" is supported. Defaults to "form" when absent.
2885
+ * Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent.
2493
2886
  */
2494
- mode?: "form";
2887
+ mode?: "form" | "url";
2495
2888
  /**
2496
- * JSON Schema describing the form fields to present to the user
2889
+ * JSON Schema describing the form fields to present to the user (form mode only)
2497
2890
  */
2498
- requestedSchema: {
2891
+ requestedSchema?: {
2892
+ /**
2893
+ * Schema type indicator (always 'object')
2894
+ */
2499
2895
  type: "object";
2500
2896
  /**
2501
2897
  * Form field definitions, keyed by field name
@@ -2508,6 +2904,10 @@ export type SessionEvent = {
2508
2904
  */
2509
2905
  required?: string[];
2510
2906
  };
2907
+ /**
2908
+ * URL to open in the user's browser (url mode only)
2909
+ */
2910
+ url?: string;
2511
2911
  [k: string]: unknown;
2512
2912
  };
2513
2913
  } | {
@@ -2525,12 +2925,84 @@ export type SessionEvent = {
2525
2925
  parentId: string | null;
2526
2926
  ephemeral: true;
2527
2927
  type: "elicitation.completed";
2928
+ /**
2929
+ * Elicitation request completion notification signaling UI dismissal
2930
+ */
2528
2931
  data: {
2529
2932
  /**
2530
2933
  * Request ID of the resolved elicitation request; clients should dismiss any UI for this request
2531
2934
  */
2532
2935
  requestId: string;
2533
2936
  };
2937
+ } | {
2938
+ /**
2939
+ * Unique event identifier (UUID v4), generated when the event is emitted
2940
+ */
2941
+ id: string;
2942
+ /**
2943
+ * ISO 8601 timestamp when the event was created
2944
+ */
2945
+ timestamp: string;
2946
+ /**
2947
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
2948
+ */
2949
+ parentId: string | null;
2950
+ ephemeral: true;
2951
+ type: "mcp.oauth_required";
2952
+ /**
2953
+ * OAuth authentication request for an MCP server
2954
+ */
2955
+ data: {
2956
+ /**
2957
+ * Unique identifier for this OAuth request; used to respond via session.respondToMcpOAuth()
2958
+ */
2959
+ requestId: string;
2960
+ /**
2961
+ * Display name of the MCP server that requires OAuth
2962
+ */
2963
+ serverName: string;
2964
+ /**
2965
+ * URL of the MCP server that requires OAuth
2966
+ */
2967
+ serverUrl: string;
2968
+ /**
2969
+ * Static OAuth client configuration, if the server specifies one
2970
+ */
2971
+ staticClientConfig?: {
2972
+ /**
2973
+ * OAuth client ID for the server
2974
+ */
2975
+ clientId: string;
2976
+ /**
2977
+ * Whether this is a public OAuth client
2978
+ */
2979
+ publicClient?: boolean;
2980
+ };
2981
+ };
2982
+ } | {
2983
+ /**
2984
+ * Unique event identifier (UUID v4), generated when the event is emitted
2985
+ */
2986
+ id: string;
2987
+ /**
2988
+ * ISO 8601 timestamp when the event was created
2989
+ */
2990
+ timestamp: string;
2991
+ /**
2992
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
2993
+ */
2994
+ parentId: string | null;
2995
+ ephemeral: true;
2996
+ type: "mcp.oauth_completed";
2997
+ /**
2998
+ * MCP OAuth request completion notification
2999
+ */
3000
+ data: {
3001
+ /**
3002
+ * Request ID of the resolved OAuth request
3003
+ */
3004
+ requestId: string;
3005
+ };
2534
3006
  } | {
2535
3007
  /**
2536
3008
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2546,6 +3018,9 @@ export type SessionEvent = {
2546
3018
  parentId: string | null;
2547
3019
  ephemeral: true;
2548
3020
  type: "external_tool.requested";
3021
+ /**
3022
+ * External tool invocation request for client-side tool execution
3023
+ */
2549
3024
  data: {
2550
3025
  /**
2551
3026
  * Unique identifier for this request; used to respond via session.respondToExternalTool()
@@ -2569,6 +3044,14 @@ export type SessionEvent = {
2569
3044
  arguments?: {
2570
3045
  [k: string]: unknown;
2571
3046
  };
3047
+ /**
3048
+ * W3C Trace Context traceparent header for the execute_tool span
3049
+ */
3050
+ traceparent?: string;
3051
+ /**
3052
+ * W3C Trace Context tracestate header for the execute_tool span
3053
+ */
3054
+ tracestate?: string;
2572
3055
  };
2573
3056
  } | {
2574
3057
  /**
@@ -2585,6 +3068,9 @@ export type SessionEvent = {
2585
3068
  parentId: string | null;
2586
3069
  ephemeral: true;
2587
3070
  type: "external_tool.completed";
3071
+ /**
3072
+ * External tool completion notification signaling UI dismissal
3073
+ */
2588
3074
  data: {
2589
3075
  /**
2590
3076
  * Request ID of the resolved external tool request; clients should dismiss any UI for this request
@@ -2606,6 +3092,9 @@ export type SessionEvent = {
2606
3092
  parentId: string | null;
2607
3093
  ephemeral: true;
2608
3094
  type: "command.queued";
3095
+ /**
3096
+ * Queued slash command dispatch request for client execution
3097
+ */
2609
3098
  data: {
2610
3099
  /**
2611
3100
  * Unique identifier for this request; used to respond via session.respondToQueuedCommand()
@@ -2616,6 +3105,42 @@ export type SessionEvent = {
2616
3105
  */
2617
3106
  command: string;
2618
3107
  };
3108
+ } | {
3109
+ /**
3110
+ * Unique event identifier (UUID v4), generated when the event is emitted
3111
+ */
3112
+ id: string;
3113
+ /**
3114
+ * ISO 8601 timestamp when the event was created
3115
+ */
3116
+ timestamp: string;
3117
+ /**
3118
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3119
+ */
3120
+ parentId: string | null;
3121
+ ephemeral: true;
3122
+ type: "command.execute";
3123
+ /**
3124
+ * Registered command dispatch request routed to the owning client
3125
+ */
3126
+ data: {
3127
+ /**
3128
+ * Unique identifier; used to respond via session.commands.handlePendingCommand()
3129
+ */
3130
+ requestId: string;
3131
+ /**
3132
+ * The full command text (e.g., /deploy production)
3133
+ */
3134
+ command: string;
3135
+ /**
3136
+ * Command name without leading /
3137
+ */
3138
+ commandName: string;
3139
+ /**
3140
+ * Raw argument string after the command name
3141
+ */
3142
+ args: string;
3143
+ };
2619
3144
  } | {
2620
3145
  /**
2621
3146
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2631,12 +3156,42 @@ export type SessionEvent = {
2631
3156
  parentId: string | null;
2632
3157
  ephemeral: true;
2633
3158
  type: "command.completed";
3159
+ /**
3160
+ * Queued command completion notification signaling UI dismissal
3161
+ */
2634
3162
  data: {
2635
3163
  /**
2636
3164
  * Request ID of the resolved command request; clients should dismiss any UI for this request
2637
3165
  */
2638
3166
  requestId: string;
2639
3167
  };
3168
+ } | {
3169
+ /**
3170
+ * Unique event identifier (UUID v4), generated when the event is emitted
3171
+ */
3172
+ id: string;
3173
+ /**
3174
+ * ISO 8601 timestamp when the event was created
3175
+ */
3176
+ timestamp: string;
3177
+ /**
3178
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3179
+ */
3180
+ parentId: string | null;
3181
+ ephemeral: true;
3182
+ type: "commands.changed";
3183
+ /**
3184
+ * SDK command registration change notification
3185
+ */
3186
+ data: {
3187
+ /**
3188
+ * Current list of registered SDK commands
3189
+ */
3190
+ commands: {
3191
+ name: string;
3192
+ description?: string;
3193
+ }[];
3194
+ };
2640
3195
  } | {
2641
3196
  /**
2642
3197
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2652,6 +3207,9 @@ export type SessionEvent = {
2652
3207
  parentId: string | null;
2653
3208
  ephemeral: true;
2654
3209
  type: "exit_plan_mode.requested";
3210
+ /**
3211
+ * Plan approval request with plan content and available user actions
3212
+ */
2655
3213
  data: {
2656
3214
  /**
2657
3215
  * Unique identifier for this request; used to respond via session.respondToExitPlanMode()
@@ -2689,10 +3247,256 @@ export type SessionEvent = {
2689
3247
  parentId: string | null;
2690
3248
  ephemeral: true;
2691
3249
  type: "exit_plan_mode.completed";
3250
+ /**
3251
+ * Plan mode exit completion notification signaling UI dismissal
3252
+ */
2692
3253
  data: {
2693
3254
  /**
2694
3255
  * Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request
2695
3256
  */
2696
3257
  requestId: string;
2697
3258
  };
3259
+ } | {
3260
+ /**
3261
+ * Unique event identifier (UUID v4), generated when the event is emitted
3262
+ */
3263
+ id: string;
3264
+ /**
3265
+ * ISO 8601 timestamp when the event was created
3266
+ */
3267
+ timestamp: string;
3268
+ /**
3269
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3270
+ */
3271
+ parentId: string | null;
3272
+ ephemeral: true;
3273
+ type: "session.tools_updated";
3274
+ data: {
3275
+ model: string;
3276
+ };
3277
+ } | {
3278
+ /**
3279
+ * Unique event identifier (UUID v4), generated when the event is emitted
3280
+ */
3281
+ id: string;
3282
+ /**
3283
+ * ISO 8601 timestamp when the event was created
3284
+ */
3285
+ timestamp: string;
3286
+ /**
3287
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3288
+ */
3289
+ parentId: string | null;
3290
+ ephemeral: true;
3291
+ type: "session.background_tasks_changed";
3292
+ data: {};
3293
+ } | {
3294
+ /**
3295
+ * Unique event identifier (UUID v4), generated when the event is emitted
3296
+ */
3297
+ id: string;
3298
+ /**
3299
+ * ISO 8601 timestamp when the event was created
3300
+ */
3301
+ timestamp: string;
3302
+ /**
3303
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3304
+ */
3305
+ parentId: string | null;
3306
+ ephemeral: true;
3307
+ type: "session.skills_loaded";
3308
+ data: {
3309
+ /**
3310
+ * Array of resolved skill metadata
3311
+ */
3312
+ skills: {
3313
+ /**
3314
+ * Unique identifier for the skill
3315
+ */
3316
+ name: string;
3317
+ /**
3318
+ * Description of what the skill does
3319
+ */
3320
+ description: string;
3321
+ /**
3322
+ * Source location type of the skill (e.g., project, personal, plugin)
3323
+ */
3324
+ source: string;
3325
+ /**
3326
+ * Whether the skill can be invoked by the user as a slash command
3327
+ */
3328
+ userInvocable: boolean;
3329
+ /**
3330
+ * Whether the skill is currently enabled
3331
+ */
3332
+ enabled: boolean;
3333
+ /**
3334
+ * Absolute path to the skill file, if available
3335
+ */
3336
+ path?: string;
3337
+ }[];
3338
+ };
3339
+ } | {
3340
+ /**
3341
+ * Unique event identifier (UUID v4), generated when the event is emitted
3342
+ */
3343
+ id: string;
3344
+ /**
3345
+ * ISO 8601 timestamp when the event was created
3346
+ */
3347
+ timestamp: string;
3348
+ /**
3349
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3350
+ */
3351
+ parentId: string | null;
3352
+ ephemeral: true;
3353
+ type: "session.custom_agents_updated";
3354
+ data: {
3355
+ /**
3356
+ * Array of loaded custom agent metadata
3357
+ */
3358
+ agents: {
3359
+ /**
3360
+ * Unique identifier for the agent
3361
+ */
3362
+ id: string;
3363
+ /**
3364
+ * Internal name of the agent
3365
+ */
3366
+ name: string;
3367
+ /**
3368
+ * Human-readable display name
3369
+ */
3370
+ displayName: string;
3371
+ /**
3372
+ * Description of what the agent does
3373
+ */
3374
+ description: string;
3375
+ /**
3376
+ * Source location: user, project, inherited, remote, or plugin
3377
+ */
3378
+ source: string;
3379
+ /**
3380
+ * List of tool names available to this agent
3381
+ */
3382
+ tools: string[];
3383
+ /**
3384
+ * Whether the agent can be selected by the user
3385
+ */
3386
+ userInvocable: boolean;
3387
+ /**
3388
+ * Model override for this agent, if set
3389
+ */
3390
+ model?: string;
3391
+ }[];
3392
+ /**
3393
+ * Non-fatal warnings from agent loading
3394
+ */
3395
+ warnings: string[];
3396
+ /**
3397
+ * Fatal errors from agent loading
3398
+ */
3399
+ errors: string[];
3400
+ };
3401
+ } | {
3402
+ /**
3403
+ * Unique event identifier (UUID v4), generated when the event is emitted
3404
+ */
3405
+ id: string;
3406
+ /**
3407
+ * ISO 8601 timestamp when the event was created
3408
+ */
3409
+ timestamp: string;
3410
+ /**
3411
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3412
+ */
3413
+ parentId: string | null;
3414
+ ephemeral: true;
3415
+ type: "session.mcp_servers_loaded";
3416
+ data: {
3417
+ /**
3418
+ * Array of MCP server status summaries
3419
+ */
3420
+ servers: {
3421
+ /**
3422
+ * Server name (config key)
3423
+ */
3424
+ name: string;
3425
+ /**
3426
+ * Connection status: connected, failed, pending, disabled, or not_configured
3427
+ */
3428
+ status: "connected" | "failed" | "pending" | "disabled" | "not_configured";
3429
+ /**
3430
+ * Configuration source: user, workspace, plugin, or builtin
3431
+ */
3432
+ source?: string;
3433
+ /**
3434
+ * Error message if the server failed to connect
3435
+ */
3436
+ error?: string;
3437
+ }[];
3438
+ };
3439
+ } | {
3440
+ /**
3441
+ * Unique event identifier (UUID v4), generated when the event is emitted
3442
+ */
3443
+ id: string;
3444
+ /**
3445
+ * ISO 8601 timestamp when the event was created
3446
+ */
3447
+ timestamp: string;
3448
+ /**
3449
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3450
+ */
3451
+ parentId: string | null;
3452
+ ephemeral: true;
3453
+ type: "session.mcp_server_status_changed";
3454
+ data: {
3455
+ /**
3456
+ * Name of the MCP server whose status changed
3457
+ */
3458
+ serverName: string;
3459
+ /**
3460
+ * New connection status: connected, failed, pending, disabled, or not_configured
3461
+ */
3462
+ status: "connected" | "failed" | "pending" | "disabled" | "not_configured";
3463
+ };
3464
+ } | {
3465
+ /**
3466
+ * Unique event identifier (UUID v4), generated when the event is emitted
3467
+ */
3468
+ id: string;
3469
+ /**
3470
+ * ISO 8601 timestamp when the event was created
3471
+ */
3472
+ timestamp: string;
3473
+ /**
3474
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3475
+ */
3476
+ parentId: string | null;
3477
+ ephemeral: true;
3478
+ type: "session.extensions_loaded";
3479
+ data: {
3480
+ /**
3481
+ * Array of discovered extensions and their status
3482
+ */
3483
+ extensions: {
3484
+ /**
3485
+ * Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper')
3486
+ */
3487
+ id: string;
3488
+ /**
3489
+ * Extension name (directory name)
3490
+ */
3491
+ name: string;
3492
+ /**
3493
+ * Discovery source
3494
+ */
3495
+ source: "project" | "user";
3496
+ /**
3497
+ * Current status: running, disabled, failed, or starting
3498
+ */
3499
+ status: "running" | "disabled" | "failed" | "starting";
3500
+ }[];
3501
+ };
2698
3502
  };