github / github/app

Feature request: Support user-invocable-only canvases

Đang mở
#2,660 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
2.1k
Fork
153
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 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

```js
createCanvas({
id: "example",
displayName: "Example",
description: "An explicitly opened utility.",
invocation: {
user: true,
agent: false,
},
open: async (context) => {
// ...
},
});
```

A simpler alternative:

```js
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_canvas` and `invoke_canvas_action` cannot 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Issue nêu tên createCanvas, open_canvas và invoke_canvas_action nhưng không có tệp hoặc bài kiểm thử nào. Hãy bắt đầu bằng cách xác định các điểm vào đó và lần theo cách các khai báo canvas đi vào ngữ cảnh mô hình cũng như cách các lệnh gọi từ host được cấp quyền. Công việc được hoàn tất khi các canvas chỉ dành cho người dùng vẫn có thể được người dùng khám phá, bị loại khỏi ngữ cảnh mô hình, từ chối rõ ràng các lệnh gọi của agent và giữ nguyên các giá trị mặc định hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
api
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.