File size: 987 Bytes
4e7644b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { request } from "../request";
import type {
  ACPAgentConfig,
  ACPConfig,
  ACPNodeRuntimeStatus,
  ACPNodeRuntimeUpdate,
} from "../types";

export const acpApi = {
  getACPConfig: () => request<ACPConfig>("/config/acp"),

  getACPNodeRuntime: () =>
    request<ACPNodeRuntimeStatus>("/config/acp/node-runtime"),

  getACPAgentConfig: (agentName: string) =>
    request<ACPAgentConfig>(`/config/acp/${encodeURIComponent(agentName)}`),

  updateACPConfig: (body: ACPConfig) =>
    request<ACPConfig>("/config/acp", {
      method: "PUT",
      body: JSON.stringify(body),
    }),

  updateACPNodeRuntime: (body: ACPNodeRuntimeUpdate) =>
    request<ACPNodeRuntimeStatus>("/config/acp/node-runtime", {
      method: "PUT",
      body: JSON.stringify(body),
    }),

  updateACPAgentConfig: (agentName: string, body: ACPAgentConfig) =>
    request<ACPAgentConfig>(`/config/acp/${encodeURIComponent(agentName)}`, {
      method: "PUT",
      body: JSON.stringify(body),
    }),
};