@github/copilot-sdk 1.0.13-preview.1 → 1.0.13-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/dist/client.js CHANGED
@@ -271,6 +271,7 @@ class CopilotClient {
271
271
  builtinPluginDirectories = [];
272
272
  onGitHubTelemetry;
273
273
  clientGlobalHandlers = {};
274
+ githubTokenProviders = /* @__PURE__ */ new Map();
274
275
  /**
275
276
  * Typed server-scoped RPC methods.
276
277
  * @throws Error if the client is not connected
@@ -528,8 +529,53 @@ class CopilotClient {
528
529
  }
529
530
  };
530
531
  }
532
+ handlers.gitHubToken = {
533
+ getToken: (params) => this.acquireGitHubToken(params)
534
+ };
531
535
  this.clientGlobalHandlers = handlers;
532
536
  }
537
+ async acquireGitHubToken(params) {
538
+ const registration = this.githubTokenProviders.get(params.registrationId);
539
+ if (!registration) {
540
+ throw new Error(
541
+ `No GitHub token provider registered for registration ID "${params.registrationId}"`
542
+ );
543
+ }
544
+ return await registration.provider({
545
+ host: params.host,
546
+ sessionId: params.sessionId ?? registration.sessionId,
547
+ reason: params.reason
548
+ });
549
+ }
550
+ registerGitHubTokenProvider(provider, sessionId) {
551
+ if (!provider) {
552
+ return void 0;
553
+ }
554
+ const registrationId = randomUUID();
555
+ this.githubTokenProviders.set(registrationId, { provider, sessionId, committed: false });
556
+ return registrationId;
557
+ }
558
+ assignGitHubTokenProvider(registrationId, sessionId) {
559
+ if (!registrationId) {
560
+ return;
561
+ }
562
+ const registration = this.githubTokenProviders.get(registrationId);
563
+ if (registration) {
564
+ registration.sessionId = sessionId;
565
+ }
566
+ }
567
+ commitGitHubTokenProvider(sessionId, registrationId) {
568
+ for (const [candidateId, registration2] of this.githubTokenProviders) {
569
+ if (registration2.sessionId === sessionId && registration2.committed) {
570
+ this.githubTokenProviders.delete(candidateId);
571
+ }
572
+ }
573
+ const registration = registrationId ? this.githubTokenProviders.get(registrationId) : void 0;
574
+ if (registration) {
575
+ registration.sessionId = sessionId;
576
+ registration.committed = true;
577
+ }
578
+ }
533
579
  /**
534
580
  * Starts the CLI server and establishes a connection.
535
581
  *
@@ -646,6 +692,7 @@ class CopilotClient {
646
692
  session._markDisconnected();
647
693
  }
648
694
  this.sessions.clear();
695
+ this.githubTokenProviders.clear();
649
696
  if (this.connection && (this.cliProcess || this.ffiHost) && !this.isExternalServer) {
650
697
  const runtimeShutdownStart = Date.now();
651
698
  const shutdownPromise = this.rpc.runtime.shutdown();
@@ -800,6 +847,7 @@ class CopilotClient {
800
847
  session._markDisconnected();
801
848
  }
802
849
  this.sessions.clear();
850
+ this.githubTokenProviders.clear();
803
851
  if (this.messageWriter) {
804
852
  this.messageWriter.suppressWriteErrors = true;
805
853
  }
@@ -1003,6 +1051,9 @@ class CopilotClient {
1003
1051
  }
1004
1052
  }
1005
1053
  async createSession(config) {
1054
+ if (config.gitHubToken !== void 0 && config.gitHubTokenProvider !== void 0) {
1055
+ throw new Error("gitHubToken and gitHubTokenProvider are mutually exclusive");
1056
+ }
1006
1057
  if (!this.connection) {
1007
1058
  await this.start();
1008
1059
  }
@@ -1013,6 +1064,11 @@ class CopilotClient {
1013
1064
  const callerSessionId = config.sessionId;
1014
1065
  const useServerGeneratedId = config.cloud != null && callerSessionId == null;
1015
1066
  const localSessionId = useServerGeneratedId ? void 0 : callerSessionId ?? randomUUID();
1067
+ const toolFilterOptions = this.resolveToolFilterOptions(config);
1068
+ const gitHubTokenProviderRegistrationId = this.registerGitHubTokenProvider(
1069
+ config.gitHubTokenProvider,
1070
+ localSessionId
1071
+ );
1016
1072
  const {
1017
1073
  wireProvider: bearerWireProvider,
1018
1074
  wireProviders: bearerWireProviders,
@@ -1029,7 +1085,10 @@ class CopilotClient {
1029
1085
  this.onGetTraceContext,
1030
1086
  {
1031
1087
  mcpAuthHandler: config.onMcpAuthRequest,
1032
- managedSettingsEnabled: config.enableManagedSettings === true || config.managedSettings !== void 0
1088
+ managedSettingsEnabled: config.enableManagedSettings === true || config.managedSettings !== void 0,
1089
+ onDisconnected: gitHubTokenProviderRegistrationId === void 0 ? void 0 : () => this.githubTokenProviders.delete(
1090
+ gitHubTokenProviderRegistrationId
1091
+ )
1033
1092
  }
1034
1093
  );
1035
1094
  s.registerTools(config.tools);
@@ -1067,10 +1126,16 @@ class CopilotClient {
1067
1126
  let session;
1068
1127
  let registeredId;
1069
1128
  if (localSessionId !== void 0) {
1070
- session = initializeSession(localSessionId);
1071
- registeredId = localSessionId;
1129
+ try {
1130
+ session = initializeSession(localSessionId);
1131
+ registeredId = localSessionId;
1132
+ } catch (error) {
1133
+ if (gitHubTokenProviderRegistrationId !== void 0) {
1134
+ this.githubTokenProviders.delete(gitHubTokenProviderRegistrationId);
1135
+ }
1136
+ throw error;
1137
+ }
1072
1138
  }
1073
- const toolFilterOptions = this.resolveToolFilterOptions(config);
1074
1139
  try {
1075
1140
  const response = await this.connection.sendRequest("session.create", {
1076
1141
  ...await getTraceContext(this.onGetTraceContext),
@@ -1120,6 +1185,7 @@ class CopilotClient {
1120
1185
  requestPermission: !!config.onPermissionRequest,
1121
1186
  requestUserInput: !!config.onUserInputRequest,
1122
1187
  requestElicitation: !!config.onElicitationRequest,
1188
+ askUserVariant: config.askUserVariant,
1123
1189
  ...config.enableMcpApps ? { requestMcpApps: true } : {},
1124
1190
  ...config.githubMcpToolConfig != null ? { githubMcpToolConfig: config.githubMcpToolConfig } : {},
1125
1191
  requestExitPlanMode: !!config.onExitPlanModeRequest,
@@ -1155,6 +1221,7 @@ class CopilotClient {
1155
1221
  infiniteSessions: config.infiniteSessions,
1156
1222
  memory: config.memory,
1157
1223
  gitHubToken: config.gitHubToken,
1224
+ gitHubTokenProviderRegistrationId,
1158
1225
  remoteSession: config.remoteSession,
1159
1226
  cloud: config.cloud,
1160
1227
  expAssignments: config.expAssignments,
@@ -1178,6 +1245,7 @@ class CopilotClient {
1178
1245
  session = initializeSession(returnedSessionId);
1179
1246
  registeredId = returnedSessionId;
1180
1247
  }
1248
+ this.assignGitHubTokenProvider(gitHubTokenProviderRegistrationId, returnedSessionId);
1181
1249
  if (config.onMcpAuthRequest) {
1182
1250
  await this.connection.sendRequest("session.eventLog.registerInterest", {
1183
1251
  sessionId: returnedSessionId,
@@ -1187,10 +1255,14 @@ class CopilotClient {
1187
1255
  session["_workspacePath"] = workspacePath;
1188
1256
  session.setCapabilities(capabilities);
1189
1257
  await this.updateSessionOptionsForMode(session, config);
1258
+ this.commitGitHubTokenProvider(returnedSessionId, gitHubTokenProviderRegistrationId);
1190
1259
  } catch (e) {
1191
1260
  if (registeredId !== void 0) {
1192
1261
  this.sessions.delete(registeredId);
1193
1262
  }
1263
+ if (gitHubTokenProviderRegistrationId !== void 0) {
1264
+ this.githubTokenProviders.delete(gitHubTokenProviderRegistrationId);
1265
+ }
1194
1266
  throw e;
1195
1267
  }
1196
1268
  return session;
@@ -1227,6 +1299,9 @@ class CopilotClient {
1227
1299
  return this.resumeSessionInternal(sessionId, config, factories, extensionOptions);
1228
1300
  }
1229
1301
  async resumeSessionInternal(sessionId, config, factories, extensionOptions) {
1302
+ if (config.gitHubToken !== void 0 && config.gitHubTokenProvider !== void 0) {
1303
+ throw new Error("gitHubToken and gitHubTokenProvider are mutually exclusive");
1304
+ }
1230
1305
  if (!this.connection) {
1231
1306
  await this.start();
1232
1307
  }
@@ -1284,6 +1359,15 @@ class CopilotClient {
1284
1359
  this.sessions.set(sessionId, session);
1285
1360
  this.setupSessionFs(session, config);
1286
1361
  const toolFilterOptions = this.resolveToolFilterOptions(config);
1362
+ const gitHubTokenProviderRegistrationId = this.registerGitHubTokenProvider(
1363
+ config.gitHubTokenProvider,
1364
+ sessionId
1365
+ );
1366
+ if (gitHubTokenProviderRegistrationId !== void 0) {
1367
+ session._setOnDisconnected(
1368
+ () => this.githubTokenProviders.delete(gitHubTokenProviderRegistrationId)
1369
+ );
1370
+ }
1287
1371
  try {
1288
1372
  const response = await this.connection.sendRequest("session.resume", {
1289
1373
  ...await getTraceContext(this.onGetTraceContext),
@@ -1334,6 +1418,7 @@ class CopilotClient {
1334
1418
  requestPermission: config.onPermissionRequest !== defaultJoinSessionPermissionHandler,
1335
1419
  requestUserInput: !!config.onUserInputRequest,
1336
1420
  requestElicitation: !!config.onElicitationRequest,
1421
+ askUserVariant: config.askUserVariant,
1337
1422
  ...config.enableMcpApps ? { requestMcpApps: true } : {},
1338
1423
  ...config.githubMcpToolConfig != null ? { githubMcpToolConfig: config.githubMcpToolConfig } : {},
1339
1424
  requestExitPlanMode: !!config.onExitPlanModeRequest,
@@ -1371,6 +1456,7 @@ class CopilotClient {
1371
1456
  disableResume: config.suppressResumeEvent,
1372
1457
  continuePendingWork: config.continuePendingWork,
1373
1458
  gitHubToken: config.gitHubToken,
1459
+ gitHubTokenProviderRegistrationId,
1374
1460
  remoteSession: config.remoteSession,
1375
1461
  openCanvases: config.openCanvases,
1376
1462
  expAssignments: config.expAssignments,
@@ -1400,8 +1486,12 @@ class CopilotClient {
1400
1486
  });
1401
1487
  }
1402
1488
  await this.updateSessionOptionsForMode(session, config);
1489
+ this.commitGitHubTokenProvider(sessionId, gitHubTokenProviderRegistrationId);
1403
1490
  } catch (e) {
1404
1491
  this.sessions.delete(sessionId);
1492
+ if (gitHubTokenProviderRegistrationId !== void 0) {
1493
+ this.githubTokenProviders.delete(gitHubTokenProviderRegistrationId);
1494
+ }
1405
1495
  throw e;
1406
1496
  }
1407
1497
  return session;
@@ -1590,7 +1680,9 @@ class CopilotClient {
1590
1680
  if (!success) {
1591
1681
  throw new Error(`Failed to delete session ${sessionId}: ${error || "Unknown error"}`);
1592
1682
  }
1683
+ const session = this.sessions.get(sessionId);
1593
1684
  this.sessions.delete(sessionId);
1685
+ session?._runOnDisconnected();
1594
1686
  }
1595
1687
  /**
1596
1688
  * List all available sessions.
@@ -2138,6 +2230,7 @@ stderr: ${stderrOutput}`
2138
2230
  );
2139
2231
  this.connection.onClose(() => {
2140
2232
  this.state = "disconnected";
2233
+ this.githubTokenProviders.clear();
2141
2234
  });
2142
2235
  this.connection.onError((_error) => {
2143
2236
  this.state = "disconnected";
@@ -42,7 +42,7 @@ export type JoinSessionConfig = Omit<ResumeSessionConfig, "onPermissionRequest"
42
42
  factories?: FactoryHandle[];
43
43
  };
44
44
  export type { ExtensionInfo, FactoryLimits, FactoryMeta } from "./types.js";
45
- export { defineFactory, FactoryResumeError, isFactoryRunTerminal, type RunOptions, type ResumeOptions, type FactoryResumeErrorCode, type SessionFactoryApi, type FactoryAgentOptions, type FactoryContext, type FactoryDefinition, type FactoryHandle, type FactoryJsonSchema, type JsonValue, type FactoryPipelineStage, type FactoryStepOptions, type FactoryRunResult, type FactoryRunStatus, type FactoryRunSummary, type FactoryRunDetail, type FactoryProgressPage, type FactoryProgressLine, type FactoryPhaseObservation, type FactoryPhaseStatus, type FactoryAgentSummary, } from "./factory.js";
45
+ export { defineFactory, FactoryResumeError, isFactoryRunTerminal, type RunOptions, type ResumeOptions, type FactoryResumeErrorCode, type SessionFactoryApi, type FactoryAgentOptions, type FactoryContext, type FactoryDefinition, type FactoryHandle, type FactoryJsonSchema, type JsonValue, type FactoryPipelineStage, type FactoryStepOptions, type FactoryRunResult, type FactoryRunStatus, type FactoryRunSummary, type FactoryListRunsOptions, type FactoryRunsPage, type FactoryRunDetail, type FactoryProgressPage, type FactoryProgressLine, type FactoryPhaseObservation, type FactoryPhaseStatus, type FactoryAgentSummary, } from "./factory.js";
46
46
  /**
47
47
  * Joins the current foreground session.
48
48
  *
package/dist/factory.d.ts CHANGED
@@ -1,9 +1,23 @@
1
- import type { FactoryGetRunProgressRequest, FactoryProgressPage, FactoryRunDetail, FactoryRunResult, FactoryRunStatus, FactoryRunSummary } from "./generated/rpc.js";
1
+ import type { FactoryGetRunProgressRequest, FactoryListRunsRequest, FactoryListRunsResult, FactoryProgressPage, FactoryRunDetail, FactoryRunResult, FactoryRunStatus, FactoryRunSummary } from "./generated/rpc.js";
2
2
  import type { ContextTier } from "./generated/session-events.js";
3
3
  import type { CopilotSession } from "./session.js";
4
4
  import type { FactoryLimits, FactoryMeta } from "./types.js";
5
5
  export type { FactoryRunResult };
6
6
  export type { FactoryAgentSummary, FactoryPhaseStatus, FactoryPhaseObservation, FactoryProgressLine, FactoryProgressPage, FactoryRunDetail, FactoryRunStatus, FactoryRunSummary, } from "./generated/rpc.js";
7
+ /**
8
+ * Options for paging durable factory runs.
9
+ *
10
+ * @experimental Part of the experimental Agent Factories surface and may
11
+ * change or be removed in future SDK or CLI releases.
12
+ */
13
+ export type FactoryListRunsOptions = FactoryListRunsRequest;
14
+ /**
15
+ * A page of durable factory runs and its paging metadata.
16
+ *
17
+ * @experimental Part of the experimental Agent Factories surface and may
18
+ * change or be removed in future SDK or CLI releases.
19
+ */
20
+ export type FactoryRunsPage = FactoryListRunsResult;
7
21
  /**
8
22
  * Whether a factory run status is terminal.
9
23
  *
@@ -165,6 +179,10 @@ export interface RunOptions<TArgs extends JsonValue = JsonValue> {
165
179
  args?: TArgs;
166
180
  /** Optional per-invocation resource ceiling overrides. */
167
181
  limits?: FactoryLimits;
182
+ /** Whether to notify the originating session when the factory completes. */
183
+ notifyOnComplete?: boolean;
184
+ /** Whether to emit factory phase names to the session transcript. */
185
+ logPhaseNames?: boolean;
168
186
  /**
169
187
  * Prior run whose persisted identity, arguments, journal, and accounting should be resumed.
170
188
  *
@@ -181,6 +199,10 @@ export interface RunOptions<TArgs extends JsonValue = JsonValue> {
181
199
  export interface ResumeOptions {
182
200
  /** Optional per-invocation resource ceiling overrides. */
183
201
  limits?: FactoryLimits;
202
+ /** Whether to notify the originating session when the factory completes. */
203
+ notifyOnComplete?: boolean;
204
+ /** Whether to emit factory phase names to the session transcript. */
205
+ logPhaseNames?: boolean;
184
206
  }
