@github/copilot-sdk 1.0.5-preview.0 → 1.0.5

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/types.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  import type { Canvas } from "./canvas.js";
5
5
  import type { SessionFsProvider } from "./sessionFsProvider.js";
6
6
  import type { CopilotRequestHandler } from "./copilotRequestHandler.js";
7
- import type { ReasoningSummary, SessionEvent as GeneratedSessionEvent } from "./generated/session-events.js";
7
+ import type { ReasoningSummary, SessionLimitsConfig, SessionEvent as GeneratedSessionEvent } from "./generated/session-events.js";
8
8
  import type { CopilotSession } from "./session.js";
9
9
  import type { ModelBillingTokenPrices, OpenCanvasInstance, RemoteSessionMode } from "./generated/rpc.js";
10
10
  import type { ToolSet } from "./toolSet.js";
@@ -1280,6 +1280,68 @@ export type ReasoningEffort = "low" | "medium" | "high" | "xhigh";
1280
1280
  * long-context tier when the selected model supports it.
1281
1281
  */
1282
1282
  export type ContextTier = "default" | "long_context";
1283
+ /** Parsed parameters from an MCP server's WWW-Authenticate response. */
1284
+ export interface McpAuthWwwAuthenticateParams {
1285
+ /** Parsed resource_metadata URL used for protected-resource metadata discovery, if present. */
1286
+ resourceMetadataUrl?: string;
1287
+ /** Parsed OAuth scope, if present. */
1288
+ scope?: string;
1289
+ /** Parsed OAuth error, if present. */
1290
+ error?: string;
1291
+ }
1292
+ /** Static OAuth client configuration supplied by the MCP server, if available. */
1293
+ export interface McpAuthStaticClientConfig {
1294
+ /** OAuth client ID for the server. */
1295
+ clientId: string;
1296
+ /** Optional OAuth client secret for confidential static clients. */
1297
+ clientSecret?: string;
1298
+ /** Optional non-default OAuth grant type. */
1299
+ grantType?: "client_credentials";
1300
+ /** Whether this is a public OAuth client. */
1301
+ publicClient?: boolean;
1302
+ }
1303
+ /** MCP OAuth request that the SDK host can satisfy with a host-acquired token. */
1304
+ export interface McpAuthRequest {
1305
+ /** Unique request identifier used by the SDK when responding. */
1306
+ requestId: string;
1307
+ /** Display name of the MCP server that requires OAuth. */
1308
+ serverName: string;
1309
+ /** URL of the MCP server that requires OAuth. */
1310
+ serverUrl: string;
1311
+ /** Why the runtime is requesting host-provided OAuth credentials. */
1312
+ reason: "initial" | "refresh" | "reauth" | "upscope";
1313
+ /** Parsed WWW-Authenticate parameters from the MCP server. */
1314
+ wwwAuthenticateParams?: McpAuthWwwAuthenticateParams;
1315
+ /** Raw RFC 9728 protected-resource metadata JSON fetched by the runtime, if available. */
1316
+ resourceMetadata?: string;
1317
+ /** Static OAuth client configuration, if the server specifies one. */
1318
+ staticClientConfig?: McpAuthStaticClientConfig;
1319
+ }
1320
+ /** Host-provided OAuth token data for a pending MCP OAuth request. */
1321
+ export interface McpAuthToken {
1322
+ /** Access token acquired by the SDK host. */
1323
+ accessToken: string;
1324
+ /** OAuth token type. Defaults to Bearer when omitted. */
1325
+ tokenType?: string;
1326
+ /** Token lifetime in seconds, if known. */
1327
+ expiresIn?: number;
1328
+ }
1329
+ /**
1330
+ * Result returned by an MCP auth request handler.
1331
+ *
1332
+ * Return `null`/`undefined` or `{ kind: "cancelled" }` to cancel the pending
1333
+ * OAuth request. Return `{ kind: "token", ... }` to provide host-acquired
1334
+ * OAuth token data.
1335
+ */
1336
+ export type McpAuthResult = ({
1337
+ kind: "token";
1338
+ } & McpAuthToken) | {
1339
+ kind: "cancelled";
1340
+ };
1341
+ /** Callback invoked when an MCP server requires OAuth and the SDK host opted in. */
1342
+ export type McpAuthHandler = (request: McpAuthRequest, context: {
1343
+ sessionId: string;
1344
+ }) => McpAuthResult | McpAuthToken | null | undefined | Promise<McpAuthResult | McpAuthToken | null | undefined>;
1283
1345
  /**
1284
1346
  * Stable extension identity for session participants that provide canvases.
1285
1347
  */
@@ -1448,6 +1510,12 @@ export interface SessionConfigBase {
1448
1510
  * is disabled even if it also matches `availableTools`.
1449
1511
  */
1450
1512
  excludedTools?: string[] | ToolSet;
1513
+ /**
1514
+ * Names of built-in agents to exclude from the session. Excluded built-in
1515
+ * agents are hidden from discovery and cannot be selected or invoked unless
1516
+ * a custom agent with the same name is configured.
1517
+ */
1518
+ excludedBuiltinAgents?: string[];
1451
1519
  /**
1452
1520
  * Custom provider configuration (BYOK - Bring Your Own Key).
1453
1521
  * When specified, uses the provided API endpoint instead of the Copilot API.
@@ -1492,6 +1560,18 @@ export interface SessionConfigBase {
1492
1560
  * This is independent of the OpenTelemetry configuration in {@link CopilotClientOptions.telemetry}.
1493
1561
  */
1494
1562
  enableSessionTelemetry?: boolean;
1563
+ /**
1564
+ * Enables native model citations for supported providers.
1565
+ *
1566
+ * @experimental
1567
+ */
1568
+ enableCitations?: boolean;
1569
+ /**
1570
+ * Limits applied to this session's current accounting window.
1571
+ *
1572
+ * @experimental
1573
+ */
1574
+ sessionLimits?: SessionLimitsConfig;
1495
1575
  /**
1496
1576
  * When true, the runtime skips loading custom-instruction sources
1497
1577
  * (e.g. `.github/copilot-instructions.md`, `AGENTS.md`, `CLAUDE.md`).
@@ -1531,6 +1611,12 @@ export interface SessionConfigBase {
1531
1611
  * the consumer to resolve via the pending permission RPC.
1532
1612
  */
1533
1613
  onPermissionRequest?: PermissionHandler;
1614
+ /**
1615
+ * Optional handler for MCP OAuth requests from MCP servers.
1616
+ * When provided, the SDK can satisfy MCP server OAuth requests with
1617
+ * host-provided token data or cancellation.
1618
+ */
1619
+ onMcpAuthRequest?: McpAuthHandler;
1534
1620
  /**
1535
1621
  * Handler for user input requests from the agent.
1536
1622
  * When provided, enables the ask_user tool allowing the agent to ask questions.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/github/copilot-sdk.git"
6
6
  },
7
- "version": "1.0.5-preview.0",
7
+ "version": "1.0.5",
8
8
  "description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
9
9
  "main": "./dist/cjs/index.js",
10
10
  "types": "./dist/index.d.ts",
@@ -56,7 +56,7 @@
56
56
  "author": "GitHub",
57
57
  "license": "MIT",
58
58
  "dependencies": {
59
- "@github/copilot": "^1.0.66-1",
59
+ "@github/copilot": "^1.0.67",
60
60
  "vscode-jsonrpc": "^8.2.1",
61
61
  "zod": "^4.3.6"
62
62
  },