Skip to content

Commit c50b728

Browse files
jmoseleyCopilot
andcommitted
Remove canvas tools field
Drop CanvasToolDefinition, CanvasToolDefinitionDefer, and the CanvasOpenResponse.tools / OpenCanvasInstance.tools fields from both the Node and Rust SDKs. The CLI side is being removed in lockstep, so the wire contract no longer carries this field. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 55f97bd commit c50b728

5 files changed

Lines changed: 1 addition & 60 deletions

File tree

nodejs/src/canvas.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,9 @@
1313
* focuses an existing panel; reload is a renderer-only concern.
1414
*/
1515

16-
/** JSON Schema object used for canvas inputs and canvas-scoped tools. */
16+
/** JSON Schema object used for canvas inputs. */
1717
export type CanvasJsonSchema = Record<string, unknown>;
1818

19-
/** Tool definition exposed to a canvas instance. */
20-
export interface CanvasToolDefinition {
21-
name: string;
22-
description: string;
23-
title?: string;
24-
parameters?: CanvasJsonSchema;
25-
overridesBuiltInTool?: boolean;
26-
skipPermission?: boolean;
27-
defer?: "auto" | "never";
28-
}
29-
3019
/**
3120
* A single agent-callable action contributed by a canvas. The metadata
3221
* (`name`, `description`, `inputSchema`) is serialized over the wire on
@@ -72,8 +61,6 @@ export interface CanvasOpenResponse {
7261
title?: string;
7362
/** Provider-supplied status text shown in host chrome. */
7463
status?: string;
75-
/** Tools available to the canvas instance. */
76-
tools?: CanvasToolDefinition[];
7764
}
7865

7966
/** Host capabilities passed to canvas callbacks. */

nodejs/src/extension.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export {
2424
type CanvasOpenContext,
2525
type CanvasOpenResponse,
2626
type CanvasOptions,
27-
type CanvasToolDefinition,
2827
} from "./canvas.js";
2928

3029
export type JoinSessionConfig = Omit<ResumeSessionConfig, "onPermissionRequest"> & {

nodejs/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export {
2424
type CanvasOpenContext,
2525
type CanvasOpenResponse,
2626
type CanvasOptions,
27-
type CanvasToolDefinition,
2827
} from "./canvas.js";
2928
export {
3029
defineTool,

rust/src/canvas.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,6 @@ use crate::types::SessionId;
1313
/// JSON Schema object used for canvas inputs and canvas-scoped tools.
1414
pub type CanvasJsonSchema = serde_json::Map<String, Value>;
1515

16-
/// Tool definition exposed to a canvas instance.
17-
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
18-
#[serde(rename_all = "camelCase")]
19-
pub struct CanvasToolDefinition {
20-
/// Tool name.
21-
pub name: String,
22-
/// Tool description.
23-
pub description: String,
24-
/// Human-readable tool title.
25-
#[serde(default, skip_serializing_if = "Option::is_none")]
26-
pub title: Option<String>,
27-
/// JSON Schema parameters for the tool.
28-
#[serde(default, skip_serializing_if = "Option::is_none")]
29-
pub parameters: Option<Value>,
30-
/// Whether this tool overrides a built-in tool.
31-
#[serde(default, skip_serializing_if = "Option::is_none")]
32-
pub overrides_built_in_tool: Option<bool>,
33-
/// Whether this tool skips permission prompts.
34-
#[serde(default, skip_serializing_if = "Option::is_none")]
35-
pub skip_permission: Option<bool>,
36-
/// Tool deferral behavior.
37-
#[serde(default, skip_serializing_if = "Option::is_none")]
38-
pub defer: Option<CanvasToolDefinitionDefer>,
39-
}
40-
41-
/// Tool deferral behavior for canvas-scoped tools.
42-
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
43-
#[serde(rename_all = "kebab-case")]
44-
pub enum CanvasToolDefinitionDefer {
45-
/// The tool may be deferred by the runtime.
46-
Auto,
47-
/// The tool is always included in the initial tool list.
48-
Never,
49-
}
50-
5116
/// Runtime-controlled routing state for an open canvas instance.
5217
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
5318
#[serde(rename_all = "lowercase")]
@@ -130,9 +95,6 @@ pub struct CanvasOpenResponse {
13095
/// Provider-supplied status text shown in host chrome.
13196
#[serde(default, skip_serializing_if = "Option::is_none")]
13297
pub status: Option<String>,
133-
/// Tools available to the canvas instance.
134-
#[serde(default, skip_serializing_if = "Option::is_none")]
135-
pub tools: Option<Vec<CanvasToolDefinition>>,
13698
}
13799

138100
/// Open canvas instance returned by `session.canvas.open`,
@@ -159,9 +121,6 @@ pub struct OpenCanvasInstance {
159121
/// URL for web-rendered canvases.
160122
#[serde(default, skip_serializing_if = "Option::is_none")]
161123
pub url: Option<String>,
162-
/// Tools available to the canvas instance.
163-
#[serde(default, skip_serializing_if = "Option::is_none")]
164-
pub tools: Option<Vec<CanvasToolDefinition>>,
165124
/// Input supplied when the instance was opened.
166125
#[serde(default, skip_serializing_if = "Option::is_none")]
167126
pub input: Option<Value>,
@@ -186,7 +145,6 @@ impl OpenCanvasInstance {
186145
title: None,
187146
status: None,
188147
url: None,
189-
tools: None,
190148
input: None,
191149
reopen: false,
192150
availability: CanvasInstanceAvailability::Stale,
@@ -652,7 +610,6 @@ mod tests {
652610
url: Some(format!("https://example.test/{}", ctx.canvas_id)),
653611
title: Some("Echo".to_string()),
654612
status: Some("ready".to_string()),
655-
tools: None,
656613
})
657614
}
658615

rust/tests/session_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ impl CanvasHandler for TestCanvasHandler {
3636
url: Some(format!("https://example.test/{}", ctx.canvas_id)),
3737
title: Some("Test Canvas".to_string()),
3838
status: Some("ready".to_string()),
39-
tools: None,
4039
})
4140
}
4241

0 commit comments

Comments
 (0)