@172ai/containers-mcp-server 1.0.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/.env.example +43 -0
- package/README.md +366 -0
- package/dist/auth.d.ts +57 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +192 -0
- package/dist/auth.js.map +1 -0
- package/dist/config.d.ts +84 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +246 -0
- package/dist/config.js.map +1 -0
- package/dist/server.d.ts +63 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +886 -0
- package/dist/server.js.map +1 -0
- package/dist/services/buildService.d.ts +51 -0
- package/dist/services/buildService.d.ts.map +1 -0
- package/dist/services/buildService.js +268 -0
- package/dist/services/buildService.js.map +1 -0
- package/dist/services/capabilityService.d.ts +62 -0
- package/dist/services/capabilityService.d.ts.map +1 -0
- package/dist/services/capabilityService.js +240 -0
- package/dist/services/capabilityService.js.map +1 -0
- package/dist/services/containerService.d.ts +52 -0
- package/dist/services/containerService.d.ts.map +1 -0
- package/dist/services/containerService.js +251 -0
- package/dist/services/containerService.js.map +1 -0
- package/dist/services/fileService.d.ts +65 -0
- package/dist/services/fileService.d.ts.map +1 -0
- package/dist/services/fileService.js +330 -0
- package/dist/services/fileService.js.map +1 -0
- package/dist/setup.d.ts +30 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +328 -0
- package/dist/setup.js.map +1 -0
- package/dist/types.d.ts +229 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/errorHandler.d.ts +78 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/errorHandler.js +269 -0
- package/dist/utils/errorHandler.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fileService = exports.FileService = void 0;
|
|
4
|
+
const auth_1 = require("../auth");
|
|
5
|
+
const errorHandler_1 = require("../utils/errorHandler");
|
|
6
|
+
/**
|
|
7
|
+
* File management service
|
|
8
|
+
*/
|
|
9
|
+
class FileService {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.httpClient = auth_1.authManager.getHttpClient();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* List files in a container
|
|
15
|
+
*/
|
|
16
|
+
async listContainerFiles(params) {
|
|
17
|
+
try {
|
|
18
|
+
if (!params.containerId) {
|
|
19
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
20
|
+
}
|
|
21
|
+
const queryParams = new URLSearchParams();
|
|
22
|
+
if (params.path) {
|
|
23
|
+
queryParams.append('path', params.path);
|
|
24
|
+
}
|
|
25
|
+
const response = await this.httpClient.get(`/v1/containers/${params.containerId}/files?${queryParams.toString()}`);
|
|
26
|
+
if (!response.data) {
|
|
27
|
+
throw errorHandler_1.ErrorHandler.createServerError('Invalid response format from files list API');
|
|
28
|
+
}
|
|
29
|
+
const data = response.data;
|
|
30
|
+
if (!Array.isArray(data.files)) {
|
|
31
|
+
throw errorHandler_1.ErrorHandler.createServerError('Invalid files array in response');
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
files: data.files,
|
|
35
|
+
total: data.total || data.files.length,
|
|
36
|
+
path: data.path || params.path || '/'
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error instanceof errorHandler_1.ApiError && error.status === 404) {
|
|
41
|
+
throw errorHandler_1.ErrorHandler.createNotFoundError(`Container ${params.containerId} not found`);
|
|
42
|
+
}
|
|
43
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.listContainerFiles');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get file content
|
|
48
|
+
*/
|
|
49
|
+
async getFileContent(params) {
|
|
50
|
+
try {
|
|
51
|
+
if (!params.containerId) {
|
|
52
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
53
|
+
}
|
|
54
|
+
if (!params.filePath) {
|
|
55
|
+
throw errorHandler_1.ErrorHandler.createValidationError('File path is required');
|
|
56
|
+
}
|
|
57
|
+
const encodedPath = encodeURIComponent(params.filePath);
|
|
58
|
+
const response = await this.httpClient.get(`/v1/containers/${params.containerId}/files/${encodedPath}`);
|
|
59
|
+
if (!response.data) {
|
|
60
|
+
throw errorHandler_1.ErrorHandler.createNotFoundError(`File ${params.filePath} not found`);
|
|
61
|
+
}
|
|
62
|
+
return response.data;
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
if (error instanceof errorHandler_1.ApiError && error.status === 404) {
|
|
66
|
+
throw errorHandler_1.ErrorHandler.createNotFoundError(`File ${params.filePath} not found in container ${params.containerId}`);
|
|
67
|
+
}
|
|
68
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.getFileContent');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Upload a file to a container
|
|
73
|
+
*/
|
|
74
|
+
async uploadFile(params) {
|
|
75
|
+
try {
|
|
76
|
+
if (!params.containerId) {
|
|
77
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
78
|
+
}
|
|
79
|
+
if (!params.filePath) {
|
|
80
|
+
throw errorHandler_1.ErrorHandler.createValidationError('File path is required');
|
|
81
|
+
}
|
|
82
|
+
if (!params.content) {
|
|
83
|
+
throw errorHandler_1.ErrorHandler.createValidationError('File content is required');
|
|
84
|
+
}
|
|
85
|
+
const uploadData = {
|
|
86
|
+
filePath: params.filePath,
|
|
87
|
+
content: params.content,
|
|
88
|
+
mimeType: params.mimeType || 'text/plain',
|
|
89
|
+
encoding: params.encoding || 'utf8'
|
|
90
|
+
};
|
|
91
|
+
const response = await this.httpClient.post(`/v1/containers/${params.containerId}/files`, uploadData);
|
|
92
|
+
if (!response.data) {
|
|
93
|
+
throw errorHandler_1.ErrorHandler.createServerError('Invalid response from file upload API');
|
|
94
|
+
}
|
|
95
|
+
return response.data;
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
if (error instanceof errorHandler_1.ApiError && error.status === 404) {
|
|
99
|
+
throw errorHandler_1.ErrorHandler.createNotFoundError(`Container ${params.containerId} not found`);
|
|
100
|
+
}
|
|
101
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.uploadFile');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Update file content
|
|
106
|
+
*/
|
|
107
|
+
async updateFile(params) {
|
|
108
|
+
try {
|
|
109
|
+
if (!params.containerId) {
|
|
110
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
111
|
+
}
|
|
112
|
+
if (!params.filePath) {
|
|
113
|
+
throw errorHandler_1.ErrorHandler.createValidationError('File path is required');
|
|
114
|
+
}
|
|
115
|
+
if (!params.content) {
|
|
116
|
+
throw errorHandler_1.ErrorHandler.createValidationError('File content is required');
|
|
117
|
+
}
|
|
118
|
+
const updateData = {
|
|
119
|
+
content: params.content,
|
|
120
|
+
mimeType: params.mimeType || 'text/plain',
|
|
121
|
+
encoding: params.encoding || 'utf8'
|
|
122
|
+
};
|
|
123
|
+
const encodedPath = encodeURIComponent(params.filePath);
|
|
124
|
+
const response = await this.httpClient.put(`/v1/containers/${params.containerId}/files/${encodedPath}`, updateData);
|
|
125
|
+
if (!response.data) {
|
|
126
|
+
throw errorHandler_1.ErrorHandler.createServerError('Invalid response from file update API');
|
|
127
|
+
}
|
|
128
|
+
return response.data;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
if (error instanceof errorHandler_1.ApiError && error.status === 404) {
|
|
132
|
+
throw errorHandler_1.ErrorHandler.createNotFoundError(`File ${params.filePath} not found in container ${params.containerId}`);
|
|
133
|
+
}
|
|
134
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.updateFile');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Delete a file from a container
|
|
139
|
+
*/
|
|
140
|
+
async deleteFile(containerId, filePath) {
|
|
141
|
+
try {
|
|
142
|
+
if (!containerId) {
|
|
143
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
144
|
+
}
|
|
145
|
+
if (!filePath) {
|
|
146
|
+
throw errorHandler_1.ErrorHandler.createValidationError('File path is required');
|
|
147
|
+
}
|
|
148
|
+
const encodedPath = encodeURIComponent(filePath);
|
|
149
|
+
await this.httpClient.delete(`/v1/containers/${containerId}/files/${encodedPath}`);
|
|
150
|
+
return {
|
|
151
|
+
success: true,
|
|
152
|
+
message: `File ${filePath} deleted successfully`
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
if (error instanceof errorHandler_1.ApiError && error.status === 404) {
|
|
157
|
+
throw errorHandler_1.ErrorHandler.createNotFoundError(`File ${filePath} not found in container ${containerId}`);
|
|
158
|
+
}
|
|
159
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.deleteFile');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Upload multiple files
|
|
164
|
+
*/
|
|
165
|
+
async uploadMultipleFiles(containerId, files) {
|
|
166
|
+
try {
|
|
167
|
+
if (!containerId) {
|
|
168
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
169
|
+
}
|
|
170
|
+
if (!files || files.length === 0) {
|
|
171
|
+
throw errorHandler_1.ErrorHandler.createValidationError('At least one file is required');
|
|
172
|
+
}
|
|
173
|
+
const uploadPromises = files.map(file => this.uploadFile({
|
|
174
|
+
containerId,
|
|
175
|
+
filePath: file.filePath,
|
|
176
|
+
content: file.content,
|
|
177
|
+
mimeType: file.mimeType,
|
|
178
|
+
encoding: file.encoding
|
|
179
|
+
}));
|
|
180
|
+
return await Promise.all(uploadPromises);
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.uploadMultipleFiles');
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Create a directory
|
|
188
|
+
*/
|
|
189
|
+
async createDirectory(containerId, dirPath) {
|
|
190
|
+
try {
|
|
191
|
+
if (!containerId) {
|
|
192
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
193
|
+
}
|
|
194
|
+
if (!dirPath) {
|
|
195
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Directory path is required');
|
|
196
|
+
}
|
|
197
|
+
const response = await this.httpClient.post(`/v1/containers/${containerId}/directories`, {
|
|
198
|
+
path: dirPath
|
|
199
|
+
});
|
|
200
|
+
if (!response.data) {
|
|
201
|
+
throw errorHandler_1.ErrorHandler.createServerError('Invalid response from directory creation API');
|
|
202
|
+
}
|
|
203
|
+
return response.data;
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
if (error instanceof errorHandler_1.ApiError && error.status === 404) {
|
|
207
|
+
throw errorHandler_1.ErrorHandler.createNotFoundError(`Container ${containerId} not found`);
|
|
208
|
+
}
|
|
209
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.createDirectory');
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Copy files between containers
|
|
214
|
+
*/
|
|
215
|
+
async copyFiles(sourceContainerId, targetContainerId, filePaths) {
|
|
216
|
+
try {
|
|
217
|
+
if (!sourceContainerId) {
|
|
218
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Source container ID is required');
|
|
219
|
+
}
|
|
220
|
+
if (!targetContainerId) {
|
|
221
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Target container ID is required');
|
|
222
|
+
}
|
|
223
|
+
if (!filePaths || filePaths.length === 0) {
|
|
224
|
+
throw errorHandler_1.ErrorHandler.createValidationError('At least one file path is required');
|
|
225
|
+
}
|
|
226
|
+
const response = await this.httpClient.post('/v1/files/copy', {
|
|
227
|
+
sourceContainerId,
|
|
228
|
+
targetContainerId,
|
|
229
|
+
filePaths
|
|
230
|
+
});
|
|
231
|
+
if (!response.data || !Array.isArray(response.data.files)) {
|
|
232
|
+
throw errorHandler_1.ErrorHandler.createServerError('Invalid response from file copy API');
|
|
233
|
+
}
|
|
234
|
+
return response.data.files;
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.copyFiles');
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Move files within a container
|
|
242
|
+
*/
|
|
243
|
+
async moveFiles(containerId, moves) {
|
|
244
|
+
try {
|
|
245
|
+
if (!containerId) {
|
|
246
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
247
|
+
}
|
|
248
|
+
if (!moves || moves.length === 0) {
|
|
249
|
+
throw errorHandler_1.ErrorHandler.createValidationError('At least one move operation is required');
|
|
250
|
+
}
|
|
251
|
+
const response = await this.httpClient.post(`/v1/containers/${containerId}/files/move`, {
|
|
252
|
+
moves
|
|
253
|
+
});
|
|
254
|
+
if (!response.data || !Array.isArray(response.data.files)) {
|
|
255
|
+
throw errorHandler_1.ErrorHandler.createServerError('Invalid response from file move API');
|
|
256
|
+
}
|
|
257
|
+
return response.data.files;
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
if (error instanceof errorHandler_1.ApiError && error.status === 404) {
|
|
261
|
+
throw errorHandler_1.ErrorHandler.createNotFoundError(`Container ${containerId} not found`);
|
|
262
|
+
}
|
|
263
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.moveFiles');
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Get file metadata without content
|
|
268
|
+
*/
|
|
269
|
+
async getFileMetadata(containerId, filePath) {
|
|
270
|
+
try {
|
|
271
|
+
if (!containerId) {
|
|
272
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
273
|
+
}
|
|
274
|
+
if (!filePath) {
|
|
275
|
+
throw errorHandler_1.ErrorHandler.createValidationError('File path is required');
|
|
276
|
+
}
|
|
277
|
+
const encodedPath = encodeURIComponent(filePath);
|
|
278
|
+
const response = await this.httpClient.head(`/v1/containers/${containerId}/files/${encodedPath}`);
|
|
279
|
+
// Extract metadata from headers
|
|
280
|
+
const headers = response.headers;
|
|
281
|
+
return {
|
|
282
|
+
name: filePath.split('/').pop() || '',
|
|
283
|
+
path: filePath,
|
|
284
|
+
size: headers['content-length'] ? parseInt(headers['content-length']) : undefined,
|
|
285
|
+
type: headers['x-file-type'] || 'file',
|
|
286
|
+
mimeType: headers['content-type'],
|
|
287
|
+
lastModified: headers['last-modified']
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
if (error instanceof errorHandler_1.ApiError && error.status === 404) {
|
|
292
|
+
throw errorHandler_1.ErrorHandler.createNotFoundError(`File ${filePath} not found in container ${containerId}`);
|
|
293
|
+
}
|
|
294
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.getFileMetadata');
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Search files by name pattern
|
|
299
|
+
*/
|
|
300
|
+
async searchFiles(containerId, pattern, path) {
|
|
301
|
+
try {
|
|
302
|
+
if (!containerId) {
|
|
303
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Container ID is required');
|
|
304
|
+
}
|
|
305
|
+
if (!pattern) {
|
|
306
|
+
throw errorHandler_1.ErrorHandler.createValidationError('Search pattern is required');
|
|
307
|
+
}
|
|
308
|
+
const queryParams = new URLSearchParams();
|
|
309
|
+
queryParams.append('pattern', pattern);
|
|
310
|
+
if (path) {
|
|
311
|
+
queryParams.append('path', path);
|
|
312
|
+
}
|
|
313
|
+
const response = await this.httpClient.get(`/v1/containers/${containerId}/files/search?${queryParams.toString()}`);
|
|
314
|
+
if (!response.data || !Array.isArray(response.data.files)) {
|
|
315
|
+
return [];
|
|
316
|
+
}
|
|
317
|
+
return response.data.files;
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
if (error instanceof errorHandler_1.ApiError && error.status === 404) {
|
|
321
|
+
return [];
|
|
322
|
+
}
|
|
323
|
+
throw errorHandler_1.ErrorHandler.processError(error, 'FileService.searchFiles');
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
exports.FileService = FileService;
|
|
328
|
+
// Export singleton instance
|
|
329
|
+
exports.fileService = new FileService();
|
|
330
|
+
//# sourceMappingURL=fileService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileService.js","sourceRoot":"","sources":["../../src/services/fileService.ts"],"names":[],"mappings":";;;AASA,kCAAsC;AACtC,wDAA+D;AAE/D;;GAEG;AACH,MAAa,WAAW;IAGtB;QACE,IAAI,CAAC,UAAU,GAAG,kBAAW,CAAC,aAAa,EAAE,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CAAC,MAAgC;QACvD,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBACxB,MAAM,2BAAY,CAAC,qBAAqB,CAAC,0BAA0B,CAAC,CAAC;YACvE,CAAC;YAED,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;YAC1C,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBAChB,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1C,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CACxC,kBAAkB,MAAM,CAAC,WAAW,UAAU,WAAW,CAAC,QAAQ,EAAE,EAAE,CACvE,CAAC;YAEF,IAAI,CAAC,QAAQ,CAA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AAI,KAAK,YAAY,uBAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACtD,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,MAAM,2BAAY,CAAC,YAAY,CAAC,KAAK,EAAE,yBAAyB,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;CACF;AAzXD,kCAyXC;AAED,4BAA4B;AACf,QAAA,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC"}
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Interactive setup for the 172.ai MCP Server
|
|
4
|
+
*/
|
|
5
|
+
declare class MCPServerSetup {
|
|
6
|
+
private envPath;
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* Run the setup process
|
|
10
|
+
*/
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Gather configuration from user input
|
|
14
|
+
*/
|
|
15
|
+
private gatherConfiguration;
|
|
16
|
+
/**
|
|
17
|
+
* Test connection with the provided configuration
|
|
18
|
+
*/
|
|
19
|
+
private testConnection;
|
|
20
|
+
/**
|
|
21
|
+
* Save configuration to .env file
|
|
22
|
+
*/
|
|
23
|
+
private saveConfiguration;
|
|
24
|
+
/**
|
|
25
|
+
* Create .env file content from configuration
|
|
26
|
+
*/
|
|
27
|
+
private createEnvContent;
|
|
28
|
+
}
|
|
29
|
+
export { MCPServerSetup };
|
|
30
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AAQA;;GAEG;AACH,cAAM,cAAc;IAClB,OAAO,CAAC,OAAO,CAAS;;IAMxB;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA8C1B;;OAEG;YACW,mBAAmB;IA8HjC;;OAEG;YACW,cAAc;IAuB5B;;OAEG;YACW,iBAAiB;IAa/B;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAiEzB;AAWD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|