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 (
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.
{command}
))}