@voxburst/mcp-server 0.1.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 +293 -0
- package/dist/client.d.ts +98 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +116 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +184 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/accounts.d.ts +41 -0
- package/dist/resources/accounts.d.ts.map +1 -0
- package/dist/resources/accounts.js +82 -0
- package/dist/resources/accounts.js.map +1 -0
- package/dist/resources/index.d.ts +24 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +45 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/posts.d.ts +41 -0
- package/dist/resources/posts.d.ts.map +1 -0
- package/dist/resources/posts.js +97 -0
- package/dist/resources/posts.js.map +1 -0
- package/dist/tools/accounts.d.ts +39 -0
- package/dist/tools/accounts.d.ts.map +1 -0
- package/dist/tools/accounts.js +51 -0
- package/dist/tools/accounts.js.map +1 -0
- package/dist/tools/analytics.d.ts +51 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +60 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/index.d.ts +111 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +36 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/posts.d.ts +186 -0
- package/dist/tools/posts.d.ts.map +1 -0
- package/dist/tools/posts.js +176 -0
- package/dist/tools/posts.js.map +1 -0
- package/package.json +54 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* VoxBurst MCP Server
|
|
5
|
+
*
|
|
6
|
+
* Model Context Protocol server that enables AI agents to manage
|
|
7
|
+
* social media posts through VoxBurst.
|
|
8
|
+
*
|
|
9
|
+
* @see https://modelcontextprotocol.io
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
13
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
14
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
15
|
+
const client_js_1 = require("./client.js");
|
|
16
|
+
const index_js_2 = require("./tools/index.js");
|
|
17
|
+
const index_js_3 = require("./resources/index.js");
|
|
18
|
+
const SERVER_NAME = 'voxburst';
|
|
19
|
+
const SERVER_VERSION = '0.1.0';
|
|
20
|
+
/**
|
|
21
|
+
* Create and configure the MCP server
|
|
22
|
+
*/
|
|
23
|
+
function createServer(client) {
|
|
24
|
+
const server = new index_js_1.Server({
|
|
25
|
+
name: SERVER_NAME,
|
|
26
|
+
version: SERVER_VERSION,
|
|
27
|
+
}, {
|
|
28
|
+
capabilities: {
|
|
29
|
+
tools: {},
|
|
30
|
+
resources: {},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
// Register tool handlers
|
|
34
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
35
|
+
return {
|
|
36
|
+
tools: (0, index_js_2.getAllTools)(),
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
40
|
+
const { name, arguments: args } = request.params;
|
|
41
|
+
try {
|
|
42
|
+
let result;
|
|
43
|
+
switch (name) {
|
|
44
|
+
// Post tools
|
|
45
|
+
case 'create_post':
|
|
46
|
+
result = await (0, index_js_2.handleCreatePost)(client, args);
|
|
47
|
+
break;
|
|
48
|
+
case 'list_posts':
|
|
49
|
+
result = await (0, index_js_2.handleListPosts)(client, args);
|
|
50
|
+
break;
|
|
51
|
+
case 'get_post':
|
|
52
|
+
result = await (0, index_js_2.handleGetPost)(client, args);
|
|
53
|
+
break;
|
|
54
|
+
case 'delete_post':
|
|
55
|
+
result = await (0, index_js_2.handleDeletePost)(client, args);
|
|
56
|
+
break;
|
|
57
|
+
case 'validate_content':
|
|
58
|
+
result = await (0, index_js_2.handleValidateContent)(client, args);
|
|
59
|
+
break;
|
|
60
|
+
// Account tools
|
|
61
|
+
case 'list_accounts':
|
|
62
|
+
result = await (0, index_js_2.handleListAccounts)(client);
|
|
63
|
+
break;
|
|
64
|
+
case 'get_account':
|
|
65
|
+
result = await (0, index_js_2.handleGetAccount)(client, args);
|
|
66
|
+
break;
|
|
67
|
+
// Analytics tools
|
|
68
|
+
case 'get_post_metrics':
|
|
69
|
+
result = await (0, index_js_2.handleGetPostMetrics)(client, args);
|
|
70
|
+
break;
|
|
71
|
+
case 'get_account_metrics':
|
|
72
|
+
result = await (0, index_js_2.handleGetAccountMetrics)(client, args);
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
return {
|
|
76
|
+
content: [
|
|
77
|
+
{
|
|
78
|
+
type: 'text',
|
|
79
|
+
text: `Unknown tool: ${name}`,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
isError: true,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: 'text',
|
|
89
|
+
text: JSON.stringify(result, null, 2),
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
const errorMessage = formatError(error);
|
|
96
|
+
return {
|
|
97
|
+
content: [
|
|
98
|
+
{
|
|
99
|
+
type: 'text',
|
|
100
|
+
text: errorMessage,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
isError: true,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
// Register resource handlers
|
|
108
|
+
server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async () => {
|
|
109
|
+
return {
|
|
110
|
+
resources: (0, index_js_3.getAllResources)(),
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
server.setRequestHandler(types_js_1.ListResourceTemplatesRequestSchema, async () => {
|
|
114
|
+
return {
|
|
115
|
+
resourceTemplates: (0, index_js_3.getAllResourceTemplates)(),
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request) => {
|
|
119
|
+
const { uri } = request.params;
|
|
120
|
+
try {
|
|
121
|
+
// Try account resources
|
|
122
|
+
if (uri.startsWith(index_js_3.ACCOUNT_URI_PREFIX) || uri === 'accounts://list') {
|
|
123
|
+
const content = await (0, index_js_3.readAccountResource)(client, uri);
|
|
124
|
+
if (content) {
|
|
125
|
+
return { contents: [content] };
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// Try post resources
|
|
129
|
+
if (uri.startsWith(index_js_3.POST_URI_PREFIX) || uri === 'posts://recent') {
|
|
130
|
+
const content = await (0, index_js_3.readPostResource)(client, uri);
|
|
131
|
+
if (content) {
|
|
132
|
+
return { contents: [content] };
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
throw new Error(`Resource not found: ${uri}`);
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
throw new Error(formatError(error));
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
return server;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Format error for MCP response
|
|
145
|
+
*/
|
|
146
|
+
function formatError(error) {
|
|
147
|
+
if (error instanceof client_js_1.VoxBurstAPIError) {
|
|
148
|
+
return `VoxBurst API Error (${error.statusCode}): ${error.message}${error.code ? ` [${error.code}]` : ''}`;
|
|
149
|
+
}
|
|
150
|
+
if (error instanceof Error) {
|
|
151
|
+
return error.message;
|
|
152
|
+
}
|
|
153
|
+
return String(error);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Main entry point
|
|
157
|
+
*/
|
|
158
|
+
async function main() {
|
|
159
|
+
try {
|
|
160
|
+
// Create API client from environment
|
|
161
|
+
const client = (0, client_js_1.createClientFromEnv)();
|
|
162
|
+
// Create and start server
|
|
163
|
+
const server = createServer(client);
|
|
164
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
165
|
+
await server.connect(transport);
|
|
166
|
+
// Log to stderr (stdout is for MCP protocol)
|
|
167
|
+
console.error(`VoxBurst MCP Server v${SERVER_VERSION} started`);
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
console.error('Failed to start VoxBurst MCP Server:', error);
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// Handle graceful shutdown
|
|
175
|
+
process.on('SIGINT', () => {
|
|
176
|
+
console.error('Shutting down VoxBurst MCP Server...');
|
|
177
|
+
process.exit(0);
|
|
178
|
+
});
|
|
179
|
+
process.on('SIGTERM', () => {
|
|
180
|
+
console.error('Shutting down VoxBurst MCP Server...');
|
|
181
|
+
process.exit(0);
|
|
182
|
+
});
|
|
183
|
+
main();
|
|
184
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;GAOG;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAM4C;AAE5C,2CAAoF;AACpF,+CAW0B;AAC1B,mDAO8B;AAE9B,MAAM,WAAW,GAAG,UAAU,CAAC;AAC/B,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B;;GAEG;AACH,SAAS,YAAY,CAAC,MAAsB;IAC1C,MAAM,MAAM,GAAG,IAAI,iBAAM,CACvB;QACE,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,cAAc;KACxB,EACD;QACE,YAAY,EAAE;YACZ,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;SACd;KACF,CACF,CAAC;IAEF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KAAK,CAAC,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,qCAAqC;QACrC,MAAM,MAAM,GAAG,IAAA,+BAAmB,GAAE,CAAC;QAErC,0BAA0B;QAC1B,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;QAE7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhC,6CAA6C;QAC7C,OAAO,CAAC,KAAK,CAAC,wBAAwB,cAAc,UAAU,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,2BAA2B;AAC3B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IACxB,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;IACzB,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account Resources - Expose accounts as MCP resources
|
|
3
|
+
*/
|
|
4
|
+
import type { VoxBurstClient, Account } from '../client.js';
|
|
5
|
+
export declare const ACCOUNTS_LIST_URI = "accounts://list";
|
|
6
|
+
export declare const ACCOUNT_URI_PREFIX = "accounts://";
|
|
7
|
+
/**
|
|
8
|
+
* Get resource templates for accounts
|
|
9
|
+
*/
|
|
10
|
+
export declare function getAccountResourceTemplates(): {
|
|
11
|
+
uriTemplate: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
mimeType: string;
|
|
15
|
+
}[];
|
|
16
|
+
/**
|
|
17
|
+
* Get static account resources
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAccountResources(): {
|
|
20
|
+
uri: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
mimeType: string;
|
|
24
|
+
}[];
|
|
25
|
+
/**
|
|
26
|
+
* Read account resource content
|
|
27
|
+
*/
|
|
28
|
+
export declare function readAccountResource(client: VoxBurstClient, uri: string): Promise<{
|
|
29
|
+
uri: string;
|
|
30
|
+
mimeType: string;
|
|
31
|
+
text: string;
|
|
32
|
+
} | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Format account for display
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatAccount(account: Account): string;
|
|
37
|
+
/**
|
|
38
|
+
* Format accounts list for display
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatAccountsList(accounts: Account[]): string;
|
|
41
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/resources/accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5D,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AACnD,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD;;GAEG;AACH,wBAAgB,2BAA2B;;;;;IAS1C;AAED;;GAEG;AACH,wBAAgB,mBAAmB;;;;;IASlC;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAwBjE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAGtD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAM9D"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Account Resources - Expose accounts as MCP resources
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ACCOUNT_URI_PREFIX = exports.ACCOUNTS_LIST_URI = void 0;
|
|
7
|
+
exports.getAccountResourceTemplates = getAccountResourceTemplates;
|
|
8
|
+
exports.getAccountResources = getAccountResources;
|
|
9
|
+
exports.readAccountResource = readAccountResource;
|
|
10
|
+
exports.formatAccount = formatAccount;
|
|
11
|
+
exports.formatAccountsList = formatAccountsList;
|
|
12
|
+
exports.ACCOUNTS_LIST_URI = 'accounts://list';
|
|
13
|
+
exports.ACCOUNT_URI_PREFIX = 'accounts://';
|
|
14
|
+
/**
|
|
15
|
+
* Get resource templates for accounts
|
|
16
|
+
*/
|
|
17
|
+
function getAccountResourceTemplates() {
|
|
18
|
+
return [
|
|
19
|
+
{
|
|
20
|
+
uriTemplate: 'accounts://{accountId}',
|
|
21
|
+
name: 'Social Media Account',
|
|
22
|
+
description: 'A connected social media account with platform details and status',
|
|
23
|
+
mimeType: 'application/json',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get static account resources
|
|
29
|
+
*/
|
|
30
|
+
function getAccountResources() {
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
uri: exports.ACCOUNTS_LIST_URI,
|
|
34
|
+
name: 'All Connected Accounts',
|
|
35
|
+
description: 'List of all connected social media accounts',
|
|
36
|
+
mimeType: 'application/json',
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Read account resource content
|
|
42
|
+
*/
|
|
43
|
+
async function readAccountResource(client, uri) {
|
|
44
|
+
if (uri === exports.ACCOUNTS_LIST_URI) {
|
|
45
|
+
const accounts = await client.listAccounts();
|
|
46
|
+
return {
|
|
47
|
+
uri,
|
|
48
|
+
mimeType: 'application/json',
|
|
49
|
+
text: JSON.stringify(accounts, null, 2),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// Handle individual account URIs like accounts://acc_123
|
|
53
|
+
if (uri.startsWith(exports.ACCOUNT_URI_PREFIX) && uri !== exports.ACCOUNTS_LIST_URI) {
|
|
54
|
+
const accountId = uri.slice(exports.ACCOUNT_URI_PREFIX.length);
|
|
55
|
+
if (accountId && accountId !== 'list') {
|
|
56
|
+
const account = await client.getAccount(accountId);
|
|
57
|
+
return {
|
|
58
|
+
uri,
|
|
59
|
+
mimeType: 'application/json',
|
|
60
|
+
text: JSON.stringify(account, null, 2),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Format account for display
|
|
68
|
+
*/
|
|
69
|
+
function formatAccount(account) {
|
|
70
|
+
const status = account.connected ? '✅ Connected' : '❌ Disconnected';
|
|
71
|
+
return `${account.platform}: @${account.handle} (${account.displayName}) - ${status}`;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Format accounts list for display
|
|
75
|
+
*/
|
|
76
|
+
function formatAccountsList(accounts) {
|
|
77
|
+
if (accounts.length === 0) {
|
|
78
|
+
return 'No accounts connected. Connect accounts at https://app.voxburst.io/accounts';
|
|
79
|
+
}
|
|
80
|
+
return accounts.map(formatAccount).join('\n');
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC,CAAC;YACnD,OAAO;gBACL,GAAG;gBACH,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;aACvC,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,OAAgB;IAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC;IACpE,OAAO,GAAG,OAAO,CAAC,QAAQ,MAAM,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,WAAW,OAAO,MAAM,EAAE,CAAC;AACxF,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,QAAmB;IACpD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,6EAA6E,CAAC;IACvF,CAAC;IAED,OAAO,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource Registry - Exports all MCP resources
|
|
3
|
+
*/
|
|
4
|
+
export { ACCOUNTS_LIST_URI, ACCOUNT_URI_PREFIX, getAccountResources, getAccountResourceTemplates, readAccountResource, formatAccount, formatAccountsList, } from './accounts.js';
|
|
5
|
+
export { POSTS_RECENT_URI, POST_URI_PREFIX, getPostResources, getPostResourceTemplates, readPostResource, formatPost, formatPostsList, } from './posts.js';
|
|
6
|
+
/**
|
|
7
|
+
* Get all static resources
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAllResources(): {
|
|
10
|
+
uri: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
mimeType: string;
|
|
14
|
+
}[];
|
|
15
|
+
/**
|
|
16
|
+
* Get all resource templates
|
|
17
|
+
*/
|
|
18
|
+
export declare function getAllResourceTemplates(): {
|
|
19
|
+
uriTemplate: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
mimeType: string;
|
|
23
|
+
}[];
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,aAAa,EACb,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AAKpB;;GAEG;AACH,wBAAgB,eAAe;;;;;IAK9B;AAED;;GAEG;AACH,wBAAgB,uBAAuB;;;;;IAKtC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Resource Registry - Exports all MCP resources
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatPostsList = exports.formatPost = exports.readPostResource = exports.getPostResourceTemplates = exports.getPostResources = exports.POST_URI_PREFIX = exports.POSTS_RECENT_URI = exports.formatAccountsList = exports.formatAccount = exports.readAccountResource = exports.getAccountResourceTemplates = exports.getAccountResources = exports.ACCOUNT_URI_PREFIX = exports.ACCOUNTS_LIST_URI = void 0;
|
|
7
|
+
exports.getAllResources = getAllResources;
|
|
8
|
+
exports.getAllResourceTemplates = getAllResourceTemplates;
|
|
9
|
+
var accounts_js_1 = require("./accounts.js");
|
|
10
|
+
Object.defineProperty(exports, "ACCOUNTS_LIST_URI", { enumerable: true, get: function () { return accounts_js_1.ACCOUNTS_LIST_URI; } });
|
|
11
|
+
Object.defineProperty(exports, "ACCOUNT_URI_PREFIX", { enumerable: true, get: function () { return accounts_js_1.ACCOUNT_URI_PREFIX; } });
|
|
12
|
+
Object.defineProperty(exports, "getAccountResources", { enumerable: true, get: function () { return accounts_js_1.getAccountResources; } });
|
|
13
|
+
Object.defineProperty(exports, "getAccountResourceTemplates", { enumerable: true, get: function () { return accounts_js_1.getAccountResourceTemplates; } });
|
|
14
|
+
Object.defineProperty(exports, "readAccountResource", { enumerable: true, get: function () { return accounts_js_1.readAccountResource; } });
|
|
15
|
+
Object.defineProperty(exports, "formatAccount", { enumerable: true, get: function () { return accounts_js_1.formatAccount; } });
|
|
16
|
+
Object.defineProperty(exports, "formatAccountsList", { enumerable: true, get: function () { return accounts_js_1.formatAccountsList; } });
|
|
17
|
+
var posts_js_1 = require("./posts.js");
|
|
18
|
+
Object.defineProperty(exports, "POSTS_RECENT_URI", { enumerable: true, get: function () { return posts_js_1.POSTS_RECENT_URI; } });
|
|
19
|
+
Object.defineProperty(exports, "POST_URI_PREFIX", { enumerable: true, get: function () { return posts_js_1.POST_URI_PREFIX; } });
|
|
20
|
+
Object.defineProperty(exports, "getPostResources", { enumerable: true, get: function () { return posts_js_1.getPostResources; } });
|
|
21
|
+
Object.defineProperty(exports, "getPostResourceTemplates", { enumerable: true, get: function () { return posts_js_1.getPostResourceTemplates; } });
|
|
22
|
+
Object.defineProperty(exports, "readPostResource", { enumerable: true, get: function () { return posts_js_1.readPostResource; } });
|
|
23
|
+
Object.defineProperty(exports, "formatPost", { enumerable: true, get: function () { return posts_js_1.formatPost; } });
|
|
24
|
+
Object.defineProperty(exports, "formatPostsList", { enumerable: true, get: function () { return posts_js_1.formatPostsList; } });
|
|
25
|
+
const accounts_js_2 = require("./accounts.js");
|
|
26
|
+
const posts_js_2 = require("./posts.js");
|
|
27
|
+
/**
|
|
28
|
+
* Get all static resources
|
|
29
|
+
*/
|
|
30
|
+
function getAllResources() {
|
|
31
|
+
return [
|
|
32
|
+
...(0, accounts_js_2.getAccountResources)(),
|
|
33
|
+
...(0, posts_js_2.getPostResources)(),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get all resource templates
|
|
38
|
+
*/
|
|
39
|
+
function getAllResourceTemplates() {
|
|
40
|
+
return [
|
|
41
|
+
...(0, accounts_js_2.getAccountResourceTemplates)(),
|
|
42
|
+
...(0, posts_js_2.getPostResourceTemplates)(),
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA4BH,0CAKC;AAKD,0DAKC;AAzCD,6CAQuB;AAPrB,gHAAA,iBAAiB,OAAA;AACjB,iHAAA,kBAAkB,OAAA;AAClB,kHAAA,mBAAmB,OAAA;AACnB,0HAAA,2BAA2B,OAAA;AAC3B,kHAAA,mBAAmB,OAAA;AACnB,4GAAA,aAAa,OAAA;AACb,iHAAA,kBAAkB,OAAA;AAGpB,uCAQoB;AAPlB,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AACf,4GAAA,gBAAgB,OAAA;AAChB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,sGAAA,UAAU,OAAA;AACV,2GAAA,eAAe,OAAA;AAGjB,+CAAiF;AACjF,yCAAwE;AAExE;;GAEG;AACH,SAAgB,eAAe;IAC7B,OAAO;QACL,GAAG,IAAA,iCAAmB,GAAE;QACxB,GAAG,IAAA,2BAAgB,GAAE;KACtB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,uBAAuB;IACrC,OAAO;QACL,GAAG,IAAA,yCAA2B,GAAE;QAChC,GAAG,IAAA,mCAAwB,GAAE;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post Resources - Expose posts as MCP resources
|
|
3
|
+
*/
|
|
4
|
+
import type { VoxBurstClient, Post } from '../client.js';
|
|
5
|
+
export declare const POSTS_RECENT_URI = "posts://recent";
|
|
6
|
+
export declare const POST_URI_PREFIX = "posts://";
|
|
7
|
+
/**
|
|
8
|
+
* Get resource templates for posts
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPostResourceTemplates(): {
|
|
11
|
+
uriTemplate: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
mimeType: string;
|
|
15
|
+
}[];
|
|
16
|
+
/**
|
|
17
|
+
* Get static post resources
|
|
18
|
+
*/
|
|
19
|
+
export declare function getPostResources(): {
|
|
20
|
+
uri: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
mimeType: string;
|
|
24
|
+
}[];
|
|
25
|
+
/**
|
|
26
|
+
* Read post resource content
|
|
27
|
+
*/
|
|
28
|
+
export declare function readPostResource(client: VoxBurstClient, uri: string): Promise<{
|
|
29
|
+
uri: string;
|
|
30
|
+
mimeType: string;
|
|
31
|
+
text: string;
|
|
32
|
+
} | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Format post for display
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatPost(post: Post): string;
|
|
37
|
+
/**
|
|
38
|
+
* Format posts list for display
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatPostsList(posts: Post[]): string;
|
|
41
|
+
//# sourceMappingURL=posts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../src/resources/posts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzD,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AACjD,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C;;GAEG;AACH,wBAAgB,wBAAwB;;;;;IASvC;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;;;;IAS/B;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAwBjE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAsB7C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAMrD"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Post Resources - Expose posts as MCP resources
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.POST_URI_PREFIX = exports.POSTS_RECENT_URI = void 0;
|
|
7
|
+
exports.getPostResourceTemplates = getPostResourceTemplates;
|
|
8
|
+
exports.getPostResources = getPostResources;
|
|
9
|
+
exports.readPostResource = readPostResource;
|
|
10
|
+
exports.formatPost = formatPost;
|
|
11
|
+
exports.formatPostsList = formatPostsList;
|
|
12
|
+
exports.POSTS_RECENT_URI = 'posts://recent';
|
|
13
|
+
exports.POST_URI_PREFIX = 'posts://';
|
|
14
|
+
/**
|
|
15
|
+
* Get resource templates for posts
|
|
16
|
+
*/
|
|
17
|
+
function getPostResourceTemplates() {
|
|
18
|
+
return [
|
|
19
|
+
{
|
|
20
|
+
uriTemplate: 'posts://{postId}',
|
|
21
|
+
name: 'Social Media Post',
|
|
22
|
+
description: 'A social media post with content, status, and scheduling details',
|
|
23
|
+
mimeType: 'application/json',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get static post resources
|
|
29
|
+
*/
|
|
30
|
+
function getPostResources() {
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
uri: exports.POSTS_RECENT_URI,
|
|
34
|
+
name: 'Recent Posts',
|
|
35
|
+
description: 'List of recent posts across all accounts (last 20)',
|
|
36
|
+
mimeType: 'application/json',
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Read post resource content
|
|
42
|
+
*/
|
|
43
|
+
async function readPostResource(client, uri) {
|
|
44
|
+
if (uri === exports.POSTS_RECENT_URI) {
|
|
45
|
+
const posts = await client.listPosts({ limit: 20 });
|
|
46
|
+
return {
|
|
47
|
+
uri,
|
|
48
|
+
mimeType: 'application/json',
|
|
49
|
+
text: JSON.stringify(posts, null, 2),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// Handle individual post URIs like posts://post_123
|
|
53
|
+
if (uri.startsWith(exports.POST_URI_PREFIX) && uri !== exports.POSTS_RECENT_URI) {
|
|
54
|
+
const postId = uri.slice(exports.POST_URI_PREFIX.length);
|
|
55
|
+
if (postId && postId !== 'recent') {
|
|
56
|
+
const post = await client.getPost(postId);
|
|
57
|
+
return {
|
|
58
|
+
uri,
|
|
59
|
+
mimeType: 'application/json',
|
|
60
|
+
text: JSON.stringify(post, null, 2),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Format post for display
|
|
68
|
+
*/
|
|
69
|
+
function formatPost(post) {
|
|
70
|
+
const statusEmoji = {
|
|
71
|
+
draft: '📝',
|
|
72
|
+
scheduled: '📅',
|
|
73
|
+
published: '✅',
|
|
74
|
+
failed: '❌',
|
|
75
|
+
};
|
|
76
|
+
const preview = post.content.length > 100
|
|
77
|
+
? post.content.slice(0, 100) + '...'
|
|
78
|
+
: post.content;
|
|
79
|
+
let info = `${statusEmoji[post.status]} [${post.status.toUpperCase()}] ${preview}`;
|
|
80
|
+
if (post.scheduledFor) {
|
|
81
|
+
info += `\n Scheduled: ${new Date(post.scheduledFor).toLocaleString()}`;
|
|
82
|
+
}
|
|
83
|
+
if (post.publishedAt) {
|
|
84
|
+
info += `\n Published: ${new Date(post.publishedAt).toLocaleString()}`;
|
|
85
|
+
}
|
|
86
|
+
return info;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Format posts list for display
|
|
90
|
+
*/
|
|
91
|
+
function formatPostsList(posts) {
|
|
92
|
+
if (posts.length === 0) {
|
|
93
|
+
return 'No posts found.';
|
|
94
|
+
}
|
|
95
|
+
return posts.map((post, index) => `${index + 1}. ${formatPost(post)}`).join('\n\n');
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=posts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/resources/posts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAUH,4DASC;AAKD,4CASC;AAKD,4CA2BC;AAKD,gCAsBC;AAKD,0CAMC;AAnGY,QAAA,gBAAgB,GAAG,gBAAgB,CAAC;AACpC,QAAA,eAAe,GAAG,UAAU,CAAC;AAE1C;;GAEG;AACH,SAAgB,wBAAwB;IACtC,OAAO;QACL;YACE,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,kEAAkE;YAC/E,QAAQ,EAAE,kBAAkB;SAC7B;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,OAAO;QACL;YACE,GAAG,EAAE,wBAAgB;YACrB,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,oDAAoD;YACjE,QAAQ,EAAE,kBAAkB;SAC7B;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,gBAAgB,CACpC,MAAsB,EACtB,GAAW;IAEX,IAAI,GAAG,KAAK,wBAAgB,EAAE,CAAC;QAC7B,MAAM,KAAK,G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AAE,CAAC;IAEnF,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,IAAI,IAAI,mBAAmB,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC;IAC5E,CAAC;IACD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACrB,IAAI,IAAI,mBAAmB,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC;IAC3E,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,KAAa;IAC3C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account Management MCP Tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import type { VoxBurstClient, Account } from '../client.js';
|
|
6
|
+
export declare const GetAccountSchema: z.ZodObject<{
|
|
7
|
+
accountId: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
accountId: string;
|
|
10
|
+
}, {
|
|
11
|
+
accountId: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function getAccountTools(): ({
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object";
|
|
18
|
+
properties: {
|
|
19
|
+
accountId?: undefined;
|
|
20
|
+
};
|
|
21
|
+
required: never[];
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: "object";
|
|
28
|
+
properties: {
|
|
29
|
+
accountId: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
required: string[];
|
|
35
|
+
};
|
|
36
|
+
})[];
|
|
37
|
+
export declare function handleListAccounts(client: VoxBurstClient): Promise<Account[]>;
|
|
38
|
+
export declare function handleGetAccount(client: VoxBurstClient, args: unknown): Promise<Account>;
|
|
39
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5D,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAGH,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;KA0B9B;AAGD,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,OAAO,EAAE,CAAC,CAEpB;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,OAAO,CAAC,CAGlB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Account Management MCP Tools
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GetAccountSchema = void 0;
|
|
7
|
+
exports.getAccountTools = getAccountTools;
|
|
8
|
+
exports.handleListAccounts = handleListAccounts;
|
|
9
|
+
exports.handleGetAccount = handleGetAccount;
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
// Input schemas
|
|
12
|
+
exports.GetAccountSchema = zod_1.z.object({
|
|
13
|
+
accountId: zod_1.z.string().describe('The unique identifier of the account'),
|
|
14
|
+
});
|
|
15
|
+
// Tool definitions
|
|
16
|
+
function getAccountTools() {
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
name: 'list_accounts',
|
|
20
|
+
description: 'List all connected social media accounts. Returns account details including platform, handle, and connection status.',
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {},
|
|
24
|
+
required: [],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'get_account',
|
|
29
|
+
description: 'Get detailed information about a specific connected account by its ID.',
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
properties: {
|
|
33
|
+
accountId: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'The unique identifier of the account',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ['accountId'],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
// Tool handlers
|
|
44
|
+
async function handleListAccounts(client) {
|
|
45
|
+
return client.listAccounts();
|
|
46
|
+
}
|
|
47
|
+
async function handleGetAccount(client, args) {
|
|
48
|
+
const { accountId } = exports.GetAccountSchema.parse(args);
|
|
49
|
+
return client.getAccount(accountId);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAWH,0CA0BC;AAGD,gDAIC;AAED,4CAMC;AAlDD,6BAAwB;AAGxB,gBAAgB;AACH,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;CACvE,CAAC,CAAC;AAEH,mBAAmB;AACnB,SAAgB,eAAe;IAC7B,OAAO;QACL;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,sHAAsH;YACnI,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE,EAAE;aACb;SACF;QACD;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,wEAAwE;YACrF,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,SAAS,EAAE;wBACT,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,sCAAsC;qBACpD;iBACF;gBACD,QAAQ,EAAE,CAAC,WAAW,CAAC;aACxB;SACF;KACF,CAAC;AACJ,CAAC;AAED,gBAAgB;AACT,KAAK,UAAU,kBAAkB,CACtC,MAAsB;IAEtB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC;AAC/B,CAAC;AAEM,KAAK,UAAU,gBAAgB,CACpC,MAAsB,EACtB,IAAa;IAEb,MAAM,EAAE,SAAS,EAAE,GAAG,wBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC"}
|