import { useState } from "react"; import { setWorkspaceTrusted, type WorkspaceCommandTrust } from "../api"; export function WorkspaceTrustPrompt({ request, onClose, }: { request: WorkspaceCommandTrust; onClose: () => void; }) { const [saving, setSaving] = useState(false); const [error, setError] = useState(""); const trust = async () => { setSaving(true); setError(""); const result = await setWorkspaceTrusted(request.workspace, true).catch(() => null); setSaving(false); if (!result?.ok) { setError(result?.error || "Could not save workspace trust."); return; } onClose(); }; return (

Trust this workspace’s commands?

This project asks OpenWorker to run the commands below without individual approval. Trust applies to future configuration changes at this exact folder until you revoke it in Settings.

{request.requested_commands.map((command) => ( {command} ))}
{request.workspace}
{error &&
{error}
}
); }