forked from bots-garden/ori
| ✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS | 1 | /** |
| 2 | * PermissionPrompt asks the user to approve or reject a sensitive agent | |
| 3 | * action, offering exactly the options the agent proposed (allow once, | |
| 4 | * always, reject, ...), like Zed's permission bar. | |
| 5 | * | |
| 6 | * @example | |
| 7 | * <PermissionPrompt | |
| 8 | * request={{ requestId: "perm-1", title: "Run `make test`", options: [ | |
| 9 | * { optionId: "allow", name: "Allow", kind: "allow_once" }] }} | |
| 10 | * onRespond={(requestId, optionId) => console.log(requestId, optionId)} | |
| 11 | * /> | |
| 12 | */ | |
| 13 | ||
| 14 | import type { PermissionRequestState } from "../reducer"; | |
| ✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme | 15 | import { InlineText } from "./InlineText"; |
| ✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS | 16 | |
| 17 | interface PermissionPromptProps { | |
| 18 | request: PermissionRequestState; | |
| 19 | onRespond: (requestId: string, optionId: string) => void; | |
| 20 | } | |
| 21 | ||
| 22 | export function PermissionPrompt({ | |
| 23 | request, | |
| 24 | onRespond, | |
| 25 | }: PermissionPromptProps) { | |
| 26 | return ( | |
| 27 | <div | |
| 28 | className="permission" | |
| 29 | role="alertdialog" | |
| 30 | aria-label="permission request" | |
| 31 | > | |
| ✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme | 32 | <p className="permission-title"> |
| 33 | 🔐 <InlineText text={request.title} /> | |
| 34 | </p> | |
| ✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS | 35 | <div className="permission-options"> |
| 36 | {request.options.map((option) => ( | |
| 37 | <button | |
| 38 | key={option.optionId} | |
| 39 | type="button" | |
| 40 | className={`permission-option permission-${option.kind}`} | |
| 41 | onClick={() => onRespond(request.requestId, option.optionId)} | |
| 42 | > | |
| 43 | {option.name} | |
| 44 | </button> | |
| 45 | ))} | |
| 46 | </div> | |
| 47 | </div> | |
| 48 | ); | |
| 49 | } |