@github/copilot-sdk 1.0.13-preview.4 → 1.0.13-preview.6

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
@@ -1,10 +1,8 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { existsSync } from "node:fs";
4
- import { createRequire } from "node:module";
5
- import { Socket } from "node:net";
4
+ import { isIPv6, Socket } from "node:net";
6
5
  import { dirname, isAbsolute, join, resolve } from "node:path";
7
- import { fileURLToPath } from "node:url";
8
6
  import {
9
7
  createMessageConnection,
10
8
  ErrorCodes,
@@ -20,7 +18,8 @@ import {
20
18
  } from "./generated/rpc.js";
21
19
  import { getSdkProtocolVersion } from "./sdkProtocolVersion.js";
22
20
  import { CopilotSession } from "./session.js";
23
- import { materializeRuntimeBundle } from "./runtimeArtifacts.js";
21
+ import { ensureRuntimeBundle } from "./runtimeArtifacts.js";
22
+ import { COPILOT_CLI_VERSION } from "./cliVersion.js";
24
23
  import { createSessionFsAdapter } from "./sessionFsProvider.js";
25
24
  import { createCopilotRequestAdapter } from "./copilotRequestHandler.js";
26
25
  import { getTraceContext } from "./telemetry.js";
@@ -128,6 +127,15 @@ function toWireCustomAgents(agents) {
128
127
  return { ...rest, mcpServers: toWireMcpServers(mcpServers) };
129
128
  });
130
129
  }
130
+ function clientInfoToWire(info) {
131
+ if (info == null) return void 0;
132
+ const wire = {};
133
+ if (info.applicationName) wire.editorName = info.applicationName;
134
+ if (info.applicationVersion) wire.editorVersion = info.applicationVersion;
135
+ if (info.integrationName) wire.extensionName = info.integrationName;
136
+ if (info.integrationVersion) wire.extensionVersion = info.integrationVersion;
137
+ return Object.keys(wire).length > 0 ? wire : void 0;
138
+ }
131
139
  function toWireLargeOutput(config) {
132
140
  if (!config) return void 0;
133
141
  const { outputDirectory, ...rest } = config;
@@ -185,53 +193,8 @@ function getNodeExecPath() {
185
193
  }
186
194
  return process.execPath;
187
195
  }
188
- function getCliPlatformPackageNames() {
189
- const arch = process.arch;
190
- const variants = process.platform === "linux" ? ["linux", "linuxmusl"] : [process.platform];
191
- return variants.map((variant) => `@github/copilot-${variant}-${arch}`);
192
- }
193
- function getBundledCliPackage() {
194
- const packageNames = getCliPlatformPackageNames();
195
- if (typeof import.meta.resolve === "function") {
196
- for (const packageName of packageNames) {
197
- try {
198
- const packageEntryUrl = import.meta.resolve(packageName);
199
- const packageEntryPath = fileURLToPath(packageEntryUrl);
200
- return {
201
- root: dirname(packageEntryPath),
202
- platform: packageName.slice("@github/copilot-".length)
203
- };
204
- } catch {
205
- }
206
- }
207
- throw new Error(
208
- `Could not resolve a @github/copilot platform package (tried ${packageNames.join(", ")}). Ensure @github/copilot is installed, or pass cliPath/cliUrl to CopilotClient.`
209
- );
210
- }
211
- const req = createRequire(__filename);
212
- const searchPaths = req.resolve.paths("@github/copilot") ?? [];
213
- for (const base of searchPaths) {
214
- for (const packageName of packageNames) {
215
- const root = join(base, ...packageName.split("/"));
216
- const candidate = join(root, "index.js");
217
- if (existsSync(candidate)) {
218
- return {
219
- root,
220
- platform: packageName.slice("@github/copilot-".length)
221
- };
222
- }
223
- }
224
- }
225
- throw new Error(
226
- `Could not find a @github/copilot platform package (tried ${packageNames.join(", ")}). Searched ${searchPaths.length} paths. Ensure @github/copilot is installed, or pass cliPath/cliUrl to CopilotClient.`
227
- );
228
- }
229
196
  function getBundledRuntimePath() {
230
- const bundled = getBundledCliPackage();
231
- return materializeRuntimeBundle({
232
- packageRoot: bundled.root,
233
- platform: bundled.platform
234
- });
197
+ return ensureRuntimeBundle(COPILOT_CLI_VERSION);
235
198
  }
