Feature request: Support user-invocable-only canvases
还没有人认领这个 Issue。
- 主要语言
- 没有语言数据
- 星标
- 2.1k
- 派生
- 157
- PR 合并指标
- 30 天内没有已合并 PR
描述
Summary
Add a canvas visibility/invocation setting that allows extension authors to expose a canvas to users without making it discoverable or invocable by the agent.
Problem
User-scoped canvases are registered with every applicable session. Their declarations become available to the agent, which:
- Allows the agent to open the canvas without an explicit user request.
- Adds canvas metadata to the model's input context.
- Prevents authors from building strictly user-initiated utilities.
- Creates unnecessary token overhead for canvases that are rarely used.
Omitting actions prevents action invocation but does not prevent agent discovery or opening.
Proposed API
createCanvas({
id: "example",
displayName: "Example",
description: "An explicitly opened utility.",
invocation: {
user: true,
agent: false,
},
open: async (context) => {
// ...
},
});
A simpler alternative:
agentInvocable: false
Expected behavior
When agentInvocable is false:
- The canvas remains visible in user-facing canvas discovery and commands.
- Users can open it explicitly.
- Its declaration and action schemas are excluded from model context.
open_canvasandinvoke_canvas_actioncannot target it.- Canvas-internal, app-only tools continue to work.
- The default remains agent-invocable for backward compatibility.
Acceptance criteria
- Extension authors can independently configure user and agent invocation.
- User-only canvases consume no model-context tokens before explicit use.
- Agent attempts to invoke user-only canvases fail with a clear authorization error.
- Invocation restrictions are enforced by the host, not only through instructions.
- The setting works for user-, project-, and session-scoped extensions.
- Existing canvas extensions retain their current behavior.
Motivation
This would enable dashboards, editors, configuration panels, and other interactive utilities that should be available on demand without permanently expanding every agent session's tool surface.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
该 issue 提到了 createCanvas、open_canvas 和 invoke_canvas_action,但没有文件或测试。首先定位这些入口点,并跟踪 canvas 声明如何进入模型上下文,以及 host 调用如何获得授权。完成的标准是:仅供用户使用的 canvas 仍可被用户发现,被排除在模型上下文之外,明确拒绝 agent 调用,并保留现有默认值。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- api
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100