@code-rag/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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CodeRAG Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @code-rag/mcp-server
2
+
3
+ MCP server for CodeRAG -- exposes codebase search, context, explain, and status tools via the Model Context Protocol (stdio and SSE transports).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @code-rag/mcp-server
9
+ ```
10
+
11
+ ## Tools
12
+
13
+ - `coderag_search` -- semantic + keyword hybrid search over the codebase
14
+ - `coderag_context` -- retrieve assembled context within a token budget
15
+ - `coderag_explain` -- explain code symbols with dependency context
16
+ - `coderag_status` -- show index health and statistics
17
+
18
+ ## Documentation
19
+
20
+ See the [main repository](https://dev.azure.com/momc-pl/CodeRAG/_git/CodeRAG) for full documentation.
21
+
22
+ ## License
23
+
24
+ MIT
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ export { CodeRAGServer, MCP_SERVER_VERSION, NO_INDEX_MESSAGE } from './server.js';
3
+ export { handleSearch, searchInputSchema, type SearchInput, type SearchToolResult } from './tools/search.js';
4
+ export { handleContext, contextInputSchema, type ContextInput } from './tools/context.js';
5
+ export { handleStatus, type StatusResult } from './tools/status.js';
6
+ export { handleExplain, explainInputSchema, type ExplainInput } from './tools/explain.js';
7
+ export { handleBacklog, backlogInputSchema, type BacklogInput } from './tools/backlog.js';
8
+ export { handleDocs, docsInputSchema, type DocsInput, type DocsToolResult } from './tools/docs.js';
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import { fileURLToPath } from 'node:url';
3
+ import { CodeRAGServer } from './server.js';
4
+ export { CodeRAGServer, MCP_SERVER_VERSION, NO_INDEX_MESSAGE } from './server.js';
5
+ export { handleSearch, searchInputSchema } from './tools/search.js';
6
+ export { handleContext, contextInputSchema } from './tools/context.js';
7
+ export { handleStatus } from './tools/status.js';
8
+ export { handleExplain, explainInputSchema } from './tools/explain.js';
9
+ export { handleBacklog, backlogInputSchema } from './tools/backlog.js';
10
+ export { handleDocs, docsInputSchema } from './tools/docs.js';
11
+ async function main() {
12
+ const rootDir = process.argv[2] ?? process.cwd();
13
+ const server = new CodeRAGServer({ rootDir });
14
+ await server.initialize();
15
+ await server.connectStdio();
16
+ }
17
+ // Only run main when this module is executed directly (not imported)
18
+ const isMainModule = process.argv[1] === fileURLToPath(import.meta.url);
19
+ if (isMainModule) {
20
+ main().catch((error) => {
21
+ // eslint-disable-next-line no-console
22
+ console.error('Fatal error:', error);
23
+ process.exit(1);
24
+ });
25
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aA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52 @@
1
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
+ import { type IndexCheckResult } from '@code-rag/core';
3
+ export declare const MCP_SERVER_VERSION = "0.1.0";
4
+ /** Message printed when the CLI `serve` command cannot find an index. */
5
+ export declare const NO_INDEX_MESSAGE = "CodeRAG: No index found for this project.\n\nTo build the RAG index, run:\n npx coderag index\n\nOr in VS Code, use the command:\n CodeRAG: Index\n\nThe MCP server will start automatically once indexing is complete.";
6
+ export interface CodeRAGServerOptions {
7
+ rootDir: string;
8
+ }
9
+ export declare class CodeRAGServer {
10
+ private readonly server;
11
+ private readonly rootDir;
12
+ private config;
13
+ private store;
14
+ private hybridSearch;
15
+ private contextExpander;
16
+ private reranker;
17
+ private backlogProvider;
18
+ private httpServer;
19
+ private transports;
20
+ private indexCheck;
21
+ constructor(options: CodeRAGServerOptions);
22
+ /**
23
+ * Check whether a RAG index exists for the project.
24
+ * Loads config to determine storage path, then checks for LanceDB + BM25 data.
25
+ * Returns the index check result, or null if config could not be loaded.
26
+ */
27
+ checkIndex(): Promise<IndexCheckResult | null>;
28
+ /** Get the current index check result (set during initialize). */
29
+ getIndexCheck(): IndexCheckResult;
30
+ /**
31
+ * Initialize all services: load config, connect LanceDB, build indices.
32
+ * Fails gracefully -- the server still starts even if initialization errors occur.
33
+ */
34
+ initialize(): Promise<void>;
35
+ private registerHandlers;
36
+ connectStdio(): Promise<void>;
37
+ /**
38
+ * Start the MCP server with SSE transport on the given port.
39
+ *
40
+ * - GET /sse — establishes the SSE stream
41
+ * - POST /messages — receives JSON-RPC messages from the client
42
+ *
43
+ * Returns a promise that resolves once the HTTP server is listening.
44
+ */
45
+ connectSSE(port: number): Promise<void>;
46
+ /**
47
+ * Gracefully shut down the HTTP server (if running) and close all SSE transports.
48
+ */
49
+ close(): Promise<void>;
50
+ /** Expose for testing. */
51
+ getServer(): Server;
52
+ }
package/dist/server.js ADDED
@@ -0,0 +1,420 @@
1
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
5
+ import { loadConfig, checkIndexExists, OllamaEmbeddingProvider, LanceDBStore, BM25Index, HybridSearch, DependencyGraph, ContextExpander, CrossEncoderReRanker, } from '@code-rag/core';
6
+ import { readFile } from 'node:fs/promises';
7
+ import { join, resolve } from 'node:path';
8
+ import { createServer } from 'node:http';
9
+ import { URL } from 'node:url';
10
+ import { handleSearch } from './tools/search.js';
11
+ import { handleContext } from './tools/context.js';
12
+ import { handleStatus } from './tools/status.js';
13
+ import { handleExplain } from './tools/explain.js';
14
+ import { handleBacklog } from './tools/backlog.js';
15
+ import { handleDocs } from './tools/docs.js';
16
+ export const MCP_SERVER_VERSION = '0.1.0';
17
+ /** Message printed when the CLI `serve` command cannot find an index. */
18
+ export const NO_INDEX_MESSAGE = `CodeRAG: No index found for this project.
19
+
20
+ To build the RAG index, run:
21
+ npx coderag index
22
+
23
+ Or in VS Code, use the command:
24
+ CodeRAG: Index
25
+
26
+ The MCP server will start automatically once indexing is complete.`;
27
+ export class CodeRAGServer {
28
+ server;
29
+ rootDir;
30
+ config = null;
31
+ store = null;
32
+ hybridSearch = null;
33
+ contextExpander = null;
34
+ reranker = null;
35
+ backlogProvider = null;
36
+ httpServer = null;
37
+ transports = new Map();
38
+ indexCheck = { exists: false, empty: false };
39
+ constructor(options) {
40
+ this.rootDir = options.rootDir;
41
+ this.server = new Server({ name: 'coderag', version: MCP_SERVER_VERSION }, { capabilities: { tools: {} } });
42
+ this.registerHandlers();
43
+ }
44
+ /**
45
+ * Check whether a RAG index exists for the project.
46
+ * Loads config to determine storage path, then checks for LanceDB + BM25 data.
47
+ * Returns the index check result, or null if config could not be loaded.
48
+ */
49
+ async checkIndex() {
50
+ const configResult = await loadConfig(this.rootDir);
51
+ if (configResult.isErr()) {
52
+ return null;
53
+ }
54
+ const config = configResult.value;
55
+ const storagePath = resolve(this.rootDir, config.storage.path);
56
+ if (!storagePath.startsWith(resolve(this.rootDir))) {
57
+ return null;
58
+ }
59
+ return checkIndexExists(storagePath);
60
+ }
61
+ /** Get the current index check result (set during initialize). */
62
+ getIndexCheck() {
63
+ return this.indexCheck;
64
+ }
65
+ /**
66
+ * Initialize all services: load config, connect LanceDB, build indices.
67
+ * Fails gracefully -- the server still starts even if initialization errors occur.
68
+ */
69
+ async initialize() {
70
+ try {
71
+ const configResult = await loadConfig(this.rootDir);
72
+ if (configResult.isErr()) {
73
+ // eslint-disable-next-line no-console
74
+ console.error(`[coderag] Config load failed: ${configResult.error.message}`);
75
+ return;
76
+ }
77
+ this.config = configResult.value;
78
+ // Create embedding provider
79
+ const embeddingProvider = new OllamaEmbeddingProvider({
80
+ model: this.config.embedding.model,
81
+ dimensions: this.config.embedding.dimensions,
82
+ });
83
+ // Create LanceDB store (validate path stays within rootDir)
84
+ const storagePath = resolve(this.rootDir, this.config.storage.path);
85
+ if (!storagePath.startsWith(resolve(this.rootDir))) {
86
+ // eslint-disable-next-line no-console
87
+ console.error('[coderag] Storage path escapes project root');
88
+ return;
89
+ }
90
+ // Check index existence before connecting
91
+ this.indexCheck = await checkIndexExists(storagePath);
92
+ this.store = new LanceDBStore(storagePath, this.config.embedding.dimensions);
93
+ await this.store.connect();
94
+ // Create BM25 index -- try to load from stored data
95
+ let bm25Index = new BM25Index();
96
+ const bm25Path = join(storagePath, 'bm25-index.json');
97
+ try {
98
+ const bm25Data = await readFile(bm25Path, 'utf-8');
99
+ bm25Index = BM25Index.deserialize(bm25Data);
100
+ }
101
+ catch {
102
+ // No saved BM25 index, start empty
103
+ }
104
+ // Create HybridSearch
105
+ this.hybridSearch = new HybridSearch(this.store, bm25Index, embeddingProvider, this.config.search);
106
+ // Create re-ranker if enabled
107
+ if (this.config.reranker?.enabled) {
108
+ this.reranker = new CrossEncoderReRanker({
109
+ model: this.config.reranker.model,
110
+ topN: this.config.reranker.topN,
111
+ });
112
+ }
113
+ // Load dependency graph if available
114
+ let graph = new DependencyGraph();
115
+ const graphPath = join(storagePath, 'graph.json');
116
+ try {
117
+ const graphData = await readFile(graphPath, 'utf-8');
118
+ const parsed = JSON.parse(graphData);
119
+ graph = DependencyGraph.fromJSON(parsed);
120
+ }
121
+ catch {
122
+ // No saved graph, start empty
123
+ }
124
+ // Create retrieval services
125
+ const chunkLookup = (_chunkId) => {
126
+ // In a full implementation this would look up chunks by ID.
127
+ // For now, the context expander will only work with chunks found via search.
128
+ return undefined;
129
+ };
130
+ this.contextExpander = new ContextExpander(graph, chunkLookup);
131
+ }
132
+ catch (error) {
133
+ const message = error instanceof Error ? error.message : 'Unknown error';
134
+ // eslint-disable-next-line no-console
135
+ console.error(`[coderag] Initialization failed: ${message}`);
136
+ }
137
+ }
138
+ registerHandlers() {
139
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
140
+ tools: [
141
+ {
142
+ name: 'coderag_search',
143
+ description: 'Search the indexed codebase using hybrid semantic + keyword search. Returns matching code chunks with file paths, types, content, and relevance scores.',
144
+ inputSchema: {
145
+ type: 'object',
146
+ properties: {
147
+ query: {
148
+ type: 'string',
149
+ description: 'Natural language search query',
150
+ },
151
+ language: {
152
+ type: 'string',
153
+ description: 'Filter results by programming language (e.g. "typescript", "python")',
154
+ },
155
+ file_path: {
156
+ type: 'string',
157
+ description: 'Filter results by file path substring',
158
+ },
159
+ chunk_type: {
160
+ type: 'string',
161
+ description: 'Filter by chunk type: function, method, class, module, interface, type_alias, config_block, import_block',
162
+ },
163
+ top_k: {
164
+ type: 'number',
165
+ description: 'Maximum number of results to return (default: 10)',
166
+ },
167
+ },
168
+ required: ['query'],
169
+ },
170
+ },
171
+ {
172
+ name: 'coderag_context',
173
+ description: 'Assemble rich context for a specific file, including primary code chunks, related chunks from the dependency graph, and a dependency graph excerpt. Output is token-budgeted.',
174
+ inputSchema: {
175
+ type: 'object',
176
+ properties: {
177
+ file_path: {
178
+ type: 'string',
179
+ description: 'Target file path to get context for',
180
+ },
181
+ include_tests: {
182
+ type: 'boolean',
183
+ description: 'Include test files in context (default: true)',
184
+ },
185
+ include_interfaces: {
186
+ type: 'boolean',
187
+ description: 'Include interface/type chunks in context (default: true)',
188
+ },
189
+ max_tokens: {
190
+ type: 'number',
191
+ description: 'Maximum token budget for assembled context (default: 8000)',
192
+ },
193
+ },
194
+ required: ['file_path'],
195
+ },
196
+ },
197
+ {
198
+ name: 'coderag_explain',
199
+ description: 'Get a detailed natural language explanation of a code module, function, or class. Returns NL summaries, code content, and related symbols. At least one of file_path or name must be provided.',
200
+ inputSchema: {
201
+ type: 'object',
202
+ properties: {
203
+ file_path: {
204
+ type: 'string',
205
+ description: 'File path to explain',
206
+ },
207
+ name: {
208
+ type: 'string',
209
+ description: 'Function, class, or method name to search for and explain',
210
+ },
211
+ detail_level: {
212
+ type: 'string',
213
+ enum: ['brief', 'detailed'],
214
+ description: 'Level of detail: "brief" for summaries only, "detailed" for full code + dependencies (default: "detailed")',
215
+ },
216
+ },
217
+ required: [],
218
+ },
219
+ },
220
+ {
221
+ name: 'coderag_status',
222
+ description: 'Get the current status of the CodeRAG index, including total chunks, model info, configured languages, and health status.',
223
+ inputSchema: {
224
+ type: 'object',
225
+ properties: {},
226
+ required: [],
227
+ },
228
+ },
229
+ {
230
+ name: 'coderag_backlog',
231
+ description: 'Query project backlog items linked to code. Supports searching by text, retrieving by ID, and listing with filters for type, state, and tags.',
232
+ inputSchema: {
233
+ type: 'object',
234
+ properties: {
235
+ action: {
236
+ type: 'string',
237
+ enum: ['search', 'get', 'list'],
238
+ description: 'Action to perform: "search" to find items by text, "get" to retrieve a single item by ID, "list" to list items with filters',
239
+ },
240
+ query: {
241
+ type: 'string',
242
+ description: 'Search text (required for "search" action)',
243
+ },
244
+ id: {
245
+ type: 'string',
246
+ description: 'Item ID (required for "get" action)',
247
+ },
248
+ types: {
249
+ type: 'array',
250
+ items: { type: 'string', enum: ['epic', 'story', 'task', 'bug', 'feature'] },
251
+ description: 'Filter by backlog item types',
252
+ },
253
+ states: {
254
+ type: 'array',
255
+ items: { type: 'string' },
256
+ description: 'Filter by item states (e.g. "New", "Active", "Resolved")',
257
+ },
258
+ tags: {
259
+ type: 'array',
260
+ items: { type: 'string' },
261
+ description: 'Filter by tags',
262
+ },
263
+ limit: {
264
+ type: 'number',
265
+ description: 'Maximum number of results to return (default: 10, max: 50)',
266
+ },
267
+ },
268
+ required: ['action'],
269
+ },
270
+ },
271
+ {
272
+ name: 'coderag_docs',
273
+ description: 'Search project documentation (Markdown, Confluence, etc.) for relevant sections.',
274
+ inputSchema: {
275
+ type: 'object',
276
+ properties: {
277
+ query: {
278
+ type: 'string',
279
+ description: 'Natural language search query for documentation',
280
+ },
281
+ source: {
282
+ type: 'string',
283
+ enum: ['markdown', 'confluence', 'all'],
284
+ description: 'Filter by documentation source: "markdown" for local .md files, "confluence" for Confluence pages, "all" for everything (default: "all")',
285
+ },
286
+ file_path: {
287
+ type: 'string',
288
+ description: 'Filter results by file path substring',
289
+ },
290
+ top_k: {
291
+ type: 'number',
292
+ description: 'Maximum number of results to return (default: 10)',
293
+ },
294
+ },
295
+ required: ['query'],
296
+ },
297
+ },
298
+ ],
299
+ }));
300
+ this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
301
+ const { name, arguments: args } = request.params;
302
+ const safeArgs = args ?? {};
303
+ switch (name) {
304
+ case 'coderag_search':
305
+ return handleSearch(safeArgs, this.hybridSearch, this.reranker);
306
+ case 'coderag_context':
307
+ return handleContext(safeArgs, this.hybridSearch, this.contextExpander);
308
+ case 'coderag_explain':
309
+ return handleExplain(safeArgs, this.hybridSearch, this.contextExpander);
310
+ case 'coderag_status':
311
+ return handleStatus(this.store, this.config);
312
+ case 'coderag_backlog':
313
+ return handleBacklog(safeArgs, this.backlogProvider);
314
+ case 'coderag_docs':
315
+ return handleDocs(safeArgs, this.hybridSearch, this.reranker);
316
+ default:
317
+ return {
318
+ content: [
319
+ {
320
+ type: 'text',
321
+ text: JSON.stringify({ error: `Unknown tool: ${name}` }),
322
+ },
323
+ ],
324
+ };
325
+ }
326
+ });
327
+ }
328
+ async connectStdio() {
329
+ const transport = new StdioServerTransport();
330
+ await this.server.connect(transport);
331
+ }
332
+ /**
333
+ * Start the MCP server with SSE transport on the given port.
334
+ *
335
+ * - GET /sse — establishes the SSE stream
336
+ * - POST /messages — receives JSON-RPC messages from the client
337
+ *
338
+ * Returns a promise that resolves once the HTTP server is listening.
339
+ */
340
+ async connectSSE(port) {
341
+ const setCorsHeaders = (res) => {
342
+ res.setHeader('Access-Control-Allow-Origin', '*');
343
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
344
+ res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
345
+ };
346
+ this.httpServer = createServer(async (req, res) => {
347
+ setCorsHeaders(res);
348
+ // Handle CORS preflight
349
+ if (req.method === 'OPTIONS') {
350
+ res.writeHead(204).end();
351
+ return;
352
+ }
353
+ const parsedUrl = new URL(req.url ?? '/', `http://localhost:${port}`);
354
+ const pathname = parsedUrl.pathname;
355
+ if (req.method === 'GET' && pathname === '/sse') {
356
+ // Close any existing connections — SSEServerTransport is single-client.
357
+ // This handles VS Code extension reloads gracefully.
358
+ for (const [id, old] of this.transports) {
359
+ await old.close();
360
+ this.transports.delete(id);
361
+ }
362
+ await this.server.close();
363
+ const transport = new SSEServerTransport('/messages', res);
364
+ this.transports.set(transport.sessionId, transport);
365
+ res.on('close', () => {
366
+ this.transports.delete(transport.sessionId);
367
+ });
368
+ await this.server.connect(transport);
369
+ return;
370
+ }
371
+ if (req.method === 'POST' && pathname === '/messages') {
372
+ const sessionId = parsedUrl.searchParams.get('sessionId');
373
+ if (!sessionId) {
374
+ res.writeHead(400).end('Missing sessionId');
375
+ return;
376
+ }
377
+ const transport = this.transports.get(sessionId);
378
+ if (!transport) {
379
+ res.writeHead(400).end('No transport found for sessionId');
380
+ return;
381
+ }
382
+ await transport.handlePostMessage(req, res);
383
+ return;
384
+ }
385
+ // Unknown route
386
+ res.writeHead(404).end('Not Found');
387
+ });
388
+ return new Promise((resolvePromise, reject) => {
389
+ this.httpServer.on('error', reject);
390
+ this.httpServer.listen(port, () => {
391
+ resolvePromise();
392
+ });
393
+ });
394
+ }
395
+ /**
396
+ * Gracefully shut down the HTTP server (if running) and close all SSE transports.
397
+ */
398
+ async close() {
399
+ // Close all active transports
400
+ for (const [sessionId, transport] of this.transports) {
401
+ await transport.close();
402
+ this.transports.delete(sessionId);
403
+ }
404
+ if (this.httpServer) {
405
+ await new Promise((resolvePromise, reject) => {
406
+ this.httpServer.close((err) => {
407
+ if (err)
408
+ reject(err);
409
+ else
410
+ resolvePromise();
411
+ });
412
+ });
413
+ this.httpServer = null;
414
+ }
415
+ }
416
+ /** Expose for testing. */
417
+ getServer() {
418
+ return this.server;
419
+ }
420
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,eAAe,EACf,eAAe,EACf,oBAAoB,GAQrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAwE,MAAM,WAAW,CAAC;AAC/G,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,O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