Skip to content

v0.2.1-preview.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 24 Mar 22:16
5b58582

Feature: commands and UI elicitation support for Node.js

The Node.js SDK now supports registering slash commands and prompting users with interactive dialogs. Pass commands in session config to handle CLI slash commands; use session.ui to show confirm, select, or text-input prompts. The feature was already available in other SDKs. (#906)

const session = await client.createSession({
  commands: [{
    name: "deploy",
    handler: async (params) => ({ text: `Deploying to \$\{params.args}...` })
  }]
});

const confirmed = await session.ui.confirm({ title: "Proceed?", message: "This will deploy to production." });
const env = await session.ui.select({ title: "Environment", options: [{ value: "prod" }, { value: "staging" }] });
const note = await session.ui.input({ title: "Release note" });

Feature: custom model listing for BYOK mode

All four SDKs now accept an onListModels callback in client options. When provided, client.listModels() calls your handler instead of querying the CLI — useful for BYOK setups where you want to expose your provider's available models. (#730)

const client = new CopilotClient({
  onListModels: async () => [{ id: "gpt-4o", displayName: "GPT-4o", vendor: "OpenAI" }]
});
var client = new CopilotClient(new CopilotClientOptions {
    OnListModels = async (ct) => [new ModelInfo { Id = "gpt-4o", DisplayName = "GPT-4o" }]
});
  • Python: on_list_models=lambda: [ModelInfo(id="gpt-4o", display_name="GPT-4o")]
  • Go: OnListModels: func(ctx context.Context) ([]copilot.ModelInfo, error) { ... }

Feature: blob attachments for inline image data

A new blob attachment type lets you send base64-encoded content directly to a session without writing it to disk first — useful when images are already in memory (screenshots, API responses, generated images). (#731)

await session.sendMessage("Describe this screenshot", {
  attachments: [{ type: "blob", data: base64Data, mimeType: "image/png", displayName: "screen.png" }]
});
await session.send_message("Describe this screenshot", attachments=[
    BlobAttachment(type="blob", data=base64_data, mime_type="image/png", display_name="screen.png")
])

Other changes

  • feature: [All] tools can now set skipPermission: true to bypass per-use permission prompts for safe tools (#808)
  • bugfix: [Node] add CJS compatibility so the SDK can be require()d in VS Code extensions and other CommonJS contexts (#546)
  • bugfix: [Node] cliPath is now ignored when cliUrl is already set (#787)
  • bugfix: [C#] fix SessionEvent.ToJson() failing for events with JsonElement-backed members (e.g. tool.execution_start, session.shutdown) (#868)
  • bugfix: [C#] unknown session event types no longer throw; they are returned as UnknownSessionEvent preserving the raw JSON (#881)
  • bugfix: [C#] fix AOT serialization crash when a CancellationToken fires during a JSON-RPC operation (#783)
  • improvement: [C#] optional RPC parameters are now optional method parameters, preventing source-breaking changes when new optional params are added by the runtime (#733)
  • bugfix: [Go] all enum constants are now consistently named using the TypeNameValue convention (e.g. SessionEventTypeSessionIdle, ModeInteractive) — breaking change: update any references using the old unprefixed names (#883)
  • improvement: [Go] Rpc suffix removed from struct names in the rpc package (e.g. ModelRpcApiModelApi) (#905)
  • bugfix: [Go] Session.SetModel now takes *SetModelOptions instead of a variadic argument (#904)
  • bugfix: [Python] workspace_path in CopilotSession now accepts any os.PathLike value, not just strings (#901)
  • improvement: [Python] telemetry, jsonrpc, and sdk_protocol_version modules are now marked as private (#884)

New contributors

  • @darthmolen made their first contribution in #546
  • @MackinnonBuck made their first contribution in #731
  • @kirankashyap made their first contribution in #740
  • @PureWeen made their first contribution in #783
  • @stefansedich made their first contribution in #784
  • @sergiou87 made their first contribution in #787
  • @MRayermannMSFT made their first contribution in #808
  • @xoofx made their first contribution in #868
  • @jamesmontemagno made their first contribution in #879
  • @Ron537 made their first contribution in #881
  • @edburns made their first contribution in #889

Generated by Release Changelog Generator