Skip to content

Commit 9b28c94

Browse files
Update SDK snapshot for Copilot CLI 1.0.92-1
1 parent 19e9a4b commit 9b28c94

99 files changed

Lines changed: 4977 additions & 433 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.

‎.github/workflows/sdk-nodejs.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
os: ${{ fromJSON(inputs.platform == 'linux-x64' && '["ubuntu-latest"]' || inputs.platform == 'darwin-arm64' && '["macos-latest"]' || inputs.platform == 'win32-x64' && '["windows-latest"]' || '["ubuntu-latest","macos-latest","windows-latest"]') }}
34-
transport: [default, inprocess]
34+
transport: ${{ fromJSON(github.event_name == 'merge_group' && '["default"]' || '["default","inprocess"]') }}
3535
runs-on: ${{ matrix.os }}
3636
defaults:
3737
run:
@@ -54,6 +54,9 @@ jobs:
5454
cache: npm
5555
cache-dependency-path: ${{ inputs.sdk-home }}/nodejs/package-lock.json
5656
- run: npm ci --ignore-scripts
57+
- name: Install generator test dependencies
58+
run: npm ci --ignore-scripts
59+
working-directory: ${{ inputs.sdk-home }}/scripts/codegen
5760
# TEMPORARY MERGE QUEUE REDUCTION: pull requests and main pushes retain
5861
# static checks; merge groups rerun only SDK compatibility coverage.
5962
- if: github.event_name != 'merge_group' && runner.os == 'Linux' && matrix.transport == 'default'
@@ -121,6 +124,7 @@ jobs:
121124
transport: ${{ matrix.transport }}
122125
command: |
123126
npm ci --ignore-scripts
127+
(cd "$COPILOT_SDK_ROOT/scripts/codegen" && npm ci --ignore-scripts)
124128
npm run build
125129
(cd "$COPILOT_SDK_ROOT/test/harness" && npm ci --ignore-scripts)
126130

‎.github/workflows/sdk-platform.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Runs all SDK language checks for one runtime platform, allowing each platform
2-
# to start as soon as its runtime artifact is available.
1+
# Runs SDK language checks for one runtime platform as soon as its artifact is
2+
# available. Merge groups retain only the Node.js compatibility lane.
33
name: "SDK platform"
44

55
on:
@@ -24,34 +24,39 @@ jobs:
2424
secrets: inherit
2525

2626
python:
27+
if: github.event_name != 'merge_group'
2728
uses: ./.github/workflows/sdk-python.yml
2829
with:
2930
platform: ${{ inputs.platform }}
3031
sdk-home: ${{ inputs.sdk-home }}
3132
secrets: inherit
3233

3334
go:
35+
if: github.event_name != 'merge_group'
3436
uses: ./.github/workflows/sdk-go.yml
3537
with:
3638
platform: ${{ inputs.platform }}
3739
sdk-home: ${{ inputs.sdk-home }}
3840
secrets: inherit
3941

4042
dotnet:
43+
if: github.event_name != 'merge_group'
4144
uses: ./.github/workflows/sdk-dotnet.yml
4245
with:
4346
platform: ${{ inputs.platform }}
4447
sdk-home: ${{ inputs.sdk-home }}
4548
secrets: inherit
4649

4750
rust:
51+
if: github.event_name != 'merge_group'
4852
uses: ./.github/workflows/sdk-rust.yml
4953
with:
5054
platform: ${{ inputs.platform }}
5155
sdk-home: ${{ inputs.sdk-home }}
5256
secrets: inherit
5357

5458
java:
59+
if: github.event_name != 'merge_group'
5560
uses: ./.github/workflows/sdk-java.yml
5661
with:
5762
platform: ${{ inputs.platform }}

‎.github/workflows/sdk-runtime-artifact.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: "SDK runtime artifact"
33
env:
44
COPILOT_AUTO_UPDATE: "false"
55
COPILOT_BAZEL_ANG_ENABLED: ${{ vars.COPILOT_BAZEL_ANG_ENABLED }}
6+
COPILOT_BAZEL_ANG_SCOPE: ${{ vars.COPILOT_BAZEL_ANG_SCOPE }}
67
COPILOT_RUNTIME_E2E_TEST_HOOKS: "1"
78
CARGO_PROFILE_DEV_DEBUG: line-tables-only
89
GIT_HTTP_LOW_SPEED_LIMIT: 1000

‎.github/workflows/sdk.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ name: "SDK build and test"
44

