Update SDK snapshot for Copilot CLI 1.0.101-0 · github/copilot-sdk@374b773 · GitHub
Skip to content

Commit 374b773

Browse files
Update SDK snapshot for Copilot CLI 1.0.101-0
1 parent b96cd2b commit 374b773

240 files changed

Lines changed: 6838 additions & 1873 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions

‎docs/auth/byok.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,9 @@ client.stop().get();
204204
| `type` | `"openai"` \| `"azure"` \| `"anthropic"` | Provider type (default: `"openai"`) |
205205
| `baseUrl` / `base_url` | string | **Required.** API endpoint URL |
206206
| `apiKey` / `api_key` | string | API key (optional for local providers like Ollama) |
207+
| `apiKeyCommand` / `api_key_command` | string | Command run by the runtime before each provider request to obtain a fresh API key. Also exposed as `ApiKeyCommand` in .NET and `APIKeyCommand` in Go. Credential-command failures fail the turn before sending a model request. |
207208
| `bearerToken` / `bearer_token` | string | Bearer token auth (takes precedence over apiKey) |
208-
| `bearerTokenProvider` / `bearer_token_provider` | callback | Returns a bearer token on demand (takes precedence over `apiKey` and `bearerToken`) |
209+
| `bearerTokenProvider` / `bearer_token_provider` | callback | Returns a bearer token on demand (takes precedence over `apiKey`, `apiKeyCommand`, and `bearerToken`; the command does not run) |
209210
| `wireApi` / `wire_api` | `"completions"` \| `"responses"` | Select `"completions"` for broad model compatibility (the Chat Completions API); select `"responses"` for multi-turn state management, tool namespacing, and reasoning support (the Responses API). Anthropic models always use the Messages API regardless of this setting. |
210211
| `azure.apiVersion` / `azure.api_version` | string | Azure API version. When set, the runtime uses the versioned deployment route; when omitted, it uses the GA versionless `v1` route. |
211212

‎docs/features/hooks.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ flowchart LR
3333

3434
All hooks are **optional**—register only the ones you need. Returning `null` (or the language equivalent) from any hook tells the SDK to continue with default behavior.
3535

36+
File-based repository hooks and repository hook settings are loaded only after the workspace is trusted. User hooks remain available before workspace trust is granted.
37+
3638
## Repository hooks from additional directories
3739

3840
Repository filesystem hooks are separate from the SDK callbacks described in

