@github/copilot-sdk 1.0.20 → 1.0.21-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -362,6 +362,25 @@ function createServerRpc(connection) {
362
362
  disable: async (params) => connection.sendRequest("extensions.disable", params)
363
363
  },
364
364
  /** @experimental */
365
+ instructions: {
366
+ /**
367
+ * Discovers instruction sources across user, repository, and plugin sources.
368
+ *
369
+ * @param params Optional project paths to include in instruction discovery.
370
+ *
371
+ * @returns Instruction sources discovered across user, repository, and plugin sources.
372
+ */
373
+ discover: async (params) => connection.sendRequest("instructions.discover", params),
374
+ /**
375
+ * Returns the canonical files and directories where a client may create custom instructions that the runtime will recognize, including ones that do not exist yet. Repository targets become active once created.
376
+ *
377
+ * @param params Optional project paths to include when enumerating instruction discovery targets.
378
+ *
379
+ * @returns Canonical files and directories where custom instructions can be created so the runtime will recognize them.
380
+ */
381
+ getDiscoveryPaths: async (params) => connection.sendRequest("instructions.getDiscoveryPaths", params)
382
+ },
383
+ /** @experimental */
365
384
  skills: {
366
385
  /**
367
386
  * Plans installation of a verified Agent Finder Skill candidate without writing files. The returned review is safe to present to a user and installing always leaves the Skill disabled until separately enabled.
@@ -614,25 +633,6 @@ function createServerRpc(connection) {
614
633
  getDiscoveryPaths: async (params) => connection.sendRequest("agents.getDiscoveryPaths", params)
615
634
  },
616
635
  /** @experimental */
617
- instructions: {
618
- /**
619
- * Discovers instruction sources across user, repository, and plugin sources.
620
- *
621
- * @param params Optional project paths to include in instruction discovery.
622
- *
623
- * @returns Instruction sources discovered across user, repository, and plugin sources.
624
- */
625
- discover: async (params) => connection.sendRequest("instructions.discover", params),
626
- /**
627
- * Returns the canonical files and directories where a client may create custom instructions that the runtime will recognize, including ones that do not exist yet. Repository targets become active once created.
628
- *
629
- * @param params Optional project paths to include when enumerating instruction discovery targets.
630
- *
631
- * @returns Canonical files and directories where custom instructions can be created so the runtime will recognize them.
632
- */
633
- getDiscoveryPaths: async (params) => connection.sendRequest("instructions.getDiscoveryPaths", params)
634
- },
635
- /** @experimental */
636
636
  commands: {
637
637
  /**
638
638
  * Lists the well-known built-in slash commands that work as the first message in a new session (e.g. /plan, /env), without requiring an active session. Commands that depend on session state, authentication, or a synced session are omitted.
@@ -1051,6 +1051,39 @@ function createInternalServerRpc(connection) {
1051
1051
  */
1052
1052
  connect: async (params) => connection.sendRequest("connect", params),
1053
1053
  /** @experimental */
1054
+ account: {
1055
+ /**
1056
+ * Renders the sign-in banner and the one-line account description the runtime uses for an authentication identity. The runtime words these in several places for its own callers, so a host that announces a sign-in or an account switch should render them from here rather than composing its own, which would let the two spellings drift apart.
1057
+ *
1058
+ * @param params The authentication identity whose shared wording should be rendered.
1059
+ *
1060
+ * @returns The wording the runtime uses for an authentication identity.
1061
+ */
1062
+ describeAuthInfo: async (params) => connection.sendRequest("account.describeAuthInfo", params),
1063
+ /**
1064
+ * Reports whether the supplied identity can create gists. Gists are unavailable on GitHub Enterprise Cloud with data residency, and to Enterprise Managed Users on github.com, so a host that offers gist actions should hide or disable them when this reports no support.
1065
+ *
1066
+ * @param params The authentication identity whose gist support should be reported.
1067
+ *
1068
+ * @returns Whether the identity can create gists, and why not when it cannot.
1069
+ */
1070
+ getGistSupport: async (params) => connection.sendRequest("account.getGistSupport", params),
1071
+ /**
1072
+ * Resolves a path on the identity's GitHub host into an absolute URL, so a host can link to settings or documentation on the enterprise instance the user is signed in to rather than to github.com. Falls back to the public host when no identity is supplied.
1073
+ *
1074
+ * @param params A path to resolve against the GitHub host an identity is signed in to.
1075
+ *
1076
+ * @returns An absolute URL on the identity's GitHub host.
1077
+ */
1078
+ getWebUrl: async (params) => connection.sendRequest("account.getWebUrl", params),
1079
+ /**
1080
+ * Names the environment variable supplying a classic personal access token, if one is set. A classic token cannot be upgraded in place, so a host that finds one should tell the user which variable to unset rather than starting an interactive sign-in that the variable would override.
1081
+ *
1082
+ * @returns The environment variable supplying a classic personal access token, when one is set.
1083
+ */
1084
+ getTokenEnvVar: async () => connection.sendRequest("account.getTokenEnvVar", {})
1085
+ },
1086
+ /** @experimental */
1054
1087
  mcp: {
1055
1088
  /** @experimental */
1056
1089
  registry: {
@@ -1077,6 +1110,12 @@ function createInternalServerRpc(connection) {
1077
1110
  */
1078
1111
  cancel: async (params) => connection.sendRequest("mcp.registry.cancel", params)
1079
1112
  },
1113
+ /**
1114
+ * Lists the MCP servers the runtime supplies itself, so a host that disables the built-ins wholesale suppresses exactly the set the runtime would otherwise add. The names are fixed for a build and depend on no configuration, session or account.
1115
+ *
1116
+ * @returns Names of the MCP servers the runtime supplies itself.
1117
+ */
1118
+ listBuiltinServerNames: async () => connection.sendRequest("mcp.listBuiltinServerNames", {}),
1080
1119
  /**
1081
1120
  * Reports whether the gh-replaceable GitHub MCP tools may be clipped for a session, which a host feeds back as the `excludeGhReplaceableTools` build option. The tools are redundant only when the session can reach a shell *and* the host has the `gh` that would replace them, so both halves are decided here. The shell half runs the platform shell tool through the runtime's own tool-filter matcher, so entry forms like `builtin:bash` and `builtin:*` behave exactly as they do when a session builds its tool catalog. The host half probes for `gh`, and is skipped entirely when the filters already rule the shell out. Host presence alone is not enough: a session restricted to, say, `view` would otherwise lose the built-in issue-read fallback while having no shell to replace it with. The answer describes the host the runtime runs on, so it is never forwarded to a remote engine.
1082
1121
  *
@@ -1087,6 +1126,27 @@ function createInternalServerRpc(connection) {
1087
1126
  shouldExcludeGitHubTools: async (params) => connection.sendRequest("mcp.shouldExcludeGitHubTools", params)
1088
1127
  },
1089
1128
  /** @experimental */
1129
+ instructions: {
1130
+ /**
1131
+ * Returns the prompt the `init` command runs to author repository instructions. A host offering its own initialize action sends this text so the instructions it produces match the ones the CLI produces. The text is fixed for a build and depends on no configuration, session or repository.
1132
+ *
1133
+ * @returns The prompt the init command runs.
1134
+ */
1135
+ getInitPrompt: async () => connection.sendRequest("instructions.getInitPrompt", {}),
1136
+ /**
1137
+ * Discovers the instruction sources for one caller-named location and returns them in the order the runtime applies them. `discover` answers for a set of project paths and derives the rest of its scope itself; this one instead takes every argument from the caller — the extra directories to scan and whether to descend into nested instruction files — and honors them as given. It also includes instruction directories from trusted repository settings, matching native repository discovery. Use it when the caller knows its own scope and no session exists to derive that scope from, such as a host reporting how many instruction files a directory contributes before any session starts. Marked internal because it exists to carry a CLI call site off the napi boundary onto the SDK contract; it is migration plumbing, not a surface consumers are meant to depend on.
1138
+ *
1139
+ * @param params Explicit discovery arguments for one location, supplied by the caller rather than derived from a session.
1140
+ *
1141
+ * @returns Instruction sources discovered across user, repository, and plugin sources.
1142
+ */
1143
+ discoverRepoSources: async (params) => connection.sendRequest("instructions.discoverRepoSources", params),
1144
+ /**
1145
+ * Drops the runtime's in-memory cache of discovered custom instructions so the next discovery reads them from disk again. A host calls this after it changes instruction files, or after it trusts a folder whose instructions an earlier discovery skipped, so that a session started afterwards sees the current files instead of a cached earlier answer. The call performs no I/O of its own and removes nothing from disk; it only invalidates, so the cost lands on the next discovery. Returns once the cache is clear, which is what lets a caller order a session start after it. Marked internal because it exists to carry a CLI call site off the napi boundary onto the SDK contract; it is migration plumbing, not a surface consumers are meant to depend on.
1146
+ */
1147
+ clearCache: async () => connection.sendRequest("instructions.clearCache", {})
1148
+ },
1149
+ /** @experimental */
1090
1150
  agents: {
1091
1151
  /**
1092
1152
  * Lists the agents this runtime ships, by name. A consumer separating shipped agents from ones the user or a plugin authored should compare against these names rather than against `AgentInfo.source`: an authored agent may carry the `builtin` source while not being one of these, and the runtime treats the two as separate questions. `disableableNames` is the subset a user may turn off, which a client needs to decide whether to offer a toggle. `yamlBasedNames` is the subset backed by a shipped YAML definition, which a client needs before asking the runtime to load one.
@@ -1151,6 +1211,129 @@ function createInternalServerRpc(connection) {
1151
1211
  writeKey: async (params) => connection.sendRequest("globalState.writeKey", params)
1152
1212
  },
1153
1213
  /** @experimental */
1214
+ user: {
1215
+ /** @experimental */
1216
+ settings: {
1217
+ /**
1218
+ * Resolves the on-disk locations of the settings files this runtime reads, so a consumer can show or open them. The user path is the same file `user.settings.get`, `user.settings.load`, and `user.settings.set` operate on. Supply `repoRoot` to also resolve that repository's checked-in and local settings paths. A path is reported whether or not the file exists.
1219
+ *
1220
+ * @param params Selects which settings file paths to resolve.
1221
+ *
1222
+ * @returns On-disk locations of the settings files this runtime reads. A path is reported whether or not the file exists.
1223
+ */
1224
+ getPaths: async (params) => connection.sendRequest("user.settings.getPaths", params),
1225
+ /**
1226
+ * Lists the top-level user-setting keys by who is allowed to govern them: `repo` keys a repository may override through `.github/copilot/settings.json`, `claudeRepo` keys a repository may override through a Claude-compatible config, and `managed` keys an enterprise policy may fix. The lists are static for a given runtime build and fail closed: a key absent from a list cannot be governed that way.
1227
+ *
1228
+ * @returns Top-level user-setting keys grouped by who may govern them.
1229
+ */
1230
+ listGovernanceKeys: async () => connection.sendRequest("user.settings.listGovernanceKeys", {}),
1231
+ /**
1232
+ * Atomically edits one canonical user setting inside its settings-file lock. Reads, canonicalizes touched aliases, applies the edit, validates the resulting top-level setting and writes before releasing the lock. An explicit autoUpdatesChannel set completes the staff migration in the same transaction. Only a malformed existing file returns `invalid`; refused keys, invalid values and I/O errors reject the call.
1233
+ *
1234
+ * @param params One atomic edit of a canonical setting in settings.json.
1235
+ *
1236
+ * @returns Outcome of an atomic user or repository settings edit.
1237
+ */
1238
+ edit: async (params) => connection.sendRequest("user.settings.edit", params),
1239
+ /**
1240
+ * Rewrites legacy and snake_case setting names in a settings object to their canonical spelling. A caller editing settings.json must normalize before writing: a legacy key left in place survives the write, is re-normalized on the next load, and silently shadows the canonical value the write just stored.
1241
+ *
1242
+ * @param params Settings object whose key names should be canonicalized.
1243
+ *
1244
+ * @returns Settings object with canonical key names.
1245
+ */
1246
+ normalize: async (params) => connection.sendRequest("user.settings.normalize", params),
1247
+ /**
1248
+ * Diagnoses a set of already-loaded settings layers, reporting each key that will not take effect and why. Settings load tolerantly so that one bad key does not stop a session from starting; this method surfaces what was dropped so a caller can report it instead of silently ignoring the user's intent. Takes the layers as given rather than reading them, so a caller can diagnose exactly the content it is showing, including unsaved edits. Never echoes a setting's value, because a value may be a token or another secret. Marked internal because it exists to carry a CLI call site off the native addon, not to serve a consumer-facing need; it becomes public once an SDK consumer needs to inspect settings health itself.
1249
+ *
1250
+ * @param params The settings layers to diagnose.
1251
+ *
1252
+ * @returns The settings that will not take effect across the given layers.
1253
+ */
1254
+ diagnoseProblems: async (params) => connection.sendRequest("user.settings.diagnoseProblems", params),
1255
+ /**
1256
+ * Validates one top-level setting subtree and writes just that key to settings.json as a single step. Doing both here closes the race a caller cannot close itself: between a separate preflight read and the write, the file may change. Rewriting only the touched key keeps legacy siblings out of settings.json. Answers a status rather than failing, so a validation problem and a write problem stay distinguishable.
1257
+ *
1258
+ * @param params A single top-level setting subtree to validate and write.
1259
+ *
1260
+ * @returns Outcome of validating and writing one top-level setting subtree.
1261
+ */
1262
+ applyTopKey: async (params) => connection.sendRequest("user.settings.applyTopKey", params),
1263
+ /**
1264
+ * Replaces the user settings file's entire content in one write. A key absent from `settings` is removed, which is what distinguishes this from `user.settings.set`: that one merges, so it can never clear a key the caller has dropped. For a caller saving the result of a raw edit, a merge would silently resurrect every key the user deleted. Records the same one-time mutation marks a per-key write records, so a setting the user has now chosen explicitly stops being migrated for them.
1265
+ *
1266
+ * @param params The whole content to store in the user settings file.
1267
+ */
1268
+ writeAll: async (params) => connection.sendRequest("user.settings.writeAll", params),
1269
+ /**
1270
+ * Merges a partial object into one top-level user setting, re-reading the stored value inside this runtime process's settings.json write lock so that concurrent writers in this process to different sub-fields of the same key do not clobber each other. Unlike `user.settings.set`, which replaces a key's whole value with what the caller last read, this keeps sub-fields the caller did not name when both the stored value and supplied value are objects; otherwise the supplied value replaces the stored value. Use it whenever two independent surfaces own different sub-fields of one setting. Returns the key's stored value after the write, in `value`.
1271
+ *
1272
+ * @param params Names the user setting to merge into, and the partial object to merge.
1273
+ *
1274
+ * @returns The stored value of the user setting after the merge.
1275
+ */
1276
+ update: async (params) => connection.sendRequest("user.settings.update", params),
1277
+ /**
1278
+ * Reads settings.json as stored for a caller that is about to edit it. Unlike `user.settings.get`, this returns file values rather than per-key metadata and defaults. Reports `missing` for an absent file and `invalid` when the existing file will not parse. Retired config.json and extensionless files are not read.
1279
+ *
1280
+ * @returns Contents of settings.json as stored, for a caller about to rewrite it.
1281
+ */
1282
+ loadForEdit: async () => connection.sendRequest("user.settings.loadForEdit", {}),
1283
+ /**
1284
+ * Validates one top-level setting subtree without writing it, reporting each problem with the path it applies to. Scoped to a single top-level key on purpose: validating the whole file would reject an edit whenever an unrelated pre-existing field is malformed, locking the user out of the very tool that could fix it.
1285
+ *
1286
+ * @param params A single top-level setting subtree to validate.
1287
+ *
1288
+ * @returns Outcome of validating one top-level setting subtree.
1289
+ */
1290
+ validate: async (params) => connection.sendRequest("user.settings.validate", params)
1291
+ }
1292
+ },
1293
+ /** @experimental */
1294
+ featureFlags: {
1295
+ /**
1296
+ * Lists every feature flag this runtime declares, with the population each one is declared for, its experimental description, and the online-experiment flag it maps to. This is the static catalog: it describes how each flag is defined, not whether it is on for anyone. Use `featureFlags.resolve` for static values with caller overrides, not active runtime values or experiment assignments.
1297
+ *
1298
+ * @returns Every feature flag this runtime declares, with the shape each one was declared with.
1299
+ */
1300
+ listMetadata: async () => connection.sendRequest("featureFlags.listMetadata", {}),
1301
+ /**
1302
+ * Computes static feature flags from the supplied population and overrides without changing runtime state or verifying audience membership. Starts from declared availability, then applies direct feature-flag environment values, user settings, and explicit `flagOverrides`. It does not apply `COPILOT_EXP_*` experiment assignments, authenticated startup gates, or active runtime state. Settings include `enabledFeatureFlags`, the legacy `feature_flags.enabled` list, and supported convenience settings. Supply `baseFlags` to use an existing flag set instead of declared availability. Omit `isStaffGitHub` or `isStaffMicrosoft` when membership was never recorded: a legacy staff account then counts as both populations.
1303
+ *
1304
+ * @param params Caller population and overrides for static feature-flag resolution, independent of experiment assignments and active runtime state.
1305
+ *
1306
+ * @returns The resolved feature flags, keyed by flag name.
1307
+ */
1308
+ resolve: async (params) => connection.sendRequest("featureFlags.resolve", params)
1309
+ },
1310
+ /** @experimental */
1311
+ repo: {
1312
+ /** @experimental */
1313
+ settings: {
1314
+ /**
1315
+ * Reads one repository settings file without settings normalization or layering. The existing JSONC parser accepts comments and trailing commas and applies its prototype-safety rules. Missing or blank files return an empty valid config. Invalid files return an empty config with invalid=true; other read failures reject.
1316
+ *
1317
+ * @param params Which repository settings file to read.
1318
+ *
1319
+ * @returns Parsed repository settings without normalization or layering.
1320
+ */
1321
+ readRaw: async (params) => connection.sendRequest("repo.settings.readRaw", params),
1322
+ /**
1323
+ * Writes or removes one allowed top-level repository setting through the existing validator and file lock. Preserves unrelated stored keys. Invalid keys, values, existing documents, and I/O errors reject without replacing the file. Deletion requires delete=true; otherwise value must be present.
1324
+ *
1325
+ * @param params One key to write or remove in a repository settings file.
1326
+ */
1327
+ writeKey: async (params) => connection.sendRequest("repo.settings.writeKey", params),
1328
+ /**
1329
+ * Replaces the repository-overridable settings in one locked write. Allowed keys present in settings are validated and written; allowed keys absent from settings are removed. Other input keys are ignored, and unknown keys already stored in the file remain unchanged. Invalid values or an invalid existing file reject without a partial write.
1330
+ *
1331
+ * @param params The complete set of repository-overridable settings to store.
1332
+ */
1333
+ writeAll: async (params) => connection.sendRequest("repo.settings.writeAll", params)
1334
+ }
1335
+ },
1336
+ /** @experimental */
1154
1337
  gitHubRepository: {
1155
1338
  /**
1156
1339
  * Resolves the GitHub repository that owns a working-tree path by reading the selected git remote configured for it, preferring `origin`. Returns a null `repository` when the path is inside a git working tree but that selected remote does not resolve to a GitHub host. Fails when the path is not inside a git working tree at all, so a caller can tell 'not a repository' apart from 'a repository with no GitHub remote'.
@@ -1695,6 +1878,14 @@ function createSessionRpc(connection, sessionId) {
1695
1878
  * @returns Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns.
1696
1879
  */
1697
1880
  setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", { ...params, sessionId }),
1881
+ /**
1882
+ * Computes whether the session's current model shows reasoning summaries and how a host should present them: the default Ctrl+T visibility, reasoning headers, the hidden-summaries hint, and whether a persisted `showReasoning` setting is redundant. The runtime folds in the session's model catalog, selection and reasoning-summaries experiment assignment; the host supplies only its own persisted setting and current visibility. This method reads the session's resolved model catalog rather than resolving it, so call `session.model.list` first on a session that has not listed models or run a turn; until then the result is `ready: false`. A session that resolves models without a Copilot catalog, that is a BYOK registry or an alternate provider, never caches one and stays `ready: false`.
1883
+ *
1884
+ * @param params Host presentation state the reasoning-summaries policy depends on.
1885
+ *
1886
+ * @returns Reasoning-summaries presentation policy for the session's current model.
1887
+ */
1888
+ getReasoningSummaries: async (params) => connection.sendRequest("session.model.getReasoningSummaries", { ...params, sessionId }),
1698
1889
  /**
1699
1890
  * Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's.
1700
1891
  *
@@ -71,7 +71,9 @@ export type RemediationAction =
71
71
  /** Review or widen the sandbox policy. The blocked path or host is named by the accompanying message or by the tool result the action arrived with. */
72
72
  | "review_sandbox_policy"
73
73
  /** Permit outbound network access in the sandbox policy. */
74
- | "allow_sandbox_outbound";
74
+ | "allow_sandbox_outbound"
75
+ /** Discard conversation history back through the blocked request before continuing. */
76
+ | "rewind_conversation";
75
77
  /**
76
78
  * The session mode the agent is operating in
77
79
  */
@@ -1942,7 +1944,7 @@ export interface ErrorData {
1942
1944
  */
1943
1945
  errorCode?: string;
1944
1946
  /**
1945
- * Category of error (e.g., "authentication", "authorization", "quota", "rate_limit", "context_limit", "query")
1947
+ * Category of error (e.g., "authentication", "authorization", "policy", "quota", "rate_limit", "context_limit", "query")
1946
1948
  */
1947
1949
  errorType: string;
1948
1950
  /**
@@ -1953,6 +1955,14 @@ export interface ErrorData {
1953
1955
  * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
1954
1956
  */
1955
1957
  providerCallId?: string;
1958
+ /**
1959
+ * Sanitized provider-defined error parameter preserved from a structured upstream error envelope, when available.
1960
+ */
1961
+ providerErrorParam?: string;
1962
+ /**
1963
+ * Provider-defined error type preserved from a structured upstream error envelope, when available (for example, `invalid_request_error`).
1964
+ */
1965
+ providerErrorType?: string;
1956
1966
  remediation?: RemediationAction;
1957
1967
  /**
1958
1968
  * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
@@ -4071,6 +4081,10 @@ export interface CompactionCompleteCompactionTokensUsed {
4071
4081
  */
4072
4082
  outputTokens?: number;
4073
4083
  provider?: ModelProviderRef;
4084
+ /**
4085
+ * Number of model requests represented by this aggregated compaction usage
4086
+ */
4087
+ requestCount?: number;
4074
4088
  }
4075
4089
  /**
4076
4090
  * Token usage detail for a single billing category
@@ -4197,6 +4211,14 @@ export interface PermissionRecoveryData {
4197
4211
  */
4198
4212
  maxAttempts: number;
4199
4213
  onBlocked: PermissionRecoveryOnBlocked;
4214
+ /**
4215
+ * Subagent identifier that owns this recovery episode when the request was delegated through a parent permission service
4216
+ */
4217
+ ownerAgentId?: string;
4218
+ /**
4219
+ * Root or child execution-session identifier that owns this recovery episode; omitted for legacy snapshots
4220
+ */
4221
+ ownerSessionId?: string;
4200
4222
  reason: PermissionRecoveryReason;
4201
4223
  status: PermissionRecoveryStatus;
4202
4224
  }
@@ -9158,6 +9180,14 @@ export interface PermissionRequestedEvent {
9158
9180
  */
9159
9181
  export interface PermissionRequestedData {
9160
9182
  agentMode?: SessionMode;
9183
+ /**
9184
+ * Delegated agent that owns permission recovery when the owner session multiplexes remote agents. Absent otherwise.
9185
+ */
9186
+ ownerAgentId?: string;
9187
+ /**
9188
+ * Execution session that owns permission recovery for this request. Absent on historical events.
9189
+ */
9190
+ ownerSessionId?: string;
9161
9191
  permissionMode?: PermissionMode;
9162
9192
  permissionRequest: PermissionRequest;
9163
9193
  promptRequest?: PermissionPromptRequest;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * JSON-RPC based SDK for programmatic control of GitHub Copilot CLI
5
5
  */
6
6
  export { CopilotClient } from "./client.js";
7
- export type { HostLocalServerOptions, HostGitHubEnvironmentOptions } from "./generated/rpc.js";
7
+ export type { HostLocalServerOptions, HostGitHubEnvironmentOptions, ModelGetReasoningSummariesRequest, ModelGetReasoningSummariesResult, } from "./generated/rpc.js";
8
8
  export { AhpHost, type AhpHostExit, type AhpHostOptions, type AhpSessionCreateRequest, type AhpSessionResumeRequest, } from "./host.js";
9
9
  export { DisableBypassPermissionsModes, RuntimeConnection } from "./types.js";
10
10
  export { BuiltInTools, ToolSet } from "./toolSet.js";
package/dist/types.d.ts CHANGED
@@ -1574,6 +1574,8 @@ export type MCPServerConfig = MCPStdioServerConfig | MCPHTTPServerConfig;
1574
1574
  * Configuration for a custom agent.
1575
1575
  */
1576
1576
  export interface CustomAgentConfig {
1577
+ /** Declarative hook actions keyed by event name, active only for this agent. */
1578
+ hooks?: Record<string, Record<string, unknown>[]>;
1577
1579
  /**
1578
1580
  * Unique name of the custom agent.
1579
1581
  */
@@ -2411,7 +2413,11 @@ export interface SessionConfigBase {
2411
2413
  */
2412
2414
  agent?: string;
2413
2415
  /**
2414
- * Directories to load skills from.
2416
+ * Explicit discovery-only skill roots. No general filesystem access is granted.
2417
+ * Available without `enableConfigDiscovery`; skill and managed disables still apply.
2418
+ * Relative paths resolve once when supplied against the request's effective
2419
+ * `workingDirectory`, and retained roots do not move when it changes.
2420
+ * Null and omission are equivalent; `[]` clears only the explicit SDK contribution.
2415
2421
  */
2416
2422
  skillDirectories?: string[];
2417
2423
  /**
@@ -2430,6 +2436,25 @@ export interface SessionConfigBase {
2430
2436
  * or be removed in future SDK or CLI releases.
2431
2437
  */
2432
2438
  skillProvider?: SkillProvider;
2439
+ /**
2440
+ * Explicit discovery-only agent roots, separate from `customAgents` objects.
2441
+ * No general filesystem access is granted. Available without `enableConfigDiscovery`;
2442
+ * source and managed disables still apply.
2443
+ * Relative paths resolve once when supplied against the request's effective
2444
+ * `workingDirectory`, and retained roots do not move when it changes.
2445
+ * Null and omission are equivalent; `[]` clears only the explicit SDK contribution.
2446
+ */
2447
+ agentDirectories?: string[];
2448
+ /**
2449
+ * Explicit discovery-only file-hook roots, separate from callback `hooks`.
2450
+ * No general filesystem access is granted. Available without `enableConfigDiscovery`
2451
+ * or `enableFileHooks` (which controls repository-origin hooks only);
2452
+ * hook and managed disables still apply.
2453
+ * Relative paths resolve once when supplied against the request's effective
2454
+ * `workingDirectory`, and retained roots do not move when it changes.
2455
+ * Null and omission are equivalent; `[]` clears only the explicit SDK contribution.
2456
+ */
2457
+ hookDirectories?: string[];
2433
2458
  /**
2434
2459
  * Local filesystem paths to Open Plugins-format directories
2435
2460
  * (https://open-plugins.com/) to load for this session.
@@ -2445,7 +2470,12 @@ export interface SessionConfigBase {
2445
2470
  */
2446
2471
  pluginDirectories?: string[];
2447
2472
  /**
2448
- * Additional directories to search for custom instruction files.
2473
+ * Explicit discovery-only instruction roots using the existing SDK instruction formats.
2474
+ * No general filesystem access is granted. Available without `enableConfigDiscovery`;
2475
+ * instruction and managed disables still apply.
2476
+ * Relative paths resolve once when supplied against the request's effective
2477
+ * `workingDirectory`, and retained roots do not move when it changes.
2478
+ * Null and omission are equivalent; `[]` clears only the explicit SDK contribution.
2449
2479
  */
2450
2480
  instructionDirectories?: string[];
2451
2481
  /**
@@ -2549,9 +2579,9 @@ export interface SessionConfigBase {
2549
2579
  */
2550
2580
  enableOnDemandInstructionDiscovery?: boolean;
2551
2581
  /**
2552
- * When true, enables loading of file-based hooks from `.github/hooks/`.
2553
- * This is separate from the `hooks` callback parameter which gates SDK
2554
- * hook event registration.
2582
+ * When true, enables repository-origin file hooks from `.github/hooks/` and
2583
+ * trusted repository-configured roots. Does not control explicit `hookDirectories`
2584
+ * or the `hooks` callback parameter.
2555
2585
  */
2556
2586
  enableFileHooks?: boolean;
2557
2587
  /**
@@ -2608,6 +2638,14 @@ export interface SessionConfig extends SessionConfigBase {
2608
2638
  * Optional custom session ID. If not provided, the server generates one.
2609
2639
  */
2610
2640
  sessionId?: string;
2641
+ /**
2642
+ * Names the session at creation, as `session.name.set` would, and is validated the
2643
+ * same way: non-empty, no leading or trailing whitespace, at most 100 UTF-16 units,
2644
+ * no control characters, and no double quotes. A name also makes the session persist
2645
+ * from the start, so it can be listed and resumed without ever running a turn.
2646
+ * Local sessions only: cloud creation rejects it.
2647
+ */
2648
+ name?: string;
2611
2649
  /**
2612
2650
  * Invalidates the process-wide custom-instruction discovery cache before
2613
2651
  * creating this session. Use when instruction files changed in the same runtime.
package/package.json CHANGED
@@ -5,8 +5,8 @@
5
5
  "url": "https://github.com/github/copilot-agent-runtime.git",
6
6
  "directory": "src/sdk/nodejs"
7
7
  },
8
- "version": "1.0.20",
9
- "copilotCliVersion": "1.0.96",
8
+ "version": "1.0.21-preview.0",
9
+ "copilotCliVersion": "1.0.97-0",
10
10
  "description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
11
11
  "main": "./dist/cjs/index.js",
12
12
  "types": "./dist/index.d.ts",
@@ -85,13 +85,12 @@
85
85
  "json-schema": "^0.4.0",
86
86
  "json-schema-to-typescript": "^15.0.4",
87
87
  "prettier": "^3.8.1",
88
- "quicktype-core": "^23.2.6",
89
88
  "rimraf": "^6.1.2",
90
89
  "semver": "^7.7.3",
91
90
  "tar": "^7.5.22",
92
91
  "tsx": "^4.20.6",
93
92
  "typescript": "^5.0.0",
94
- "vitest": "^4.0.18",
93
+ "vitest": "^4.1.11",
95
94
  "ws": "^8.21.0"
96
95
  },
97
96
  "engines": {
@@ -104,18 +103,18 @@
104
103
  "README.md"
105
104
  ],
106
105
  "copilotRuntime": {
107
- "sourceSha": "8227e3a7b5f74c8dde298fcc69dcb27a9a044a93",
108
- "version": "1.0.96",
106
+ "sourceSha": "6daac4f9a50868027282315612487d14f6f97878",
107
+ "version": "1.0.97-0",
109
108
  "visibility": "public"
110
109
  },
111
110
  "optionalDependencies": {
112
- "@github/copilot-sdk-darwin-arm64": "1.0.20",
113
- "@github/copilot-sdk-darwin-x64": "1.0.20",
114
- "@github/copilot-sdk-linux-arm64": "1.0.20",
115
- "@github/copilot-sdk-linux-x64": "1.0.20",
116
- "@github/copilot-sdk-linuxmusl-arm64": "1.0.20",
117
- "@github/copilot-sdk-linuxmusl-x64": "1.0.20",
118
- "@github/copilot-sdk-win32-arm64": "1.0.20",
119
- "@github/copilot-sdk-win32-x64": "1.0.20"
111
+ "@github/copilot-sdk-darwin-arm64": "1.0.21-preview.0",
112
+ "@github/copilot-sdk-darwin-x64": "1.0.21-preview.0",
113
+ "@github/copilot-sdk-linux-arm64": "1.0.21-preview.0",
114
+ "@github/copilot-sdk-linux-x64": "1.0.21-preview.0",
115
+ "@github/copilot-sdk-linuxmusl-arm64": "1.0.21-preview.0",
116
+ "@github/copilot-sdk-linuxmusl-x64": "1.0.21-preview.0",
117
+ "@github/copilot-sdk-win32-arm64": "1.0.21-preview.0",
118
+ "@github/copilot-sdk-win32-x64": "1.0.21-preview.0"
120
119
  }
121
120
  }