cursor-feedback 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.
@@ -0,0 +1,445 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * MCP Server 独立入口文件
5
+ *
6
+ * 此文件用于作为独立进程运行 MCP Server
7
+ * Cursor/VS Code 会通过 stdio 与此服务器通信
8
+ *
9
+ * 使用方法:
10
+ * 在 Cursor 的 MCP 配置中添加:
11
+ * {
12
+ * "mcpServers": {
13
+ * "cursor-feedback": {
14
+ * "command": "node",
15
+ * "args": ["/path/to/dist/mcp-server.js"]
16
+ * }
17
+ * }
18
+ * }
19
+ */
20
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
32
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
33
+ }) : function(o, v) {
34
+ o["default"] = v;
35
+ });
36
+ var __importStar = (this && this.__importStar) || (function () {
37
+ var ownKeys = function(o) {
38
+ ownKeys = Object.getOwnPropertyNames || function (o) {
39
+ var ar = [];
40
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
41
+ return ar;
42
+ };
43
+ return ownKeys(o);
44
+ };
45
+ return function (mod) {
46
+ if (mod && mod.__esModule) return mod;
47
+ var result = {};
48
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
49
+ __setModuleDefault(result, mod);
50
+ return result;
51
+ };
52
+ })();
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
55
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
56
+ const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
57
+ const http = __importStar(require("http"));
58
+ const os = __importStar(require("os"));
59
+ // 调试日志输出到 stderr(不影响 stdio 通信)
60
+ function debugLog(message) {
61
+ const timestamp = new Date().toISOString();
62
+ console.error(`[${timestamp}] ${message}`);
63
+ }
64
+ /**
65
+ * MCP Feedback Server
66
+ */
67
+ class McpFeedbackServer {
68
+ constructor(port = 8766) {
69
+ this.httpServer = null;
70
+ // 待处理的反馈请求
71
+ this.pendingRequests = new Map();
72
+ // 当前反馈请求
73
+ this.currentRequest = null;
74
+ this.port = port;
75
+ this.server = new index_js_1.Server({
76
+ name: 'cursor-feedback-server',
77
+ version: '0.0.1',
78
+ }, {
79
+ capabilities: {
80
+ tools: {},
81
+ },
82
+ });
83
+ this.setupHandlers();
84
+ }
85
+ setupHandlers() {
86
+ // 列出可用工具
87
+ this.server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
88
+ return {
89
+ tools: [
90
+ {
91
+ name: 'interactive_feedback',
92
+ description: `Interactive feedback collection tool for LLM agents.
93
+
94
+ USAGE RULES:
95
+ 1. During any process, task, or conversation, whether asking, replying, or completing phased tasks, you must call this tool to ask for feedback.
96
+ 2. Unless receiving termination instructions, all steps must repeatedly call this tool.
97
+ 3. Whenever user feedback is received, if the feedback content is not empty, you must call this tool again and adjust behavior based on the feedback content.
98
+ 4. Only when the user explicitly indicates "end" or "no more interaction needed" can you stop calling this tool, and the process is considered complete.
99
+ 5. You should summarize what have done, and provide project directory through args to let user know what you have done to provide feedback for next step.
100
+
101
+ Args:
102
+ project_directory: Project directory path for context
103
+ summary: Summary of AI work completed for user review
104
+ timeout: Timeout in seconds for waiting user feedback (default: 600 seconds)
105
+
106
+ Returns:
107
+ list: List containing TextContent and MCPImage objects representing user feedback`,
108
+ inputSchema: {
109
+ type: 'object',
110
+ properties: {
111
+ project_directory: {
112
+ type: 'string',
113
+ description: 'Project directory path for context',
114
+ default: '.',
115
+ },
116
+ summary: {
117
+ type: 'string',
118
+ description: 'Summary of AI work completed for user review',
119
+ default: 'I have completed the task you requested.',
120
+ },
121
+ timeout: {
122
+ type: 'number',
123
+ description: 'Timeout in seconds for waiting user feedback (default: 600 seconds)',
124
+ default: 600,
125
+ },
126
+ },
127
+ },
128
+ },
129
+ {
130
+ name: 'get_system_info',
131
+ description: 'Get system environment information',
132
+ inputSchema: {
133
+ type: 'object',
134
+ properties: {},
135
+ },
136
+ },
137
+ ],
138
+ };
139
+ });
140
+ // 处理工具调用
141
+ this.server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
142
+ const { name, arguments: args } = request.params;
143
+ switch (name) {
144
+ case 'interactive_feedback':
145
+ return this.handleInteractiveFeedback(args);
146
+ case 'get_system_info':
147
+ return this.handleGetSystemInfo();
148
+ default:
149
+ throw new Error(`Unknown tool: ${name}`);
150
+ }
151
+ });
152
+ }
153
+ /**
154
+ * 处理交互式反馈请求
155
+ */
156
+ async handleInteractiveFeedback(args) {
157
+ const projectDir = args?.project_directory || '.';
158
+ const summary = args?.summary || 'I have completed the task you requested.';
159
+ const timeout = args?.timeout || 600;
160
+ const requestId = this.generateRequestId();
161
+ // 创建反馈请求
162
+ this.currentRequest = {
163
+ id: requestId,
164
+ summary,
165
+ projectDir,
166
+ timeout,
167
+ timestamp: Date.now(),
168
+ };
169
+ debugLog(`Feedback request created: ${requestId}`);
170
+ debugLog(`Summary: ${summary}`);
171
+ debugLog(`Project: ${projectDir}`);
172
+ debugLog(`Timeout: ${timeout}s`);
173
+ debugLog(`Waiting for VS Code extension to collect feedback...`);
174
+ try {
175
+ // 等待用户反馈
176
+ const result = await this.waitForFeedback(requestId, timeout * 1000);
177
+ if (!result) {
178
+ debugLog('Feedback request timed out or cancelled');
179
+ return {
180
+ content: [
181
+ {
182
+ type: 'text',
183
+ text: 'User cancelled the feedback or timeout.',
184
+ },
185
+ ],
186
+ };
187
+ }
188
+ debugLog(`Received feedback: ${result.interactive_feedback?.substring(0, 100)}...`);
189
+ const contentItems = [];
190
+ // 添加文字反馈
191
+ if (result.interactive_feedback) {
192
+ contentItems.push({
193
+ type: 'text',
194
+ text: `=== User Feedback ===\n${result.interactive_feedback}`,
195
+ });
196
+ }
197
+ // 添加图片
198
+ if (result.images && result.images.length > 0) {
199
+ debugLog(`Processing ${result.images.length} images`);
200
+ for (const img of result.images) {
201
+ contentItems.push({
202
+ type: 'image',
203
+ data: img.data,
204
+ mimeType: this.getMimeType(img.name),
205
+ });
206
+ }
207
+ }
208
+ if (contentItems.length === 0) {
209
+ contentItems.push({
210
+ type: 'text',
211
+ text: 'User did not provide any feedback.',
212
+ });
213
+ }
214
+ return { content: contentItems };
215
+ }
216
+ catch (error) {
217
+ debugLog(`Error collecting feedback: ${error}`);
218
+ return {
219
+ content: [
220
+ {
221
+ type: 'text',
222
+ text: `Error collecting feedback: ${error}`,
223
+ },
224
+ ],
225
+ };
226
+ }
227
+ finally {
228
+ this.currentRequest = null;
229
+ }
230
+ }
231
+ /**
232
+ * 等待用户反馈
233
+ */
234
+ waitForFeedback(requestId, timeoutMs) {
235
+ return new Promise((resolve) => {
236
+ const timeout = setTimeout(() => {
237
+ debugLog(`Request ${requestId} timed out`);
238
+ this.pendingRequests.delete(requestId);
239
+ resolve(null);
240
+ }, timeoutMs);
241
+ this.pendingRequests.set(requestId, {
242
+ resolve,
243
+ reject: () => resolve(null),
244
+ timeout
245
+ });
246
+ });
247
+ }
248
+ /**
249
+ * 处理获取系统信息请求
250
+ */
251
+ handleGetSystemInfo() {
252
+ const systemInfo = {
253
+ platform: process.platform,
254
+ nodeVersion: process.version,
255
+ arch: process.arch,
256
+ hostname: os.hostname(),
257
+ interfaceType: 'VS Code Extension',
258
+ mcpServerPort: this.port,
259
+ pid: process.pid,
260
+ };
261
+ return {
262
+ content: [
263
+ {
264
+ type: 'text',
265
+ text: JSON.stringify(systemInfo, null, 2),
266
+ },
267
+ ],
268
+ };
269
+ }
270
+ /**
271
+ * 根据文件名获取 MIME 类型
272
+ */
273
+ getMimeType(filename) {
274
+ const ext = filename.toLowerCase().split('.').pop();
275
+ switch (ext) {
276
+ case 'jpg':
277
+ case 'jpeg':
278
+ return 'image/jpeg';
279
+ case 'png':
280
+ return 'image/png';
281
+ case 'gif':
282
+ return 'image/gif';
283
+ case 'webp':
284
+ return 'image/webp';
285
+ default:
286
+ return 'image/png';
287
+ }
288
+ }
289
+ /**
290
+ * 生成唯一的请求 ID
291
+ */
292
+ generateRequestId() {
293
+ return `req_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
294
+ }
295
+ /**
296
+ * 启动 HTTP 服务器,用于与 VS Code 插件通信
297
+ */
298
+ startHttpServer() {
299
+ return new Promise((resolve, reject) => {
300
+ this.httpServer = http.createServer((req, res) => {
301
+ // 设置 CORS 头
302
+ res.setHeader('Access-Control-Allow-Origin', '*');
303
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
304
+ res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
305
+ if (req.method === 'OPTIONS') {
306
+ res.writeHead(200);
307
+ res.end();
308
+ return;
309
+ }
310
+ // 获取当前反馈请求
311
+ if (req.method === 'GET' && req.url === '/api/feedback/current') {
312
+ res.writeHead(200, { 'Content-Type': 'application/json' });
313
+ res.end(JSON.stringify(this.currentRequest || null));
314
+ return;
315
+ }
316
+ // 提交反馈
317
+ if (req.method === 'POST' && req.url === '/api/feedback/submit') {
318
+ let body = '';
319
+ req.on('data', chunk => {
320
+ body += chunk.toString();
321
+ });
322
+ req.on('end', () => {
323
+ try {
324
+ const data = JSON.parse(body);
325
+ const { requestId, feedback } = data;
326
+ debugLog(`Received feedback submission for request: ${requestId}`);
327
+ const pending = this.pendingRequests.get(requestId);
328
+ if (pending) {
329
+ clearTimeout(pending.timeout);
330
+ pending.resolve(feedback);
331
+ this.pendingRequests.delete(requestId);
332
+ res.writeHead(200, { 'Content-Type': 'application/json' });
333
+ res.end(JSON.stringify({ success: true }));
334
+ }
335
+ else {
336
+ debugLog(`Request ${requestId} not found`);
337
+ res.writeHead(404, { 'Content-Type': 'application/json' });
338
+ res.end(JSON.stringify({ error: 'Request not found' }));
339
+ }
340
+ }
341
+ catch (error) {
342
+ debugLog(`Invalid request body: ${error}`);
343
+ res.writeHead(400, { 'Content-Type': 'application/json' });
344
+ res.end(JSON.stringify({ error: 'Invalid request body' }));
345
+ }
346
+ });
347
+ return;
348
+ }
349
+ // 健康检查
350
+ if (req.method === 'GET' && req.url === '/api/health') {
351
+ res.writeHead(200, { 'Content-Type': 'application/json' });
352
+ res.end(JSON.stringify({
353
+ status: 'ok',
354
+ version: '0.0.1',
355
+ hasCurrentRequest: this.currentRequest !== null,
356
+ }));
357
+ return;
358
+ }
359
+ res.writeHead(404);
360
+ res.end('Not Found');
361
+ });
362
+ this.httpServer.on('error', (err) => {
363
+ if (err.code === 'EADDRINUSE') {
364
+ debugLog(`Port ${this.port} is already in use, trying next port...`);
365
+ this.port++;
366
+ this.httpServer?.close();
367
+ this.startHttpServer().then(resolve).catch(reject);
368
+ }
369
+ else {
370
+ reject(err);
371
+ }
372
+ });
373
+ this.httpServer.listen(this.port, '127.0.0.1', () => {
374
+ debugLog(`HTTP Server listening on http://127.0.0.1:${this.port}`);
375
+ resolve();
376
+ });
377
+ });
378
+ }
379
+ /**
380
+ * 启动服务器
381
+ */
382
+ async start() {
383
+ try {
384
+ debugLog('Starting MCP Feedback Server...');
385
+ // 启动 HTTP 服务器
386
+ await this.startHttpServer();
387
+ // 启动 MCP stdio 传输
388
+ const transport = new stdio_js_1.StdioServerTransport();
389
+ await this.server.connect(transport);
390
+ debugLog('MCP Server started successfully');
391
+ debugLog('Waiting for tool calls from AI agent...');
392
+ }
393
+ catch (error) {
394
+ debugLog(`Failed to start server: ${error}`);
395
+ throw error;
396
+ }
397
+ }
398
+ /**
399
+ * 停止服务器
400
+ */
401
+ stop() {
402
+ debugLog('Stopping server...');
403
+ // 关闭 HTTP 服务器
404
+ if (this.httpServer) {
405
+ this.httpServer.close();
406
+ this.httpServer = null;
407
+ }
408
+ // 清理待处理的请求
409
+ for (const [, pending] of this.pendingRequests) {
410
+ clearTimeout(pending.timeout);
411
+ pending.resolve(null);
412
+ }
413
+ this.pendingRequests.clear();
414
+ // 关闭 MCP 服务器
415
+ this.server.close();
416
+ debugLog('Server stopped');
417
+ }
418
+ }
419
+ // 主函数
420
+ async function main() {
421
+ const port = parseInt(process.env.MCP_FEEDBACK_PORT || '5678', 10);
422
+ const server = new McpFeedbackServer(port);
423
+ // 处理进程信号
424
+ process.on('SIGINT', () => {
425
+ debugLog('Received SIGINT');
426
+ server.stop();
427
+ process.exit(0);
428
+ });
429
+ process.on('SIGTERM', () => {
430
+ debugLog('Received SIGTERM');
431
+ server.stop();
432
+ process.exit(0);
433
+ });
434
+ process.on('uncaughtException', (error) => {
435
+ debugLog(`Uncaught exception: ${error}`);
436
+ server.stop();
437
+ process.exit(1);
438
+ });
439
+ await server.start();
440
+ }
441
+ main().catch((error) => {
442
+ console.error('Failed to start MCP server:', error);
443
+ process.exit(1);
444
+ });
445
+ //# sourceMappingURL=mcp-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAG4C;AAC5C,2CAA6B;AAC7B,uCAAyB;AAEzB,+BAA+B;AAC/B,SAAS,QAAQ,CAAC,OAAe;IAC/B,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,OAAO,CAAC,KAAK,CAAC,IAAI,SAAS,KAAK,OAAO,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C,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;QACxC,QAAQ,CAAC,uBAAuB,KAAK,EAAE,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.FeedbackPanel = void 0;
37
+ const vscode = __importStar(require("vscode"));
38
+ /**
39
+ * 独立的反馈面板(用于在编辑器区域显示)
40
+ */
41
+ class FeedbackPanel {
42
+ static createOrShow(extensionUri) {
43
+ const column = vscode.window.activeTextEditor
44
+ ? vscode.window.activeTextEditor.viewColumn
45
+ : undefined;
46
+ // 如果面板已存在,显示它
47
+ if (FeedbackPanel.currentPanel) {
48
+ FeedbackPanel.currentPanel._panel.reveal(column);
49
+ return;
50
+ }
51
+ // 创建新面板
52
+ const panel = vscode.window.createWebviewPanel(FeedbackPanel.viewType, 'Cursor Feedback', column || vscode.ViewColumn.One, {
53
+ enableScripts: true,
54
+ localResourceRoots: [extensionUri],
55
+ retainContextWhenHidden: true,
56
+ });
57
+ FeedbackPanel.currentPanel = new FeedbackPanel(panel, extensionUri);
58
+ }
59
+ constructor(panel, extensionUri) {
60
+ this._disposables = [];
61
+ this._panel = panel;
62
+ this._extensionUri = extensionUri;
63
+ // 设置 HTML 内容
64
+ this._update();
65
+ // 监听面板关闭
66
+ this._panel.onDidDispose(() => this.dispose(), null, this._disposables);
67
+ // 监听面板状态变化
68
+ this._panel.onDidChangeViewState(() => {
69
+ if (this._panel.visible) {
70
+ this._update();
71
+ }
72
+ }, null, this._disposables);
73
+ // 处理来自 webview 的消息
74
+ this._panel.webview.onDidReceiveMessage((message) => {
75
+ switch (message.type) {
76
+ case 'submitFeedback':
77
+ vscode.window.showInformationMessage(`Feedback received: ${message.payload.interactive_feedback}`);
78
+ break;
79
+ }
80
+ }, null, this._disposables);
81
+ }
82
+ dispose() {
83
+ FeedbackPanel.currentPanel = undefined;
84
+ this._panel.dispose();
85
+ while (this._disposables.length) {
86
+ const x = this._disposables.pop();
87
+ if (x) {
88
+ x.dispose();
89
+ }
90
+ }
91
+ }
92
+ _update() {
93
+ const webview = this._panel.webview;
94
+ this._panel.title = 'Cursor Feedback';
95
+ this._panel.webview.html = this._getHtmlForWebview(webview);
96
+ }
97
+ _getHtmlForWebview(webview) {
98
+ return `<!DOCTYPE html>
99
+ <html lang="zh-CN">
100
+ <head>
101
+ <meta charset="UTF-8">
102
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
103
+ <title>Cursor Feedback</title>
104
+ <style>
105
+ body {
106
+ font-family: var(--vscode-font-family);
107
+ padding: 20px;
108
+ color: var(--vscode-foreground);
109
+ background-color: var(--vscode-editor-background);
110
+ }
111
+
112
+ h1 {
113
+ color: var(--vscode-foreground);
114
+ border-bottom: 1px solid var(--vscode-panel-border);
115
+ padding-bottom: 10px;
116
+ }
117
+
118
+ .info {
119
+ background: var(--vscode-textBlockQuote-background);
120
+ padding: 15px;
121
+ border-radius: 4px;
122
+ margin: 20px 0;
123
+ }
124
+ </style>
125
+ </head>
126
+ <body>
127
+ <h1>Cursor Feedback Panel</h1>
128
+ <div class="info">
129
+ <p>此面板用于显示独立的反馈界面。</p>
130
+ <p>通常情况下,请使用侧边栏中的反馈面板进行交互。</p>
131
+ </div>
132
+ </body>
133
+ </html>`;
134
+ }
135
+ }
136
+ exports.FeedbackPanel = FeedbackPanel;
137
+ FeedbackPanel.viewType = 'cursorFeedback';
138
+ //# sourceMappingURL=FeedbackPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedbackPanel.js","sourceRoot":"","sources":["../../src/webview/FeedbackPanel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC;;GAEG;AACH,MAAa,aAAa;IAQjB,MAAM,CAAC,YAAY,CAAC,YAAwB;QACjD,MAAM,MAAM,GAAG,MAAM,CAAC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