mirror of
https://github.com/davidkaya/aryx.git
synced 2026-12-04 06:06:24 +01:00
feat: surface structured permission details in approval UI
Wire the sidecar's new permissionDetail payload through the frontend: - Add PermissionDetail interface to sidecar contract - Add permissionDetail field to PendingApprovalRecord and thread through normalization and AryxAppService mapping - Create PermissionDetailView component with kind-specific rendering: shell (command block + warning), write (filename + diff), read (path), mcp (server badge + args), url (prominent URL), memory (subject/fact), custom-tool (description + args), hook (message + args) - ApprovalBanner shows structured detail when available, falls back to generic text for backward compatibility - QueuedApprovalsList shows brief kind-specific summaries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
13c543e2fd
commit
4c01d8b1a7
5 files changed
+334
-4
No files matched your search
@@ -181,6 +181,30 @@ export interface AgentActivityEvent {
|
||||
toolName?: string;
|
||||
}
|
||||
|
||||
export interface PermissionDetail {
|
||||
kind: string;
|
||||
intention?: string;
|
||||
command?: string;
|
||||
warning?: string;
|
||||
possiblePaths?: string[];
|
||||
possibleUrls?: string[];
|
||||
hasWriteFileRedirection?: boolean;
|
||||
fileName?: string;
|
||||
diff?: string;
|
||||
newFileContents?: string;
|
||||
path?: string;
|
||||
serverName?: string;
|
||||
toolTitle?: string;
|
||||
args?: Record<string, unknown>;
|
||||
readOnly?: boolean;
|
||||
url?: string;
|
||||
subject?: string;
|
||||
fact?: string;
|
||||
citations?: string;
|
||||
toolDescription?: string;
|
||||
hookMessage?: string;
|
||||
}
|
||||
|
||||
export interface ApprovalRequestedEvent {
|
||||
type: 'approval-requested';
|
||||
requestId: string;
|
||||
@@ -193,6 +217,7 @@ export interface ApprovalRequestedEvent {
|
||||
permissionKind?: string;
|
||||
title: string;
|
||||
detail?: string;
|
||||
permissionDetail?: PermissionDetail;
|
||||
}
|
||||
|
||||
export interface CommandErrorEvent {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { PermissionDetail } from '@shared/contracts/sidecar';
|
||||
|
||||
export type ApprovalCheckpointKind = 'tool-call' | 'final-response';
|
||||
export type ApprovalStatus = 'pending' | 'approved' | 'rejected';
|
||||
export type ApprovalDecision = Exclude<ApprovalStatus, 'pending'>;
|
||||
@@ -35,6 +37,7 @@ export interface PendingApprovalRecord {
|
||||
title: string;
|
||||
detail?: string;
|
||||
messages?: PendingApprovalMessageRecord[];
|
||||
permissionDetail?: PermissionDetail;
|
||||
}
|
||||
|
||||
export interface PendingApprovalState {
|
||||
@@ -290,6 +293,7 @@ export function normalizePendingApproval(
|
||||
title,
|
||||
detail: normalizeOptionalString(approval?.detail),
|
||||
messages: normalizePendingApprovalMessages(approval?.messages),
|
||||
permissionDetail: approval?.permissionDetail,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user