( wsId: string, agent: AgentId, cfg: AgentConfig, )
| 677 | } |
| 678 | |
| 679 | export async function saveAgentConfig( |
| 680 | wsId: string, |
| 681 | agent: AgentId, |
| 682 | cfg: AgentConfig, |
| 683 | ): Promise<void> { |
| 684 | const res = await fetch( |
| 685 | `/api/workspaces/${encodeURIComponent(wsId)}/agent-config/${agent}`, |
| 686 | { |
| 687 | method: 'PUT', |
| 688 | headers: { 'content-type': 'application/json' }, |
| 689 | body: JSON.stringify(cfg), |
| 690 | }, |
| 691 | ); |
| 692 | if (!res.ok) { |
| 693 | const msg = await res.text().catch(() => ''); |
| 694 | throw new Error(`save agent config failed: ${res.status} ${msg}`); |
| 695 | } |
| 696 | } |
| 697 | |
| 698 | export interface AgentTestResult { |
| 699 | readonly ok: boolean; |
no test coverage detected