The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Commit 1efaca5a

1efaca5a5f5eMerged

aryaamin <[email protected]> · 2 months ago · 2 files · ~2 modified

Description

feat: add complete agent deletion

Details

Commit
1efaca5a5f5e
Parent
68f53f7907ca

apps/dashboard/src/main.tsxmodifiedView file

@@ -785,6 +785,13 @@
785785 evidence: number;
786786 };
787787
788+function confirmAgentDeletion(agent: Record<string, any>) {
789+ const agentId = String(agent.agentId);
790+ return window.confirm(
791+ `Delete “${String(agent.name ?? agentId)}” from OpenClasp?\n\nIts provider connection, runtime, token, publication and profile will be removed. Signed interaction and receipt history will be retained. You should also uninstall the connector from its provider.`,
792+ );
793+}
794+
788795 function AgentWorkspace({
789796 data,
790797 navigate,
@@ -851,6 +858,22 @@
851858 }
852859 };
853860
861+ const deleteAgent = async (agent: Record<string, any>) => {
862+ const agentId = String(agent.agentId);
863+ if (!confirmAgentDeletion(agent)) return;
864+ setWorking(`delete:${agentId}`);
865+ setError('');
866+ try {
867+ await api(`/v0.1/agents/${encodeURIComponent(agentId)}`, { method: 'DELETE' });
868+ setExpandedAgent('');
869+ await refreshDashboard();
870+ } catch (reason) {
871+ setError(reason instanceof Error ? reason.message : 'Agent deletion failed');
872+ } finally {
873+ setWorking('');
874+ }
875+ };
876+
854877 return (
855878 <div className="workspacePage">
856879 <header className="workspaceHead">
@@ -1176,6 +1199,16 @@
11761199 </ol>
11771200 )}
11781201 </section>
1202+ <div className="agentActions agentManagementActions">
1203+ <button
1204+ className="secondary dangerButton"
1205+ type="button"
1206+ disabled={Boolean(working)}
1207+ onClick={() => void deleteAgent(agent)}
1208+ >
1209+ {working === `delete:${agentId}` ? 'Deleting…' : 'Delete agent'}
1210+ </button>
1211+ </div>
11791212 </div>
11801213 ) : null}
11811214 </article>
@@ -2794,12 +2827,7 @@
27942827 };
27952828 const deleteAgent = async (agent: Record<string, any>) => {
27962829 const agentId = String(agent.agentId);
2797- if (
2798- !window.confirm(
2799- `Delete “${String(agent.name ?? agentId)}”?\n\nIts runtime, publication, presence and MCP binding will be removed. Signed interaction and receipt history will be retained.`,
2800- )
2801- )
2802- return;
2830+ if (!confirmAgentDeletion(agent)) return;
28032831 setWorking(`delete:${agentId}`);
28042832 setError('');
28052833 try {