‎docs/hooks/session-lifecycle.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ const session = await client.createSession({
254254

255255
The `onSessionEnd` hook is called when a session ends.
256256

257+
A standalone SDK session remains active between prompts. Completing a prompt does not end the session; disconnect or dispose the session to run its end hook.
258+
257259
### Hook signature
258260

259261
<details open>

‎dotnet/README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ Create a new conversation session.
241241
- `InfiniteSessions` - Configure automatic context compaction (see below)
242242
- `WorkingDirectory` - Working directory for the session. When not set, the runtime uses its own process working directory.
243243
- `EnableSessionStore` - Enables the cross-session store for search and retrieval across sessions. When unset in `CopilotClientMode.CopilotCli`, the runtime default applies (enabled). In `CopilotClientMode.Empty`, defaults to disabled.
244-
- `EnableGitHubCacheStore` - Requests the read-only GitHub cache store (`github-cache-store` capability) on create or resume. The runtime registers the `github_sql` tool only when its `GITHUB_CACHE_STORE` feature flag is also on. Defaults to disabled in every mode.
245244
- `GitHubTokenProvider` - Acquires session-scoped GitHub tokens on demand. Return `GitHubTokenProviderResult.FromToken` with a positive `ExpiresIn` value (production GitHub tokens typically use `8 * 60 * 60` seconds), or `GitHubTokenProviderResult.Cancel()`. Cannot be combined with `GitHubToken`.
246245
- `SkillProvider` - Experimental session-scoped skill provider. See [Skill providers (experimental)](#skill-providers-experimental).
247246
- `OnPermissionRequest` - Optional handler called before each tool execution to approve or deny it. When omitted, permission requests are emitted as events and left pending for manual resolution. `PermissionHandler.ApproveAll` approves requests when managed settings are disabled and throws when `EnableManagedSettings` is true. Custom handlers can inspect `ManagedApprovalRequired` for human-facing confirmation logic. See [Permission Handling](#permission-handling) section.

‎dotnet/src/Client.cs‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,6 @@ public async Task<CopilotSession> CreateSessionAsync(SessionConfig config, Cance
13051305
config.EnableFileHooks,
13061306
config.EnableHostGitOperations,
13071307
config.EnableSessionStore,
1308-
config.EnableGitHubCacheStore,
13091308
config.EnableSkills,
13101309
config.SkillDirectories,
13111310
config.DisabledSkills,
@@ -1321,6 +1320,13 @@ public async Task<CopilotSession> CreateSessionAsync(SessionConfig config, Cance
13211320
GitHubTokenProviderRegistrationId: registrationId,
13221321
RemoteSession: config.RemoteSession,
13231322
Cloud: config.Cloud,
1323+
TrustWorkingDirectory: config.TrustWorkingDirectory switch
1324+
{
1325+
WorkingDirectoryTrust.Session => "session",
1326+
WorkingDirectoryTrust.User => "user",
1327+
null => null,
1328+
_ => throw new ArgumentOutOfRangeException(nameof(config), config.TrustWorkingDirectory, "Unsupported working-directory trust scope.")
1329+
},
13241330
RefreshCustomInstructions: config.RefreshCustomInstructions,
13251331
InstructionDirectories: config.InstructionDirectories,
13261332
AgentDirectories: config.AgentDirectories,
@@ -1572,7 +1578,6 @@ public async Task<CopilotSession> ResumeSessionAsync(string sessionId, ResumeSes
15721578
config.EnableFileHooks,
15731579
config.EnableHostGitOperations,
15741580
config.EnableSessionStore,
1575-
config.EnableGitHubCacheStore,
15761581
config.EnableSkills,
15771582
config.SuppressResumeEvent is true ? true : null,
15781583
config.Streaming is true ? true : null,
@@ -3276,7 +3281,6 @@ internal record CreateSessionRequest(
32763281
bool? EnableFileHooks,
32773282
bool? EnableHostGitOperations,
32783283
bool? EnableSessionStore,
3279-
[property: JsonPropertyName("enableGitHubCacheStore")] bool? EnableGitHubCacheStore,
32803284
bool? EnableSkills,
32813285
IList<string>? SkillDirectories,
32823286
IList<string>? DisabledSkills,
@@ -3292,6 +3296,7 @@ internal record CreateSessionRequest(
32923296
[property: JsonPropertyName("gitHubTokenProviderRegistrationId")] string? GitHubTokenProviderRegistrationId = null,
32933297
RemoteSessionMode? RemoteSession = null,
32943298
CloudSessionOptions? Cloud = null,
3299+
string? TrustWorkingDirectory = null,
32953300
bool? RefreshCustomInstructions = null,
32963301
IList<string>? InstructionDirectories = null,
32973302
IList<string>? AgentDirectories = null,
@@ -3332,7 +3337,8 @@ internal record ToolDefinition(
33323337
bool? SkipPermission = null,
33333338
CopilotToolDefer? Defer = null,
33343339
IDictionary<string, JsonNode?>? Metadata = null,
3335-
bool? IsTerminal = null)
3340+
bool? IsTerminal = null,
3341+
ProtocolExternalToolNamespace? Namespace = null)
33363342
{
33373343
public static ToolDefinition FromAIFunction(AIFunctionDeclaration function)
33383344
{
@@ -3341,12 +3347,16 @@ public static ToolDefinition FromAIFunction(AIFunctionDeclaration function)
33413347
var defer = function.AdditionalProperties.TryGetValue(CopilotTool.DeferKey, out var deferVal) && deferVal is CopilotToolDefer d ? d : (CopilotToolDefer?)null;
33423348
var metadata = function.AdditionalProperties.TryGetValue(CopilotTool.MetadataKey, out var metaVal) && metaVal is IDictionary<string, JsonNode?> m ? m : null;
33433349
var isTerminal = function.AdditionalProperties.TryGetValue(CopilotTool.IsTerminalKey, out var terminalVal) && terminalVal is true;
3350+
var toolNamespace = function.AdditionalProperties.TryGetValue(CopilotTool.NamespaceKey, out var namespaceVal) && namespaceVal is ToolNamespace ns
3351+
? new ProtocolExternalToolNamespace { Name = ns.Name, Description = ns.Description }
3352+
: null;
33443353
return new ToolDefinition(function.Name, function.Description, function.JsonSchema,
33453354
overrides ? true : null,
33463355
skipPerm ? true : null,
33473356
defer,
33483357
metadata,
3349-
isTerminal ? true : null);
3358+
isTerminal ? true : null,
3359+
toolNamespace);
33503360
}
33513361
}
33523362

@@ -3393,7 +3403,6 @@ internal record ResumeSessionRequest(
33933403
bool? EnableFileHooks,
33943404
bool? EnableHostGitOperations,
33953405
bool? EnableSessionStore,
3396-
[property: JsonPropertyName("enableGitHubCacheStore")] bool? EnableGitHubCacheStore,
33973406
bool? EnableSkills,
33983407
[property: JsonPropertyName("disableResume")] bool? SuppressResumeEvent,
33993408
bool? Streaming,

‎dotnet/src/CopilotTool.cs‎

Lines changed: 38 additions & 1 deletion

0 commit comments

Comments
 (0)