@ragwalla/agents-sdk 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/dist/client/http-client.d.ts.map +1 -1
- package/dist/client/http-client.js +3 -1
- package/dist/client/http-client.js.map +1 -1
- package/dist/client/websocket-client.d.ts +5 -1
- package/dist/client/websocket-client.d.ts.map +1 -1
- package/dist/client/websocket-client.js +18 -3
- package/dist/client/websocket-client.js.map +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -36
- package/dist/index.js.map +1 -1
- package/dist/resources/agents.d.ts +84 -6
- package/dist/resources/agents.d.ts.map +1 -1
- package/dist/resources/agents.js +90 -6
- package/dist/resources/agents.js.map +1 -1
- package/dist/resources/assistants.d.ts +32 -0
- package/dist/resources/assistants.d.ts.map +1 -0
- package/dist/resources/assistants.js +128 -0
- package/dist/resources/assistants.js.map +1 -0
- package/dist/resources/channels.d.ts +33 -0
- package/dist/resources/channels.d.ts.map +1 -0
- package/dist/resources/channels.js +39 -0
- package/dist/resources/channels.js.map +1 -0
- package/dist/resources/mcp-servers.d.ts +55 -0
- package/dist/resources/mcp-servers.d.ts.map +1 -0
- package/dist/resources/mcp-servers.js +63 -0
- package/dist/resources/mcp-servers.js.map +1 -0
- package/dist/resources/models.d.ts +11 -0
- package/dist/resources/models.d.ts.map +1 -0
- package/dist/resources/models.js +13 -0
- package/dist/resources/models.js.map +1 -0
- package/dist/resources/organizations.d.ts +40 -0
- package/dist/resources/organizations.d.ts.map +1 -0
- package/dist/resources/organizations.js +51 -0
- package/dist/resources/organizations.js.map +1 -0
- package/dist/resources/skills.d.ts +39 -0
- package/dist/resources/skills.d.ts.map +1 -0
- package/dist/resources/skills.js +45 -0
- package/dist/resources/skills.js.map +1 -0
- package/dist/resources/threads.d.ts +51 -0
- package/dist/resources/threads.d.ts.map +1 -0
- package/dist/resources/threads.js +31 -0
- package/dist/resources/threads.js.map +1 -0
- package/dist/resources/workspace-files.d.ts +35 -0
- package/dist/resources/workspace-files.d.ts.map +1 -0
- package/dist/resources/workspace-files.js +43 -0
- package/dist/resources/workspace-files.js.map +1 -0
- package/dist/types/index.d.ts +492 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/workers.d.ts +12 -0
- package/dist/workers.d.ts.map +1 -1
- package/dist/workers.js +16 -0
- package/dist/workers.js.map +1 -1
- package/package.json +2 -1
package/dist/resources/agents.js
CHANGED
|
@@ -3,6 +3,12 @@ export class AgentsResource {
|
|
|
3
3
|
constructor(client) {
|
|
4
4
|
this.client = client;
|
|
5
5
|
}
|
|
6
|
+
unwrapToolResponse(response) {
|
|
7
|
+
if (response && typeof response === 'object' && 'tool' in response && response.tool) {
|
|
8
|
+
return response.tool;
|
|
9
|
+
}
|
|
10
|
+
return response;
|
|
11
|
+
}
|
|
6
12
|
/**
|
|
7
13
|
* Create a new agent
|
|
8
14
|
*/
|
|
@@ -42,22 +48,100 @@ export class AgentsResource {
|
|
|
42
48
|
return this.client.post('/v1/agents/auth/websocket', params);
|
|
43
49
|
}
|
|
44
50
|
/**
|
|
45
|
-
* List
|
|
51
|
+
* List skills attached to an agent
|
|
46
52
|
*/
|
|
47
|
-
async
|
|
53
|
+
async listSkills(agentId, params) {
|
|
48
54
|
return this.client.get(`/v1/agents/${agentId}/tools`, params);
|
|
49
55
|
}
|
|
56
|
+
/** @deprecated Use listSkills() instead */
|
|
57
|
+
async listTools(agentId, params) {
|
|
58
|
+
return this.listSkills(agentId, params);
|
|
59
|
+
}
|
|
50
60
|
/**
|
|
51
|
-
* Attach a
|
|
61
|
+
* Attach a skill to an agent
|
|
52
62
|
*/
|
|
63
|
+
async attachSkill(agentId, skill) {
|
|
64
|
+
const response = await this.client.post(`/v1/agents/${agentId}/tools`, skill);
|
|
65
|
+
return this.unwrapToolResponse(response);
|
|
66
|
+
}
|
|
67
|
+
/** @deprecated Use attachSkill() instead */
|
|
53
68
|
async attachTool(agentId, tool) {
|
|
54
|
-
return this.
|
|
69
|
+
return this.attachSkill(agentId, tool);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Update an existing skill on an agent
|
|
73
|
+
*/
|
|
74
|
+
async updateSkill(agentId, skillId, updates) {
|
|
75
|
+
const response = await this.client.put(`/v1/agents/${agentId}/tools/${skillId}`, updates);
|
|
76
|
+
return this.unwrapToolResponse(response);
|
|
77
|
+
}
|
|
78
|
+
/** @deprecated Use updateSkill() instead */
|
|
79
|
+
async updateTool(agentId, toolId, updates) {
|
|
80
|
+
return this.updateSkill(agentId, toolId, updates);
|
|
55
81
|
}
|
|
56
82
|
/**
|
|
57
|
-
* Remove a
|
|
83
|
+
* Remove a skill from an agent
|
|
58
84
|
*/
|
|
85
|
+
async detachSkill(agentId, skillId) {
|
|
86
|
+
return this.client.delete(`/v1/agents/${agentId}/tools/${skillId}`);
|
|
87
|
+
}
|
|
88
|
+
/** @deprecated Use detachSkill() instead */
|
|
59
89
|
async detachTool(agentId, toolId) {
|
|
60
|
-
return this.
|
|
90
|
+
return this.detachSkill(agentId, toolId);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* List available system skills that can be enabled for agents
|
|
94
|
+
*/
|
|
95
|
+
async listSystemSkills() {
|
|
96
|
+
return this.client.get('/v1/system-skills');
|
|
97
|
+
}
|
|
98
|
+
/** @deprecated Use listSystemSkills() instead */
|
|
99
|
+
async listSystemTools() {
|
|
100
|
+
return this.listSystemSkills();
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Enable a system skill for an agent
|
|
104
|
+
*/
|
|
105
|
+
async enableSystemSkill(agentId, skillId) {
|
|
106
|
+
const response = await this.client.post(`/v1/agents/${agentId}/tools/enable-system`, { toolId: skillId });
|
|
107
|
+
return this.unwrapToolResponse(response);
|
|
108
|
+
}
|
|
109
|
+
/** @deprecated Use enableSystemSkill() instead */
|
|
110
|
+
async enableSystemTool(agentId, toolId) {
|
|
111
|
+
return this.enableSystemSkill(agentId, toolId);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Grant delegation permission: allow this agent to delegate to targetAgentId
|
|
115
|
+
*/
|
|
116
|
+
async grantDelegationPermission(agentId, targetAgentId, targetAgentName) {
|
|
117
|
+
return this.client.post(`/v1/agents/${agentId}/delegation-permissions`, {
|
|
118
|
+
targetAgentId,
|
|
119
|
+
targetAgentName,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Revoke delegation permission
|
|
124
|
+
*/
|
|
125
|
+
async revokeDelegationPermission(agentId, targetAgentId) {
|
|
126
|
+
return this.client.delete(`/v1/agents/${agentId}/delegation-permissions/${targetAgentId}`);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* List active child agents (subagents) for an orchestrator agent
|
|
130
|
+
*/
|
|
131
|
+
async listChildren(agentId) {
|
|
132
|
+
return this.client.get(`/v1/agents/${agentId}/children`);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Tear down a specific child agent
|
|
136
|
+
*/
|
|
137
|
+
async teardownChild(agentId, childAgentId) {
|
|
138
|
+
return this.client.delete(`/v1/agents/${agentId}/children/${childAgentId}`);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Tear down all ephemeral child agents for an orchestrator agent
|
|
142
|
+
*/
|
|
143
|
+
async teardownAllChildren(agentId) {
|
|
144
|
+
return this.client.post(`/v1/agents/${agentId}/children/teardown-all`);
|
|
61
145
|
}
|
|
62
146
|
}
|
|
63
147
|
//# sourceMappingURL=agents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/resources/agents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/resources/agents.ts"],"names":[],"mappings":"AAYA,MAAM,OAAO,cAAc;IACL;IAApB,YAAoB,MAAkB;QAAlB,WAAM,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;IACH,KAAK,CAAC,aAAa,CACjB,OAAe,EACf,YAAoB;QAEpB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CACvB,cAAc,OAAO,aAAa,YAAY,EAAE,CACjD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CACvB,OAAe;QAEf,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,cAAc,OAAO,wBAAwB,CAC9C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HTTPClient } from '../client/http-client';
|
|
2
|
+
import { Assistant, AssistantDeleted, AssistantList, CreateAssistantRequest, UpdateAssistantRequest } from '../types';
|
|
3
|
+
export declare class AssistantsResource {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HTTPClient);
|
|
6
|
+
/**
|
|
7
|
+
* Create a new assistant
|
|
8
|
+
*/
|
|
9
|
+
create(request: CreateAssistantRequest): Promise<Assistant>;
|
|
10
|
+
/**
|
|
11
|
+
* Retrieve an assistant by ID
|
|
12
|
+
*/
|
|
13
|
+
retrieve(assistantId: string): Promise<Assistant>;
|
|
14
|
+
/**
|
|
15
|
+
* List assistants
|
|
16
|
+
*/
|
|
17
|
+
list(params?: {
|
|
18
|
+
limit?: number;
|
|
19
|
+
order?: 'asc' | 'desc';
|
|
20
|
+
after?: string;
|
|
21
|
+
before?: string;
|
|
22
|
+
}): Promise<AssistantList>;
|
|
23
|
+
/**
|
|
24
|
+
* Update an assistant
|
|
25
|
+
*/
|
|
26
|
+
update(assistantId: string, request: UpdateAssistantRequest): Promise<Assistant>;
|
|
27
|
+
/**
|
|
28
|
+
* Delete an assistant
|
|
29
|
+
*/
|
|
30
|
+
delete(assistantId: string): Promise<AssistantDeleted>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=assistants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistants.d.ts","sourceRoot":"","sources":["../../src/resources/assistants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,SAAS,EAET,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAgFlB,qBAAa,kBAAkB;IACjB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC;IAuBjE;;OAEG;IACG,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIvD;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,aAAa,CAAC;IAI1B;;OAEG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC;IAiBtF;;OAEG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAG7D"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
const ASSISTANT_CONFIG_KEYS = [
|
|
2
|
+
'model',
|
|
3
|
+
'embedding_settings',
|
|
4
|
+
'instructions',
|
|
5
|
+
'tools',
|
|
6
|
+
'tool_resources',
|
|
7
|
+
'metadata',
|
|
8
|
+
'temperature',
|
|
9
|
+
'top_p',
|
|
10
|
+
'response_format',
|
|
11
|
+
];
|
|
12
|
+
const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
|
13
|
+
const extractConfig = (request) => {
|
|
14
|
+
const config = {};
|
|
15
|
+
let hasAny = false;
|
|
16
|
+
for (const key of ASSISTANT_CONFIG_KEYS) {
|
|
17
|
+
if (hasOwn(request, key) && request[key] !== undefined) {
|
|
18
|
+
config[key] = request[key];
|
|
19
|
+
hasAny = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return hasAny ? config : undefined;
|
|
23
|
+
};
|
|
24
|
+
const normalizeCreateRequest = (request) => {
|
|
25
|
+
const raw = request;
|
|
26
|
+
const name = raw.name;
|
|
27
|
+
const description = raw.description;
|
|
28
|
+
const status = raw.status;
|
|
29
|
+
const resourceType = raw.resource_type || 'assistant';
|
|
30
|
+
const explicitConfig = raw.config;
|
|
31
|
+
const flatConfig = extractConfig(raw);
|
|
32
|
+
const config = explicitConfig ? { ...explicitConfig, ...(flatConfig || {}) } : (flatConfig || {});
|
|
33
|
+
const body = {
|
|
34
|
+
name,
|
|
35
|
+
description,
|
|
36
|
+
resource_type: resourceType,
|
|
37
|
+
config,
|
|
38
|
+
status
|
|
39
|
+
};
|
|
40
|
+
if (raw.project_id) {
|
|
41
|
+
body.project_id = raw.project_id;
|
|
42
|
+
}
|
|
43
|
+
return body;
|
|
44
|
+
};
|
|
45
|
+
const normalizeUpdateRequest = (request) => {
|
|
46
|
+
const raw = request;
|
|
47
|
+
const name = raw.name;
|
|
48
|
+
const description = raw.description;
|
|
49
|
+
const status = raw.status;
|
|
50
|
+
const resourceType = raw.resource_type;
|
|
51
|
+
const explicitConfig = raw.config;
|
|
52
|
+
const flatConfig = extractConfig(raw);
|
|
53
|
+
const config = explicitConfig ? { ...explicitConfig, ...(flatConfig || {}) } : flatConfig;
|
|
54
|
+
const body = {};
|
|
55
|
+
if (name !== undefined)
|
|
56
|
+
body.name = name;
|
|
57
|
+
if (description !== undefined)
|
|
58
|
+
body.description = description;
|
|
59
|
+
if (status !== undefined)
|
|
60
|
+
body.status = status;
|
|
61
|
+
if (resourceType !== undefined)
|
|
62
|
+
body.resource_type = resourceType;
|
|
63
|
+
if (config !== undefined)
|
|
64
|
+
body.config = config;
|
|
65
|
+
return body;
|
|
66
|
+
};
|
|
67
|
+
export class AssistantsResource {
|
|
68
|
+
client;
|
|
69
|
+
constructor(client) {
|
|
70
|
+
this.client = client;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Create a new assistant
|
|
74
|
+
*/
|
|
75
|
+
async create(request) {
|
|
76
|
+
const body = normalizeCreateRequest(request);
|
|
77
|
+
const response = await this.client.post('/v1/assistants', body);
|
|
78
|
+
// OpenAI-compatible format: { object: 'assistant', id: '...' }
|
|
79
|
+
if (response && response.object === 'assistant' && response.id) {
|
|
80
|
+
return response;
|
|
81
|
+
}
|
|
82
|
+
// Ragwalla format: { success: true, data: { id: '...', ... } }
|
|
83
|
+
if (response?.success && response?.data?.id) {
|
|
84
|
+
return response.data;
|
|
85
|
+
}
|
|
86
|
+
// Fallback: extract ID from wherever it lives
|
|
87
|
+
const assistantId = response?.id ?? response?.data?.id;
|
|
88
|
+
if (!assistantId) {
|
|
89
|
+
throw new Error('Assistant creation succeeded but no assistant id was returned.');
|
|
90
|
+
}
|
|
91
|
+
return this.retrieve(assistantId);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Retrieve an assistant by ID
|
|
95
|
+
*/
|
|
96
|
+
async retrieve(assistantId) {
|
|
97
|
+
return this.client.get(`/v1/assistants/${assistantId}`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* List assistants
|
|
101
|
+
*/
|
|
102
|
+
async list(params) {
|
|
103
|
+
return this.client.get('/v1/assistants', params);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Update an assistant
|
|
107
|
+
*/
|
|
108
|
+
async update(assistantId, request) {
|
|
109
|
+
const body = normalizeUpdateRequest(request);
|
|
110
|
+
const response = await this.client.post(`/v1/assistants/${assistantId}`, body);
|
|
111
|
+
// OpenAI-compatible format
|
|
112
|
+
if (response && response.object === 'assistant' && response.id) {
|
|
113
|
+
return response;
|
|
114
|
+
}
|
|
115
|
+
// Ragwalla format: { success: true, data: { ... } }
|
|
116
|
+
if (response?.success && response?.data) {
|
|
117
|
+
return response.data;
|
|
118
|
+
}
|
|
119
|
+
return this.retrieve(assistantId);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Delete an assistant
|
|
123
|
+
*/
|
|
124
|
+
async delete(assistantId) {
|
|
125
|
+
return this.client.delete(`/v1/assistants/${assistantId}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=assistants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistants.js","sourceRoot":"","sources":["../../src/resources/assistants.ts"],"names":[],"mappings":"AAUA,MAAM,qBAAqB,GAAG;IAC5B,OAAO;IACP,oBAAoB;IACpB,cAAc;IACd,OAAO;IACP,gBAAgB;IAChB,UAAU;IACV,aAAa;IACb,OAAO;IACP,iBAAiB;CACT,CAAC;AAIX,MAAM,MAAM,GAAG,CAAC,GAAwB,EAAE,GAAW,EAAE,EAAE,CACvD,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAEjD,MAAM,aAAa,GAAG,CAAC,OAA4B,EAAwC,EAAE;IAC3F,MAAM,MAAM,GAA6B,EAAE,CAAC;IAC5C,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,KAAK,MAAM,GAAG,IAAI,qBAAqB,EAAE,CAAC;QACxC,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YACtD,MAA0C,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;YAChE,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,sBAAsB,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
import { HTTPClient } from '../client/http-client';
|
|
2
|
+
import { Channel, CreateChannelRequest, CreateChannelResponse, ChannelStatus, WebhookRetryResponse } from '../types';
|
|
3
|
+
export declare class ChannelsResource {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HTTPClient);
|
|
6
|
+
/**
|
|
7
|
+
* Configure a channel for an agent (e.g. Telegram, Slack, WhatsApp).
|
|
8
|
+
* If a channel of the same type already exists for the agent, it will be updated.
|
|
9
|
+
*/
|
|
10
|
+
create(agentId: string, request: CreateChannelRequest): Promise<CreateChannelResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* List all channels configured for an agent
|
|
13
|
+
*/
|
|
14
|
+
list(agentId: string): Promise<{
|
|
15
|
+
channels: Channel[];
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Delete a channel from an agent.
|
|
19
|
+
* For Telegram channels, this also unregisters the webhook.
|
|
20
|
+
*/
|
|
21
|
+
delete(agentId: string, channelId: string): Promise<{
|
|
22
|
+
deleted: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Get detailed status of a channel, including live webhook status for Telegram
|
|
26
|
+
*/
|
|
27
|
+
getStatus(agentId: string, channelId: string): Promise<ChannelStatus>;
|
|
28
|
+
/**
|
|
29
|
+
* Retry webhook registration for a failed Telegram channel
|
|
30
|
+
*/
|
|
31
|
+
retryWebhook(agentId: string, channelId: string): Promise<WebhookRetryResponse>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=channels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/resources/channels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAElB,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI5F;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;IAI7D;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAI/E;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAI3E;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAGtF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export class ChannelsResource {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Configure a channel for an agent (e.g. Telegram, Slack, WhatsApp).
|
|
8
|
+
* If a channel of the same type already exists for the agent, it will be updated.
|
|
9
|
+
*/
|
|
10
|
+
async create(agentId, request) {
|
|
11
|
+
return this.client.post(`/v1/agents/${agentId}/channels`, request);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* List all channels configured for an agent
|
|
15
|
+
*/
|
|
16
|
+
async list(agentId) {
|
|
17
|
+
return this.client.get(`/v1/agents/${agentId}/channels`);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Delete a channel from an agent.
|
|
21
|
+
* For Telegram channels, this also unregisters the webhook.
|
|
22
|
+
*/
|
|
23
|
+
async delete(agentId, channelId) {
|
|
24
|
+
return this.client.delete(`/v1/agents/${agentId}/channels/${channelId}`);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get detailed status of a channel, including live webhook status for Telegram
|
|
28
|
+
*/
|
|
29
|
+
async getStatus(agentId, channelId) {
|
|
30
|
+
return this.client.get(`/v1/agents/${agentId}/channels/${channelId}/status`);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Retry webhook registration for a failed Telegram channel
|
|
34
|
+
*/
|
|
35
|
+
async retryWebhook(agentId, channelId) {
|
|
36
|
+
return this.client.post(`/v1/agents/${agentId}/channels/${channelId}/webhook/retry`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=channels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/resources/channels.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,gBAAgB;IACP;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAwB,cAAc,OAAO,WAAW,EAAE,OAAO,CAAC,CAAC;IAC5F,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,OAAe;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA0B,cAAc,OAAO,WAAW,CAAC,CAAC;IACpF,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,SAAiB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAuB,cAAc,OAAO,aAAa,SAAS,EAAE,CAAC,CAAC;IACjG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,OAAe,EAAE,SAAiB;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,cAAc,OAAO,aAAa,SAAS,SAAS,CAAC,CAAC;IAC9F,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,OAAe,EAAE,SAAiB;QACnD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAuB,cAAc,OAAO,aAAa,SAAS,gBAAgB,CAAC,CAAC;IAC7G,CAAC;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { HTTPClient } from '../client/http-client';
|
|
2
|
+
import { MCPServer, CreateMCPServerRequest, UpdateMCPServerRequest, TestMCPServerRequest, MCPDiscoverResponse, MCPTestResponse, MCPAgentAccess, GrantAgentAccessRequest } from '../types';
|
|
3
|
+
export declare class MCPServersResource {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HTTPClient);
|
|
6
|
+
/**
|
|
7
|
+
* Create a new MCP server configuration
|
|
8
|
+
*/
|
|
9
|
+
create(request: CreateMCPServerRequest): Promise<MCPServer>;
|
|
10
|
+
/**
|
|
11
|
+
* List all MCP servers for the project
|
|
12
|
+
*/
|
|
13
|
+
list(): Promise<{
|
|
14
|
+
servers: MCPServer[];
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve a specific MCP server by ID
|
|
18
|
+
*/
|
|
19
|
+
retrieve(serverId: string): Promise<MCPServer>;
|
|
20
|
+
/**
|
|
21
|
+
* Update an MCP server configuration
|
|
22
|
+
*/
|
|
23
|
+
update(serverId: string, request: UpdateMCPServerRequest): Promise<{
|
|
24
|
+
success: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Delete an MCP server
|
|
28
|
+
*/
|
|
29
|
+
delete(serverId: string): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Discover tools available on an MCP server.
|
|
34
|
+
* Connects to the server, lists tools, and caches the results.
|
|
35
|
+
*/
|
|
36
|
+
discoverTools(serverId: string): Promise<MCPDiscoverResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Test an MCP server connection without saving it.
|
|
39
|
+
* Useful for validating server configuration before creating.
|
|
40
|
+
*/
|
|
41
|
+
test(request: TestMCPServerRequest): Promise<MCPTestResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Grant or revoke an agent's access to an MCP server
|
|
44
|
+
*/
|
|
45
|
+
grantAgentAccess(serverId: string, request: GrantAgentAccessRequest): Promise<{
|
|
46
|
+
success: boolean;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* List agents that have access to an MCP server
|
|
50
|
+
*/
|
|
51
|
+
listAgentAccess(serverId: string): Promise<{
|
|
52
|
+
access: MCPAgentAccess[];
|
|
53
|
+
}>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=mcp-servers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-servers.d.ts","sourceRoot":"","sources":["../../src/resources/mcp-servers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,uBAAuB,EACxB,MAAM,UAAU,CAAC;AAElB,qBAAa,kBAAkB;IACjB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC;IAIjE;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,SAAS,EAAE,CAAA;KAAE,CAAC;IAI/C;;OAEG;IACG,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIpD;;OAEG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAI9F;;OAEG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAI7D;;;OAGG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAInE;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAInE;;OAEG;IACG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAIzG;;OAEG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;CAG/E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export class MCPServersResource {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Create a new MCP server configuration
|
|
8
|
+
*/
|
|
9
|
+
async create(request) {
|
|
10
|
+
return this.client.post('/v1/mcp-servers', request);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* List all MCP servers for the project
|
|
14
|
+
*/
|
|
15
|
+
async list() {
|
|
16
|
+
return this.client.get('/v1/mcp-servers');
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve a specific MCP server by ID
|
|
20
|
+
*/
|
|
21
|
+
async retrieve(serverId) {
|
|
22
|
+
return this.client.get(`/v1/mcp-servers/${serverId}`);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update an MCP server configuration
|
|
26
|
+
*/
|
|
27
|
+
async update(serverId, request) {
|
|
28
|
+
return this.client.put(`/v1/mcp-servers/${serverId}`, request);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Delete an MCP server
|
|
32
|
+
*/
|
|
33
|
+
async delete(serverId) {
|
|
34
|
+
return this.client.delete(`/v1/mcp-servers/${serverId}`);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Discover tools available on an MCP server.
|
|
38
|
+
* Connects to the server, lists tools, and caches the results.
|
|
39
|
+
*/
|
|
40
|
+
async discoverTools(serverId) {
|
|
41
|
+
return this.client.post(`/v1/mcp-servers/${serverId}/discover`);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Test an MCP server connection without saving it.
|
|
45
|
+
* Useful for validating server configuration before creating.
|
|
46
|
+
*/
|
|
47
|
+
async test(request) {
|
|
48
|
+
return this.client.post('/v1/mcp-servers/test', request);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Grant or revoke an agent's access to an MCP server
|
|
52
|
+
*/
|
|
53
|
+
async grantAgentAccess(serverId, request) {
|
|
54
|
+
return this.client.post(`/v1/mcp-servers/${serverId}/access`, request);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* List agents that have access to an MCP server
|
|
58
|
+
*/
|
|
59
|
+
async listAgentAccess(serverId) {
|
|
60
|
+
return this.client.get(`/v1/mcp-servers/${serverId}/access`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=mcp-servers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-servers.js","sourceRoot":"","sources":["../../src/resources/mcp-servers.ts"],"names":[],"mappings":"AAYA,MAAM,OAAO,kBAAkB;IACT;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,OAA+B;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAY,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH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|
|
2
|
+
import { ModelsListResponse } from '../types';
|
|
3
|
+
export declare class ModelsResource {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HTTPClient);
|
|
6
|
+
/**
|
|
7
|
+
* List available AI models
|
|
8
|
+
*/
|
|
9
|
+
list(): Promise<ModelsListResponse>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/resources/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,kBAAkB,CAAC;CAG1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/resources/models.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IACL;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAqB,YAAY,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { HTTPClient } from '../client/http-client';
|
|
2
|
+
import { OrganizationList, Project, ProjectList, CreateProjectRequest, UpdateProjectRequest } from '../types';
|
|
3
|
+
declare class ProjectsResource {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HTTPClient);
|
|
6
|
+
/**
|
|
7
|
+
* Create a new project within an organization
|
|
8
|
+
*/
|
|
9
|
+
create(orgId: string, request: CreateProjectRequest): Promise<Project>;
|
|
10
|
+
/**
|
|
11
|
+
* List projects within an organization
|
|
12
|
+
*/
|
|
13
|
+
list(orgId: string, params?: {
|
|
14
|
+
limit?: number;
|
|
15
|
+
after?: string;
|
|
16
|
+
}): Promise<ProjectList>;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve a project by ID
|
|
19
|
+
*/
|
|
20
|
+
retrieve(orgId: string, projectId: string): Promise<Project>;
|
|
21
|
+
/**
|
|
22
|
+
* Update a project
|
|
23
|
+
*/
|
|
24
|
+
update(orgId: string, projectId: string, request: UpdateProjectRequest): Promise<Project>;
|
|
25
|
+
/**
|
|
26
|
+
* Archive a project
|
|
27
|
+
*/
|
|
28
|
+
archive(orgId: string, projectId: string): Promise<Project>;
|
|
29
|
+
}
|
|
30
|
+
export declare class OrganizationsResource {
|
|
31
|
+
private client;
|
|
32
|
+
readonly projects: ProjectsResource;
|
|
33
|
+
constructor(client: HTTPClient);
|
|
34
|
+
/**
|
|
35
|
+
* List all organizations accessible to the current API key
|
|
36
|
+
*/
|
|
37
|
+
list(): Promise<OrganizationList>;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=organizations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/resources/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAEL,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAElB,cAAM,gBAAgB;IACR,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5E;;OAEG;IACG,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QACjC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,WAAW,CAAC;IAIxB;;OAEG;IACG,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlE;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/F;;OAEG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlE;AAED,qBAAa,qBAAqB;IAGpB,OAAO,CAAC,MAAM;IAF1B,SAAgB,QAAQ,EAAE,gBAAgB,CAAC;gBAEvB,MAAM,EAAE,UAAU;IAItC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAGxC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
class ProjectsResource {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Create a new project within an organization
|
|
8
|
+
*/
|
|
9
|
+
async create(orgId, request) {
|
|
10
|
+
return this.client.post(`/v1/organizations/${orgId}/projects`, request);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* List projects within an organization
|
|
14
|
+
*/
|
|
15
|
+
async list(orgId, params) {
|
|
16
|
+
return this.client.get(`/v1/organizations/${orgId}/projects`, params);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve a project by ID
|
|
20
|
+
*/
|
|
21
|
+
async retrieve(orgId, projectId) {
|
|
22
|
+
return this.client.get(`/v1/organizations/${orgId}/projects/${projectId}`);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update a project
|
|
26
|
+
*/
|
|
27
|
+
async update(orgId, projectId, request) {
|
|
28
|
+
return this.client.post(`/v1/organizations/${orgId}/projects/${projectId}`, request);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Archive a project
|
|
32
|
+
*/
|
|
33
|
+
async archive(orgId, projectId) {
|
|
34
|
+
return this.client.post(`/v1/organizations/${orgId}/projects/${projectId}/archive`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export class OrganizationsResource {
|
|
38
|
+
client;
|
|
39
|
+
projects;
|
|
40
|
+
constructor(client) {
|
|
41
|
+
this.client = client;
|
|
42
|
+
this.projects = new ProjectsResource(client);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* List all organizations accessible to the current API key
|
|
46
|
+
*/
|
|
47
|
+
async list() {
|
|
48
|
+
return this.client.get('/v1/organizations');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=organizations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../src/resources/organizations.ts"],"names":[],"mappings":"AAUA,MAAM,gBAAgB;IACA;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,OAA6B;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,qBAAqB,KAAK,WAAW,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,KAAa,EAAE,MAGzB;QACC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc,qBAAqB,KAAK,WAAW,EAAE,MAAM,CAAC,CAAC;IACrF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,KAAa,EAAE,SAAiB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,qBAAqB,KAAK,aAAa,SAAS,EAAE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