55
env:
66
COPILOT_BAZEL_ANG_ENABLED: ${{ vars.COPILOT_BAZEL_ANG_ENABLED }}
7+
COPILOT_BAZEL_ANG_SCOPE: ${{ vars.COPILOT_BAZEL_ANG_SCOPE }}
78
HUSKY: 0
89
POWERSHELL_UPDATECHECK: Off
910
SETUP_NODE_TIMEOUT_MINUTES: 10
@@ -49,8 +50,9 @@ jobs:
4950
fi
5051
5152
# TEMPORARY MERGE QUEUE REDUCTION: pull requests and main pushes retain the
52-
# full platform matrix. Merge groups rerun Linux x64 as the representative
53-
# compatibility lane. Remove the merge_group gates below to restore it.
53+
# full SDK matrix. Merge groups rerun only Linux x64 Node.js out-of-process
54+
# CAPI coverage. Remove the merge_group gates here and in sdk-platform.yml
55+
# and sdk-nodejs.yml to restore the full matrix.
5456
build-runtime-windows-x64-addons:
5557
name: "Build runtime addons (win32-x64)"
5658
needs: detect-layout
@@ -454,7 +456,7 @@ jobs:
454456
exit 1
455457
fi
456458
done
457-
echo "Linux x64 SDK compatibility and generated clients passed"
459+
echo "Linux x64 Node.js SDK compatibility and generated clients passed"
458460
exit 0
459461
fi
460462

‎BUILD.bazel‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
SHARED_CODEGEN_INPUTS = [
22
"nodejs/scripts/releaseArtifacts.ts",
33
"nodejs/src/cliVersion.ts",
4+
"scripts/codegen/legacy-parameters.ts",
45
"scripts/codegen/package-lock.json",
56
"scripts/codegen/package.json",
67
"scripts/codegen/utils.ts",
@@ -222,6 +223,7 @@ genrule(
222223
"java/scripts/codegen/package-lock.json",
223224
"java/scripts/codegen/package.json",
224225
"nodejs/package.json",
226+
"scripts/codegen/legacy-parameters.ts",
225227
"scripts/runtime-layout.mjs",
226228
"scripts/runtime-release.mjs",
227229
],

‎CONTRIBUTING.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,15 @@ npm --prefix nodejs ci --ignore-scripts
116116
npm --prefix test/harness ci --ignore-scripts
117117
```
118118

119+
Node tests, including the unit-only profile, run generator subprocesses and
120+
require the codegen package's own dependencies. Prepare these before invoking
121+
Node tests directly or from a standalone SDK checkout (runtime build/test tasks
122+
already prepare them):
123+
124+
```bash
125+
npm --prefix scripts/codegen ci --ignore-scripts
126+
```
127+
119128
The full Node test task also runs the corrections-script tests:
120129

121130
```bash
@@ -319,6 +328,16 @@ For TypeScript SDK E2Es, use the existing
319328
`nodejs/test/e2e/harness/sdkTestContext.ts` fixture. In the runtime repository,
320329
also follow the `e2e-test-author` skill's SDK section.
321330

331+
The Node.js Vitest global setup bundles the shared replay proxy once per run
332+
into Vitest's project-owned temporary directory (and refreshes it on watch
333+
reruns). Each E2E context launches that bundle directly with the test runner's
334+
Node executable, without an npm, shell, or TypeScript-loader subprocess.
335+
Focused Vitest commands use the same setup; no separate proxy build is needed.
336+
If startup or shutdown cleanup cannot confirm that the child exited, `CapiProxy`
337+
retains the child handle so callers can retry cleanup with `stop()`.
338+
Once shutdown is acknowledged, it waits for the child to finish flushing captures
339+
and exit rather than applying a forced-termination timeout to the flush.
340+
322341
Owned-stdio shutdown regressions share
323342
`test/harness/stdio-shutdown-runtime.cjs` across all six SDKs. Launch it with
324343
Node and arguments `<cleanup-marker> <mode> <pid-file>`. The fixture acknowledges

‎docs/features/mcp.md‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,57 @@ On session creation and a **cold** resume, disabled servers are not started and
183183
the runtime does not initiate their authentication. A resident resume cannot
184184
undo a server that the runtime has already spawned. Names are matched exactly.
185185

