feat: UI許可システムの実装

- permissionModeを設定可能に変更(bypassPermissions, default, acceptEdits, plan)
- defaultモード時のUI許可ダイアログを実装
  - canUseTool callbackによるプログラマティックな許可処理
  - SSEを使用したリアルタイム通信
  - 許可/拒否の選択UI
- PermissionDialog機能
  - 大きなダイアログサイズ(max-w-4xl, max-h-[80vh])
  - パラメータの折りたたみ表示
  - 各パラメータのコピーボタン
  - 長いテキストのスクロール対応
  - レスポンシブデザイン対応
This commit is contained in:
dobachi
2025-09-24 01:37:53 +09:00
parent a35cba7a21
commit b7e9947efb
13 changed files with 541 additions and 11 deletions

13
src/types/permissions.ts Normal file
View File

@@ -0,0 +1,13 @@
export type PermissionRequest = {
id: string;
taskId: string;
sessionId?: string;
toolName: string;
toolInput: Record<string, unknown>;
timestamp: number;
};
export type PermissionResponse = {
permissionRequestId: string;
decision: "allow" | "deny";
};

View File

@@ -1,4 +1,7 @@
import type { AliveClaudeCodeTask } from "../server/service/claude-code/types";
import type {
AliveClaudeCodeTask,
PermissionRequest,
} from "../server/service/claude-code/types";
export type SSEEventDeclaration = {
// biome-ignore lint/complexity/noBannedTypes: correct type
@@ -19,6 +22,10 @@ export type SSEEventDeclaration = {
taskChanged: {
aliveTasks: AliveClaudeCodeTask[];
};
permission_requested: {
permissionRequest: PermissionRequest;
};
};
export type SSEEventMap = {