driftdetect-mcp 0.7.1 → 0.8.1
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 +121 -21
- package/dist/bin/server.js +8 -1
- package/dist/bin/server.js.map +1 -1
- package/dist/enterprise-server.d.ts +4 -0
- package/dist/enterprise-server.d.ts.map +1 -1
- package/dist/enterprise-server.js +32 -2
- package/dist/enterprise-server.js.map +1 -1
- package/dist/infrastructure/index.d.ts +1 -0
- package/dist/infrastructure/index.d.ts.map +1 -1
- package/dist/infrastructure/index.js +2 -0
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/infrastructure/startup-warmer.d.ts +65 -0
- package/dist/infrastructure/startup-warmer.d.ts.map +1 -0
- package/dist/infrastructure/startup-warmer.js +257 -0
- package/dist/infrastructure/startup-warmer.js.map +1 -0
- package/dist/tools/analysis/coupling.js +181 -63
- package/dist/tools/analysis/coupling.js.map +1 -1
- package/dist/tools/analysis/cpp.d.ts +51 -0
- package/dist/tools/analysis/cpp.d.ts.map +1 -0
- package/dist/tools/analysis/cpp.js +224 -0
- package/dist/tools/analysis/cpp.js.map +1 -0
- package/dist/tools/analysis/error-handling.js +130 -37
- package/dist/tools/analysis/error-handling.js.map +1 -1
- package/dist/tools/analysis/index.d.ts +3 -0
- package/dist/tools/analysis/index.d.ts.map +1 -1
- package/dist/tools/analysis/index.js +100 -0
- package/dist/tools/analysis/index.js.map +1 -1
- package/dist/tools/analysis/quality-gate.d.ts +78 -0
- package/dist/tools/analysis/quality-gate.d.ts.map +1 -0
- package/dist/tools/analysis/quality-gate.js +164 -0
- package/dist/tools/analysis/quality-gate.js.map +1 -0
- package/dist/tools/analysis/rust.d.ts +51 -0
- package/dist/tools/analysis/rust.d.ts.map +1 -0
- package/dist/tools/analysis/rust.js +253 -0
- package/dist/tools/analysis/rust.js.map +1 -0
- package/dist/tools/analysis/simulate.d.ts +1 -0
- package/dist/tools/analysis/simulate.d.ts.map +1 -1
- package/dist/tools/analysis/simulate.js +78 -74
- package/dist/tools/analysis/simulate.js.map +1 -1
- package/dist/tools/analysis/test-topology.js +117 -44
- package/dist/tools/analysis/test-topology.js.map +1 -1
- package/dist/tools/detail/reachability.d.ts +2 -0
- package/dist/tools/detail/reachability.d.ts.map +1 -1
- package/dist/tools/detail/reachability.js +42 -32
- package/dist/tools/detail/reachability.js.map +1 -1
- package/dist/tools/orchestration/index.d.ts +2 -0
- package/dist/tools/orchestration/index.d.ts.map +1 -1
- package/dist/tools/orchestration/index.js +3 -0
- package/dist/tools/orchestration/index.js.map +1 -1
- package/dist/tools/orchestration/package-context.d.ts +134 -0
- package/dist/tools/orchestration/package-context.d.ts.map +1 -0
- package/dist/tools/orchestration/package-context.js +261 -0
- package/dist/tools/orchestration/package-context.js.map +1 -0
- package/package.json +4 -4
- package/dist/server.d.ts +0 -11
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -3177
- package/dist/server.js.map +0 -1
- package/dist/tools/detail/dna-check.d.ts +0 -32
- package/dist/tools/detail/dna-check.d.ts.map +0 -1
- package/dist/tools/detail/dna-check.js +0 -231
- package/dist/tools/detail/dna-check.js.map +0 -1
- package/dist/tools/exploration/files-list.d.ts +0 -29
- package/dist/tools/exploration/files-list.d.ts.map +0 -1
- package/dist/tools/exploration/files-list.js +0 -94
- package/dist/tools/exploration/files-list.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work.
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including
|
|
45
|
+
the original version of the Work and any modifications or additions
|
|
46
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
47
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner.
|
|
48
|
+
|
|
49
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
50
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
51
|
+
subsequently incorporated within the Work.
|
|
52
|
+
|
|
53
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
54
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
55
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
56
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
57
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
58
|
+
Work and such Derivative Works in Source or Object form.
|
|
59
|
+
|
|
60
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
61
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
62
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
63
|
+
patent license to make, have made, use, offer to sell, sell, import,
|
|
64
|
+
and otherwise transfer the Work.
|
|
65
|
+
|
|
66
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
67
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
68
|
+
modifications, and in Source or Object form, provided that You
|
|
69
|
+
meet the following conditions:
|
|
70
|
+
|
|
71
|
+
(a) You must give any other recipients of the Work or
|
|
72
|
+
Derivative Works a copy of this License; and
|
|
73
|
+
|
|
74
|
+
(b) You must cause any modified files to carry prominent notices
|
|
75
|
+
stating that You changed the files; and
|
|
76
|
+
|
|
77
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
78
|
+
that You distribute, all copyright, patent, trademark, and
|
|
79
|
+
attribution notices from the Source form of the Work; and
|
|
80
|
+
|
|
81
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
82
|
+
distribution, then any Derivative Works that You distribute must
|
|
83
|
+
include a readable copy of the attribution notices contained
|
|
84
|
+
within such NOTICE file.
|
|
85
|
+
|
|
86
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
87
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
88
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
89
|
+
this License, without any additional terms or conditions.
|
|
90
|
+
|
|
91
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
92
|
+
names, trademarks, service marks, or product names of the Licensor.
|
|
93
|
+
|
|
94
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
95
|
+
agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
|
|
96
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
|
|
97
|
+
|
|
98
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
99
|
+
shall any Contributor be liable to You for damages, including any
|
|
100
|
+
direct, indirect, special, incidental, or consequential damages.
|
|
101
|
+
|
|
102
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
103
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
104
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
105
|
+
or other liability obligations.
|
|
106
|
+
|
|
107
|
+
END OF TERMS AND CONDITIONS
|
|
108
|
+
|
|
109
|
+
Copyright 2025 Geoffrey Fernald
|
|
110
|
+
|
|
111
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
112
|
+
you may not use this file except in compliance with the License.
|
|
113
|
+
You may obtain a copy of the License at
|
|
114
|
+
|
|
115
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
116
|
+
|
|
117
|
+
Unless required by applicable law or agreed to in writing, software
|
|
118
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
119
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
120
|
+
See the License for the specific language governing permissions and
|
|
121
|
+
limitations under the License.
|
package/dist/bin/server.js
CHANGED
|
@@ -33,13 +33,20 @@ async function main() {
|
|
|
33
33
|
// Parse flags
|
|
34
34
|
const noCache = args.includes('--no-cache');
|
|
35
35
|
const noRateLimit = args.includes('--no-rate-limit');
|
|
36
|
+
const verbose = args.includes('--verbose') || args.includes('-v');
|
|
37
|
+
const skipWarmup = args.includes('--skip-warmup');
|
|
36
38
|
// Get project root (first non-flag argument, or cwd)
|
|
37
|
-
const projectRoot = args.find(arg => !arg.startsWith('--')) ?? process.cwd();
|
|
39
|
+
const projectRoot = args.find(arg => !arg.startsWith('--') && !arg.startsWith('-')) ?? process.cwd();
|
|
40
|
+
if (verbose) {
|
|
41
|
+
console.error(`[drift-mcp] Starting server for: ${projectRoot}`);
|
|
42
|
+
}
|
|
38
43
|
const server = createEnterpriseMCPServer({
|
|
39
44
|
projectRoot,
|
|
40
45
|
enableCache: !noCache,
|
|
41
46
|
enableRateLimiting: !noRateLimit,
|
|
42
47
|
enableMetrics: true,
|
|
48
|
+
verbose,
|
|
49
|
+
skipWarmup,
|
|
43
50
|
});
|
|
44
51
|
const transport = new StdioServerTransport();
|
|
45
52
|
await server.connect(transport);
|
package/dist/bin/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/bin/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,KAAK,UAAU,IAAI;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,cAAc;IACd,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/bin/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAE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AM,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -26,6 +26,10 @@ export interface EnterpriseMCPConfig {
|
|
|
26
26
|
maxRequestsPerMinute?: number;
|
|
27
27
|
/** Use the new IPatternService instead of direct PatternStore access */
|
|
28
28
|
usePatternService?: boolean;
|
|
29
|
+
/** Enable verbose logging for warmup */
|
|
30
|
+
verbose?: boolean;
|
|
31
|
+
/** Skip warmup on startup (not recommended) */
|
|
32
|
+
skipWarmup?: boolean;
|
|
29
33
|
}
|
|
30
34
|
export declare function createEnterpriseMCPServer(config: EnterpriseMCPConfig): Server;
|
|
31
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enterprise-server.d.ts","sourceRoot":"","sources":["../src/enterprise-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"enterprise-server.d.ts","sourceRoot":"","sources":["../src/enterprise-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAgFnE,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,wCAAwC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CA8H7E;AAwOD;;GAEG;AACH,wBAAgB,iBAAiB;;;;;;;;EAEhC;AAED;;GAEG;AACH,wBAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE1B"}
|
|
@@ -21,7 +21,7 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
21
21
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
22
22
|
import { PatternStore, ManifestStore, HistoryStore, DNAStore, BoundaryStore, ContractStore, CallGraphStore, EnvStore, createDataLake, createPatternServiceFromStore, } from 'driftdetect-core';
|
|
23
23
|
// Infrastructure
|
|
24
|
-
import { handleError, rateLimiter, metrics, createCache, } from './infrastructure/index.js';
|
|
24
|
+
import { handleError, rateLimiter, metrics, createCache, warmupStores, buildMissingData, logWarmupResult, } from './infrastructure/index.js';
|
|
25
25
|
// Tool definitions
|
|
26
26
|
import { ALL_TOOLS, TOOL_CATEGORIES } from './tools/registry.js';
|
|
27
27
|
// Discovery handlers
|
|
@@ -45,7 +45,7 @@ import { handleWrappers } from './tools/detail/wrappers.js';
|
|
|
45
45
|
// Discovery handlers (additional)
|
|
46
46
|
import { handleProjects } from './tools/discovery/projects.js';
|
|
47
47
|
// Orchestration handlers
|
|
48
|
-
import { handleContext } from './tools/orchestration/index.js';
|
|
48
|
+
import { handleContext, handlePackageContext } from './tools/orchestration/index.js';
|
|
49
49
|
// Generation handlers (new AI-powered tools)
|
|
50
50
|
import { handleSuggestChanges } from './tools/generation/suggest-changes.js';
|
|
51
51
|
import { handleValidateChange } from './tools/generation/validate-change.js';
|
|
@@ -59,7 +59,10 @@ import { handleSimulate } from './tools/analysis/simulate.js';
|
|
|
59
59
|
import { handleConstraints } from './tools/analysis/constraints.js';
|
|
60
60
|
import { executeWpfTool } from './tools/analysis/wpf.js';
|
|
61
61
|
import { executeGoTool } from './tools/analysis/go.js';
|
|
62
|
+
import { executeRustTool } from './tools/analysis/rust.js';
|
|
63
|
+
import { executeCppTool } from './tools/analysis/cpp.js';
|
|
62
64
|
import { handleConstants } from './tools/analysis/constants.js';
|
|
65
|
+
import { handleQualityGate } from './tools/analysis/quality-gate.js';
|
|
63
66
|
export function createEnterpriseMCPServer(config) {
|
|
64
67
|
const server = new Server({ name: 'drift-enterprise', version: '2.0.0' }, { capabilities: { tools: {} } });
|
|
65
68
|
// Initialize stores
|
|
@@ -87,6 +90,25 @@ export function createEnterpriseMCPServer(config) {
|
|
|
87
90
|
const cache = config.enableCache !== false
|
|
88
91
|
? createCache(config.projectRoot)
|
|
89
92
|
: null;
|
|
93
|
+
// Warm up stores on startup (async, non-blocking for server start)
|
|
94
|
+
// This loads all .drift data into memory so tools work immediately
|
|
95
|
+
if (config.skipWarmup !== true) {
|
|
96
|
+
warmupStores(stores, config.projectRoot, dataLake)
|
|
97
|
+
.then((result) => {
|
|
98
|
+
logWarmupResult(result, config.verbose);
|
|
99
|
+
// Build missing data in background (e.g., call graph)
|
|
100
|
+
if (!result.loaded.callGraph) {
|
|
101
|
+
buildMissingData(config.projectRoot, result.loaded).catch(() => {
|
|
102
|
+
// Silently fail - user can build manually
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
.catch((error) => {
|
|
107
|
+
if (config.verbose) {
|
|
108
|
+
console.error('[drift-mcp] Warmup failed:', error);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
90
112
|
// List available tools
|
|
91
113
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
92
114
|
metrics.increment('tools.list');
|
|
@@ -157,6 +179,8 @@ async function routeToolCall(name, args, stores, projectRoot, dataLake, patternS
|
|
|
157
179
|
callGraph: stores.callGraph,
|
|
158
180
|
dna: stores.dna,
|
|
159
181
|
}, projectRoot, args);
|
|
182
|
+
case 'drift_package_context':
|
|
183
|
+
return handlePackageContext(projectRoot, args);
|
|
160
184
|
}
|
|
161
185
|
// ============================================================================
|
|
162
186
|
// Discovery Tools (Layer 1)
|
|
@@ -246,8 +270,14 @@ async function routeToolCall(name, args, stores, projectRoot, dataLake, patternS
|
|
|
246
270
|
return executeWpfTool(args, { projectRoot });
|
|
247
271
|
case 'drift_go':
|
|
248
272
|
return executeGoTool(args, { projectRoot });
|
|
273
|
+
case 'drift_rust':
|
|
274
|
+
return executeRustTool(args, { projectRoot });
|
|
275
|
+
case 'drift_cpp':
|
|
276
|
+
return executeCppTool(args, { projectRoot });
|
|
249
277
|
case 'drift_constants':
|
|
250
278
|
return handleConstants(projectRoot, args);
|
|
279
|
+
case 'drift_quality_gate':
|
|
280
|
+
return handleQualityGate(projectRoot, args);
|
|
251
281
|
}
|
|
252
282
|
// ============================================================================
|
|
253
283
|
// Generation Tools (AI-Powered Code Intelligence)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enterprise-server.js","sourceRoot":"","sources":["../src/enterprise-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,cAAc,EACd,QAAQ,E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AAW,EACX,IAA6D,CAC9D,CAAC;QAEJ,KAAK,eAAe;YAClB,OAAO,aAAa,CAClB;gBACE,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B,EACD,WAAW,EACX,IAAsD,CACvD,CAAC;IACN,CAAC;IAED,eAAe;IACf,OAAO;QACL,OAAO,EAAE,CAAC;gBACR,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,KAAK,EAAE,iBAAiB,IAAI,EAAE;oBAC9B,IAAI,EAAE,+CAA+C;oBACrD,cAAc,EAAE,eAAe;iBAChC,CAAC;aACH,CAAC;QACF,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -18,4 +18,5 @@ export { ResponseCache, createCache, type CachedResponse, type CacheConfig, } fr
|
|
|
18
18
|
export { RateLimiter, rateLimiter, type RateLimitConfig, } from './rate-limiter.js';
|
|
19
19
|
export { MetricsCollector, metrics, type Metric, type MetricLabels, type HistogramBuckets, } from './metrics.js';
|
|
20
20
|
export { resolveProject, formatProjectContext, ProjectNotFoundError, ProjectInvalidError, type ProjectResolution, } from './project-resolver.js';
|
|
21
|
+
export { warmupStores, buildMissingData, logWarmupResult, type WarmupResult, type WarmupStores, } from './startup-warmer.js';
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,cAAc,EACd,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACX,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,UAAU,EACV,cAAc,EACd,MAAM,EACN,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,aAAa,EACb,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,iBAAiB,GACvB,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,cAAc,EACd,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACX,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,UAAU,EACV,cAAc,EACd,MAAM,EACN,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,aAAa,EACb,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,iBAAiB,GACvB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC"}
|
|
@@ -26,4 +26,6 @@ export { RateLimiter, rateLimiter, } from './rate-limiter.js';
|
|
|
26
26
|
export { MetricsCollector, metrics, } from './metrics.js';
|
|
27
27
|
// Project Resolution
|
|
28
28
|
export { resolveProject, formatProjectContext, ProjectNotFoundError, ProjectInvalidError, } from './project-resolver.js';
|
|
29
|
+
// Startup Warmer
|
|
30
|
+
export { warmupStores, buildMissingData, logWarmupResult, } from './startup-warmer.js';
|
|
29
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,oBAAoB;AACpB,OAAO,EACL,eAAe,EACf,qBAAqB,GAMtB,MAAM,uBAAuB,CAAC;AAE/B,mBAAmB;AACnB,OAAO,EACL,cAAc,EACd,cAAc,GAEf,MAAM,sBAAsB,CAAC;AAE9B,oBAAoB;AACpB,OAAO,EACL,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,GAGZ,MAAM,qBAAqB,CAAC;AAE7B,iBAAiB;AACjB,OAAO,EACL,UAAU,EACV,cAAc,EACd,MAAM,EACN,WAAW,GAGZ,MAAM,oBAAoB,CAAC;AAE5B,UAAU;AACV,OAAO,EACL,aAAa,EACb,WAAW,GAGZ,MAAM,YAAY,CAAC;AAEpB,gBAAgB;AAChB,OAAO,EACL,WAAW,EACX,WAAW,GAEZ,MAAM,mBAAmB,CAAC;AAE3B,UAAU;AACV,OAAO,EACL,gBAAgB,EAChB,OAAO,GAIR,MAAM,cAAc,CAAC;AAEtB,qBAAqB;AACrB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,oBAAoB;AACpB,OAAO,EACL,eAAe,EACf,qBAAqB,GAMtB,MAAM,uBAAuB,CAAC;AAE/B,mBAAmB;AACnB,OAAO,EACL,cAAc,EACd,cAAc,GAEf,MAAM,sBAAsB,CAAC;AAE9B,oBAAoB;AACpB,OAAO,EACL,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,GAGZ,MAAM,qBAAqB,CAAC;AAE7B,iBAAiB;AACjB,OAAO,EACL,UAAU,EACV,cAAc,EACd,MAAM,EACN,WAAW,GAGZ,MAAM,oBAAoB,CAAC;AAE5B,UAAU;AACV,OAAO,EACL,aAAa,EACb,WAAW,GAGZ,MAAM,YAAY,CAAC;AAEpB,gBAAgB;AAChB,OAAO,EACL,WAAW,EACX,WAAW,GAEZ,MAAM,mBAAmB,CAAC;AAE3B,UAAU;AACV,OAAO,EACL,gBAAgB,EAChB,OAAO,GAIR,MAAM,cAAc,CAAC;AAEtB,qBAAqB;AACrB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAE/B,iBAAiB;AACjB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAGhB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Startup Warmer - Pre-loads all .drift data on MCP server initialization
|
|
3
|
+
*
|
|
4
|
+
* This ensures all stores are populated from the source of truth (.drift folder)
|
|
5
|
+
* before any tool calls are made, eliminating the need for users to manually
|
|
6
|
+
* run build commands.
|
|
7
|
+
*
|
|
8
|
+
* Data loaded:
|
|
9
|
+
* - Patterns (approved, discovered, ignored)
|
|
10
|
+
* - Call graph
|
|
11
|
+
* - Boundaries (data access map)
|
|
12
|
+
* - Environment variables
|
|
13
|
+
* - DNA profile
|
|
14
|
+
* - Contracts
|
|
15
|
+
* - History snapshots
|
|
16
|
+
* - Module coupling
|
|
17
|
+
* - Error handling analysis
|
|
18
|
+
* - Test topology
|
|
19
|
+
*/
|
|
20
|
+
import { PatternStore, ManifestStore, HistoryStore, DNAStore, BoundaryStore, ContractStore, CallGraphStore, EnvStore, UnifiedCallGraphProvider, type DataLake } from 'driftdetect-core';
|
|
21
|
+
export interface WarmupResult {
|
|
22
|
+
success: boolean;
|
|
23
|
+
duration: number;
|
|
24
|
+
loaded: {
|
|
25
|
+
patterns: number;
|
|
26
|
+
callGraph: boolean;
|
|
27
|
+
boundaries: boolean;
|
|
28
|
+
env: number;
|
|
29
|
+
dna: boolean;
|
|
30
|
+
contracts: number;
|
|
31
|
+
history: number;
|
|
32
|
+
coupling: boolean;
|
|
33
|
+
errorHandling: boolean;
|
|
34
|
+
testTopology: boolean;
|
|
35
|
+
};
|
|
36
|
+
errors: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface WarmupStores {
|
|
39
|
+
pattern: PatternStore;
|
|
40
|
+
manifest: ManifestStore;
|
|
41
|
+
history: HistoryStore;
|
|
42
|
+
dna: DNAStore;
|
|
43
|
+
boundary: BoundaryStore;
|
|
44
|
+
contract: ContractStore;
|
|
45
|
+
callGraph: CallGraphStore;
|
|
46
|
+
callGraphProvider?: UnifiedCallGraphProvider;
|
|
47
|
+
env: EnvStore;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Warm up all stores by loading data from .drift folder
|
|
51
|
+
*/
|
|
52
|
+
export declare function warmupStores(stores: WarmupStores, projectRoot: string, dataLake?: DataLake): Promise<WarmupResult>;
|
|
53
|
+
/**
|
|
54
|
+
* Build missing data if not present
|
|
55
|
+
* This is a background operation that doesn't block startup
|
|
56
|
+
*
|
|
57
|
+
* Note: Call graph building is complex and requires scanning the codebase.
|
|
58
|
+
* For now, we just log a hint that the user should run `drift callgraph build`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function buildMissingData(_projectRoot: string, loaded: WarmupResult['loaded']): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Log warmup results for debugging
|
|
63
|
+
*/
|
|
64
|
+
export declare function logWarmupResult(result: WarmupResult, verbose?: boolean): void;
|
|
65
|
+
//# sourceMappingURL=startup-warmer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startup-warmer.d.ts","sourceRoot":"","sources":["../../src/infrastructure/startup-warmer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,cAAc,EACd,QAAQ,EACR,wBAAwB,EAExB,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE;QACN,QAAQ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