mcp-adr-analysis-server 2.7.31 → 2.7.32
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/dist/.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/utils/bootstrap-task-integration.d.ts +0 -214
- package/dist/src/utils/bootstrap-task-integration.d.ts.map +0 -1
- package/dist/src/utils/bootstrap-task-integration.js +0 -365
- package/dist/src/utils/bootstrap-task-integration.js.map +0 -1
- package/dist/src/utils/llm-artifact-detector.d.ts +0 -76
- package/dist/src/utils/llm-artifact-detector.d.ts.map +0 -1
- package/dist/src/utils/llm-artifact-detector.js +0 -426
- package/dist/src/utils/llm-artifact-detector.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-adr-analysis-server",
|
|
3
3
|
"mcpName": "io.github.tosin2013/mcp-adr-analysis-server",
|
|
4
|
-
"version": "2.7.
|
|
4
|
+
"version": "2.7.32",
|
|
5
5
|
"description": "MCP server for analyzing Architectural Decision Records and project architecture",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"type": "module",
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Tasks Integration for Bootstrap Validation Loop
|
|
3
|
-
*
|
|
4
|
-
* This module provides standardized task tracking for the bootstrap validation loop tool,
|
|
5
|
-
* implementing ADR-020: MCP Tasks Integration Strategy.
|
|
6
|
-
*
|
|
7
|
-
* Key features:
|
|
8
|
-
* - Creates MCP Tasks for bootstrap operations
|
|
9
|
-
* - Tracks progress through phases (platform_detection, infrastructure, application, validation)
|
|
10
|
-
* - Supports cancellation between phases
|
|
11
|
-
* - Migrates from custom executionId to standardized taskId
|
|
12
|
-
*
|
|
13
|
-
* @see ADR-020: MCP Tasks Integration Strategy
|
|
14
|
-
* @see https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks
|
|
15
|
-
*/
|
|
16
|
-
import { type AdrTask, type TaskResult, type TaskManager } from './task-manager.js';
|
|
17
|
-
/**
|
|
18
|
-
* Bootstrap phases that map to MCP Task phases
|
|
19
|
-
*/
|
|
20
|
-
export declare const BOOTSTRAP_PHASES: readonly ["platform_detection", "infrastructure_setup", "application_deployment", "validation", "cleanup"];
|
|
21
|
-
export type BootstrapPhase = (typeof BOOTSTRAP_PHASES)[number];
|
|
22
|
-
/**
|
|
23
|
-
* Bootstrap task context for tracking state across iterations
|
|
24
|
-
*/
|
|
25
|
-
export interface BootstrapTaskContext {
|
|
26
|
-
taskId: string;
|
|
27
|
-
currentPhase: BootstrapPhase;
|
|
28
|
-
iteration: number;
|
|
29
|
-
maxIterations: number;
|
|
30
|
-
cancelled: boolean;
|
|
31
|
-
platformDetected?: string;
|
|
32
|
-
infrastructureResult?: {
|
|
33
|
-
success: boolean;
|
|
34
|
-
executedTasks: string[];
|
|
35
|
-
failedTasks: string[];
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Options for creating a bootstrap task
|
|
40
|
-
*/
|
|
41
|
-
export interface CreateBootstrapTaskOptions {
|
|
42
|
-
projectPath: string;
|
|
43
|
-
adrDirectory: string;
|
|
44
|
-
targetEnvironment: string;
|
|
45
|
-
maxIterations: number;
|
|
46
|
-
autoFix: boolean;
|
|
47
|
-
updateAdrsWithLearnings: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Result from bootstrap task execution
|
|
51
|
-
*/
|
|
52
|
-
export interface BootstrapTaskResult extends TaskResult {
|
|
53
|
-
data?: {
|
|
54
|
-
success: boolean;
|
|
55
|
-
iterations: number;
|
|
56
|
-
platformDetected?: string;
|
|
57
|
-
deploymentPlan?: unknown;
|
|
58
|
-
adrUpdates?: unknown[];
|
|
59
|
-
learnings?: unknown[];
|
|
60
|
-
bootstrapAdrPath?: string;
|
|
61
|
-
contextDocumentPath?: string;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Bootstrap Task Manager - Provides MCP Tasks integration for bootstrap validation loop
|
|
66
|
-
*
|
|
67
|
-
* This class wraps the TaskManager to provide bootstrap-specific functionality:
|
|
68
|
-
* - Creates tasks with bootstrap-specific phases
|
|
69
|
-
* - Tracks iteration progress
|
|
70
|
-
* - Supports cancellation checks between phases
|
|
71
|
-
* - Converts between executionId and taskId patterns
|
|
72
|
-
*/
|
|
73
|
-
export declare class BootstrapTaskManager {
|
|
74
|
-
private taskManager;
|
|
75
|
-
private activeContexts;
|
|
76
|
-
constructor(taskManager?: TaskManager);
|
|
77
|
-
/**
|
|
78
|
-
* Initialize the bootstrap task manager
|
|
79
|
-
*/
|
|
80
|
-
initialize(): Promise<void>;
|
|
81
|
-
/**
|
|
82
|
-
* Create a new bootstrap task
|
|
83
|
-
*
|
|
84
|
-
* @returns The created task and context
|
|
85
|
-
*/
|
|
86
|
-
createBootstrapTask(options: CreateBootstrapTaskOptions): Promise<{
|
|
87
|
-
task: AdrTask;
|
|
88
|
-
context: BootstrapTaskContext;
|
|
89
|
-
}>;
|
|
90
|
-
/**
|
|
91
|
-
* Get bootstrap task context
|
|
92
|
-
*/
|
|
93
|
-
getContext(taskId: string): BootstrapTaskContext | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Start a bootstrap phase
|
|
96
|
-
*/
|
|
97
|
-
startPhase(taskId: string, phase: BootstrapPhase, message?: string): Promise<void>;
|
|
98
|
-
/**
|
|
99
|
-
* Update phase progress
|
|
100
|
-
*/
|
|
101
|
-
updatePhaseProgress(taskId: string, phase: BootstrapPhase, phaseProgress: number, message?: string): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Complete a bootstrap phase
|
|
104
|
-
*/
|
|
105
|
-
completePhase(taskId: string, phase: BootstrapPhase, _message?: string): Promise<void>;
|
|
106
|
-
/**
|
|
107
|
-
* Fail a bootstrap phase
|
|
108
|
-
*/
|
|
109
|
-
failPhase(taskId: string, phase: BootstrapPhase, error: string): Promise<void>;
|
|
110
|
-
/**
|
|
111
|
-
* Update iteration progress
|
|
112
|
-
*/
|
|
113
|
-
updateIteration(taskId: string, iteration: number): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* Store platform detection result
|
|
116
|
-
*/
|
|
117
|
-
storePlatformDetection(taskId: string, platform: string, confidence: number): Promise<void>;
|
|
118
|
-
/**
|
|
119
|
-
* Store infrastructure result
|
|
120
|
-
*/
|
|
121
|
-
storeInfrastructureResult(taskId: string, result: {
|
|
122
|
-
success: boolean;
|
|
123
|
-
executedTasks: string[];
|
|
124
|
-
failedTasks: string[];
|
|
125
|
-
}): Promise<void>;
|
|
126
|
-
/**
|
|
127
|
-
* Check if task is cancelled
|
|
128
|
-
*/
|
|
129
|
-
isCancelled(taskId: string): Promise<boolean>;
|
|
130
|
-
/**
|
|
131
|
-
* Cancel a bootstrap task
|
|
132
|
-
*/
|
|
133
|
-
cancelTask(taskId: string, reason?: string): Promise<void>;
|
|
134
|
-
/**
|
|
135
|
-
* Complete a bootstrap task successfully
|
|
136
|
-
*/
|
|
137
|
-
completeTask(taskId: string, result: BootstrapTaskResult): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* Fail a bootstrap task
|
|
140
|
-
*/
|
|
141
|
-
failTask(taskId: string, error: string): Promise<void>;
|
|
142
|
-
/**
|
|
143
|
-
* Get task status
|
|
144
|
-
*/
|
|
145
|
-
getTaskStatus(taskId: string): Promise<{
|
|
146
|
-
task: AdrTask | null;
|
|
147
|
-
context: BootstrapTaskContext | undefined;
|
|
148
|
-
}>;
|
|
149
|
-
}
|
|
150
|
-
export declare function getBootstrapTaskManager(): BootstrapTaskManager;
|
|
151
|
-
/**
|
|
152
|
-
* Reset the global BootstrapTaskManager (for testing)
|
|
153
|
-
*/
|
|
154
|
-
export declare function resetBootstrapTaskManager(): Promise<void>;
|
|
155
|
-
/**
|
|
156
|
-
* Helper function to wrap bootstrap execution with task tracking
|
|
157
|
-
*
|
|
158
|
-
* This can be used by the bootstrap_validation_loop tool to automatically
|
|
159
|
-
* track progress through MCP Tasks.
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* ```typescript
|
|
163
|
-
* const result = await executeWithTaskTracking(
|
|
164
|
-
* {
|
|
165
|
-
* projectPath: '/path/to/project',
|
|
166
|
-
* adrDirectory: 'docs/adrs',
|
|
167
|
-
* targetEnvironment: 'development',
|
|
168
|
-
* maxIterations: 5,
|
|
169
|
-
* autoFix: true,
|
|
170
|
-
* updateAdrsWithLearnings: true,
|
|
171
|
-
* },
|
|
172
|
-
* async (tracker) => {
|
|
173
|
-
* // Platform detection phase
|
|
174
|
-
* await tracker.startPhase('platform_detection');
|
|
175
|
-
* const platform = await detectPlatform();
|
|
176
|
-
* await tracker.storePlatformDetection(platform.name, platform.confidence);
|
|
177
|
-
* await tracker.completePhase('platform_detection');
|
|
178
|
-
*
|
|
179
|
-
* // Infrastructure phase
|
|
180
|
-
* await tracker.startPhase('infrastructure_setup');
|
|
181
|
-
* const infraResult = await runInfrastructure();
|
|
182
|
-
* await tracker.storeInfrastructureResult(infraResult);
|
|
183
|
-
* await tracker.completePhase('infrastructure_setup');
|
|
184
|
-
*
|
|
185
|
-
* // Return final result
|
|
186
|
-
* return { success: true, iterations: 3 };
|
|
187
|
-
* }
|
|
188
|
-
* );
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
|
-
export declare function executeWithTaskTracking<T extends BootstrapTaskResult>(options: CreateBootstrapTaskOptions, executor: (tracker: TaskTracker) => Promise<T['data']>): Promise<{
|
|
192
|
-
taskId: string;
|
|
193
|
-
result: T;
|
|
194
|
-
}>;
|
|
195
|
-
/**
|
|
196
|
-
* Task tracker interface provided to bootstrap executor
|
|
197
|
-
*/
|
|
198
|
-
export interface TaskTracker {
|
|
199
|
-
taskId: string;
|
|
200
|
-
startPhase: (phase: BootstrapPhase, message?: string) => Promise<void>;
|
|
201
|
-
updatePhaseProgress: (phase: BootstrapPhase, progress: number, message?: string) => Promise<void>;
|
|
202
|
-
completePhase: (phase: BootstrapPhase, message?: string) => Promise<void>;
|
|
203
|
-
failPhase: (phase: BootstrapPhase, error: string) => Promise<void>;
|
|
204
|
-
updateIteration: (iteration: number) => Promise<void>;
|
|
205
|
-
storePlatformDetection: (platform: string, confidence: number) => Promise<void>;
|
|
206
|
-
storeInfrastructureResult: (result: {
|
|
207
|
-
success: boolean;
|
|
208
|
-
executedTasks: string[];
|
|
209
|
-
failedTasks: string[];
|
|
210
|
-
}) => Promise<void>;
|
|
211
|
-
isCancelled: () => Promise<boolean>;
|
|
212
|
-
getContext: () => BootstrapTaskContext;
|
|
213
|
-
}
|
|
214
|
-
//# sourceMappingURL=bootstrap-task-integration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-task-integration.d.ts","sourceRoot":"","sources":["../../../src/utils/bootstrap-task-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAkB,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKpG;;GAEG;AACH,eAAO,MAAM,gBAAgB,4GAMnB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,cAAc,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE;QACrB,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,MAAM,EAAE,CAAC;QACxB,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,0BA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C,IAAI,CAAC,CAAC;IAChF,yBAAyB,EAAE,CAAC,MAAM,EAAE;QAClC,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,MAAM,EAAE,CAAC;QACxB,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,oBAAoB,CAAC;CACxC"}
|
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Tasks Integration for Bootstrap Validation Loop
|
|
3
|
-
*
|
|
4
|
-
* This module provides standardized task tracking for the bootstrap validation loop tool,
|
|
5
|
-
* implementing ADR-020: MCP Tasks Integration Strategy.
|
|
6
|
-
*
|
|
7
|
-
* Key features:
|
|
8
|
-
* - Creates MCP Tasks for bootstrap operations
|
|
9
|
-
* - Tracks progress through phases (platform_detection, infrastructure, application, validation)
|
|
10
|
-
* - Supports cancellation between phases
|
|
11
|
-
* - Migrates from custom executionId to standardized taskId
|
|
12
|
-
*
|
|
13
|
-
* @see ADR-020: MCP Tasks Integration Strategy
|
|
14
|
-
* @see https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks
|
|
15
|
-
*/
|
|
16
|
-
import { getTaskManager } from './task-manager.js';
|
|
17
|
-
import { createComponentLogger } from './enhanced-logging.js';
|
|
18
|
-
const logger = createComponentLogger('BootstrapTaskIntegration');
|
|
19
|
-
/**
|
|
20
|
-
* Bootstrap phases that map to MCP Task phases
|
|
21
|
-
*/
|
|
22
|
-
export const BOOTSTRAP_PHASES = [
|
|
23
|
-
'platform_detection',
|
|
24
|
-
'infrastructure_setup',
|
|
25
|
-
'application_deployment',
|
|
26
|
-
'validation',
|
|
27
|
-
'cleanup',
|
|
28
|
-
];
|
|
29
|
-
/**
|
|
30
|
-
* Bootstrap Task Manager - Provides MCP Tasks integration for bootstrap validation loop
|
|
31
|
-
*
|
|
32
|
-
* This class wraps the TaskManager to provide bootstrap-specific functionality:
|
|
33
|
-
* - Creates tasks with bootstrap-specific phases
|
|
34
|
-
* - Tracks iteration progress
|
|
35
|
-
* - Supports cancellation checks between phases
|
|
36
|
-
* - Converts between executionId and taskId patterns
|
|
37
|
-
*/
|
|
38
|
-
export class BootstrapTaskManager {
|
|
39
|
-
taskManager;
|
|
40
|
-
activeContexts = new Map();
|
|
41
|
-
constructor(taskManager) {
|
|
42
|
-
this.taskManager = taskManager ?? getTaskManager();
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Initialize the bootstrap task manager
|
|
46
|
-
*/
|
|
47
|
-
async initialize() {
|
|
48
|
-
await this.taskManager.initialize();
|
|
49
|
-
logger.info('BootstrapTaskManager initialized');
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Create a new bootstrap task
|
|
53
|
-
*
|
|
54
|
-
* @returns The created task and context
|
|
55
|
-
*/
|
|
56
|
-
async createBootstrapTask(options) {
|
|
57
|
-
const { projectPath, adrDirectory, maxIterations } = options;
|
|
58
|
-
const task = await this.taskManager.createTask({
|
|
59
|
-
type: 'bootstrap',
|
|
60
|
-
tool: 'bootstrap_validation_loop',
|
|
61
|
-
phases: [...BOOTSTRAP_PHASES],
|
|
62
|
-
projectPath,
|
|
63
|
-
adrDirectory,
|
|
64
|
-
ttl: 1800000, // 30 minute TTL for bootstrap operations
|
|
65
|
-
pollInterval: 2000, // 2 second poll interval
|
|
66
|
-
});
|
|
67
|
-
const context = {
|
|
68
|
-
taskId: task.taskId,
|
|
69
|
-
currentPhase: 'platform_detection',
|
|
70
|
-
iteration: 0,
|
|
71
|
-
maxIterations,
|
|
72
|
-
cancelled: false,
|
|
73
|
-
};
|
|
74
|
-
this.activeContexts.set(task.taskId, context);
|
|
75
|
-
logger.info('Bootstrap task created', {
|
|
76
|
-
taskId: task.taskId,
|
|
77
|
-
projectPath,
|
|
78
|
-
maxIterations,
|
|
79
|
-
});
|
|
80
|
-
return { task, context };
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Get bootstrap task context
|
|
84
|
-
*/
|
|
85
|
-
getContext(taskId) {
|
|
86
|
-
return this.activeContexts.get(taskId);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Start a bootstrap phase
|
|
90
|
-
*/
|
|
91
|
-
async startPhase(taskId, phase, message) {
|
|
92
|
-
const context = this.activeContexts.get(taskId);
|
|
93
|
-
if (!context) {
|
|
94
|
-
logger.warn('No context found for task', { taskId });
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
// Check for cancellation
|
|
98
|
-
if (context.cancelled) {
|
|
99
|
-
throw new Error('Task was cancelled');
|
|
100
|
-
}
|
|
101
|
-
context.currentPhase = phase;
|
|
102
|
-
await this.taskManager.startPhase(taskId, phase);
|
|
103
|
-
// Calculate overall progress based on phase
|
|
104
|
-
const phaseIndex = BOOTSTRAP_PHASES.indexOf(phase);
|
|
105
|
-
const phaseProgress = phaseIndex >= 0 ? Math.floor((phaseIndex / BOOTSTRAP_PHASES.length) * 100) : 0;
|
|
106
|
-
await this.taskManager.updateProgress({
|
|
107
|
-
taskId,
|
|
108
|
-
progress: phaseProgress,
|
|
109
|
-
phase,
|
|
110
|
-
phaseProgress: 0,
|
|
111
|
-
message: message ?? `Starting phase: ${phase}`,
|
|
112
|
-
});
|
|
113
|
-
logger.info('Bootstrap phase started', { taskId, phase, progress: phaseProgress });
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Update phase progress
|
|
117
|
-
*/
|
|
118
|
-
async updatePhaseProgress(taskId, phase, phaseProgress, message) {
|
|
119
|
-
const context = this.activeContexts.get(taskId);
|
|
120
|
-
if (!context) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
// Calculate overall progress
|
|
124
|
-
const phaseIndex = BOOTSTRAP_PHASES.indexOf(phase);
|
|
125
|
-
const phaseFraction = 100 / BOOTSTRAP_PHASES.length;
|
|
126
|
-
const baseProgress = phaseIndex * phaseFraction;
|
|
127
|
-
const overallProgress = Math.floor(baseProgress + (phaseProgress / 100) * phaseFraction);
|
|
128
|
-
await this.taskManager.updateProgress({
|
|
129
|
-
taskId,
|
|
130
|
-
progress: overallProgress,
|
|
131
|
-
phase,
|
|
132
|
-
phaseProgress,
|
|
133
|
-
...(message !== undefined && { message }),
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Complete a bootstrap phase
|
|
138
|
-
*/
|
|
139
|
-
async completePhase(taskId, phase, _message) {
|
|
140
|
-
const context = this.activeContexts.get(taskId);
|
|
141
|
-
if (!context) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
await this.taskManager.completePhase(taskId, phase);
|
|
145
|
-
logger.info('Bootstrap phase completed', { taskId, phase });
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Fail a bootstrap phase
|
|
149
|
-
*/
|
|
150
|
-
async failPhase(taskId, phase, error) {
|
|
151
|
-
const context = this.activeContexts.get(taskId);
|
|
152
|
-
if (!context) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
await this.taskManager.failPhase(taskId, phase, error);
|
|
156
|
-
logger.warn('Bootstrap phase failed', { taskId, phase, error });
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Update iteration progress
|
|
160
|
-
*/
|
|
161
|
-
async updateIteration(taskId, iteration) {
|
|
162
|
-
const context = this.activeContexts.get(taskId);
|
|
163
|
-
if (!context) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
context.iteration = iteration;
|
|
167
|
-
await this.taskManager.updateProgress({
|
|
168
|
-
taskId,
|
|
169
|
-
progress: this.taskManager.getProgress(taskId) ?? 0,
|
|
170
|
-
message: `Iteration ${iteration}/${context.maxIterations}`,
|
|
171
|
-
});
|
|
172
|
-
logger.info('Bootstrap iteration updated', {
|
|
173
|
-
taskId,
|
|
174
|
-
iteration,
|
|
175
|
-
maxIterations: context.maxIterations,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Store platform detection result
|
|
180
|
-
*/
|
|
181
|
-
async storePlatformDetection(taskId, platform, confidence) {
|
|
182
|
-
const context = this.activeContexts.get(taskId);
|
|
183
|
-
if (!context) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
context.platformDetected = platform;
|
|
187
|
-
await this.taskManager.updateProgress({
|
|
188
|
-
taskId,
|
|
189
|
-
progress: 20, // Platform detection is ~20% of bootstrap
|
|
190
|
-
message: `Platform detected: ${platform} (${(confidence * 100).toFixed(0)}% confidence)`,
|
|
191
|
-
});
|
|
192
|
-
logger.info('Platform detection stored', { taskId, platform, confidence });
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Store infrastructure result
|
|
196
|
-
*/
|
|
197
|
-
async storeInfrastructureResult(taskId, result) {
|
|
198
|
-
const context = this.activeContexts.get(taskId);
|
|
199
|
-
if (!context) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
context.infrastructureResult = result;
|
|
203
|
-
const progress = result.success ? 50 : 40;
|
|
204
|
-
await this.taskManager.updateProgress({
|
|
205
|
-
taskId,
|
|
206
|
-
progress,
|
|
207
|
-
message: result.success
|
|
208
|
-
? `Infrastructure setup complete (${result.executedTasks.length} tasks executed)`
|
|
209
|
-
: `Infrastructure setup failed (${result.failedTasks.length} tasks failed)`,
|
|
210
|
-
});
|
|
211
|
-
logger.info('Infrastructure result stored', {
|
|
212
|
-
taskId,
|
|
213
|
-
success: result.success,
|
|
214
|
-
executed: result.executedTasks.length,
|
|
215
|
-
failed: result.failedTasks.length,
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Check if task is cancelled
|
|
220
|
-
*/
|
|
221
|
-
async isCancelled(taskId) {
|
|
222
|
-
const context = this.activeContexts.get(taskId);
|
|
223
|
-
if (!context) {
|
|
224
|
-
return false;
|
|
225
|
-
}
|
|
226
|
-
// Check if task was cancelled externally
|
|
227
|
-
const task = await this.taskManager.getTask(taskId);
|
|
228
|
-
if (task?.status === 'cancelled') {
|
|
229
|
-
context.cancelled = true;
|
|
230
|
-
}
|
|
231
|
-
return context.cancelled;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Cancel a bootstrap task
|
|
235
|
-
*/
|
|
236
|
-
async cancelTask(taskId, reason) {
|
|
237
|
-
const context = this.activeContexts.get(taskId);
|
|
238
|
-
if (context) {
|
|
239
|
-
context.cancelled = true;
|
|
240
|
-
}
|
|
241
|
-
await this.taskManager.cancelTask(taskId, reason ?? 'Bootstrap cancelled by user');
|
|
242
|
-
this.activeContexts.delete(taskId);
|
|
243
|
-
logger.info('Bootstrap task cancelled', { taskId, reason });
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Complete a bootstrap task successfully
|
|
247
|
-
*/
|
|
248
|
-
async completeTask(taskId, result) {
|
|
249
|
-
await this.taskManager.completeTask(taskId, result);
|
|
250
|
-
this.activeContexts.delete(taskId);
|
|
251
|
-
logger.info('Bootstrap task completed', { taskId, success: result.success });
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Fail a bootstrap task
|
|
255
|
-
*/
|
|
256
|
-
async failTask(taskId, error) {
|
|
257
|
-
await this.taskManager.failTask(taskId, error);
|
|
258
|
-
this.activeContexts.delete(taskId);
|
|
259
|
-
logger.error('Bootstrap task failed', undefined, { taskId, error });
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Get task status
|
|
263
|
-
*/
|
|
264
|
-
async getTaskStatus(taskId) {
|
|
265
|
-
const task = await this.taskManager.getTask(taskId);
|
|
266
|
-
const context = this.activeContexts.get(taskId);
|
|
267
|
-
return { task, context };
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Get the global BootstrapTaskManager instance
|
|
272
|
-
*/
|
|
273
|
-
let globalBootstrapTaskManager = null;
|
|
274
|
-
export function getBootstrapTaskManager() {
|
|
275
|
-
if (!globalBootstrapTaskManager) {
|
|
276
|
-
globalBootstrapTaskManager = new BootstrapTaskManager();
|
|
277
|
-
}
|
|
278
|
-
return globalBootstrapTaskManager;
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* Reset the global BootstrapTaskManager (for testing)
|
|
282
|
-
*/
|
|
283
|
-
export async function resetBootstrapTaskManager() {
|
|
284
|
-
globalBootstrapTaskManager = null;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Helper function to wrap bootstrap execution with task tracking
|
|
288
|
-
*
|
|
289
|
-
* This can be used by the bootstrap_validation_loop tool to automatically
|
|
290
|
-
* track progress through MCP Tasks.
|
|
291
|
-
*
|
|
292
|
-
* @example
|
|
293
|
-
* ```typescript
|
|
294
|
-
* const result = await executeWithTaskTracking(
|
|
295
|
-
* {
|
|
296
|
-
* projectPath: '/path/to/project',
|
|
297
|
-
* adrDirectory: 'docs/adrs',
|
|
298
|
-
* targetEnvironment: 'development',
|
|
299
|
-
* maxIterations: 5,
|
|
300
|
-
* autoFix: true,
|
|
301
|
-
* updateAdrsWithLearnings: true,
|
|
302
|
-
* },
|
|
303
|
-
* async (tracker) => {
|
|
304
|
-
* // Platform detection phase
|
|
305
|
-
* await tracker.startPhase('platform_detection');
|
|
306
|
-
* const platform = await detectPlatform();
|
|
307
|
-
* await tracker.storePlatformDetection(platform.name, platform.confidence);
|
|
308
|
-
* await tracker.completePhase('platform_detection');
|
|
309
|
-
*
|
|
310
|
-
* // Infrastructure phase
|
|
311
|
-
* await tracker.startPhase('infrastructure_setup');
|
|
312
|
-
* const infraResult = await runInfrastructure();
|
|
313
|
-
* await tracker.storeInfrastructureResult(infraResult);
|
|
314
|
-
* await tracker.completePhase('infrastructure_setup');
|
|
315
|
-
*
|
|
316
|
-
* // Return final result
|
|
317
|
-
* return { success: true, iterations: 3 };
|
|
318
|
-
* }
|
|
319
|
-
* );
|
|
320
|
-
* ```
|
|
321
|
-
*/
|
|
322
|
-
export async function executeWithTaskTracking(options, executor) {
|
|
323
|
-
const btm = getBootstrapTaskManager();
|
|
324
|
-
await btm.initialize();
|
|
325
|
-
const { task, context } = await btm.createBootstrapTask(options);
|
|
326
|
-
const taskId = task.taskId;
|
|
327
|
-
// Create a tracker interface for the executor
|
|
328
|
-
const tracker = {
|
|
329
|
-
taskId,
|
|
330
|
-
startPhase: (phase, message) => btm.startPhase(taskId, phase, message),
|
|
331
|
-
updatePhaseProgress: (phase, progress, message) => btm.updatePhaseProgress(taskId, phase, progress, message),
|
|
332
|
-
completePhase: (phase, message) => btm.completePhase(taskId, phase, message),
|
|
333
|
-
failPhase: (phase, error) => btm.failPhase(taskId, phase, error),
|
|
334
|
-
updateIteration: iteration => btm.updateIteration(taskId, iteration),
|
|
335
|
-
storePlatformDetection: (platform, confidence) => btm.storePlatformDetection(taskId, platform, confidence),
|
|
336
|
-
storeInfrastructureResult: result => btm.storeInfrastructureResult(taskId, result),
|
|
337
|
-
isCancelled: () => btm.isCancelled(taskId),
|
|
338
|
-
getContext: () => context,
|
|
339
|
-
};
|
|
340
|
-
try {
|
|
341
|
-
const resultData = await executor(tracker);
|
|
342
|
-
const result = {
|
|
343
|
-
success: resultData?.success ?? true,
|
|
344
|
-
data: resultData,
|
|
345
|
-
};
|
|
346
|
-
await btm.completeTask(taskId, result);
|
|
347
|
-
return { taskId, result };
|
|
348
|
-
}
|
|
349
|
-
catch (error) {
|
|
350
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
351
|
-
await btm.failTask(taskId, errorMessage);
|
|
352
|
-
return {
|
|
353
|
-
taskId,
|
|
354
|
-
result: {
|
|
355
|
-
success: false,
|
|
356
|
-
error: {
|
|
357
|
-
code: 'BOOTSTRAP_ERROR',
|
|
358
|
-
message: errorMessage,
|
|
359
|
-
recoverable: false,
|
|
360
|
-
},
|
|
361
|
-
},
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
//# sourceMappingURL=bootstrap-task-integration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-task-integration.js","sourceRoot":"","sources":["../../../src/utils/bootstrap-task-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAmD,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAwB,MAAM,uBAAuB,CAAC;AAEpF,MAAM,MAAM,GAAoB,qBAAqB,CAAC,0BAA0B,CAAC,CAAC;AAElF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,oBAAoB;IACpB,sBAAsB;IACtB,wBAAwB;IACxB,YAAY;IACZ,SAAS;CACD,CAAC;AAiDX;;;;;;;;GAQG;AACH,MAAM,OAAO,oBAAoB;IACvB,WAAW,CAAc;IACzB,cAAc,GAAsC,IAAI,GAAG,EAAE,CAAC;IAEtE,YAAY,WAAyB;QACnC,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,cAAc,EAAE,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,mBAAmB,CAAC,OAAmC;QAI3D,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;QAE7D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;YAC7C,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,2BAA2B;YACjC,MAAM,EAAE,CAAC,GAAG,gBAAgB,CAAC;YAC7B,WAAW;YACX,YAAY;YACZ,GAAG,EAAE,OAAO,EAAE,yCAAyC;YACvD,YAAY,EAAE,IAAI,EAAE,yBAAyB;SAC9C,CAAC,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