185
207
  /**
186
208
  * Machine-readable pre-execution factory resume failure.
@@ -239,8 +261,20 @@ export interface SessionFactoryApi {
239
261
  }): Promise<FactoryRunResult>;
240
262
  /**
241
263
  * List the newest default page of this session's durable factory runs.
264
+ *
265
+ * This backwards-compatible overload returns only the runs array. Pass
266
+ * paging options to receive the full page, including its cursors and
267
+ * truncation metadata.
242
268
  */
243
269
  listRuns(): Promise<FactoryRunSummary[]>;
270
+ /**
271
+ * Page this session's durable factory runs.
272
+ *
273
+ * `afterSeq` and `beforeSeq` are exclusive cursors. The result includes
274
+ * `oldestSeq`, `newestSeq`, `hasMoreNewer`, and `omittedOlder` so callers
275
+ * can continue paging without using the raw RPC client.
276
+ */
277
+ listRuns(options: FactoryListRunsOptions): Promise<FactoryRunsPage>;
244
278
  /** Read durable phases, direct agents, and the latest progress tail for a run. */
245
279
  getRunDetail(runId: string): Promise<FactoryRunDetail>;
246
280
  /** Page durable progress forward, backward, or from the latest tail. */
@@ -3,7 +3,7 @@
3
3
  * Generated from: api.schema.json
