@ai-agent-context/mcp 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 ai-agent-context 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,308 @@
1
+ # @ai-agent-context/mcp
2
+
3
+ MCP (Model Context Protocol) adapter for `ai-agent-context`.
4
+
5
+ This package provides MCP tools that allow AI agents (like Claude, etc.) to query repository context directly.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @ai-agent-context/mcp
11
+ ```
12
+
13
+ ## MCP Tools
14
+
15
+ ### `get_repository_context`
16
+
17
+ Get the complete repository context.
18
+
19
+ **Input:**
20
+ ```json
21
+ {
22
+ "root": "/path/to/repository"
23
+ }
24
+ ```
25
+
26
+ **Output:**
27
+ ```json
28
+ {
29
+ "repository": {
30
+ "name": "my-project",
31
+ "root": "/path/to/repository",
32
+ "files": 1284,
33
+ "modules": 42
34
+ },
35
+ "architecture": { ... },
36
+ "dependencies": { ... },
37
+ "conventions": [ ... ],
38
+ "decisions": [ ... ]
39
+ }
40
+ ```
41
+
42
+ ### `explain_module`
43
+
44
+ Explain a specific module.
45
+
46
+ **Input:**
47
+ ```json
48
+ {
49
+ "root": "/path/to/repository",
50
+ "target": "src/payments"
51
+ }
52
+ ```
53
+
54
+ **Output:**
55
+ ```json
56
+ {
57
+ "path": "src/payments",
58
+ "entryPoints": ["src/payments/index.ts"],
59
+ "responsibilities": ["payment processing", "refunds"],
60
+ "dependsOn": ["users", "events"],
61
+ "usedBy": ["checkout"],
62
+ "publicAPI": [ ... ],
63
+ "conventions": [ ... ],
64
+ "decisions": [ ... ]
65
+ }
66
+ ```
67
+
68
+ ### `get_dependencies`
69
+
70
+ Get dependency information.
71
+
72
+ **Input:**
73
+ ```json
74
+ {
75
+ "root": "/path/to/repository"
76
+ }
77
+ ```
78
+
79
+ **Output:**
80
+ ```json
81
+ {
82
+ "internal": [ ... ],
83
+ "external": [ ... ],
84
+ "workspaceDependencies": [ ... ]
85
+ }
86
+ ```
87
+
88
+ ### `get_dependents`
89
+
90
+ Get modules that depend on a given module.
91
+
92
+ **Input:**
93
+ ```json
94
+ {
95
+ "root": "/path/to/repository",
96
+ "moduleId": "payments"
97
+ }
98
+ ```
99
+
100
+ **Output:**
101
+ ```json
102
+ {
103
+ "moduleId": "payments",
104
+ "dependents": ["checkout", "subscription"]
105
+ }
106
+ ```
107
+
108
+ ### `search_context`
109
+
110
+ Search repository context.
111
+
112
+ **Input:**
113
+ ```json
114
+ {
115
+ "root": "/path/to/repository",
116
+ "query": "payment idempotency"
117
+ }
118
+ ```
119
+
120
+ **Output:**
121
+ ```json
122
+ {
123
+ "query": "payment idempotency",
124
+ "results": [
125
+ {
126
+ "type": "module",
127
+ "id": "payments",
128
+ "score": 0.95,
129
+ "reason": "module name and responsibilities match query"
130
+ }
131
+ ]
132
+ }
133
+ ```
134
+
135
+ ### `get_architecture`
136
+
137
+ Get architecture information.
138
+
139
+ **Input:**
140
+ ```json
141
+ {
142
+ "root": "/path/to/repository"
143
+ }
144
+ ```
145
+
146
+ **Output:**
147
+ ```json
148
+ {
149
+ "modules": [ ... ],
150
+ "layers": [ ... ],
151
+ "boundaries": [ ... ]
152
+ }
153
+ ```
154
+
155
+ ### `get_conventions`
156
+
157
+ Get detected conventions.
158
+
159
+ **Input:**
160
+ ```json
161
+ {
162
+ "root": "/path/to/repository"
163
+ }
164
+ ```
165
+
166
+ **Output:**
167
+ ```json
168
+ {
169
+ "conventions": [
170
+ {
171
+ "category": "Naming",
172
+ "statement": "Files use kebab-case",
173
+ "confidence": 0.9,
174
+ "evidence": [ ... ]
175
+ }
176
+ ]
177
+ }
178
+ ```
179
+
180
+ ### `get_decisions`
181
+
182
+ Get architectural decisions.
183
+
184
+ **Input:**
185
+ ```json
186
+ {
187
+ "root": "/path/to/repository"
188
+ }
189
+ ```
190
+
191
+ **Output:**
192
+ ```json
193
+ {
194
+ "decisions": [
195
+ {
196
+ "id": "ADR-001",
197
+ "title": "Use PostgreSQL for transactional data",
198
+ "status": "accepted",
199
+ "source": "docs/adr/001-postgresql.md"
200
+ }
201
+ ]
202
+ }
203
+ ```
204
+
205
+ ## Usage
206
+
207
+ ### Standalone MCP Server
208
+
209
+ ```typescript
210
+ import { createMcpServer } from '@ai-agent-context/mcp';
211
+
212
+ const server = createMcpServer({
213
+ root: process.cwd()
214
+ });
215
+
216
+ // Start the server
217
+ await server.start();
218
+ ```
219
+
220
+ ### With Claude Desktop
221
+
222
+ Add to your Claude Desktop configuration:
223
+
224
+ ```json
225
+ {
226
+ "mcpServers": {
227
+ "agent-context": {
228
+ "command": "node",
229
+ "args": ["path/to/@ai-agent-context/mcp/dist/server.js"],
230
+ "env": {
231
+ "AGENT_CONTEXT_ROOT": "/path/to/repository"
232
+ }
233
+ }
234
+ }
235
+ }
236
+ ```
237
+
238
+ ### Programmatic Usage
239
+
240
+ ```typescript
241
+ import { AgentContext } from '@ai-agent-context/core';
242
+ import { createMcpTools } from '@ai-agent-context/mcp';
243
+
244
+ const context = await AgentContext.load({ root: process.cwd() });
245
+ const tools = createMcpTools(context);
246
+
247
+ // Use tools with MCP server
248
+ // ...
249
+ ```
250
+
251
+ ## Architecture
252
+
253
+ The MCP adapter is a thin wrapper around the core API:
254
+
255
+ ```
256
+ AI Agent
257
+
258
+ MCP
259
+
260
+ @ai-agent-context/mcp
261
+
262
+ @ai-agent-context/core
263
+
264
+ Repository Knowledge Graph
265
+ ```
266
+
267
+ The MCP adapter:
268
+ - Does not contain business logic
269
+ - Only calls core API methods
270
+ - Transforms results to MCP-compatible format
271
+ - Handles MCP-specific error handling
272
+
273
+ ## Configuration
274
+
275
+ The MCP adapter respects the same configuration as the core package:
276
+
277
+ - `.agent/config.json` - Repository configuration
278
+ - `.agent/index.json` - Cached context
279
+ - Environment variables - Override configuration
280
+
281
+ ## Security
282
+
283
+ The MCP adapter inherits the security properties of the core package:
284
+
285
+ - **Local-only**: No external API calls
286
+ - **No telemetry**: No data sent to external services
287
+ - **Secret filtering**: Automatically excludes sensitive files
288
+ - **Repository-scoped**: Only accesses configured repository
289
+
290
+ ## Error Handling
291
+
292
+ The MCP adapter returns structured errors:
293
+
294
+ ```json
295
+ {
296
+ "error": {
297
+ "code": "CONTEXT_NOT_FOUND",
298
+ "message": "No usable .agent/ context found",
299
+ "suggestions": [
300
+ "Run: agent-context init && agent-context scan"
301
+ ]
302
+ }
303
+ }
304
+ ```
305
+
306
+ ## License
307
+
308
+ MIT
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/version.ts","../src/tools/definitions.ts","../../core/dist/model/types.d.ts","../../core/dist/adapters/language/types.d.ts","../../core/dist/adapters/language/registry.d.ts","../../core/dist/config/types.d.ts","../../core/dist/logging/diagnostics.d.ts","../../core/dist/adapters/git/git-adapter.d.ts","../../core/dist/core/serialization/types.d.ts","../../core/dist/core/serialization/reader.d.ts","../../core/dist/core/scanner/types.d.ts","../../core/dist/core/scanner/cache.d.ts","../../core/dist/core/context/types.d.ts","../../core/dist/core/search/types.d.ts","../../core/dist/core/graph/resolver.d.ts","../../core/dist/util/glob.d.ts","../../core/dist/adapters/filesystem/fs-adapter.d.ts","../../core/dist/core/scanner/scanner.d.ts","../../core/dist/core/graph/knowledge-graph.d.ts","../../core/dist/core/search/documents.d.ts","../../core/dist/core/search/service.d.ts","../../core/dist/agent-context.d.ts","../../core/dist/core/serialization/writer.d.ts","../../core/dist/pipeline/scan-pipeline.d.ts","../../core/dist/model/schema.d.ts","../../core/dist/model/canonical.d.ts","../../core/dist/errors.d.ts","../../core/dist/config/defaults.d.ts","../../core/dist/config/load.d.ts","../../core/dist/config/validate.d.ts","../../core/dist/adapters/filesystem/sensitive.d.ts","../../core/dist/adapters/language/ts-js/adapter.d.ts","../../core/dist/adapters/language/ts-js/lexer.d.ts","../../core/dist/adapters/language/ts-js/extractor.d.ts","../../core/dist/adapters/language/json/adapter.d.ts","../../core/dist/adapters/language/markdown/adapter.d.ts","../../core/dist/adapters/language/package-json/adapter.d.ts","../../core/dist/adapters/language/tsconfig/adapter.d.ts","../../core/dist/core/graph/modules.d.ts","../../core/dist/core/graph/aliases.d.ts","../../core/dist/core/workspace/workspace.d.ts","../../core/dist/core/workspace/package-facts.d.ts","../../core/dist/core/architecture/detector.d.ts","../../core/dist/core/architecture/entry-points.d.ts","../../core/dist/core/architecture/role-detector.d.ts","../../core/dist/core/conventions/detector.d.ts","../../core/dist/core/conventions/renderer.d.ts","../../core/dist/core/decisions/detector.d.ts","../../core/dist/core/git-analysis/activity.d.ts","../../core/dist/core/diff/differ.d.ts","../../core/dist/core/context/explain.d.ts","../../core/dist/core/context/repository-context.d.ts","../../core/dist/core/search/bm25.d.ts","../../core/dist/core/search/analyzer.d.ts","../../core/dist/core/serialization/documents.d.ts","../../core/dist/util/paths.d.ts","../../core/dist/util/concurrency.d.ts","../../core/dist/util/text.d.ts","../../core/dist/index.d.ts","../src/tools/handlers.ts","../src/server.ts","../src/bin.ts","../src/index.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/@types/node/web-globals/crypto.d.ts","../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/undici-types/utility.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client-stats.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/round-robin-pool.d.ts","../../../node_modules/undici-types/h2c-client.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-call-history.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/snapshot-agent.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cache-interceptor.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/@types/node/web-globals/streams.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts"],"fileIdsList":[[129,181,182,184,201,202],[129,183,184,201,202],[184,201,202],[129,184,189,201,202,219],[129,184,185,190,195,201,202,204,216,227],[129,184,185,186,195,201,202,204],[129,184,201,202],[129,184,187,201,202,228],[129,184,188,189,196,201,202,205],[129,184,189,201,202,216,224],[129,184,190,192,195,201,202,204],[129,183,184,191,201,202],[129,184,192,193,201,202],[129,184,194,195,201,202],[129,183,184,195,201,202],[129,184,195,196,197,201,202,216,227],[129,184,195,196,197,201,202,211,216,219],[129,176,184,192,195,198,201,202,204,216,227],[129,184,195,196,198,199,201,202,204,216,224,227],[129,184,198,200,201,202,216,224,227],[127,128,129,130,131,132,133,134,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233],[129,184,195,201,202],[129,184,201,202,203,227],[129,184,192,195,201,202,204,216],[129,184,201,202,205],[129,184,201,202,206],[129,183,184,201,202,207],[129,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233],[129,184,201,202,209],[129,184,201,202,210],[129,184,195,201,202,211,212],[129,184,201,202,211,213,228,230],[129,184,196,201,202],[129,184,195,201,202,216,217,219],[129,184,201,202,218,219],[129,184,201,202,216,217],[129,184,201,202,219],[129,184,201,202,220],[129,181,184,201,202,216,221,227],[129,184,195,201,202,222,223],[129,184,201,202,222,223],[129,184,189,201,202,204,216,224],[129,184,201,202,225],[129,184,201,202,204,226],[129,184,198,201,202,210,227],[129,184,189,201,202,228],[129,184,201,202,216,229],[129,184,201,202,203,230],[129,184,201,202,231],[129,184,189,201,202],[129,176,184,201,202],[129,184,201,202,232],[129,176,184,195,197,201,202,207,216,219,227,229,230,232],[129,184,201,202,216,233],[129,141,144,147,148,184,201,202,227],[129,144,184,201,202,216,227],[129,144,148,184,201,202,227],[129,184,201,202,216],[129,138,184,201,202],[129,142,184,201,202],[129,140,141,144,184,201,202,227],[129,184,201,202,204,224],[129,184,201,202,234],[129,138,184,201,202,234],[129,140,144,184,201,202,204,227],[129,135,136,137,139,143,184,195,201,202,216,227],[129,144,153,161,184,201,202],[129,136,142,184,201,202],[129,144,170,171,184,201,202],[129,136,139,144,184,201,202,219,227,234],[129,144,184,201,202],[129,140,144,184,201,202,227],[129,135,184,201,202],[129,138,139,140,142,143,144,145,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,171,172,173,174,175,184,201,202],[129,144,163,166,184,192,201,202],[129,144,153,154,155,184,201,202],[129,142,144,154,156,184,201,202],[129,143,184,201,202],[129,136,138,144,184,201,202],[129,144,148,154,156,184,201,202],[129,148,184,201,202],[129,142,144,147,184,201,202,227],[129,136,140,144,153,184,201,202],[129,144,163,184,201,202],[129,156,184,201,202],[129,138,144,170,184,201,202,219,232,234],[79,129,184,201,202],[67,129,184,201,202],[66,67,129,184,201,202],[66,129,184,201,202],[66,68,69,70,71,72,73,75,76,84,129,184,201,202],[69,129,184,201,202],[67,82,129,184,201,202],[66,67,82,129,184,201,202],[67,76,82,129,184,201,202],[66,67,78,129,184,201,202],[66,67,71,129,184,201,202],[66,72,73,129,184,201,202],[66,71,129,184,201,202],[67,78,129,184,201,202],[66,67,78,81,129,184,201,202],[74,129,184,201,202],[66,67,68,69,70,75,80,129,184,201,202],[77,129,184,201,202],[67,77,82,129,184,201,202],[66,77,83,129,184,201,202],[67,69,72,82,129,184,201,202],[72,129,184,201,202],[69,72,129,184,201,202],[67,100,129,184,201,202],[66,100,129,184,201,202],[66,67,68,69,70,71,72,73,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,129,184,201,202],[66,67,68,69,70,71,72,73,75,81,82,86,129,184,201,202],[64,124,129,184,201,202,206],[64,65,123,124,129,184,201,202],[64,65,122,123,129,184,201,202],[122,129,184,201,202]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"196cb558a13d4533a5163286f30b0509ce0210e4b316c56c38d4c0fd2fb38405","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffe554904bfed4b77c091c979cad44b02743ef8c70b4be60d4bc478810bd3c5e","signature":"923f088dc3b8f6c99ca6af9af1e203cde7c3ab9760ab49c58dbd92591afefbbd","impliedFormat":99},{"version":"0d2a75fb2a46e9e71c9f50af9002151f6e05b4b961a69889cf4739817aefc841","signature":"7ee8964794de14f724cdd57c6a0dfc2de9ef8c9b9da1fc4d48d70ee3fd84dcd4","impliedFormat":99},{"version":"1b5b4cd327fd85e27306a1dd7c1bcf005f2a354e34cdf94edf3e74c24429ae16","impliedFormat":99},{"version":"c388756b415bac221f5a967b9a877c5d6fc0d3d39052bb13e13ef2725216decd","impliedFormat":99},{"version":"3b1d1a4aff2a80cb5131801cd0ea2589e8a3f56ec891c85b6d30a1ff31363856","impliedFormat":99},{"version":"9d2cc72223f10b0997f850a72b93ca2b55e8f56c8c14dd79232f05efd676b185","impliedFormat":99},{"version":"5b34e3e3c9a65851acc34292702483838c0aff3575c30a8af66947967fa7c35b","impliedFormat":99},{"version":"06b2fdd3d9e1bc18f2b8c391b65dec41bea809e6c74de27cc2f57c9ddcbfc29e","impliedFormat":99},{"version":"19f14d8577fcfac949e825ddc25a71ae41f5e05d68b6d8a53f4a7800ababcdcc","impliedFormat":99},{"version":"777a96ba446363293cf2fc0878527f708a5c68b1e2c6be841e1e8f248fce8b31","impliedFormat":99},{"version":"dee1e120a51ce6a6a1c7229014b4eacc895c9791614a1e19d4968b52dc6a0711","impliedFormat":99},{"version":"a90f126ff6bb4137ea9e95e8e8c330c8609e884795a5a904248902418406fe40","impliedFormat":99},{"version":"7e232a62b394d8e97c493f2e9cbe4dee3fdacf37417c0434712ec2f685cc08c2","impliedFormat":99},{"version":"9416b195e668d4069a1f2b748ac8b3a94627e2ea680f23fd623b356df4de655d","impliedFormat":99},{"version":"ec9b5a55eb4b93bf76e23fe7f1588142bb491ff3979c67180d7cc562fcdf4885","impliedFormat":99},{"version":"f315025e38d44c8a15354babc19aafec9d0bf7a921f915381bf1775c21693bbf","impliedFormat":99},{"version":"6035c10abaa1d7ff150aef732e643763f57af485ae8430cf1bedb233ed2c8aa0","impliedFormat":99},{"version":"cb6866e0c3f54f2d9757d44e8140da3a09dcfa07255026cd203ad609f8fc00a3","impliedFormat":99},{"version":"0b17157271d9740ffc2c839dd1179158714061815755387324c873a9fb3b4216","impliedFormat":99},{"version":"127dde38a923da8111b4f44996d8b52d87f7cc6c406e73b3d338eca5e868db6c","impliedFormat":99},{"version":"ee264fafe0b53abb2ee1d18064f2a5cf0ca4a1288bff1afc27a0f9e5fc7894ba","impliedFormat":99},{"version":"06488463ad90c216c13a5de2ff54b6d07c8cd29f6ce29ab854bd27b5d8ba6608","impliedFormat":99},{"version":"eba40a9a894de0c8c09ee41d027e8d1386c131bb86841085befd719ea0513c3a","impliedFormat":99},{"version":"0d0ece05c4b9fa21b0aa9188a193ca9e1602f86a62a999910093a7fe76045478","impliedFormat":99},{"version":"63e5f13014c467b31e021f048e3ac86544cc03788f9d7c8452d815da9ca5b876","impliedFormat":99},{"version":"a6003278bd7f6def745b964d5e61df8e2ec918bfa89b4ec68d08ede71846986d","impliedFormat":99},{"version":"5f87e0dc895dd345001dc76ad2347ea4a574dbb3230670109e80846889c9a28c","impliedFormat":99},{"version":"8f5f31b20401430c08840f31cfec7f9284fda910def21ac4186a914c40a26ed0","impliedFormat":99},{"version":"6d1c031701ee553964ba09ce5e33e98e9dfed5112db7128878881f2e21ad8ae5","impliedFormat":99},{"version":"3b699eb5907ea9ee40a3734b306f180a3ed6bb675ec3abe31b2a908c818c923e","impliedFormat":99},{"version":"ce38498f279002fb138538cee113e78659366d81e100a2ac44e0b3c07274c9ee","impliedFormat":99},{"version":"31b2b43fc853f90ed62892c4a85ea5d3601666f5d97502ad5c9492488be19d3e","impliedFormat":99},{"version":"8002905569a9e3634139d22193cf425a9f9b82edeb5bd51d2dd2e4e1c7e6c90e","impliedFormat":99},{"version":"fb70026a5a07de2a8ca7f8c15f2b7b0628befc078771d902f66a4498115d7e9d","impliedFormat":99},{"version":"d936db46099e9ccd77586716b082ffa3a28e09a166a59115cebf8b6f814e64d9","impliedFormat":99},{"version":"76570510044cc23b81947332feb067042a8709ec2b97384e24e8a09af079d7d9","impliedFormat":99},{"version":"9ec2f0d1459a1b86a42dcaedcaf51423bb4184a6ef2c366060a046088e3dfdbe","impliedFormat":99},{"version":"c988642547a95f4d27f3f5b0bae91e8c12ec4d1ba219a9083466e0cb111ea272","impliedFormat":99},{"version":"b76afbead89c79e4a3d76a0f0a9b4171f80263dcf99a5c83607c8f8f65c1bf4d","impliedFormat":99},{"version":"3a129acecf6125b394c187872d4b09147ce863ce316b95a6a31bbe1b4236917b","impliedFormat":99},{"version":"319d12d76c84f75e79d36d77f7e98b2fca6658f4b5a30c7202583aacd7b50016","impliedFormat":99},{"version":"b77987b5060594b14e364569c8eecf171bd3ced01cf1685607eb66745e1fedbb","impliedFormat":99},{"version":"2e2fbfdb30e9ca976a119de49c9938902f4bc5907ababd302e99ca0713479813","impliedFormat":99},{"version":"43208cd0eb7d78ae94d5d0f41dd583096be38f5b6af924ee3dbec0103b864586","impliedFormat":99},{"version":"3091dd4f2e9c9602dd13ba6bfbbd47e205bd1f2445ae8df6f97b8aee429e108f","impliedFormat":99},{"version":"928eacfcb8587ab1070df40a049a48d4bd2438fa291e46bad768d1d99a9e3fd5","impliedFormat":99},{"version":"4b5c8ba3364c3d19d83ef59469fbbdfc093abd2ac581f0068dc40a0c80d0cbd8","impliedFormat":99},{"version":"59b608635471453a79e7dc593412c92ebc466d2187b05e84e9cecb7e56a359c2","impliedFormat":99},{"version":"8b157d6e1995bb47fb1f415267cbe5c56c60bfb62bacc67e5db789a76c26f290","impliedFormat":99},{"version":"ff81da660e1cb48afebb76f629d41adabc64e034bdafcd9311457d7990318763","impliedFormat":99},{"version":"4672826f6f34e1b05be700dca57ce53fe798dfc13ee7c137d923797a92cc4ae3","impliedFormat":99},{"version":"0c5e3984f45c2d569db3780fe7809d31504d7cda535f38c5b24b5b35b21eb90f","impliedFormat":99},{"version":"88640039368e4aaef6130829e7d39dfec2aeb4df62b0939323851373fa7a12bf","impliedFormat":99},{"version":"07f14c272a9ae1ab90b995af417ea3dedbe9524076bc27c0d7ef5f6ebdac4a88","impliedFormat":99},{"version":"dfaae0b33cbdaaca070f2007d057f239e0b2d06712644ea7b5a1b7d59a7422f2","impliedFormat":99},{"version":"f81f9a17d830f7bbcc75208ad0c176b5e4030be708e5faa0402be6fcf4cb1c17","impliedFormat":99},{"version":"950ede28a65df183ff64b4a1e49f56cb8ded04bb9dd10f417d480e098d7bd739","impliedFormat":99},{"version":"64228333a0f4027f63fba32e183b94be8854411f3604f21af2fee412cd1fe8f0","impliedFormat":99},{"version":"775d28a5171d0dae225d92cc8e55c8e2808027d8287d8a47358ca5a8bcfd895a","impliedFormat":99},{"version":"f74ad2dabe5bf11c25711d8e4e5a6777da684546e6783332044bd346281fed72","signature":"9bb16e61957eb10fec35109da9591eb2d2245682c08eee8ef6c03d40fdd872dc","impliedFormat":99},{"version":"5163037f08d86750550661713197074ed2e68b1967b10e423a916f0b65d073e8","signature":"a21a16d8fcb311ca43b6611e4635467edb5954eecada9eb7d1abe830eafc0c3a","impliedFormat":99},{"version":"b81925e3576cf856f2988831b215058c68985a7601332f6f2bfc48cf38f3ab6a","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012","impliedFormat":99},{"version":"931960116afd835da5464971141543f8d07fc1856c888cf9af53307838b88b5d","signature":"5d9e766e465a73c3d774fab8937b8e4a79745da2a36370796e8e389d9446f453","impliedFormat":99},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"378281aa35786c27d5811af7e6bcaa492eebd0c7013d48137c35bbc69a2b9751","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"1b2dd1cbeb0cc6ae20795958ba5950395ebb2849b7c8326853dd15530c77ab0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"387a023d363f755eb63450a66c28b14cdd7bc30a104565e2dbf0a8988bb4a56c","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"cdcf9ea426ad970f96ac930cd176d5c69c6c24eebd9fc580e1572d6c6a88f62c","impliedFormat":1},{"version":"23cd712e2ce083d68afe69224587438e5914b457b8acf87073c22494d706a3d0","impliedFormat":1},{"version":"156a859e21ef3244d13afeeba4e49760a6afa035c149dda52f0c45ea8903b338","impliedFormat":1},{"version":"10ec5e82144dfac6f04fa5d1d6c11763b3e4dbbac6d99101427219ab3e2ae887","impliedFormat":1},{"version":"615754924717c0b1e293e083b83503c0a872717ad5aa60ed7f1a699eb1b4ea5c","impliedFormat":1},{"version":"074de5b2fdead0165a2757e3aaef20f27a6347b1c36adea27d51456795b37682","impliedFormat":1},{"version":"68834d631c8838c715f225509cfc3927913b9cc7a4870460b5b60c8dbdb99baf","impliedFormat":1},{"version":"24371e69a38fc33e268d4a8716dbcda430d6c2c414a99ff9669239c4b8f40dea","impliedFormat":1},{"version":"ccab02f3920fc75c01174c47fcf67882a11daf16baf9e81701d0a94636e94556","impliedFormat":1},{"version":"3e11fce78ad8c0e1d1db4ba5f0652285509be3acdd519529bc8fcef85f7dafd9","impliedFormat":1},{"version":"ea6bc8de8b59f90a7a3960005fd01988f98fd0784e14bc6922dde2e93305ec7d","impliedFormat":1},{"version":"36107995674b29284a115e21a0618c4c2751b32a8766dd4cb3ba740308b16d59","impliedFormat":1},{"version":"914a0ae30d96d71915fc519ccb4efbf2b62c0ddfb3a3fc6129151076bc01dc60","impliedFormat":1},{"version":"9c32412007b5662fd34a8eb04292fb5314ec370d7016d1c2fb8aa193c807fe22","impliedFormat":1},{"version":"7fd1b31fd35876b0aa650811c25ec2c97a3c6387e5473eb18004bed86cdd76b6","impliedFormat":1},{"version":"4d327f7d72ad0918275cea3eee49a6a8dc8114ae1d5b7f3f5d0774de75f7439a","impliedFormat":1},{"version":"6ebe8ebb8659aaa9d1acbf3710d7dae3e923e97610238b9511c25dc39023a166","impliedFormat":1},{"version":"e85d7f8068f6a26710bff0cc8c0fc5e47f71089c3780fbede05857331d2ddec9","impliedFormat":1},{"version":"7befaf0e76b5671be1d47b77fcc65f2b0aad91cc26529df1904f4a7c46d216e9","impliedFormat":1},{"version":"0a60a292b89ca7218b8616f78e5bbd1c96b87e048849469cccb4355e98af959a","impliedFormat":1},{"version":"0b6e25234b4eec6ed96ab138d96eb70b135690d7dd01f3dd8a8ab291c35a683a","impliedFormat":1},{"version":"9666f2f84b985b62400d2e5ab0adae9ff44de9b2a34803c2c5bd3c8325b17dc0","impliedFormat":1},{"version":"40cd35c95e9cf22cfa5bd84e96408b6fcbca55295f4ff822390abb11afbc3dca","impliedFormat":1},{"version":"b1616b8959bf557feb16369c6124a97a0e74ed6f49d1df73bb4b9ddf68acf3f3","impliedFormat":1},{"version":"5b03a034c72146b61573aab280f295b015b9168470f2df05f6080a2122f9b4df","impliedFormat":1},{"version":"40b463c6766ca1b689bfcc46d26b5e295954f32ad43e37ee6953c0a677e4ae2b","impliedFormat":1},{"version":"249b9cab7f5d628b71308c7d9bb0a808b50b091e640ba3ed6e2d0516f4a8d91d","impliedFormat":1},{"version":"80aae6afc67faa5ac0b32b5b8bc8cc9f7fa299cff15cf09cc2e11fd28c6ae29e","impliedFormat":1},{"version":"f473cd2288991ff3221165dcf73cd5d24da30391f87e85b3dd4d0450c787a391","impliedFormat":1},{"version":"499e5b055a5aba1e1998f7311a6c441a369831c70905cc565ceac93c28083d53","impliedFormat":1},{"version":"8aee8b6d4f9f62cf3776cda1305fb18763e2aade7e13cea5bbe699112df85214","impliedFormat":1},{"version":"c63b9ada8c72f95aac5db92aea07e5e87ec810353cdf63b2d78f49a58662cf6c","impliedFormat":1},{"version":"1cc2a09e1a61a5222d4174ab358a9f9de5e906afe79dbf7363d871a7edda3955","impliedFormat":1},{"version":"5d0375ca7310efb77e3ef18d068d53784faf62705e0ad04569597ae0e755c401","impliedFormat":1},{"version":"59af37caec41ecf7b2e76059c9672a49e682c1a2aa6f9d7dc78878f53aa284d6","impliedFormat":1},{"version":"addf417b9eb3f938fddf8d81e96393a165e4be0d4a8b6402292f9c634b1cb00d","impliedFormat":1},{"version":"b64d4d1c5f877f9c666e98e833f0205edb9384acc46e98a1fef344f64d6aba44","impliedFormat":1},{"version":"adf27937dba6af9f08a68c5b1d3fce0ca7d4b960c57e6d6c844e7d1a8e53adae","impliedFormat":1},{"version":"12950411eeab8563b349cb7959543d92d8d02c289ed893d78499a19becb5a8cc","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"c9381908473a1c92cb8c516b184e75f4d226dad95c3a85a5af35f670064d9a2f","impliedFormat":1},{"version":"f724236417941ea77ec8d38c6b7021f5fb7f8521c7f8c1538e87661f2c6a0774","affectsGlobalScope":true,"impliedFormat":1},{"version":"1cf059eaf468efcc649f8cf6075d3cb98e9a35a0fe9c44419ec3d2f5428d7123","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d97fb21da858fb18b8ae72c314e9743fd52f73ebe2764e12af1db32fc03f853f","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ea15fd99b2e34cb25fe8346c955000bb70c8b423ae4377a972ef46bfb37f595","impliedFormat":1},{"version":"7cf69dd5502c41644c9e5106210b5da7144800670cbe861f66726fa209e231c4","impliedFormat":1},{"version":"72c1f5e0a28e473026074817561d1bc9647909cf253c8d56c41d1df8d95b85f7","impliedFormat":1},{"version":"f9b4137a0d285bd77dba2e6e895530112264310ae47e07bf311feae428fb8b61","affectsGlobalScope":true,"impliedFormat":1},{"version":"b8fd27f1c91ee0f957826b3de0b3aad4fc5fdf419c8db47b0bc48f28849861c7","impliedFormat":1},{"version":"51aecd2df90a3cffea1eb4696b33b2d78594ea2aa2138e6b9471ec4841c6c2ee","impliedFormat":1},{"version":"9d8f9e63e29a3396285620908e7f14d874d066caea747dc4b2c378f0599166b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"612422d5ba6b4a5c4537f423e9199645468ad80a689801da63ab7edb43f7b835","impliedFormat":1},{"version":"db9ada976f9e52e13f7ae8b9a320f4b67b87685938c5879187d8864b2fbe97f3","impliedFormat":1},{"version":"9f39e70a354d0fba29ac3cdf6eca00b7f9e96f64b2b2780c432e8ea27f133743","impliedFormat":1},{"version":"0dace96cc0f7bc6d0ee2044921bdf19fe42d16284dbcc8ae200800d1c9579335","impliedFormat":1},{"version":"a2e2bbde231b65c53c764c12313897ffdfb6c49183dd31823ee2405f2f7b5378","impliedFormat":1},{"version":"1cbdcdef62bf42688e5d825898c3a59458466c48ad8a4ef3f88d8a1cd04310d6","impliedFormat":1},{"version":"c64e1888baaa3253ca4405b455e4bf44f76357868a1bd0a52998ade9a092ad78","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc8c6f5322961b56d9906601b20798725df60baeab45ec014fba9f795d5596fd","impliedFormat":1},{"version":"67e435fa530778903f5525904e6645b7368eb5ac622055febd19bb399e328ccd","impliedFormat":1},{"version":"060d305fe4494d8cb2b99d620928d369d1ee55c1645f5e729a2aca07d0f108cb","impliedFormat":1},{"version":"5b22bf96be06fca1e134e3a85351ffe7aa2edf0c9a5bd175b7239ee48186dbf5","impliedFormat":1},{"version":"0c50296ee73dae94efc3f0da4936b1146ca6ce2217acfabb44c19c9a33fa30e5","impliedFormat":1},{"version":"bbf42f98a5819f4f06e18c8b669a994afe9a17fe520ae3454a195e6eabf7700d","impliedFormat":1},{"version":"5b48cc670da1dfe926036deaf349085caf822def460a6d50de23f1cc12a5f8cd","impliedFormat":1},{"version":"418f34087d52d001e2688a6282a5de9bf583ff771ed5546af0ae36e4f60a458b","affectsGlobalScope":true,"impliedFormat":1},{"version":"036c9a03b01281f99f8251fdc7088e894566be44b3f139a9d48501a978b611df","impliedFormat":1},{"version":"ff65b8a8bd380c6d129becc35de02f7c29ad7ce03300331ca91311fb4044d1a9","impliedFormat":1},{"version":"04bf1aa481d1adfb16d93d76e44ce71c51c8ef68039d849926551199489637f6","impliedFormat":1},{"version":"2c9adcc85574b002c9a6311ff2141055769e0071856ec979d92ff989042b1f1b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1569ad5969ae0de6ad0bdfaaab0dabcd8878bc3147ab096206eed2019bb84e7f","affectsGlobalScope":true,"impliedFormat":1},{"version":"a58a15da4c5ba3df60c910a043281256fa52d36a0fcdef9b9100c646282e88dd","impliedFormat":1},{"version":"b36beffbf8acdc3ebc58c8bb4b75574b31a2169869c70fc03f82895b93950a12","impliedFormat":1},{"version":"42a350ce4f6f291198dc89833afcc4fd078248b4e1fdc9d05c846c66a670f710","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"8c81fd4a110490c43d7c578e8c6f69b3af01717189196899a6a44f93daa57a3a","impliedFormat":1},{"version":"5fb39858b2459864b139950a09adae4f38dad87c25bf572ce414f10e4bd7baab","impliedFormat":1},{"version":"b03754211d839cdc48979996525a32eb62130682c2f9801dfc2f25533ce7238d","impliedFormat":1},{"version":"3910dab597c40e173bf0e0d419d3ce9682c54ebf6ae84849f9b829b1451a17ec","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"4e5d5874ff5bf94b02e856cffbcc2b3ddea5d52f463ef55cc0206f1afaa2ab28","affectsGlobalScope":true,"impliedFormat":1},{"version":"c119835edf36415081dfd9ed15fc0cd37aaa28d232be029ad073f15f3d88c323","impliedFormat":1},{"version":"f4d99ac08c4097a3cc202bec2c7198c19dcdd80d4ec6c62d1356b10d03b119d5","impliedFormat":1},{"version":"9705cd157ffbb91c5cab48bdd2de5a437a372e63f870f8a8472e72ff634d47c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ae86f30d5d10e4f75ce8dcb6e1bd3a12ecec3d071a21e8f462c5c85c678efb41","impliedFormat":1},{"version":"ca77e83162eccec633513723d178d4203bdd5465297267696be08013bab0aa1d","impliedFormat":1},{"version":"e03460fe72b259f6d25ad029f085e4bedc3f90477da4401d8fbc1efa9793230e","impliedFormat":1},{"version":"4286a3a6619514fca656089aee160bb6f2e77f4dd53dc5a96b26a0b4fc778055","impliedFormat":1},{"version":"f61c153d5abbe4381a1fba0d41be0babdd5de51c626ee7ff14cede14dedc33f1","affectsGlobalScope":true,"impliedFormat":1},{"version":"7803171d745ab18e77f16bf82e742268ff72b7f7382ab191e4277527580c2d89","affectsGlobalScope":true,"impliedFormat":1},{"version":"0e9ba65cd3d6d194bdda7343f9f2917f7144ead96a924ca58d1a14919992dc20","impliedFormat":1},{"version":"255d948f87f24ffd57bcb2fdf95792fd418a2e1f712a98cf2cce88744d75085c","impliedFormat":1},{"version":"0d5b085f36e6dc55bc6332ecb9c733be3a534958c238fb8d8d18d4a2b6f2a15a","impliedFormat":1},{"version":"0b0dfb2d3e8420ead06f6a11acfb02ddcec42257e6ce391993e895ba0af86de4","affectsGlobalScope":true,"impliedFormat":1},{"version":"bfd3b3c21a56104693183942e221c1896ee23bcb8f8d91ab0b941f7b32985411","impliedFormat":1},{"version":"d7e9ab1b0996639047c61c1e62f85c620e4382206b3abb430d9a21fb7bc23c77","impliedFormat":1}],"root":[64,65,[123,126]],"options":{"allowImportingTsExtensions":true,"composite":true,"declaration":true,"declarationMap":true,"erasableSyntaxOnly":true,"module":199,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":false,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rewriteRelativeImportExtensions":true,"rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","useUnknownInCatchVariables":true,"verbatimModuleSyntax":true},"referencedMap":[[181,1],[182,1],[183,2],[129,3],[184,4],[185,5],[186,6],[127,7],[187,8],[188,9],[189,10],[190,11],[191,12],[192,13],[193,13],[194,14],[195,15],[196,16],[197,17],[130,7],[128,7],[198,18],[199,19],[200,20],[234,21],[201,22],[202,7],[203,23],[204,24],[205,25],[206,26],[207,27],[208,28],[209,29],[210,30],[211,31],[212,31],[213,32],[214,7],[215,33],[216,34],[218,35],[217,36],[219,37],[220,38],[221,39],[222,40],[223,41],[224,42],[225,43],[226,44],[227,45],[228,46],[229,47],[230,48],[231,49],[131,7],[132,50],[133,7],[134,7],[177,51],[178,52],[179,7],[180,37],[232,53],[233,54],[62,7],[63,7],[12,7],[11,7],[2,7],[13,7],[14,7],[15,7],[16,7],[17,7],[18,7],[19,7],[20,7],[3,7],[21,7],[22,7],[4,7],[23,7],[27,7],[24,7],[25,7],[26,7],[28,7],[29,7],[30,7],[5,7],[31,7],[32,7],[33,7],[34,7],[6,7],[38,7],[35,7],[36,7],[37,7],[39,7],[7,7],[40,7],[45,7],[46,7],[41,7],[42,7],[43,7],[44,7],[8,7],[50,7],[47,7],[48,7],[49,7],[51,7],[9,7],[52,7],[53,7],[54,7],[56,7],[55,7],[57,7],[58,7],[10,7],[59,7],[1,7],[60,7],[61,7],[153,55],[165,56],[150,57],[166,58],[175,59],[141,60],[142,61],[140,62],[174,63],[169,64],[173,65],[144,66],[162,67],[143,68],[172,69],[138,70],[139,64],[145,71],[146,7],[152,72],[149,71],[136,73],[176,74],[167,75],[156,76],[155,71],[157,77],[160,78],[154,79],[158,80],[170,63],[147,81],[148,82],[161,83],[137,58],[164,84],[163,71],[151,82],[159,85],[168,7],[135,7],[171,86],[80,87],[94,7],[71,7],[98,88],[99,88],[100,88],[68,88],[95,88],[97,89],[96,7],[101,88],[67,90],[85,91],[91,92],[92,92],[69,7],[93,92],[106,93],[107,89],[108,89],[114,94],[115,95],[76,90],[109,96],[110,90],[111,97],[113,98],[112,99],[103,100],[82,101],[102,89],[78,90],[75,102],[81,103],[74,89],[117,7],[116,104],[83,105],[84,106],[77,90],[118,107],[73,108],[72,90],[86,109],[105,110],[104,111],[90,90],[122,112],[70,90],[89,7],[88,7],[66,7],[87,113],[120,7],[79,7],[119,7],[121,7],[125,114],[126,115],[124,116],[65,7],[123,117],[64,7]],"latestChangedDtsFile":"./index.d.ts","version":"5.9.3"}
package/dist/bin.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
package/dist/bin.js ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Executable entry point of the MCP adapter (`agent-context-mcp`).
4
+ *
5
+ * Usage:
6
+ * agent-context-mcp [--root <path>]
7
+ *
8
+ * The repository root defaults to `AGENT_CONTEXT_ROOT` and then to the current
9
+ * working directory. The server speaks JSON-RPC over stdin/stdout, which is what
10
+ * MCP clients (Claude Desktop, IDEs, custom agents) expect.
11
+ */
12
+ import path from 'node:path';
13
+ import { McpServer, createStdioTransport } from "./server.js";
14
+ import { MCP_VERSION } from "./version.js";
15
+ function parseRoot(argv) {
16
+ for (let index = 0; index < argv.length; index += 1) {
17
+ const argument = argv[index];
18
+ if (argument === '--root') {
19
+ const value = argv[index + 1];
20
+ if (value !== undefined)
21
+ return path.resolve(value);
22
+ continue;
23
+ }
24
+ if (argument.startsWith('--root='))
25
+ return path.resolve(argument.slice('--root='.length));
26
+ }
27
+ const fromEnv = process.env['AGENT_CONTEXT_ROOT'];
28
+ return path.resolve(fromEnv !== undefined && fromEnv.length > 0 ? fromEnv : process.cwd());
29
+ }
30
+ if (process.argv.includes('--version')) {
31
+ process.stdout.write(`${MCP_VERSION}\n`);
32
+ }
33
+ else {
34
+ const root = parseRoot(process.argv.slice(2));
35
+ const server = new McpServer({
36
+ root,
37
+ transport: createStdioTransport(),
38
+ log: (line) => process.stderr.write(`${line}\n`),
39
+ });
40
+ server.start();
41
+ process.stderr.write(`ai-agent-context MCP server ready (root: ${root})\n`);
42
+ }
43
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,SAAS,SAAS,CAAC,IAAuB;IACxC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAE,CAAC;QAC9B,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC9B,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpD,SAAS;QACX,CAAC;QACD,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5F,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAC7F,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;IACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,IAAI,CAAC,CAAC;AAC3C,CAAC;KAAM,CAAC;IACN,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI;QACJ,SAAS,EAAE,oBAAoB,EAAE;QACjC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;KACjD,CAAC,CAAC;IACH,MAAM,CAAC,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4CAA4C,IAAI,KAAK,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Programmatic entry point of the MCP adapter.
3
+ *
4
+ * The adapter is intentionally thin: it exposes the core API as MCP tools and
5
+ * contains no analysis logic, so an embedder can reuse the server with a custom
6
+ * transport (HTTP, WebSocket, in-process) without touching the core.
7
+ */
8
+ export { McpServer, createStdioTransport, createMemoryTransport, MCP_PROTOCOL_VERSION, SERVER_NAME } from './server.ts';
9
+ export type { McpServerOptions, McpTransport, JsonRpcRequest, MemoryTransport } from './server.ts';
10
+ export { TOOL_DEFINITIONS, toolByName } from './tools/definitions.ts';
11
+ export type { ToolDefinition, JsonSchema } from './tools/definitions.ts';
12
+ export { callTool, ContextPool } from './tools/handlers.ts';
13
+ export type { ToolCallResult, ToolHandlerDependencies } from './tools/handlers.ts';
14
+ export { MCP_VERSION } from './version.ts';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACxH,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Programmatic entry point of the MCP adapter.
3
+ *
4
+ * The adapter is intentionally thin: it exposes the core API as MCP tools and
5
+ * contains no analysis logic, so an embedder can reuse the server with a custom
6
+ * transport (HTTP, WebSocket, in-process) without touching the core.
7
+ */
8
+ export { McpServer, createStdioTransport, createMemoryTransport, MCP_PROTOCOL_VERSION, SERVER_NAME } from "./server.js";
9
+ export { TOOL_DEFINITIONS, toolByName } from "./tools/definitions.js";
10
+ export { callTool, ContextPool } from "./tools/handlers.js";
11
+ export { MCP_VERSION } from "./version.js";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAExH,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { AgentContextOptions } from '@ai-agent-context/core';
2
+ export declare const MCP_PROTOCOL_VERSION = "2024-11-05";
3
+ export declare const SERVER_NAME = "ai-agent-context";
4
+ export interface JsonRpcRequest {
5
+ jsonrpc?: string;
6
+ id?: string | number | null;
7
+ method?: string;
8
+ params?: Record<string, unknown>;
9
+ }
10
+ export interface McpTransport {
11
+ /** Registers the message handler (called for every parsed JSON message). */
12
+ onMessage(handler: (message: unknown) => void): void;
13
+ /** Sends a JSON-RPC response/notification. */
14
+ send(message: unknown): void;
15
+ close(): void;
16
+ }
17
+ export interface McpServerOptions {
18
+ root: string;
19
+ transport: McpTransport;
20
+ /** Injectable context factory (tests). */
21
+ createContext?: (options: AgentContextOptions) => Promise<import('@ai-agent-context/core').AgentContext>;
22
+ /** Protocol diagnostics go to stderr; stdout is the JSON-RPC channel. */
23
+ log?: (line: string) => void;
24
+ }
25
+ export declare class McpServer {
26
+ private readonly options;
27
+ private readonly pool;
28
+ private initialized;
29
+ constructor(options: McpServerOptions);
30
+ /** Wires the transport and starts serving. */
31
+ start(): void;
32
+ /** Handles a single JSON-RPC message. */
33
+ handleMessage(message: unknown): Promise<void>;
34
+ private respond;
35
+ private respondError;
36
+ get isInitialized(): boolean;
37
+ }
38
+ /** stdio transport: newline delimited JSON-RPC on stdin/stdout. */
39
+ export declare function createStdioTransport(): McpTransport;
40
+ export interface MemoryTransport extends McpTransport {
41
+ sent: unknown[];
42
+ /** Pushes a message into the server, as stdin would. */
43
+ push(message: unknown): void;
44
+ }
45
+ /** In-memory transport, used by tests and by embedders. */
46
+ export declare function createMemoryTransport(): MemoryTransport;
47
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,WAAW,q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B,SAAQ,YAAY;IACnD,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,wDAAwD;IACxD,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED,2DAA2D;AAC3D,wBAAgB,qBAAqB,IAAI,eAAe,CAkBvD"}
package/dist/server.js ADDED
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Minimal Model Context Protocol server over stdio.
3
+ *
4
+ * Implemented without runtime dependencies (the package keeps a zero-dependency
5
+ * core): newline-delimited JSON-RPC 2.0 on stdin/stdout, covering the subset of
6
+ * MCP that matters for tools — `initialize`, `tools/list`, `tools/call`, `ping`.
7
+ * `resources` and `prompts` are advertised as empty capabilities: the documented
8
+ * extension point for later versions.
9
+ *
10
+ * The transport is injectable, so the protocol can be tested without a process.
11
+ */
12
+ import { MCP_VERSION } from "./version.js";
13
+ import { TOOL_DEFINITIONS } from "./tools/definitions.js";
14
+ import { ContextPool, callTool } from "./tools/handlers.js";
15
+ export const MCP_PROTOCOL_VERSION = '2024-11-05';
16
+ export const SERVER_NAME = 'ai-agent-context';
17
+ function toMcpTools() {
18
+ return TOOL_DEFINITIONS.map((tool) => ({
19
+ name: tool.name,
20
+ title: tool.title,
21
+ description: `${tool.description}\n\nReturns: ${tool.outputDescription}`,
22
+ inputSchema: tool.inputSchema,
23
+ }));
24
+ }
25
+ export class McpServer {
26
+ options;
27
+ pool;
28
+ initialized = false;
29
+ constructor(options) {
30
+ this.options = options;
31
+ this.pool = new ContextPool({
32
+ root: options.root,
33
+ ...(options.createContext === undefined ? {} : { createContext: options.createContext }),
34
+ });
35
+ }
36
+ /** Wires the transport and starts serving. */
37
+ start() {
38
+ this.options.transport.onMessage((message) => {
39
+ void this.handleMessage(message);
40
+ });
41
+ }
42
+ /** Handles a single JSON-RPC message. */
43
+ async handleMessage(message) {
44
+ if (typeof message !== 'object' || message === null)
45
+ return;
46
+ const request = message;
47
+ const id = request.id ?? null;
48
+ const method = request.method ?? '';
49
+ const log = this.options.log ?? ((line) => process.stderr.write(`${line}\n`));
50
+ if (id === null && method.startsWith('notifications/')) {
51
+ if (method === 'notifications/initialized')
52
+ this.initialized = true;
53
+ return;
54
+ }
55
+ try {
56
+ switch (method) {
57
+ case 'initialize':
58
+ this.respond(id, {
59
+ protocolVersion: MCP_PROTOCOL_VERSION,
60
+ capabilities: { tools: { listChanged: false }, resources: {}, prompts: {} },
61
+ serverInfo: { name: SERVER_NAME, version: MCP_VERSION },
62
+ instructions: 'Repository context layer. Start with get_repository_context, then use explain_module, get_dependencies, get_dependents, search_context, get_architecture, get_conventions and get_decisions. All data is generated locally from the repository; heuristic values carry a confidence and their evidence.',
63
+ });
64
+ return;
65
+ case 'ping':
66
+ this.respond(id, {});
67
+ return;
68
+ case 'tools/list':
69
+ this.respond(id, { tools: toMcpTools() });
70
+ return;
71
+ case 'resources/list':
72
+ this.respond(id, { resources: [] });
73
+ return;
74
+ case 'prompts/list':
75
+ this.respond(id, { prompts: [] });
76
+ return;
77
+ case 'tools/call': {
78
+ const params = request.params ?? {};
79
+ const name = typeof params['name'] === 'string' ? params['name'] : '';
80
+ const rawArguments = params['arguments'];
81
+ const args = typeof rawArguments === 'object' && rawArguments !== null
82
+ ? rawArguments
83
+ : {};
84
+ if (name.length === 0) {
85
+ this.respondError(id, -32602, 'tools/call requires a tool name');
86
+ return;
87
+ }
88
+ const result = await callTool(name, args, this.pool, this.options.root);
89
+ this.respond(id, {
90
+ content: [{ type: 'text', text: JSON.stringify(result.payload, null, 2) }],
91
+ isError: result.isError,
92
+ });
93
+ return;
94
+ }
95
+ default:
96
+ this.respondError(id, -32601, `method not found: ${method}`);
97
+ }
98
+ }
99
+ catch (error) {
100
+ const reason = error instanceof Error ? error.message : String(error);
101
+ log(`mcp: ${method} failed: ${reason}`);
102
+ this.respondError(id, -32603, reason);
103
+ }
104
+ }
105
+ respond(id, result) {
106
+ this.options.transport.send({ jsonrpc: '2.0', id, result });
107
+ }
108
+ respondError(id, code, message) {
109
+ this.options.transport.send({ jsonrpc: '2.0', id, error: { code, message } });
110
+ }
111
+ get isInitialized() {
112
+ return this.initialized;
113
+ }
114
+ }
115
+ /** stdio transport: newline delimited JSON-RPC on stdin/stdout. */
116
+ export function createStdioTransport() {
117
+ return {
118
+ onMessage(handler) {
119
+ let buffer = '';
120
+ process.stdin.setEncoding('utf8');
121
+ process.stdin.on('data', (chunk) => {
122
+ buffer += chunk;
123
+ let newline = buffer.indexOf('\n');
124
+ while (newline !== -1) {
125
+ const line = buffer.slice(0, newline).trim();
126
+ buffer = buffer.slice(newline + 1);
127
+ if (line.length > 0) {
128
+ try {
129
+ handler(JSON.parse(line));
130
+ }
131
+ catch {
132
+ process.stderr.write('mcp: ignoring unparsable message\n');
133
+ }
134
+ }
135
+ newline = buffer.indexOf('\n');
136
+ }
137
+ });
138
+ },
139
+ send(message) {
140
+ process.stdout.write(`${JSON.stringify(message)}\n`);
141
+ },
142
+ close() {
143
+ process.stdin.pause();
144
+ },
145
+ };
146
+ }
147
+ /** In-memory transport, used by tests and by embedders. */
148
+ export function createMemoryTransport() {
149
+ const sent = [];
150
+ let handler = null;
151
+ return {
152
+ sent,
153
+ push(message) {
154
+ handler?.(message);
155
+ },
156
+ onMessage(next) {
157
+ handler = next;
158
+ },
159
+ send(message) {
160
+ sent.push(message);
161
+ },
162
+ close() {
163
+ handler = null;
164
+ },
165
+ };
166
+ }
167
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC;AACjD,MAAM,CAAC,MAAM,WAAW,G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AC;wBACpB,IAAI,CAAC;4BACH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC,CAAC;wBACvC,CAAC;wBAAC,MAAM,CAAC;4BACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;wBAC7D,CAAC;oBACH,CAAC;oBACD,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,OAAO;YACV,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvD,CAAC;QACD,KAAK;YACH,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;KACF,CAAC;AACJ,CAAC;AAQD,2DAA2D;AAC3D,MAAM,UAAU,qBAAqB;IACnC,MAAM,IAAI,GAAc,EAAE,CAAC;IAC3B,IAAI,OAAO,GAAwC,IAAI,CAAC;IACxD,OAAO;QACL,IAAI;QACJ,IAAI,CAAC,OAAO;YACV,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;QACD,SAAS,CAAC,IAAI;YACZ,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,OAAO;YACV,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;QACD,KAAK;YACH,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Tool definitions of the MCP adapter.
3
+ *
4
+ * The adapter contains no analysis logic: every tool delegates to the core API
5
+ * (`AgentContext`) and returns a JSON payload an LLM can consume directly. Each
6
+ * schema declares exactly what the tool needs, so an agent cannot accidentally
7
+ * trigger a full repository dump.
8
+ */
9
+ export interface JsonSchema {
10
+ type: 'object' | 'string' | 'number' | 'boolean' | 'array';
11
+ description?: string;
12
+ properties?: Record<string, JsonSchema>;
13
+ required?: string[];
14
+ items?: JsonSchema;
15
+ additionalProperties?: boolean;
16
+ enum?: string[];
17
+ }
18
+ export interface ToolDefinition {
19
+ name: string;
20
+ title: string;
21
+ description: string;
22
+ inputSchema: JsonSchema;
23
+ /** Documented shape of the returned payload. */
24
+ outputDescription: string;
25
+ }
26
+ export declare const TOOL_DEFINITIONS: ToolDefinition[];
27
+ export declare function toolByName(name: string): ToolDefinition | undefined;
28
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,UAAU,CAAC;IACxB,gDAAgD;IAChD,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAYD,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAkH5C,CAAC;AAEF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEnE"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Tool definitions of the MCP adapter.
3
+ *
4
+ * The adapter contains no analysis logic: every tool delegates to the core API
5
+ * (`AgentContext`) and returns a JSON payload an LLM can consume directly. Each
6
+ * schema declares exactly what the tool needs, so an agent cannot accidentally
7
+ * trigger a full repository dump.
8
+ */
9
+ const ROOT_PROPERTY = {
10
+ type: 'string',
11
+ description: 'Repository root. Omit to use the root configured when the server started.',
12
+ };
13
+ const MODULE_PROPERTY = {
14
+ type: 'string',
15
+ description: 'Module id, module directory, file path or workspace package name (for example "src/payments").',
16
+ };
17
+ export const TOOL_DEFINITIONS = [
18
+ {
19
+ name: 'get_repository_context',
20
+ title: 'Get repository context',
21
+ description: 'Compact, structured overview of the repository: languages, file counts, workspace layout, runnable commands, ranked modules with heuristic roles, entry points, external dependencies and documented decisions. Call this first to orient yourself.',
22
+ inputSchema: { type: 'object', properties: { root: ROOT_PROPERTY }, additionalProperties: false },
23
+ outputDescription: 'Repository context payload (schema v1).',
24
+ },
25
+ {
26
+ name: 'explain_module',
27
+ title: 'Explain module',
28
+ description: 'Structured explanation of one module (or of the module owning a file path): entry points, internal dependencies, dependents, external packages, public API, relevant conventions and decisions, tests, neutral git activity and the transitive change impact set.',
29
+ inputSchema: {
30
+ type: 'object',
31
+ properties: { path: MODULE_PROPERTY, root: ROOT_PROPERTY },
32
+ required: ['path'],
33
+ additionalProperties: false,
34
+ },
35
+ outputDescription: 'Module explanation with confidence-carrying heuristics and their evidence.',
36
+ },
37
+ {
38
+ name: 'get_dependencies',
39
+ title: 'Get dependencies',
40
+ description: 'Dependencies of a module or of the whole repository: internal module edges with evidence, external packages grouped by scope and heuristic importance, and imports that could not be resolved to a file.',
41
+ inputSchema: {
42
+ type: 'object',
43
+ properties: {
44
+ module: { type: 'string', description: 'Optional module id or path. Omit for the whole repository.' },
45
+ root: ROOT_PROPERTY,
46
+ },
47
+ additionalProperties: false,
48
+ },
49
+ outputDescription: 'Dependency edges and external packages.',
50
+ },
51
+ {
52
+ name: 'get_dependents',
53
+ title: 'Get dependents',
54
+ description: 'Modules that depend on a given module: direct dependents plus the transitive set, so you can reason about the impact of a change.',
55
+ inputSchema: {
56
+ type: 'object',
57
+ properties: { module: MODULE_PROPERTY, root: ROOT_PROPERTY },
58
+ required: ['module'],
59
+ additionalProperties: false,
60
+ },
61
+ outputDescription: 'Direct and transitive dependents.',
62
+ },
63
+ {
64
+ name: 'search_context',
65
+ title: 'Search context',
66
+ description: 'Deterministic lexical (BM25) search across files, modules, symbols, conventions, decisions and entry points; returns ranked nodes and the reason each matched. Example queries: "payment idempotency", "where are routes registered".',
67
+ inputSchema: {
68
+ type: 'object',
69
+ properties: {
70
+ query: { type: 'string', description: 'Natural language or identifier query.' },
71
+ limit: { type: 'number', description: 'Maximum number of results (default 10).' },
72
+ types: {
73
+ type: 'array',
74
+ description: 'Restrict to node types.',
75
+ items: { type: 'string', enum: ['file', 'module', 'symbol', 'decision', 'convention', 'entry-point'] },
76
+ },
77
+ root: ROOT_PROPERTY,
78
+ },
79
+ required: ['query'],
80
+ additionalProperties: false,
81
+ },
82
+ outputDescription: 'Ranked search results with deterministic match reasons.',
83
+ },
84
+ {
85
+ name: 'get_architecture',
86
+ title: 'Get architecture',
87
+ description: 'Architecture projection: workspace model, entry points and every detected module with heuristic roles (confidence + evidence), responsibilities, dependency edges and neutral git activity.',
88
+ inputSchema: {
89
+ type: 'object',
90
+ properties: { module: { type: 'string', description: 'Optional module id filter.' }, root: ROOT_PROPERTY },
91
+ additionalProperties: false,
92
+ },
93
+ outputDescription: 'Architecture document (schema v1).',
94
+ },
95
+ {
96
+ name: 'get_conventions',
97
+ title: 'Get conventions',
98
+ description: 'Observable repository conventions (naming, imports, tests, error handling, exports, structure, toolchain). Every statement is a counted observation with confidence and evidence — never an invented rule.',
99
+ inputSchema: {
100
+ type: 'object',
101
+ properties: {
102
+ category: { type: 'string', description: 'Optional category filter, for example "Tests".' },
103
+ root: ROOT_PROPERTY,
104
+ },
105
+ additionalProperties: false,
106
+ },
107
+ outputDescription: 'Conventions with confidence and evidence.',
108
+ },
109
+ {
110
+ name: 'get_decisions',
111
+ title: 'Get decisions',
112
+ description: 'Architecture decisions: documents found in docs/, adr/ and README sections (origin "explicit") plus heuristically derived signals (origin "inferred", with evidence and source).',
113
+ inputSchema: {
114
+ type: 'object',
115
+ properties: {
116
+ origin: { type: 'string', enum: ['explicit', 'inferred'], description: 'Optional origin filter.' },
117
+ root: ROOT_PROPERTY,
118
+ },
119
+ additionalProperties: false,
120
+ },
121
+ outputDescription: 'Decisions with origin, status and evidence.',
122
+ },
123
+ ];
124
+ export function toolByName(name) {
125
+ return TOOL_DEFINITIONS.find((tool) => tool.name === name);
126
+ }
127
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqBH,MAAM,aAAa,GAAe;IAChC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,2EAA2E;CACzF,CAAC;AAEF,MAAM,eAAe,GAAe;IAClC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,gGAAgG;CAC9G,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD;QACE,IAAI,EAAE,wBAAwB;QAC9B,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,qPAAqP;QACvP,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE;QACjG,iBAAiB,EAAE,yCAAyC;KAC7D;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,mQAAmQ;QACrQ,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,aAAa,EAAE;YAC1D,QAAQ,EAAE,CAAC,MAAM,CAAC;YAClB,oBAAoB,EAAE,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,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Tool handlers.
3
+ *
4
+ * Thin adapters over the core API: they resolve the repository root, obtain an
5
+ * AgentContext (cached per root so repeated tool calls do not rescan) and return
6
+ * plain JSON payloads. No analysis, no caching policy, no formatting logic lives
7
+ * here.
8
+ */
9
+ import { AgentContext, type AgentContextOptions } from '@ai-agent-context/core';
10
+ export interface ToolHandlerDependencies {
11
+ /** Default repository root (from the CLI flag or the environment). */
12
+ root: string;
13
+ /** Injectable factory, used by tests. */
14
+ createContext?: (options: AgentContextOptions) => Promise<AgentContext>;
15
+ }
16
+ export interface ToolCallResult {
17
+ /** `true` when the tool could not satisfy the request. */
18
+ isError: boolean;
19
+ payload: unknown;
20
+ }
21
+ /** Per-root context cache: an MCP session should not rescan on every call. */
22
+ export declare class ContextPool {
23
+ private readonly contexts;
24
+ private readonly dependencies;
25
+ constructor(dependencies: ToolHandlerDependencies);
26
+ get(root: string): Promise<AgentContext>;
27
+ clear(): void;
28
+ }
29
+ /** Executes an MCP tool by name (first half of the switch). */
30
+ export declare function callTool(name: string, args: Record<string, unknown>, pool: ContextPool, defaultRoot: string): Promise<ToolCallResult>;
31
+ //# sourceMappingURL=handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/tools/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,MAAM,WAAW,uBAAuB;IACtC,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACzE;AAED,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAgBD,8EAA8E;AAC9E,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4C;IACrE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA0B;gBAE3C,YAAY,EAAE,uBAAuB;IAI3C,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAY9C,KAAK,IAAI,IAAI;CAGd;AAMD,+DAA+D;AAC/D,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,cAAc,CAAC,CAkIzB"}
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Tool handlers.
3
+ *
4
+ * Thin adapters over the core API: they resolve the repository root, obtain an
5
+ * AgentContext (cached per root so repeated tool calls do not rescan) and return
6
+ * plain JSON payloads. No analysis, no caching policy, no formatting logic lives
7
+ * here.
8
+ */
9
+ import { AgentContext } from '@ai-agent-context/core';
10
+ function asString(value) {
11
+ return typeof value === 'string' && value.trim().length > 0 ? value : undefined;
12
+ }
13
+ function asNumber(value) {
14
+ return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
15
+ }
16
+ function asStringArray(value) {
17
+ if (!Array.isArray(value))
18
+ return undefined;
19
+ const items = value.filter((entry) => typeof entry === 'string');
20
+ return items.length > 0 ? items : undefined;
21
+ }
22
+ /** Per-root context cache: an MCP session should not rescan on every call. */
23
+ export class ContextPool {
24
+ contexts = new Map();
25
+ dependencies;
26
+ constructor(dependencies) {
27
+ this.dependencies = dependencies;
28
+ }
29
+ async get(root) {
30
+ const existing = this.contexts.get(root);
31
+ if (existing !== undefined)
32
+ return existing;
33
+ const options = { root };
34
+ const pending = this.dependencies.createContext === undefined
35
+ ? AgentContext.load(options)
36
+ : this.dependencies.createContext(options);
37
+ this.contexts.set(root, pending);
38
+ return pending;
39
+ }
40
+ clear() {
41
+ this.contexts.clear();
42
+ }
43
+ }
44
+ function errorPayload(message, extra = {}) {
45
+ return { isError: true, payload: { error: message, ...extra } };
46
+ }
47
+ /** Executes an MCP tool by name (first half of the switch). */
48
+ export async function callTool(name, args, pool, defaultRoot) {
49
+ const root = asString(args['root']) ?? defaultRoot;
50
+ switch (name) {
51
+ case 'get_repository_context': {
52
+ const context = await pool.get(root);
53
+ return { isError: false, payload: await context.getRepositoryContext() };
54
+ }
55
+ case 'explain_module': {
56
+ const target = asString(args['path']) ?? asString(args['module']);
57
+ if (target === undefined)
58
+ return errorPayload('explain_module requires the "path" argument');
59
+ const context = await pool.get(root);
60
+ const explanation = await context.explain(target);
61
+ if (explanation === null) {
62
+ return errorPayload(`no module or file matched "${target}"`, {
63
+ hint: 'Call get_repository_context to list module ids, or search_context to find the module.',
64
+ });
65
+ }
66
+ return { isError: false, payload: explanation };
67
+ }
68
+ case 'get_dependencies': {
69
+ const context = await pool.get(root);
70
+ const module = asString(args['module']);
71
+ if (module === undefined)
72
+ return { isError: false, payload: await context.getDependencies() };
73
+ const explanation = await context.explain(module);
74
+ if (explanation === null)
75
+ return errorPayload(`no module matched "${module}"`);
76
+ const document = await context.getDependencies();
77
+ return {
78
+ isError: false,
79
+ payload: {
80
+ module: explanation.module.id,
81
+ dependsOn: explanation.dependsOn,
82
+ usedBy: explanation.usedBy,
83
+ externalDependencies: explanation.externalDependencies,
84
+ fileImports: document.fileImports.filter((entry) => entry.module === explanation.module.id),
85
+ },
86
+ };
87
+ }
88
+ case 'get_dependents': {
89
+ const module = asString(args['module']);
90
+ if (module === undefined)
91
+ return errorPayload('get_dependents requires the "module" argument');
92
+ const context = await pool.get(root);
93
+ const explanation = await context.explain(module);
94
+ if (explanation === null)
95
+ return errorPayload(`no module matched "${module}"`);
96
+ const repository = await context.getRepository();
97
+ const filesByModule = new Map(repository.modules.map((entry) => [entry.id, entry.files]));
98
+ return {
99
+ isError: false,
100
+ payload: {
101
+ module: explanation.module.id,
102
+ direct: explanation.usedBy,
103
+ transitive: explanation.impact.modules,
104
+ files: explanation.impact.files.slice(0, 200),
105
+ moduleFiles: Object.fromEntries(explanation.impact.modules
106
+ .slice(0, 50)
107
+ .map((id) => [id, filesByModule.get(id) ?? []])),
108
+ },
109
+ };
110
+ }
111
+ case 'search_context': {
112
+ const query = asString(args['query']);
113
+ if (query === undefined)
114
+ return errorPayload('search_context requires the "query" argument');
115
+ const limit = asNumber(args['limit']) ?? 10;
116
+ const types = asStringArray(args['types']);
117
+ const context = await pool.get(root);
118
+ const searchOptions = { limit };
119
+ if (types !== undefined)
120
+ searchOptions.types = types;
121
+ const results = await context.search(query, searchOptions);
122
+ return { isError: false, payload: { query, backend: 'bm25', results } };
123
+ }
124
+ case 'get_architecture': {
125
+ const context = await pool.get(root);
126
+ const architecture = await context.getArchitecture();
127
+ const module = asString(args['module']);
128
+ if (module === undefined)
129
+ return { isError: false, payload: architecture };
130
+ const explanation = await context.explain(module);
131
+ if (explanation === null)
132
+ return errorPayload(`no module matched "${module}"`);
133
+ const entry = architecture.modules.find((candidate) => candidate.id === explanation.module.id) ?? null;
134
+ return {
135
+ isError: false,
136
+ payload: { summary: architecture.summary, workspace: architecture.workspace, module: entry },
137
+ };
138
+ }
139
+ case 'get_conventions': {
140
+ const context = await pool.get(root);
141
+ const conventions = await context.getConventions();
142
+ const category = asString(args['category']);
143
+ const filtered = category === undefined
144
+ ? conventions
145
+ : conventions.filter((convention) => convention.category.toLowerCase() === category.toLowerCase());
146
+ return {
147
+ isError: false,
148
+ payload: {
149
+ total: conventions.length,
150
+ category: category ?? null,
151
+ conventions: filtered,
152
+ note: 'Every statement is a counted observation; confidence and evidence are attached.',
153
+ },
154
+ };
155
+ }
156
+ case 'get_decisions': {
157
+ const context = await pool.get(root);
158
+ const decisions = await context.getDecisions();
159
+ const origin = asString(args['origin']);
160
+ const filtered = origin === undefined ? decisions : decisions.filter((decision) => decision.origin === origin);
161
+ return {
162
+ isError: false,
163
+ payload: {
164
+ total: decisions.length,
165
+ origin: origin ?? null,
166
+ explicit: filtered.filter((decision) => decision.origin === 'explicit').length,
167
+ decisions: filtered,
168
+ note: 'Entries with origin "inferred" were derived heuristically and carry their evidence.',
169
+ },
170
+ };
171
+ }
172
+ default:
173
+ return errorPayload(`unknown tool "${name}"`, { available: 'see tools/list' });
174
+ }
175
+ }
176
+ //# sourceMappingURL=handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/tools/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAA4B,MAAM,wBAAwB,CAAC;AAehF,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAClF,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;IAClF,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC;AAED,8EAA8E;AAC9E,MAAM,OAAO,WAAW;IACL,QAAQ,GAAG,IAAI,GAAG,EAAiC,CAAC;IACpD,YAAY,CAA0B;IAEvD,YAAY,YA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C;YACvG,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE;oBACP,KAAK,EAAE,WAAW,CAAC,MAAM;oBACzB,QAAQ,EAAE,QAAQ,IAAI,IAAI;oBAC1B,WAAW,EAAE,QAAQ;oBACrB,IAAI,EAAE,iFAAiF;iBACxF;aACF,CAAC;QACJ,CAAC;QAED,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,YAAY,EAAE,CAAC;YAC/C,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YACxC,MAAM,QAAQ,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;YAC/G,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE;oBACP,KAAK,EAAE,SAAS,CAAC,MAAM;oBACvB,MAAM,EAAE,MAAM,IAAI,IAAI;oBACtB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,MAAM;oBAC9E,SAAS,EAAE,QAAQ;oBACnB,IAAI,EAAE,qFAAqF;iBAC5F;aACF,CAAC;QACJ,CAAC;QAED;YACE,OAAO,YAAY,CAAC,iBAAiB,IAAI,GAAG,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACnF,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Version constant, kept in one place for both the CLI handshake and MCP info. */
2
+ export declare const MCP_VERSION = "0.1.0";
3
+ /** Re-exported for the MCP handshake (`serverInfo.version`). */
4
+ export { MCP_VERSION as CLI_VERSION };
5
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,gEAAgE;AAChE,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Version constant, kept in one place for both the CLI handshake and MCP info. */
2
+ export const MCP_VERSION = '0.1.0';
3
+ /** Re-exported for the MCP handshake (`serverInfo.version`). */
4
+ export { MCP_VERSION as CLI_VERSION };
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,gEAAgE;AAChE,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@ai-agent-context/mcp",
3
+ "version": "0.1.0",
4
+ "description": "Model Context Protocol adapter for ai-agent-context. Exposes the repository knowledge graph to MCP clients over stdio. Contains no business logic of its own.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "modeusweb <modeusweb@gmail.com>",
8
+ "homepage": "https://github.com/modeusweb/ai-agent-context",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/modeusweb/ai-agent-context.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/modeusweb/ai-agent-context/issues"
15
+ },
16
+ "engines": {
17
+ "node": ">=20.11.0"
18
+ },
19
+ "keywords": [
20
+ "mcp",
21
+ "model-context-protocol",
22
+ "ai-agent",
23
+ "context",
24
+ "knowledge-graph",
25
+ "claude",
26
+ "anthropic"
27
+ ],
28
+ "main": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "bin": {
31
+ "agent-context-mcp": "dist/bin.js"
32
+ },
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "default": "./dist/index.js"
37
+ },
38
+ "./package.json": "./package.json"
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "README.md",
43
+ "LICENSE"
44
+ ],
45
+ "scripts": {
46
+ "build": "tsc -b tsconfig.json"
47
+ },
48
+ "dependencies": {
49
+ "@ai-agent-context/core": "^0.1.0"
50
+ },
51
+ "publishConfig": {
52
+ "access": "public"
53
+ }
54
+ }