186+
## Listing and retrieving prompts
187+
188+
The experimental generated MCP namespace exposes the wire JSON-RPC methods
189+
`session.mcp.prompts.list` and `session.mcp.prompts.get`. Use the language-specific
190+
SDK accessors below to call them. These methods target one connected server in the
191+
current session; they do not combine results from multiple servers.
192+
193+
| SDK | List prompts | Get a prompt |
194+
| --- | --- | --- |
195+
| Node.js | `session.rpc.mcp.prompts.list(...)` | `session.rpc.mcp.prompts.get(...)` |
196+
| Python | `session.rpc.mcp.prompts.list(...)` | `session.rpc.mcp.prompts.get(...)` |
197+
| Go | `session.RPC.MCP.Prompts().List(...)` | `session.RPC.MCP.Prompts().Get(...)` |
198+
| .NET | `session.Rpc.Mcp.Prompts.ListAsync(...)` | `session.Rpc.Mcp.Prompts.GetAsync(...)` |
199+
| Java | `session.getRpc().mcp.prompts.list(...)` | `session.getRpc().mcp.prompts.get(...)` |
200+
| Rust | `session.rpc().mcp().prompts().list(...)` | `session.rpc().mcp().prompts().get(...)` |
201+
202+
Listing requires `serverName` and accepts an optional opaque `cursor`. Each
203+
call returns one page of typed prompt definitions and an optional `nextCursor`.
204+
Pass that cursor in another list call to request the next page. Definitions
205+
include names, optional titles and descriptions, and argument definitions.
206+
An omitted argument `required` flag remains distinct from `false`.
207+
208+
Getting a prompt requires `serverName` and `promptName`, with an optional
209+
`arguments` dictionary whose values are strings. Omitting `arguments` leaves the
210+
MCP request's arguments absent; passing `{}` sends an explicitly empty dictionary.
211+
The runtime preserves this distinction for the server. The result contains an optional
212+
description and ordered messages with typed roles and opaque JSON `content`.
213+
Inspect each content block's `type` before interpreting it; content is not
214+
flattened into text. Nested resources, annotations, metadata, unfamiliar content
215+
types, and additional content fields retain their JSON structure. Server
216+
extensions on typed descriptors, messages, and result envelopes are available under
217+
`additionalProperties`. A server extension itself named `additionalProperties`
218+
is preserved as an entry inside that map, not merged into it.
219+
The protocol's top-level `resultType: "complete"` discriminator is consumed by
220+
the runtime; it is not returned as an SDK field or a server extension.
221+
Requests fail explicitly if the runtime cannot preserve the raw response,
222+
including stdio response frames exceeding the 1 MiB capture limit.
223+
224+
The returned prompt messages are not automatically sent to the model or used to
225+
execute tools or fetch referenced resources. Your application decides how to
226+
use the result.
227+
While generating that result, an MCP server can request sampling or elicitation
228+
through multi round-trip continuations. These requests use the same configured
229+
host responders as other MCP operations; prompt retrieval does not grant
230+
additional permission or bypass the host's decision. A missing responder or
231+
responder error fails the request, and an elicitation decline is returned to the
232+
server unchanged. State-only continuations do not invoke either responder.
233+
234+
After an existing `mcp.prompts.list_changed` session event, list the named
235+
server's prompts again to refresh your application's view.
236+
186237
## Tool configuration
187238

188239
You can control which tools are available to an MCP server using the `tools` field.
@@ -295,6 +346,53 @@ directories for different applications.
295346
| `tools` | `string[]` | No | Tools to enable |
296347
| `timeout` | `number` | No | Timeout in milliseconds |
297348

349+
## OAuth ownership for remote servers
350+
351+
Choose one OAuth ownership model for each authentication attempt:
352+
353+
1. **Runtime-managed loopback**: Call `session.mcp.oauth.login` without a
354+
redirect URI. The runtime opens a local callback listener and owns discovery,
355+
PKCE, state validation, token exchange, persistence, refresh, and reconnect.
356+
1. **Runtime-managed hosted callback**: Call `session.mcp.oauth.login` with a
357+
trusted public HTTPS redirect URI. Your host receives the callback, but the
358+
runtime continues to own the OAuth protocol and credentials.
359+
1. **Host-managed OAuth**: Use the SDK's MCP authentication request handler and
360+
return a host-acquired access token. Your host owns authorization and refresh.
361+
362+
Do not register a host-managed OAuth handler for an authentication attempt that
363+
uses a runtime-managed hosted callback. Wait until the remote server enters the
364+
`needs-auth` state, then call the generated `session.rpc.mcp.oauth.login` method
365+
directly with the server name and callback URI:
366+
367+
```jsonc
368+
{
369+
"serverName": "remote-mcp",
370+
"redirectUri": "https://agent.example.com/oauth/callback"
371+
}
372+
```
373+
374+
The selected static, CIMD, or dynamically registered OAuth client must advertise
375+
that exact URI. The URI must use HTTPS and must not contain a query or fragment.
376+
When browser interaction is required, the result contains `authorizationUrl`
377+
and `authorizationId`. Open `authorizationUrl` in the user's browser and retain
378+
`authorizationId` with the target session.
379+
380+
After the authorization server redirects to your endpoint, call the generated
381+
`session.rpc.mcp.oauth.complete` method:
382+
383+
```jsonc
384+
{
385+
"authorizationId": "<opaque-state>",
386+
"callbackUrl": "https://agent.example.com/oauth/callback?code=...&state=..."
387+
}
388+
```
389+
390+
Construct `callbackUrl` from the configured public redirect origin and path plus
391+
the callback's original query. Do not pass an internal service URL or trust
392+
client-supplied `Forwarded` or `X-Forwarded-*` headers. The runtime validates the
393+
origin, port, path, state, and OAuth response before accepting delivery. Token
394+
exchange, persistence, and MCP reconnect then continue asynchronously.
395+
298396
## Session-scoped MCP diagnostics
299397

300398
Set `diagnostics: { sources: { mcp: { level: "debug" } } }` when you create or

0 commit comments

Comments
 (0)