Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotnet/src/Canvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ internal partial class CanvasJsonContext : JsonSerializerContext;
/// <remarks>
/// A session installs a single <see cref="ICanvasHandler"/> via
/// <c>SessionConfigBase.CanvasHandler</c>. The handler receives every
/// inbound <c>canvas.open</c> / <c>canvas.close</c> / <c>canvas.invokeAction</c>
/// inbound <c>canvas.open</c> / <c>canvas.close</c> / <c>canvas.action.invoke</c>
/// JSON-RPC request the runtime issues for this session and decides — typically
/// by inspecting <see cref="CanvasProviderOpenRequest.CanvasId"/> — which
/// application-side canvas should handle the call.
Expand Down
38 changes: 28 additions & 10 deletions dotnet/src/Generated/Rpc.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dotnet/src/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ public async Task CloseAsync(CanvasProviderCloseRequest request, CancellationTok
}
}

public async Task<object> InvokeActionAsync(CanvasProviderInvokeActionRequest request, CancellationToken cancellationToken = default)
public async Task<object> InvokeAsync(CanvasProviderInvokeActionRequest request, CancellationToken cancellationToken = default)
{
try
{
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/Types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2630,7 +2630,7 @@ protected SessionConfigBase(SessionConfigBase? other)

/// <summary>
/// Provider-side canvas lifecycle handler. The SDK routes inbound
/// <c>canvas.open</c> / <c>canvas.close</c> / <c>canvas.invokeAction</c>
/// <c>canvas.open</c> / <c>canvas.close</c> / <c>canvas.action.invoke</c>
/// requests to this handler.
/// </summary>
[Experimental(Diagnostics.Experimental)]
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/E2E/CanvasE2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ await session.Rpc.Canvas.OpenAsync(
extensionId: canvas.ExtensionId,
input: new Dictionary<string, object> { ["start"] = 41 });

var result = await session.Rpc.Canvas.InvokeActionAsync(
var result = await session.Rpc.Canvas.Action.InvokeAsync(
instanceId: "counter-1",
actionName: "increment",
input: new Dictionary<string, object> { ["delta"] = 1 });
Expand Down
2 changes: 1 addition & 1 deletion go/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func CanvasErrorNoHandler() *CanvasError {
//
// A session installs a single CanvasHandler (via SessionConfig.CanvasHandler).
// The handler receives every inbound `canvas.open` / `canvas.close` /
// `canvas.invokeAction` JSON-RPC request the runtime issues for this session
// `canvas.action.invoke` JSON-RPC request the runtime issues for this session
// and decides — typically by inspecting CanvasProviderOpenRequest.CanvasID — which
// application-side canvas should handle the call.
//
Expand Down
4 changes: 2 additions & 2 deletions go/canvas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func TestCanvasAdapter_DispatchesToHandler(t *testing.T) {
t.Fatalf("response URL not propagated: %+v", openResp)
}

actionResp, err := session.clientSessionApis.Canvas.InvokeAction(&rpc.CanvasProviderInvokeActionRequest{
actionResp, err := session.clientSessionApis.Canvas.Invoke(&rpc.CanvasProviderInvokeActionRequest{
SessionID: "s1",
ExtensionID: "project:echo",
CanvasID: "echo",
Expand Down Expand Up @@ -284,7 +284,7 @@ func TestCanvasRegisterClientSessionApiHandlers_RawJSONRoundTrip(t *testing.T) {
t.Fatalf("expected status=ready, got %v", decoded["status"])
}

actionRaw, err := requester.Request("canvas.invokeAction", map[string]any{
actionRaw, err := requester.Request("canvas.action.invoke", map[string]any{
"sessionId": "s1",
"extensionId": "ext",
"canvasId": "echo",
Expand Down
4 changes: 2 additions & 2 deletions go/internal/e2e/canvas_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ func TestCanvasE2E(t *testing.T) {
t.Fatalf("unexpected open calls: %+v", calls)
}

actionResult, err := session.RPC.Canvas.InvokeAction(t.Context(), &rpc.CanvasInvokeActionRequest{
actionResult, err := session.RPC.Canvas.Action().Invoke(t.Context(), &rpc.CanvasActionInvokeRequest{
InstanceID: "counter-1",
ActionName: "increment",
Input: map[string]any{
"amount": float64(2),
},
})
if err != nil {
t.Fatalf("Canvas.InvokeAction failed: %v", err)
t.Fatalf("Canvas.Action.Invoke failed: %v", err)
}
actionPayload, ok := actionResult.Result.(map[string]any)
if !ok || actionPayload["count"] != float64(5) {
Expand Down
112 changes: 60 additions & 52 deletions go/rpc/zrpc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (a *canvasClientSessionAdapter) Close(request *rpc.CanvasProviderCloseReque
return nil, nil
}

func (a *canvasClientSessionAdapter) InvokeAction(request *rpc.CanvasProviderInvokeActionRequest) (any, error) {
func (a *canvasClientSessionAdapter) Invoke(request *rpc.CanvasProviderInvokeActionRequest) (any, error) {
if request == nil {
return nil, canvasJSONRPCError(NewCanvasError("canvas_handler_unset", "missing canvas action request"))
}
Expand Down
2 changes: 1 addition & 1 deletion go/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ type SessionConfig struct {
RequestCanvasRenderer *bool
// RequestExtensions asks the host to surface declared canvases as agent-visible extensions.
RequestExtensions *bool
// CanvasHandler receives inbound canvas.open / canvas.close / canvas.invokeAction
// CanvasHandler receives inbound canvas.open / canvas.close / canvas.action.invoke
// requests for this session. The SDK does not maintain a per-canvas registry;
// the handler must dispatch on CanvasProviderOpenRequest.CanvasID itself.
CanvasHandler CanvasHandler `json:"-"`
Expand Down
Loading
Loading