@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.
- package/README.md +37 -0
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +5 -0
- package/dist/cjs/generated/rpc.js +210 -19
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.js +5 -0
- package/dist/generated/rpc.d.ts +535 -78
- package/dist/generated/rpc.js +210 -19
- package/dist/generated/session-events.d.ts +32 -2
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +43 -5
- package/package.json +13 -14
package/README.md
CHANGED
|
@@ -671,6 +671,23 @@ if (result.status === "pending") {
|
|
|
671
671
|
|
|
672
672
|
See [Auto tier persistence](../docs/features/session-persistence.md#auto-tier-persistence) for the full lifecycle rules.
|
|
673
673
|
|
|
674
|
+
##### `rpc.model.getReasoningSummaries(params)` (experimental)
|
|
675
|
+
|
|
676
|
+
Read the current model's reasoning-summary presentation policy without changing session state. Call `session.rpc.model.list()` first to load the model catalog; otherwise the result may have `ready: false`. The request and result types are exported from `@github/copilot-sdk`.
|
|
677
|
+
|
|
678
|
+
```typescript
|
|
679
|
+
import type {
|
|
680
|
+
ModelGetReasoningSummariesRequest,
|
|
681
|
+
ModelGetReasoningSummariesResult,
|
|
682
|
+
} from "@github/copilot-sdk";
|
|
683
|
+
|
|
684
|
+
const presentation: ModelGetReasoningSummariesRequest = { summariesVisible: false };
|
|
685
|
+
const policy: ModelGetReasoningSummariesResult =
|
|
686
|
+
await session.rpc.model.getReasoningSummaries(presentation);
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
Omit `persistedShowReasoning` when no visibility setting is saved. `visibility` can remain unset while experiment assignment is pending; `clearRedundantSetting` tells the host when its persisted setting matches the model default.
|
|
690
|
+
|
|
674
691
|
##### `setTools(tools: Tool[]): Promise<void>`
|
|
675
692
|
|
|
676
693
|
Replace the tools this client supplies to the session, together with the handlers that serve them (experimental). `tools` takes the same definitions as `createSession` and becomes this client's complete tool set; pass `[]` to remove all of this client's tools. Built-in, MCP, and plugin tools, and tools other connected clients supply, are unaffected.
|
|
@@ -1635,6 +1652,26 @@ npm ci
|
|
|
1635
1652
|
npm test
|
|
1636
1653
|
```
|
|
1637
1654
|
|
|
1655
|
+
### Internal feature-flag example
|
|
1656
|
+
|
|
1657
|
+
[`examples/internal-feature-flags.ts`](examples/internal-feature-flags.ts) uses
|
|
1658
|
+
the generated internal RPC factory against a real runtime over stdio.
|
|
1659
|
+
It lists the catalog and shows environment, settings, and explicit-override
|
|
1660
|
+
precedence. It also checks that static resolution does not apply `COPILOT_EXP_*`
|
|
1661
|
+
experiment assignments. It creates no session and sends no model request.
|
|
1662
|
+
|
|
1663
|
+
After you prepare matching runtime artifacts, run this from the runtime repository root:
|
|
1664
|
+
|
|
1665
|
+
```bash
|
|
1666
|
+
COPILOT_RUNTIME_PROVIDER_LIB="$PWD/bazel-bin/src/native/runtime/runtime.node" \
|
|
1667
|
+
src/sdk/nodejs/node_modules/.bin/tsx \
|
|
1668
|
+
src/sdk/nodejs/examples/internal-feature-flags.ts \
|
|
1669
|
+
"$PWD/bazel-bin/src/runtime-bin/copilot-runtime"
|
|
1670
|
+
```
|
|
1671
|
+
|
|
1672
|
+
The JSON output includes `staticResolution` values of `false`, `true`, `false`,
|
|
1673
|
+
and `true`, in that order. These methods are internal, not public SDK APIs.
|
|
1674
|
+
|
|
1638
1675
|
## License
|
|
1639
1676
|
|
|
1640
1677
|
MIT
|
package/dist/cjs/cliVersion.js
CHANGED
|
@@ -22,7 +22,7 @@ __export(cliVersion_exports, {
|
|
|
22
22
|
COPILOT_CLI_VERSION: () => COPILOT_CLI_VERSION
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(cliVersion_exports);
|
|
25
|
-
const COPILOT_CLI_VERSION = "1.0.
|
|
25
|
+
const COPILOT_CLI_VERSION = "1.0.97-0";
|
|
26
26
|
const COPILOT_CLI_USE_NPM_PACKAGE = false;
|
|
27
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
28
|
0 && (module.exports = {
|
package/dist/cjs/client.js
CHANGED
|
@@ -1299,6 +1299,7 @@ class CopilotClient {
|
|
|
1299
1299
|
model: config.model,
|
|
1300
1300
|
allowedModels: config.allowedModels,
|
|
1301
1301
|
sessionId: localSessionId,
|
|
1302
|
+
name: config.name,
|
|
1302
1303
|
clientName: config.clientName,
|
|
1303
1304
|
reasoningEffort: config.reasoningEffort,
|
|
1304
1305
|
reasoningSummary: config.reasoningSummary,
|
|
@@ -1377,6 +1378,8 @@ class CopilotClient {
|
|
|
1377
1378
|
enableSkills: config.enableSkills,
|
|
1378
1379
|
skillDirectories: config.skillDirectories,
|
|
1379
1380
|
...config.skillProvider ? { hasSkillProvider: true } : {},
|
|
1381
|
+
agentDirectories: config.agentDirectories,
|
|
1382
|
+
hookDirectories: config.hookDirectories,
|
|
1380
1383
|
pluginDirectories: config.pluginDirectories,
|
|
1381
1384
|
instructionDirectories: config.instructionDirectories,
|
|
1382
1385
|
disabledSkills: config.disabledSkills,
|
|
@@ -1645,6 +1648,8 @@ class CopilotClient {
|
|
|
1645
1648
|
agent: config.agent,
|
|
1646
1649
|
skillDirectories: config.skillDirectories,
|
|
1647
1650
|
...config.skillProvider ? { hasSkillProvider: true } : {},
|
|
1651
|
+
agentDirectories: config.agentDirectories,
|
|
1652
|
+
hookDirectories: config.hookDirectories,
|
|
1648
1653
|
pluginDirectories: config.pluginDirectories,
|
|
1649
1654
|
instructionDirectories: config.instructionDirectories,
|
|
1650
1655
|
disabledSkills: config.disabledSkills,
|
|
@@ -390,6 +390,25 @@ function createServerRpc(connection) {
|
|
|
390
390
|
disable: async (params) => connection.sendRequest("extensions.disable", params)
|
|
391
391
|
},
|
|
392
392
|
/** @experimental */
|
|
393
|
+
instructions: {
|
|
394
|
+
/**
|
|
395
|
+
* Discovers instruction sources across user, repository, and plugin sources.
|
|
396
|
+
*
|
|
397
|
+
* @param params Optional project paths to include in instruction discovery.
|
|
398
|
+
*
|
|
399
|
+
* @returns Instruction sources discovered across user, repository, and plugin sources.
|
|
400
|
+
*/
|
|
401
|
+
discover: async (params) => connection.sendRequest("instructions.discover", params),
|
|
402
|
+
/**
|
|
403
|
+
* 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.
|
|
404
|
+
*
|
|
405
|
+
* @param params Optional project paths to include when enumerating instruction discovery targets.
|
|
406
|
+
*
|
|
407
|
+
* @returns Canonical files and directories where custom instructions can be created so the runtime will recognize them.
|
|
408
|
+
*/
|
|
409
|
+
getDiscoveryPaths: async (params) => connection.sendRequest("instructions.getDiscoveryPaths", params)
|
|
410
|
+
},
|
|
411
|
+
/** @experimental */
|
|
393
412
|
skills: {
|
|
394
413
|
/**
|
|
395
414
|
* 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.
|
|
@@ -642,25 +661,6 @@ function createServerRpc(connection) {
|
|
|
642
661
|
getDiscoveryPaths: async (params) => connection.sendRequest("agents.getDiscoveryPaths", params)
|
|
643
662
|
},
|
|
644
663
|
/** @experimental */
|
|
645
|
-
instructions: {
|
|
646
|
-
/**
|
|
647
|
-
* Discovers instruction sources across user, repository, and plugin sources.
|
|
648
|
-
*
|
|
649
|
-
* @param params Optional project paths to include in instruction discovery.
|
|
650
|
-
*
|
|
651
|
-
* @returns Instruction sources discovered across user, repository, and plugin sources.
|
|
652
|
-
*/
|
|
653
|
-
discover: async (params) => connection.sendRequest("instructions.discover", params),
|
|
654
|
-
/**
|
|
655
|
-
* 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.
|
|
656
|
-
*
|
|
657
|
-
* @param params Optional project paths to include when enumerating instruction discovery targets.
|
|
658
|
-
*
|
|
659
|
-
* @returns Canonical files and directories where custom instructions can be created so the runtime will recognize them.
|
|
660
|
-
*/
|
|
661
|
-
getDiscoveryPaths: async (params) => connection.sendRequest("instructions.getDiscoveryPaths", params)
|
|
662
|
-
},
|
|
663
|
-
/** @experimental */
|
|
664
664
|
commands: {
|
|
665
665
|
/**
|
|
666
666
|
* 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.
|
|
@@ -1079,6 +1079,39 @@ function createInternalServerRpc(connection) {
|
|
|
1079
1079
|
*/
|
|
1080
1080
|
connect: async (params) => connection.sendRequest("connect", params),
|
|
1081
1081
|
/** @experimental */
|
|
1082
|
+
account: {
|
|
1083
|
+
/**
|
|
1084
|
+
* 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.
|
|
1085
|
+
*
|
|
1086
|
+
* @param params The authentication identity whose shared wording should be rendered.
|
|
1087
|
+
*
|
|
1088
|
+
* @returns The wording the runtime uses for an authentication identity.
|
|
1089
|
+
*/
|
|
1090
|
+
describeAuthInfo: async (params) => connection.sendRequest("account.describeAuthInfo", params),
|
|
1091
|
+
/**
|
|
1092
|
+
* 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.
|
|
1093
|
+
*
|
|
1094
|
+
* @param params The authentication identity whose gist support should be reported.
|
|
1095
|
+
*
|
|
1096
|
+
* @returns Whether the identity can create gists, and why not when it cannot.
|
|
1097
|
+
*/
|
|
1098
|
+
getGistSupport: async (params) => connection.sendRequest("account.getGistSupport", params),
|
|
1099
|
+
/**
|
|
1100
|
+
* 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.
|
|
1101
|
+
*
|
|
1102
|
+
* @param params A path to resolve against the GitHub host an identity is signed in to.
|
|
1103
|
+
*
|
|
1104
|
+
* @returns An absolute URL on the identity's GitHub host.
|
|
1105
|
+
*/
|
|
1106
|
+
getWebUrl: async (params) => connection.sendRequest("account.getWebUrl", params),
|
|
1107
|
+
/**
|
|
1108
|
+
* 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.
|
|
1109
|
+
*
|
|
1110
|
+
* @returns The environment variable supplying a classic personal access token, when one is set.
|
|
1111
|
+
*/
|
|
1112
|
+
getTokenEnvVar: async () => connection.sendRequest("account.getTokenEnvVar", {})
|
|
1113
|
+
},
|
|
1114
|
+
/** @experimental */
|
|
1082
1115
|
mcp: {
|
|
1083
1116
|
/** @experimental */
|
|
1084
1117
|
registry: {
|
|
@@ -1105,6 +1138,12 @@ function createInternalServerRpc(connection) {
|
|
|
1105
1138
|
*/
|
|
1106
1139
|
cancel: async (params) => connection.sendRequest("mcp.registry.cancel", params)
|
|
1107
1140
|
},
|
|
1141
|
+
/**
|
|
1142
|
+
* 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.
|
|
1143
|
+
*
|
|
1144
|
+
* @returns Names of the MCP servers the runtime supplies itself.
|
|
1145
|
+
*/
|
|
1146
|
+
listBuiltinServerNames: async () => connection.sendRequest("mcp.listBuiltinServerNames", {}),
|
|
1108
1147
|
/**
|
|
1109
1148
|
* 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.
|
|
1110
1149
|
*
|
|
@@ -1115,6 +1154,27 @@ function createInternalServerRpc(connection) {
|
|
|
1115
1154
|
shouldExcludeGitHubTools: async (params) => connection.sendRequest("mcp.shouldExcludeGitHubTools", params)
|
|
1116
1155
|
},
|
|
1117
1156
|
/** @experimental */
|
|
1157
|
+
instructions: {
|
|
1158
|
+
/**
|
|
1159
|
+
* 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.
|
|
1160
|
+
*
|
|
1161
|
+
* @returns The prompt the init command runs.
|
|
1162
|
+
*/
|
|
1163
|
+
getInitPrompt: async () => connection.sendRequest("instructions.getInitPrompt", {}),
|
|
1164
|
+
/**
|
|
1165
|
+
* 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.
|
|
1166
|
+
*
|
|
1167
|
+
* @param params Explicit discovery arguments for one location, supplied by the caller rather than derived from a session.
|
|
1168
|
+
*
|
|
1169
|
+
* @returns Instruction sources discovered across user, repository, and plugin sources.
|
|
1170
|
+
*/
|
|
1171
|
+
discoverRepoSources: async (params) => connection.sendRequest("instructions.discoverRepoSources", params),
|
|
1172
|
+
/**
|
|
1173
|
+
* 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.
|
|
1174
|
+
*/
|
|
1175
|
+
clearCache: async () => connection.sendRequest("instructions.clearCache", {})
|
|
1176
|
+
},
|
|
1177
|
+
/** @experimental */
|
|
1118
1178
|
agents: {
|
|
1119
1179
|
/**
|
|
1120
1180
|
* 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.
|
|
@@ -1179,6 +1239,129 @@ function createInternalServerRpc(connection) {
|
|
|
1179
1239
|
writeKey: async (params) => connection.sendRequest("globalState.writeKey", params)
|
|
1180
1240
|
},
|
|
1181
1241
|
/** @experimental */
|
|
1242
|
+
user: {
|
|
1243
|
+
/** @experimental */
|
|
1244
|
+
settings: {
|
|
1245
|
+
/**
|
|
1246
|
+
* 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.
|
|
1247
|
+
*
|
|
1248
|
+
* @param params Selects which settings file paths to resolve.
|
|
1249
|
+
*
|
|
1250
|
+
* @returns On-disk locations of the settings files this runtime reads. A path is reported whether or not the file exists.
|
|
1251
|
+
*/
|
|
1252
|
+
getPaths: async (params) => connection.sendRequest("user.settings.getPaths", params),
|
|
1253
|
+
/**
|
|
1254
|
+
* 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.
|
|
1255
|
+
*
|
|
1256
|
+
* @returns Top-level user-setting keys grouped by who may govern them.
|
|
1257
|
+
*/
|
|
1258
|
+
listGovernanceKeys: async () => connection.sendRequest("user.settings.listGovernanceKeys", {}),
|
|
1259
|
+
/**
|
|
1260
|
+
* 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.
|
|
1261
|
+
*
|
|
1262
|
+
* @param params One atomic edit of a canonical setting in settings.json.
|
|
1263
|
+
*
|
|
1264
|
+
* @returns Outcome of an atomic user or repository settings edit.
|
|
1265
|
+
*/
|
|
1266
|
+
edit: async (params) => connection.sendRequest("user.settings.edit", params),
|
|
1267
|
+
/**
|
|
1268
|
+
* 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.
|
|
1269
|
+
*
|
|
1270
|
+
* @param params Settings object whose key names should be canonicalized.
|
|
1271
|
+
*
|
|
1272
|
+
* @returns Settings object with canonical key names.
|
|
1273
|
+
*/
|
|
1274
|
+
normalize: async (params) => connection.sendRequest("user.settings.normalize", params),
|
|
1275
|
+
/**
|
|
1276
|
+
* 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.
|
|
1277
|
+
*
|
|
1278
|
+
* @param params The settings layers to diagnose.
|
|
1279
|
+
*
|
|
1280
|
+
* @returns The settings that will not take effect across the given layers.
|
|
1281
|
+
*/
|
|
1282
|
+
diagnoseProblems: async (params) => connection.sendRequest("user.settings.diagnoseProblems", params),
|
|
1283
|
+
/**
|
|
1284
|
+
* 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.
|
|
1285
|
+
*
|
|
1286
|
+
* @param params A single top-level setting subtree to validate and write.
|
|
1287
|
+
*
|
|
1288
|
+
* @returns Outcome of validating and writing one top-level setting subtree.
|
|
1289
|
+
*/
|
|
1290
|
+
applyTopKey: async (params) => connection.sendRequest("user.settings.applyTopKey", params),
|
|
1291
|
+
/**
|
|
1292
|
+
* 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.
|
|
1293
|
+
*
|
|
1294
|
+
* @param params The whole content to store in the user settings file.
|
|
1295
|
+
*/
|
|
1296
|
+
writeAll: async (params) => connection.sendRequest("user.settings.writeAll", params),
|
|
1297
|
+
/**
|
|
1298
|
+
* 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`.
|
|
1299
|
+
*
|
|
1300
|
+
* @param params Names the user setting to merge into, and the partial object to merge.
|
|
1301
|
+
*
|
|
1302
|
+
* @returns The stored value of the user setting after the merge.
|
|
1303
|
+
*/
|
|
1304
|
+
update: async (params) => connection.sendRequest("user.settings.update", params),
|
|
1305
|
+
/**
|
|
1306
|
+
* 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.
|
|
1307
|
+
*
|
|
1308
|
+
* @returns Contents of settings.json as stored, for a caller about to rewrite it.
|
|
1309
|
+
*/
|
|
1310
|
+
loadForEdit: async () => connection.sendRequest("user.settings.loadForEdit", {}),
|
|
1311
|
+
/**
|
|
1312
|
+
* 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.
|
|
1313
|
+
*
|
|
1314
|
+
* @param params A single top-level setting subtree to validate.
|
|
1315
|
+
*
|
|
1316
|
+
* @returns Outcome of validating one top-level setting subtree.
|
|
1317
|
+
*/
|
|
1318
|
+
validate: async (params) => connection.sendRequest("user.settings.validate", params)
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
/** @experimental */
|
|
1322
|
+
featureFlags: {
|
|
1323
|
+
/**
|
|
1324
|
+
* 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.
|
|
1325
|
+
*
|
|
1326
|
+
* @returns Every feature flag this runtime declares, with the shape each one was declared with.
|
|
1327
|
+
*/
|
|
1328
|
+
listMetadata: async () => connection.sendRequest("featureFlags.listMetadata", {}),
|
|
1329
|
+
/**
|
|
1330
|
+
* 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.
|
|
1331
|
+
*
|
|
1332
|
+
* @param params Caller population and overrides for static feature-flag resolution, independent of experiment assignments and active runtime state.
|
|
1333
|
+
*
|
|
1334
|
+
* @returns The resolved feature flags, keyed by flag name.
|
|
1335
|
+
*/
|
|
1336
|
+
resolve: async (params) => connection.sendRequest("featureFlags.resolve", params)
|
|
1337
|
+
},
|
|
1338
|
+
/** @experimental */
|
|
1339
|
+
repo: {
|
|
1340
|
+
/** @experimental */
|
|
1341
|
+
settings: {
|
|
1342
|
+
/**
|
|
1343
|
+
* 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.
|
|
1344
|
+
*
|
|
1345
|
+
* @param params Which repository settings file to read.
|
|
1346
|
+
*
|
|
1347
|
+
* @returns Parsed repository settings without normalization or layering.
|
|
1348
|
+
*/
|
|
1349
|
+
readRaw: async (params) => connection.sendRequest("repo.settings.readRaw", params),
|
|
1350
|
+
/**
|
|
1351
|
+
* 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.
|
|
1352
|
+
*
|
|
1353
|
+
* @param params One key to write or remove in a repository settings file.
|
|
1354
|
+
*/
|
|
1355
|
+
writeKey: async (params) => connection.sendRequest("repo.settings.writeKey", params),
|
|
1356
|
+
/**
|
|
1357
|
+
* 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.
|
|
1358
|
+
*
|
|
1359
|
+
* @param params The complete set of repository-overridable settings to store.
|
|
1360
|
+
*/
|
|
1361
|
+
writeAll: async (params) => connection.sendRequest("repo.settings.writeAll", params)
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
/** @experimental */
|
|
1182
1365
|
gitHubRepository: {
|
|
1183
1366
|
/**
|
|
1184
1367
|
* 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'.
|
|
@@ -1723,6 +1906,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1723
1906
|
* @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.
|
|
1724
1907
|
*/
|
|
1725
1908
|
setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", { ...params, sessionId }),
|
|
1909
|
+
/**
|
|
1910
|
+
* 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`.
|
|
1911
|
+
*
|
|
1912
|
+
* @param params Host presentation state the reasoning-summaries policy depends on.
|
|
1913
|
+
*
|
|
1914
|
+
* @returns Reasoning-summaries presentation policy for the session's current model.
|
|
1915
|
+
*/
|
|
1916
|
+
getReasoningSummaries: async (params) => connection.sendRequest("session.model.getReasoningSummaries", { ...params, sessionId }),
|
|
1726
1917
|
/**
|
|
1727
1918
|
* 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.
|
|
1728
1919
|
*
|
package/dist/cliVersion.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const COPILOT_CLI_VERSION = "1.0.
|
|
1
|
+
export declare const COPILOT_CLI_VERSION = "1.0.97-0";
|
|
2
2
|
export declare const COPILOT_CLI_USE_NPM_PACKAGE = false;
|
package/dist/cliVersion.js
CHANGED
package/dist/client.js
CHANGED
|
@@ -1279,6 +1279,7 @@ class CopilotClient {
|
|
|
1279
1279
|
model: config.model,
|
|
1280
1280
|
allowedModels: config.allowedModels,
|
|
1281
1281
|
sessionId: localSessionId,
|
|
1282
|
+
name: config.name,
|
|
1282
1283
|
clientName: config.clientName,
|
|
1283
1284
|
reasoningEffort: config.reasoningEffort,
|
|
1284
1285
|
reasoningSummary: config.reasoningSummary,
|
|
@@ -1357,6 +1358,8 @@ class CopilotClient {
|
|
|
1357
1358
|
enableSkills: config.enableSkills,
|
|
1358
1359
|
skillDirectories: config.skillDirectories,
|
|
1359
1360
|
...config.skillProvider ? { hasSkillProvider: true } : {},
|
|
1361
|
+
agentDirectories: config.agentDirectories,
|
|
1362
|
+
hookDirectories: config.hookDirectories,
|
|
1360
1363
|
pluginDirectories: config.pluginDirectories,
|
|
1361
1364
|
instructionDirectories: config.instructionDirectories,
|
|
1362
1365
|
disabledSkills: config.disabledSkills,
|
|
@@ -1625,6 +1628,8 @@ class CopilotClient {
|
|
|
1625
1628
|
agent: config.agent,
|
|
1626
1629
|
skillDirectories: config.skillDirectories,
|
|
1627
1630
|
...config.skillProvider ? { hasSkillProvider: true } : {},
|
|
1631
|
+
agentDirectories: config.agentDirectories,
|
|
1632
|
+
hookDirectories: config.hookDirectories,
|
|
1628
1633
|
pluginDirectories: config.pluginDirectories,
|
|
1629
1634
|
instructionDirectories: config.instructionDirectories,
|
|
1630
1635
|
disabledSkills: config.disabledSkills,
|