Skip to content

Commit ffa7c34

Browse files
jmoseleyCopilot
andcommitted
Scrub V1/V1.1 framing from canvas comments
Rewrites doc comments on the canvas declarations, session config fields, and dispatch wiring to describe the surface as-is without versioning narrative or references to the removed hosted-extension types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bdb687f commit ffa7c34

7 files changed

Lines changed: 23 additions & 37 deletions

File tree

nodejs/src/canvas.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*--------------------------------------------------------------------------------------------*/
44

55
/**
6-
* Canvas V1.1 — extension-owned canvases declared via
6+
* Extension-owned canvases declared via
77
* `joinSession({ canvases: [createCanvas({...})] })`.
88
*
99
* The on-the-wire declaration shape mirrors the runtime's `CanvasDeclaration`
@@ -13,11 +13,9 @@
1313
* `canvas.action.invoke` dispatches by `(canvasId, actionName)` back to the
1414
* handlers.
1515
*
16-
* The wire RPC method is still `hostExtension.invoke` (runtime preserves the
17-
* legacy name); inside, `method === "canvas.action.invoke"` identifies canvas
18-
* dispatches. The runtime synthesizes an internal
19-
* `implementationId = "v1.1.<extensionId>/<canvasId>"`, but the SDK ignores
20-
* it and routes purely on `params.canvasId` + `params.actionName`.
16+
* The wire RPC method is `hostExtension.invoke`; inside,
17+
* `method === "canvas.action.invoke"` identifies canvas dispatches. The SDK
18+
* routes purely on `params.canvasId` + `params.actionName`.
2119
*/
2220

