MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / saveAgentConfig

Function saveAgentConfig

ui/src/components/workspace/api.ts:679–696  ·  view source on GitHub ↗
(
  wsId: string,
  agent: AgentId,
  cfg: AgentConfig,
)

Source from the content-addressed store, hash-verified

677}
678
679export 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
698export interface AgentTestResult {
699 readonly ok: boolean;

Callers 2

handleSaveFunction · 0.90
handleResetFunction · 0.90

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected