@github/copilot-sdk 1.0.15-preview.1 → 1.0.15-preview.3

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.
package/README.md CHANGED
@@ -18,11 +18,6 @@ The checked-in `copilotCliVersion` in `package.json` and compiled metadata in
18
18
  `src/cliVersion.ts` use a development placeholder. The public SDK snapshot
19
19
  replaces both with the CLI version published for that snapshot.
20
20
 
21
- Do not change these pins for runtime-repository development. If they contain
22
- `0.0.0-dev`, use the same-checkout runtime; release snapshot export owns replacing
23
- development placeholders with a published CLI version. See
24
- [checkout preparation](../CONTRIBUTING.md#testing-an-unreleased-runtime-api).
25
-
26
21
  `npm run pack:release` builds the main package and all platform packages. Set
27
22
  `COPILOT_CLI_DOWNLOAD_BASE_URL` to use a release mirror while packaging.
28
23
  Release workflows instead set `COPILOT_SDK_RUNTIME_PACKAGE_DIR` to a directory
@@ -44,11 +39,7 @@ npm install @github/copilot-sdk
44
39
 
45
40
  ## Run the Sample
46
41
 
47
- Try the interactive chat sample from the SDK root (`src/sdk` when nested).
48
- In the runtime repository, first run `pnpm run build:cli` from the runtime root
49
- to prepare the same-checkout executable, then return to `src/sdk`.
50
- Building the Node SDK alone does not build the runtime. For dependency
51
- prerequisites, see [development setup](#development).
42
+ Try the interactive chat sample (from the repo root):
52
43
 
53
44
  ```bash
54
45
  cd nodejs
@@ -172,6 +163,7 @@ Create a new conversation session.
172
163
  - `systemMessage?: SystemMessageConfig` - System message customization (see below)
173
164
  - `infiniteSessions?: InfiniteSessionConfig` - Configure automatic context compaction (see below)
174
165
  - `workingDirectory?: string` - Working directory for the session (default: runtime process cwd).
166
+ - `refreshCustomInstructions?: boolean` - Invalidates the process-wide custom-instruction discovery cache before creating this session, so instruction-file edits made in the same runtime are read again. Defaults to `false` (cache reuse). Other sessions in this runtime may observe updated instructions on later turns or discovery. This does not watch files or enable disabled instruction loading. Available on `SessionConfig`, not `ResumeSessionConfig`.
175
167
  - `enableSessionStore?: boolean` - Enables the cross-session store for search and retrieval across sessions. When unset in `"copilot-cli"` mode, the runtime default applies (enabled). In `"empty"` mode, defaults to disabled.
176
168
  - `gitHubTokenProvider?: GitHubTokenProvider` - Acquires rotating, session-scoped GitHub tokens. Token results require a positive `expiresIn` value in seconds remaining when the callback completes; production tokens typically last eight hours. Cannot be combined with `gitHubToken`.
177
169
  - `provider?: ProviderConfig` - Custom API provider configuration (BYOK - Bring Your Own Key). See [Custom Providers](#custom-providers) section.
@@ -309,6 +301,7 @@ Source is independent of delivery mode. Leaving it unset preserves the existing
309
301
  ##### `sendAndWait(options: MessageOptions, timeout?: number): Promise<AssistantMessageEvent | undefined>`
310
302
 
311
303
  Send a message and wait until the session becomes idle.
304
+ Sub-agent events are still delivered to listeners, but do not complete the wait or supply its reply.
312
305
 
313
306
  **Options:**
314
307
 
@@ -1288,28 +1281,19 @@ try {
1288
1281
 
1289
1282
  ## Development
1290
1283
 
1291
- Follow [SDK development setup](../CONTRIBUTING.md#developing-an-sdk) first,
1292
- including the harness and corrections-script dependencies. From the SDK root
1293
- (`src/sdk` in the runtime repository, or the standalone repository root):
1284
+ From the repository root:
1294
1285
 
1295
1286
  ```bash
1296
- npm run build:nodejs
1297
- npm run test:nodejs
1298
- npm run check:nodejs
1287
+ cd test/harness
1288
+ npm ci
1299
1289
  ```
1300
1290
 
1301
- In the runtime layout, these build/test commands refresh the projection and
1302
- prepare the checked-out runtime for tests. For focused unit tests after
1303
- installing Node dependencies:
1304
-
1305
1291
  ```bash
1306
- npm --prefix nodejs run test:unit
1292
+ cd nodejs
1293
+ npm ci
1294
+ npm test
1307
1295
  ```
1308
1296
 
1309
- For native Vitest selectors on E2Es, use the
1310
- [prepared-runtime instructions](../CONTRIBUTING.md#testing-an-unreleased-runtime-api);
1311
- the SDK facade does not forward selectors.
1312
-
1313
1297
  ## License
1314
1298
 
1315
1299
  MIT
@@ -22,7 +22,7 @@ __export(cliVersion_exports, {
22
22
  COPILOT_CLI_VERSION: () => COPILOT_CLI_VERSION
23
23
  });
24
24
  module.exports = __toCommonJS(cliVersion_exports);
25
- const COPILOT_CLI_VERSION = "1.0.89-0";
25
+ const COPILOT_CLI_VERSION = "1.0.89-3";
26
26
  const COPILOT_CLI_USE_NPM_PACKAGE = false;
27
27
  // Annotate the CommonJS export names for ESM import in node:
28
28
  0 && (module.exports = {
@@ -1237,6 +1237,7 @@ class CopilotClient {
1237
1237
  includeSubAgentStreamingEvents: config.includeSubAgentStreamingEvents ?? true,
1238
1238
  ...this.onGitHubTelemetry != null ? { enableGitHubTelemetryForwarding: true } : {},
1239
1239
  mcpServers: toWireMcpServers(config.mcpServers),
1240
+ ...config.diagnostics !== void 0 ? { diagnostics: config.diagnostics } : {},
1240
1241
  mcpOAuthTokenStorage: config.mcpOAuthTokenStorage,
1241
1242
  authClientIdMetadataUrl: config.authClientIdMetadataUrl,
1242
1243
  envValueMode: "direct",
@@ -1246,6 +1247,7 @@ class CopilotClient {
1246
1247
  agent: config.agent,
1247
1248
  configDir: config.configDirectory,
1248
1249
  enableConfigDiscovery: config.enableConfigDiscovery,
1250
+ refreshCustomInstructions: config.refreshCustomInstructions,
1249
1251
  skipEmbeddingRetrieval: config.skipEmbeddingRetrieval,
1250
1252
  embeddingCacheStorage: config.embeddingCacheStorage,
1251
1253
  organizationCustomInstructions: config.organizationCustomInstructions,
@@ -1488,6 +1490,7 @@ class CopilotClient {
1488
1490
  includeSubAgentStreamingEvents: config.includeSubAgentStreamingEvents ?? true,
1489
1491
  ...this.onGitHubTelemetry != null ? { enableGitHubTelemetryForwarding: true } : {},
1490
1492
  mcpServers: toWireMcpServers(config.mcpServers),
1493
+ ...config.diagnostics !== void 0 ? { diagnostics: config.diagnostics } : {},
1491
1494
  mcpOAuthTokenStorage: config.mcpOAuthTokenStorage,
1492
1495
  authClientIdMetadataUrl: config.authClientIdMetadataUrl,
1493
1496
  envValueMode: "direct",
@@ -67,6 +67,15 @@ function createServerRpc(connection) {
67
67
  getBuiltInCatalog: async () => connection.sendRequest("models.getBuiltInCatalog", {})
68
68
  },
69
69
  /** @experimental */
70
+ sandbox: {
71
+ /**
72
+ * Reports whether the host running this runtime can run the command sandbox, without starting a session or spawning a sandboxed command.
73
+ *
74
+ * @returns Whether the host running this runtime can run the command sandbox. The runtime checks `supported` once per process. A capability answer can change while the process runs, for example after the user installs a missing package.
75
+ */
76
+ getHostSupport: async () => connection.sendRequest("sandbox.getHostSupport", {})
77
+ },
78
+ /** @experimental */
70
79
  tools: {
71
80
  /**
72
81
  * Lists built-in tools available for a model.
@@ -1425,7 +1434,20 @@ function createSessionRpc(connection, sessionId) {
1425
1434
  *
1426
1435
  * @returns Instruction sources loaded for the session, in merge order.
1427
1436
  */
1428
- getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId })
1437
+ getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId }),
1438
+ /**
1439
+ * Invalidates cached custom-instruction discovery so subsequent turns and source reads observe instruction files currently on disk.
1440
+ */
1441
+ reload: async () => connection.sendRequest("session.instructions.reload", { sessionId })
1442
+ },
1443
+ /** @experimental */
1444
+ customizations: {
1445
+ /**
1446
+ * Reloads all repository and user customizations for the active session: instructions, plugins and their MCP servers and hooks, custom agents, extensions, and skills. Returns diagnostics from the final skill reload.
1447
+ *
1448
+ * @returns Diagnostics from reloading skill definitions, with warnings and errors as separate lists.
1449
+ */
1450
+ reload: async () => connection.sendRequest("session.customizations.reload", { sessionId })
1429
1451
  },
1430
1452
  /** @experimental */
1431
1453
  fleet: {
@@ -1835,6 +1857,25 @@ function createSessionRpc(connection, sessionId) {
1835
1857
  }
1836
1858
  },
1837
1859
  /** @experimental */
1860
+ diagnostics: {
1861
+ /**
1862
+ * Patches configured session diagnostic sources without restarting their producers. Setting a source level to off clears its retained diagnostics and invalidates cursors selecting that source.
1863
+ *
1864
+ * @param params Patch session diagnostic thresholds for explicitly supplied sources.
1865
+ *
1866
+ * @returns Per-source session diagnostics configuration.
1867
+ */
1868
+ configure: async (params) => connection.sendRequest("session.diagnostics.configure", { sessionId, ...params }),
1869
+ /**
1870
+ * Reads a bounded batch of retained session diagnostics for the selected sources. Records are never consumed and each reader advances independently through its opaque cursor.
1871
+ *
1872
+ * @param params Cursor-based request for session diagnostics. The default limit is 100 (maximum 500); the default waitMs is zero (maximum 30000).
1873
+ *
1874
+ * @returns One cursor-addressed page of retained session diagnostics.
1875
+ */
1876
+ read: async (params) => connection.sendRequest("session.diagnostics.read", { sessionId, ...params })
1877
+ },
1878
+ /** @experimental */
1838
1879
  connectors: {
1839
1880
  /**
1840
1881
  * Returns feature availability and bounded polling limits for the EXPERIMENTAL session connector API. This method never performs a Connector service request.
@@ -2714,11 +2755,11 @@ function createSessionRpc(connection, sessionId) {
2714
2755
  */
2715
2756
  updateText: async (params) => connection.sendRequest("session.queue.updateText", { sessionId, ...params }),
2716
2757
  /**
2717
- * Atomically withdraws an unchanged, unconsumed user message from the local queued or steering lane. A client retaining the original draft may restore it only when removed is true. Does not interrupt the running turn.
2758
+ * Atomically withdraws an unchanged user message of a local session: from the queued or steering lane while unconsumed, or from the running turn it started while the model has not answered it and nothing the user sent after it is pending. Withdrawing from the running turn interrupts that turn and removes its events from history. A client retaining the original draft may restore it only when removed is true.
2718
2759
  *
2719
- * @param params Conditional withdrawal of a single user message, before the runtime claims it for delivery.
2760
+ * @param params Conditional withdrawal of a single user message, from its queue or from the running turn it started.
2720
2761
  *
2721
- * @returns Result of removing a queued item.
2762
+ * @returns Result of withdrawing a user message.
2722
2763
  */
2723
2764
  withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { sessionId, ...params }),
2724
2765
  /**
@@ -838,6 +838,7 @@ class CopilotSession {
838
838
  });
839
839
  let lastAssistantMessage;
840
840
  const unsubscribe = this.on((event) => {
841
+ if (event.agentId) return;
841
842
  if (event.type === "assistant.message") {
842
843
  lastAssistantMessage = event;
843
844
  } else if (event.type === "session.idle" && event.data.mode !== "autopilot") {
@@ -1,2 +1,2 @@
1
- export declare const COPILOT_CLI_VERSION = "1.0.89-0";
1
+ export declare const COPILOT_CLI_VERSION = "1.0.89-3";
2
2
  export declare const COPILOT_CLI_USE_NPM_PACKAGE = false;
@@ -1,4 +1,4 @@
1
- const COPILOT_CLI_VERSION = "1.0.89-0";
1
+ const COPILOT_CLI_VERSION = "1.0.89-3";
2
2
  const COPILOT_CLI_USE_NPM_PACKAGE = false;
3
3
  export {
4
4
  COPILOT_CLI_USE_NPM_PACKAGE,
package/dist/client.js CHANGED
@@ -1215,6 +1215,7 @@ class CopilotClient {
1215
1215
  includeSubAgentStreamingEvents: config.includeSubAgentStreamingEvents ?? true,
1216
1216
  ...this.onGitHubTelemetry != null ? { enableGitHubTelemetryForwarding: true } : {},
1217
1217
  mcpServers: toWireMcpServers(config.mcpServers),
1218
+ ...config.diagnostics !== void 0 ? { diagnostics: config.diagnostics } : {},
1218
1219
  mcpOAuthTokenStorage: config.mcpOAuthTokenStorage,
1219
1220
  authClientIdMetadataUrl: config.authClientIdMetadataUrl,
1220
1221
  envValueMode: "direct",
@@ -1224,6 +1225,7 @@ class CopilotClient {
1224
1225
  agent: config.agent,
1225
1226
  configDir: config.configDirectory,
1226
1227
  enableConfigDiscovery: config.enableConfigDiscovery,
1228
+ refreshCustomInstructions: config.refreshCustomInstructions,
1227
1229
  skipEmbeddingRetrieval: config.skipEmbeddingRetrieval,
1228
1230
  embeddingCacheStorage: config.embeddingCacheStorage,
1229
1231
  organizationCustomInstructions: config.organizationCustomInstructions,
@@ -1466,6 +1468,7 @@ class CopilotClient {
1466
1468
  includeSubAgentStreamingEvents: config.includeSubAgentStreamingEvents ?? true,
1467
1469
  ...this.onGitHubTelemetry != null ? { enableGitHubTelemetryForwarding: true } : {},
1468
1470
  mcpServers: toWireMcpServers(config.mcpServers),
1471
+ ...config.diagnostics !== void 0 ? { diagnostics: config.diagnostics } : {},
1469
1472
  mcpOAuthTokenStorage: config.mcpOAuthTokenStorage,
1470
1473
  authClientIdMetadataUrl: config.authClientIdMetadataUrl,
1471
1474
  envValueMode: "direct",
@@ -1210,6 +1210,127 @@ export type DebugCollectLogsResultKind =
1210
1210
  "archive"
1211
1211
  /** A directory containing the collected files was written. */
1212
1212
  | "directory";
1213
+ /**
1214
+ * Whether the supplied diagnostic cursor remained within the retained buffer window.
1215
+ *
1216
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1217
+ * via the `definition` "DiagnosticCursorStatus".
1218
+ */
1219
+ /** @experimental */
1220
+ export type DiagnosticCursorStatus =
1221
+ /** The cursor is valid for the current retained window. */
1222
+ "ok"
1223
+ /** The cursor no longer addresses retained records; reading resumes at the oldest retained record. */
1224
+ | "expired";
1225
+ /**
1226
+ * One retained session-scoped diagnostic record. Potentially content-bearing diagnostic data is opt-in and must not be exported automatically as telemetry.
1227
+ *
1228
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1229
+ * via the `definition` "DiagnosticEntry".
1230
+ */
1231
+ /** @experimental */
1232
+ export type DiagnosticEntry = {
1233
+ /**
1234
+ * UTC RFC 3339 timestamp captured at the diagnostic source.
1235
+ */
1236
+ timestamp: string;
1237
+ level: DiagnosticSeverity;
1238
+ /**
1239
+ * Agent identifier for a subagent host. Omitted for the root agent.
1240
+ */
1241
+ agentId?: string;
1242
+ /**
1243
+ * Human-readable diagnostic summary.
1244
+ */
1245
+ message: string;
1246
+ /**
1247
+ * Whether message or data was truncated to the record-size bound.
1248
+ */
1249
+ truncated?: boolean;
1250
+ /**
1251
+ * Original byte count when a known-size message or data value was truncated.
1252
+ */
1253
+ originalBytes?: number;
1254
+ details: McpDiagnosticDetails;
1255
+ /**
1256
+ * Diagnostic source identifying the typed details payload.
1257
+ */
1258
+ source: "mcp";
1259
+ };
1260
+ /**
1261
+ * Severity of an emitted diagnostic record.
1262
+ *
1263
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1264
+ * via the `definition` "DiagnosticSeverity".
1265
+ */
1266
+ /** @experimental */
1267
+ export type DiagnosticSeverity =
1268
+ /** Failure that prevented or interrupted communication. */
1269
+ "error"
1270
+ /** A recoverable warning or server standard-error output. */
1271
+ | "warning"
1272
+ /** Lifecycle transition. */
1273
+ | "info"
1274
+ /** Protocol-frame or launch diagnostic. */
1275
+ | "debug"
1276
+ /** HTTP metadata diagnostic. */
1277
+ | "trace";
1278
+ /**
1279
+ * Category for an MCP diagnostic record.
1280
+ *
1281
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1282
+ * via the `definition` "McpDiagnosticKind".
1283
+ */
1284
+ /** @experimental */
1285
+ export type McpDiagnosticKind =
1286
+ /** Connection lifecycle transition or failure. */
1287
+ "lifecycle"
1288
+ /** JSON-RPC protocol frame. */
1289
+ | "protocol"
1290
+ /** HTTP request or response metadata. */
1291
+ | "http"
1292
+ /** Local MCP server standard-error output. */
1293
+ | "stderr";
1294
+ /**
1295
+ * Direction of an observed MCP protocol frame.
1296
+ *
1297
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1298
+ * via the `definition` "McpDiagnosticDirection".
1299
+ */
1300
+ /** @experimental */
1301
+ export type McpDiagnosticDirection =
1302
+ /** Frame emitted by the Copilot MCP client. */
1303
+ "client-to-server"
1304
+ /** Frame received from the MCP server. */
1305
+ | "server-to-client";
1306
+ /**
1307
+ * Session-scoped diagnostic threshold. Capture is disabled by default and is never persisted with the session.
1308
+ *
1309
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1310
+ * via the `definition` "DiagnosticLogLevel".
1311
+ */
1312
+ /** @experimental */
1313
+ export type DiagnosticLogLevel =
1314
+ /** Disable capture and clear retained diagnostics. */
1315
+ "off"
1316
+ /** Capture failures only. */
1317
+ | "error"
1318
+ /** Capture failures, warnings, and stderr. */
1319
+ | "warning"
1320
+ /** Capture lifecycle diagnostics. */
1321
+ | "info"
1322
+ /** Capture protocol frames and launch diagnostics. */
1323
+ | "debug"
1324
+ /** Capture HTTP metadata in addition to debug diagnostics. */
1325
+ | "trace";
1326
+ /**
1327
+ * A supported diagnostic source.
1328
+ *
1329
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1330
+ * via the `definition` "DiagnosticSource".
1331
+ */
1332
+ /** @experimental */
1333
+ export type DiagnosticSource = "mcp";
1213
1334
  /**
1214
1335
  * Persisted extension discovery source
1215
1336
  *
@@ -3275,6 +3396,14 @@ export type ResponseFormat = {
3275
3396
  */
3276
3397
  type: "json_schema";
3277
3398
  };
3399
+ /**
3400
+ * Extensible identifier of a sandbox policy feature whose availability varies between hosts. A plain string, so an older client decodes a name added by a newer runtime; ignore names you do not recognize. Known values: `network` — sandboxed commands can reach the network (`network.allowOutbound`, on by default); on Linux this needs the tooling for Bubblewrap's private network namespace, such as slirp4netns. `network_filtering` — host rules and the sandbox proxy (`network.allowedHosts`, `network.blockedHosts`, `network.proxy`); on Linux this needs the same tooling as `network`; on Windows it needs a version with Process Security Environment 1.1 host-loopback support, and a policy that uses it must also set `network.allowLocalNetwork`, because Windows reaches the local proxy only together with private-network access. `denied_paths` — native enforcement of `filesystem.deniedPaths`; on Windows this needs a version whose sandbox contract reports denied-path support. `shell` — shell commands inside the sandbox: bash on macOS and Linux, PowerShell on Windows; on Windows this needs a version with Process Security Environment 1.1 filesystem enumeration support.
3401
+ *
3402
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
3403
+ * via the `definition` "SandboxHostCapabilityName".
3404
+ */
3405
+ /** @experimental */
3406
+ export type SandboxHostCapabilityName = string;
3278
3407
  /**
3279
3408
  * A session-scoped sandbox transition applied while handling a slash command
3280
3409
  *
@@ -8161,6 +8290,120 @@ export interface DebugCollectLogsSkippedEntry {
8161
8290
  */
8162
8291
  reason: string;
8163
8292
  }
8293
+ /**
8294
+ * MCP-specific detail for a source-discriminated diagnostic entry.
8295
+ *
8296
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8297
+ * via the `definition` "McpDiagnosticDetails".
8298
+ */
8299
+ /** @experimental */
8300
+ export interface McpDiagnosticDetails {
8301
+ kind: McpDiagnosticKind;
8302
+ /**
8303
+ * Configured MCP server name.
8304
+ */
8305
+ serverName: string;
8306
+ /**
8307
+ * Fresh identifier for the MCP connection attempt, including failed starts.
8308
+ */
8309
+ connectionId: string;
8310
+ direction?: McpDiagnosticDirection;
8311
+ /**
8312
+ * Serialized diagnostic detail. Protocol and HTTP records use JSON when detail is present.
8313
+ */
8314
+ data?: string;
8315
+ }
8316
+ /**
8317
+ * Per-source session diagnostics configuration.
8318
+ *
8319
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8320
+ * via the `definition` "DiagnosticsConfiguration".
8321
+ */
8322
+ /** @experimental */
8323
+ export interface DiagnosticsConfiguration {
8324
+ sources: DiagnosticSourcesConfiguration;
8325
+ }
8326
+ /**
8327
+ * Typed diagnostic source configuration. At least one source is required by diagnostics configuration methods.
8328
+ *
8329
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8330
+ * via the `definition` "DiagnosticSourcesConfiguration".
8331
+ */
8332
+ /** @experimental */
8333
+ export interface DiagnosticSourcesConfiguration {
8334
+ mcp?: McpDiagnosticSourceConfiguration;
8335
+ }
8336
+ /**
8337
+ * MCP diagnostic source configuration.
8338
+ *
8339
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8340
+ * via the `definition` "McpDiagnosticSourceConfiguration".
8341
+ */
8342
+ /** @experimental */
8343
+ export interface McpDiagnosticSourceConfiguration {
8344
+ level: DiagnosticLogLevel;
8345
+ }
8346
+ /**
8347
+ * Patch session diagnostic thresholds for explicitly supplied sources.
8348
+ *
8349
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8350
+ * via the `definition` "DiagnosticsConfigureRequest".
8351
+ */
8352
+ /** @experimental */
8353
+ export interface DiagnosticsConfigureRequest {
8354
+ sources: DiagnosticSourcesConfiguration;
8355
+ }
8356
+ /**
8357
+ * Cursor-based request for session diagnostics. The default limit is 100 (maximum 500); the default waitMs is zero (maximum 30000).
8358
+ *
8359
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8360
+ * via the `definition` "DiagnosticsReadRequest".
8361
+ */
8362
+ /** @experimental */
8363
+ export interface DiagnosticsReadRequest {
8364
+ /**
8365
+ * Nonempty selection of sources to read. Each source may be listed once.
8366
+ */
8367
+ sources: DiagnosticSource[];
8368
+ /**
8369
+ * Opaque cursor returned by an earlier read. Omit to start at the oldest retained record.
8370
+ */
8371
+ cursor?: string;
8372
+ /**
8373
+ * Maximum number of records to return, from 1 through 500. Omit for 100.
8374
+ */
8375
+ max?: number;
8376
+ /**
8377
+ * Maximum time in milliseconds to wait for a new record, from 0 through 30000.
8378
+ */
8379
+ waitMs?: number;
8380
+ }
8381
+ /**
8382
+ * One cursor-addressed page of retained session diagnostics.
8383
+ *
8384
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8385
+ * via the `definition` "DiagnosticsReadResult".
8386
+ */
8387
+ /** @experimental */
8388
+ export interface DiagnosticsReadResult {
8389
+ /**
8390
+ * Retained records beginning at the requested cursor.
8391
+ */
8392
+ entries: DiagnosticEntry[];
8393
+ /**
8394
+ * Opaque cursor for the next independent read.
8395
+ */
8396
+ cursor: string;
8397
+ cursorStatus: DiagnosticCursorStatus;
8398
+ /**
8399
+ * Number of records lost before this page when known. Omitted when a buffer generation change makes the count unknowable.
8400
+ */
8401
+ droppedCount?: number;
8402
+ /**
8403
+ * Whether additional retained records follow this page.
8404
+ */
8405
+ hasMore: boolean;
8406
+ }
8164
8407
  /**
8165
8408
  * Discovered extension metadata and persistent enablement state.
8166
8409
  *
@@ -11909,6 +12152,10 @@ export interface McpServerConfigHttp {
11909
12152
  * OAuth client ID for a pre-registered remote MCP OAuth client.
11910
12153
  */
11911
12154
  oauthClientId?: string;
12155
+ /**
12156
+ * Non-empty array of valid RFC 6749 scope-token strings to request for the statically configured OAuth client when the server challenge omits scope or provides an empty scope. Requires a non-empty oauthClientId. These scopes take precedence over protected-resource metadata.
12157
+ */
12158
+ oauthScopes?: string[];
11912
12159
  /**
11913
12160
  * Whether the configured OAuth client is public and does not require a client secret.
11914
12161
  */
@@ -17624,6 +17871,10 @@ export interface QueuePendingItems {
17624
17871
  */
17625
17872
  displayText: string;
17626
17873
  agentMode: SendAgentMode;
17874
+ /**
17875
+ * Optional source tag associated with this pending queue entry. This is an open string, not authenticated authorship. In particular, `user` does not prove that a person typed the message. If the source is absent or unrecognized, consumers must not infer human or agent authorship and should handle the entry neutrally. Consumers should tolerate future source values.
17876
+ */
17877
+ source?: string;
17627
17878
  }
17628
17879
  /**
17629
17880
  * Snapshot of the session's pending queued items and immediate-steering messages.
@@ -17645,6 +17896,10 @@ export interface QueuePendingItemsResult {
17645
17896
  * How many leading entries of `steeringMessages` have already been folded into the running turn (and so have an emitted `user.message`), as opposed to still waiting for one. Absent for hosts that do not distinguish the two.
17646
17897
  */
17647
17898
  inFlightSteeringCount?: number;
17899
+ /**
17900
+ * ID of the running turn's user message while the model has not answered it, so `withdrawMessage` can still take it back once nothing sent after it is pending. A message leaves `items` when its turn starts, before its `user.message` is recorded; this tells that message apart from one that was removed. Absent when no turn prompt can be taken back.
17901
+ */
17902
+ withdrawableTurnMessageId?: string;
17648
17903
  }
17649
17904
  /**
17650
17905
  * Parameters for removing a queued item by stable id.
@@ -17788,7 +18043,7 @@ export interface QueueUpdateTextResult {
17788
18043
  updated: boolean;
17789
18044
  }
17790
18045
  /**
17791
- * Conditional withdrawal of a single user message, before the runtime claims it for delivery.
18046
+ * Conditional withdrawal of a single user message, from its queue or from the running turn it started.
17792
18047
  *
17793
18048
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
17794
18049
  * via the `definition` "QueueWithdrawMessageRequest".
@@ -17804,6 +18059,23 @@ export interface QueueWithdrawMessageRequest {
17804
18059
  */
17805
18060
  expectedPrompt: string;
17806
18061
  }
18062
+ /**
18063
+ * Result of withdrawing a user message.
18064
+ *
18065
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
18066
+ * via the `definition` "QueueWithdrawMessageResult".
18067
+ */
18068
+ /** @experimental */
18069
+ export interface QueueWithdrawMessageResult {
18070
+ /**
18071
+ * True when the message left the queue or, for a running turn, history.
18072
+ */
18073
+ removed: boolean;
18074
+ /**
18075
+ * True when the running turn was interrupted to withdraw the message. With removed false, the turn was interrupted but its events could not be removed, for example because the model answered first, so the message stays in the interrupted turn.
18076
+ */
18077
+ interrupted: boolean;
18078
+ }
17807
18079
  /**
17808
18080
  * Event type to register consumer interest for, used by runtime gating logic.
17809
18081
  *
@@ -18395,6 +18667,45 @@ export interface SandboxEnforcementStatus {
18395
18667
  */
18396
18668
  reason?: string;
18397
18669
  }
18670
+ /**
18671
+ * Whether this host can run one sandbox policy feature. A session whose effective policy uses an unsupported feature fails each sandboxed command with `reason`.
18672
+ *
18673
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
18674
+ * via the `definition` "SandboxHostCapability".
18675
+ */
18676
+ /** @experimental */
18677
+ export interface SandboxHostCapability {
18678
+ name: SandboxHostCapabilityName;
18679
+ /**
18680
+ * Whether this host can run the feature.
18681
+ */
18682
+ supported: boolean;
18683
+ /**
18684
+ * Human-readable reason and remedy when the feature is unsupported, such as a package to install or an OS update. Present only when `supported` is false.
18685
+ */
18686
+ reason?: string;
18687
+ }
18688
+ /**
18689
+ * Whether the host running this runtime can run the command sandbox. The runtime checks `supported` once per process. A capability answer can change while the process runs, for example after the user installs a missing package.
18690
+ *
18691
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
18692
+ * via the `definition` "SandboxHostSupport".
18693
+ */
18694
+ /** @experimental */
18695
+ export interface SandboxHostSupport {
18696
+ /**
18697
+ * Whether a process-containment backend is usable on this host: Seatbelt on macOS, Bubblewrap on Linux, or ProcessContainer on Windows.
18698
+ */
18699
+ supported: boolean;
18700
+ /**
18701
+ * Human-readable reason the sandbox cannot run on this host. Present only when `supported` is false.
18702
+ */
18703
+ reason?: string;
18704
+ /**
18705
+ * Sandbox policy features whose availability varies between hosts that can run the backend. Empty when `supported` is false, because no feature can run without a backend. Later runtimes can add entries; ignore an entry whose `name` you do not recognize.
18706
+ */
18707
+ capabilities: SandboxHostCapability[];
18708
+ }
18398
18709
  /**
18399
18710
  * Register an absolute-time scheduled prompt.
18400
18711
  *
@@ -26040,6 +26351,15 @@ export declare function createServerRpc(connection: MessageConnection): {
26040
26351
  getBuiltInCatalog: () => Promise<BuiltInModelCatalog>;
26041
26352
  };
26042
26353
  /** @experimental */
26354
+ sandbox: {
26355
+ /**
26356
+ * Reports whether the host running this runtime can run the command sandbox, without starting a session or spawning a sandboxed command.
26357
+ *
26358
+ * @returns Whether the host running this runtime can run the command sandbox. The runtime checks `supported` once per process. A capability answer can change while the process runs, for example after the user installs a missing package.
26359
+ */
26360
+ getHostSupport: () => Promise<SandboxHostSupport>;
26361
+ };
26362
+ /** @experimental */
26043
26363
  tools: {
26044
26364
  /**
26045
26365
  * Lists built-in tools available for a model.
@@ -27329,6 +27649,19 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
27329
27649
  * @returns Instruction sources loaded for the session, in merge order.
27330
27650
  */
27331
27651
  getSources: () => Promise<InstructionsGetSourcesResult>;
27652
+ /**
27653
+ * Invalidates cached custom-instruction discovery so subsequent turns and source reads observe instruction files currently on disk.
27654
+ */
27655
+ reload: () => Promise<void>;
27656
+ };
27657
+ /** @experimental */
27658
+ customizations: {
27659
+ /**
27660
+ * Reloads all repository and user customizations for the active session: instructions, plugins and their MCP servers and hooks, custom agents, extensions, and skills. Returns diagnostics from the final skill reload.
27661
+ *
27662
+ * @returns Diagnostics from reloading skill definitions, with warnings and errors as separate lists.
27663
+ */
27664
+ reload: () => Promise<SkillsLoadDiagnostics>;
27332
27665
  };
27333
27666
  /** @experimental */
27334
27667
  fleet: {
@@ -27738,6 +28071,25 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
27738
28071
  };
27739
28072
  };
27740
28073
  /** @experimental */
28074
+ diagnostics: {
28075
+ /**
28076
+ * Patches configured session diagnostic sources without restarting their producers. Setting a source level to off clears its retained diagnostics and invalidates cursors selecting that source.
28077
+ *
28078
+ * @param params Patch session diagnostic thresholds for explicitly supplied sources.
28079
+ *
28080
+ * @returns Per-source session diagnostics configuration.
28081
+ */
28082
+ configure: (params: DiagnosticsConfigureRequest) => Promise<DiagnosticsConfiguration>;
28083
+ /**
28084
+ * Reads a bounded batch of retained session diagnostics for the selected sources. Records are never consumed and each reader advances independently through its opaque cursor.
28085
+ *
28086
+ * @param params Cursor-based request for session diagnostics. The default limit is 100 (maximum 500); the default waitMs is zero (maximum 30000).
28087
+ *
28088
+ * @returns One cursor-addressed page of retained session diagnostics.
28089
+ */
28090
+ read: (params: DiagnosticsReadRequest) => Promise<DiagnosticsReadResult>;
28091
+ };
28092
+ /** @experimental */
27741
28093
  connectors: {
27742
28094
  /**
27743
28095
  * Returns feature availability and bounded polling limits for the EXPERIMENTAL session connector API. This method never performs a Connector service request.
@@ -28617,13 +28969,13 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
28617
28969
  */
28618
28970
  updateText: (params: QueueUpdateTextRequest) => Promise<QueueUpdateTextResult>;
28619
28971
  /**
28620
- * Atomically withdraws an unchanged, unconsumed user message from the local queued or steering lane. A client retaining the original draft may restore it only when removed is true. Does not interrupt the running turn.
28972
+ * Atomically withdraws an unchanged user message of a local session: from the queued or steering lane while unconsumed, or from the running turn it started while the model has not answered it and nothing the user sent after it is pending. Withdrawing from the running turn interrupts that turn and removes its events from history. A client retaining the original draft may restore it only when removed is true.
28621
28973
  *
28622
- * @param params Conditional withdrawal of a single user message, before the runtime claims it for delivery.
28974
+ * @param params Conditional withdrawal of a single user message, from its queue or from the running turn it started.
28623
28975
  *
28624
- * @returns Result of removing a queued item.
28976
+ * @returns Result of withdrawing a user message.
28625
28977
  */
28626
- withdrawMessage: (params: QueueWithdrawMessageRequest) => Promise<QueueRemoveAtResult>;
28978
+ withdrawMessage: (params: QueueWithdrawMessageRequest) => Promise<QueueWithdrawMessageResult>;
28627
28979
  /**
28628
28980
  * Atomically appends text and attachments to an unchanged, unconsumed local steering message. Returns updated=false if delivery or withdrawal already claimed the message.
28629
28981
  *
@@ -39,6 +39,15 @@ function createServerRpc(connection) {
39
39
  getBuiltInCatalog: async () => connection.sendRequest("models.getBuiltInCatalog", {})
40
40
  },
41
41
  /** @experimental */
42
+ sandbox: {
43
+ /**
44
+ * Reports whether the host running this runtime can run the command sandbox, without starting a session or spawning a sandboxed command.
45
+ *
46
+ * @returns Whether the host running this runtime can run the command sandbox. The runtime checks `supported` once per process. A capability answer can change while the process runs, for example after the user installs a missing package.
47
+ */
48
+ getHostSupport: async () => connection.sendRequest("sandbox.getHostSupport", {})
49
+ },
50
+ /** @experimental */
42
51
  tools: {
43
52
  /**
44
53
  * Lists built-in tools available for a model.
@@ -1397,7 +1406,20 @@ function createSessionRpc(connection, sessionId) {
1397
1406
  *
1398
1407
  * @returns Instruction sources loaded for the session, in merge order.
1399
1408
  */
1400
- getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId })
1409
+ getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId }),
1410
+ /**
1411
+ * Invalidates cached custom-instruction discovery so subsequent turns and source reads observe instruction files currently on disk.
1412
+ */
1413
+ reload: async () => connection.sendRequest("session.instructions.reload", { sessionId })
1414
+ },
1415
+ /** @experimental */
1416
+ customizations: {
1417
+ /**
1418
+ * Reloads all repository and user customizations for the active session: instructions, plugins and their MCP servers and hooks, custom agents, extensions, and skills. Returns diagnostics from the final skill reload.
1419
+ *
1420
+ * @returns Diagnostics from reloading skill definitions, with warnings and errors as separate lists.
1421
+ */
1422
+ reload: async () => connection.sendRequest("session.customizations.reload", { sessionId })
1401
1423
  },
1402
1424
  /** @experimental */
1403
1425
  fleet: {
@@ -1807,6 +1829,25 @@ function createSessionRpc(connection, sessionId) {
1807
1829
  }
1808
1830
  },
1809
1831
  /** @experimental */
1832
+ diagnostics: {
1833
+ /**
1834
+ * Patches configured session diagnostic sources without restarting their producers. Setting a source level to off clears its retained diagnostics and invalidates cursors selecting that source.
1835
+ *
1836
+ * @param params Patch session diagnostic thresholds for explicitly supplied sources.
1837
+ *
1838
+ * @returns Per-source session diagnostics configuration.
1839
+ */
1840
+ configure: async (params) => connection.sendRequest("session.diagnostics.configure", { sessionId, ...params }),
1841
+ /**
1842
+ * Reads a bounded batch of retained session diagnostics for the selected sources. Records are never consumed and each reader advances independently through its opaque cursor.
1843
+ *
1844
+ * @param params Cursor-based request for session diagnostics. The default limit is 100 (maximum 500); the default waitMs is zero (maximum 30000).
1845
+ *
1846
+ * @returns One cursor-addressed page of retained session diagnostics.
1847
+ */
1848
+ read: async (params) => connection.sendRequest("session.diagnostics.read", { sessionId, ...params })
1849
+ },
1850
+ /** @experimental */
1810
1851
  connectors: {
1811
1852
  /**
1812
1853
  * Returns feature availability and bounded polling limits for the EXPERIMENTAL session connector API. This method never performs a Connector service request.
@@ -2686,11 +2727,11 @@ function createSessionRpc(connection, sessionId) {
2686
2727
  */
2687
2728
  updateText: async (params) => connection.sendRequest("session.queue.updateText", { sessionId, ...params }),
2688
2729
  /**
2689
- * Atomically withdraws an unchanged, unconsumed user message from the local queued or steering lane. A client retaining the original draft may restore it only when removed is true. Does not interrupt the running turn.
2730
+ * Atomically withdraws an unchanged user message of a local session: from the queued or steering lane while unconsumed, or from the running turn it started while the model has not answered it and nothing the user sent after it is pending. Withdrawing from the running turn interrupts that turn and removes its events from history. A client retaining the original draft may restore it only when removed is true.
2690
2731
  *
2691
- * @param params Conditional withdrawal of a single user message, before the runtime claims it for delivery.
2732
+ * @param params Conditional withdrawal of a single user message, from its queue or from the running turn it started.
2692
2733
  *
2693
- * @returns Result of removing a queued item.
2734
+ * @returns Result of withdrawing a user message.
2694
2735
  */
2695
2736
  withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { sessionId, ...params }),
2696
2737
  /**
@@ -2684,12 +2684,16 @@ export interface SnapshotRewindEvent {
2684
2684
  * Session rewind details including target event and count of removed events
2685
2685
  */
2686
2686
  export interface SnapshotRewindData {
2687
+ /**
2688
+ * The removed events, starting with `upToEventId`. Later events not listed were kept, such as a background agent's events that interleaved with a withdrawn turn
2689
+ */
2690
+ eventIds?: string[];
2687
2691
  /**
2688
2692
  * Number of events that were removed by the rewind
2689
2693
  */
2690
2694
  eventsRemoved: number;
2691
2695
  /**
2692
- * Event ID that was rewound to; this event and all after it were removed
2696
+ * First removed event. Without `eventIds`, it and every event after it were removed
2693
2697
  */
2694
2698
  upToEventId: string;
2695
2699
  }
@@ -3317,7 +3321,7 @@ export interface CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail {
3317
3321
  tokenType: string;
3318
3322
  }
3319
3323
  /**
3320
- * Original request-level and effective conversation reasoning effort for a Responses history boundary
3324
+ * Original request-level and effective conversation reasoning effort for a provider history boundary; the historical type name is retained for compatibility
3321
3325
  */
3322
3326
  export interface ResponsesReasoning {
3323
3327
  /**
@@ -3703,6 +3707,12 @@ export interface FusionResolvedData {
3703
3707
  * Stable identifier for the resolved HydraFusion turn.
3704
3708
  */
3705
3709
  fusionId: string;
3710
+ /**
3711
+ * Short human-readable summary of the selected workflow, suitable for immediate client display after routing. May be absent in older durable events; omit the explanation or derive one from pattern and phasePlan. Display text, not a stable machine-readable value.
3712
+ *
3713
+ * @experimental
3714
+ */
3715
+ hint?: string;
3706
3716
  /**
3707
3717
  * Version of the executable model universe used for selection.
3708
3718
  */
@@ -5379,6 +5389,10 @@ export interface FusionAttribution {
5379
5389
  * Stable identifier for the HydraFusion turn that produced the event.
5380
5390
  */
5381
5391
  fusionId: string;
5392
+ /**
5393
+ * Whether this model request consumed a user steering message rather than only internal Fusion work.
5394
+ */
5395
+ hasUserSteering?: boolean;
5382
5396
  /**
5383
5397
  * HydraFusion orchestration pattern selected for the turn.
5384
5398
  */
@@ -10360,6 +10374,10 @@ export interface McpOauthRequiredStaticClientConfig {
10360
10374
  * Whether this is a public OAuth client
10361
10375
  */
10362
10376
  publicClient?: boolean;
10377
+ /**
10378
+ * Configured OAuth scope string used when the server challenge omits scope or provides an empty scope
10379
+ */
10380
+ scope?: string;
10363
10381
  }
10364
10382
  /**
10365
10383
  * OAuth WWW-Authenticate parameters parsed from an MCP auth challenge
package/dist/index.d.ts CHANGED
@@ -12,6 +12,6 @@ export { defineWorkflow, WorkflowResumeError, isWorkflowRunTerminal } from "./wo
12
12
  export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
13
13
  export { defineTool, approveAll, createAttributedPermissionResult, convertMcpCallToolResult, createSessionFsAdapter, CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, SessionFsSqliteTransactionFailure, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
14
14
  export type * from "./generated/session-events.js";
15
- export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, FactoryLimits, FactoryMeta, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, MessageSource, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfig, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
15
+ export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, ConnectorAccountRequest, ConnectorAvailability, ConnectorCapabilities, ConnectorCatalogEntry, ConnectorCatalogResult, ConnectorCatalogStatus, ConnectorConnectRequest, ConnectorConnectResult, ConnectorContinueRequest, ConnectorDisconnectResult, ConnectorMcpStatus, ConnectorReconcileRequest, ConnectorRuntimeStatus, ConnectorStatus, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, FactoryLimits, FactoryMeta, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, MessageSource, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfig, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
16
16
  export type { RunOptions, ResumeOptions, FactoryLimitOverrides, FactoryResumeErrorCode, SessionFactoryApi, FactoryAgentOptions, FactoryContext, FactoryDefinition, FactoryHandle, FactoryJsonSchema, JsonValue, FactoryPipelineStage, FactoryStepOptions, FactoryRunResult, FactoryRunStatus, FactoryRunSummary, FactoryListRunsOptions, FactoryRunsPage, FactoryRunDetail, FactoryProgressPage, FactoryProgressLine, FactoryPhaseObservation, FactoryPhaseStatus, FactoryAgentSummary, } from "./factory.js";
17
17
  export type { WorkflowRunOptions, WorkflowResumeOptions, WorkflowLimitOverrides, WorkflowResumeErrorCode, SessionWorkflowApi, WorkflowAgentOptions, WorkflowContext, WorkflowDefinition, WorkflowHandle, WorkflowJsonSchema, WorkflowLimits, WorkflowMeta, WorkflowPipelineStage, WorkflowStepOptions, WorkflowRunResult, WorkflowRunStatus, WorkflowRunSummary, WorkflowListRunsOptions, WorkflowRunsPage, WorkflowRunDetail, WorkflowProgressPage, WorkflowProgressLine, WorkflowPhaseObservation, WorkflowPhaseStatus, WorkflowAgentSummary, } from "./workflow.js";
package/dist/session.d.ts CHANGED
@@ -167,6 +167,7 @@ export declare class CopilotSession {
167
167
  * assistant has finished processing the message.
168
168
  *
169
169
  * Events are still delivered to handlers registered via {@link on} while waiting.
170
+ * Sub-agent events with a non-empty `agentId` do not complete the wait or supply its reply.
170
171
  * With a schema as the second argument, returns its parsed, validated result.
171
172
  * Structured waits select only root-agent output originating from this send;
172
173
  * other queued work may delay session.idle but cannot replace the result.
package/dist/session.js CHANGED
@@ -825,6 +825,7 @@ class CopilotSession {
825
825
  });
826
826
  let lastAssistantMessage;
827
827
  const unsubscribe = this.on((event) => {
828
+ if (event.agentId) return;
828
829
  if (event.type === "assistant.message") {
829
830
  lastAssistantMessage = event;
830
831
  } else if (event.type === "session.idle" && event.data.mode !== "autopilot") {
package/dist/types.d.ts CHANGED
@@ -7,11 +7,11 @@ import type { CopilotRequestHandler } from "./copilotRequestHandler.js";
7
7
  import type { AttachmentExtensionContext as GeneratedExtensionContextAttachment, AutoTier, PermissionRequest as GeneratedPermissionRequest, PermissionRequestedData as GeneratedPermissionRequestedData, PermissionRequestedEvent as GeneratedPermissionRequestedEvent, ReasoningSummary, SessionLimitsConfig, SessionEvent as GeneratedSessionEvent } from "./generated/session-events.js";
8
8
  import type { CopilotSession } from "./session.js";
9
9
  import type { FactoryJsonSchema, JsonValue } from "./factory.js";
10
- import type { ExtensionLaunchProviderHandler as GeneratedExtensionLaunchProvider, GitHubTokenAcquireRequest, GitHubTokenAcquireResult, GitHubTelemetryNotification, ModelBillingTokenPrices, OpenCanvasInstance, RemoteSessionMode, CurrentToolMetadata } from "./generated/rpc.js";
10
+ import type { ExtensionLaunchProviderHandler as GeneratedExtensionLaunchProvider, GitHubTokenAcquireRequest, GitHubTokenAcquireResult, GitHubTelemetryNotification, ModelBillingTokenPrices, DiagnosticsConfiguration, OpenCanvasInstance, RemoteSessionMode, CurrentToolMetadata } from "./generated/rpc.js";
11
11
  import type { ToolSet } from "./toolSet.js";
12
12
  export type { RemoteSessionMode } from "./generated/rpc.js";
13
13
  export type { CurrentToolMetadata } from "./generated/rpc.js";
14
- export type { ExtensionLaunchProfile, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, } from "./generated/rpc.js";
14
+ export type { ConnectorAccountRequest, ConnectorAvailability, ConnectorCapabilities, ConnectorCatalogEntry, ConnectorCatalogResult, ConnectorCatalogStatus, ConnectorConnectRequest, ConnectorConnectResult, ConnectorContinueRequest, ConnectorDisconnectResult, ConnectorMcpStatus, ConnectorReconcileRequest, ConnectorRuntimeStatus, ConnectorStatus, ExtensionLaunchProfile, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, } from "./generated/rpc.js";
15
15
  /**
16
16
  * Arguments passed to a session's {@link GitHubTokenProvider}.
17
17
  *
@@ -1622,6 +1622,8 @@ export interface McpAuthStaticClientConfig {
1622
1622
  grantType?: "client_credentials";
1623
1623
  /** Whether this is a public OAuth client. */
1624
1624
  publicClient?: boolean;
1625
+ /** Configured OAuth scope string used when the server challenge omits scope. */
1626
+ scope?: string;
1625
1627
  }
1626
1628
  /** MCP OAuth request that the SDK host can satisfy with a host-acquired token. */
1627
1629
  export interface McpAuthRequest {
@@ -1922,6 +1924,16 @@ export interface SessionConfigBase {
1922
1924
  * the session to the long-context tier; omit or use "default" otherwise.
1923
1925
  */
1924
1926
  contextTier?: ContextTier;
1927
+ /**
1928
+ * Enables session-scoped MCP diagnostic capture at the requested level.
1929
+ *
1930
+ * Diagnostics are off by default. At `"debug"` and `"trace"` levels, entries
1931
+ * can contain MCP payloads, tool arguments, paths, and server stderr. Do not
1932
+ * upload entries as telemetry or export them without deliberate host action.
1933
+ * Omit this option when resuming a resident session to preserve its current
1934
+ * diagnostic level.
1935
+ */
1936
+ diagnostics?: DiagnosticsConfiguration;
1925
1937
  /** Per-property overrides for model capabilities, deep-merged over runtime defaults. */
1926
1938
  modelCapabilities?: ModelCapabilitiesOverride;
1927
1939
  /**
@@ -2465,6 +2477,14 @@ export interface SessionConfig extends SessionConfigBase {
2465
2477
  * Optional custom session ID. If not provided, the server generates one.
2466
2478
  */
2467
2479
  sessionId?: string;
2480
+ /**
2481
+ * Invalidates the process-wide custom-instruction discovery cache before
2482
+ * creating this session. Use when instruction files changed in the same runtime.
2483
+ * Other sessions in this runtime may observe updated instructions on later turns
2484
+ * or discovery. This does not watch files or enable disabled instruction loading.
2485
+ * @default false
2486
+ */
2487
+ refreshCustomInstructions?: boolean;
2468
2488
  /**
2469
2489
  * Creates a remote session in the cloud instead of a local session.
2470
2490
  * The optional repository is associated with the cloud session.
package/package.json CHANGED
@@ -4,8 +4,8 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/github/copilot-sdk.git"
6
6
  },
7
- "version": "1.0.15-preview.1",
8
- "copilotCliVersion": "1.0.89-0",
7
+ "version": "1.0.15-preview.3",
8
+ "copilotCliVersion": "1.0.89-3",
9
9
  "description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
10
10
  "main": "./dist/cjs/index.js",
11
11
  "types": "./dist/index.d.ts",
@@ -101,13 +101,13 @@
101
101
  "README.md"
102
102
  ],
103
103
  "optionalDependencies": {
104
- "@github/copilot-sdk-darwin-arm64": "1.0.15-preview.1",
105
- "@github/copilot-sdk-darwin-x64": "1.0.15-preview.1",
106
- "@github/copilot-sdk-linux-arm64": "1.0.15-preview.1",
107
- "@github/copilot-sdk-linux-x64": "1.0.15-preview.1",
108
- "@github/copilot-sdk-linuxmusl-arm64": "1.0.15-preview.1",
109
- "@github/copilot-sdk-linuxmusl-x64": "1.0.15-preview.1",
110
- "@github/copilot-sdk-win32-arm64": "1.0.15-preview.1",
111
- "@github/copilot-sdk-win32-x64": "1.0.15-preview.1"
104
+ "@github/copilot-sdk-darwin-arm64": "1.0.15-preview.3",
105
+ "@github/copilot-sdk-darwin-x64": "1.0.15-preview.3",
106
+ "@github/copilot-sdk-linux-arm64": "1.0.15-preview.3",
107
+ "@github/copilot-sdk-linux-x64": "1.0.15-preview.3",
108
+ "@github/copilot-sdk-linuxmusl-arm64": "1.0.15-preview.3",
109
+ "@github/copilot-sdk-linuxmusl-x64": "1.0.15-preview.3",
110
+ "@github/copilot-sdk-win32-arm64": "1.0.15-preview.3",
111
+ "@github/copilot-sdk-win32-x64": "1.0.15-preview.3"
112
112
  }
113
113
  }