@github/copilot-sdk 0.2.2 → 0.3.0-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.
@@ -3,407 +3,671 @@
3
3
  * Generated from: api.schema.json
4
4
  */
5
5
  import type { MessageConnection } from "vscode-jsonrpc/node.js";
6
- export interface PingResult {
6
+ /**
7
+ * Server transport type: stdio, http, sse, or memory (local configs are normalized to stdio)
8
+ *
9
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
10
+ * via the `definition` "DiscoveredMcpServerType".
11
+ */
12
+ export type DiscoveredMcpServerType = "stdio" | "http" | "sse" | "memory";
13
+ /**
14
+ * Configuration source
15
+ *
16
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
17
+ * via the `definition` "DiscoveredMcpServerSource".
18
+ */
19
+ export type DiscoveredMcpServerSource = "user" | "workspace" | "plugin" | "builtin";
20
+ /**
21
+ * Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/)
22
+ *
23
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
24
+ * via the `definition` "ExtensionSource".
25
+ */
26
+ export type ExtensionSource = "project" | "user";
27
+ /**
28
+ * Current status: running, disabled, failed, or starting
29
+ *
30
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
31
+ * via the `definition` "ExtensionStatus".
32
+ */
33
+ export type ExtensionStatus = "running" | "disabled" | "failed" | "starting";
34
+ export type FilterMapping = {
35
+ [k: string]: FilterMappingValue;
36
+ } | FilterMappingString;
37
+ export type FilterMappingValue = "none" | "markdown" | "hidden_characters";
38
+ export type FilterMappingString = "none" | "markdown" | "hidden_characters";
39
+ /**
40
+ * Category of instruction source — used for merge logic
41
+ *
42
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
43
+ * via the `definition` "InstructionsSourcesType".
44
+ */
45
+ export type InstructionsSourcesType = "home" | "repo" | "model" | "vscode" | "nested-agents" | "child-instructions";
46
+ /**
47
+ * Where this source lives — used for UI grouping
48
+ *
49
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
50
+ * via the `definition` "InstructionsSourcesLocation".
51
+ */
52
+ export type InstructionsSourcesLocation = "user" | "repository" | "working-directory";
53
+ /**
54
+ * Log severity level. Determines how the message is displayed in the timeline. Defaults to "info".
55
+ *
56
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
57
+ * via the `definition` "SessionLogLevel".
58
+ */
59
+ export type SessionLogLevel = "info" | "warning" | "error";
60
+ /**
61
+ * MCP server configuration (local/stdio or remote/http)
62
+ *
63
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
64
+ * via the `definition` "McpServerConfig".
65
+ */
66
+ export type McpServerConfig = McpServerConfigLocal | McpServerConfigHttp;
67
+ export type McpServerConfigLocalType = "local" | "stdio";
68
+ /**
69
+ * Remote transport type. Defaults to "http" when omitted.
70
+ *
71
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
72
+ * via the `definition` "McpServerConfigHttpType".
73
+ */
74
+ export type McpServerConfigHttpType = "http" | "sse";
75
+ /**
76
+ * Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
77
+ *
78
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
79
+ * via the `definition` "McpServerStatus".
80
+ */
81
+ export type McpServerStatus = "connected" | "failed" | "needs-auth" | "pending" | "disabled" | "not_configured";
82
+ /**
83
+ * Configuration source: user, workspace, plugin, or builtin
84
+ *
85
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
86
+ * via the `definition` "McpServerSource".
87
+ */
88
+ export type McpServerSource = "user" | "workspace" | "plugin" | "builtin";
89
+ /**
90
+ * The agent mode. Valid values: "interactive", "plan", "autopilot".
91
+ *
92
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
93
+ * via the `definition` "SessionMode".
94
+ */
95
+ export type SessionMode = "interactive" | "plan" | "autopilot";
96
+ export type PermissionDecision = PermissionDecisionApproved | PermissionDecisionDeniedByRules | PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser | PermissionDecisionDeniedInteractivelyByUser | PermissionDecisionDeniedByContentExclusionPolicy | PermissionDecisionDeniedByPermissionRequestHook;
97
+ /**
98
+ * Error classification
99
+ *
100
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
101
+ * via the `definition` "SessionFsErrorCode".
102
+ */
103
+ export type SessionFsErrorCode = "ENOENT" | "UNKNOWN";
104
+ /**
105
+ * Entry type
106
+ *
107
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
108
+ * via the `definition` "SessionFsReaddirWithTypesEntryType".
109
+ */
110
+ export type SessionFsReaddirWithTypesEntryType = "file" | "directory";
111
+ /**
112
+ * Path conventions used by this filesystem
113
+ *
114
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
115
+ * via the `definition` "SessionFsSetProviderConventions".
116
+ */
117
+ export type SessionFsSetProviderConventions = "windows" | "posix";
118
+ /**
119
+ * Signal to send (default: SIGTERM)
120
+ *
121
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
122
+ * via the `definition` "ShellKillSignal".
123
+ */
124
+ export type ShellKillSignal = "SIGTERM" | "SIGKILL" | "SIGINT";
125
+ /**
126
+ * Tool call result (string or expanded result object)
127
+ *
128
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
129
+ * via the `definition` "ToolsHandlePendingToolCall".
130
+ */
131
+ export type ToolsHandlePendingToolCall = string | ToolCallResult;
132
+ export type UIElicitationFieldValue = string | number | boolean | string[];
133
+ export type UIElicitationSchemaProperty = UIElicitationStringEnumField | UIElicitationStringOneOfField | UIElicitationArrayEnumField | UIElicitationArrayAnyOfField | UIElicitationSchemaPropertyBoolean | UIElicitationSchemaPropertyString | UIElicitationSchemaPropertyNumber;
134
+ export type UIElicitationSchemaPropertyStringFormat = "email" | "uri" | "date" | "date-time";
135
+ export type UIElicitationSchemaPropertyNumberType = "number" | "integer";
136
+ /**
137
+ * The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
138
+ *
139
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
140
+ * via the `definition` "UIElicitationResponseAction".
141
+ */
142
+ export type UIElicitationResponseAction = "accept" | "decline" | "cancel";
143
+ export interface AccountGetQuotaResult {
7
144
  /**
8
- * Echoed message (or default greeting)
145
+ * Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)
9
146
  */
10
- message: string;
147
+ quotaSnapshots: {
148
+ [k: string]: AccountQuotaSnapshot;
149
+ };
150
+ }
151
+ export interface AccountQuotaSnapshot {
11
152
  /**
12
- * Server timestamp in milliseconds
153
+ * Whether the user has an unlimited usage entitlement
13
154
  */
14
- timestamp: number;
155
+ isUnlimitedEntitlement: boolean;
15
156
  /**
16
- * Server protocol version number
157
+ * Number of requests included in the entitlement
17
158
  */
18
- protocolVersion: number;
159
+ entitlementRequests: number;
160
+ /**
161
+ * Number of requests used so far this period
162
+ */
163
+ usedRequests: number;
164
+ /**
165
+ * Whether usage is still permitted after quota exhaustion
166
+ */
167
+ usageAllowedWithExhaustedQuota: boolean;
168
+ /**
169
+ * Percentage of entitlement remaining
170
+ */
171
+ remainingPercentage: number;
172
+ /**
173
+ * Number of overage requests made this period
174
+ */
175
+ overage: number;
176
+ /**
177
+ * Whether overage is allowed when quota is exhausted
178
+ */
179
+ overageAllowedWithExhaustedQuota: boolean;
180
+ /**
181
+ * Date when the quota resets (ISO 8601 string)
182
+ */
183
+ resetDate?: string;
19
184
  }
20
- export interface PingParams {
185
+ /** @experimental */
186
+ export interface AgentGetCurrentResult {
21
187
  /**
22
- * Optional message to echo back
188
+ * Currently selected custom agent, or null if using the default agent
23
189
  */
24
- message?: string;
190
+ agent?: AgentInfo | null;
25
191
  }
26
- export interface ModelsListResult {
192
+ export interface AgentInfo {
27
193
  /**
28
- * List of available models with full metadata
194
+ * Unique identifier of the custom agent
29
195
  */
30
- models: {
31
- /**
32
- * Model identifier (e.g., "claude-sonnet-4.5")
33
- */
34
- id: string;
35
- /**
36
- * Display name
37
- */
38
- name: string;
39
- capabilities: ModelCapabilities;
40
- /**
41
- * Policy state (if applicable)
42
- */
43
- policy?: {
44
- /**
45
- * Current policy state for this model
46
- */
47
- state: string;
48
- /**
49
- * Usage terms or conditions for this model
50
- */
51
- terms: string;
52
- };
53
- /**
54
- * Billing information
55
- */
56
- billing?: {
57
- /**
58
- * Billing cost multiplier relative to the base rate
59
- */
60
- multiplier: number;
61
- };
62
- /**
63
- * Supported reasoning effort levels (only present if model supports reasoning effort)
64
- */
65
- supportedReasoningEfforts?: string[];
66
- /**
67
- * Default reasoning effort level (only present if model supports reasoning effort)
68
- */
69
- defaultReasoningEffort?: string;
70
- }[];
196
+ name: string;
197
+ /**
198
+ * Human-readable display name
199
+ */
200
+ displayName: string;
201
+ /**
202
+ * Description of the agent's purpose
203
+ */
204
+ description: string;
71
205
  }
72
- /**
73
- * Model capabilities and limits
74
- */
75
- export interface ModelCapabilities {
76
- supports: ModelCapabilitiesSupports;
77
- limits: ModelCapabilitiesLimits;
206
+ /** @experimental */
207
+ export interface AgentList {
208
+ /**
209
+ * Available custom agents
210
+ */
211
+ agents: AgentInfo[];
78
212
  }
79
- /**
80
- * Feature flags indicating what the model supports
81
- */
82
- export interface ModelCapabilitiesSupports {
213
+ /** @experimental */
214
+ export interface AgentReloadResult {
83
215
  /**
84
- * Whether this model supports vision/image input
216
+ * Reloaded custom agents
85
217
  */
86
- vision?: boolean;
218
+ agents: AgentInfo[];
219
+ }
220
+ /** @experimental */
221
+ export interface AgentSelectRequest {
87
222
  /**
88
- * Whether this model supports reasoning effort configuration
223
+ * Name of the custom agent to select
89
224
  */
90
- reasoningEffort?: boolean;
225
+ name: string;
91
226
  }
92
- /**
93
- * Token limits for prompts, outputs, and context window
94
- */
95
- export interface ModelCapabilitiesLimits {
227
+ /** @experimental */
228
+ export interface AgentSelectResult {
229
+ agent: AgentInfo;
230
+ }
231
+ export interface CommandsHandlePendingCommandRequest {
96
232
  /**
97
- * Maximum number of prompt/input tokens
233
+ * Request ID from the command invocation event
98
234
  */
99
- max_prompt_tokens?: number;
235
+ requestId: string;
100
236
  /**
101
- * Maximum number of output/completion tokens
237
+ * Error message if the command handler failed
102
238
  */
103
- max_output_tokens?: number;
239
+ error?: string;
240
+ }
241
+ export interface CommandsHandlePendingCommandResult {
104
242
  /**
105
- * Maximum total context window size in tokens
243
+ * Whether the command was handled successfully
106
244
  */
107
- max_context_window_tokens: number;
108
- vision?: ModelCapabilitiesLimitsVision;
245
+ success: boolean;
246
+ }
247
+ export interface CurrentModel {
248
+ /**
249
+ * Currently active model identifier
250
+ */
251
+ modelId?: string;
252
+ }
253
+ export interface DiscoveredMcpServer {
254
+ /**
255
+ * Server name (config key)
256
+ */
257
+ name: string;
258
+ type?: DiscoveredMcpServerType;
259
+ source: DiscoveredMcpServerSource;
260
+ /**
261
+ * Whether the server is enabled (not in the disabled list)
262
+ */
263
+ enabled: boolean;
264
+ }
265
+ export interface Extension {
266
+ /**
267
+ * Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper')
268
+ */
269
+ id: string;
270
+ /**
271
+ * Extension name (directory name)
272
+ */
273
+ name: string;
274
+ source: ExtensionSource;
275
+ status: ExtensionStatus;
276
+ /**
277
+ * Process ID if the extension is running
278
+ */
279
+ pid?: number;
280
+ }
281
+ /** @experimental */
282
+ export interface ExtensionList {
283
+ /**
284
+ * Discovered extensions and their current status
285
+ */
286
+ extensions: Extension[];
287
+ }
288
+ /** @experimental */
289
+ export interface ExtensionsDisableRequest {
290
+ /**
291
+ * Source-qualified extension ID to disable
292
+ */
293
+ id: string;
294
+ }
295
+ /** @experimental */
296
+ export interface ExtensionsEnableRequest {
297
+ /**
298
+ * Source-qualified extension ID to enable
299
+ */
300
+ id: string;
301
+ }
302
+ /** @experimental */
303
+ export interface FleetStartRequest {
304
+ /**
305
+ * Optional user prompt to combine with fleet instructions
306
+ */
307
+ prompt?: string;
308
+ }
309
+ /** @experimental */
310
+ export interface FleetStartResult {
311
+ /**
312
+ * Whether fleet mode was successfully activated
313
+ */
314
+ started: boolean;
315
+ }
316
+ export interface HandleToolCallResult {
317
+ /**
318
+ * Whether the tool call result was handled successfully
319
+ */
320
+ success: boolean;
109
321
  }
110
322
  /**
111
- * Vision-specific limits
323
+ * Post-compaction context window usage breakdown
324
+ *
325
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
326
+ * via the `definition` "HistoryCompactContextWindow".
112
327
  */
113
- export interface ModelCapabilitiesLimitsVision {
328
+ export interface HistoryCompactContextWindow {
114
329
  /**
115
- * MIME types the model accepts
330
+ * Maximum token count for the model's context window
116
331
  */
117
- supported_media_types: string[];
332
+ tokenLimit: number;
118
333
  /**
119
- * Maximum number of images per prompt
334
+ * Current total tokens in the context window (system + conversation + tool definitions)
120
335
  */
121
- max_prompt_images: number;
336
+ currentTokens: number;
122
337
  /**
123
- * Maximum image size in bytes
338
+ * Current number of messages in the conversation
124
339
  */
125
- max_prompt_image_size: number;
340
+ messagesLength: number;
341
+ /**
342
+ * Token count from system message(s)
343
+ */
344
+ systemTokens?: number;
345
+ /**
346
+ * Token count from non-system messages (user, assistant, tool)
347
+ */
348
+ conversationTokens?: number;
349
+ /**
350
+ * Token count from tool definitions
351
+ */
352
+ toolDefinitionsTokens?: number;
126
353
  }
127
- export interface ToolsListResult {
354
+ /** @experimental */
355
+ export interface HistoryCompactResult {
128
356
  /**
129
- * List of available built-in tools with metadata
357
+ * Whether compaction completed successfully
130
358
  */
131
- tools: {
132
- /**
133
- * Tool identifier (e.g., "bash", "grep", "str_replace_editor")
134
- */
135
- name: string;
136
- /**
137
- * Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP tools)
138
- */
139
- namespacedName?: string;
140
- /**
141
- * Description of what the tool does
142
- */
143
- description: string;
144
- /**
145
- * JSON Schema for the tool's input parameters
146
- */
147
- parameters?: {
148
- [k: string]: unknown;
149
- };
150
- /**
151
- * Optional instructions for how to use this tool effectively
152
- */
153
- instructions?: string;
154
- }[];
359
+ success: boolean;
360
+ /**
361
+ * Number of tokens freed by compaction
362
+ */
363
+ tokensRemoved: number;
364
+ /**
365
+ * Number of messages removed during compaction
366
+ */
367
+ messagesRemoved: number;
368
+ contextWindow?: HistoryCompactContextWindow;
155
369
  }
156
- export interface ToolsListParams {
370
+ /** @experimental */
371
+ export interface HistoryTruncateRequest {
157
372
  /**
158
- * Optional model ID when provided, the returned tool list reflects model-specific overrides
373
+ * Event ID to truncate to. This event and all events after it are removed from the session.
159
374
  */
160
- model?: string;
375
+ eventId: string;
161
376
  }
162
- export interface AccountGetQuotaResult {
377
+ /** @experimental */
378
+ export interface HistoryTruncateResult {
163
379
  /**
164
- * Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)
380
+ * Number of events that were removed
165
381
  */
166
- quotaSnapshots: {
167
- [k: string]: {
168
- /**
169
- * Number of requests included in the entitlement
170
- */
171
- entitlementRequests: number;
172
- /**
173
- * Number of requests used so far this period
174
- */
175
- usedRequests: number;
176
- /**
177
- * Percentage of entitlement remaining
178
- */
179
- remainingPercentage: number;
180
- /**
181
- * Number of overage requests made this period
182
- */
183
- overage: number;
184
- /**
185
- * Whether pay-per-request usage is allowed when quota is exhausted
186
- */
187
- overageAllowedWithExhaustedQuota: boolean;
188
- /**
189
- * Date when the quota resets (ISO 8601)
190
- */
191
- resetDate?: string;
192
- };
193
- };
382
+ eventsRemoved: number;
194
383
  }
195
- export interface McpConfigListResult {
384
+ export interface InstructionsGetSourcesResult {
196
385
  /**
197
- * All MCP servers from user config, keyed by name
386
+ * Instruction sources for the session
198
387
  */
199
- servers: {
200
- /**
201
- * MCP server configuration (local/stdio or remote/http)
202
- */
203
- [k: string]: {
204
- /**
205
- * Tools to include. Defaults to all tools if not specified.
206
- */
207
- tools?: string[];
208
- type?: "local" | "stdio";
209
- isDefaultServer?: boolean;
210
- filterMapping?: {
211
- [k: string]: "none" | "markdown" | "hidden_characters";
212
- } | ("none" | "markdown" | "hidden_characters");
213
- timeout?: number;
214
- command: string;
215
- args: string[];
216
- cwd?: string;
217
- env?: {
218
- [k: string]: string;
219
- };
220
- } | {
221
- /**
222
- * Tools to include. Defaults to all tools if not specified.
223
- */
224
- tools?: string[];
225
- type: "http" | "sse";
226
- isDefaultServer?: boolean;
227
- filterMapping?: {
228
- [k: string]: "none" | "markdown" | "hidden_characters";
229
- } | ("none" | "markdown" | "hidden_characters");
230
- timeout?: number;
231
- url: string;
232
- headers?: {
233
- [k: string]: string;
234
- };
235
- oauthClientId?: string;
236
- oauthPublicClient?: boolean;
237
- };
238
- };
388
+ sources: InstructionsSources[];
389
+ }
390
+ export interface InstructionsSources {
391
+ /**
392
+ * Unique identifier for this source (used for toggling)
393
+ */
394
+ id: string;
395
+ /**
396
+ * Human-readable label
397
+ */
398
+ label: string;
399
+ /**
400
+ * File path relative to repo or absolute for home
401
+ */
402
+ sourcePath: string;
403
+ /**
404
+ * Raw content of the instruction file
405
+ */
406
+ content: string;
407
+ type: InstructionsSourcesType;
408
+ location: InstructionsSourcesLocation;
409
+ /**
410
+ * Glob pattern from frontmatter — when set, this instruction applies only to matching files
411
+ */
412
+ applyTo?: string;
413
+ /**
414
+ * Short description (body after frontmatter) for use in instruction tables
415
+ */
416
+ description?: string;
417
+ }
418
+ export interface LogRequest {
419
+ /**
420
+ * Human-readable message
421
+ */
422
+ message: string;
423
+ level?: SessionLogLevel;
424
+ /**
425
+ * When true, the message is transient and not persisted to the session event log on disk
426
+ */
427
+ ephemeral?: boolean;
428
+ /**
429
+ * Optional URL the user can open in their browser for more details
430
+ */
431
+ url?: string;
239
432
  }
240
- export interface McpConfigAddParams {
433
+ export interface LogResult {
434
+ /**
435
+ * The unique identifier of the emitted session event
436
+ */
437
+ eventId: string;
438
+ }
439
+ export interface McpConfigAddRequest {
241
440
  /**
242
441
  * Unique name for the MCP server
243
442
  */
244
443
  name: string;
444
+ config: McpServerConfig;
445
+ }
446
+ export interface McpServerConfigLocal {
245
447
  /**
246
- * MCP server configuration (local/stdio or remote/http)
247
- */
248
- config: {
249
- /**
250
- * Tools to include. Defaults to all tools if not specified.
251
- */
252
- tools?: string[];
253
- type?: "local" | "stdio";
254
- isDefaultServer?: boolean;
255
- filterMapping?: {
256
- [k: string]: "none" | "markdown" | "hidden_characters";
257
- } | ("none" | "markdown" | "hidden_characters");
258
- timeout?: number;
259
- command: string;
260
- args: string[];
261
- cwd?: string;
262
- env?: {
263
- [k: string]: string;
264
- };
265
- } | {
266
- /**
267
- * Tools to include. Defaults to all tools if not specified.
268
- */
269
- tools?: string[];
270
- type: "http" | "sse";
271
- isDefaultServer?: boolean;
272
- filterMapping?: {
273
- [k: string]: "none" | "markdown" | "hidden_characters";
274
- } | ("none" | "markdown" | "hidden_characters");
275
- timeout?: number;
276
- url: string;
277
- headers?: {
278
- [k: string]: string;
279
- };
280
- oauthClientId?: string;
281
- oauthPublicClient?: boolean;
448
+ * Tools to include. Defaults to all tools if not specified.
449
+ */
450
+ tools?: string[];
451
+ type?: McpServerConfigLocalType;
452
+ isDefaultServer?: boolean;
453
+ filterMapping?: FilterMapping;
454
+ /**
455
+ * Timeout in milliseconds for tool calls to this server.
456
+ */
457
+ timeout?: number;
458
+ command: string;
459
+ args: string[];
460
+ cwd?: string;
461
+ env?: {
462
+ [k: string]: string;
282
463
  };
283
464
  }
284
- export interface McpConfigUpdateParams {
465
+ export interface McpServerConfigHttp {
285
466
  /**
286
- * Name of the MCP server to update
467
+ * Tools to include. Defaults to all tools if not specified.
287
468
  */
288
- name: string;
469
+ tools?: string[];
470
+ type?: McpServerConfigHttpType;
471
+ isDefaultServer?: boolean;
472
+ filterMapping?: FilterMapping;
289
473
  /**
290
- * MCP server configuration (local/stdio or remote/http)
291
- */
292
- config: {
293
- /**
294
- * Tools to include. Defaults to all tools if not specified.
295
- */
296
- tools?: string[];
297
- type?: "local" | "stdio";
298
- isDefaultServer?: boolean;
299
- filterMapping?: {
300
- [k: string]: "none" | "markdown" | "hidden_characters";
301
- } | ("none" | "markdown" | "hidden_characters");
302
- timeout?: number;
303
- command: string;
304
- args: string[];
305
- cwd?: string;
306
- env?: {
307
- [k: string]: string;
308
- };
309
- } | {
310
- /**
311
- * Tools to include. Defaults to all tools if not specified.
312
- */
313
- tools?: string[];
314
- type: "http" | "sse";
315
- isDefaultServer?: boolean;
316
- filterMapping?: {
317
- [k: string]: "none" | "markdown" | "hidden_characters";
318
- } | ("none" | "markdown" | "hidden_characters");
319
- timeout?: number;
320
- url: string;
321
- headers?: {
322
- [k: string]: string;
323
- };
324
- oauthClientId?: string;
325
- oauthPublicClient?: boolean;
474
+ * Timeout in milliseconds for tool calls to this server.
475
+ */
476
+ timeout?: number;
477
+ url: string;
478
+ headers?: {
479
+ [k: string]: string;
326
480
  };
481
+ oauthClientId?: string;
482
+ oauthPublicClient?: boolean;
327
483
  }
328
- export interface McpConfigRemoveParams {
484
+ export interface McpConfigList {
485
+ /**
486
+ * All MCP servers from user config, keyed by name
487
+ */
488
+ servers: {
489
+ [k: string]: McpServerConfig;
490
+ };
491
+ }
492
+ export interface McpConfigRemoveRequest {
329
493
  /**
330
494
  * Name of the MCP server to remove
331
495
  */
332
496
  name: string;
333
497
  }
334
- export interface SessionFsSetProviderResult {
498
+ export interface McpConfigUpdateRequest {
335
499
  /**
336
- * Whether the provider was set successfully
500
+ * Name of the MCP server to update
337
501
  */
338
- success: boolean;
502
+ name: string;
503
+ config: McpServerConfig;
339
504
  }
340
- export interface SessionFsSetProviderParams {
505
+ /** @experimental */
506
+ export interface McpDisableRequest {
341
507
  /**
342
- * Initial working directory for sessions
508
+ * Name of the MCP server to disable
343
509
  */
344
- initialCwd: string;
510
+ serverName: string;
511
+ }
512
+ export interface McpDiscoverRequest {
345
513
  /**
346
- * Path within each session's SessionFs where the runtime stores files for that session
514
+ * Working directory used as context for discovery (e.g., plugin resolution)
347
515
  */
348
- sessionStatePath: string;
516
+ workingDirectory?: string;
517
+ }
518
+ export interface McpDiscoverResult {
349
519
  /**
350
- * Path conventions used by this filesystem
520
+ * MCP servers discovered from all sources
351
521
  */
352
- conventions: "windows" | "posix";
522
+ servers: DiscoveredMcpServer[];
353
523
  }
354
524
  /** @experimental */
355
- export interface SessionsForkResult {
525
+ export interface McpEnableRequest {
356
526
  /**
357
- * The new forked session's ID
527
+ * Name of the MCP server to enable
358
528
  */
359
- sessionId: string;
529
+ serverName: string;
530
+ }
531
+ export interface McpServer {
532
+ /**
533
+ * Server name (config key)
534
+ */
535
+ name: string;
536
+ status: McpServerStatus;
537
+ source?: McpServerSource;
538
+ /**
539
+ * Error message if the server failed to connect
540
+ */
541
+ error?: string;
360
542
  }
361
543
  /** @experimental */
362
- export interface SessionsForkParams {
544
+ export interface McpServerList {
363
545
  /**
364
- * Source session ID to fork from
546
+ * Configured MCP servers
365
547
  */
366
- sessionId: string;
548
+ servers: McpServer[];
549
+ }
550
+ export interface Model {
367
551
  /**
368
- * Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included.
552
+ * Model identifier (e.g., "claude-sonnet-4.5")
369
553
  */
370
- toEventId?: string;
554
+ id: string;
555
+ /**
556
+ * Display name
557
+ */
558
+ name: string;
559
+ capabilities: ModelCapabilities;
560
+ policy?: ModelPolicy;
561
+ billing?: ModelBilling;
562
+ /**
563
+ * Supported reasoning effort levels (only present if model supports reasoning effort)
564
+ */
565
+ supportedReasoningEfforts?: string[];
566
+ /**
567
+ * Default reasoning effort level (only present if model supports reasoning effort)
568
+ */
569
+ defaultReasoningEffort?: string;
570
+ }
571
+ /**
572
+ * Model capabilities and limits
573
+ *
574
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
575
+ * via the `definition` "ModelCapabilities".
576
+ */
577
+ export interface ModelCapabilities {
578
+ supports?: ModelCapabilitiesSupports;
579
+ limits?: ModelCapabilitiesLimits;
371
580
  }
372
- export interface SessionModelGetCurrentResult {
581
+ /**
582
+ * Feature flags indicating what the model supports
583
+ *
584
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
585
+ * via the `definition` "ModelCapabilitiesSupports".
586
+ */
587
+ export interface ModelCapabilitiesSupports {
373
588
  /**
374
- * Currently active model identifier
589
+ * Whether this model supports vision/image input
375
590
  */
376
- modelId?: string;
591
+ vision?: boolean;
592
+ /**
593
+ * Whether this model supports reasoning effort configuration
594
+ */
595
+ reasoningEffort?: boolean;
377
596
  }
378
- export interface SessionModelGetCurrentParams {
597
+ /**
598
+ * Token limits for prompts, outputs, and context window
599
+ *
600
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
601
+ * via the `definition` "ModelCapabilitiesLimits".
602
+ */
603
+ export interface ModelCapabilitiesLimits {
379
604
  /**
380
- * Target session identifier
605
+ * Maximum number of prompt/input tokens
381
606
  */
382
- sessionId: string;
607
+ max_prompt_tokens?: number;
608
+ /**
609
+ * Maximum number of output/completion tokens
610
+ */
611
+ max_output_tokens?: number;
612
+ /**
613
+ * Maximum total context window size in tokens
614
+ */
615
+ max_context_window_tokens?: number;
616
+ vision?: ModelCapabilitiesLimitsVision;
383
617
  }
384
- export interface SessionModelSwitchToResult {
618
+ /**
619
+ * Vision-specific limits
620
+ *
621
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
622
+ * via the `definition` "ModelCapabilitiesLimitsVision".
623
+ */
624
+ export interface ModelCapabilitiesLimitsVision {
385
625
  /**
386
- * Currently active model identifier after the switch
626
+ * MIME types the model accepts
387
627
  */
388
- modelId?: string;
628
+ supported_media_types: string[];
629
+ /**
630
+ * Maximum number of images per prompt
631
+ */
632
+ max_prompt_images: number;
633
+ /**
634
+ * Maximum image size in bytes
635
+ */
636
+ max_prompt_image_size: number;
389
637
  }
390
- export interface SessionModelSwitchToParams {
638
+ /**
639
+ * Policy state (if applicable)
640
+ *
641
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
642
+ * via the `definition` "ModelPolicy".
643
+ */
644
+ export interface ModelPolicy {
391
645
  /**
392
- * Target session identifier
646
+ * Current policy state for this model
393
647
  */
394
- sessionId: string;
648
+ state: string;
395
649
  /**
396
- * Model identifier to switch to
650
+ * Usage terms or conditions for this model
397
651
  */
398
- modelId: string;
652
+ terms: string;
653
+ }
654
+ /**
655
+ * Billing information
656
+ *
657
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
658
+ * via the `definition` "ModelBilling".
659
+ */
660
+ export interface ModelBilling {
399
661
  /**
400
- * Reasoning effort level to use for the model
662
+ * Billing cost multiplier relative to the base rate
401
663
  */
402
- reasoningEffort?: string;
403
- modelCapabilities?: ModelCapabilitiesOverride;
664
+ multiplier: number;
404
665
  }
405
666
  /**
406
667
  * Override individual model capabilities resolved by the runtime
668
+ *
669
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
670
+ * via the `definition` "ModelCapabilitiesOverride".
407
671
  */
408
672
  export interface ModelCapabilitiesOverride {
409
673
  supports?: ModelCapabilitiesOverrideSupports;
@@ -411,6 +675,9 @@ export interface ModelCapabilitiesOverride {
411
675
  }
412
676
  /**
413
677
  * Feature flags indicating what the model supports
678
+ *
679
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
680
+ * via the `definition` "ModelCapabilitiesOverrideSupports".
414
681
  */
415
682
  export interface ModelCapabilitiesOverrideSupports {
416
683
  vision?: boolean;
@@ -418,6 +685,9 @@ export interface ModelCapabilitiesOverrideSupports {
418
685
  }
419
686
  /**
420
687
  * Token limits for prompts, outputs, and context window
688
+ *
689
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
690
+ * via the `definition` "ModelCapabilitiesOverrideLimits".
421
691
  */
422
692
  export interface ModelCapabilitiesOverrideLimits {
423
693
  max_prompt_tokens?: number;
@@ -442,750 +712,460 @@ export interface ModelCapabilitiesOverrideLimitsVision {
442
712
  */
443
713
  max_prompt_image_size?: number;
444
714
  }
445
- export interface SessionModeGetResult {
715
+ export interface ModelList {
446
716
  /**
447
- * The current agent mode.
717
+ * List of available models with full metadata
448
718
  */
449
- mode: "interactive" | "plan" | "autopilot";
719
+ models: Model[];
450
720
  }
451
- export interface SessionModeGetParams {
721
+ export interface ModelSwitchToRequest {
452
722
  /**
453
- * Target session identifier
723
+ * Model identifier to switch to
454
724
  */
455
- sessionId: string;
456
- }
457
- export interface SessionModeSetResult {
725
+ modelId: string;
458
726
  /**
459
- * The agent mode after switching.
727
+ * Reasoning effort level to use for the model
460
728
  */
461
- mode: "interactive" | "plan" | "autopilot";
729
+ reasoningEffort?: string;
730
+ modelCapabilities?: ModelCapabilitiesOverride;
462
731
  }
463
- export interface SessionModeSetParams {
464
- /**
465
- * Target session identifier
466
- */
467
- sessionId: string;
732
+ export interface ModelSwitchToResult {
468
733
  /**
469
- * The mode to switch to. Valid values: "interactive", "plan", "autopilot".
734
+ * Currently active model identifier after the switch
470
735
  */
471
- mode: "interactive" | "plan" | "autopilot";
736
+ modelId?: string;
472
737
  }
473
- export interface SessionPlanReadResult {
474
- /**
475
- * Whether the plan file exists in the workspace
476
- */
477
- exists: boolean;
478
- /**
479
- * The content of the plan file, or null if it does not exist
480
- */
481
- content: string | null;
482
- /**
483
- * Absolute file path of the plan file, or null if workspace is not enabled
484
- */
485
- path: string | null;
738
+ export interface ModeSetRequest {
739
+ mode: SessionMode;
486
740
  }
487
- export interface SessionPlanReadParams {
741
+ export interface NameGetResult {
488
742
  /**
489
- * Target session identifier
743
+ * The session name, falling back to the auto-generated summary, or null if neither exists
490
744
  */
491
- sessionId: string;
745
+ name: string | null;
492
746
  }
493
- export interface SessionPlanUpdateResult {
494
- }
495
- export interface SessionPlanUpdateParams {
496
- /**
497
- * Target session identifier
498
- */
499
- sessionId: string;
747
+ export interface NameSetRequest {
500
748
  /**
501
- * The new content for the plan file
749
+ * New session name (1–100 characters, trimmed of leading/trailing whitespace)
502
750
  */
503
- content: string;
504
- }
505
- export interface SessionPlanDeleteResult {
751
+ name: string;
506
752
  }
507
- export interface SessionPlanDeleteParams {
753
+ export interface PermissionDecisionApproved {
508
754
  /**
509
- * Target session identifier
755
+ * The permission request was approved
510
756
  */
511
- sessionId: string;
757
+ kind: "approved";
512
758
  }
513
- export interface SessionWorkspaceListFilesResult {
759
+ export interface PermissionDecisionDeniedByRules {
514
760
  /**
515
- * Relative file paths in the workspace files directory
761
+ * Denied because approval rules explicitly blocked it
516
762
  */
517
- files: string[];
518
- }
519
- export interface SessionWorkspaceListFilesParams {
763
+ kind: "denied-by-rules";
520
764
  /**
521
- * Target session identifier
765
+ * Rules that denied the request
522
766
  */
523
- sessionId: string;
767
+ rules: unknown[];
524
768
  }
525
- export interface SessionWorkspaceReadFileResult {
769
+ export interface PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser {
526
770
  /**
527
- * File content as a UTF-8 string
771
+ * Denied because no approval rule matched and user confirmation was unavailable
528
772
  */
529
- content: string;
773
+ kind: "denied-no-approval-rule-and-could-not-request-from-user";
530
774
  }
531
- export interface SessionWorkspaceReadFileParams {
775
+ export interface PermissionDecisionDeniedInteractivelyByUser {
532
776
  /**
533
- * Target session identifier
777
+ * Denied by the user during an interactive prompt
534
778
  */
535
- sessionId: string;
779
+ kind: "denied-interactively-by-user";
536
780
  /**
537
- * Relative path within the workspace files directory
781
+ * Optional feedback from the user explaining the denial
538
782
  */
539
- path: string;
783
+ feedback?: string;
540
784
  }
541
- export interface SessionWorkspaceCreateFileResult {
542
- }
543
- export interface SessionWorkspaceCreateFileParams {
785
+ export interface PermissionDecisionDeniedByContentExclusionPolicy {
544
786
  /**
545
- * Target session identifier
787
+ * Denied by the organization's content exclusion policy
546
788
  */
547
- sessionId: string;
789
+ kind: "denied-by-content-exclusion-policy";
548
790
  /**
549
- * Relative path within the workspace files directory
791
+ * File path that triggered the exclusion
550
792
  */
551
793
  path: string;
552
794
  /**
553
- * File content to write as a UTF-8 string
795
+ * Human-readable explanation of why the path was excluded
554
796
  */
555
- content: string;
797
+ message: string;
556
798
  }
557
- /** @experimental */
558
- export interface SessionFleetStartResult {
799
+ export interface PermissionDecisionDeniedByPermissionRequestHook {
559
800
  /**
560
- * Whether fleet mode was successfully activated
801
+ * Denied by a permission request hook registered by an extension or plugin
561
802
  */
562
- started: boolean;
563
- }
564
- /** @experimental */
565
- export interface SessionFleetStartParams {
803
+ kind: "denied-by-permission-request-hook";
566
804
  /**
567
- * Target session identifier
805
+ * Optional message from the hook explaining the denial
568
806
  */
569
- sessionId: string;
807
+ message?: string;
570
808
  /**
571
- * Optional user prompt to combine with fleet instructions
809
+ * Whether to interrupt the current agent turn
572
810
  */
573
- prompt?: string;
811
+ interrupt?: boolean;
574
812
  }
575
- /** @experimental */
576
- export interface SessionAgentListResult {
813
+ export interface PermissionDecisionRequest {
577
814
  /**
578
- * Available custom agents
815
+ * Request ID of the pending permission request
579
816
  */
580
- agents: {
581
- /**
582
- * Unique identifier of the custom agent
583
- */
584
- name: string;
585
- /**
586
- * Human-readable display name
587
- */
588
- displayName: string;
589
- /**
590
- * Description of the agent's purpose
591
- */
592
- description: string;
593
- }[];
817
+ requestId: string;
818
+ result: PermissionDecision;
594
819
  }
595
- /** @experimental */
596
- export interface SessionAgentListParams {
820
+ export interface PermissionRequestResult {
597
821
  /**
598
- * Target session identifier
822
+ * Whether the permission request was handled successfully
599
823
  */
600
- sessionId: string;
824
+ success: boolean;
601
825
  }
602
- /** @experimental */
603
- export interface SessionAgentGetCurrentResult {
826
+ export interface PingRequest {
604
827
  /**
605
- * Currently selected custom agent, or null if using the default agent
828
+ * Optional message to echo back
606
829
  */
607
- agent: {
608
- /**
609
- * Unique identifier of the custom agent
610
- */
611
- name: string;
612
- /**
613
- * Human-readable display name
614
- */
615
- displayName: string;
616
- /**
617
- * Description of the agent's purpose
618
- */
619
- description: string;
620
- } | null;
830
+ message?: string;
621
831
  }
622
- /** @experimental */
623
- export interface SessionAgentGetCurrentParams {
832
+ export interface PingResult {
624
833
  /**
625
- * Target session identifier
834
+ * Echoed message (or default greeting)
626
835
  */
627
- sessionId: string;
628
- }
629
- /** @experimental */
630
- export interface SessionAgentSelectResult {
836
+ message: string;
631
837
  /**
632
- * The newly selected custom agent
838
+ * Server timestamp in milliseconds
633
839
  */
634
- agent: {
635
- /**
636
- * Unique identifier of the custom agent
637
- */
638
- name: string;
639
- /**
640
- * Human-readable display name
641
- */
642
- displayName: string;
643
- /**
644
- * Description of the agent's purpose
645
- */
646
- description: string;
647
- };
648
- }
649
- /** @experimental */
650
- export interface SessionAgentSelectParams {
840
+ timestamp: number;
651
841
  /**
652
- * Target session identifier
842
+ * Server protocol version number
653
843
  */
654
- sessionId: string;
844
+ protocolVersion: number;
845
+ }
846
+ export interface PlanReadResult {
655
847
  /**
656
- * Name of the custom agent to select
848
+ * Whether the plan file exists in the workspace
657
849
  */
658
- name: string;
659
- }
660
- /** @experimental */
661
- export interface SessionAgentDeselectResult {
662
- }
663
- /** @experimental */
664
- export interface SessionAgentDeselectParams {
850
+ exists: boolean;
665
851
  /**
666
- * Target session identifier
852
+ * The content of the plan file, or null if it does not exist
667
853
  */
668
- sessionId: string;
669
- }
670
- /** @experimental */
671
- export interface SessionAgentReloadResult {
854
+ content: string | null;
672
855
  /**
673
- * Reloaded custom agents
856
+ * Absolute file path of the plan file, or null if workspace is not enabled
674
857
  */
675
- agents: {
676
- /**
677
- * Unique identifier of the custom agent
678
- */
679
- name: string;
680
- /**
681
- * Human-readable display name
682
- */
683
- displayName: string;
684
- /**
685
- * Description of the agent's purpose
686
- */
687
- description: string;
688
- }[];
858
+ path: string | null;
689
859
  }
690
- /** @experimental */
691
- export interface SessionAgentReloadParams {
860
+ export interface PlanUpdateRequest {
692
861
  /**
693
- * Target session identifier
862
+ * The new content for the plan file
694
863
  */
695
- sessionId: string;
864
+ content: string;
696
865
  }
697
- /** @experimental */
698
- export interface SessionSkillsListResult {
866
+ export interface Plugin {
699
867
  /**
700
- * Available skills
868
+ * Plugin name
701
869
  */
702
- skills: {
703
- /**
704
- * Unique identifier for the skill
705
- */
706
- name: string;
707
- /**
708
- * Description of what the skill does
709
- */
710
- description: string;
711
- /**
712
- * Source location type (e.g., project, personal, plugin)
713
- */
714
- source: string;
715
- /**
716
- * Whether the skill can be invoked by the user as a slash command
717
- */
718
- userInvocable: boolean;
719
- /**
720
- * Whether the skill is currently enabled
721
- */
722
- enabled: boolean;
723
- /**
724
- * Absolute path to the skill file
725
- */
726
- path?: string;
727
- }[];
728
- }
729
- /** @experimental */
730
- export interface SessionSkillsListParams {
870
+ name: string;
731
871
  /**
732
- * Target session identifier
872
+ * Marketplace the plugin came from
733
873
  */
734
- sessionId: string;
735
- }
736
- /** @experimental */
737
- export interface SessionSkillsEnableResult {
738
- }
739
- /** @experimental */
740
- export interface SessionSkillsEnableParams {
874
+ marketplace: string;
741
875
  /**
742
- * Target session identifier
876
+ * Installed version
743
877
  */
744
- sessionId: string;
878
+ version?: string;
745
879
  /**
746
- * Name of the skill to enable
880
+ * Whether the plugin is currently enabled
747
881
  */
748
- name: string;
749
- }
750
- /** @experimental */
751
- export interface SessionSkillsDisableResult {
882
+ enabled: boolean;
752
883
  }
753
884
  /** @experimental */
754
- export interface SessionSkillsDisableParams {
885
+ export interface PluginList {
755
886
  /**
756
- * Target session identifier
887
+ * Installed plugins
757
888
  */
758
- sessionId: string;
889
+ plugins: Plugin[];
890
+ }
891
+ export interface ServerSkill {
759
892
  /**
760
- * Name of the skill to disable
893
+ * Unique identifier for the skill
761
894
  */
762
895
  name: string;
763
- }
764
- /** @experimental */
765
- export interface SessionSkillsReloadResult {
766
- }
767
- /** @experimental */
768
- export interface SessionSkillsReloadParams {
769
896
  /**
770
- * Target session identifier
897
+ * Description of what the skill does
771
898
  */
772
- sessionId: string;
773
- }
774
- /** @experimental */
775
- export interface SessionMcpListResult {
899
+ description: string;
776
900
  /**
777
- * Configured MCP servers
901
+ * Source location type (e.g., project, personal-copilot, plugin, builtin)
778
902
  */
779
- servers: {
780
- /**
781
- * Server name (config key)
782
- */
783
- name: string;
784
- /**
785
- * Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
786
- */
787
- status: "connected" | "failed" | "needs-auth" | "pending" | "disabled" | "not_configured";
788
- /**
789
- * Configuration source: user, workspace, plugin, or builtin
790
- */
791
- source?: string;
792
- /**
793
- * Error message if the server failed to connect
794
- */
795
- error?: string;
796
- }[];
797
- }
798
- /** @experimental */
799
- export interface SessionMcpListParams {
903
+ source: string;
800
904
  /**
801
- * Target session identifier
905
+ * Whether the skill can be invoked by the user as a slash command
802
906
  */
803
- sessionId: string;
804
- }
805
- /** @experimental */
806
- export interface SessionMcpEnableResult {
807
- }
808
- /** @experimental */
809
- export interface SessionMcpEnableParams {
907
+ userInvocable: boolean;
810
908
  /**
811
- * Target session identifier
909
+ * Whether the skill is currently enabled (based on global config)
812
910
  */
813
- sessionId: string;
911
+ enabled: boolean;
814
912
  /**
815
- * Name of the MCP server to enable
913
+ * Absolute path to the skill file
816
914
  */
817
- serverName: string;
915
+ path?: string;
916
+ /**
917
+ * The project path this skill belongs to (only for project/inherited skills)
918
+ */
919
+ projectPath?: string;
818
920
  }
819
- /** @experimental */
820
- export interface SessionMcpDisableResult {
921
+ export interface ServerSkillList {
922
+ /**
923
+ * All discovered skills across all sources
924
+ */
925
+ skills: ServerSkill[];
821
926
  }
822
- /** @experimental */
823
- export interface SessionMcpDisableParams {
927
+ export interface SessionFsAppendFileRequest {
824
928
  /**
825
929
  * Target session identifier
826
930
  */
827
931
  sessionId: string;
828
932
  /**
829
- * Name of the MCP server to disable
933
+ * Path using SessionFs conventions
830
934
  */
831
- serverName: string;
832
- }
833
- /** @experimental */
834
- export interface SessionMcpReloadResult {
835
- }
836
- /** @experimental */
837
- export interface SessionMcpReloadParams {
935
+ path: string;
838
936
  /**
839
- * Target session identifier
937
+ * Content to append
840
938
  */
841
- sessionId: string;
939
+ content: string;
940
+ /**
941
+ * Optional POSIX-style mode for newly created files
942
+ */
943
+ mode?: number;
842
944
  }
843
- /** @experimental */
844
- export interface SessionPluginsListResult {
945
+ /**
946
+ * Describes a filesystem error.
947
+ *
948
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
949
+ * via the `definition` "SessionFsError".
950
+ */
951
+ export interface SessionFsError {
952
+ code: SessionFsErrorCode;
845
953
  /**
846
- * Installed plugins
954
+ * Free-form detail about the error, for logging/diagnostics
847
955
  */
848
- plugins: {
849
- /**
850
- * Plugin name
851
- */
852
- name: string;
853
- /**
854
- * Marketplace the plugin came from
855
- */
856
- marketplace: string;
857
- /**
858
- * Installed version
859
- */
860
- version?: string;
861
- /**
862
- * Whether the plugin is currently enabled
863
- */
864
- enabled: boolean;
865
- }[];
956
+ message?: string;
866
957
  }
867
- /** @experimental */
868
- export interface SessionPluginsListParams {
958
+ export interface SessionFsExistsRequest {
869
959
  /**
870
960
  * Target session identifier
871
961
  */
872
962
  sessionId: string;
873
- }
874
- /** @experimental */
875
- export interface SessionExtensionsListResult {
876
963
  /**
877
- * Discovered extensions and their current status
964
+ * Path using SessionFs conventions
878
965
  */
879
- extensions: {
880
- /**
881
- * Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper')
882
- */
883
- id: string;
884
- /**
885
- * Extension name (directory name)
886
- */
887
- name: string;
888
- /**
889
- * Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/)
890
- */
891
- source: "project" | "user";
892
- /**
893
- * Current status: running, disabled, failed, or starting
894
- */
895
- status: "running" | "disabled" | "failed" | "starting";
896
- /**
897
- * Process ID if the extension is running
898
- */
899
- pid?: number;
900
- }[];
966
+ path: string;
901
967
  }
902
- /** @experimental */
903
- export interface SessionExtensionsListParams {
968
+ export interface SessionFsExistsResult {
904
969
  /**
905
- * Target session identifier
970
+ * Whether the path exists
906
971
  */
907
- sessionId: string;
908
- }
909
- /** @experimental */
910
- export interface SessionExtensionsEnableResult {
972
+ exists: boolean;
911
973
  }
912
- /** @experimental */
913
- export interface SessionExtensionsEnableParams {
974
+ export interface SessionFsMkdirRequest {
914
975
  /**
915
976
  * Target session identifier
916
977
  */
917
978
  sessionId: string;
918
979
  /**
919
- * Source-qualified extension ID to enable
980
+ * Path using SessionFs conventions
920
981
  */
921
- id: string;
922
- }
923
- /** @experimental */
924
- export interface SessionExtensionsDisableResult {
982
+ path: string;
983
+ /**
984
+ * Create parent directories as needed
985
+ */
986
+ recursive?: boolean;
987
+ /**
988
+ * Optional POSIX-style mode for newly created directories
989
+ */
990
+ mode?: number;
925
991
  }
926
- /** @experimental */
927
- export interface SessionExtensionsDisableParams {
992
+ export interface SessionFsReaddirRequest {
928
993
  /**
929
994
  * Target session identifier
930
995
  */
931
996
  sessionId: string;
932
997
  /**
933
- * Source-qualified extension ID to disable
998
+ * Path using SessionFs conventions
934
999
  */
935
- id: string;
936
- }
937
- /** @experimental */
938
- export interface SessionExtensionsReloadResult {
1000
+ path: string;
939
1001
  }
940
- /** @experimental */
941
- export interface SessionExtensionsReloadParams {
1002
+ export interface SessionFsReaddirResult {
942
1003
  /**
943
- * Target session identifier
1004
+ * Entry names in the directory
944
1005
  */
945
- sessionId: string;
1006
+ entries: string[];
1007
+ error?: SessionFsError;
946
1008
  }
947
- export interface SessionToolsHandlePendingToolCallResult {
1009
+ export interface SessionFsReaddirWithTypesEntry {
948
1010
  /**
949
- * Whether the tool call result was handled successfully
1011
+ * Entry name
950
1012
  */
951
- success: boolean;
1013
+ name: string;
1014
+ type: SessionFsReaddirWithTypesEntryType;
952
1015
  }
953
- export interface SessionToolsHandlePendingToolCallParams {
1016
+ export interface SessionFsReaddirWithTypesRequest {
954
1017
  /**
955
1018
  * Target session identifier
956
1019
  */
957
1020
  sessionId: string;
958
- requestId: string;
959
- result?: string | {
960
- textResultForLlm: string;
961
- resultType?: string;
962
- error?: string;
963
- toolTelemetry?: {
964
- [k: string]: unknown;
965
- };
966
- };
967
- error?: string;
1021
+ /**
1022
+ * Path using SessionFs conventions
1023
+ */
1024
+ path: string;
968
1025
  }
969
- export interface SessionCommandsHandlePendingCommandResult {
970
- success: boolean;
1026
+ export interface SessionFsReaddirWithTypesResult {
1027
+ /**
1028
+ * Directory entries with type information
1029
+ */
1030
+ entries: SessionFsReaddirWithTypesEntry[];
1031
+ error?: SessionFsError;
971
1032
  }
972
- export interface SessionCommandsHandlePendingCommandParams {
1033
+ export interface SessionFsReadFileRequest {
973
1034
  /**
974
1035
  * Target session identifier
975
1036
  */
976
1037
  sessionId: string;
977
1038
  /**
978
- * Request ID from the command invocation event
1039
+ * Path using SessionFs conventions
979
1040
  */
980
- requestId: string;
1041
+ path: string;
1042
+ }
1043
+ export interface SessionFsReadFileResult {
981
1044
  /**
982
- * Error message if the command handler failed
1045
+ * File content as UTF-8 string
983
1046
  */
984
- error?: string;
1047
+ content: string;
1048
+ error?: SessionFsError;
985
1049
  }
986
- export interface SessionUiElicitationResult {
1050
+ export interface SessionFsRenameRequest {
1051
+ /**
1052
+ * Target session identifier
1053
+ */
1054
+ sessionId: string;
987
1055
  /**
988
- * The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
1056
+ * Source path using SessionFs conventions
989
1057
  */
990
- action: "accept" | "decline" | "cancel";
1058
+ src: string;
991
1059
  /**
992
- * The form values submitted by the user (present when action is 'accept')
1060
+ * Destination path using SessionFs conventions
993
1061
  */
994
- content?: {
995
- [k: string]: string | number | boolean | string[];
996
- };
1062
+ dest: string;
997
1063
  }
998
- export interface SessionUiElicitationParams {
1064
+ export interface SessionFsRmRequest {
999
1065
  /**
1000
1066
  * Target session identifier
1001
1067
  */
1002
1068
  sessionId: string;
1003
1069
  /**
1004
- * Message describing what information is needed from the user
1070
+ * Path using SessionFs conventions
1005
1071
  */
1006
- message: string;
1072
+ path: string;
1007
1073
  /**
1008
- * JSON Schema describing the form fields to present to the user
1009
- */
1010
- requestedSchema: {
1011
- /**
1012
- * Schema type indicator (always 'object')
1013
- */
1014
- type: "object";
1015
- /**
1016
- * Form field definitions, keyed by field name
1017
- */
1018
- properties: {
1019
- [k: string]: {
1020
- type: "string";
1021
- title?: string;
1022
- description?: string;
1023
- enum: string[];
1024
- enumNames?: string[];
1025
- default?: string;
1026
- } | {
1027
- type: "string";
1028
- title?: string;
1029
- description?: string;
1030
- oneOf: {
1031
- const: string;
1032
- title: string;
1033
- }[];
1034
- default?: string;
1035
- } | {
1036
- type: "array";
1037
- title?: string;
1038
- description?: string;
1039
- minItems?: number;
1040
- maxItems?: number;
1041
- items: {
1042
- type: "string";
1043
- enum: string[];
1044
- };
1045
- default?: string[];
1046
- } | {
1047
- type: "array";
1048
- title?: string;
1049
- description?: string;
1050
- minItems?: number;
1051
- maxItems?: number;
1052
- items: {
1053
- anyOf: {
1054
- const: string;
1055
- title: string;
1056
- }[];
1057
- };
1058
- default?: string[];
1059
- } | {
1060
- type: "boolean";
1061
- title?: string;
1062
- description?: string;
1063
- default?: boolean;
1064
- } | {
1065
- type: "string";
1066
- title?: string;
1067
- description?: string;
1068
- minLength?: number;
1069
- maxLength?: number;
1070
- format?: "email" | "uri" | "date" | "date-time";
1071
- default?: string;
1072
- } | {
1073
- type: "number" | "integer";
1074
- title?: string;
1075
- description?: string;
1076
- minimum?: number;
1077
- maximum?: number;
1078
- default?: number;
1079
- };
1080
- };
1081
- /**
1082
- * List of required field names
1083
- */
1084
- required?: string[];
1085
- };
1086
- }
1087
- export interface SessionUiHandlePendingElicitationResult {
1074
+ * Remove directories and their contents recursively
1075
+ */
1076
+ recursive?: boolean;
1088
1077
  /**
1089
- * Whether the response was accepted. False if the request was already resolved by another client.
1078
+ * Ignore errors if the path does not exist
1090
1079
  */
1091
- success: boolean;
1080
+ force?: boolean;
1092
1081
  }
1093
- export interface SessionUiHandlePendingElicitationParams {
1082
+ export interface SessionFsSetProviderRequest {
1094
1083
  /**
1095
- * Target session identifier
1084
+ * Initial working directory for sessions
1096
1085
  */
1097
- sessionId: string;
1086
+ initialCwd: string;
1098
1087
  /**
1099
- * The unique request ID from the elicitation.requested event
1088
+ * Path within each session's SessionFs where the runtime stores files for that session
1100
1089
  */
1101
- requestId: string;
1102
- /**
1103
- * The elicitation response (accept with form values, decline, or cancel)
1104
- */
1105
- result: {
1106
- /**
1107
- * The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
1108
- */
1109
- action: "accept" | "decline" | "cancel";
1110
- /**
1111
- * The form values submitted by the user (present when action is 'accept')
1112
- */
1113
- content?: {
1114
- [k: string]: string | number | boolean | string[];
1115
- };
1116
- };
1090
+ sessionStatePath: string;
1091
+ conventions: SessionFsSetProviderConventions;
1117
1092
  }
1118
- export interface SessionPermissionsHandlePendingPermissionRequestResult {
1093
+ export interface SessionFsSetProviderResult {
1119
1094
  /**
1120
- * Whether the permission request was handled successfully
1095
+ * Whether the provider was set successfully
1121
1096
  */
1122
1097
  success: boolean;
1123
1098
  }
1124
- export interface SessionPermissionsHandlePendingPermissionRequestParams {
1099
+ export interface SessionFsStatRequest {
1125
1100
  /**
1126
1101
  * Target session identifier
1127
1102
  */
1128
1103
  sessionId: string;
1129
- requestId: string;
1130
- result: {
1131
- kind: "approved";
1132
- } | {
1133
- kind: "denied-by-rules";
1134
- rules: unknown[];
1135
- } | {
1136
- kind: "denied-no-approval-rule-and-could-not-request-from-user";
1137
- } | {
1138
- kind: "denied-interactively-by-user";
1139
- feedback?: string;
1140
- } | {
1141
- kind: "denied-by-content-exclusion-policy";
1142
- path: string;
1143
- message: string;
1144
- } | {
1145
- kind: "denied-by-permission-request-hook";
1146
- message?: string;
1147
- interrupt?: boolean;
1148
- };
1104
+ /**
1105
+ * Path using SessionFs conventions
1106
+ */
1107
+ path: string;
1149
1108
  }
1150
- export interface SessionLogResult {
1109
+ export interface SessionFsStatResult {
1151
1110
  /**
1152
- * The unique identifier of the emitted session event
1111
+ * Whether the path is a file
1153
1112
  */
1154
- eventId: string;
1113
+ isFile: boolean;
1114
+ /**
1115
+ * Whether the path is a directory
1116
+ */
1117
+ isDirectory: boolean;
1118
+ /**
1119
+ * File size in bytes
1120
+ */
1121
+ size: number;
1122
+ /**
1123
+ * ISO 8601 timestamp of last modification
1124
+ */
1125
+ mtime: string;
1126
+ /**
1127
+ * ISO 8601 timestamp of creation
1128
+ */
1129
+ birthtime: string;
1130
+ error?: SessionFsError;
1155
1131
  }
1156
- export interface SessionLogParams {
1132
+ export interface SessionFsWriteFileRequest {
1157
1133
  /**
1158
1134
  * Target session identifier
1159
1135
  */
1160
1136
  sessionId: string;
1161
1137
  /**
1162
- * Human-readable message
1138
+ * Path using SessionFs conventions
1163
1139
  */
1164
- message: string;
1140
+ path: string;
1165
1141
  /**
1166
- * Log severity level. Determines how the message is displayed in the timeline. Defaults to "info".
1142
+ * Content to write
1167
1143
  */
1168
- level?: "info" | "warning" | "error";
1144
+ content: string;
1169
1145
  /**
1170
- * When true, the message is transient and not persisted to the session event log on disk
1146
+ * Optional POSIX-style mode for newly created files
1171
1147
  */
1172
- ephemeral?: boolean;
1148
+ mode?: number;
1149
+ }
1150
+ /** @experimental */
1151
+ export interface SessionsForkRequest {
1173
1152
  /**
1174
- * Optional URL the user can open in their browser for more details
1153
+ * Source session ID to fork from
1175
1154
  */
1176
- url?: string;
1177
- }
1178
- export interface SessionShellExecResult {
1155
+ sessionId: string;
1179
1156
  /**
1180
- * Unique identifier for tracking streamed output
1157
+ * Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included.
1181
1158
  */
1182
- processId: string;
1159
+ toEventId?: string;
1183
1160
  }
1184
- export interface SessionShellExecParams {
1161
+ /** @experimental */
1162
+ export interface SessionsForkResult {
1185
1163
  /**
1186
- * Target session identifier
1164
+ * The new forked session's ID
1187
1165
  */
1188
1166
  sessionId: string;
1167
+ }
1168
+ export interface ShellExecRequest {
1189
1169
  /**
1190
1170
  * Shell command to execute
1191
1171
  */
@@ -1199,378 +1179,585 @@ export interface SessionShellExecParams {
1199
1179
  */
1200
1180
  timeout?: number;
1201
1181
  }
1202
- export interface SessionShellKillResult {
1182
+ export interface ShellExecResult {
1183
+ /**
1184
+ * Unique identifier for tracking streamed output
1185
+ */
1186
+ processId: string;
1187
+ }
1188
+ export interface ShellKillRequest {
1189
+ /**
1190
+ * Process identifier returned by shell.exec
1191
+ */
1192
+ processId: string;
1193
+ signal?: ShellKillSignal;
1194
+ }
1195
+ export interface ShellKillResult {
1203
1196
  /**
1204
1197
  * Whether the signal was sent successfully
1205
1198
  */
1206
1199
  killed: boolean;
1207
1200
  }
1208
- export interface SessionShellKillParams {
1201
+ export interface Skill {
1209
1202
  /**
1210
- * Target session identifier
1203
+ * Unique identifier for the skill
1211
1204
  */
1212
- sessionId: string;
1205
+ name: string;
1213
1206
  /**
1214
- * Process identifier returned by shell.exec
1207
+ * Description of what the skill does
1215
1208
  */
1216
- processId: string;
1209
+ description: string;
1217
1210
  /**
1218
- * Signal to send (default: SIGTERM)
1211
+ * Source location type (e.g., project, personal, plugin)
1219
1212
  */
1220
- signal?: "SIGTERM" | "SIGKILL" | "SIGINT";
1221
- }
1222
- /** @experimental */
1223
- export interface SessionHistoryCompactResult {
1213
+ source: string;
1224
1214
  /**
1225
- * Whether compaction completed successfully
1215
+ * Whether the skill can be invoked by the user as a slash command
1226
1216
  */
1227
- success: boolean;
1217
+ userInvocable: boolean;
1228
1218
  /**
1229
- * Number of tokens freed by compaction
1219
+ * Whether the skill is currently enabled
1230
1220
  */
1231
- tokensRemoved: number;
1221
+ enabled: boolean;
1232
1222
  /**
1233
- * Number of messages removed during compaction
1223
+ * Absolute path to the skill file
1234
1224
  */
1235
- messagesRemoved: number;
1225
+ path?: string;
1236
1226
  }
1237
1227
  /** @experimental */
1238
- export interface SessionHistoryCompactParams {
1228
+ export interface SkillList {
1239
1229
  /**
1240
- * Target session identifier
1230
+ * Available skills
1241
1231
  */
1242
- sessionId: string;
1232
+ skills: Skill[];
1243
1233
  }
1244
- /** @experimental */
1245
- export interface SessionHistoryTruncateResult {
1234
+ export interface SkillsConfigSetDisabledSkillsRequest {
1246
1235
  /**
1247
- * Number of events that were removed
1236
+ * List of skill names to disable
1248
1237
  */
1249
- eventsRemoved: number;
1238
+ disabledSkills: string[];
1250
1239
  }
1251
1240
  /** @experimental */
1252
- export interface SessionHistoryTruncateParams {
1241
+ export interface SkillsDisableRequest {
1253
1242
  /**
1254
- * Target session identifier
1243
+ * Name of the skill to disable
1255
1244
  */
1256
- sessionId: string;
1245
+ name: string;
1246
+ }
1247
+ export interface SkillsDiscoverRequest {
1257
1248
  /**
1258
- * Event ID to truncate to. This event and all events after it are removed from the session.
1249
+ * Optional list of project directory paths to scan for project-scoped skills
1259
1250
  */
1260
- eventId: string;
1261
- }
1262
- export interface SessionFsReadFileResult {
1251
+ projectPaths?: string[];
1263
1252
  /**
1264
- * File content as UTF-8 string
1253
+ * Optional list of additional skill directory paths to include
1265
1254
  */
1266
- content: string;
1255
+ skillDirectories?: string[];
1267
1256
  }
1268
- export interface SessionFsReadFileParams {
1257
+ /** @experimental */
1258
+ export interface SkillsEnableRequest {
1269
1259
  /**
1270
- * Target session identifier
1260
+ * Name of the skill to enable
1271
1261
  */
1272
- sessionId: string;
1262
+ name: string;
1263
+ }
1264
+ export interface Tool {
1273
1265
  /**
1274
- * Path using SessionFs conventions
1266
+ * Tool identifier (e.g., "bash", "grep", "str_replace_editor")
1275
1267
  */
1276
- path: string;
1277
- }
1278
- export interface SessionFsWriteFileParams {
1268
+ name: string;
1279
1269
  /**
1280
- * Target session identifier
1270
+ * Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP tools)
1281
1271
  */
1282
- sessionId: string;
1272
+ namespacedName?: string;
1283
1273
  /**
1284
- * Path using SessionFs conventions
1274
+ * Description of what the tool does
1285
1275
  */
1286
- path: string;
1276
+ description: string;
1287
1277
  /**
1288
- * Content to write
1278
+ * JSON Schema for the tool's input parameters
1289
1279
  */
1290
- content: string;
1280
+ parameters?: {
1281
+ [k: string]: unknown;
1282
+ };
1291
1283
  /**
1292
- * Optional POSIX-style mode for newly created files
1284
+ * Optional instructions for how to use this tool effectively
1293
1285
  */
1294
- mode?: number;
1286
+ instructions?: string;
1295
1287
  }
1296
- export interface SessionFsAppendFileParams {
1288
+ export interface ToolCallResult {
1297
1289
  /**
1298
- * Target session identifier
1290
+ * Text result to send back to the LLM
1299
1291
  */
1300
- sessionId: string;
1292
+ textResultForLlm: string;
1301
1293
  /**
1302
- * Path using SessionFs conventions
1294
+ * Type of the tool result
1303
1295
  */
1304
- path: string;
1296
+ resultType?: string;
1305
1297
  /**
1306
- * Content to append
1298
+ * Error message if the tool call failed
1307
1299
  */
1308
- content: string;
1300
+ error?: string;
1309
1301
  /**
1310
- * Optional POSIX-style mode for newly created files
1302
+ * Telemetry data from tool execution
1311
1303
  */
1312
- mode?: number;
1304
+ toolTelemetry?: {
1305
+ [k: string]: unknown;
1306
+ };
1313
1307
  }
1314
- export interface SessionFsExistsResult {
1308
+ export interface ToolList {
1315
1309
  /**
1316
- * Whether the path exists
1310
+ * List of available built-in tools with metadata
1317
1311
  */
1318
- exists: boolean;
1312
+ tools: Tool[];
1319
1313
  }
1320
- export interface SessionFsExistsParams {
1314
+ export interface ToolsHandlePendingToolCallRequest {
1321
1315
  /**
1322
- * Target session identifier
1316
+ * Request ID of the pending tool call
1323
1317
  */
1324
- sessionId: string;
1318
+ requestId: string;
1319
+ result?: ToolsHandlePendingToolCall;
1325
1320
  /**
1326
- * Path using SessionFs conventions
1321
+ * Error message if the tool call failed
1327
1322
  */
1328
- path: string;
1323
+ error?: string;
1329
1324
  }
1330
- export interface SessionFsStatResult {
1325
+ export interface ToolsListRequest {
1331
1326
  /**
1332
- * Whether the path is a file
1327
+ * Optional model ID — when provided, the returned tool list reflects model-specific overrides
1333
1328
  */
1334
- isFile: boolean;
1329
+ model?: string;
1330
+ }
1331
+ export interface UIElicitationArrayAnyOfField {
1332
+ type: "array";
1333
+ title?: string;
1334
+ description?: string;
1335
+ minItems?: number;
1336
+ maxItems?: number;
1337
+ items: UIElicitationArrayAnyOfFieldItems;
1338
+ default?: string[];
1339
+ }
1340
+ export interface UIElicitationArrayAnyOfFieldItems {
1341
+ anyOf: UIElicitationArrayAnyOfFieldItemsAnyOf[];
1342
+ }
1343
+ export interface UIElicitationArrayAnyOfFieldItemsAnyOf {
1344
+ const: string;
1345
+ title: string;
1346
+ }
1347
+ export interface UIElicitationArrayEnumField {
1348
+ type: "array";
1349
+ title?: string;
1350
+ description?: string;
1351
+ minItems?: number;
1352
+ maxItems?: number;
1353
+ items: UIElicitationArrayEnumFieldItems;
1354
+ default?: string[];
1355
+ }
1356
+ export interface UIElicitationArrayEnumFieldItems {
1357
+ type: "string";
1358
+ enum: string[];
1359
+ }
1360
+ export interface UIElicitationRequest {
1335
1361
  /**
1336
- * Whether the path is a directory
1362
+ * Message describing what information is needed from the user
1337
1363
  */
1338
- isDirectory: boolean;
1364
+ message: string;
1365
+ requestedSchema: UIElicitationSchema;
1366
+ }
1367
+ /**
1368
+ * JSON Schema describing the form fields to present to the user
1369
+ *
1370
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1371
+ * via the `definition` "UIElicitationSchema".
1372
+ */
1373
+ export interface UIElicitationSchema {
1339
1374
  /**
1340
- * File size in bytes
1375
+ * Schema type indicator (always 'object')
1341
1376
  */
1342
- size: number;
1377
+ type: "object";
1343
1378
  /**
1344
- * ISO 8601 timestamp of last modification
1379
+ * Form field definitions, keyed by field name
1345
1380
  */
1346
- mtime: string;
1381
+ properties: {
1382
+ [k: string]: UIElicitationSchemaProperty;
1383
+ };
1347
1384
  /**
1348
- * ISO 8601 timestamp of creation
1349
- */
1350
- birthtime: string;
1385
+ * List of required field names
1386
+ */
1387
+ required?: string[];
1388
+ }
1389
+ export interface UIElicitationStringEnumField {
1390
+ type: "string";
1391
+ title?: string;
1392
+ description?: string;
1393
+ enum: string[];
1394
+ enumNames?: string[];
1395
+ default?: string;
1396
+ }
1397
+ export interface UIElicitationStringOneOfField {
1398
+ type: "string";
1399
+ title?: string;
1400
+ description?: string;
1401
+ oneOf: UIElicitationStringOneOfFieldOneOf[];
1402
+ default?: string;
1403
+ }
1404
+ export interface UIElicitationStringOneOfFieldOneOf {
1405
+ const: string;
1406
+ title: string;
1407
+ }
1408
+ export interface UIElicitationSchemaPropertyBoolean {
1409
+ type: "boolean";
1410
+ title?: string;
1411
+ description?: string;
1412
+ default?: boolean;
1413
+ }
1414
+ export interface UIElicitationSchemaPropertyString {
1415
+ type: "string";
1416
+ title?: string;
1417
+ description?: string;
1418
+ minLength?: number;
1419
+ maxLength?: number;
1420
+ format?: UIElicitationSchemaPropertyStringFormat;
1421
+ default?: string;
1422
+ }
1423
+ export interface UIElicitationSchemaPropertyNumber {
1424
+ type: UIElicitationSchemaPropertyNumberType;
1425
+ title?: string;
1426
+ description?: string;
1427
+ minimum?: number;
1428
+ maximum?: number;
1429
+ default?: number;
1430
+ }
1431
+ /**
1432
+ * The elicitation response (accept with form values, decline, or cancel)
1433
+ *
1434
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1435
+ * via the `definition` "UIElicitationResponse".
1436
+ */
1437
+ export interface UIElicitationResponse {
1438
+ action: UIElicitationResponseAction;
1439
+ content?: UIElicitationResponseContent;
1440
+ }
1441
+ /**
1442
+ * The form values submitted by the user (present when action is 'accept')
1443
+ *
1444
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1445
+ * via the `definition` "UIElicitationResponseContent".
1446
+ */
1447
+ export interface UIElicitationResponseContent {
1448
+ [k: string]: UIElicitationFieldValue;
1351
1449
  }
1352
- export interface SessionFsStatParams {
1450
+ export interface UIElicitationResult {
1353
1451
  /**
1354
- * Target session identifier
1452
+ * Whether the response was accepted. False if the request was already resolved by another client.
1355
1453
  */
1356
- sessionId: string;
1454
+ success: boolean;
1455
+ }
1456
+ export interface UIHandlePendingElicitationRequest {
1357
1457
  /**
1358
- * Path using SessionFs conventions
1458
+ * The unique request ID from the elicitation.requested event
1359
1459
  */
1360
- path: string;
1460
+ requestId: string;
1461
+ result: UIElicitationResponse;
1361
1462
  }
1362
- export interface SessionFsMkdirParams {
1463
+ /** @experimental */
1464
+ export interface UsageGetMetricsResult {
1363
1465
  /**
1364
- * Target session identifier
1466
+ * Total user-initiated premium request cost across all models (may be fractional due to multipliers)
1365
1467
  */
1366
- sessionId: string;
1468
+ totalPremiumRequestCost: number;
1367
1469
  /**
1368
- * Path using SessionFs conventions
1470
+ * Raw count of user-initiated API requests
1369
1471
  */
1370
- path: string;
1472
+ totalUserRequests: number;
1371
1473
  /**
1372
- * Create parent directories as needed
1474
+ * Total time spent in model API calls (milliseconds)
1373
1475
  */
1374
- recursive?: boolean;
1476
+ totalApiDurationMs: number;
1375
1477
  /**
1376
- * Optional POSIX-style mode for newly created directories
1478
+ * Session start timestamp (epoch milliseconds)
1377
1479
  */
1378
- mode?: number;
1379
- }
1380
- export interface SessionFsReaddirResult {
1480
+ sessionStartTime: number;
1481
+ codeChanges: UsageMetricsCodeChanges;
1381
1482
  /**
1382
- * Entry names in the directory
1483
+ * Per-model token and request metrics, keyed by model identifier
1383
1484
  */
1384
- entries: string[];
1385
- }
1386
- export interface SessionFsReaddirParams {
1485
+ modelMetrics: {
1486
+ [k: string]: UsageMetricsModelMetric;
1487
+ };
1387
1488
  /**
1388
- * Target session identifier
1489
+ * Currently active model identifier
1389
1490
  */
1390
- sessionId: string;
1491
+ currentModel?: string;
1391
1492
  /**
1392
- * Path using SessionFs conventions
1493
+ * Input tokens from the most recent main-agent API call
1393
1494
  */
1394
- path: string;
1495
+ lastCallInputTokens: number;
1496
+ /**
1497
+ * Output tokens from the most recent main-agent API call
1498
+ */
1499
+ lastCallOutputTokens: number;
1395
1500
  }
1396
- export interface SessionFsReaddirWithTypesResult {
1501
+ /**
1502
+ * Aggregated code change metrics
1503
+ *
1504
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1505
+ * via the `definition` "UsageMetricsCodeChanges".
1506
+ */
1507
+ export interface UsageMetricsCodeChanges {
1397
1508
  /**
1398
- * Directory entries with type information
1509
+ * Total lines of code added
1510
+ */
1511
+ linesAdded: number;
1512
+ /**
1513
+ * Total lines of code removed
1514
+ */
1515
+ linesRemoved: number;
1516
+ /**
1517
+ * Number of distinct files modified
1399
1518
  */
1400
- entries: {
1401
- /**
1402
- * Entry name
1403
- */
1404
- name: string;
1405
- /**
1406
- * Entry type
1407
- */
1408
- type: "file" | "directory";
1409
- }[];
1519
+ filesModifiedCount: number;
1410
1520
  }
1411
- export interface SessionFsReaddirWithTypesParams {
1521
+ export interface UsageMetricsModelMetric {
1522
+ requests: UsageMetricsModelMetricRequests;
1523
+ usage: UsageMetricsModelMetricUsage;
1524
+ }
1525
+ /**
1526
+ * Request count and cost metrics for this model
1527
+ *
1528
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1529
+ * via the `definition` "UsageMetricsModelMetricRequests".
1530
+ */
1531
+ export interface UsageMetricsModelMetricRequests {
1412
1532
  /**
1413
- * Target session identifier
1533
+ * Number of API requests made with this model
1414
1534
  */
1415
- sessionId: string;
1535
+ count: number;
1416
1536
  /**
1417
- * Path using SessionFs conventions
1537
+ * User-initiated premium request cost (with multiplier applied)
1418
1538
  */
1419
- path: string;
1539
+ cost: number;
1420
1540
  }
1421
- export interface SessionFsRmParams {
1541
+ /**
1542
+ * Token usage metrics for this model
1543
+ *
1544
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1545
+ * via the `definition` "UsageMetricsModelMetricUsage".
1546
+ */
1547
+ export interface UsageMetricsModelMetricUsage {
1422
1548
  /**
1423
- * Target session identifier
1549
+ * Total input tokens consumed
1424
1550
  */
1425
- sessionId: string;
1551
+ inputTokens: number;
1426
1552
  /**
1427
- * Path using SessionFs conventions
1553
+ * Total output tokens produced
1554
+ */
1555
+ outputTokens: number;
1556
+ /**
1557
+ * Total tokens read from prompt cache
1558
+ */
1559
+ cacheReadTokens: number;
1560
+ /**
1561
+ * Total tokens written to prompt cache
1562
+ */
1563
+ cacheWriteTokens: number;
1564
+ /**
1565
+ * Total output tokens used for reasoning
1566
+ */
1567
+ reasoningTokens?: number;
1568
+ }
1569
+ export interface WorkspacesCreateFileRequest {
1570
+ /**
1571
+ * Relative path within the workspace files directory
1428
1572
  */
1429
1573
  path: string;
1430
1574
  /**
1431
- * Remove directories and their contents recursively
1575
+ * File content to write as a UTF-8 string
1432
1576
  */
1433
- recursive?: boolean;
1577
+ content: string;
1578
+ }
1579
+ export interface WorkspacesGetWorkspaceResult {
1434
1580
  /**
1435
- * Ignore errors if the path does not exist
1581
+ * Current workspace metadata, or null if not available
1436
1582
  */
1437
- force?: boolean;
1583
+ workspace: {
1584
+ id: string;
1585
+ cwd?: string;
1586
+ git_root?: string;
1587
+ repository?: string;
1588
+ host_type?: "github" | "ado";
1589
+ branch?: string;
1590
+ summary?: string;
1591
+ name?: string;
1592
+ summary_count?: number;
1593
+ created_at?: string;
1594
+ updated_at?: string;
1595
+ remote_steerable?: boolean;
1596
+ mc_task_id?: string;
1597
+ mc_session_id?: string;
1598
+ mc_last_event_id?: string;
1599
+ session_sync_level?: "local" | "user" | "repo_and_user";
1600
+ chronicle_sync_dismissed?: boolean;
1601
+ } | null;
1438
1602
  }
1439
- export interface SessionFsRenameParams {
1603
+ export interface WorkspacesListFilesResult {
1440
1604
  /**
1441
- * Target session identifier
1605
+ * Relative file paths in the workspace files directory
1442
1606
  */
1443
- sessionId: string;
1607
+ files: string[];
1608
+ }
1609
+ export interface WorkspacesReadFileRequest {
1444
1610
  /**
1445
- * Source path using SessionFs conventions
1611
+ * Relative path within the workspace files directory
1446
1612
  */
1447
- src: string;
1613
+ path: string;
1614
+ }
1615
+ export interface WorkspacesReadFileResult {
1448
1616
  /**
1449
- * Destination path using SessionFs conventions
1617
+ * File content as a UTF-8 string
1450
1618
  */
1451
- dest: string;
1619
+ content: string;
1452
1620
  }
1453
1621
  /** Create typed server-scoped RPC methods (no session required). */
1454
1622
  export declare function createServerRpc(connection: MessageConnection): {
1455
- ping: (params: PingParams) => Promise<PingResult>;
1623
+ ping: (params: PingRequest) => Promise<PingResult>;
1456
1624
  models: {
1457
- list: () => Promise<ModelsListResult>;
1625
+ list: () => Promise<ModelList>;
1458
1626
  };
1459
1627
  tools: {
1460
- list: (params: ToolsListParams) => Promise<ToolsListResult>;
1628
+ list: (params: ToolsListRequest) => Promise<ToolList>;
1461
1629
  };
1462
1630
  account: {
1463
1631
  getQuota: () => Promise<AccountGetQuotaResult>;
1464
1632
  };
1465
1633
  mcp: {
1466
1634
  config: {
1467
- list: () => Promise<McpConfigListResult>;
1468
- add: (params: McpConfigAddParams) => Promise<void>;
1469
- update: (params: McpConfigUpdateParams) => Promise<void>;
1470
- remove: (params: McpConfigRemoveParams) => Promise<void>;
1635
+ list: () => Promise<McpConfigList>;
1636
+ add: (params: McpConfigAddRequest) => Promise<void>;
1637
+ update: (params: McpConfigUpdateRequest) => Promise<void>;
1638
+ remove: (params: McpConfigRemoveRequest) => Promise<void>;
1639
+ };
1640
+ discover: (params: McpDiscoverRequest) => Promise<McpDiscoverResult>;
1641
+ };
1642
+ skills: {
1643
+ config: {
1644
+ setDisabledSkills: (params: SkillsConfigSetDisabledSkillsRequest) => Promise<void>;
1471
1645
  };
1646
+ discover: (params: SkillsDiscoverRequest) => Promise<ServerSkillList>;
1472
1647
  };
1473
1648
  sessionFs: {
1474
- setProvider: (params: SessionFsSetProviderParams) => Promise<SessionFsSetProviderResult>;
1649
+ setProvider: (params: SessionFsSetProviderRequest) => Promise<SessionFsSetProviderResult>;
1475
1650
  };
1476
1651
  /** @experimental */
1477
1652
  sessions: {
1478
- fork: (params: SessionsForkParams) => Promise<SessionsForkResult>;
1653
+ fork: (params: SessionsForkRequest) => Promise<SessionsForkResult>;
1479
1654
  };
1480
1655
  };
1481
1656
  /** Create typed session-scoped RPC methods. */
1482
1657
  export declare function createSessionRpc(connection: MessageConnection, sessionId: string): {
1483
1658
  model: {
1484
- getCurrent: () => Promise<SessionModelGetCurrentResult>;
1485
- switchTo: (params: Omit<SessionModelSwitchToParams, "sessionId">) => Promise<SessionModelSwitchToResult>;
1659
+ getCurrent: () => Promise<CurrentModel>;
1660
+ switchTo: (params: Omit<ModelSwitchToRequest, "sessionId">) => Promise<ModelSwitchToResult>;
1486
1661
  };
1487
1662
  mode: {
1488
- get: () => Promise<SessionModeGetResult>;
1489
- set: (params: Omit<SessionModeSetParams, "sessionId">) => Promise<SessionModeSetResult>;
1663
+ get: () => Promise<SessionMode>;
1664
+ set: (params: Omit<ModeSetRequest, "sessionId">) => Promise<void>;
1665
+ };
1666
+ name: {
1667
+ get: () => Promise<NameGetResult>;
1668
+ set: (params: Omit<NameSetRequest, "sessionId">) => Promise<void>;
1490
1669
  };
1491
1670
  plan: {
1492
- read: () => Promise<SessionPlanReadResult>;
1493
- update: (params: Omit<SessionPlanUpdateParams, "sessionId">) => Promise<SessionPlanUpdateResult>;
1494
- delete: () => Promise<SessionPlanDeleteResult>;
1671
+ read: () => Promise<PlanReadResult>;
1672
+ update: (params: Omit<PlanUpdateRequest, "sessionId">) => Promise<void>;
1673
+ delete: () => Promise<void>;
1495
1674
  };
1496
- workspace: {
1497
- listFiles: () => Promise<SessionWorkspaceListFilesResult>;
1498
- readFile: (params: Omit<SessionWorkspaceReadFileParams, "sessionId">) => Promise<SessionWorkspaceReadFileResult>;
1499
- createFile: (params: Omit<SessionWorkspaceCreateFileParams, "sessionId">) => Promise<SessionWorkspaceCreateFileResult>;
1675
+ workspaces: {
1676
+ getWorkspace: () => Promise<WorkspacesGetWorkspaceResult>;
1677
+ listFiles: () => Promise<WorkspacesListFilesResult>;
1678
+ readFile: (params: Omit<WorkspacesReadFileRequest, "sessionId">) => Promise<WorkspacesReadFileResult>;
1679
+ createFile: (params: Omit<WorkspacesCreateFileRequest, "sessionId">) => Promise<void>;
1680
+ };
1681
+ instructions: {
1682
+ getSources: () => Promise<InstructionsGetSourcesResult>;
1500
1683
  };
1501
1684
  /** @experimental */
1502
1685
  fleet: {
1503
- start: (params: Omit<SessionFleetStartParams, "sessionId">) => Promise<SessionFleetStartResult>;
1686
+ start: (params: Omit<FleetStartRequest, "sessionId">) => Promise<FleetStartResult>;
1504
1687
  };
1505
1688
  /** @experimental */
1506
1689
  agent: {
1507
- list: () => Promise<SessionAgentListResult>;
1508
- getCurrent: () => Promise<SessionAgentGetCurrentResult>;
1509
- select: (params: Omit<SessionAgentSelectParams, "sessionId">) => Promise<SessionAgentSelectResult>;
1510
- deselect: () => Promise<SessionAgentDeselectResult>;
1511
- reload: () => Promise<SessionAgentReloadResult>;
1690
+ list: () => Promise<AgentList>;
1691
+ getCurrent: () => Promise<AgentGetCurrentResult>;
1692
+ select: (params: Omit<AgentSelectRequest, "sessionId">) => Promise<AgentSelectResult>;
1693
+ deselect: () => Promise<void>;
1694
+ reload: () => Promise<AgentReloadResult>;
1512
1695
  };
1513
1696
  /** @experimental */
1514
1697
  skills: {
1515
- list: () => Promise<SessionSkillsListResult>;
1516
- enable: (params: Omit<SessionSkillsEnableParams, "sessionId">) => Promise<SessionSkillsEnableResult>;
1517
- disable: (params: Omit<SessionSkillsDisableParams, "sessionId">) => Promise<SessionSkillsDisableResult>;
1518
- reload: () => Promise<SessionSkillsReloadResult>;
1698
+ list: () => Promise<SkillList>;
1699
+ enable: (params: Omit<SkillsEnableRequest, "sessionId">) => Promise<void>;
1700
+ disable: (params: Omit<SkillsDisableRequest, "sessionId">) => Promise<void>;
1701
+ reload: () => Promise<void>;
1519
1702
  };
1520
1703
  /** @experimental */
1521
1704
  mcp: {
1522
- list: () => Promise<SessionMcpListResult>;
1523
- enable: (params: Omit<SessionMcpEnableParams, "sessionId">) => Promise<SessionMcpEnableResult>;
1524
- disable: (params: Omit<SessionMcpDisableParams, "sessionId">) => Promise<SessionMcpDisableResult>;
1525
- reload: () => Promise<SessionMcpReloadResult>;
1705
+ list: () => Promise<McpServerList>;
1706
+ enable: (params: Omit<McpEnableRequest, "sessionId">) => Promise<void>;
1707
+ disable: (params: Omit<McpDisableRequest, "sessionId">) => Promise<void>;
1708
+ reload: () => Promise<void>;
1526
1709
  };
1527
1710
  /** @experimental */
1528
1711
  plugins: {
1529
- list: () => Promise<SessionPluginsListResult>;
1712
+ list: () => Promise<PluginList>;
1530
1713
  };
1531
1714
  /** @experimental */
1532
1715
  extensions: {
1533
- list: () => Promise<SessionExtensionsListResult>;
1534
- enable: (params: Omit<SessionExtensionsEnableParams, "sessionId">) => Promise<SessionExtensionsEnableResult>;
1535
- disable: (params: Omit<SessionExtensionsDisableParams, "sessionId">) => Promise<SessionExtensionsDisableResult>;
1536
- reload: () => Promise<SessionExtensionsReloadResult>;
1716
+ list: () => Promise<ExtensionList>;
1717
+ enable: (params: Omit<ExtensionsEnableRequest, "sessionId">) => Promise<void>;
1718
+ disable: (params: Omit<ExtensionsDisableRequest, "sessionId">) => Promise<void>;
1719
+ reload: () => Promise<void>;
1537
1720
  };
1538
1721
  tools: {
1539
- handlePendingToolCall: (params: Omit<SessionToolsHandlePendingToolCallParams, "sessionId">) => Promise<SessionToolsHandlePendingToolCallResult>;
1722
+ handlePendingToolCall: (params: Omit<ToolsHandlePendingToolCallRequest, "sessionId">) => Promise<HandleToolCallResult>;
1540
1723
  };
1541
1724
  commands: {
1542
- handlePendingCommand: (params: Omit<SessionCommandsHandlePendingCommandParams, "sessionId">) => Promise<SessionCommandsHandlePendingCommandResult>;
1725
+ handlePendingCommand: (params: Omit<CommandsHandlePendingCommandRequest, "sessionId">) => Promise<CommandsHandlePendingCommandResult>;
1543
1726
  };
1544
1727
  ui: {
1545
- elicitation: (params: Omit<SessionUiElicitationParams, "sessionId">) => Promise<SessionUiElicitationResult>;
1546
- handlePendingElicitation: (params: Omit<SessionUiHandlePendingElicitationParams, "sessionId">) => Promise<SessionUiHandlePendingElicitationResult>;
1728
+ elicitation: (params: Omit<UIElicitationRequest, "sessionId">) => Promise<UIElicitationResponse>;
1729
+ handlePendingElicitation: (params: Omit<UIHandlePendingElicitationRequest, "sessionId">) => Promise<UIElicitationResult>;
1547
1730
  };
1548
1731
  permissions: {
1549
- handlePendingPermissionRequest: (params: Omit<SessionPermissionsHandlePendingPermissionRequestParams, "sessionId">) => Promise<SessionPermissionsHandlePendingPermissionRequestResult>;
1732
+ handlePendingPermissionRequest: (params: Omit<PermissionDecisionRequest, "sessionId">) => Promise<PermissionRequestResult>;
1550
1733
  };
1551
- log: (params: Omit<SessionLogParams, "sessionId">) => Promise<SessionLogResult>;
1734
+ log: (params: Omit<LogRequest, "sessionId">) => Promise<LogResult>;
1552
1735
  shell: {
1553
- exec: (params: Omit<SessionShellExecParams, "sessionId">) => Promise<SessionShellExecResult>;
1554
- kill: (params: Omit<SessionShellKillParams, "sessionId">) => Promise<SessionShellKillResult>;
1736
+ exec: (params: Omit<ShellExecRequest, "sessionId">) => Promise<ShellExecResult>;
1737
+ kill: (params: Omit<ShellKillRequest, "sessionId">) => Promise<ShellKillResult>;
1555
1738
  };
1556
1739
  /** @experimental */
1557
1740
  history: {
1558
- compact: () => Promise<SessionHistoryCompactResult>;
1559
- truncate: (params: Omit<SessionHistoryTruncateParams, "sessionId">) => Promise<SessionHistoryTruncateResult>;
1741
+ compact: () => Promise<HistoryCompactResult>;
1742
+ truncate: (params: Omit<HistoryTruncateRequest, "sessionId">) => Promise<HistoryTruncateResult>;
1743
+ };
1744
+ /** @experimental */
1745
+ usage: {
1746
+ getMetrics: () => Promise<UsageGetMetricsResult>;
1560
1747
  };
1561
1748
  };
1562
1749
  /** Handler for `sessionFs` client session API methods. */
1563
1750
  export interface SessionFsHandler {
1564
- readFile(params: SessionFsReadFileParams): Promise<SessionFsReadFileResult>;
1565
- writeFile(params: SessionFsWriteFileParams): Promise<void>;
1566
- appendFile(params: SessionFsAppendFileParams): Promise<void>;
1567
- exists(params: SessionFsExistsParams): Promise<SessionFsExistsResult>;
1568
- stat(params: SessionFsStatParams): Promise<SessionFsStatResult>;
1569
- mkdir(params: SessionFsMkdirParams): Promise<void>;
1570
- readdir(params: SessionFsReaddirParams): Promise<SessionFsReaddirResult>;
1571
- readdirWithTypes(params: SessionFsReaddirWithTypesParams): Promise<SessionFsReaddirWithTypesResult>;
1572
- rm(params: SessionFsRmParams): Promise<void>;
1573
- rename(params: SessionFsRenameParams): Promise<void>;
1751
+ readFile(params: SessionFsReadFileRequest): Promise<SessionFsReadFileResult>;
1752
+ writeFile(params: SessionFsWriteFileRequest): Promise<SessionFsError | undefined>;
1753
+ appendFile(params: SessionFsAppendFileRequest): Promise<SessionFsError | undefined>;
1754
+ exists(params: SessionFsExistsRequest): Promise<SessionFsExistsResult>;
1755
+ stat(params: SessionFsStatRequest): Promise<SessionFsStatResult>;
1756
+ mkdir(params: SessionFsMkdirRequest): Promise<SessionFsError | undefined>;
1757
+ readdir(params: SessionFsReaddirRequest): Promise<SessionFsReaddirResult>;
1758
+ readdirWithTypes(params: SessionFsReaddirWithTypesRequest): Promise<SessionFsReaddirWithTypesResult>;
1759
+ rm(params: SessionFsRmRequest): Promise<SessionFsError | undefined>;
1760
+ rename(params: SessionFsRenameRequest): Promise<SessionFsError | undefined>;
1574
1761
  }
1575
1762
  /** All client session API handler groups. */
1576
1763
  export interface ClientSessionApiHandlers {