4
4
  */
5
5
  import type { MessageConnection } from "vscode-jsonrpc/node.js";
6
- import type { AbortReason, Attachment, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerSource, McpServerStatus, ModelChangeSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UserToolSessionApproval, Verbosity } from "./session-events.js";
6
+ import type { AbortReason, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerSource, McpServerStatus, ModelChangeSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UserToolSessionApproval, Verbosity } from "./session-events.js";
7
7
  /** A value that can be represented losslessly on the SDK JSON wire. */
8
8
  export type JsonValue = null | boolean | number | string | JsonValue[] | {
9
9
  [key: string]: JsonValue;
@@ -2373,8 +2373,24 @@ export type PermissionDecisionSurface =
2373
2373
  | "prompt_mode"
2374
2374
  /** The Copilot App client. */
2375
2375
  | "copilot_app"
2376
+ /** An Agent Client Protocol host. */
2377
+ | "acp"
2376
2378
  /** A generic Copilot SDK client. */
2377
2379
  | "sdk";
2380
+ /**
2381
+ * Response capability available to the client when it settled a permission request.
2382
+ *
2383
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2384
+ * via the `definition` "PermissionResponseCapability".
2385
+ */
2386
+ /** @experimental */
2387
+ export type PermissionResponseCapability =
2388
+ /** The client could ask a user for this decision. */
2389
+ "interactive"
2390
+ /** The client could return an automated response but could not ask a user. */
2391
+ | "headless"
2392
+ /** The client had no response path available. */
2393
+ | "none";
2378
2394
  /**
2379
2395
  * Tool approval to persist and apply
2380
2396
  *
@@ -5164,6 +5180,7 @@ export interface CanvasProviderUnregisterRequest {
5164
5180
  */
5165
5181
  /** @experimental */
5166
5182
  export interface CapiSessionOptions {
5183
+ autoTier?: AutoTier;
5167
5184
  /**
5168
5185
  * Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable.
5169
5186
  */
@@ -6447,6 +6464,10 @@ export interface EnqueueCommandParams {
6447
6464
  * Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately.
6448
6465
  */
6449
6466
  command: string;
6467
+ /**
6468
+ * Optional user-facing text for the queue row. The command string is shown when omitted.
6469
+ */
6470
+ displayText?: string | null;
6450
6471
  }
6451
6472
  /**
6452
6473
  * Indicates whether the command was accepted into the local execution queue.
@@ -6856,6 +6877,10 @@ export interface ExternalToolTextResultForLlmContentShellExit {
6856
6877
  * Whether outputPreview is known to be incomplete or truncated
6857
6878
  */
6858
6879
  outputTruncated?: boolean;
6880
+ /**
6881
+ * Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold.
6882
+ */
6883
+ outputFilePath?: string;
6859
6884
  }
6860
6885
  /**
6861
6886
  * Image content block with base64-encoded data
@@ -7676,6 +7701,14 @@ export interface FactoryResumeRequest {
7676
7701
  */
7677
7702
  runId: string;
7678
7703
  limits?: FactoryRunLimits;
7704
+ /**
7705
+ * Whether to notify the originating session when the factory completes.
7706
+ */
7707
+ notifyOnComplete?: boolean;
7708
+ /**
7709
+ * Whether to emit factory phase names to the session transcript.
7710
+ */
7711
+ logPhaseNames?: boolean;
7679
7712
  }