236
199
  class TeardownResilientStreamMessageWriter extends StreamMessageWriter {
237
200
  suppressWriteErrors = false;
@@ -450,8 +413,6 @@ class CopilotClient {
450
413
  const explicitCliPath = conn.path ?? effectiveEnv.COPILOT_CLI_PATH;
451
414
  if (explicitCliPath) {
452
415
  this.resolvedCliPath = explicitCliPath;
453
- } else {
454
- this.resolvedCliPath = getBundledRuntimePath();
455
416
  }
456
417
  }
457
418
  const connArgs = conn.kind === "stdio" || conn.kind === "tcp" ? conn.args ?? [] : [];
@@ -466,7 +427,8 @@ class CopilotClient {
466
427
  baseDirectory: options.baseDirectory,
467
428
  sessionIdleTimeoutSeconds: options.sessionIdleTimeoutSeconds ?? 0,
468
429
  enableRemoteSessions: options.enableRemoteSessions ?? false,
469
- mode: options.mode ?? "copilot-cli"
430
+ mode: options.mode ?? "copilot-cli",
431
+ clientInfo: options.clientInfo
470
432
  };
471
433
  if (this.options.mode === "empty") {
472
434
  const hasPersistence = this.options.baseDirectory !== void 0 || this.sessionFsConfig !== null || // External runtimes manage their own persistence layer; the SDK
@@ -482,17 +444,29 @@ class CopilotClient {
482
444
  connectionExtraArgs = [];
483
445
  /**
484
446
  * Parse CLI URL into host and port
485
- * Supports formats: "host:port", "http://host:port", "https://host:port", or just "port"
447
+ * Supports formats: "host:port", "[ipv6]:port", "http://host:port", "https://host:port", or just "port"
486
448
  */
487
449
  parseCliUrl(url) {
488
- let cleanUrl = url.replace(/^https?:\/\//, "");
450
+ const cleanUrl = url.replace(/^https?:\/\//, "");
489
451
  if (/^\d+$/.test(cleanUrl)) {
490
452
  return { host: "localhost", port: parseInt(cleanUrl, 10) };
491
453
  }
454
+ const ipv6Match = cleanUrl.match(/^\[([^\]]+)\]:(\d+)$/);
455
+ if (ipv6Match) {
456
+ const host2 = ipv6Match[1];
457
+ if (!isIPv6(host2)) {
458
+ throw new Error(`Invalid cliUrl format: ${url}`);
459
+ }
460
+ const port2 = parseInt(ipv6Match[2], 10);
461
+ if (isNaN(port2) || port2 <= 0 || port2 > 65535) {
462
+ throw new Error(`Invalid port in cliUrl: ${url}`);
463
+ }
464
+ return { host: host2, port: port2 };
465
+ }
492
466
  const parts = cleanUrl.split(":");
493
467
  if (parts.length !== 2) {
494
468
  throw new Error(
495
- `Invalid cliUrl format: ${url}. Expected "host:port", "http://host:port", or "port"`
469
+ `Invalid cliUrl format: ${url}. Expected "host:port", "[ipv6]:port", "http://host:port", or "port"`
496
470
  );
497
471
  }
498
472
  const host = parts[0] || "localhost";
@@ -1251,6 +1225,7 @@ class CopilotClient {
1251
1225
  gitHubTokenProviderRegistrationId,
1252
1226
  remoteSession: config.remoteSession,
1253
1227
  cloud: config.cloud,
1228
+ featureFlags: config.featureFlags,
1254
1229
  expAssignments: config.expAssignments,
1255
1230
  enableManagedSettings: config.enableManagedSettings,
1256
1231
  managedSettings: config.managedSettings
@@ -1486,6 +1461,7 @@ class CopilotClient {
1486
1461
  gitHubTokenProviderRegistrationId,
1487
1462
  remoteSession: config.remoteSession,
1488
1463
  openCanvases: config.openCanvases,
1464
+ featureFlags: config.featureFlags,
1489
1465
  expAssignments: config.expAssignments,
1490
1466
  enableManagedSettings: config.enableManagedSettings,
1491
1467
  managedSettings: config.managedSettings,
@@ -1634,6 +1610,10 @@ class CopilotClient {
1634
1610
  if (this.onGitHubTelemetry != null) {
1635
1611
  connectParams.enableGitHubTelemetryForwarding = true;
1636
1612
  }
1613
+ const clientInfo = clientInfoToWire(this.options.clientInfo);
1614
+ if (clientInfo != null) {
1615
+ connectParams.clientInfo = clientInfo;
1616
+ }
1637
1617
  const result = await raceAgainstExit(this.internalRpc.connect(connectParams));
1638
1618
  serverVersion = result.protocolVersion;
1639
1619
  } catch (err) {
@@ -1894,6 +1874,7 @@ class CopilotClient {
1894
1874
  * Start the CLI server process
1895
1875
  */
1896
1876
  async startCLIServer() {
1877
+ this.resolvedCliPath ??= await getBundledRuntimePath();
1897
1878
  return new Promise((resolve2, reject) => {
1898
1879
  this.stderrBuffer = "";
1899
1880
  const args = [...this.connectionExtraArgs, "--headless", "--no-auto-update"];
@@ -1931,7 +1912,7 @@ class CopilotClient {
1931
1912
  }
1932
1913
  if (!existsSync(this.resolvedCliPath)) {
1933
1914
  throw new Error(
1934
- `Copilot CLI not found at ${this.resolvedCliPath}. Ensure @github/copilot is installed.`
1915
+ `Copilot CLI not found at ${this.resolvedCliPath}. Set COPILOT_CLI_PATH to use a custom installation.`
1935
1916
  );
1936
1917
  }
1937
1918
  const stdioConfig = this.connectionConfig.kind === "stdio" ? ["pipe", "pipe", "pipe"] : ["ignore", "pipe", "pipe"];
@@ -2058,12 +2039,19 @@ stderr: ${stderrOutput}`
2058
2039
  /** Starts the in-process FFI runtime with SDK-managed typed options. */
2059
2040
  async startInProcessFfi() {
2060
2041
  const explicitEntrypoint = this.resolvedEnv.COPILOT_CLI_PATH;
2061
- const runtimeLibrary = explicitEntrypoint ? join(
2062
- dirname(resolve(explicitEntrypoint)),
2063
- "prebuilds",
2064
- CopilotClient.getNapiPrebuildsFolder(explicitEntrypoint),
2065
- "runtime.node"
2066
- ) : join(dirname(getBundledRuntimePath()), "runtime.node");
2042
+ let runtimeLibrary;
2043
+ if (explicitEntrypoint) {
2044
+ const entrypointDirectory = dirname(resolve(explicitEntrypoint));
2045
+ const adjacentRuntime = join(entrypointDirectory, "runtime.node");
2046
+ runtimeLibrary = existsSync(adjacentRuntime) ? adjacentRuntime : join(
2047
+ entrypointDirectory,
2048
+ "prebuilds",
2049
+ CopilotClient.getNapiPrebuildsFolder(explicitEntrypoint),
2050
+ "runtime.node"
2051
+ );
2052
+ } else {
2053
+ runtimeLibrary = join(dirname(await getBundledRuntimePath()), "runtime.node");
2054
+ }
2067
2055
  const { FfiRuntimeHost } = await import("./ffiRuntimeHost.js");
2068
2056
  const environment = {};
2069
2057
  if (this.options.gitHubToken) {
@@ -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, 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";
6
+ import type { AbortReason, AgentModelPolicy, 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;
@@ -529,7 +529,13 @@ export type CatalogNetworkFailureReason =
529
529
  | "tls"
530
530
  /** The connection was refused or reset. */
531
531
  | "connection-refused"
532
- /** The authority returned a status the runtime treats as a failure. */
532
+ /** The configured proxy returned 407 and requires authentication. */
533
+ | "proxy-authentication-required"
534
+ /** The authority rate-limited requests and supplied or implied a bounded cooldown. */
535
+ | "rate-limited"
536
+ /** The authority returned a transient 5xx response. */
537
+ | "service-unavailable"
538
+ /** The authority returned another status the runtime treats as a failure. */
533
539
  | "http-status"
534
540
  /** The response exceeded the permitted size. */
535
541
  | "response-too-large"
@@ -824,6 +830,64 @@ export type DiscoveredExtensionMode =
824
830
  | "load_only"
825
831
  /** Extensions are loaded and the agent can create, reload, and manage them. */
826
832
  | "load_and_augment";
833
+ /**
834
+ * Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events.
835
+ *
836
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
837
+ * via the `definition` "HookType".
838
+ */
839
+ /** @experimental */
840
+ export type HookType =
841
+ /** Runs before a tool is invoked. */
842
+ "preToolUse"
843
+ /** Runs before an MCP tool is invoked. */
844
+ | "preMcpToolCall"
845
+ /** Runs after a tool completes successfully. */
846
+ | "postToolUse"
847
+ /** Runs after a tool fails. */
848
+ | "postToolUseFailure"
849
+ /** Runs after the user submits a prompt. */
850
+ | "userPromptSubmitted"
851
+ /** Runs after the runtime transforms the submitted prompt for the model, before it is added to session history. */
852
+ | "userPromptTransformed"
853
+ /** Runs when a session starts. */
854
+ | "sessionStart"
855
+ /** Runs when a session ends. */
856
+ | "sessionEnd"
857
+ /** Runs after an agent result is produced. */
858
+ | "postResult"
859
+ /** Runs before a pull request description is generated. */
860
+ | "prePRDescription"
861
+ /** Runs when the agent encounters an error. */
862
+ | "errorOccurred"
863
+ /** Runs when the agent stops. */
864
+ | "agentStop"
865
+ /** Runs when a subagent starts. */
866
+ | "subagentStart"
867
+ /** Runs when a subagent stops. */
868
+ | "subagentStop"
869
+ /** Runs before conversation context is compacted. */
870
+ | "preCompact"
871
+ /** Runs when the agent requests permission. */
872
+ | "permissionRequest"
873
+ /** Runs when the agent emits a notification. */
874
+ | "notification";
875
+ /**
876
+ * Configuration tier that contributed a discovered hook action.
877
+ *
878
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
879
+ * via the `definition` "HookOrigin".
880
+ */
881
+ /** @experimental */
882
+ export type HookOrigin =
883
+ /** Hook loaded from user settings or the user's hook directory. */
884
+ "user"
885
+ /** Hook loaded from repository settings or the repository hook directory. */
886
+ | "repository"
887
+ /** Hook provided by an enabled installed or explicit plugin. Projectless rows omit projectPath and do not expand a project directory. */
888
+ | "plugin"
889
+ /** Hook enforced by centrally managed policy. */
890
+ | "policy";
827
891
  /**
828
892
  * Server transport type: stdio, http, sse (deprecated), or memory
829
893
  *
@@ -1075,6 +1139,15 @@ export type FactoryRunFailure = {
1075
1139
  * Factory failure variant discriminator.
1076
1140
  */
1077
1141
  type: "factory_accounting_incomplete";
1142
+ } | {
1143
+ /**
1144
+ * Factory run identifier.
1145
+ */
1146
+ runId: string;
1147
+ /**
1148
+ * Factory failure variant discriminator.
1149
+ */
1150
+ type: "factory_provider_disconnected";
1078
1151
  };
1079
1152
  /**
1080
1153
  * Cumulative resource ceiling that stopped a factory run.
@@ -4272,7 +4345,7 @@ export interface AgentGetCurrentResult {
4272
4345
  agent?: AgentInfo | null;
4273
4346
  }
4274
4347
  /**
4275
- * Agent metadata, including identifiers, display details, source, tools, model, MCP servers, skills, and file path.
4348
+ * Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path.
4276
4349
  *
4277
4350
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
4278
4351
  * via the `definition` "AgentInfo".
@@ -4312,6 +4385,11 @@ export interface AgentInfo {
4312
4385
  * Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference.
4313
4386
  */
4314
4387
  model?: string;
4388
+ /**
4389
+ * Authored preferred model ids for this agent, in priority order. Runtime model selection chooses the first available model; omitted means no authored preference.
4390
+ */
4391
+ models?: string[];
4392
+ modelPolicy?: AgentModelPolicy;
4315
4393
  /**
4316
4394
  * MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema.
4317
4395
  *
@@ -5527,6 +5605,10 @@ export interface CatalogNetworkFailureError {
5527
5605
  * HTTP status code, when the failure was a rejected response.
5528
5606
  */
5529
5607
  statusCode?: number;
5608
+ /**
5609
+ * Bounded cooldown in seconds before another catalog request should be attempted, when the authority supplied a numeric Retry-After value or the runtime applied its documented fallback.
5610
+ */
5611
+ retryAfterSeconds?: number;
5530
5612
  /**
5531
5613
  * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret.
5532
5614
  */
@@ -5578,7 +5660,7 @@ export interface CatalogPolicyRejectedError {
5578
5660
  export interface CatalogSearchRequest {
5579
5661
  contract: CatalogClientContract;
5580
5662
  /**
5581
- * Free-text search query. Never written to logs or telemetry.
5663
+ * Free-text search query. Persisted as tool input for session continuity, but omitted from telemetry.
5582
5664
  */
5583
5665
  query: string;
5584
5666
  /**
@@ -6425,6 +6507,37 @@ export interface DiscoveredExtensionsEnableRequest {
6425
6507
  */
6426
6508
  ids: string[];
6427
6509
  }
6510
+ /**
6511
+ * One server-discovered hook action from user, repository, plugin, or managed-policy configuration.
6512
+ *
6513
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
6514
+ * via the `definition` "DiscoveredHook".
6515
+ */
6516
+ /** @experimental */
6517
+ export interface DiscoveredHook {
6518
+ /**
6519
+ * Deterministic identifier for this server-discovered action row. It remains stable while the project, origin, source, event, action content, and duplicate ordinal are unchanged. This is row identity, not the key persisted in disabledHooks.
6520
+ */
6521
+ id: string;
6522
+ hookType: HookType;
6523
+ origin: HookOrigin;
6524
+ /**
6525
+ * Human-readable source label, such as a hook file path, settings source, or plugin name.
6526
+ */
6527
+ source?: string;
6528
+ /**
6529
+ * Input project path for which this server-side action was resolved. Set on every row returned for project-scoped discovery, including repeated user and policy actions.
6530
+ */
6531
+ projectPath?: string;
6532
+ /**
6533
+ * Whether this action is enabled under the server-side discovery settings. Concrete sessions may differ because they can add session-specific directories, plugins, or trust. False when its disable key is present in the user's disabled-hooks setting or disable-all settings suppress the action.
6534
+ */
6535
+ enabled: boolean;
6536
+ /**
6537
+ * Durable content hash used by hook enablement. Identical actions may intentionally share this key. Omitted when changing the user's disabled-hooks setting cannot change the action's current server-discovered state, including managed-policy hooks, session-start prompt actions, actions suppressed by disable-all settings, and projectless plugin actions that require project-directory expansion.
6538
+ */
6539
+ disableKey?: string;
6540
+ }
6428
6541
  /**
6429
6542
  * MCP server discovered by `mcp.discover`, with config source, optional plugin source, transport type, and enabled state.
6430
6543
  *
@@ -7761,6 +7874,10 @@ export interface FactoryRunResult {
7761
7874
  * Factory run identifier.
7762
7875
  */
7763
7876
  runId: string;
7877
+ /**
7878
+ * One-based execution attempt represented by this envelope. Absent before the first attempt starts or when returned by an older runtime.
7879
+ */
7880
+ attempt?: number;
7764
7881
  status: FactoryRunStatus;
7765
7882
  /**
7766
7883
  * Completed factory result.
@@ -8482,6 +8599,44 @@ export interface HistoryTruncateResult {
8482
8599
  */
8483
8600
  checkpointCleanupError?: string;
8484
8601
  }
8602
+ /**
8603
+ * Optional project paths and host-exclusion behavior for server-scoped hook discovery.
8604
+ *
8605
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8606
+ * via the `definition` "HooksDiscoverRequest".
8607
+ */
8608
+ /** @experimental */
8609
+ export interface HooksDiscoverRequest {
8610
+ /**
8611
+ * Optional project directory paths whose trusted repository and project-expanded plugin hooks should be discovered. When omitted or empty, user, managed-policy, and globally enabled installed or explicit plugin hooks are returned without project expansion.
8612
+ */
8613
+ projectPaths?: string[];
8614
+ /**
8615
+ * When true, omit host-owned user and plugin hook rows and their diagnostics. Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks still contribute to each remaining row's effective enabled state. This filters sources rather than simulating a host with no settings.
8616
+ */
8617
+ excludeHostHooks?: boolean;
8618
+ }
8619
+ /**
8620
+ * Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources.
8621
+ *
8622
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8623
+ * via the `definition` "HooksDiscoverResult".
8624
+ */
8625
+ /** @experimental */
8626
+ export interface HooksDiscoverResult {
8627
+ /**
8628
+ * All discovered hook actions. Byte-identical actions remain separate rows even when they share a disable key.
8629
+ */
8630
+ hooks: DiscoveredHook[];
8631
+ /**
8632
+ * Non-fatal source-loading warnings. Discovery remains complete for the affected source, although the source had a recoverable issue. Repository-settings warnings are prefixed with their project path when attribution is available.
8633
+ */
8634
+ warnings: string[];
8635
+ /**
8636
+ * Errors for hook sources or actions that could not be loaded, making the result partially incomplete. Other valid actions are still returned. Project-resolution and repository-settings errors are prefixed with their project path.
8637
+ */
8638
+ errors: string[];
8639
+ }
8485
8640
  /**
8486
8641
  * Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source.
8487
8642
  *
@@ -11704,6 +11859,10 @@ export interface ModelBillingPromo {
11704
11859
  * Human-readable promotion message. Does not include the expiry timestamp; consumers may format endsAt and append it when present.
11705
11860
  */
11706
11861
  message?: string;
11862
+ /**
11863
+ * Whether the service asked hosts to give this promotion a prominent surface, such as a dedicated banner, in addition to listing it with the model. `true` requests that surface and `false` asks for the model list only. Absent means the service expressed no preference — for example a response that predates the field — so hosts should apply their own default rather than read it as `false`.
11864
+ */
11865
+ showBanner?: boolean;
11707
11866
  }
11708
11867
  /**
11709
11868
  * Service-published warning text that hosts should display when presenting a model.
@@ -11751,6 +11910,10 @@ export interface ModelApplyStartupOverlayRequest {
11751
11910
  * Model required by server-managed policy, when configured.
11752
11911
  */
11753
11912
  serverManagedModel?: string;
11913
+ /**
11914
+ * Startup default model from the enterprise policy helper, when configured. Weakest of the managed sources: it applies only when neither device nor server policy names a model, and an explicit user selection still wins.
11915
+ */
11916
+ policyHelperModel?: string;
11754
11917
  /**
11755
11918
  * Model selected by repository settings, when configured.
11756
11919
  */
@@ -15189,6 +15352,10 @@ export interface QueuePendingItems {
15189
15352
  * Stable opaque id for the canonical queued item. Batch rows share one id.
15190
15353
  */
15191
15354
  id: string;
15355
+ /**
15356
+ * Stable identity of the queued user message. Present for message rows and absent for slash commands and model changes.
15357
+ */
15358
+ messageId?: string;
15192
15359
  kind: QueuePendingItemsKind;
15193
15360
  /**
15194
15361
  * Human-readable text to display for this queue entry in the UI
@@ -15817,7 +15984,7 @@ export interface SandboxConfigUserPolicyNetwork {
15817
15984
  /** @experimental */
15818
15985
  export interface SandboxConfigUserPolicyNetworkProxy {
15819
15986
  /**
15820
- * Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is.
15987
+ * Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted; an explicit port must be between 1 and 65535. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is.
15821
15988
  */
15822
15989
  url: string;
15823
15990
  /**
@@ -17560,6 +17727,10 @@ export interface SessionOpenOptions {
17560
17727
  * Additional directories to search for skills.
17561
17728
  */
17562
17729
  skillDirectories?: string[];
17730
+ /**
17731
+ * Whether skill loading is enabled. When omitted, an SDK skill provider enables skills by default.
17732
+ */
17733
+ enableSkills?: boolean;
17563
17734
  /**
17564
17735
  * Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available.
17565
17736
  */
@@ -18698,6 +18869,28 @@ export interface SessionsPruneOldRequest {
18698
18869
  */
18699
18870
  excludeSessionIds?: string[];
18700
18871
  }
18872
+ /**
18873
+ * Pagination options for reading an inactive or active local session's persisted event journal.
18874
+ *
18875
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
18876
+ * via the `definition` "SessionsReadPersistedEventsRequest".
18877
+ */
18878
+ /** @experimental */
18879
+ export interface SessionsReadPersistedEventsRequest {
18880
+ /**
18881
+ * Session ID whose persisted event journal should be read.
18882
+ */
18883
+ sessionId: string;
18884
+ /**
18885
+ * Opaque cursor returned by a previous persisted-event read. Omit on the first call.
18886
+ */
18887
+ cursor?: string;
18888
+ /**
18889
+ * Maximum number of events to return in this batch (1–1000, default 200).
18890
+ */
18891
+ max?: number;
18892
+ direction?: EventsReadDirection;
18893
+ }
18701
18894
  /**
18702
18895
  * Session ID whose in-use lock should be released.
18703
18896
  *
@@ -19065,7 +19258,7 @@ export interface SessionUpdateOptionsParams {
19065
19258
  */
19066
19259
  enableSessionStore?: boolean;
19067
19260
  /**
19068
- * Whether to enable skill directory scanning and loading. Falls back to enableConfigDiscovery when unset.
19261
+ * Whether skill loading is enabled. Explicit false disables every source, including a bound SDK provider; changing the value invalidates the loaded skill snapshot. When omitted, creation falls back to enableConfigDiscovery unless an SDK skill provider is registered.
19069
19262
  */
19070
19263
  enableSkills?: boolean;
19071
19264
  contextTier?: OptionsUpdateContextTier;
@@ -19286,6 +19479,35 @@ export interface SkillList {
19286
19479
  */
19287
19480
  skills: Skill[];
19288
19481
  }
19482
+ /**
19483
+ * Catalog-only metadata for one SDK-provided skill. The complete SKILL.md is fetched separately and lazily.
19484
+ *
19485
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
19486
+ * via the `definition` "SkillProviderDescriptor".
19487
+ */
19488
+ /** @experimental */
19489
+ export interface SkillProviderDescriptor {
19490
+ /**
19491
+ * Invocation and display name.
19492
+ */
19493
+ name: string;
19494
+ /**
19495
+ * Description used in skill catalogs without fetching content.
19496
+ */
19497
+ description: string;
19498
+ /**
19499
+ * Whether users may invoke the skill directly. Defaults to true.
19500
+ */
19501
+ userInvocable?: boolean;
19502
+ /**
19503
+ * Whether model invocation is disabled. Defaults to false.
19504
+ */
19505
+ disableModelInvocation?: boolean;
19506
+ /**
19507
+ * Optional freeform argument hint used by slash-command catalogs.
19508
+ */
19509
+ argumentHint?: string;
19510
+ }
19289
19511
  /**
19290
19512
  * Skill names to mark as disabled in global configuration, replacing any previous list.
19291
19513
  *
@@ -19406,7 +19628,7 @@ export interface SkillsInvokedSkill {
19406
19628
  */
19407
19629
  name: string;
19408
19630
  /**
19409
- * Path to the SKILL.md file
19631
+ * Path to the SKILL.md file, or an empty string for an SDK-provided skill without a filesystem identity
19410
19632
  */
19411
19633
  path: string;
19412
19634
  /**
@@ -19417,6 +19639,10 @@ export interface SkillsInvokedSkill {
19417
19639
  * Tools that should be auto-approved when this skill is active, captured at invocation time
19418
19640
  */
19419
19641
  allowedTools?: string[];
19642
+ /**
19643
+ * Whether model invocation was disabled when this skill was invoked
19644
+ */
19645
+ disableModelInvocation?: boolean;
19420
19646
  /**
19421
19647
  * Turn number when the skill was invoked
19422
19648
  */
@@ -19516,6 +19742,7 @@ export interface SlashCommandCompletedResult {
19516
19742
  * Optional user-facing message describing the completed command
19517
19743
  */
19518
19744
  message?: string;
19745
+ mode?: SessionMode;
19519
19746
  /**
19520
19747
  * True when the invocation mutated user runtime settings; consumers caching settings should refresh
19521
19748
  */
@@ -19697,6 +19924,7 @@ export interface SubagentSettingsEntry {
19697
19924
  * Model override for matching subagents
19698
19925
  */
19699
19926
  model?: string;
19927
+ modelPolicy?: AgentModelPolicy;
19700
19928
  /**
19701
19929
  * Reasoning effort override for matching subagents
19702
19930
  */
@@ -21999,6 +22227,19 @@ export interface SessionLimitPredictionPredictRequest {
21999
22227
  modelId?: string;
22000
22228
  clientType?: SessionLimitPredictionClientType;
22001
22229
  }
22230
+ /**
22231
+ * Identifies the target session.
22232
+ *
22233
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
22234
+ * via the `definition` "SkillProviderListRequest".
22235
+ */
22236
+ /** @experimental */
22237
+ export interface SkillProviderListRequest {
22238
+ /**
22239
+ * Target session identifier
22240
+ */
22241
+ sessionId: string;
22242
+ }
22002
22243
  /**
22003
22244
  * Identifies the target session.
22004
22245
  *
@@ -22025,6 +22266,17 @@ export declare function createServerRpc(connection: MessageConnection): {
22025
22266
  */
22026
22267
  ping: (params: PingRequest) => Promise<PingResult>;
22027
22268
  /** @experimental */
22269
+ hooks: {
22270
+ /**
22271
+ * Discovers hook actions enabled under server-side discovery settings from user, repository, plugin, and managed-policy sources.
22272
+ *
22273
+ * @param params Optional project paths and host-exclusion behavior for server-scoped hook discovery.
22274
+ *
22275
+ * @returns Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources.
22276
+ */
22277
+ discover: (params: HooksDiscoverRequest) => Promise<HooksDiscoverResult>;
22278
+ };
22279
+ /** @experimental */
22028
22280
  models: {
22029
22281
  /**
22030
22282
  * Lists Copilot models available to the authenticated user.
@@ -22492,6 +22744,14 @@ export declare function createServerRpc(connection: MessageConnection): {
22492
22744
  * @returns Sessions matching the filter, ordered most-recently-modified first.
22493
22745
  */
22494
22746
  list: (params: SessionsListRequest) => Promise<SessionList>;
22747
+ /**
22748
+ * Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The initial backward read uses a bounded tail scan for fast first paint; cursor continuations preserve the session event-log paging semantics. Persisted events may omit payloads that are reconstructed only for an active session.
22749
+ *
22750
+ * @param params Pagination options for reading an inactive or active local session's persisted event journal.
22751
+ *
22752
+ * @returns Batch of session events returned by a read, with cursor and continuation metadata.
22753
+ */
22754
+ readPersistedEvents: (params: SessionsReadPersistedEventsRequest) => Promise<EventsReadResult>;
22495
22755
  /**
22496
22756
  * Finds the local session bound to a GitHub task ID, if any.
22497
22757
  *