nandi/oripublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/nandi/ori.git
git clone ssh://git@rickub.com/nandi/ori.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

forked from bots-garden/ori

PermissionPrompt.tsx · 49 lines · 1.3 KBTypeScript Blame HistoryRaw
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g yesterday1/**
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
14import type { PermissionRequestState } from "../reducer";
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday15import { 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 2434cc7 k33g yesterday16
17interface PermissionPromptProps {
18 request: PermissionRequestState;
19 onRespond: (requestId: string, optionId: string) => void;
20}
21
22export 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 76d62ac k33g yesterday32 <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 2434cc7 k33g yesterday35 <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}