7680
7713
  /**
7681
7714
  * Wire-only per-invocation factory resource ceiling overrides.
@@ -7859,6 +7892,14 @@ export interface FactoryRunRequest {
7859
7892
  /** @experimental */
7860
7893
  export interface RunOptions {
7861
7894
  limits?: FactoryRunLimits;
7895
+ /**
7896
+ * Whether to notify the originating session when the factory completes.
7897
+ */
7898
+ notifyOnComplete?: boolean;
7899
+ /**
7900
+ * Whether to emit factory phase names to the session transcript.
7901
+ */
7902
+ logPhaseNames?: boolean;
7862
7903
  /**
7863
7904
  * Run identifier whose journal and progress should seed this resumed run.
7864
7905
  */
@@ -7977,6 +8018,14 @@ export interface GitHubTelemetryClientInfo {
7977
8018
  * Stable machine identifier for the device.
7978
8019
  */
7979
8020
  dev_device_id?: string;
8021
+ /**
8022
+ * Distinct CPU model names for the host, comma-separated.
8023
+ */
8024
+ cpu_model?: string;
8025
+ /**
8026
+ * Number of logical CPU cores on the host.
8027
+ */
8028
+ cpu_count?: number;
7980
8029
  }
7981
8030
  /**
7982
8031
  * A single telemetry event in the runtime's native GitHub-shaped telemetry format, forwarded verbatim to opted-in hosts. The `restricted` flag on the enclosing GitHubTelemetryNotification distinguishes standard from restricted events; the payload shape is identical for both.
@@ -12900,6 +12949,7 @@ export interface PermissionDecisionContext {
12900
12949
  outcome: PermissionDecisionOutcome;
12901
12950
  source: PermissionDecisionSource;
12902
12951
  surface: PermissionDecisionSurface;
12952
+ responseCapability?: PermissionResponseCapability;
12903
12953
  }
12904
12954
  /**
12905
12955
  * Pending permission request ID and the decision to apply (approve/reject and scope).
@@ -15698,7 +15748,7 @@ export interface SandboxConfig {
15698
15748
  addCurrentWorkingDirectory?: boolean;
15699
15749
  auth?: SandboxConfigAuth;
15700
15750
  /**
15701
- * Whether to auto-grant read access to the tool directories discovered on PATH and in toolchain environment variables (GOROOT, CARGO_HOME, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, registries, and toolchains in their default home locations (cargo, go, npm, Maven, and more), plus read-write access to (and up-front creation of) the scratch caches builds write on every run (go-build, ccache, sccache, Gradle caches, Cargo lock/tracker files), so builds work without extra configuration; a relocated CARGO_HOME additionally gets its Cargo lock files granted read-write. Set to false to disable every grant listed above: user-installed toolchains (rustup, nvm, pyenv, conda, pipx) then need explicit userPolicy.filesystem entries — readonlyPaths to read them, plus readwriteFiles for a relocated CARGO_HOME's .package-cache and .global-cache, which Cargo locks on every build. Only these developer-tool grants are affected: the working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted, so commands still run. Default: true (enabled by default; set to false to opt out).
15751
+ * Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out).
15702
15752
  */
15703
15753
  allowDevToolAccess?: boolean;
15704
15754
  }
