MCPcopy Create free account
hub / github.com/github/copilot-sdk / _CounterCanvasHandler

Class _CounterCanvasHandler

python/e2e/test_canvas_e2e.py:28–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28class _CounterCanvasHandler(CanvasHandler):
29 def __init__(self) -> None:
30 self.open_calls: list[CanvasProviderOpenRequest] = []
31 self.action_calls: list[CanvasProviderInvokeActionRequest] = []
32 self.close_calls: list[CanvasProviderCloseRequest] = []
33
34 async def on_open(self, ctx: CanvasProviderOpenRequest) -> CanvasProviderOpenResult:
35 self.open_calls.append(ctx)
36 return CanvasProviderOpenResult(
37 url="https://example.test/counter",
38 title="Counter Canvas",
39 status="ready",
40 )
41
42 async def on_close(self, ctx: CanvasProviderCloseRequest) -> None:
43 self.close_calls.append(ctx)
44
45 async def on_action(self, ctx: CanvasProviderInvokeActionRequest) -> dict[str, int]:
46 self.action_calls.append(ctx)
47 return {"newValue": 42}
48
49
50def _counter_canvas() -> CanvasDeclaration:

Callers 1

_create_counter_sessionFunction · 0.85

Calls

no outgoing calls

Tested by 1

_create_counter_sessionFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…