MCPcopy Index your code
hub / github.com/github/copilot-sdk / CanvasHandler

Interface CanvasHandler

go/canvas.go:94–98  ·  view source on GitHub ↗

CanvasHandler is the provider-side canvas lifecycle handler. A session installs a single CanvasHandler (via SessionConfig.CanvasHandler). The handler receives every inbound `canvas.open` / `canvas.close` / `canvas.action.invoke` JSON-RPC request the runtime issues for this session and decides — typ

Source from the content-addressed store, hash-verified

92// Experimental: CanvasHandler is part of an experimental wire-protocol
93// surface and may change or be removed in future SDK or CLI releases.
94type CanvasHandler interface {
95 OnOpen(ctx context.Context, c rpc.CanvasProviderOpenRequest) (rpc.CanvasProviderOpenResult, error)
96 OnClose(ctx context.Context, c rpc.CanvasProviderCloseRequest) error
97 OnAction(ctx context.Context, c rpc.CanvasProviderInvokeActionRequest) (any, error)
98}
99
100// CanvasHandlerDefaults supplies default OnClose / OnAction implementations
101// that consumers can inherit by embedding it in their CanvasHandler.

Callers 3

OpenMethod · 0.65
CloseMethod · 0.65
InvokeMethod · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…