mycontext-cli 4.0.0 → 4.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/README.md +56 -114
- package/dist/cli.js +67 -0
- package/dist/cli.js.map +1 -1
- package/dist/clients/MyContextAIClient.d.ts.map +1 -1
- package/dist/clients/MyContextAIClient.js +12 -0
- package/dist/clients/MyContextAIClient.js.map +1 -1
- package/dist/commands/agent.d.ts +22 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +245 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +18 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +0 -9
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync-readme.d.ts +14 -0
- package/dist/commands/sync-readme.d.ts.map +1 -0
- package/dist/commands/sync-readme.js +131 -0
- package/dist/commands/sync-readme.js.map +1 -0
- package/dist/commands/test.d.ts +76 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +361 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/mcp/browser-test-runner.d.ts +89 -0
- package/dist/mcp/browser-test-runner.d.ts.map +1 -0
- package/dist/mcp/browser-test-runner.js +786 -0
- package/dist/mcp/browser-test-runner.js.map +1 -0
- package/dist/mcp/test-mission-manager.d.ts +82 -0
- package/dist/mcp/test-mission-manager.d.ts.map +1 -0
- package/dist/mcp/test-mission-manager.js +327 -0
- package/dist/mcp/test-mission-manager.js.map +1 -0
- package/dist/mcp/test-reporter.d.ts +54 -0
- package/dist/mcp/test-reporter.d.ts.map +1 -0
- package/dist/mcp/test-reporter.js +358 -0
- package/dist/mcp/test-reporter.js.map +1 -0
- package/dist/mcp/testing-server.d.ts +36 -0
- package/dist/mcp/testing-server.d.ts.map +1 -0
- package/dist/mcp/testing-server.js +516 -0
- package/dist/mcp/testing-server.js.map +1 -0
- package/dist/package.json +6 -2
- package/dist/services/ContextService.d.ts +38 -0
- package/dist/services/ContextService.d.ts.map +1 -0
- package/dist/services/ContextService.js +104 -0
- package/dist/services/ContextService.js.map +1 -0
- package/dist/services/ProbeManager.d.ts +32 -0
- package/dist/services/ProbeManager.d.ts.map +1 -0
- package/dist/services/ProbeManager.js +116 -0
- package/dist/services/ProbeManager.js.map +1 -0
- package/dist/types/design-pipeline.d.ts +6 -0
- package/dist/types/design-pipeline.d.ts.map +1 -1
- package/dist/types/flow-testing.d.ts +179 -0
- package/dist/types/flow-testing.d.ts.map +1 -0
- package/dist/types/flow-testing.js +7 -0
- package/dist/types/flow-testing.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/designManifestManager.d.ts +4 -0
- package/dist/utils/designManifestManager.d.ts.map +1 -1
- package/dist/utils/designManifestManager.js +161 -0
- package/dist/utils/designManifestManager.js.map +1 -1
- package/dist/utils/githubModelsClient.d.ts.map +1 -1
- package/dist/utils/githubModelsClient.js +6 -2
- package/dist/utils/githubModelsClient.js.map +1 -1
- package/dist/utils/mcpTools.d.ts +21 -21
- package/package.json +6 -2
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Flow Testing MCP Server
|
|
5
|
+
*
|
|
6
|
+
* A Model Context Protocol server that provides AI-powered UI flow testing capabilities.
|
|
7
|
+
* Can be used standalone or integrated with MyContext CLI.
|
|
8
|
+
*
|
|
9
|
+
* MCP Tools:
|
|
10
|
+
* - create_test_mission: Create a new test mission from natural language
|
|
11
|
+
* - run_test: Execute a test mission with autonomous browser navigation
|
|
12
|
+
* - list_test_missions: List all saved test missions
|
|
13
|
+
* - get_test_report: Retrieve detailed test execution report
|
|
14
|
+
* - record_flow: Interactive flow recording mode
|
|
15
|
+
*/
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.FlowTestingMCPServer = void 0;
|
|
21
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
22
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
23
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
24
|
+
const test_mission_manager_1 = require("./test-mission-manager");
|
|
25
|
+
const browser_test_runner_1 = require("./browser-test-runner");
|
|
26
|
+
const test_reporter_1 = require("./test-reporter");
|
|
27
|
+
const ProbeManager_1 = require("../services/ProbeManager");
|
|
28
|
+
const ContextService_1 = require("../services/ContextService");
|
|
29
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
30
|
+
class FlowTestingMCPServer {
|
|
31
|
+
constructor(projectPath) {
|
|
32
|
+
this.projectPath = projectPath || process.cwd();
|
|
33
|
+
this.server = new index_js_1.Server({
|
|
34
|
+
name: "flow-testing-server",
|
|
35
|
+
version: "1.0.0",
|
|
36
|
+
}, {
|
|
37
|
+
capabilities: {
|
|
38
|
+
tools: {},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
// Initialize managers
|
|
42
|
+
this.missionManager = new test_mission_manager_1.TestMissionManager(this.projectPath);
|
|
43
|
+
this.testRunner = new browser_test_runner_1.BrowserTestRunner(this.projectPath);
|
|
44
|
+
this.reporter = new test_reporter_1.TestReporter(this.projectPath);
|
|
45
|
+
this.probeManager = new ProbeManager_1.ProbeManager(this.projectPath);
|
|
46
|
+
this.contextService = new ContextService_1.ContextService(this.projectPath);
|
|
47
|
+
this.setupToolHandlers();
|
|
48
|
+
}
|
|
49
|
+
setupToolHandlers() {
|
|
50
|
+
// List available tools
|
|
51
|
+
this.server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
52
|
+
return {
|
|
53
|
+
tools: this.getAvailableTools(),
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
// Handle tool calls
|
|
57
|
+
this.server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
58
|
+
const { name, arguments: args } = request.params;
|
|
59
|
+
try {
|
|
60
|
+
switch (name) {
|
|
61
|
+
case "create_test_mission":
|
|
62
|
+
return await this.handleCreateTestMission(args);
|
|
63
|
+
case "run_test":
|
|
64
|
+
return await this.handleRunTest(args);
|
|
65
|
+
case "list_test_missions":
|
|
66
|
+
return await this.handleListTestMissions(args);
|
|
67
|
+
case "get_test_report":
|
|
68
|
+
return await this.handleGetTestReport(args);
|
|
69
|
+
case "run_probe":
|
|
70
|
+
return await this.handleRunProbe(args);
|
|
71
|
+
case "query_context":
|
|
72
|
+
return await this.handleQueryContext(args);
|
|
73
|
+
case "record_flow":
|
|
74
|
+
return await this.handleRecordFlow(args);
|
|
75
|
+
case "watch_tests":
|
|
76
|
+
return await this.handleWatchTests(args);
|
|
77
|
+
default:
|
|
78
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return {
|
|
83
|
+
content: [
|
|
84
|
+
{
|
|
85
|
+
type: "text",
|
|
86
|
+
text: `Error executing ${name}: ${error.message}`,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
isError: true,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
getAvailableTools() {
|
|
95
|
+
return [
|
|
96
|
+
{
|
|
97
|
+
name: "create_test_mission",
|
|
98
|
+
description: "Create a new UI flow test mission from natural language description",
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: "object",
|
|
101
|
+
properties: {
|
|
102
|
+
name: {
|
|
103
|
+
type: "string",
|
|
104
|
+
description: "Name for the test mission",
|
|
105
|
+
},
|
|
106
|
+
mission: {
|
|
107
|
+
type: "string",
|
|
108
|
+
description: "Natural language description of what to test (e.g., 'User should be able to login with valid credentials')",
|
|
109
|
+
},
|
|
110
|
+
expectedOutcome: {
|
|
111
|
+
type: "string",
|
|
112
|
+
description: "Expected result after completing the mission",
|
|
113
|
+
},
|
|
114
|
+
validationRules: {
|
|
115
|
+
type: "array",
|
|
116
|
+
description: "Optional validation rules to check",
|
|
117
|
+
items: {
|
|
118
|
+
type: "object",
|
|
119
|
+
properties: {
|
|
120
|
+
type: {
|
|
121
|
+
type: "string",
|
|
122
|
+
enum: [
|
|
123
|
+
"url-match",
|
|
124
|
+
"element-exists",
|
|
125
|
+
"text-contains",
|
|
126
|
+
"element-visible",
|
|
127
|
+
"form-submitted",
|
|
128
|
+
"data-updated",
|
|
129
|
+
"custom",
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
description: { type: "string" },
|
|
133
|
+
selector: { type: "string" },
|
|
134
|
+
expectedValue: { type: "string" },
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
startUrl: {
|
|
139
|
+
type: "string",
|
|
140
|
+
description: "Starting URL for the test",
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
required: ["name", "mission", "expectedOutcome"],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "run_test",
|
|
148
|
+
description: "Execute a test mission with autonomous browser navigation",
|
|
149
|
+
inputSchema: {
|
|
150
|
+
type: "object",
|
|
151
|
+
properties: {
|
|
152
|
+
missionId: {
|
|
153
|
+
type: "string",
|
|
154
|
+
description: "ID of the test mission to run",
|
|
155
|
+
},
|
|
156
|
+
headless: {
|
|
157
|
+
type: "boolean",
|
|
158
|
+
description: "Run browser in headless mode (default: true)",
|
|
159
|
+
},
|
|
160
|
+
baseUrl: {
|
|
161
|
+
type: "string",
|
|
162
|
+
description: "Base URL to use if different from mission config",
|
|
163
|
+
},
|
|
164
|
+
slowMo: {
|
|
165
|
+
type: "number",
|
|
166
|
+
description: "Slow down operations by N milliseconds for debugging",
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
required: ["missionId"],
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "list_test_missions",
|
|
174
|
+
description: "List all saved test missions",
|
|
175
|
+
inputSchema: {
|
|
176
|
+
type: "object",
|
|
177
|
+
properties: {
|
|
178
|
+
status: {
|
|
179
|
+
type: "string",
|
|
180
|
+
enum: ["all", "passing", "failing"],
|
|
181
|
+
description: "Filter missions by last execution status",
|
|
182
|
+
},
|
|
183
|
+
tag: {
|
|
184
|
+
type: "string",
|
|
185
|
+
description: "Filter missions by tag",
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "get_test_report",
|
|
192
|
+
description: "Retrieve detailed report from a test execution",
|
|
193
|
+
inputSchema: {
|
|
194
|
+
type: "object",
|
|
195
|
+
properties: {
|
|
196
|
+
executionId: {
|
|
197
|
+
type: "string",
|
|
198
|
+
description: "ID of the test execution",
|
|
199
|
+
},
|
|
200
|
+
includeScreenshots: {
|
|
201
|
+
type: "boolean",
|
|
202
|
+
description: "Include screenshot paths in report (default: true)",
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
required: ["executionId"],
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "run_probe",
|
|
210
|
+
description: "Execute a repository interrogation script (e.g., find, grep, lint) to get ground truth state",
|
|
211
|
+
inputSchema: {
|
|
212
|
+
type: "object",
|
|
213
|
+
properties: {
|
|
214
|
+
name: { type: "string", description: "Name of the probe" },
|
|
215
|
+
command: { type: "string", description: "The shell command to execute" },
|
|
216
|
+
description: { type: "string", description: "What this probe is looking for" },
|
|
217
|
+
},
|
|
218
|
+
required: ["name", "command"],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "query_context",
|
|
223
|
+
description: "Query the design-manifest.json for project anchors, intent, and visual specs",
|
|
224
|
+
inputSchema: {
|
|
225
|
+
type: "object",
|
|
226
|
+
properties: {
|
|
227
|
+
path: { type: "string", description: "The path in the manifest to query (e.g., 'phases.visual_system')" },
|
|
228
|
+
},
|
|
229
|
+
required: ["path"],
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: "record_flow",
|
|
234
|
+
description: "Start interactive recording mode to learn a flow by observing user actions",
|
|
235
|
+
inputSchema: {
|
|
236
|
+
type: "object",
|
|
237
|
+
properties: {
|
|
238
|
+
name: {
|
|
239
|
+
type: "string",
|
|
240
|
+
description: "Name for the recorded flow",
|
|
241
|
+
},
|
|
242
|
+
startUrl: {
|
|
243
|
+
type: "string",
|
|
244
|
+
description: "URL to start recording from",
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
required: ["name", "startUrl"],
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: "watch_tests",
|
|
252
|
+
description: "Start watch mode to automatically re-run tests on file changes",
|
|
253
|
+
inputSchema: {
|
|
254
|
+
type: "object",
|
|
255
|
+
properties: {
|
|
256
|
+
missions: {
|
|
257
|
+
type: "array",
|
|
258
|
+
items: { type: "string" },
|
|
259
|
+
description: "Mission IDs to watch (empty = watch all)",
|
|
260
|
+
},
|
|
261
|
+
watchPaths: {
|
|
262
|
+
type: "array",
|
|
263
|
+
items: { type: "string" },
|
|
264
|
+
description: "Paths to watch for changes (default: src/, app/, components/)",
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
];
|
|
270
|
+
}
|
|
271
|
+
async handleCreateTestMission(args) {
|
|
272
|
+
const { name, mission, expectedOutcome, validationRules = [], startUrl, } = args;
|
|
273
|
+
// Milestone 3: Grounding Pre-hook
|
|
274
|
+
await this.contextService.initialize();
|
|
275
|
+
const manifest = this.contextService.getManifest();
|
|
276
|
+
if (manifest) {
|
|
277
|
+
const grounding = await this.contextService.validateIntent(mission);
|
|
278
|
+
if (!grounding.valid) {
|
|
279
|
+
return {
|
|
280
|
+
content: [
|
|
281
|
+
{
|
|
282
|
+
type: "text",
|
|
283
|
+
text: `⚠️ MISSION REJECTED: Your mission "${mission}" deviates from the Project's Prime Objective: "${manifest.phases.functional_summary.core_purpose}".\n\nREASON: ${grounding.reason}`,
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
isError: true,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const newMission = await this.missionManager.createMission({
|
|
291
|
+
name,
|
|
292
|
+
mission,
|
|
293
|
+
expectedOutcome,
|
|
294
|
+
validationRules,
|
|
295
|
+
startUrl,
|
|
296
|
+
});
|
|
297
|
+
return {
|
|
298
|
+
content: [
|
|
299
|
+
{
|
|
300
|
+
type: "text",
|
|
301
|
+
text: `✅ Test mission created successfully!
|
|
302
|
+
|
|
303
|
+
**Mission ID**: ${newMission.id}
|
|
304
|
+
**Name**: ${newMission.name}
|
|
305
|
+
**Mission**: ${newMission.mission}
|
|
306
|
+
**Expected Outcome**: ${newMission.expectedOutcome}
|
|
307
|
+
${startUrl ? `**Start URL**: ${startUrl}` : ""}
|
|
308
|
+
${validationRules.length > 0 ? `**Validation Rules**: ${validationRules.length}` : ""}
|
|
309
|
+
|
|
310
|
+
You can now run this mission with:
|
|
311
|
+
\`\`\`
|
|
312
|
+
run_test(missionId: "${newMission.id}")
|
|
313
|
+
\`\`\`
|
|
314
|
+
|
|
315
|
+
Or from CLI:
|
|
316
|
+
\`\`\`
|
|
317
|
+
mycontext test:run ${newMission.name}
|
|
318
|
+
\`\`\`
|
|
319
|
+
`,
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
async handleRunTest(args) {
|
|
325
|
+
const { missionId, headless = true, baseUrl, slowMo } = args;
|
|
326
|
+
const mission = await this.missionManager.getMission(missionId);
|
|
327
|
+
if (!mission) {
|
|
328
|
+
throw new Error(`Mission not found: ${missionId}`);
|
|
329
|
+
}
|
|
330
|
+
// Milestone 3: Pre-flight Grounding
|
|
331
|
+
await this.contextService.initialize();
|
|
332
|
+
const manifest = this.contextService.getManifest();
|
|
333
|
+
if (manifest) {
|
|
334
|
+
console.log(chalk_1.default.blue(`🛰️ Pre-flight Grounding: Anchoring mission to "${manifest.project_name}"`));
|
|
335
|
+
}
|
|
336
|
+
// Execute the test
|
|
337
|
+
const result = await this.testRunner.runTest(mission, {
|
|
338
|
+
headless,
|
|
339
|
+
baseUrl,
|
|
340
|
+
slowMo,
|
|
341
|
+
});
|
|
342
|
+
// Save execution result
|
|
343
|
+
await this.missionManager.saveExecution(result);
|
|
344
|
+
// Generate report
|
|
345
|
+
const report = await this.reporter.generateReport(result);
|
|
346
|
+
const statusEmoji = result.status === "passed" ? "✅" : "❌";
|
|
347
|
+
return {
|
|
348
|
+
content: [
|
|
349
|
+
{
|
|
350
|
+
type: "text",
|
|
351
|
+
text: `${statusEmoji} Test execution ${result.status.toUpperCase()}
|
|
352
|
+
|
|
353
|
+
**Mission**: ${mission.name}
|
|
354
|
+
**Execution ID**: ${result.executionId}
|
|
355
|
+
**Duration**: ${result.duration}ms
|
|
356
|
+
**Steps Executed**: ${result.steps.length}
|
|
357
|
+
**Validations**: ${result.validationResults.length} (${result.validationResults.filter((v) => v.passed).length} passed)
|
|
358
|
+
|
|
359
|
+
${result.status === "failed" ? `**Error**: ${result.error?.message}\n` : ""}
|
|
360
|
+
|
|
361
|
+
**Final State**:
|
|
362
|
+
- URL: ${result.finalState.url}
|
|
363
|
+
- Screenshot: ${result.finalState.screenshot || "N/A"}
|
|
364
|
+
|
|
365
|
+
${result.aiNotes ? `**AI Notes**: ${result.aiNotes}\n` : ""}
|
|
366
|
+
|
|
367
|
+
View full report:
|
|
368
|
+
\`\`\`
|
|
369
|
+
get_test_report(executionId: "${result.executionId}")
|
|
370
|
+
\`\`\`
|
|
371
|
+
`,
|
|
372
|
+
},
|
|
373
|
+
],
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
async handleListTestMissions(args) {
|
|
377
|
+
const { status = "all", tag } = args;
|
|
378
|
+
const missions = await this.missionManager.listMissions({ status, tag });
|
|
379
|
+
const output = [
|
|
380
|
+
`# Test Missions (${missions.length})`,
|
|
381
|
+
"",
|
|
382
|
+
...missions.map((m, index) => {
|
|
383
|
+
return `${index + 1}. **${m.name}** (${m.id})
|
|
384
|
+
- Mission: ${m.mission}
|
|
385
|
+
- Expected: ${m.expectedOutcome}
|
|
386
|
+
- Tags: ${m.tags?.join(", ") || "none"}
|
|
387
|
+
- Created: ${new Date(m.createdAt).toLocaleString()}`;
|
|
388
|
+
}),
|
|
389
|
+
];
|
|
390
|
+
return {
|
|
391
|
+
content: [
|
|
392
|
+
{
|
|
393
|
+
type: "text",
|
|
394
|
+
text: output.join("\n"),
|
|
395
|
+
},
|
|
396
|
+
],
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
async handleGetTestReport(args) {
|
|
400
|
+
const { executionId, includeScreenshots = true } = args;
|
|
401
|
+
const report = await this.reporter.getReport(executionId);
|
|
402
|
+
if (!report) {
|
|
403
|
+
throw new Error(`Report not found: ${executionId}`);
|
|
404
|
+
}
|
|
405
|
+
const output = await this.reporter.formatReport(report, {
|
|
406
|
+
includeScreenshots,
|
|
407
|
+
});
|
|
408
|
+
return {
|
|
409
|
+
content: [
|
|
410
|
+
{
|
|
411
|
+
type: "text",
|
|
412
|
+
text: output,
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
async handleRunProbe(args) {
|
|
418
|
+
const { name, command, description = "" } = args;
|
|
419
|
+
const result = await this.probeManager.runProbe({
|
|
420
|
+
name,
|
|
421
|
+
command,
|
|
422
|
+
description,
|
|
423
|
+
category: "custom",
|
|
424
|
+
});
|
|
425
|
+
return {
|
|
426
|
+
content: [
|
|
427
|
+
{
|
|
428
|
+
type: "text",
|
|
429
|
+
text: `🔍 Probe Results: ${name}
|
|
430
|
+
|
|
431
|
+
Status: ${result.success ? "✅ Success" : "❌ Failed"}
|
|
432
|
+
Output:
|
|
433
|
+
\`\`\`
|
|
434
|
+
${result.output || "No output"}
|
|
435
|
+
\`\`\`
|
|
436
|
+
${result.error ? `Error: \n\`\`\`\n${result.error}\n\`\`\`` : ""}
|
|
437
|
+
`,
|
|
438
|
+
},
|
|
439
|
+
],
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
async handleQueryContext(args) {
|
|
443
|
+
const { path: queryPath } = args;
|
|
444
|
+
await this.contextService.initialize();
|
|
445
|
+
const result = await this.contextService.queryContext({ path: queryPath });
|
|
446
|
+
return {
|
|
447
|
+
content: [
|
|
448
|
+
{
|
|
449
|
+
type: "text",
|
|
450
|
+
text: `📖 Manifest Query: ${queryPath}
|
|
451
|
+
|
|
452
|
+
Result:
|
|
453
|
+
\`\`\`json
|
|
454
|
+
${JSON.stringify(result, null, 2)}
|
|
455
|
+
\`\`\`
|
|
456
|
+
`,
|
|
457
|
+
},
|
|
458
|
+
],
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
async handleRecordFlow(args) {
|
|
462
|
+
const { name, startUrl } = args;
|
|
463
|
+
// Start interactive recording
|
|
464
|
+
const session = await this.testRunner.startRecording(name, startUrl);
|
|
465
|
+
return {
|
|
466
|
+
content: [
|
|
467
|
+
{
|
|
468
|
+
type: "text",
|
|
469
|
+
text: `🎥 Recording started for "${name}"
|
|
470
|
+
|
|
471
|
+
**Session ID**: ${session.sessionId}
|
|
472
|
+
**Start URL**: ${startUrl}
|
|
473
|
+
|
|
474
|
+
A browser window will open. Perform your actions, and the AI will observe and learn.
|
|
475
|
+
When done, the recorded flow will be saved as a test mission.
|
|
476
|
+
|
|
477
|
+
Recording in progress...
|
|
478
|
+
`,
|
|
479
|
+
},
|
|
480
|
+
],
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
async handleWatchTests(args) {
|
|
484
|
+
const { missions = [], watchPaths = ["src", "app", "components"] } = args;
|
|
485
|
+
// Start watch mode
|
|
486
|
+
await this.testRunner.startWatchMode(missions, watchPaths);
|
|
487
|
+
return {
|
|
488
|
+
content: [
|
|
489
|
+
{
|
|
490
|
+
type: "text",
|
|
491
|
+
text: `👀 Watch mode started
|
|
492
|
+
|
|
493
|
+
**Watching**: ${missions.length > 0 ? missions.join(", ") : "all missions"}
|
|
494
|
+
**Paths**: ${watchPaths.join(", ")}
|
|
495
|
+
|
|
496
|
+
Tests will automatically re-run when files change.
|
|
497
|
+
Press Ctrl+C to stop.
|
|
498
|
+
`,
|
|
499
|
+
},
|
|
500
|
+
],
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
async start() {
|
|
504
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
505
|
+
await this.server.connect(transport);
|
|
506
|
+
console.error("Flow Testing MCP Server running on stdio");
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
exports.FlowTestingMCPServer = FlowTestingMCPServer;
|
|
510
|
+
// Start server if run directly
|
|
511
|
+
if (require.main === module) {
|
|
512
|
+
const projectPath = process.argv[2] || process.cwd();
|
|
513
|
+
const server = new FlowTestingMCPServer(projectPath);
|
|
514
|
+
server.start().catch(console.error);
|
|
515
|
+
}
|
|
516
|
+
//# sourceMappingURL=testing-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing-server.js","sourceRoot":"","sources":["../../src/mcp/testing-server.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;GAYG;;;;;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAI4C;AAC5C,iEAA4D;AAC5D,+DAA0D;AAC1D,mDAA+C;AAC/C,2DAAwD;AACxD,+DAA4D;AAE5D,kDAA0B;AAE1B,MAAa,oBAAoB;IAS/B,YAAY,WAAoB;QAC9B,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;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E,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC5D,CAAC;CACF;AA5hBD,oDA4hBC;AAED,+BAA+B;AAC/B,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACrD,MAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC,WAAW,CAAC,CAAC;IACrD,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mycontext-cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "CLI tool for spec-driven development - Generate comprehensive context, visual screens, and scaffolding for AI-powered coding",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -52,6 +52,8 @@
|
|
|
52
52
|
"@google-cloud/vertexai": "^1.10.0",
|
|
53
53
|
"@google/generative-ai": "^0.24.1",
|
|
54
54
|
"@huggingface/inference": "^4.11.1",
|
|
55
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
56
|
+
"@playwright/test": "^1.58.2",
|
|
55
57
|
"@types/figlet": "^1.7.0",
|
|
56
58
|
"axios": "^1.6.0",
|
|
57
59
|
"chalk": "^5.3.0",
|
|
@@ -63,12 +65,14 @@
|
|
|
63
65
|
"fs-extra": "^11.1.1",
|
|
64
66
|
"fuse.js": "^7.1.0",
|
|
65
67
|
"glob": "^10.3.10",
|
|
68
|
+
"global": "link:../../../../Library/pnpm/global/5/node_modules/global",
|
|
66
69
|
"gradient-string": "^3.0.0",
|
|
67
70
|
"inquirer": "^9.2.12",
|
|
68
71
|
"mdast-util-to-markdown": "^2.1.2",
|
|
69
72
|
"node-fetch": "^2.7.0",
|
|
70
73
|
"openai": "^6.2.0",
|
|
71
74
|
"ora": "^7.0.1",
|
|
75
|
+
"playwright": "^1.58.2",
|
|
72
76
|
"prompts": "^2.4.2",
|
|
73
77
|
"remark-parse": "^11.0.0",
|
|
74
78
|
"sonner": "^2.0.7",
|
|
@@ -101,4 +105,4 @@
|
|
|
101
105
|
"package.json"
|
|
102
106
|
],
|
|
103
107
|
"packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977"
|
|
104
|
-
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DesignManifest, EnrichedContext } from '../types/design-pipeline';
|
|
2
|
+
export interface ContextQuery {
|
|
3
|
+
path: string;
|
|
4
|
+
filter?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class ContextService {
|
|
7
|
+
private manifestManager;
|
|
8
|
+
private aiClient;
|
|
9
|
+
private projectPath;
|
|
10
|
+
private manifest;
|
|
11
|
+
constructor(projectPath: string);
|
|
12
|
+
/**
|
|
13
|
+
* Initialize and load the manifest
|
|
14
|
+
*/
|
|
15
|
+
initialize(): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Get the full manifest
|
|
18
|
+
*/
|
|
19
|
+
getManifest(): DesignManifest | null;
|
|
20
|
+
/**
|
|
21
|
+
* Query specific data from the manifest
|
|
22
|
+
*/
|
|
23
|
+
queryContext(query: ContextQuery): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Get a consolidated enrichment context for the AI
|
|
26
|
+
*/
|
|
27
|
+
getEnrichedContext(): Promise<EnrichedContext | null>;
|
|
28
|
+
/**
|
|
29
|
+
* Validate an intent against the Prime Objective
|
|
30
|
+
* (Milestone 2: Hard Gravity)
|
|
31
|
+
*/
|
|
32
|
+
validateIntent(intent: string): Promise<{
|
|
33
|
+
valid: boolean;
|
|
34
|
+
reason?: string;
|
|
35
|
+
narrativeWeight: number;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=ContextService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextService.d.ts","sourceRoot":"","sources":["../../src/services/ContextService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAA+B;gBAEnC,WAAW,EAAE,MAAM;IAM/B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC;;OAEG;IACH,WAAW,IAAI,cAAc,GAAG,IAAI;IAIpC;;OAEG;IACG,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAwBrD;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAI3D;;;OAGG;IACG,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAC5C,KAAK,EAAE,OAAO,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CAiDH"}
|