mycontext-cli 4.0.0 → 4.1.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/README.md +21 -149
- package/dist/agents/implementations/DesignPipelineAgent.d.ts +1 -1
- package/dist/agents/implementations/DesignPipelineAgent.d.ts.map +1 -1
- 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 +33 -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/IntentEnricher.d.ts +1 -1
- package/dist/services/IntentEnricher.d.ts.map +1 -1
- 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/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/contextEnricher.d.ts +1 -1
- package/dist/utils/contextEnricher.d.ts.map +1 -1
- package/dist/utils/contextEnricher.js +2 -2
- package/dist/utils/contextEnricher.js.map +1 -1
- package/dist/utils/designFallbacks.d.ts +1 -1
- package/dist/utils/designFallbacks.d.ts.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/dist/utils/unifiedDesignContextLoader.d.ts +1 -1
- package/dist/utils/unifiedDesignContextLoader.d.ts.map +1 -1
- package/dist/utils/unifiedDesignContextLoader.js +2 -2
- package/dist/utils/unifiedDesignContextLoader.js.map +1 -1
- package/package.json +6 -2
- package/dist/types/design-pipeline.d.ts +0 -300
- package/dist/types/design-pipeline.d.ts.map +0 -1
- package/dist/types/design-pipeline.js +0 -9
- package/dist/types/design-pipeline.js.map +0 -1
- package/dist/utils/designManifestManager.d.ts +0 -89
- package/dist/utils/designManifestManager.d.ts.map +0 -1
- package/dist/utils/designManifestManager.js +0 -533
- package/dist/utils/designManifestManager.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"design-pipeline.d.ts","sourceRoot":"","sources":["../../src/types/design-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,gBAAgB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAMD,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,kBAAkB,GAAG,SAAS,GAAG,UAAU,CAAC;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;CAC1D;AAMD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAA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C/B,0BAA0B,EAAE,MAAM,EAAE,CAAC;IAGrC,gBAAgB,CAAC,EAAE,OAAO,qBAAqB,EAAE,qBAAqB,EAAE,CAAC;IACzE,wBAAwB,CAAC,EAAE,OAAO,qBAAqB,EAAE,sBAAsB,CAAC;IAChF,qBAAqB,CAAC,EAAE,OAAO,qBAAqB,EAAE,qBAAqB,EAAE,CAAC;CAC/E;AAMD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,gBAAgB,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACzC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Design Pipeline Types
|
|
4
|
-
*
|
|
5
|
-
* Defines interfaces for all 8 phases of the design reasoning pipeline
|
|
6
|
-
* that replicates an internal design process for rich, contextual component generation.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
//# sourceMappingURL=design-pipeline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"design-pipeline.js","sourceRoot":"","sources":["../../src/types/design-pipeline.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { DesignManifest, EnrichedContext, ValidationResult } from "../types/design-pipeline";
|
|
2
|
-
/**
|
|
3
|
-
* Design Manifest Manager
|
|
4
|
-
*
|
|
5
|
-
* Handles storage, loading, validation, and context enrichment
|
|
6
|
-
* for the mycontext design pipeline manifest.
|
|
7
|
-
*/
|
|
8
|
-
export declare class DesignManifestManager {
|
|
9
|
-
private manifestPath;
|
|
10
|
-
private projectPath;
|
|
11
|
-
constructor(projectPath?: string);
|
|
12
|
-
/**
|
|
13
|
-
* Save design manifest to .mycontext/design-manifest.json
|
|
14
|
-
*/
|
|
15
|
-
saveDesignManifest(manifest: DesignManifest): Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Load design manifest from .mycontext/design-manifest.json
|
|
18
|
-
*/
|
|
19
|
-
loadDesignManifest(): Promise<DesignManifest | null>;
|
|
20
|
-
/**
|
|
21
|
-
* Check if design manifest exists and is valid
|
|
22
|
-
*/
|
|
23
|
-
hasValidManifest(): Promise<boolean>;
|
|
24
|
-
/**
|
|
25
|
-
* Validate design manifest structure and completeness
|
|
26
|
-
*/
|
|
27
|
-
validateManifest(manifest: any): ValidationResult;
|
|
28
|
-
/**
|
|
29
|
-
* Validate individual phases
|
|
30
|
-
*/
|
|
31
|
-
private validatePhases;
|
|
32
|
-
/**
|
|
33
|
-
* Validate a single phase
|
|
34
|
-
*/
|
|
35
|
-
private validatePhase;
|
|
36
|
-
/**
|
|
37
|
-
* Calculate overall confidence score for the manifest
|
|
38
|
-
*/
|
|
39
|
-
private calculateOverallConfidence;
|
|
40
|
-
/**
|
|
41
|
-
* Calculate confidence score for a single phase
|
|
42
|
-
*/
|
|
43
|
-
private calculatePhaseConfidence;
|
|
44
|
-
/**
|
|
45
|
-
* Generate suggestions for improving a phase
|
|
46
|
-
*/
|
|
47
|
-
private generatePhaseSuggestions;
|
|
48
|
-
/**
|
|
49
|
-
* Extract quality indicators for a phase
|
|
50
|
-
*/
|
|
51
|
-
private extractQualityIndicators;
|
|
52
|
-
/**
|
|
53
|
-
* Calculate color completeness score
|
|
54
|
-
*/
|
|
55
|
-
private calculateColorCompleteness;
|
|
56
|
-
/**
|
|
57
|
-
* Calculate typography completeness score
|
|
58
|
-
*/
|
|
59
|
-
private calculateTypographyCompleteness;
|
|
60
|
-
/**
|
|
61
|
-
* Enrich context with design manifest data
|
|
62
|
-
*/
|
|
63
|
-
enrichContextWithDesign(prd: string, types?: string, brand?: string): Promise<EnrichedContext>;
|
|
64
|
-
/**
|
|
65
|
-
* Extract visual tokens for easy consumption
|
|
66
|
-
*/
|
|
67
|
-
private extractVisualTokens;
|
|
68
|
-
/**
|
|
69
|
-
* Get design manifest summary for display
|
|
70
|
-
*/
|
|
71
|
-
getManifestSummary(): Promise<string>;
|
|
72
|
-
/**
|
|
73
|
-
* Check if manifest needs regeneration based on age or changes
|
|
74
|
-
*/
|
|
75
|
-
shouldRegenerateManifest(maxAgeHours?: number): Promise<boolean>;
|
|
76
|
-
/**
|
|
77
|
-
* Get manifest file path
|
|
78
|
-
*/
|
|
79
|
-
getManifestPath(): string;
|
|
80
|
-
/**
|
|
81
|
-
* Check if manifest file exists
|
|
82
|
-
*/
|
|
83
|
-
manifestExists(): Promise<boolean>;
|
|
84
|
-
/**
|
|
85
|
-
* Delete manifest file
|
|
86
|
-
*/
|
|
87
|
-
deleteManifest(): Promise<void>;
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=designManifestManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"designManifestManager.d.ts","sourceRoot":"","sources":["../../src/utils/designManifestManager.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAEjB,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,WAAW,CAAS;gBAEhB,WAAW,GAAE,MAAsB;IAS/C;;OAEG;IACG,kBAAkB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBjE;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAc1D;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IAK1C;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,gBAAgB;IAmDjD;;OAEG;IACH,OAAO,CAAC,cAAc;IA8FtB;;OAEG;IACH,OAAO,CAAC,aAAa;IAwFrB;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAkBlC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAehC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAmDhC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAsChC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAgClC;;OAEG;IACH,OAAO,CAAC,+BAA+B;IAYvC;;OAEG;IACG,uBAAuB,CAC3B,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,MAAW,EAClB,KAAK,GAAE,MAAW,GACjB,OAAO,CAAC,eAAe,CAAC;IAmC3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAuB3C;;OAEG;IACG,wBAAwB,CAAC,WAAW,GAAE,MAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAW1E;;OAEG;IACH,eAAe,IAAI,MAAM;IAIzB;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxC;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAWtC"}
|
|
@@ -1,533 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.DesignManifestManager = void 0;
|
|
40
|
-
const fs = __importStar(require("fs-extra"));
|
|
41
|
-
const path = __importStar(require("path"));
|
|
42
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
43
|
-
/**
|
|
44
|
-
* Design Manifest Manager
|
|
45
|
-
*
|
|
46
|
-
* Handles storage, loading, validation, and context enrichment
|
|
47
|
-
* for the mycontext design pipeline manifest.
|
|
48
|
-
*/
|
|
49
|
-
class DesignManifestManager {
|
|
50
|
-
constructor(projectPath = process.cwd()) {
|
|
51
|
-
this.projectPath = projectPath;
|
|
52
|
-
this.manifestPath = path.join(projectPath, ".mycontext", "design-manifest.json");
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Save design manifest to .mycontext/design-manifest.json
|
|
56
|
-
*/
|
|
57
|
-
async saveDesignManifest(manifest) {
|
|
58
|
-
try {
|
|
59
|
-
// Ensure .mycontext directory exists
|
|
60
|
-
const contextDir = path.dirname(this.manifestPath);
|
|
61
|
-
await fs.ensureDir(contextDir);
|
|
62
|
-
// Write manifest with pretty formatting
|
|
63
|
-
await fs.writeJSON(this.manifestPath, manifest, { spaces: 2 });
|
|
64
|
-
console.log(chalk_1.default.green("✅ Design manifest saved to .mycontext/design-manifest.json"));
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
console.error(chalk_1.default.red("❌ Failed to save design manifest:"), error);
|
|
68
|
-
throw error;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Load design manifest from .mycontext/design-manifest.json
|
|
73
|
-
*/
|
|
74
|
-
async loadDesignManifest() {
|
|
75
|
-
try {
|
|
76
|
-
if (!(await fs.pathExists(this.manifestPath))) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
const manifestData = await fs.readJSON(this.manifestPath);
|
|
80
|
-
return this.validateManifest(manifestData).valid ? manifestData : null;
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
console.warn(chalk_1.default.yellow("⚠️ Failed to load design manifest:"), error);
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Check if design manifest exists and is valid
|
|
89
|
-
*/
|
|
90
|
-
async hasValidManifest() {
|
|
91
|
-
const manifest = await this.loadDesignManifest();
|
|
92
|
-
return manifest !== null;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Validate design manifest structure and completeness
|
|
96
|
-
*/
|
|
97
|
-
validateManifest(manifest) {
|
|
98
|
-
const errors = [];
|
|
99
|
-
const warnings = [];
|
|
100
|
-
const suggestions = [];
|
|
101
|
-
// Check required top-level fields
|
|
102
|
-
if (!manifest.version)
|
|
103
|
-
errors.push("Missing version field");
|
|
104
|
-
if (!manifest.generated_at)
|
|
105
|
-
errors.push("Missing generated_at field");
|
|
106
|
-
if (!manifest.project_name)
|
|
107
|
-
errors.push("Missing project_name field");
|
|
108
|
-
if (!manifest.phases)
|
|
109
|
-
errors.push("Missing phases object");
|
|
110
|
-
if (manifest.phases) {
|
|
111
|
-
// Validate each phase
|
|
112
|
-
const phaseValidations = this.validatePhases(manifest.phases);
|
|
113
|
-
phaseValidations.forEach((validation) => {
|
|
114
|
-
if (!validation.result.valid) {
|
|
115
|
-
errors.push(...validation.result.errors.map((e) => `${validation.phase_name}: ${e}`));
|
|
116
|
-
}
|
|
117
|
-
warnings.push(...validation.result.warnings.map((w) => `${validation.phase_name}: ${w}`));
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
// Check metadata
|
|
121
|
-
if (!manifest.metadata) {
|
|
122
|
-
warnings.push("Missing metadata object");
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
if (!manifest.metadata.generation_time_ms) {
|
|
126
|
-
warnings.push("Missing generation_time_ms in metadata");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
// Calculate confidence score
|
|
130
|
-
const confidenceScore = this.calculateOverallConfidence(manifest);
|
|
131
|
-
return {
|
|
132
|
-
valid: errors.length === 0,
|
|
133
|
-
errors,
|
|
134
|
-
warnings,
|
|
135
|
-
suggestions,
|
|
136
|
-
confidence_score: confidenceScore,
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Validate individual phases
|
|
141
|
-
*/
|
|
142
|
-
validatePhases(phases) {
|
|
143
|
-
const validations = [];
|
|
144
|
-
// Phase 1: Functional Summary
|
|
145
|
-
validations.push(this.validatePhase("functional_summary", phases.functional_summary, [
|
|
146
|
-
"app_name",
|
|
147
|
-
"core_purpose",
|
|
148
|
-
"key_features",
|
|
149
|
-
"primary_user_actions",
|
|
150
|
-
"platform",
|
|
151
|
-
"technical_requirements",
|
|
152
|
-
"complexity_level",
|
|
153
|
-
]));
|
|
154
|
-
// Phase 2: Project Scope
|
|
155
|
-
validations.push(this.validatePhase("project_scope", phases.project_scope, [
|
|
156
|
-
"build_scope",
|
|
157
|
-
"reason",
|
|
158
|
-
"expected_outputs",
|
|
159
|
-
]));
|
|
160
|
-
// Phase 3: Context Gaps
|
|
161
|
-
validations.push(this.validatePhase("context_gaps", phases.context_gaps, [
|
|
162
|
-
"missing",
|
|
163
|
-
"recommended_next_action",
|
|
164
|
-
]));
|
|
165
|
-
// Phase 4: Design Brief
|
|
166
|
-
validations.push(this.validatePhase("design_brief", phases.design_brief, [
|
|
167
|
-
"theme",
|
|
168
|
-
"inspiration_sources",
|
|
169
|
-
"blended_style",
|
|
170
|
-
"primary_color",
|
|
171
|
-
"support_colors",
|
|
172
|
-
"typography",
|
|
173
|
-
"ui_principles",
|
|
174
|
-
"motion_style",
|
|
175
|
-
]));
|
|
176
|
-
// Phase 5: Visual System
|
|
177
|
-
validations.push(this.validatePhase("visual_system", phases.visual_system, [
|
|
178
|
-
"colors",
|
|
179
|
-
"typography",
|
|
180
|
-
"spacing",
|
|
181
|
-
"radii",
|
|
182
|
-
"shadows",
|
|
183
|
-
"motion",
|
|
184
|
-
"breakpoints",
|
|
185
|
-
]));
|
|
186
|
-
// Phase 6: Component Hierarchy
|
|
187
|
-
validations.push(this.validatePhase("component_hierarchy", phases.component_hierarchy, [
|
|
188
|
-
"screens",
|
|
189
|
-
"components",
|
|
190
|
-
"design_patterns",
|
|
191
|
-
"interaction_flows",
|
|
192
|
-
]));
|
|
193
|
-
// Phase 7: Implementation Plan
|
|
194
|
-
validations.push(this.validatePhase("implementation_plan", phases.implementation_plan, [
|
|
195
|
-
"framework",
|
|
196
|
-
"pages",
|
|
197
|
-
"state_management",
|
|
198
|
-
"build_requirements",
|
|
199
|
-
"data_persistence",
|
|
200
|
-
"performance_optimizations",
|
|
201
|
-
]));
|
|
202
|
-
// Phase 8: Design Intent
|
|
203
|
-
validations.push(this.validatePhase("design_intent", phases.design_intent, [
|
|
204
|
-
"visual_philosophy",
|
|
205
|
-
"design_anchors",
|
|
206
|
-
"user_experience_goals",
|
|
207
|
-
]));
|
|
208
|
-
return validations;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Validate a single phase
|
|
212
|
-
*/
|
|
213
|
-
validatePhase(phaseName, phaseData, requiredFields) {
|
|
214
|
-
const errors = [];
|
|
215
|
-
const warnings = [];
|
|
216
|
-
const missingFields = [];
|
|
217
|
-
if (!phaseData) {
|
|
218
|
-
errors.push("Phase data is missing");
|
|
219
|
-
return {
|
|
220
|
-
phase_name: phaseName,
|
|
221
|
-
result: {
|
|
222
|
-
valid: false,
|
|
223
|
-
errors,
|
|
224
|
-
warnings,
|
|
225
|
-
suggestions: [],
|
|
226
|
-
confidence_score: 0,
|
|
227
|
-
},
|
|
228
|
-
required_fields: requiredFields,
|
|
229
|
-
missing_fields: requiredFields,
|
|
230
|
-
quality_indicators: {},
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
// Check required fields
|
|
234
|
-
requiredFields.forEach((field) => {
|
|
235
|
-
if (!phaseData[field]) {
|
|
236
|
-
missingFields.push(field);
|
|
237
|
-
errors.push(`Missing required field: ${field}`);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
// Phase-specific validations
|
|
241
|
-
if (phaseName === "functional_summary") {
|
|
242
|
-
if (phaseData.complexity_level &&
|
|
243
|
-
!["low", "medium", "high"].includes(phaseData.complexity_level)) {
|
|
244
|
-
errors.push("Invalid complexity_level value");
|
|
245
|
-
}
|
|
246
|
-
if (phaseData.key_features && !Array.isArray(phaseData.key_features)) {
|
|
247
|
-
errors.push("key_features must be an array");
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
if (phaseName === "design_brief") {
|
|
251
|
-
if (phaseData.theme &&
|
|
252
|
-
!["dark", "light", "mixed"].includes(phaseData.theme)) {
|
|
253
|
-
errors.push("Invalid theme value");
|
|
254
|
-
}
|
|
255
|
-
if (phaseData.primary_color && !phaseData.primary_color.startsWith("#")) {
|
|
256
|
-
warnings.push("Primary color should be a hex value");
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
if (phaseName === "visual_system") {
|
|
260
|
-
if (phaseData.colors && !phaseData.colors.primary) {
|
|
261
|
-
errors.push("Missing primary color in visual system");
|
|
262
|
-
}
|
|
263
|
-
if (phaseData.typography && !phaseData.typography.font_families) {
|
|
264
|
-
errors.push("Missing font families in typography");
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
const confidenceScore = this.calculatePhaseConfidence(phaseData, requiredFields.length - missingFields.length);
|
|
268
|
-
return {
|
|
269
|
-
phase_name: phaseName,
|
|
270
|
-
result: {
|
|
271
|
-
valid: errors.length === 0,
|
|
272
|
-
errors,
|
|
273
|
-
warnings,
|
|
274
|
-
suggestions: this.generatePhaseSuggestions(phaseName, phaseData),
|
|
275
|
-
confidence_score: confidenceScore,
|
|
276
|
-
},
|
|
277
|
-
required_fields: requiredFields,
|
|
278
|
-
missing_fields: missingFields,
|
|
279
|
-
quality_indicators: this.extractQualityIndicators(phaseName, phaseData),
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Calculate overall confidence score for the manifest
|
|
284
|
-
*/
|
|
285
|
-
calculateOverallConfidence(manifest) {
|
|
286
|
-
if (!manifest.phases)
|
|
287
|
-
return 0;
|
|
288
|
-
const phaseScores = Object.values(manifest.phases).map((phase) => this.calculatePhaseConfidence(phase, Object.keys(phase).length));
|
|
289
|
-
const averageScore = phaseScores.reduce((sum, score) => sum + score, 0) / phaseScores.length;
|
|
290
|
-
// Boost score if metadata indicates AI generation
|
|
291
|
-
if (manifest.metadata?.ai_model_used) {
|
|
292
|
-
return Math.min(1, averageScore + 0.1);
|
|
293
|
-
}
|
|
294
|
-
return averageScore;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Calculate confidence score for a single phase
|
|
298
|
-
*/
|
|
299
|
-
calculatePhaseConfidence(phaseData, fieldCount) {
|
|
300
|
-
if (!phaseData)
|
|
301
|
-
return 0;
|
|
302
|
-
const totalFields = Object.keys(phaseData).length;
|
|
303
|
-
const completeness = fieldCount / Math.max(totalFields, 1);
|
|
304
|
-
// Additional quality checks
|
|
305
|
-
let qualityBonus = 0;
|
|
306
|
-
if (phaseData.colors?.primary)
|
|
307
|
-
qualityBonus += 0.1;
|
|
308
|
-
if (phaseData.typography?.font_families)
|
|
309
|
-
qualityBonus += 0.1;
|
|
310
|
-
if (phaseData.design_anchors?.length > 0)
|
|
311
|
-
qualityBonus += 0.1;
|
|
312
|
-
return Math.min(1, completeness + qualityBonus);
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Generate suggestions for improving a phase
|
|
316
|
-
*/
|
|
317
|
-
generatePhaseSuggestions(phaseName, phaseData) {
|
|
318
|
-
const suggestions = [];
|
|
319
|
-
switch (phaseName) {
|
|
320
|
-
case "functional_summary":
|
|
321
|
-
if (!phaseData.user_personas) {
|
|
322
|
-
suggestions.push("Add user personas to better understand target audience");
|
|
323
|
-
}
|
|
324
|
-
if (!phaseData.business_goals) {
|
|
325
|
-
suggestions.push("Define business goals for better alignment");
|
|
326
|
-
}
|
|
327
|
-
break;
|
|
328
|
-
case "design_brief":
|
|
329
|
-
if (!phaseData.accessibility_focus) {
|
|
330
|
-
suggestions.push("Add accessibility focus areas");
|
|
331
|
-
}
|
|
332
|
-
if (phaseData.inspiration_sources?.length < 3) {
|
|
333
|
-
suggestions.push("Add more inspiration sources for richer design direction");
|
|
334
|
-
}
|
|
335
|
-
break;
|
|
336
|
-
case "visual_system":
|
|
337
|
-
if (!phaseData.colors?.success) {
|
|
338
|
-
suggestions.push("Add semantic colors (success, warning, error)");
|
|
339
|
-
}
|
|
340
|
-
if (!phaseData.motion?.duration) {
|
|
341
|
-
suggestions.push("Define motion timing for better consistency");
|
|
342
|
-
}
|
|
343
|
-
break;
|
|
344
|
-
case "component_hierarchy":
|
|
345
|
-
if (phaseData.components?.length === 0) {
|
|
346
|
-
suggestions.push("Define specific components needed for the project");
|
|
347
|
-
}
|
|
348
|
-
if (!phaseData.design_patterns?.length) {
|
|
349
|
-
suggestions.push("Identify design patterns to maintain consistency");
|
|
350
|
-
}
|
|
351
|
-
break;
|
|
352
|
-
}
|
|
353
|
-
return suggestions;
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Extract quality indicators for a phase
|
|
357
|
-
*/
|
|
358
|
-
extractQualityIndicators(phaseName, phaseData) {
|
|
359
|
-
const indicators = {};
|
|
360
|
-
switch (phaseName) {
|
|
361
|
-
case "functional_summary":
|
|
362
|
-
indicators.feature_count = phaseData.key_features?.length || 0;
|
|
363
|
-
indicators.has_personas = !!phaseData.user_personas?.length;
|
|
364
|
-
indicators.has_goals = !!phaseData.business_goals?.length;
|
|
365
|
-
break;
|
|
366
|
-
case "design_brief":
|
|
367
|
-
indicators.inspiration_count =
|
|
368
|
-
phaseData.inspiration_sources?.length || 0;
|
|
369
|
-
indicators.has_accessibility = !!phaseData.accessibility_focus?.length;
|
|
370
|
-
indicators.color_count = phaseData.support_colors?.length || 0;
|
|
371
|
-
break;
|
|
372
|
-
case "visual_system":
|
|
373
|
-
indicators.color_completeness = this.calculateColorCompleteness(phaseData.colors);
|
|
374
|
-
indicators.typography_completeness =
|
|
375
|
-
this.calculateTypographyCompleteness(phaseData.typography);
|
|
376
|
-
break;
|
|
377
|
-
case "component_hierarchy":
|
|
378
|
-
indicators.screen_count = phaseData.screens?.length || 0;
|
|
379
|
-
indicators.component_count = phaseData.components?.length || 0;
|
|
380
|
-
indicators.pattern_count = phaseData.design_patterns?.length || 0;
|
|
381
|
-
break;
|
|
382
|
-
}
|
|
383
|
-
return indicators;
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Calculate color completeness score
|
|
387
|
-
*/
|
|
388
|
-
calculateColorCompleteness(colors) {
|
|
389
|
-
if (!colors)
|
|
390
|
-
return 0;
|
|
391
|
-
const requiredColors = [
|
|
392
|
-
"primary",
|
|
393
|
-
"background",
|
|
394
|
-
"surface",
|
|
395
|
-
"text",
|
|
396
|
-
"text_muted",
|
|
397
|
-
];
|
|
398
|
-
const optionalColors = [
|
|
399
|
-
"secondary",
|
|
400
|
-
"accent",
|
|
401
|
-
"border",
|
|
402
|
-
"success",
|
|
403
|
-
"warning",
|
|
404
|
-
"error",
|
|
405
|
-
];
|
|
406
|
-
const requiredCount = requiredColors.filter((color) => colors[color]).length;
|
|
407
|
-
const optionalCount = optionalColors.filter((color) => colors[color]).length;
|
|
408
|
-
return (requiredCount / requiredColors.length +
|
|
409
|
-
(optionalCount / optionalColors.length) * 0.3);
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Calculate typography completeness score
|
|
413
|
-
*/
|
|
414
|
-
calculateTypographyCompleteness(typography) {
|
|
415
|
-
if (!typography)
|
|
416
|
-
return 0;
|
|
417
|
-
let score = 0;
|
|
418
|
-
if (typography.font_families?.heading)
|
|
419
|
-
score += 0.3;
|
|
420
|
-
if (typography.font_families?.body)
|
|
421
|
-
score += 0.3;
|
|
422
|
-
if (typography.scale)
|
|
423
|
-
score += 0.2;
|
|
424
|
-
if (typography.weights)
|
|
425
|
-
score += 0.2;
|
|
426
|
-
return Math.min(1, score);
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* Enrich context with design manifest data
|
|
430
|
-
*/
|
|
431
|
-
async enrichContextWithDesign(prd, types = "", brand = "") {
|
|
432
|
-
const manifest = await this.loadDesignManifest();
|
|
433
|
-
if (!manifest) {
|
|
434
|
-
throw new Error("No design manifest found. Run design pipeline first.");
|
|
435
|
-
}
|
|
436
|
-
return {
|
|
437
|
-
project_summary: manifest.phases.functional_summary,
|
|
438
|
-
design_system: manifest.phases.visual_system,
|
|
439
|
-
design_intent: manifest.phases.design_intent,
|
|
440
|
-
component_architecture: manifest.phases.component_hierarchy,
|
|
441
|
-
technical_context: {
|
|
442
|
-
prd,
|
|
443
|
-
types,
|
|
444
|
-
brand,
|
|
445
|
-
},
|
|
446
|
-
implementation_guidelines: manifest.phases.implementation_plan,
|
|
447
|
-
design_principles: manifest.phases.design_brief.ui_principles,
|
|
448
|
-
visual_tokens: this.extractVisualTokens(manifest.phases.visual_system),
|
|
449
|
-
interaction_patterns: manifest.phases.component_hierarchy.interaction_flows,
|
|
450
|
-
accessibility_requirements: manifest.phases.design_brief.accessibility_focus || [],
|
|
451
|
-
// NEW: Intent-based specifications
|
|
452
|
-
enriched_intents: manifest.phases.intent_validation?.enriched_intents || [],
|
|
453
|
-
intent_validation_report: manifest.phases.intent_validation?.validation_report || undefined,
|
|
454
|
-
intent_clarifications: manifest.phases.intent_validation?.clarifications || [],
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Extract visual tokens for easy consumption
|
|
459
|
-
*/
|
|
460
|
-
extractVisualTokens(visualSystem) {
|
|
461
|
-
return {
|
|
462
|
-
colors: visualSystem.colors,
|
|
463
|
-
spacing: visualSystem.spacing,
|
|
464
|
-
typography: visualSystem.typography,
|
|
465
|
-
radii: visualSystem.radii,
|
|
466
|
-
shadows: visualSystem.shadows,
|
|
467
|
-
motion: visualSystem.motion,
|
|
468
|
-
breakpoints: visualSystem.breakpoints,
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Get design manifest summary for display
|
|
473
|
-
*/
|
|
474
|
-
async getManifestSummary() {
|
|
475
|
-
const manifest = await this.loadDesignManifest();
|
|
476
|
-
if (!manifest) {
|
|
477
|
-
return "No design manifest found";
|
|
478
|
-
}
|
|
479
|
-
const { phases } = manifest;
|
|
480
|
-
const summary = [
|
|
481
|
-
`🎨 Design Manifest: ${manifest.project_name}`,
|
|
482
|
-
`📱 Platform: ${phases.functional_summary.platform}`,
|
|
483
|
-
`🎯 Scope: ${phases.project_scope.build_scope}`,
|
|
484
|
-
`🎨 Theme: ${phases.design_brief.theme}`,
|
|
485
|
-
`🎨 Primary Color: ${phases.design_brief.primary_color}`,
|
|
486
|
-
`📐 Components: ${phases.component_hierarchy.components.length}`,
|
|
487
|
-
`📱 Screens: ${phases.component_hierarchy.screens.length}`,
|
|
488
|
-
`⚡ Framework: ${phases.implementation_plan.framework}`,
|
|
489
|
-
`🎯 Design Anchors: ${phases.design_intent.design_anchors.join(", ")}`,
|
|
490
|
-
];
|
|
491
|
-
return summary.join("\n");
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* Check if manifest needs regeneration based on age or changes
|
|
495
|
-
*/
|
|
496
|
-
async shouldRegenerateManifest(maxAgeHours = 24) {
|
|
497
|
-
const manifest = await this.loadDesignManifest();
|
|
498
|
-
if (!manifest)
|
|
499
|
-
return true;
|
|
500
|
-
const generatedAt = new Date(manifest.generated_at);
|
|
501
|
-
const ageHours = (Date.now() - generatedAt.getTime()) / (1000 * 60 * 60);
|
|
502
|
-
return ageHours > maxAgeHours;
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* Get manifest file path
|
|
506
|
-
*/
|
|
507
|
-
getManifestPath() {
|
|
508
|
-
return this.manifestPath;
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* Check if manifest file exists
|
|
512
|
-
*/
|
|
513
|
-
async manifestExists() {
|
|
514
|
-
return await fs.pathExists(this.manifestPath);
|
|
515
|
-
}
|
|
516
|
-
/**
|
|
517
|
-
* Delete manifest file
|
|
518
|
-
*/
|
|
519
|
-
async deleteManifest() {
|
|
520
|
-
try {
|
|
521
|
-
if (await fs.pathExists(this.manifestPath)) {
|
|
522
|
-
await fs.remove(this.manifestPath);
|
|
523
|
-
console.log(chalk_1.default.yellow("🗑️ Design manifest deleted"));
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
catch (error) {
|
|
527
|
-
console.error(chalk_1.default.red("❌ Failed to delete design manifest:"), error);
|
|
528
|
-
throw error;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
exports.DesignManifestManager = DesignManifestManager;
|
|
533
|
-
//# sourceMappingURL=designManifestManager.js.map
|