2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
// allow-any-unicode-comment-file
7
>
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
8
>
9
>
// Generated from types/actions.ts — do not edit
10
>
// Run `npm run generate` to regenerate.
11
>
12
>
import { ActionType, type StateAction, type RootAgentsChangedAction, type RootActiveSessionsChangedAction, type RootTerminalsChangedAction, type RootConfigChangedAction, type SessionReadyAction, type SessionCreationFailedAction, type SessionChatAddedAction, type SessionChatRemovedAction, type SessionChatUpdatedAction, type SessionDefaultChatChangedAction, type SessionTitleChangedAction, type SessionServerToolsChangedAction, type SessionActiveClientSetAction, type SessionActiveClientRemovedAction, type SessionWorkingDirectorySetAction, type SessionWorkingDirectoryRemovedAction, type SessionInputNeededSetAction, type SessionInputNeededRemovedAction, type SessionCustomizationsChangedAction, type SessionCustomizationToggledAction, type SessionCustomizationUpdatedAction, type SessionCustomizationRemovedAction, type SessionMcpServerStateChangedAction, type SessionMcpServerStartRequestedAction, type SessionMcpServerStopRequestedAction, type SessionIsReadChangedAction, type SessionIsArchivedChangedAction, type SessionActivityChangedAction, type SessionChangesetsChangedAction, type SessionConfigChangedAction, type SessionMetaChangedAction, type ChatTurnStartedAction, type ChatDeltaAction, type ChatResponsePartAction, type ChatToolCallStartAction, type ChatToolCallDeltaAction, type ChatToolCallReadyAction, type ChatToolCallConfirmedAction, type ChatToolCallCompleteAction, type ChatToolCallResultConfirmedAction, type ChatToolCallContentChangedAction, type ChatToolCallAuthRequiredAction, type ChatToolCallAuthResolvedAction, type ChatTurnCompleteAction, type ChatTurnCancelledAction, type ChatErrorAction, type ChatActivityChangedAction, type ChatWorkingDirectorySetAction, type ChatWorkingDirectoryRemovedAction, type ChatUsageAction, type ChatReasoningAction, type ChatPendingMessageSetAction, type ChatPendingMessageRemovedAction, type ChatQueuedMessagesReorderedAction, type ChatDraftChangedAction, type ChatInputRequestedAction, type ChatInputAnswerChangedAction, type ChatInputCompletedAction, type ChatTruncatedAction, type ChatTurnsLoadedAction, type ChangesetStatusChangedAction, type ChangesetFileSetAction, type ChangesetFileRemovedAction, type ChangesetFilesReviewChangedAction, type ChangesetContentChangedAction, type ChangesetOperationsChangedAction, type ChangesetOperationStatusChangedAction, type ChangesetClearedAction, type AnnotationsSetAction, type AnnotationsUpdatedAction, type AnnotationsRemovedAction, type AnnotationsEntrySetAction, type AnnotationsEntryRemovedAction, type TerminalDataAction, type TerminalInputAction, type TerminalResizedAction, type TerminalClaimedAction, type TerminalTitleChangedAction, type TerminalCwdChangedAction, type TerminalExitedAction, type TerminalClearedAction, type TerminalCommandDetectionAvailableAction, type TerminalCommandExecutedAction, type TerminalCommandFinishedAction, type ResourceWatchChangedAction } from './actions.js';
13
>
14
>
15
>
// ─── Root vs Session vs Chat vs Terminal vs Changeset Action Unions ─────────────────
16
>
17
>
/** Union of all root-scoped actions. */
18
>
export type RootAction =
19
>
| RootAgentsChangedAction
20
>
| RootActiveSessionsChangedAction
21
>
| RootTerminalsChangedAction
22
>
| RootConfigChangedAction
23
>
;
24
>
25
>
/** Union of root actions that clients may dispatch. */
26
>
export type ClientRootAction =
27
>
| RootConfigChangedAction
28
>
;
29
>
30
>
/** Union of root actions that only the server may produce. */
31
>
export type ServerRootAction =
32
>
| RootAgentsChangedAction
33
>
| RootActiveSessionsChangedAction
34
>
| RootTerminalsChangedAction
35
>
;
36
>
37
>
/** Union of all session-scoped actions. */
38
>
export type SessionAction =
39
>
| SessionReadyAction
40
>
| SessionCreationFailedAction
41
>
| SessionChatAddedAction
42
>
| SessionChatRemovedAction
43
>
| SessionChatUpdatedAction
44
>
| SessionDefaultChatChangedAction
45
>
| SessionTitleChangedAction
46
>
| SessionServerToolsChangedAction
47
>
| SessionActiveClientSetAction
48
>
| SessionActiveClientRemovedAction
49
>
| SessionWorkingDirectorySetAction
50
>
| SessionWorkingDirectoryRemovedAction
51
>
| SessionInputNeededSetAction
52
>
| SessionInputNeededRemovedAction
53
>
| SessionCustomizationsChangedAction
54
>
| SessionCustomizationToggledAction
55
>
| SessionCustomizationUpdatedAction
56
>
| SessionCustomizationRemovedAction
57
>
| SessionMcpServerStateChangedAction
58
>
| SessionMcpServerStartRequestedAction
59
>
| SessionMcpServerStopRequestedAction
60
>
| SessionIsReadChangedAction
61
>
| SessionIsArchivedChangedAction
62
>
| SessionActivityChangedAction
63
>
| SessionChangesetsChangedAction
64
>
| SessionConfigChangedAction
65
>
| SessionMetaChangedAction
66
>
;
67
>
68
>
/** Union of session actions that clients may dispatch. */
69
>
export type ClientSessionAction =
70
>
| SessionTitleChangedAction
71
>
| SessionActiveClientSetAction
72
>
| SessionActiveClientRemovedAction
73
>
| SessionWorkingDirectorySetAction
74
>
| SessionWorkingDirectoryRemovedAction
75
>
| SessionCustomizationToggledAction
76
>
| SessionMcpServerStartRequestedAction
77
>
| SessionMcpServerStopRequestedAction
78
>
| SessionIsReadChangedAction
79
>
| SessionIsArchivedChangedAction
80
>
| SessionConfigChangedAction
81
>
;
82
>
83
>
/** Union of session actions that only the server may produce. */
84
>
export type ServerSessionAction =
85
>
| SessionReadyAction
86
>
| SessionCreationFailedAction
87
>
| SessionChatAddedAction
88
>
| SessionChatRemovedAction
89
>
| SessionChatUpdatedAction
90
>
| SessionDefaultChatChangedAction
91
>
| SessionServerToolsChangedAction
92
>
| SessionInputNeededSetAction
93
>
| SessionInputNeededRemovedAction
94
>
| SessionCustomizationsChangedAction
95
>
| SessionCustomizationUpdatedAction
96
>
| SessionCustomizationRemovedAction
97
>
| SessionMcpServerStateChangedAction
98
>
| SessionActivityChangedAction
99
>
| SessionChangesetsChangedAction
100
>
| SessionMetaChangedAction
101
>
;
102
>
103
>
/** Union of all chat-scoped actions. */
104
>
export type ChatAction =
105
>
| ChatTurnStartedAction
106
>
| ChatDeltaAction
107
>
| ChatResponsePartAction
108
>
| ChatToolCallStartAction
109
>
| ChatToolCallDeltaAction
110
>
| ChatToolCallReadyAction
111
>
| ChatToolCallConfirmedAction
112
>
| ChatToolCallCompleteAction
113
>
| ChatToolCallResultConfirmedAction
114
>
| ChatToolCallContentChangedAction
115
>
| ChatToolCallAuthRequiredAction
116
>
| ChatToolCallAuthResolvedAction
117
>
| ChatTurnCompleteAction
118
>
| ChatTurnCancelledAction
119
>
| ChatErrorAction
120
>
| ChatActivityChangedAction
121
>
| ChatWorkingDirectorySetAction
122
>
| ChatWorkingDirectoryRemovedAction
123
>
| ChatUsageAction
124
>
| ChatReasoningAction
125
>
| ChatPendingMessageSetAction
126
>
| ChatPendingMessageRemovedAction
127
>
| ChatQueuedMessagesReorderedAction
128
>
| ChatDraftChangedAction
129
>
| ChatInputRequestedAction
130
>
| ChatInputAnswerChangedAction
131
>
| ChatInputCompletedAction
132
>
| ChatTruncatedAction
133
>
| ChatTurnsLoadedAction
134
>
;
135
>
136
>
/** Union of chat actions that clients may dispatch. */
137
>
export type ClientChatAction =
138
>
| ChatTurnStartedAction
139
>
| ChatToolCallConfirmedAction
140
>
| ChatToolCallCompleteAction
141
>
| ChatToolCallResultConfirmedAction
142
>
| ChatToolCallContentChangedAction
143
>
| ChatTurnCancelledAction
144
>
| ChatWorkingDirectorySetAction
145
>
| ChatWorkingDirectoryRemovedAction
146
>
| ChatPendingMessageSetAction
147
>
| ChatPendingMessageRemovedAction
148
>
| ChatQueuedMessagesReorderedAction
149
>
| ChatDraftChangedAction
150
>
| ChatInputAnswerChangedAction
151
>
| ChatInputCompletedAction
152
>
| ChatTruncatedAction
153
>
;
154
>
155
>
/** Union of chat actions that only the server may produce. */
156
>
export type ServerChatAction =
157
>
| ChatDeltaAction
158
>
| ChatResponsePartAction
159
>
| ChatToolCallStartAction
160
>
| ChatToolCallDeltaAction
161
>
| ChatToolCallReadyAction
162
>
| ChatToolCallAuthRequiredAction
163
>
| ChatToolCallAuthResolvedAction
164
>
| ChatTurnCompleteAction
165
>
| ChatErrorAction
166
>
| ChatActivityChangedAction
167
>
| ChatUsageAction
168
>
| ChatReasoningAction
169
>
| ChatInputRequestedAction
170
>
| ChatTurnsLoadedAction
171
>
;
172
>
173
>
/** Union of all terminal-scoped actions. */
174
>
export type TerminalAction =
175
>
| TerminalDataAction
176
>
| TerminalInputAction
177
>
| TerminalResizedAction
178
>
| TerminalClaimedAction
179
>
| TerminalTitleChangedAction
180
>
| TerminalCwdChangedAction
181
>
| TerminalExitedAction
182
>
| TerminalClearedAction
183
>
| TerminalCommandDetectionAvailableAction
184
>
| TerminalCommandExecutedAction
185
>
| TerminalCommandFinishedAction
186
>
;
187
>
188
>
/** Union of terminal actions that clients may dispatch. */
189
>
export type ClientTerminalAction =
190
>
| TerminalInputAction
191
>
| TerminalResizedAction
192
>
| TerminalClaimedAction
193
>
| TerminalTitleChangedAction
194
>
| TerminalClearedAction
195
>
;
196
>
197
>
/** Union of terminal actions that only the server may produce. */
198
>
export type ServerTerminalAction =
199
>
| TerminalDataAction
200
>
| TerminalCwdChangedAction
201
>
| TerminalExitedAction
202
>
| TerminalCommandDetectionAvailableAction
203
>
| TerminalCommandExecutedAction
204
>
| TerminalCommandFinishedAction
205
>
;
206
>
207
>
/** Union of all changeset-scoped actions. */
208
>
export type ChangesetAction =
209
>
| ChangesetStatusChangedAction
210
>
| ChangesetFileSetAction
211
>
| ChangesetFileRemovedAction
212
>
| ChangesetFilesReviewChangedAction
213
>
| ChangesetContentChangedAction
214
>
| ChangesetOperationsChangedAction
215
>
| ChangesetOperationStatusChangedAction
216
>
| ChangesetClearedAction
217
>
;
218
>
219
>
/** Union of changeset actions that clients may dispatch. */
220
>
export type ClientChangesetAction =
221
>
| ChangesetFilesReviewChangedAction
222
>
;
223
>
224
>
/** Union of changeset actions that only the server may produce. */
225
>
export type ServerChangesetAction =
226
>
| ChangesetStatusChangedAction
227
>
| ChangesetFileSetAction
228
>
| ChangesetFileRemovedAction
229
>
| ChangesetContentChangedAction
230
>
| ChangesetOperationsChangedAction
231
>
| ChangesetOperationStatusChangedAction
232
>
| ChangesetClearedAction
233
>
;
234
>
235
>
/** Union of all annotations-scoped actions. */
236
>
export type AnnotationsAction =
237
>
| AnnotationsSetAction
238
>
| AnnotationsUpdatedAction
239
>
| AnnotationsRemovedAction
240
>
| AnnotationsEntrySetAction
241
>
| AnnotationsEntryRemovedAction
242
>
;
243
>
244
>
/** Union of annotations actions that clients may dispatch. */
245
>
export type ClientAnnotationsAction =
246
>
| AnnotationsSetAction
247
>
| AnnotationsUpdatedAction
248
>
| AnnotationsRemovedAction
249
>
| AnnotationsEntrySetAction
250
>
| AnnotationsEntryRemovedAction
251
>
;
252
>
253
>
/** Union of annotations actions that only the server may produce. */
254
>
export type ServerAnnotationsAction =
255
>
never
256
>
;
257
>
258
>
/** Union of all resource-watch-scoped actions. */
259
>
export type ResourceWatchAction =
260
>
| ResourceWatchChangedAction
261
>
;
262
>
263
>
/** Union of resource-watch actions that clients may dispatch. */
264
>
export type ClientResourceWatchAction =
265
>
never
266
>
;
267
>
268
>
/** Union of resource-watch actions that only the server may produce. */
269
>
export type ServerResourceWatchAction =
270
>
| ResourceWatchChangedAction
271
>
;
272
>
273
>
// ─── Client-Dispatchable Map ─────────────────────────────────────────────────
274
>
275
>
/**
276
>
* Exhaustive map indicating which action types may be dispatched by clients.
277
>
* Adding a new action to StateAction without adding it here is a compile error.
278
>
*/
279
>
export const IS_CLIENT_DISPATCHABLE: { readonly [K in StateAction['type']]: boolean } = {
280
>
[ActionType.RootAgentsChanged]: false,
281
>
[ActionType.RootActiveSessionsChanged]: false,
282
>
[ActionType.RootTerminalsChanged]: false,
283
>
[ActionType.RootConfigChanged]: true,
284
>
[ActionType.SessionReady]: false,
285
>
[ActionType.SessionCreationFailed]: false,
286
>
[ActionType.SessionChatAdded]: false,
287
>
[ActionType.SessionChatRemoved]: false,
288
>
[ActionType.SessionChatUpdated]: false,
289
>
[ActionType.SessionDefaultChatChanged]: false,
290
>
[ActionType.SessionTitleChanged]: true,
291
>
[ActionType.SessionServerToolsChanged]: false,
292
>
[ActionType.SessionActiveClientSet]: true,
293
>
[ActionType.SessionActiveClientRemoved]: true,
294
>
[ActionType.SessionWorkingDirectorySet]: true,
295
>
[ActionType.SessionWorkingDirectoryRemoved]: true,
296
>
[ActionType.SessionInputNeededSet]: false,
297
>
[ActionType.SessionInputNeededRemoved]: false,
298
>
[ActionType.SessionCustomizationsChanged]: false,
299
>
[ActionType.SessionCustomizationToggled]: true,
300
>
[ActionType.SessionCustomizationUpdated]: false,
301
>
[ActionType.SessionCustomizationRemoved]: false,
302
>
[ActionType.SessionMcpServerStateChanged]: false,
303
>
[ActionType.SessionMcpServerStartRequested]: true,
304
>
[ActionType.SessionMcpServerStopRequested]: true,
305
>
[ActionType.SessionIsReadChanged]: true,
306
>
[ActionType.SessionIsArchivedChanged]: true,
307
>
[ActionType.SessionActivityChanged]: false,
308
>
[ActionType.SessionChangesetsChanged]: false,
309
>
[ActionType.SessionConfigChanged]: true,
310
>
[ActionType.SessionMetaChanged]: false,
311
>
[ActionType.ChatTurnStarted]: true,
312
>
[ActionType.ChatDelta]: false,
313
>
[ActionType.ChatResponsePart]: false,
314
>
[ActionType.ChatToolCallStart]: false,
315
>
[ActionType.ChatToolCallDelta]: false,
316
>
[ActionType.ChatToolCallReady]: false,
317
>
[ActionType.ChatToolCallConfirmed]: true,
318
>
[ActionType.ChatToolCallComplete]: true,
319
>
[ActionType.ChatToolCallResultConfirmed]: true,
320
>
[ActionType.ChatToolCallContentChanged]: true,
321
>
[ActionType.ChatToolCallAuthRequired]: false,
322
>
[ActionType.ChatToolCallAuthResolved]: false,
323
>
[ActionType.ChatTurnComplete]: false,
324
>
[ActionType.ChatTurnCancelled]: true,
325
>
[ActionType.ChatError]: false,
326
>
[ActionType.ChatActivityChanged]: false,
327
>
[ActionType.ChatWorkingDirectorySet]: true,
328
>
[ActionType.ChatWorkingDirectoryRemoved]: true,
329
>
[ActionType.ChatUsage]: false,
330
>
[ActionType.ChatReasoning]: false,
331
>
[ActionType.ChatPendingMessageSet]: true,
332
>
[ActionType.ChatPendingMessageRemoved]: true,
333
>
[ActionType.ChatQueuedMessagesReordered]: true,
334
>
[ActionType.ChatDraftChanged]: true,
335
>
[ActionType.ChatInputRequested]: false,
336
>
[ActionType.ChatInputAnswerChanged]: true,
337
>
[ActionType.ChatInputCompleted]: true,
338
>
[ActionType.ChatTruncated]: true,
339
>
[ActionType.ChatTurnsLoaded]: false,
340
>
[ActionType.ChangesetStatusChanged]: false,
341
>
[ActionType.ChangesetFileSet]: false,
342
>
[ActionType.ChangesetFileRemoved]: false,
343
>
[ActionType.ChangesetFilesReviewChanged]: true,
344
>
[ActionType.ChangesetContentChanged]: false,
345
>
[ActionType.ChangesetOperationsChanged]: false,
346
>
[ActionType.ChangesetOperationStatusChanged]: false,
347
>
[ActionType.ChangesetCleared]: false,
348
>
[ActionType.AnnotationsSet]: true,
349
>
[ActionType.AnnotationsUpdated]: true,
350
>
[ActionType.AnnotationsRemoved]: true,
351
>
[ActionType.AnnotationsEntrySet]: true,
352
>
[ActionType.AnnotationsEntryRemoved]: true,
353
>
[ActionType.TerminalData]: false,
354
>
[ActionType.TerminalInput]: true,
355
>
[ActionType.TerminalResized]: true,
356
>
[ActionType.TerminalClaimed]: true,
357
>
[ActionType.TerminalTitleChanged]: true,
358
>
[ActionType.TerminalCwdChanged]: false,
359
>
[ActionType.TerminalExited]: false,
360
>
[ActionType.TerminalCleared]: true,
361
>
[ActionType.TerminalCommandDetectionAvailable]: false,
362
>
[ActionType.TerminalCommandExecuted]: false,
363
>
[ActionType.TerminalCommandFinished]: false,
364
>
[ActionType.ResourceWatchChanged]: false,
365
>
};