@@ -15832,6 +15882,27 @@ export interface SandboxConfigAuth {
15832
15882
  */
15833
15883
  gh?: boolean;
15834
15884
  }
15885
+ /**
15886
+ * Managed sandbox enforcement state for a session.
15887
+ *
15888
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
15889
+ * via the `definition` "SandboxEnforcementStatus".
15890
+ */
15891
+ /** @experimental */
15892
+ export interface SandboxEnforcementStatus {
15893
+ /**
15894
+ * Whether the effective managed policy requires an available sandbox backend.
15895
+ */
15896
+ required: boolean;
15897
+ /**
15898
+ * Whether an enforcement failure has permanently blocked the session.
15899
+ */
15900
+ blocked: boolean;
15901
+ /**
15902
+ * The first sandbox enforcement failure that blocked the session.
15903
+ */
15904
+ reason?: string;
15905
+ }
15835
15906
  /**
15836
15907
  * Register an absolute-time scheduled prompt.
15837
15908
  *
@@ -20263,10 +20334,6 @@ export interface ToolsExecuteRequest {
20263
20334
  */
20264
20335
  /** @experimental */
20265
20336
  export interface ToolsGetBuiltinDescriptorsRequest {
20266
- /**
20267
- * Whether line numbers should be omitted from the view tool descriptor.
20268
- */
20269
- noViewLineNumbers?: boolean;
20270
20337
  /**
20271
20338
  * Whether descriptors should favor fewer user-intervention prompts.
20272
20339
  */
@@ -20280,10 +20347,6 @@ export interface ToolsGetBuiltinDescriptorsRequest {
20280
20347
  */
20281
20348
  skillEmbeddingEnabled?: boolean;
20282
20349
  shellConfig?: ToolsShellDescriptorConfig;
20283
- /**
20284
- * Whether shell commands may only run asynchronously.
20285
- */
20286
- shellAsyncOnlyEnabled?: boolean;
20287
20350
  /**
20288
20351
  * Whether the configured shell supports PowerShell 7 syntax.
20289
20352
  */
@@ -22123,7 +22186,7 @@ export declare function createServerRpc(connection: MessageConnection): {
22123
22186
  disable: (params: DiscoveredExtensionsDisableRequest) => Promise<void>;
22124
22187
  };
22125
22188
  /**
22126
- * Registers the calling SDK client as the per-entrypoint extension launch provider. Call before creating any sessions. When omitted, the runtime temporarily falls back to its built-in Node launcher for backward compatibility.
22189
+ * Registers the calling SDK client as the per-entrypoint extension launch provider. Call before creating any sessions. When omitted, the runtime uses its built-in extension launcher.
22127
22190
  *
22128
22191
  * @experimental
22129
22192
  */
@@ -22618,6 +22681,15 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
22618
22681
  * @experimental
22619
22682
  */
22620
22683
  sendMessages: (params: SendMessagesRequest) => Promise<SendMessagesResult>;
22684
+ /** @experimental */
22685
+ sandbox: {
22686
+ /**
22687
+ * Returns whether managed policy requires sandbox enforcement and whether an enforcement failure has permanently blocked the session.
22688
+ *
22689
+ * @returns Managed sandbox enforcement state for a session.
22690
+ */
22691
+ getEnforcementStatus: () => Promise<SandboxEnforcementStatus>;
22692
+ };
22621
22693
  /**
22622
22694
  * Aborts the current agent turn.
22623
22695
  *
@@ -172,7 +172,7 @@ function createServerRpc(connection) {
172
172
  disable: async (params) => connection.sendRequest("extensions.disable", params)
173
173
  },
174
174
  /**
175
- * Registers the calling SDK client as the per-entrypoint extension launch provider. Call before creating any sessions. When omitted, the runtime temporarily falls back to its built-in Node launcher for backward compatibility.
175
+ * Registers the calling SDK client as the per-entrypoint extension launch provider. Call before creating any sessions. When omitted, the runtime uses its built-in extension launcher.
176
176
  *
177
177
  * @experimental
178
178
  */
@@ -745,6 +745,15 @@ function createSessionRpc(connection, sessionId) {
745
745
  * @experimental
746
746
  */
747
747
  sendMessages: async (params) => connection.sendRequest("session.sendMessages", { sessionId, ...params }),
748
+ /** @experimental */
749
+ sandbox: {
750
+ /**
751
+ * Returns whether managed policy requires sandbox enforcement and whether an enforcement failure has permanently blocked the session.
752
+ *
753
+ * @returns Managed sandbox enforcement state for a session.
754
+ */
755
+ getEnforcementStatus: async () => connection.sendRequest("session.sandbox.getEnforcementStatus", { sessionId })
756
+ },
748
757
  /**
749
758
  * Aborts the current agent turn.
750
759
  *
@@ -2512,6 +2521,25 @@ function createInternalSessionRpc(connection, sessionId) {
2512
2521
  }
2513
2522
  },
2514
2523
  /** @experimental */
2524
+ factory: {
2525
+ /**
2526
+ * Internal tool-originated factory invocation.
2527
+ *
2528
+ * @param params Internal parameters for invoking a registered factory from a tool.
2529
+ *
2530
+ * @returns Complete current or terminal factory run envelope.
2531
+ */
2532
+ runFromTool: async (params) => connection.sendRequest("session.factory.runFromTool", { sessionId, ...params }),
2533
+ /**
2534
+ * Internal tool-originated factory resume.
2535
+ *
2536
+ * @param params Internal parameters for resuming a factory run from a tool.
2537
+ *
2538
+ * @returns Resolved persisted factory identity and resumed run envelope.
2539
+ */
2540
+ resumeFromTool: async (params) => connection.sendRequest("session.factory.resumeFromTool", { sessionId, ...params })
2541
+ },
2542
+ /** @experimental */
2515
2543
  model: {
2516
2544
  /**
2517
2545
  * Resolves and applies organization-managed and repository model overlays.