mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-28 21:57:13 +02:00
feat: add structured tool approval details to sidecar protocol
Expose SDK permission request details on approval-requested events via a new permissionDetail payload. This preserves the existing title/detail summary while carrying the command, URL, diff, args, and other kind-specific data needed for richer approval UI in the renderer. Also adds sidecar coverage for all supported permission request kinds and verifies the new payload serializes over the protocol. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -249,6 +249,13 @@ public sealed class SidecarProtocolHostTests
|
||||
AgentName = "Primary",
|
||||
PermissionKind = "tool access",
|
||||
Title = "Approve tool access",
|
||||
PermissionDetail = new PermissionDetailDto
|
||||
{
|
||||
Kind = "shell",
|
||||
Command = "git status",
|
||||
Intention = "Inspect repository state",
|
||||
PossiblePaths = ["README.md"],
|
||||
},
|
||||
});
|
||||
|
||||
return [];
|
||||
@@ -284,6 +291,11 @@ public sealed class SidecarProtocolHostTests
|
||||
Assert.Equal("approval-1", approvalEvent.GetProperty("approvalId").GetString());
|
||||
Assert.Equal("tool-call", approvalEvent.GetProperty("approvalKind").GetString());
|
||||
Assert.Equal("Approve tool access", approvalEvent.GetProperty("title").GetString());
|
||||
JsonElement permissionDetail = approvalEvent.GetProperty("permissionDetail");
|
||||
Assert.Equal("shell", permissionDetail.GetProperty("kind").GetString());
|
||||
Assert.Equal("git status", permissionDetail.GetProperty("command").GetString());
|
||||
Assert.Equal("Inspect repository state", permissionDetail.GetProperty("intention").GetString());
|
||||
Assert.Equal("README.md", Assert.Single(permissionDetail.GetProperty("possiblePaths").EnumerateArray()).GetString());
|
||||
},
|
||||
completionEvent =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user