2321
/**

nodejs/src/client.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,10 +1861,10 @@ export class CopilotClient {
18611861
await this.handleSystemMessageTransform(params)
18621862
);
18631863

1864-
// Canvas V1.1: runtime preserves the legacy `hostExtension.invoke`
1865-
// wire method for canvas dispatches. The inner `method` discriminates;
1864+
// Canvas dispatch: the runtime uses the `hostExtension.invoke` wire
1865+
// method for canvas dispatches. The inner `method` discriminates;
18661866
// we route `canvas.action.invoke` to the per-session canvas registry
1867-
// and reject anything else (no other inner method is in use post-V1.1).
1867+
// and reject anything else.
18681868
this.connection.onRequest(
18691869
"hostExtension.invoke",
18701870
async (params: {
@@ -2071,9 +2071,8 @@ export class CopilotClient {
20712071
throw new Error(`Session not found: ${params.sessionId}`);
20722072
}
20732073
const { method, params: inner } = params.request;
2074-
// Canvas V1.1: only `canvas.action.invoke` is in use. Other inner methods
2075-
// are dead in the V1.1 cutover; reject explicitly so misrouted calls
2076-
// don't silently no-op.
2074+
// Only `canvas.action.invoke` is accepted as an inner method; reject
2075+
// anything else explicitly so misrouted calls don't silently no-op.
20772076
if (method !== "canvas.action.invoke") {
20782077
throw new Error(`Unsupported hostExtension.invoke method: ${method}`);
20792078
}

nodejs/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ export interface SessionConfig {
13501350
tools?: Tool<any>[];
13511351

13521352
/**
1353-
* Canvases contributed by this session participant (V1.1). The declaring
1353+
* Canvases contributed by this session participant. The declaring
13541354
* connection becomes the live provider for `canvas.open|focus|close|reload`
13551355
* and `canvas.action.invoke` dispatches targeting each canvas's `id` for
13561356
* the lifetime of the connection. Re-declaring the same id on resume

rust/src/canvas.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
//! Canvas V1.1 — extension-owned canvases declared via `joinSession({ canvases: [...] })`.
1+
//! Extension-owned canvases declared via `joinSession({ canvases: [...] })`.
22
//!
3-
//! This module is the Rust mirror of the locked TypeScript wire shape committed
4-
//! in runtime PR #8441 (`jmoseley/canvas-runtime-support`, commit `0d9535192b`).
3+
//! This module is the Rust mirror of the TypeScript wire shape.
54
//!
6-
//! Status: **additive types + handler trait + Canvas/CanvasBuilder + dispatch routing**.
7-
//!
8-
//! The wire RPC method is still `hostExtension.invoke` (runtime keeps the
9-
//! legacy name); inside, the inner `method == "canvas.action.invoke"`
10-
//! identifies canvas dispatches. Runtime synthesizes
11-
//! `implementationId = "v1.1.<extensionId>/<canvasId>"`, but the SDK routes
12-
//! purely on `params.canvasId` + `params.actionName`.
13-
//!
14-
//! Old hosted-extension types in `types.rs` are scheduled for deletion in a
15-
//! follow-up edit once the host fully migrates to the new path.
5+
//! The wire RPC method is `hostExtension.invoke`; inside, the inner
6+
//! `method == "canvas.action.invoke"` identifies canvas dispatches. The SDK
7+
//! routes purely on `params.canvasId` + `params.actionName`.
168
179
use std::collections::HashMap;
1810
use std::sync::Arc;
@@ -356,9 +348,6 @@ pub fn build_registry(canvases: &[Canvas]) -> CanvasRegistry {
356348

357349
/// Wire-level params for `canvas.action.invoke` (the inner `method` field of
358350
/// a `hostExtension.invoke` JSON-RPC request).
359-
///
360-
/// Mirrors the runtime's `HostedExtensionRequest.params` shape exactly —
361-
/// `canvas-agent-runtime/src/core/server.ts` `dispatchCanvas*`.
362351
#[derive(Debug, Clone, Deserialize)]
363352
#[serde(rename_all = "camelCase")]
364353
pub struct CanvasInvokeParams {

rust/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![deny(rustdoc::broken_intra_doc_links)]
44
#![cfg_attr(test, allow(clippy::unwrap_used))]
55

6-
/// Canvas V1.1 — extension-owned canvas declarations and per-canvas handlers.
6+
/// Extension-owned canvas declarations and per-canvas handlers.
77
pub mod canvas;
88
/// Bundled CLI binary extraction and caching.
99
pub mod embeddedcli;

rust/src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,7 @@ async fn handle_request(
18151815
}
18161816

18171817
"hostExtension.invoke" => {
1818-
// V1.1 canvas dispatch: the only inner method accepted is
1818+
// Canvas dispatch: the only inner method accepted is
18191819
// `canvas.action.invoke`, routed through the canvas registry built
18201820
// from `SessionConfig.canvases`.
18211821
#[derive(serde::Deserialize)]

rust/src/types.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ pub struct SessionConfig {
11011101
/// Defaults to `Some(true)` via [`SessionConfig::default`].
11021102
#[serde(skip_serializing_if = "Option::is_none")]
11031103
pub request_elicitation: Option<bool>,
1104-
/// Renderer-side opt-in (V1.1): when `true`, the runtime surfaces canvas
1104+
/// Renderer-side opt-in: when `true`, the runtime surfaces canvas
11051105
/// agent tools (`open_canvas`, `discover_canvases`, ...) to the model.
11061106
/// Default off — TUI / headless / SDK callers stay clean unless they can
11071107
/// actually display canvases. Independent of provider semantics, which
@@ -1206,7 +1206,7 @@ pub struct SessionConfig {
12061206
/// associated [`CommandHandler`] is called when executed.
12071207
#[serde(skip_serializing_if = "Option::is_none", skip_deserializing)]
12081208
pub commands: Option<Vec<CommandDefinition>>,
1209-
/// Canvas V1.1 declarations. Each entry binds a [`CanvasDeclaration`] +
1209+
/// Canvas declarations. Each entry binds a [`CanvasDeclaration`] +
12101210
/// [`crate::canvas::CanvasHandler`] for this session; the runtime treats
12111211
/// the declaring connection as the live provider for every declared
12121212
/// canvas id. Serialized as an array of `CanvasDeclaration` on the wire.
@@ -1545,7 +1545,7 @@ impl SessionConfig {
15451545
self
15461546
}
15471547

1548-
/// Renderer-side opt-in (V1.1): surface canvas agent tools to the model.
1548+
/// Renderer-side opt-in: surface canvas agent tools to the model.
15491549
pub fn with_request_canvas_renderer(mut self, enable: bool) -> Self {
15501550
self.request_canvas_renderer = Some(enable);
15511551
self
@@ -1748,7 +1748,7 @@ pub struct ResumeSessionConfig {
17481748
/// Advertise elicitation provider capability on resume.
17491749
#[serde(skip_serializing_if = "Option::is_none")]
17501750
pub request_elicitation: Option<bool>,
1751-
/// Renderer-side opt-in (V1.1) on resume; see
1751+
/// Renderer-side opt-in on resume; see
17521752
/// [`SessionConfig::request_canvas_renderer`].
17531753
#[serde(skip_serializing_if = "Option::is_none")]
17541754
pub request_canvas_renderer: Option<bool>,
@@ -1818,7 +1818,7 @@ pub struct ResumeSessionConfig {
18181818
/// so the resume payload re-supplies the registration.
18191819
#[serde(skip_serializing_if = "Option::is_none", skip_deserializing)]
18201820
pub commands: Option<Vec<CommandDefinition>>,
1821-
/// Canvas V1.1 declarations to (re-)register on resume. Same semantics
1821+
/// Canvas declarations to (re-)register on resume. Same semantics
18221822
/// as [`SessionConfig::canvases`]; re-declaring a canvas id replaces
18231823
/// the prior entry on the runtime side.
18241824
#[serde(default, skip_serializing_if = "Vec::is_empty", skip_deserializing)]
@@ -2158,7 +2158,7 @@ impl ResumeSessionConfig {
21582158
self
21592159
}
21602160

2161-
/// Renderer-side opt-in (V1.1) on resume: surface canvas agent tools to the model.
2161+
/// Renderer-side opt-in on resume: surface canvas agent tools to the model.
21622162
pub fn with_request_canvas_renderer(mut self, enable: bool) -> Self {
21632163
self.request_canvas_renderer = Some(enable);
21642164
self

0 commit comments

Comments
 (0)