convex-mcp-visual 1.0.7 → 1.0.9
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 +51 -931
- package/dist/apps/apps/realtime-dashboard/index.html +1 -1
- package/dist/apps/apps/schema-browser/index.html +1 -1
- package/dist/apps/assets/{realtime-dashboard-BPA99DZn.js → realtime-dashboard-BKgb9FSM.js} +13 -13
- package/dist/apps/assets/{schema-browser-BEcF8hRP.js → schema-browser-DIJDjZTI.js} +18 -5
- package/dist/convex-client.d.ts +36 -8
- package/dist/convex-client.d.ts.map +1 -1
- package/dist/convex-client.js +268 -88
- package/dist/convex-client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +157 -23
- package/dist/index.js.map +1 -1
- package/dist/resources/schema-browser.js +7 -6
- package/dist/resources/schema-browser.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +38 -38
- package/dist/server.js.map +1 -1
- package/dist/tools/dashboard.d.ts +2 -2
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/dashboard.js +109 -87
- package/dist/tools/dashboard.js.map +1 -1
- package/dist/tools/schema-browser.d.ts +2 -2
- package/dist/tools/schema-browser.d.ts.map +1 -1
- package/dist/tools/schema-browser.js +93 -68
- package/dist/tools/schema-browser.js.map +1 -1
- package/package.json +1 -1
package/dist/tools/dashboard.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* MCP tool that creates real-time dashboard visualizations
|
|
5
5
|
* for Convex data - both in terminal AND in browser.
|
|
6
6
|
*/
|
|
7
|
-
import { launchUIApp } from
|
|
7
|
+
import { launchUIApp } from "../ui-server.js";
|
|
8
8
|
export const dashboardTool = {
|
|
9
|
-
name:
|
|
9
|
+
name: "dashboard_view",
|
|
10
10
|
description: `Creates a real-time dashboard for visualizing Convex data.
|
|
11
11
|
|
|
12
12
|
Features:
|
|
@@ -17,50 +17,63 @@ Features:
|
|
|
17
17
|
|
|
18
18
|
The dashboard renders as an interactive UI panel with live data.`,
|
|
19
19
|
inputSchema: {
|
|
20
|
-
type:
|
|
20
|
+
type: "object",
|
|
21
21
|
properties: {
|
|
22
22
|
deployment: {
|
|
23
|
-
type:
|
|
24
|
-
description:
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Deployment selector (from status tool)",
|
|
25
25
|
},
|
|
26
26
|
metrics: {
|
|
27
|
-
type:
|
|
28
|
-
description:
|
|
27
|
+
type: "array",
|
|
28
|
+
description: "Metrics to display on the dashboard",
|
|
29
29
|
items: {
|
|
30
|
-
type:
|
|
30
|
+
type: "object",
|
|
31
31
|
properties: {
|
|
32
|
-
name: {
|
|
33
|
-
|
|
32
|
+
name: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "Display name for the metric",
|
|
35
|
+
},
|
|
36
|
+
table: { type: "string", description: "Table to query" },
|
|
34
37
|
aggregation: {
|
|
35
|
-
type:
|
|
36
|
-
enum: [
|
|
37
|
-
description:
|
|
38
|
+
type: "string",
|
|
39
|
+
enum: ["count", "sum", "avg", "min", "max"],
|
|
40
|
+
description: "Aggregation function",
|
|
41
|
+
},
|
|
42
|
+
field: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Field to aggregate (not needed for count)",
|
|
45
|
+
},
|
|
46
|
+
filter: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Optional filter expression",
|
|
38
49
|
},
|
|
39
|
-
field: { type: 'string', description: 'Field to aggregate (not needed for count)' },
|
|
40
|
-
filter: { type: 'string', description: 'Optional filter expression' },
|
|
41
50
|
},
|
|
42
|
-
required: [
|
|
51
|
+
required: ["name", "table", "aggregation"],
|
|
43
52
|
},
|
|
44
53
|
},
|
|
45
54
|
charts: {
|
|
46
|
-
type:
|
|
47
|
-
description:
|
|
55
|
+
type: "array",
|
|
56
|
+
description: "Charts to display",
|
|
48
57
|
items: {
|
|
49
|
-
type:
|
|
58
|
+
type: "object",
|
|
50
59
|
properties: {
|
|
51
|
-
type: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
type: {
|
|
61
|
+
type: "string",
|
|
62
|
+
enum: ["line", "bar", "pie"],
|
|
63
|
+
description: "Chart type",
|
|
64
|
+
},
|
|
65
|
+
title: { type: "string", description: "Chart title" },
|
|
66
|
+
table: { type: "string", description: "Table to query" },
|
|
67
|
+
xField: { type: "string", description: "Field for X axis" },
|
|
68
|
+
yField: { type: "string", description: "Field for Y axis" },
|
|
69
|
+
groupBy: { type: "string", description: "Field to group by" },
|
|
57
70
|
},
|
|
58
|
-
required: [
|
|
71
|
+
required: ["type", "title", "table"],
|
|
59
72
|
},
|
|
60
73
|
},
|
|
61
74
|
refreshInterval: {
|
|
62
|
-
type:
|
|
63
|
-
description:
|
|
75
|
+
type: "number",
|
|
76
|
+
description: "Refresh interval in seconds (default: 5)",
|
|
64
77
|
default: 5,
|
|
65
78
|
},
|
|
66
79
|
},
|
|
@@ -68,12 +81,12 @@ The dashboard renders as an interactive UI panel with live data.`,
|
|
|
68
81
|
},
|
|
69
82
|
};
|
|
70
83
|
export async function handleDashboard(client, args = {}) {
|
|
71
|
-
const { metrics = [], charts = [], refreshInterval = 5 } = args;
|
|
84
|
+
const { metrics = [], charts = [], refreshInterval = 5, } = args;
|
|
72
85
|
if (!client.isConnected()) {
|
|
73
86
|
return {
|
|
74
87
|
content: [
|
|
75
88
|
{
|
|
76
|
-
type:
|
|
89
|
+
type: "text",
|
|
77
90
|
text: `## Realtime Dashboard
|
|
78
91
|
|
|
79
92
|
**Connection Error**: No Convex deployment configured.
|
|
@@ -87,27 +100,30 @@ To connect:
|
|
|
87
100
|
};
|
|
88
101
|
}
|
|
89
102
|
try {
|
|
90
|
-
// Get
|
|
91
|
-
const allDocuments = await client.getAllDocuments();
|
|
103
|
+
// Get tables with actual counts
|
|
92
104
|
const tables = await client.listTables();
|
|
105
|
+
const hasAdminAccess = client.hasAdminAccess();
|
|
106
|
+
// Get sample documents for computing metrics if admin access available
|
|
107
|
+
const allDocuments = hasAdminAccess ? await client.getAllDocuments() : {};
|
|
93
108
|
// Compute actual metric values
|
|
94
109
|
const computedMetrics = metrics.map((m) => {
|
|
95
110
|
const docs = allDocuments[m.table] || [];
|
|
96
|
-
const
|
|
111
|
+
const tableInfo = tables.find((t) => t.name === m.table);
|
|
112
|
+
const value = computeAggregation(docs, m.aggregation, m.field, tableInfo?.documentCount || 0);
|
|
97
113
|
return {
|
|
98
114
|
...m,
|
|
99
115
|
value,
|
|
100
|
-
documentCount:
|
|
116
|
+
documentCount: tableInfo?.documentCount || 0,
|
|
101
117
|
};
|
|
102
118
|
});
|
|
103
|
-
// If no metrics specified, auto-generate from tables
|
|
119
|
+
// If no metrics specified, auto-generate from tables using actual counts
|
|
104
120
|
const autoMetrics = metrics.length === 0
|
|
105
121
|
? tables.map((t) => ({
|
|
106
122
|
name: `${t.name} count`,
|
|
107
123
|
table: t.name,
|
|
108
|
-
aggregation:
|
|
109
|
-
value:
|
|
110
|
-
documentCount:
|
|
124
|
+
aggregation: "count",
|
|
125
|
+
value: t.documentCount,
|
|
126
|
+
documentCount: t.documentCount,
|
|
111
127
|
}))
|
|
112
128
|
: [];
|
|
113
129
|
// Build config for UI app
|
|
@@ -117,16 +133,17 @@ To connect:
|
|
|
117
133
|
charts,
|
|
118
134
|
refreshInterval,
|
|
119
135
|
allDocuments,
|
|
136
|
+
hasAdminAccess,
|
|
120
137
|
tables: tables.map((t) => ({
|
|
121
138
|
name: t.name,
|
|
122
|
-
documentCount:
|
|
139
|
+
documentCount: t.documentCount,
|
|
123
140
|
})),
|
|
124
141
|
};
|
|
125
142
|
// Launch the interactive UI in browser
|
|
126
|
-
let uiUrl =
|
|
143
|
+
let uiUrl = "";
|
|
127
144
|
try {
|
|
128
145
|
const uiServer = await launchUIApp({
|
|
129
|
-
appName:
|
|
146
|
+
appName: "realtime-dashboard",
|
|
130
147
|
config,
|
|
131
148
|
port: 3457,
|
|
132
149
|
autoClose: 30 * 60 * 1000, // Auto-close after 30 minutes
|
|
@@ -134,14 +151,14 @@ To connect:
|
|
|
134
151
|
uiUrl = uiServer.url;
|
|
135
152
|
}
|
|
136
153
|
catch (error) {
|
|
137
|
-
console.error(
|
|
154
|
+
console.error("Failed to launch UI:", error);
|
|
138
155
|
}
|
|
139
156
|
// Build terminal output
|
|
140
|
-
const terminalOutput = buildTerminalOutput(metrics.length > 0 ? computedMetrics : autoMetrics, charts, allDocuments, client.getDeploymentUrl(), uiUrl, refreshInterval);
|
|
157
|
+
const terminalOutput = buildTerminalOutput(metrics.length > 0 ? computedMetrics : autoMetrics, charts, allDocuments, client.getDeploymentUrl(), uiUrl, refreshInterval, hasAdminAccess);
|
|
141
158
|
return {
|
|
142
159
|
content: [
|
|
143
160
|
{
|
|
144
|
-
type:
|
|
161
|
+
type: "text",
|
|
145
162
|
text: terminalOutput,
|
|
146
163
|
},
|
|
147
164
|
],
|
|
@@ -151,7 +168,7 @@ To connect:
|
|
|
151
168
|
return {
|
|
152
169
|
content: [
|
|
153
170
|
{
|
|
154
|
-
type:
|
|
171
|
+
type: "text",
|
|
155
172
|
text: `## Realtime Dashboard
|
|
156
173
|
|
|
157
174
|
**Error**: ${error instanceof Error ? error.message : String(error)}
|
|
@@ -165,42 +182,43 @@ Please check your Convex credentials and deployment URL.`,
|
|
|
165
182
|
}
|
|
166
183
|
/**
|
|
167
184
|
* Compute aggregation on documents
|
|
185
|
+
* Note: For count, uses totalCount from system query if available
|
|
186
|
+
* For other aggregations, uses sample documents (may be approximate)
|
|
168
187
|
*/
|
|
169
|
-
function computeAggregation(docs, aggregation, field) {
|
|
170
|
-
if (docs.length === 0)
|
|
171
|
-
return 0;
|
|
188
|
+
function computeAggregation(docs, aggregation, field, totalCount) {
|
|
172
189
|
switch (aggregation) {
|
|
173
|
-
case
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
190
|
+
case "count":
|
|
191
|
+
// Use actual table count if available, otherwise fall back to docs.length
|
|
192
|
+
return totalCount !== undefined ? totalCount : docs.length;
|
|
193
|
+
case "sum":
|
|
194
|
+
if (!field || docs.length === 0)
|
|
177
195
|
return 0;
|
|
178
196
|
return docs.reduce((sum, doc) => {
|
|
179
197
|
const val = doc[field];
|
|
180
|
-
return sum + (typeof val ===
|
|
198
|
+
return sum + (typeof val === "number" ? val : 0);
|
|
181
199
|
}, 0);
|
|
182
|
-
case
|
|
183
|
-
if (!field)
|
|
200
|
+
case "avg":
|
|
201
|
+
if (!field || docs.length === 0)
|
|
184
202
|
return 0;
|
|
185
203
|
const values = docs
|
|
186
204
|
.map((doc) => doc[field])
|
|
187
|
-
.filter((v) => typeof v ===
|
|
205
|
+
.filter((v) => typeof v === "number");
|
|
188
206
|
if (values.length === 0)
|
|
189
207
|
return 0;
|
|
190
208
|
return values.reduce((a, b) => a + b, 0) / values.length;
|
|
191
|
-
case
|
|
192
|
-
if (!field)
|
|
209
|
+
case "min":
|
|
210
|
+
if (!field || docs.length === 0)
|
|
193
211
|
return 0;
|
|
194
212
|
const minValues = docs
|
|
195
213
|
.map((doc) => doc[field])
|
|
196
|
-
.filter((v) => typeof v ===
|
|
214
|
+
.filter((v) => typeof v === "number");
|
|
197
215
|
return minValues.length > 0 ? Math.min(...minValues) : 0;
|
|
198
|
-
case
|
|
199
|
-
if (!field)
|
|
216
|
+
case "max":
|
|
217
|
+
if (!field || docs.length === 0)
|
|
200
218
|
return 0;
|
|
201
219
|
const maxValues = docs
|
|
202
220
|
.map((doc) => doc[field])
|
|
203
|
-
.filter((v) => typeof v ===
|
|
221
|
+
.filter((v) => typeof v === "number");
|
|
204
222
|
return maxValues.length > 0 ? Math.max(...maxValues) : 0;
|
|
205
223
|
default:
|
|
206
224
|
return 0;
|
|
@@ -209,42 +227,46 @@ function computeAggregation(docs, aggregation, field) {
|
|
|
209
227
|
/**
|
|
210
228
|
* Build terminal-friendly dashboard output
|
|
211
229
|
*/
|
|
212
|
-
function buildTerminalOutput(metrics, charts, allDocuments, deploymentUrl, uiUrl, refreshInterval) {
|
|
230
|
+
function buildTerminalOutput(metrics, charts, allDocuments, deploymentUrl, uiUrl, refreshInterval, hasAdminAccess) {
|
|
213
231
|
const lines = [];
|
|
214
|
-
lines.push(
|
|
215
|
-
lines.push(
|
|
232
|
+
lines.push("## Realtime Dashboard");
|
|
233
|
+
lines.push("");
|
|
216
234
|
if (uiUrl) {
|
|
217
235
|
lines.push(`**Interactive UI**: ${uiUrl}`);
|
|
218
|
-
lines.push(
|
|
236
|
+
lines.push("");
|
|
219
237
|
}
|
|
220
238
|
lines.push(`Connected to: \`${deploymentUrl}\``);
|
|
221
239
|
lines.push(`Refresh interval: ${refreshInterval}s`);
|
|
222
|
-
|
|
240
|
+
if (!hasAdminAccess) {
|
|
241
|
+
lines.push("");
|
|
242
|
+
lines.push("*Note: Some metrics require admin access. Set CONVEX_DEPLOY_KEY for full data.*");
|
|
243
|
+
}
|
|
244
|
+
lines.push("");
|
|
223
245
|
// Metrics section
|
|
224
246
|
if (metrics.length > 0) {
|
|
225
|
-
lines.push(
|
|
226
|
-
lines.push(
|
|
227
|
-
lines.push(
|
|
228
|
-
lines.push(
|
|
247
|
+
lines.push("### Metrics");
|
|
248
|
+
lines.push("");
|
|
249
|
+
lines.push("| Metric | Value | Source |");
|
|
250
|
+
lines.push("|--------|-------|--------|");
|
|
229
251
|
for (const m of metrics) {
|
|
230
252
|
const formattedValue = formatNumber(m.value);
|
|
231
|
-
const source = `${m.table} / ${m.aggregation}${m.field ? `(${m.field})` :
|
|
253
|
+
const source = `${m.table} / ${m.aggregation}${m.field ? `(${m.field})` : ""}`;
|
|
232
254
|
lines.push(`| ${m.name} | **${formattedValue}** | ${source} |`);
|
|
233
255
|
}
|
|
234
|
-
lines.push(
|
|
256
|
+
lines.push("");
|
|
235
257
|
}
|
|
236
258
|
// Charts section (show what charts would be rendered)
|
|
237
259
|
if (charts.length > 0) {
|
|
238
|
-
lines.push(
|
|
239
|
-
lines.push(
|
|
260
|
+
lines.push("### Charts");
|
|
261
|
+
lines.push("");
|
|
240
262
|
for (const c of charts) {
|
|
241
263
|
lines.push(`- **${c.title}** (${c.type} chart from \`${c.table}\`)`);
|
|
242
264
|
}
|
|
243
|
-
lines.push(
|
|
265
|
+
lines.push("");
|
|
244
266
|
}
|
|
245
267
|
// Recent activity
|
|
246
|
-
lines.push(
|
|
247
|
-
lines.push(
|
|
268
|
+
lines.push("### Recent Documents");
|
|
269
|
+
lines.push("");
|
|
248
270
|
const flatDocs = [];
|
|
249
271
|
for (const [table, docs] of Object.entries(allDocuments)) {
|
|
250
272
|
for (const d of docs) {
|
|
@@ -262,29 +284,29 @@ function buildTerminalOutput(metrics, charts, allDocuments, deploymentUrl, uiUrl
|
|
|
262
284
|
})
|
|
263
285
|
.slice(0, 5);
|
|
264
286
|
if (allDocs.length > 0) {
|
|
265
|
-
lines.push(
|
|
266
|
-
lines.push(
|
|
287
|
+
lines.push("| Table | ID | Created |");
|
|
288
|
+
lines.push("|-------|-----|---------|");
|
|
267
289
|
for (const doc of allDocs) {
|
|
268
|
-
const id = String(doc._id ||
|
|
290
|
+
const id = String(doc._id || "").slice(0, 10) + "...";
|
|
269
291
|
const created = doc._creationTime
|
|
270
292
|
? formatTimeAgo(doc._creationTime)
|
|
271
|
-
:
|
|
293
|
+
: "Unknown";
|
|
272
294
|
lines.push(`| ${doc.table} | \`${id}\` | ${created} |`);
|
|
273
295
|
}
|
|
274
296
|
}
|
|
275
297
|
else {
|
|
276
|
-
lines.push(
|
|
298
|
+
lines.push("*No documents found*");
|
|
277
299
|
}
|
|
278
|
-
return lines.join(
|
|
300
|
+
return lines.join("\n");
|
|
279
301
|
}
|
|
280
302
|
/**
|
|
281
303
|
* Format number for display
|
|
282
304
|
*/
|
|
283
305
|
function formatNumber(num) {
|
|
284
306
|
if (num >= 1000000)
|
|
285
|
-
return (num / 1000000).toFixed(1) +
|
|
307
|
+
return (num / 1000000).toFixed(1) + "M";
|
|
286
308
|
if (num >= 1000)
|
|
287
|
-
return (num / 1000).toFixed(1) +
|
|
309
|
+
return (num / 1000).toFixed(1) + "k";
|
|
288
310
|
if (Number.isInteger(num))
|
|
289
311
|
return num.toString();
|
|
290
312
|
return num.toFixed(2);
|
|
@@ -299,7 +321,7 @@ function formatTimeAgo(timestamp) {
|
|
|
299
321
|
const hours = Math.floor(diff / 3600000);
|
|
300
322
|
const days = Math.floor(diff / 86400000);
|
|
301
323
|
if (minutes < 1)
|
|
302
|
-
return
|
|
324
|
+
return "Just now";
|
|
303
325
|
if (minutes < 60)
|
|
304
326
|
return `${minutes}m ago`;
|
|
305
327
|
if (hours < 24)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/tools/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAS;IACjC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE;;;;;;;;iEAQkD;IAC/D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wCAAwC;aACtD;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,qCAAqC;gBAClD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/tools/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAS;IACjC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE;;;;;;;;iEAQkD;IAC/D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;Y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,IAAI,OAAO,CAAC;AACxB,CAAC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* MCP tool that displays database schema in terminal AND
|
|
5
5
|
* opens an interactive schema browser UI in the browser.
|
|
6
6
|
*/
|
|
7
|
-
import type { Tool } from
|
|
8
|
-
import type { ConvexClient } from
|
|
7
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import type { ConvexClient } from "../convex-client.js";
|
|
9
9
|
export declare const schemaBrowserTool: Tool;
|
|
10
10
|
interface ToolResponse {
|
|
11
11
|
content: Array<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-browser.d.ts","sourceRoot":"","sources":["../../src/tools/schema-browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"schema-browser.d.ts","sourceRoot":"","sources":["../../src/tools/schema-browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,eAAO,MAAM,iBAAiB,EAAE,IAsC/B,CAAC;AAEF,UAAU,YAAY;IACpB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACjC,OAAO,CAAC,YAAY,CAAC,CAuIvB"}
|