diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be5e43b3..5b1ba317f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,77 @@ All notable changes to the Copilot SDK are documented in this file. This changelog is automatically generated by an AI agent when stable releases are published. See [GitHub Releases](https://github.com/github/copilot-sdk/releases) for the full list. +## [v0.2.1](https://github.com/github/copilot-sdk/releases/tag/v0.2.1) (2026-04-03) + +### Feature: commands and UI elicitation across all four SDKs + +Register slash commands that CLI users can invoke and drive interactive input dialogs from any SDK language. This feature was previously Node.js-only; it now ships in Python, Go, and .NET as well. ([#906](https://github.com/github/copilot-sdk/pull/906), [#908](https://github.com/github/copilot-sdk/pull/908), [#960](https://github.com/github/copilot-sdk/pull/960)) + +```ts +const session = await client.createSession({ + onPermissionRequest: approveAll, + commands: [{ + name: "summarize", + description: "Summarize the conversation", + handler: async (context) => { /* ... */ }, + }], + onElicitationRequest: async (context) => { + if (context.type === "confirm") return { action: "confirm" }; + }, +}); + +// Drive dialogs from the session +const confirmed = await session.ui.confirm({ message: "Proceed?" }); +const choice = await session.ui.select({ message: "Pick one", options: ["A", "B"] }); +``` + +```cs +var session = await client.CreateSessionAsync(new SessionConfig { + OnPermissionRequest = PermissionHandler.ApproveAll, + Commands = [ + new CommandDefinition { + Name = "summarize", + Description = "Summarize the conversation", + Handler = async (context) => { /* ... */ }, + } + ], +}); + +// Drive dialogs from the session +var confirmed = await session.Ui.ConfirmAsync(new ConfirmOptions { Message = "Proceed?" }); +``` + +> **⚠️ Breaking change (Node.js):** The `onElicitationRequest` handler signature changed from two arguments (`request, invocation`) to a single `ElicitationContext` that combines both. Update callers to use `context.sessionId` and `context.message` directly. + +### Feature: `session.getMetadata` across all SDKs + +Efficiently fetch metadata for a single session by ID without listing all sessions. Returns `undefined`/`null` (not an error) when the session is not found. ([#899](https://github.com/github/copilot-sdk/pull/899)) + +- TypeScript: `const meta = await client.getSessionMetadata(sessionId);` +- C#: `var meta = await client.GetSessionMetadataAsync(sessionId);` +- Python: `meta = await client.get_session_metadata(session_id)` +- Go: `meta, err := client.GetSessionMetadata(ctx, sessionID)` + +### Feature: `sessionFs` for virtualizing per-session storage (Node SDK) + +Supply a custom `sessionFs` adapter in Node SDK session config to redirect the runtime's per-session storage (event log, large output files) to any backing store — useful for serverless deployments or custom persistence layers. ([#917](https://github.com/github/copilot-sdk/pull/917)) + +### Other changes + +- bugfix: structured tool results (with `toolTelemetry`, `resultType`, etc.) now sent via RPC as objects instead of being stringified, preserving metadata for Node, Go, and Python SDKs ([#970](https://github.com/github/copilot-sdk/pull/970)) +- feature: **[Python]** `CopilotClient` and `CopilotSession` now support `async with` for automatic resource cleanup ([#475](https://github.com/github/copilot-sdk/pull/475)) +- improvement: **[Python]** `copilot.types` module removed; import types directly from `copilot` ([#871](https://github.com/github/copilot-sdk/pull/871)) +- improvement: **[Python]** `workspace_path` now accepts any `os.PathLike` and `session.workspace_path` returns a `pathlib.Path` ([#901](https://github.com/github/copilot-sdk/pull/901)) +- improvement: **[Go]** simplified `rpc` package API: renamed structs drop the redundant `Rpc` infix (e.g. `ModelRpcApi` → `ModelApi`) ([#905](https://github.com/github/copilot-sdk/pull/905)) +- fix: **[Go]** `Session.SetModel` now takes a pointer for optional options instead of a variadic argument ([#904](https://github.com/github/copilot-sdk/pull/904)) + +### New contributors + +- @Sumanth007 made their first contribution in [#475](https://github.com/github/copilot-sdk/pull/475) +- @jongalloway made their first contribution in [#957](https://github.com/github/copilot-sdk/pull/957) +- @Morabbin made their first contribution in [#970](https://github.com/github/copilot-sdk/pull/970) +- @schneidafunk made their first contribution in [#998](https://github.com/github/copilot-sdk/pull/998) + ## [v0.2.0](https://github.com/github/copilot-sdk/releases/tag/v0.2.0) (2026-03-20) This is a big update with a broad round of API refinements, new capabilities, and cross-SDK consistency improvements that have shipped incrementally through preview releases since v0.1.32.