Function
testAgentConfig
(
wsId: string,
agent: AgentId,
cfg: AgentTestInput,
)
Source from the content-addressed store, hash-verified
| 714 | } |
| 715 | |
| 716 | export async function testAgentConfig( |
| 717 | wsId: string, |
| 718 | agent: AgentId, |
| 719 | cfg: AgentTestInput, |
| 720 | ): Promise<AgentTestResult> { |
| 721 | const res = await fetch( |
| 722 | `/api/workspaces/${encodeURIComponent(wsId)}/agent-config/${agent}/test`, |
| 723 | { |
| 724 | method: 'POST', |
| 725 | headers: { 'content-type': 'application/json' }, |
| 726 | body: JSON.stringify(cfg), |
| 727 | }, |
| 728 | ); |
| 729 | try { |
| 730 | return (await res.json()) as AgentTestResult; |
| 731 | } catch { |
| 732 | return { ok: false, error: `HTTP ${res.status}` }; |
| 733 | } |
| 734 | } |
Tested by
no test coverage detected