@houtini/lm 1.0.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/CHANGELOG.md +273 -0
- package/LICENSE +21 -0
- package/README.md +203 -0
- package/dist/cache/analysis-cache.d.ts +33 -0
- package/dist/cache/analysis-cache.d.ts.map +1 -0
- package/dist/cache/analysis-cache.js +56 -0
- package/dist/cache/analysis-cache.js.map +1 -0
- package/dist/cache/cache-manager.d.ts +29 -0
- package/dist/cache/cache-manager.d.ts.map +1 -0
- package/dist/cache/cache-manager.js +85 -0
- package/dist/cache/cache-manager.js.map +1 -0
- package/dist/cache/index.d.ts +16 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +17 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/prompt-cache.d.ts +33 -0
- package/dist/cache/prompt-cache.d.ts.map +1 -0
- package/dist/cache/prompt-cache.js +61 -0
- package/dist/cache/prompt-cache.js.map +1 -0
- package/dist/config.d.ts +43 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +70 -0
- package/dist/config.js.map +1 -0
- package/dist/core/ThreeStagePromptManager.d.ts +39 -0
- package/dist/core/ThreeStagePromptManager.d.ts.map +1 -0
- package/dist/core/ThreeStagePromptManager.js +176 -0
- package/dist/core/ThreeStagePromptManager.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +230 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/base-plugin.d.ts +47 -0
- package/dist/plugins/base-plugin.d.ts.map +1 -0
- package/dist/plugins/base-plugin.js +90 -0
- package/dist/plugins/base-plugin.js.map +1 -0
- package/dist/plugins/index.d.ts +58 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +161 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/types.d.ts +5 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +5 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/prompts/analyze/code-quality.d.ts +116 -0
- package/dist/prompts/analyze/code-quality.d.ts.map +1 -0
- package/dist/prompts/analyze/code-quality.js +433 -0
- package/dist/prompts/analyze/code-quality.js.map +1 -0
- package/dist/prompts/analyze/compare-integration.d.ts +130 -0
- package/dist/prompts/analyze/compare-integration.d.ts.map +1 -0
- package/dist/prompts/analyze/compare-integration.js +543 -0
- package/dist/prompts/analyze/compare-integration.js.map +1 -0
- package/dist/prompts/analyze/count-files.d.ts +109 -0
- package/dist/prompts/analyze/count-files.d.ts.map +1 -0
- package/dist/prompts/analyze/count-files.js +399 -0
- package/dist/prompts/analyze/count-files.js.map +1 -0
- package/dist/prompts/analyze/database-queries.d.ts +156 -0
- package/dist/prompts/analyze/database-queries.d.ts.map +1 -0
- package/dist/prompts/analyze/database-queries.js +759 -0
- package/dist/prompts/analyze/database-queries.js.map +1 -0
- package/dist/prompts/analyze/dependencies.d.ts +97 -0
- package/dist/prompts/analyze/dependencies.d.ts.map +1 -0
- package/dist/prompts/analyze/dependencies.js +333 -0
- package/dist/prompts/analyze/dependencies.js.map +1 -0
- package/dist/prompts/analyze/diff-signatures.d.ts +139 -0
- package/dist/prompts/analyze/diff-signatures.d.ts.map +1 -0
- package/dist/prompts/analyze/diff-signatures.js +702 -0
- package/dist/prompts/analyze/diff-signatures.js.map +1 -0
- package/dist/prompts/analyze/find-patterns.d.ts +128 -0
- package/dist/prompts/analyze/find-patterns.d.ts.map +1 -0
- package/dist/prompts/analyze/find-patterns.js +520 -0
- package/dist/prompts/analyze/find-patterns.js.map +1 -0
- package/dist/prompts/analyze/find-unused-css.d.ts +151 -0
- package/dist/prompts/analyze/find-unused-css.d.ts.map +1 -0
- package/dist/prompts/analyze/find-unused-css.js +754 -0
- package/dist/prompts/analyze/find-unused-css.js.map +1 -0
- package/dist/prompts/analyze/n8n-workflow.d.ts +137 -0
- package/dist/prompts/analyze/n8n-workflow.d.ts.map +1 -0
- package/dist/prompts/analyze/n8n-workflow.js +529 -0
- package/dist/prompts/analyze/n8n-workflow.js.map +1 -0
- package/dist/prompts/analyze/project-structure.d.ts +126 -0
- package/dist/prompts/analyze/project-structure.d.ts.map +1 -0
- package/dist/prompts/analyze/project-structure.js +569 -0
- package/dist/prompts/analyze/project-structure.js.map +1 -0
- package/dist/prompts/analyze/security-audit.d.ts +142 -0
- package/dist/prompts/analyze/security-audit.d.ts.map +1 -0
- package/dist/prompts/analyze/security-audit.js +637 -0
- package/dist/prompts/analyze/security-audit.js.map +1 -0
- package/dist/prompts/analyze/single-file.d.ts +162 -0
- package/dist/prompts/analyze/single-file.d.ts.map +1 -0
- package/dist/prompts/analyze/single-file.js +665 -0
- package/dist/prompts/analyze/single-file.js.map +1 -0
- package/dist/prompts/analyze/trace-execution.d.ts +126 -0
- package/dist/prompts/analyze/trace-execution.d.ts.map +1 -0
- package/dist/prompts/analyze/trace-execution.js +609 -0
- package/dist/prompts/analyze/trace-execution.js.map +1 -0
- package/dist/prompts/analyze/wordpress-plugin-audit.d.ts +116 -0
- package/dist/prompts/analyze/wordpress-plugin-audit.d.ts.map +1 -0
- package/dist/prompts/analyze/wordpress-plugin-audit.js +454 -0
- package/dist/prompts/analyze/wordpress-plugin-audit.js.map +1 -0
- package/dist/prompts/analyze/wordpress-security.d.ts +146 -0
- package/dist/prompts/analyze/wordpress-security.d.ts.map +1 -0
- package/dist/prompts/analyze/wordpress-security.js +698 -0
- package/dist/prompts/analyze/wordpress-security.js.map +1 -0
- package/dist/prompts/analyze/wordpress-theme-audit.d.ts +114 -0
- package/dist/prompts/analyze/wordpress-theme-audit.d.ts.map +1 -0
- package/dist/prompts/analyze/wordpress-theme-audit.js +538 -0
- package/dist/prompts/analyze/wordpress-theme-audit.js.map +1 -0
- package/dist/prompts/custom/custom-prompt.d.ts +135 -0
- package/dist/prompts/custom/custom-prompt.d.ts.map +1 -0
- package/dist/prompts/custom/custom-prompt.js +419 -0
- package/dist/prompts/custom/custom-prompt.js.map +1 -0
- package/dist/prompts/fun/arcade-game.d.ts +152 -0
- package/dist/prompts/fun/arcade-game.d.ts.map +1 -0
- package/dist/prompts/fun/arcade-game.js +653 -0
- package/dist/prompts/fun/arcade-game.js.map +1 -0
- package/dist/prompts/fun/create_text_adventure.d.ts +100 -0
- package/dist/prompts/fun/create_text_adventure.d.ts.map +1 -0
- package/dist/prompts/fun/create_text_adventure.js +397 -0
- package/dist/prompts/fun/create_text_adventure.js.map +1 -0
- package/dist/prompts/fun/css-art-generator.d.ts +168 -0
- package/dist/prompts/fun/css-art-generator.d.ts.map +1 -0
- package/dist/prompts/fun/css-art-generator.js +827 -0
- package/dist/prompts/fun/css-art-generator.js.map +1 -0
- package/dist/prompts/generate/project-documentation.d.ts +137 -0
- package/dist/prompts/generate/project-documentation.d.ts.map +1 -0
- package/dist/prompts/generate/project-documentation.js +666 -0
- package/dist/prompts/generate/project-documentation.js.map +1 -0
- package/dist/prompts/generate/refactoring.d.ts +164 -0
- package/dist/prompts/generate/refactoring.d.ts.map +1 -0
- package/dist/prompts/generate/refactoring.js +621 -0
- package/dist/prompts/generate/refactoring.js.map +1 -0
- package/dist/prompts/generate/responsive-component.d.ts +147 -0
- package/dist/prompts/generate/responsive-component.d.ts.map +1 -0
- package/dist/prompts/generate/responsive-component.js +955 -0
- package/dist/prompts/generate/responsive-component.js.map +1 -0
- package/dist/prompts/generate/typescript-conversion.d.ts +144 -0
- package/dist/prompts/generate/typescript-conversion.d.ts.map +1 -0
- package/dist/prompts/generate/typescript-conversion.js +527 -0
- package/dist/prompts/generate/typescript-conversion.js.map +1 -0
- package/dist/prompts/generate/unit-tests.d.ts +139 -0
- package/dist/prompts/generate/unit-tests.d.ts.map +1 -0
- package/dist/prompts/generate/unit-tests.js +578 -0
- package/dist/prompts/generate/unit-tests.js.map +1 -0
- package/dist/prompts/generate/wordpress-plugin.d.ts +179 -0
- package/dist/prompts/generate/wordpress-plugin.d.ts.map +1 -0
- package/dist/prompts/generate/wordpress-plugin.js +763 -0
- package/dist/prompts/generate/wordpress-plugin.js.map +1 -0
- package/dist/prompts/generate/wordpress-theme-from-static.d.ts +177 -0
- package/dist/prompts/generate/wordpress-theme-from-static.d.ts.map +1 -0
- package/dist/prompts/generate/wordpress-theme-from-static.js +695 -0
- package/dist/prompts/generate/wordpress-theme-from-static.js.map +1 -0
- package/dist/prompts/shared/cache-manager.d.ts +45 -0
- package/dist/prompts/shared/cache-manager.d.ts.map +1 -0
- package/dist/prompts/shared/cache-manager.js +129 -0
- package/dist/prompts/shared/cache-manager.js.map +1 -0
- package/dist/prompts/shared/helpers.d.ts +39 -0
- package/dist/prompts/shared/helpers.d.ts.map +1 -0
- package/dist/prompts/shared/helpers.js +151 -0
- package/dist/prompts/shared/helpers.js.map +1 -0
- package/dist/prompts/shared/templates.d.ts +35 -0
- package/dist/prompts/shared/templates.d.ts.map +1 -0
- package/dist/prompts/shared/templates.js +77 -0
- package/dist/prompts/shared/templates.js.map +1 -0
- package/dist/prompts/shared/types.d.ts +112 -0
- package/dist/prompts/shared/types.d.ts.map +1 -0
- package/dist/prompts/shared/types.js +5 -0
- package/dist/prompts/shared/types.js.map +1 -0
- package/dist/prompts/system/find-unused-files.d.ts +106 -0
- package/dist/prompts/system/find-unused-files.d.ts.map +1 -0
- package/dist/prompts/system/find-unused-files.js +353 -0
- package/dist/prompts/system/find-unused-files.js.map +1 -0
- package/dist/security/index.d.ts +39 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +46 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/integration-helpers.d.ts +121 -0
- package/dist/security/integration-helpers.d.ts.map +1 -0
- package/dist/security/integration-helpers.js +190 -0
- package/dist/security/integration-helpers.js.map +1 -0
- package/dist/security/output-encoder.d.ts +94 -0
- package/dist/security/output-encoder.d.ts.map +1 -0
- package/dist/security/output-encoder.js +295 -0
- package/dist/security/output-encoder.js.map +1 -0
- package/dist/security/prompt-injection-guard.d.ts +59 -0
- package/dist/security/prompt-injection-guard.d.ts.map +1 -0
- package/dist/security/prompt-injection-guard.js +249 -0
- package/dist/security/prompt-injection-guard.js.map +1 -0
- package/dist/security/sanitisation.d.ts +67 -0
- package/dist/security/sanitisation.d.ts.map +1 -0
- package/dist/security/sanitisation.js +398 -0
- package/dist/security/sanitisation.js.map +1 -0
- package/dist/security/security-service.d.ts +103 -0
- package/dist/security/security-service.d.ts.map +1 -0
- package/dist/security/security-service.js +303 -0
- package/dist/security/security-service.js.map +1 -0
- package/dist/security-config.d.ts +45 -0
- package/dist/security-config.d.ts.map +1 -0
- package/dist/security-config.js +63 -0
- package/dist/security-config.js.map +1 -0
- package/dist/system/function-list.d.ts +61 -0
- package/dist/system/function-list.d.ts.map +1 -0
- package/dist/system/function-list.js +111 -0
- package/dist/system/function-list.js.map +1 -0
- package/dist/system/function-registry.d.ts +23 -0
- package/dist/system/function-registry.d.ts.map +1 -0
- package/dist/system/function-registry.js +136 -0
- package/dist/system/function-registry.js.map +1 -0
- package/dist/system/health-check.d.ts +33 -0
- package/dist/system/health-check.d.ts.map +1 -0
- package/dist/system/health-check.js +98 -0
- package/dist/system/health-check.js.map +1 -0
- package/dist/system/path-resolver.d.ts +55 -0
- package/dist/system/path-resolver.d.ts.map +1 -0
- package/dist/system/path-resolver.js +90 -0
- package/dist/system/path-resolver.js.map +1 -0
- package/dist/templates/plugin-template.d.ts +121 -0
- package/dist/templates/plugin-template.d.ts.map +1 -0
- package/dist/templates/plugin-template.js +450 -0
- package/dist/templates/plugin-template.js.map +1 -0
- package/dist/types/chunking-types.d.ts +88 -0
- package/dist/types/chunking-types.d.ts.map +1 -0
- package/dist/types/chunking-types.js +18 -0
- package/dist/types/chunking-types.js.map +1 -0
- package/dist/types/prompt-stages.d.ts +42 -0
- package/dist/types/prompt-stages.d.ts.map +1 -0
- package/dist/types/prompt-stages.js +6 -0
- package/dist/types/prompt-stages.js.map +1 -0
- package/dist/types.d.ts +46 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/css-parser.d.ts +26 -0
- package/dist/utils/css-parser.d.ts.map +1 -0
- package/dist/utils/css-parser.js +117 -0
- package/dist/utils/css-parser.js.map +1 -0
- package/dist/utils/path-resolver.d.ts +13 -0
- package/dist/utils/path-resolver.d.ts.map +1 -0
- package/dist/utils/path-resolver.js +78 -0
- package/dist/utils/path-resolver.js.map +1 -0
- package/dist/utils/plugin-utilities.d.ts +171 -0
- package/dist/utils/plugin-utilities.d.ts.map +1 -0
- package/dist/utils/plugin-utilities.js +221 -0
- package/dist/utils/plugin-utilities.js.map +1 -0
- package/dist/utils/streamHandler.d.ts +3 -0
- package/dist/utils/streamHandler.d.ts.map +1 -0
- package/dist/utils/streamHandler.js +137 -0
- package/dist/utils/streamHandler.js.map +1 -0
- package/dist/validation/output-validator.d.ts +136 -0
- package/dist/validation/output-validator.d.ts.map +1 -0
- package/dist/validation/output-validator.js +262 -0
- package/dist/validation/output-validator.js.map +1 -0
- package/dist/validation/response-factory.d.ts +44 -0
- package/dist/validation/response-factory.d.ts.map +1 -0
- package/dist/validation/response-factory.js +202 -0
- package/dist/validation/response-factory.js.map +1 -0
- package/dist/validation/schemas.d.ts +519 -0
- package/dist/validation/schemas.d.ts.map +1 -0
- package/dist/validation/schemas.js +6 -0
- package/dist/validation/schemas.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,827 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS Art Generator Plugin - Modern v4.3
|
|
3
|
+
*
|
|
4
|
+
* Creates pure CSS drawings, animations, and interactive art
|
|
5
|
+
* Automatically detects single-art or multi-art generation mode
|
|
6
|
+
*
|
|
7
|
+
* Built with the universal template for consistency and performance
|
|
8
|
+
*/
|
|
9
|
+
import { BasePlugin } from '../../plugins/base-plugin.js';
|
|
10
|
+
import { ThreeStagePromptManager } from '../../core/ThreeStagePromptManager.js';
|
|
11
|
+
import { withSecurity } from '../../security/integration-helpers.js';
|
|
12
|
+
import { readFileContent } from '../shared/helpers.js';
|
|
13
|
+
import { ModelSetup, ResponseProcessor, ParameterValidator, ErrorHandler, MultiFileAnalysis } from '../../utils/plugin-utilities.js';
|
|
14
|
+
import { getAnalysisCache } from '../../cache/index.js';
|
|
15
|
+
export class CSSArtGenerator extends BasePlugin {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.name = 'css_art_generator';
|
|
19
|
+
this.category = 'generate';
|
|
20
|
+
this.description = 'Create pure CSS drawings, animations, and interactive art with no images required - just clever CSS techniques';
|
|
21
|
+
// Universal parameter set - supports both single and multi-art scenarios
|
|
22
|
+
this.parameters = {
|
|
23
|
+
// Single-art parameters
|
|
24
|
+
code: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Existing CSS art code to enhance (for single-art analysis)',
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
filePath: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'Path to existing CSS art file to enhance',
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
// Multi-art parameters
|
|
35
|
+
projectPath: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'Working directory for CSS art project (e.g., C:\\dev\\css-art)',
|
|
38
|
+
required: false
|
|
39
|
+
},
|
|
40
|
+
files: {
|
|
41
|
+
type: 'array',
|
|
42
|
+
description: 'Array of specific CSS art files (for multi-art analysis)',
|
|
43
|
+
required: false,
|
|
44
|
+
items: { type: 'string' }
|
|
45
|
+
},
|
|
46
|
+
maxDepth: {
|
|
47
|
+
type: 'number',
|
|
48
|
+
description: 'Maximum directory depth for art file discovery (1-3)',
|
|
49
|
+
required: false,
|
|
50
|
+
default: 2
|
|
51
|
+
},
|
|
52
|
+
// CSS Art specific parameters
|
|
53
|
+
artType: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
description: 'Type of CSS art to create',
|
|
56
|
+
enum: ['drawing', 'animation', 'interactive', 'logo', 'character', 'landscape', 'abstract', 'custom'],
|
|
57
|
+
default: 'drawing',
|
|
58
|
+
required: false
|
|
59
|
+
},
|
|
60
|
+
complexity: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'Art complexity level',
|
|
63
|
+
enum: ['simple', 'intermediate', 'advanced', 'masterpiece'],
|
|
64
|
+
default: 'intermediate',
|
|
65
|
+
required: false
|
|
66
|
+
},
|
|
67
|
+
animationStyle: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'Animation style (if applicable)',
|
|
70
|
+
enum: ['none', 'subtle', 'smooth', 'bouncy', 'dramatic', 'infinite'],
|
|
71
|
+
default: 'smooth',
|
|
72
|
+
required: false
|
|
73
|
+
},
|
|
74
|
+
colorScheme: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
description: 'Color palette for the art',
|
|
77
|
+
enum: ['vibrant', 'pastel', 'monochrome', 'neon', 'earth', 'sunset', 'ocean', 'custom'],
|
|
78
|
+
default: 'vibrant',
|
|
79
|
+
required: false
|
|
80
|
+
},
|
|
81
|
+
theme: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
description: 'Art theme or subject',
|
|
84
|
+
enum: ['nature', 'geometric', 'character', 'space', 'retro', 'modern', 'fantasy', 'custom'],
|
|
85
|
+
default: 'modern',
|
|
86
|
+
required: false
|
|
87
|
+
},
|
|
88
|
+
techniques: {
|
|
89
|
+
type: 'array',
|
|
90
|
+
description: 'CSS techniques to showcase',
|
|
91
|
+
items: { type: 'string' },
|
|
92
|
+
default: ['gradients', 'shadows', 'transforms', 'pseudo-elements'],
|
|
93
|
+
required: false
|
|
94
|
+
},
|
|
95
|
+
responsive: {
|
|
96
|
+
type: 'boolean',
|
|
97
|
+
description: 'Make art responsive to screen size',
|
|
98
|
+
default: true,
|
|
99
|
+
required: false
|
|
100
|
+
},
|
|
101
|
+
// Universal parameters
|
|
102
|
+
language: {
|
|
103
|
+
type: 'string',
|
|
104
|
+
description: 'Programming language',
|
|
105
|
+
required: false,
|
|
106
|
+
default: 'css'
|
|
107
|
+
},
|
|
108
|
+
analysisDepth: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
description: 'Level of art complexity',
|
|
111
|
+
enum: ['basic', 'detailed', 'comprehensive'],
|
|
112
|
+
default: 'detailed',
|
|
113
|
+
required: false
|
|
114
|
+
},
|
|
115
|
+
analysisType: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
description: 'Type of art generation to perform',
|
|
118
|
+
enum: ['showcase', 'educational', 'comprehensive'],
|
|
119
|
+
default: 'comprehensive',
|
|
120
|
+
required: false
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
this.analysisCache = getAnalysisCache();
|
|
124
|
+
this.multiFileAnalysis = new MultiFileAnalysis();
|
|
125
|
+
// Cache and analysis utilities are initialized above
|
|
126
|
+
}
|
|
127
|
+
async execute(params, llmClient) {
|
|
128
|
+
return await withSecurity(this, params, llmClient, async (secureParams) => {
|
|
129
|
+
try {
|
|
130
|
+
// 1. Auto-detect analysis mode based on parameters
|
|
131
|
+
const analysisMode = this.detectAnalysisMode(secureParams);
|
|
132
|
+
// 2. Validate parameters based on detected mode
|
|
133
|
+
this.validateParameters(secureParams, analysisMode);
|
|
134
|
+
// 3. Setup model
|
|
135
|
+
const { model, contextLength } = await ModelSetup.getReadyModel(llmClient);
|
|
136
|
+
// 4. Route to appropriate generation method
|
|
137
|
+
if (analysisMode === 'single-file') {
|
|
138
|
+
return await this.executeSingleArtGeneration(secureParams, model, contextLength);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
return await this.executeMultiArtGeneration(secureParams, model, contextLength);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
return ErrorHandler.createExecutionError('css_art_generator', error);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Auto-detect whether this is single-art or multi-art generation
|
|
151
|
+
*/
|
|
152
|
+
detectAnalysisMode(params) {
|
|
153
|
+
// Single-file indicators take priority (avoids default parameter issues)
|
|
154
|
+
if (params.code || params.filePath) {
|
|
155
|
+
return 'single-file';
|
|
156
|
+
}
|
|
157
|
+
// Multi-file indicators (art collections, project enhancement)
|
|
158
|
+
if (params.projectPath || params.files) {
|
|
159
|
+
return 'multi-file';
|
|
160
|
+
}
|
|
161
|
+
// Default to single-file for CSS art generation (art-focused)
|
|
162
|
+
return 'single-file';
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Validate parameters based on detected analysis mode
|
|
166
|
+
*/
|
|
167
|
+
validateParameters(params, mode) {
|
|
168
|
+
if (mode === 'single-file') {
|
|
169
|
+
// Single-art generation doesn't require code/file - can generate from scratch
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
ParameterValidator.validateProjectPath(params);
|
|
173
|
+
ParameterValidator.validateDepth(params);
|
|
174
|
+
}
|
|
175
|
+
// Universal validations
|
|
176
|
+
ParameterValidator.validateEnum(params, 'analysisType', ['showcase', 'educational', 'comprehensive']);
|
|
177
|
+
ParameterValidator.validateEnum(params, 'analysisDepth', ['basic', 'detailed', 'comprehensive']);
|
|
178
|
+
ParameterValidator.validateEnum(params, 'artType', ['drawing', 'animation', 'interactive', 'logo', 'character', 'landscape', 'abstract', 'custom']);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Execute single-art generation
|
|
182
|
+
*/
|
|
183
|
+
async executeSingleArtGeneration(params, model, contextLength) {
|
|
184
|
+
// Process existing art input (if any)
|
|
185
|
+
let existingArtCode = params.code;
|
|
186
|
+
if (params.filePath) {
|
|
187
|
+
existingArtCode = await readFileContent(params.filePath);
|
|
188
|
+
}
|
|
189
|
+
// Generate prompt stages for single art piece
|
|
190
|
+
const promptStages = this.getSingleArtPromptStages({
|
|
191
|
+
...params,
|
|
192
|
+
code: existingArtCode
|
|
193
|
+
});
|
|
194
|
+
// Execute with appropriate method
|
|
195
|
+
const promptManager = new ThreeStagePromptManager(contextLength);
|
|
196
|
+
const needsChunking = promptManager.needsChunking(promptStages);
|
|
197
|
+
if (needsChunking) {
|
|
198
|
+
const conversation = promptManager.createChunkedConversation(promptStages);
|
|
199
|
+
const messages = [
|
|
200
|
+
conversation.systemMessage,
|
|
201
|
+
...conversation.dataMessages,
|
|
202
|
+
conversation.analysisMessage
|
|
203
|
+
];
|
|
204
|
+
return await ResponseProcessor.executeChunked(messages, model, contextLength, 'css_art_generator', 'single');
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
return await ResponseProcessor.executeDirect(promptStages, model, contextLength, 'css_art_generator');
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Execute multi-art generation
|
|
212
|
+
*/
|
|
213
|
+
async executeMultiArtGeneration(params, model, contextLength) {
|
|
214
|
+
// Discover existing art files
|
|
215
|
+
let filesToAnalyze = params.files ||
|
|
216
|
+
await this.discoverRelevantFiles(params.projectPath, params.maxDepth, params.analysisType);
|
|
217
|
+
// Perform multi-art analysis with caching
|
|
218
|
+
const analysisResult = await this.performMultiArtAnalysis(filesToAnalyze, params, model, contextLength);
|
|
219
|
+
// Generate prompt stages for multi-art
|
|
220
|
+
const promptStages = this.getMultiArtPromptStages({
|
|
221
|
+
...params,
|
|
222
|
+
analysisResult,
|
|
223
|
+
artCount: filesToAnalyze.length
|
|
224
|
+
});
|
|
225
|
+
// Always use chunking for multi-art
|
|
226
|
+
const promptManager = new ThreeStagePromptManager(contextLength);
|
|
227
|
+
const conversation = promptManager.createChunkedConversation(promptStages);
|
|
228
|
+
const messages = [
|
|
229
|
+
conversation.systemMessage,
|
|
230
|
+
...conversation.dataMessages,
|
|
231
|
+
conversation.analysisMessage
|
|
232
|
+
];
|
|
233
|
+
return await ResponseProcessor.executeChunked(messages, model, contextLength, 'css_art_generator', 'multifile');
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Single-art prompt stages - Generate a beautiful CSS art piece
|
|
237
|
+
*/
|
|
238
|
+
getSingleArtPromptStages(params) {
|
|
239
|
+
const { artType, complexity, animationStyle, colorScheme, theme, techniques, responsive, analysisDepth, analysisType, code } = params;
|
|
240
|
+
const systemAndContext = `You are a visionary CSS artist and master of web technologies specializing in ${analysisDepth} ${analysisType} pure CSS art creation.
|
|
241
|
+
|
|
242
|
+
**Your Mission**: Create stunning, mind-blowing CSS art that pushes the absolute boundaries of what's possible with pure CSS - no images, no JavaScript, just pure creative genius.
|
|
243
|
+
|
|
244
|
+
**CSS Art Context:**
|
|
245
|
+
- Art Type: ${artType}
|
|
246
|
+
- Complexity: ${complexity}
|
|
247
|
+
- Animation Style: ${animationStyle}
|
|
248
|
+
- Color Scheme: ${colorScheme}
|
|
249
|
+
- Theme: ${theme}
|
|
250
|
+
- CSS Techniques: ${JSON.stringify(techniques)}
|
|
251
|
+
- Responsive Design: ${responsive}
|
|
252
|
+
- Artistic Depth: ${analysisDepth}
|
|
253
|
+
- Showcase Level: ${analysisType}
|
|
254
|
+
|
|
255
|
+
**Your Legendary Expertise:**
|
|
256
|
+
- 15+ years creating impossible CSS art that makes developers say "How did they DO that?!"
|
|
257
|
+
- Master of advanced CSS properties: clip-path, filter, transform-3d, custom properties
|
|
258
|
+
- Expert in CSS animations and keyframes that bring art to life
|
|
259
|
+
- Pioneer of pseudo-element wizardry (:before, :after) for complex illustrations
|
|
260
|
+
- Specialist in gradient artistry and shadow manipulation for photorealistic effects
|
|
261
|
+
- Genius of responsive CSS art that adapts beautifully to any screen size
|
|
262
|
+
- Teacher of advanced CSS techniques through beautiful, educational examples
|
|
263
|
+
|
|
264
|
+
**CSS Art Philosophy:**
|
|
265
|
+
1. **Pure CSS Magic** - No images, no SVG, no JavaScript - just CSS superpowers
|
|
266
|
+
2. **Visual Impact** - Art should make viewers stop and stare in amazement
|
|
267
|
+
3. **Technical Mastery** - Showcase advanced CSS techniques creatively
|
|
268
|
+
4. **Educational Value** - Code should inspire and teach other developers
|
|
269
|
+
5. **Responsive Beauty** - Art looks perfect on phones, tablets, and desktops
|
|
270
|
+
6. **Performance** - Smooth animations, optimized rendering, hardware acceleration
|
|
271
|
+
7. **Creative Innovation** - Push boundaries of what people think CSS can do
|
|
272
|
+
|
|
273
|
+
**Advanced CSS Techniques Mastery:**
|
|
274
|
+
- **Gradients**: Linear, radial, conic - create complex lighting and textures
|
|
275
|
+
- **Clip-path**: Cut out complex shapes and create stunning geometry
|
|
276
|
+
- **Filters**: blur(), drop-shadow(), hue-rotate() for photographic effects
|
|
277
|
+
- **Transforms**: 3D rotation, perspective, scaling for dimensional art
|
|
278
|
+
- **Pseudo-elements**: :before and :after for layered compositions
|
|
279
|
+
- **CSS Variables**: Dynamic colors and responsive scaling
|
|
280
|
+
- **Keyframes**: Smooth, captivating animations that tell stories
|
|
281
|
+
- **Box-shadow**: Multiple shadows for depth, glow, and complex shapes
|
|
282
|
+
- **Border-radius**: Create organic curves and perfect circles
|
|
283
|
+
- **Position absolute/relative**: Precise layering and composition
|
|
284
|
+
|
|
285
|
+
**${colorScheme.charAt(0).toUpperCase() + colorScheme.slice(1)} Color Psychology:**
|
|
286
|
+
${this.getColorSchemeGuidelines(colorScheme)}
|
|
287
|
+
|
|
288
|
+
**${theme.charAt(0).toUpperCase() + theme.slice(1)} Theme Inspiration:**
|
|
289
|
+
${this.getThemeInspiration(theme)}
|
|
290
|
+
|
|
291
|
+
Your task is to create CSS art so beautiful and technically impressive that it becomes a masterpiece showcase of pure CSS potential.`;
|
|
292
|
+
const dataPayload = code ? `**Existing CSS Art to Enhance:**
|
|
293
|
+
|
|
294
|
+
\`\`\`css
|
|
295
|
+
${code}
|
|
296
|
+
\`\`\`
|
|
297
|
+
|
|
298
|
+
**Enhancement Request:**
|
|
299
|
+
Please analyze the existing CSS art and enhance it with the requested features while maintaining the artistic vision and improving the technical execution.` :
|
|
300
|
+
`**New CSS Art Generation Request:**
|
|
301
|
+
Create a brand new ${artType} artwork from scratch with the specified parameters.
|
|
302
|
+
|
|
303
|
+
**${artType.charAt(0).toUpperCase() + artType.slice(1)} Art Inspiration:**
|
|
304
|
+
${this.getArtTypeInspiration(artType)}
|
|
305
|
+
|
|
306
|
+
**${complexity.charAt(0).toUpperCase() + complexity.slice(1)} Complexity Guidelines:**
|
|
307
|
+
${this.getComplexityGuidelines(complexity)}
|
|
308
|
+
|
|
309
|
+
**Animation Style - ${animationStyle}:**
|
|
310
|
+
${this.getAnimationGuidelines(animationStyle)}`;
|
|
311
|
+
const outputInstructions = `**Generate a complete, stunning CSS art piece as a single HTML file:**
|
|
312
|
+
|
|
313
|
+
\`\`\`html
|
|
314
|
+
<!DOCTYPE html>
|
|
315
|
+
<html lang="en">
|
|
316
|
+
<head>
|
|
317
|
+
<meta charset="UTF-8">
|
|
318
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
319
|
+
<title>CSS Art: ${artType.charAt(0).toUpperCase() + artType.slice(1)} - ${theme.charAt(0).toUpperCase() + theme.slice(1)} Theme</title>
|
|
320
|
+
<style>
|
|
321
|
+
/* RESET AND BASE STYLES */
|
|
322
|
+
* {
|
|
323
|
+
margin: 0;
|
|
324
|
+
padding: 0;
|
|
325
|
+
box-sizing: border-box;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
body {
|
|
329
|
+
background: ${this.getBackgroundSuggestion(colorScheme, theme)};
|
|
330
|
+
display: flex;
|
|
331
|
+
justify-content: center;
|
|
332
|
+
align-items: center;
|
|
333
|
+
min-height: 100vh;
|
|
334
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
335
|
+
overflow: hidden; /* For full-screen art */
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/* MAIN ARTWORK CONTAINER */
|
|
339
|
+
.css-art {
|
|
340
|
+
/* Primary art container with perfect centering */
|
|
341
|
+
position: relative;
|
|
342
|
+
/* Responsive scaling based on screen size */
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* ADVANCED CSS ART TECHNIQUES */
|
|
346
|
+
|
|
347
|
+
/* 1. COMPLEX SHAPES WITH CLIP-PATH */
|
|
348
|
+
.shape-layer {
|
|
349
|
+
/* Use clip-path for impossible geometric shapes */
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* 2. GRADIENT MASTERY */
|
|
353
|
+
.gradient-layer {
|
|
354
|
+
/* Multiple gradients for lighting and texture */
|
|
355
|
+
background:
|
|
356
|
+
linear-gradient(...),
|
|
357
|
+
radial-gradient(...),
|
|
358
|
+
conic-gradient(...);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* 3. PSEUDO-ELEMENT WIZARDRY */
|
|
362
|
+
.detail::before,
|
|
363
|
+
.detail::after {
|
|
364
|
+
/* Create complex layered compositions */
|
|
365
|
+
content: '';
|
|
366
|
+
position: absolute;
|
|
367
|
+
/* Intricate shapes and details */
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/* 4. 3D TRANSFORMS AND PERSPECTIVE */
|
|
371
|
+
.dimensional {
|
|
372
|
+
transform-style: preserve-3d;
|
|
373
|
+
perspective: 1000px;
|
|
374
|
+
/* 3D rotation and depth effects */
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* 5. ADVANCED ANIMATIONS */
|
|
378
|
+
@keyframes ${animationStyle}Animation {
|
|
379
|
+
/* Smooth, captivating animation keyframes */
|
|
380
|
+
0% { /* Initial state */ }
|
|
381
|
+
50% { /* Mid-point transformation */ }
|
|
382
|
+
100% { /* Final state */ }
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/* 6. MULTIPLE BOX-SHADOWS FOR DEPTH */
|
|
386
|
+
.shadow-art {
|
|
387
|
+
box-shadow:
|
|
388
|
+
/* Multiple shadows for complex shapes */
|
|
389
|
+
inset 0 0 20px rgba(...),
|
|
390
|
+
0 0 40px rgba(...),
|
|
391
|
+
0 0 80px rgba(...);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/* 7. CSS FILTERS FOR EFFECTS */
|
|
395
|
+
.filter-effects {
|
|
396
|
+
filter:
|
|
397
|
+
blur(2px)
|
|
398
|
+
drop-shadow(0 0 10px rgba(...))
|
|
399
|
+
hue-rotate(45deg)
|
|
400
|
+
saturate(1.5);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* 8. RESPONSIVE DESIGN */
|
|
404
|
+
@media (max-width: 768px) {
|
|
405
|
+
.css-art {
|
|
406
|
+
/* Mobile-optimized scaling */
|
|
407
|
+
transform: scale(0.8);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
@media (max-width: 480px) {
|
|
412
|
+
.css-art {
|
|
413
|
+
/* Small screen adaptations */
|
|
414
|
+
transform: scale(0.6);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/* 9. CSS CUSTOM PROPERTIES FOR THEMING */
|
|
419
|
+
:root {
|
|
420
|
+
--primary-color: ${this.getPrimaryColor(colorScheme)};
|
|
421
|
+
--secondary-color: ${this.getSecondaryColor(colorScheme)};
|
|
422
|
+
--accent-color: ${this.getAccentColor(colorScheme)};
|
|
423
|
+
--art-size: clamp(200px, 50vw, 600px);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/* 10. INTERACTIVE HOVER EFFECTS (IF APPLICABLE) */
|
|
427
|
+
.css-art:hover {
|
|
428
|
+
/* Subtle interactive enhancements */
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/* ARTWORK-SPECIFIC STYLES */
|
|
432
|
+
/* [Generate detailed, creative CSS for the specific ${artType} artwork] */
|
|
433
|
+
|
|
434
|
+
</style>
|
|
435
|
+
</head>
|
|
436
|
+
<body>
|
|
437
|
+
<div class="css-art">
|
|
438
|
+
<!-- HTML structure for the CSS art -->
|
|
439
|
+
<!-- Minimal, semantic markup that enables CSS magic -->
|
|
440
|
+
<div class="main-element">
|
|
441
|
+
<div class="detail layer-1"></div>
|
|
442
|
+
<div class="detail layer-2"></div>
|
|
443
|
+
<div class="detail layer-3"></div>
|
|
444
|
+
<!-- Additional elements as needed for complex compositions -->
|
|
445
|
+
</div>
|
|
446
|
+
</div>
|
|
447
|
+
|
|
448
|
+
<!-- Optional: Art information overlay -->
|
|
449
|
+
<div class="art-info" style="position: fixed; bottom: 20px; left: 20px; color: white; font-size: 14px; opacity: 0.7;">
|
|
450
|
+
<strong>Pure CSS Art:</strong> ${artType} • ${theme} theme • ${colorScheme} colors
|
|
451
|
+
<br><small>No images • No JavaScript • Just CSS magic ✨</small>
|
|
452
|
+
</div>
|
|
453
|
+
</body>
|
|
454
|
+
</html>
|
|
455
|
+
\`\`\`
|
|
456
|
+
|
|
457
|
+
**Critical CSS Art Requirements:**
|
|
458
|
+
✅ **Pure CSS Only** - No images, no SVG, no JavaScript dependencies
|
|
459
|
+
✅ **Visual Impact** - Art should be immediately stunning and memorable
|
|
460
|
+
✅ **Advanced Techniques** - Showcase at least 5 advanced CSS properties creatively
|
|
461
|
+
✅ **${colorScheme} Color Mastery** - Beautiful, cohesive color palette execution
|
|
462
|
+
✅ **${animationStyle} Animation** - Smooth, purposeful animations that enhance the art
|
|
463
|
+
✅ **Responsive Design** - Perfect scaling on all devices (mobile to desktop)
|
|
464
|
+
✅ **Performance Optimized** - Smooth 60fps animations, hardware acceleration
|
|
465
|
+
✅ **Educational Value** - Code comments explaining advanced techniques
|
|
466
|
+
✅ **Technical Innovation** - Push boundaries of CSS art possibilities
|
|
467
|
+
|
|
468
|
+
**Advanced CSS Showcase Standards:**
|
|
469
|
+
- **Clip-path mastery** for impossible geometric shapes
|
|
470
|
+
- **Multiple gradient layers** for realistic lighting and texture
|
|
471
|
+
- **Pseudo-element wizardry** for complex layered compositions
|
|
472
|
+
- **3D transforms** for dimensional depth and perspective
|
|
473
|
+
- **Filter combinations** for photographic effects and atmosphere
|
|
474
|
+
- **Custom property theming** for responsive and dynamic styling
|
|
475
|
+
- **Animation orchestration** for smooth, captivating movement
|
|
476
|
+
- **Box-shadow artistry** for depth, glow, and complex forms
|
|
477
|
+
|
|
478
|
+
**Artistic Excellence Standards:**
|
|
479
|
+
- Museum-quality visual composition and balance
|
|
480
|
+
- Color harmony that evokes emotion and atmosphere
|
|
481
|
+
- Technical execution that inspires other developers
|
|
482
|
+
- Responsive behavior that maintains artistic integrity
|
|
483
|
+
- Performance that runs smoothly on any device
|
|
484
|
+
|
|
485
|
+
Create CSS art so incredible that developers will study your code to learn how it's possible!`;
|
|
486
|
+
return { systemAndContext, dataPayload, outputInstructions };
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Multi-art prompt stages - Generate CSS art collections or enhance projects
|
|
490
|
+
*/
|
|
491
|
+
getMultiArtPromptStages(params) {
|
|
492
|
+
const { analysisResult, analysisType, analysisDepth, artCount, artType, theme, colorScheme } = params;
|
|
493
|
+
const systemAndContext = `You are a master CSS art curator and gallery director specializing in ${analysisDepth} ${analysisType} CSS art collection development.
|
|
494
|
+
|
|
495
|
+
**Your Mission**: Create a comprehensive CSS art gallery or enhance an existing art project with multiple interconnected artworks that tell a cohesive visual story.
|
|
496
|
+
|
|
497
|
+
**Art Collection Context:**
|
|
498
|
+
- Collection Type: ${analysisType}
|
|
499
|
+
- Collection Depth: ${analysisDepth}
|
|
500
|
+
- Art Pieces in Collection: ${artCount}
|
|
501
|
+
- Primary Art Type: ${artType}
|
|
502
|
+
- Unifying Theme: ${theme}
|
|
503
|
+
- Color Harmony: ${colorScheme}
|
|
504
|
+
- Mode: Multi-Art Collection Development
|
|
505
|
+
|
|
506
|
+
**Your Elite Expertise:**
|
|
507
|
+
- 20+ years curating digital art galleries and interactive experiences
|
|
508
|
+
- Expert in creating cohesive visual narratives across multiple artworks
|
|
509
|
+
- Master of scalable CSS architectures with shared design systems
|
|
510
|
+
- Specialized in progressive art experiences that guide viewer journeys
|
|
511
|
+
- Pioneer of elegant multi-art frameworks with unified aesthetics
|
|
512
|
+
|
|
513
|
+
**Collection Architecture Philosophy:**
|
|
514
|
+
1. **Visual Cohesion** - Unified color palette and artistic style across all pieces
|
|
515
|
+
2. **Progressive Complexity** - Artworks build artistic narrative and technical sophistication
|
|
516
|
+
3. **Shared Design System** - Common CSS variables and reusable art components
|
|
517
|
+
4. **Interactive Gallery** - Elegant navigation between individual art pieces
|
|
518
|
+
5. **Responsive Exhibition** - Beautiful presentation on all devices and screen sizes
|
|
519
|
+
6. **Educational Journey** - Each artwork teaches different advanced CSS techniques
|
|
520
|
+
|
|
521
|
+
Your task is to create a masterful CSS art collection that showcases both individual artistic brilliance and cohesive gallery experience.`;
|
|
522
|
+
const dataPayload = `**CSS Art Collection Analysis Results:**
|
|
523
|
+
|
|
524
|
+
${JSON.stringify(analysisResult, null, 2)}`;
|
|
525
|
+
const outputInstructions = `**Generate a comprehensive CSS art gallery as multiple coordinated files:**
|
|
526
|
+
|
|
527
|
+
\`\`\`
|
|
528
|
+
// File Structure for CSS Art Collection:
|
|
529
|
+
index.html // Main gallery navigation and overview
|
|
530
|
+
shared/
|
|
531
|
+
art-gallery.css // Shared gallery framework and navigation
|
|
532
|
+
css-variables.css // Unified color schemes and design tokens
|
|
533
|
+
responsive-gallery.css // Mobile-friendly gallery layouts
|
|
534
|
+
artworks/
|
|
535
|
+
${artType}-piece-1.html // Individual art pieces as standalone files
|
|
536
|
+
${artType}-piece-2.html // Each showcasing different CSS techniques
|
|
537
|
+
${artType}-piece-3.html // Progressive complexity and innovation
|
|
538
|
+
animations/
|
|
539
|
+
gallery-transitions.css // Smooth navigation animations
|
|
540
|
+
artwork-interactions.css // Interactive hover and focus effects
|
|
541
|
+
\`\`\`
|
|
542
|
+
|
|
543
|
+
**Gallery Collection Features:**
|
|
544
|
+
- **Art Navigation**: Beautiful gallery interface for browsing artworks
|
|
545
|
+
- **Unified Theme**: Cohesive ${theme} aesthetic with ${colorScheme} color harmony
|
|
546
|
+
- **Progressive Showcase**: Each artwork demonstrates different advanced CSS techniques
|
|
547
|
+
- **Interactive Experience**: Smooth transitions and elegant art presentation
|
|
548
|
+
- **Educational Value**: Gallery teaches CSS artistry through visual examples
|
|
549
|
+
- **Responsive Design**: Perfect viewing experience on all devices
|
|
550
|
+
- **Performance Optimized**: Fast loading, smooth animations throughout
|
|
551
|
+
|
|
552
|
+
**Individual Artwork Quality:**
|
|
553
|
+
Each art piece in the collection must be:
|
|
554
|
+
✅ **Visually Stunning** - Museum-quality CSS art execution
|
|
555
|
+
✅ **Technically Advanced** - Showcases unique CSS techniques and innovation
|
|
556
|
+
✅ **Thematically Consistent** - Follows the unified ${theme} visual narrative
|
|
557
|
+
✅ **Educationally Valuable** - Teaches specific advanced CSS concepts
|
|
558
|
+
✅ **Performance Optimized** - Smooth, hardware-accelerated animations
|
|
559
|
+
✅ **Responsive Excellence** - Beautiful on all screen sizes
|
|
560
|
+
|
|
561
|
+
**Gallery Architecture:**
|
|
562
|
+
- **CSS Design System**: Shared variables for colors, spacing, and typography
|
|
563
|
+
- **Modular Structure**: Each artwork as independent, reusable component
|
|
564
|
+
- **Navigation Framework**: Elegant transitions between art pieces
|
|
565
|
+
- **Progressive Enhancement**: Advanced features for capable browsers
|
|
566
|
+
- **Educational Documentation**: Code comments explaining artistic techniques
|
|
567
|
+
|
|
568
|
+
**Collection Themes:**
|
|
569
|
+
- **${theme} Artistic Vision**: Unified visual story across all artworks
|
|
570
|
+
- **Technical Progression**: From foundational to advanced CSS techniques
|
|
571
|
+
- **Interactive Narrative**: User journey through CSS art possibilities
|
|
572
|
+
- **Responsive Gallery**: Adaptive layouts for optimal art viewing
|
|
573
|
+
|
|
574
|
+
Create a CSS art collection that establishes a new standard for web-based digital art galleries!`;
|
|
575
|
+
return { systemAndContext, dataPayload, outputInstructions };
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Backwards compatibility method - routes to appropriate stages
|
|
579
|
+
*/
|
|
580
|
+
getPromptStages(params) {
|
|
581
|
+
const mode = this.detectAnalysisMode(params);
|
|
582
|
+
if (mode === 'single-file') {
|
|
583
|
+
return this.getSingleArtPromptStages(params);
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
return this.getMultiArtPromptStages(params);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
// Multi-art helper methods
|
|
590
|
+
async discoverRelevantFiles(projectPath, maxDepth, analysisType) {
|
|
591
|
+
const extensions = this.getFileExtensions(analysisType);
|
|
592
|
+
return await this.multiFileAnalysis.discoverFiles(projectPath, extensions, maxDepth);
|
|
593
|
+
}
|
|
594
|
+
async performMultiArtAnalysis(files, params, model, contextLength) {
|
|
595
|
+
const cacheKey = this.analysisCache.generateKey('css_art_generator', params, files);
|
|
596
|
+
const cached = await this.analysisCache.get(cacheKey);
|
|
597
|
+
if (cached)
|
|
598
|
+
return cached;
|
|
599
|
+
const artAnalysisResults = await this.multiFileAnalysis.analyzeBatch(files, (file) => this.analyzeArtFile(file, params, model), contextLength);
|
|
600
|
+
// Aggregate results into art collection analysis
|
|
601
|
+
const aggregatedResult = {
|
|
602
|
+
summary: `CSS art collection analysis of ${files.length} art files`,
|
|
603
|
+
findings: artAnalysisResults,
|
|
604
|
+
data: {
|
|
605
|
+
artCount: files.length,
|
|
606
|
+
totalArtSize: artAnalysisResults.reduce((sum, result) => sum + (result.size || 0), 0),
|
|
607
|
+
artTypes: this.identifyArtTypes(artAnalysisResults),
|
|
608
|
+
cssFeatures: this.identifyCSSFeatures(artAnalysisResults),
|
|
609
|
+
collectionTheme: params.theme || 'modern',
|
|
610
|
+
colorScheme: params.colorScheme || 'vibrant',
|
|
611
|
+
analysisTimestamp: new Date().toISOString()
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
await this.analysisCache.cacheAnalysis(cacheKey, aggregatedResult, {
|
|
615
|
+
modelUsed: model.identifier || 'unknown',
|
|
616
|
+
executionTime: Date.now() - Date.now(),
|
|
617
|
+
timestamp: new Date().toISOString()
|
|
618
|
+
});
|
|
619
|
+
return aggregatedResult;
|
|
620
|
+
}
|
|
621
|
+
async analyzeArtFile(file, params, model) {
|
|
622
|
+
const content = await readFileContent(file);
|
|
623
|
+
return {
|
|
624
|
+
filePath: file,
|
|
625
|
+
size: content.length,
|
|
626
|
+
lines: content.split('\n').length,
|
|
627
|
+
hasAnimations: /@keyframes|animation:|transition:/.test(content),
|
|
628
|
+
hasGradients: /gradient\(/.test(content),
|
|
629
|
+
hasTransforms: /transform:/.test(content),
|
|
630
|
+
hasPseudoElements: /::?(?:before|after)/.test(content),
|
|
631
|
+
hasClipPath: /clip-path:/.test(content),
|
|
632
|
+
hasFilters: /filter:/.test(content),
|
|
633
|
+
artComplexity: this.assessArtComplexity(content),
|
|
634
|
+
detectedTheme: this.detectTheme(content)
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
identifyArtTypes(results) {
|
|
638
|
+
const types = new Set();
|
|
639
|
+
results.forEach(result => {
|
|
640
|
+
if (result.hasAnimations)
|
|
641
|
+
types.add('animated');
|
|
642
|
+
if (result.hasGradients)
|
|
643
|
+
types.add('gradient-based');
|
|
644
|
+
if (result.hasTransforms)
|
|
645
|
+
types.add('transformed');
|
|
646
|
+
if (result.hasPseudoElements)
|
|
647
|
+
types.add('layered');
|
|
648
|
+
});
|
|
649
|
+
return Array.from(types);
|
|
650
|
+
}
|
|
651
|
+
identifyCSSFeatures(results) {
|
|
652
|
+
const features = [];
|
|
653
|
+
const hasAnimations = results.some(r => r.hasAnimations);
|
|
654
|
+
const hasGradients = results.some(r => r.hasGradients);
|
|
655
|
+
const hasTransforms = results.some(r => r.hasTransforms);
|
|
656
|
+
const hasPseudoElements = results.some(r => r.hasPseudoElements);
|
|
657
|
+
const hasClipPath = results.some(r => r.hasClipPath);
|
|
658
|
+
const hasFilters = results.some(r => r.hasFilters);
|
|
659
|
+
if (hasAnimations)
|
|
660
|
+
features.push('CSS Animations & Keyframes');
|
|
661
|
+
if (hasGradients)
|
|
662
|
+
features.push('Advanced Gradients');
|
|
663
|
+
if (hasTransforms)
|
|
664
|
+
features.push('3D Transforms');
|
|
665
|
+
if (hasPseudoElements)
|
|
666
|
+
features.push('Pseudo-element Artistry');
|
|
667
|
+
if (hasClipPath)
|
|
668
|
+
features.push('Clip-path Mastery');
|
|
669
|
+
if (hasFilters)
|
|
670
|
+
features.push('CSS Filters & Effects');
|
|
671
|
+
return features;
|
|
672
|
+
}
|
|
673
|
+
assessArtComplexity(content) {
|
|
674
|
+
let complexity = 0;
|
|
675
|
+
if (/@keyframes/.test(content))
|
|
676
|
+
complexity += 2;
|
|
677
|
+
if (/gradient\(/.test(content))
|
|
678
|
+
complexity += 1;
|
|
679
|
+
if (/transform:/.test(content))
|
|
680
|
+
complexity += 1;
|
|
681
|
+
if (/::?(?:before|after)/.test(content))
|
|
682
|
+
complexity += 2;
|
|
683
|
+
if (/clip-path:/.test(content))
|
|
684
|
+
complexity += 3;
|
|
685
|
+
if (/filter:/.test(content))
|
|
686
|
+
complexity += 2;
|
|
687
|
+
if (/box-shadow:/.test(content))
|
|
688
|
+
complexity += 1;
|
|
689
|
+
if (complexity >= 8)
|
|
690
|
+
return 'masterpiece';
|
|
691
|
+
if (complexity >= 5)
|
|
692
|
+
return 'advanced';
|
|
693
|
+
if (complexity >= 3)
|
|
694
|
+
return 'intermediate';
|
|
695
|
+
return 'simple';
|
|
696
|
+
}
|
|
697
|
+
detectTheme(content) {
|
|
698
|
+
if (/space|star|galaxy|cosmic/.test(content))
|
|
699
|
+
return 'space';
|
|
700
|
+
if (/nature|leaf|tree|forest|flower/.test(content))
|
|
701
|
+
return 'nature';
|
|
702
|
+
if (/geometric|polygon|triangle|circle/.test(content))
|
|
703
|
+
return 'geometric';
|
|
704
|
+
if (/neon|glow|bright|electric/.test(content))
|
|
705
|
+
return 'neon';
|
|
706
|
+
if (/retro|vintage|old|classic/.test(content))
|
|
707
|
+
return 'retro';
|
|
708
|
+
return 'modern';
|
|
709
|
+
}
|
|
710
|
+
getArtTypeInspiration(artType) {
|
|
711
|
+
const inspirations = {
|
|
712
|
+
'drawing': 'Hand-drawn illustrations recreated in pure CSS - portraits, sketches, line art with creative pseudo-elements',
|
|
713
|
+
'animation': 'Moving art that tells a story - rotating elements, morphing shapes, particle systems in CSS',
|
|
714
|
+
'interactive': 'Art that responds to user interaction - hover effects, click transformations, dynamic color changes',
|
|
715
|
+
'logo': 'Brand identities and iconography - scalable vector-style logos using CSS shapes and typography',
|
|
716
|
+
'character': 'Cartoon characters and mascots - expressive faces, body proportions, personality through CSS',
|
|
717
|
+
'landscape': 'Scenic environments and vistas - mountains, oceans, cities using layered CSS techniques',
|
|
718
|
+
'abstract': 'Non-representational artistic expression - geometric patterns, color studies, experimental forms',
|
|
719
|
+
'custom': 'Unique artistic vision that pushes the boundaries of CSS art possibilities'
|
|
720
|
+
};
|
|
721
|
+
return inspirations[artType] || inspirations.custom;
|
|
722
|
+
}
|
|
723
|
+
getComplexityGuidelines(complexity) {
|
|
724
|
+
const guidelines = {
|
|
725
|
+
'simple': 'Clean, elegant art using basic CSS properties - focus on composition and color harmony',
|
|
726
|
+
'intermediate': 'Moderate use of advanced techniques - gradients, transforms, basic animations for visual interest',
|
|
727
|
+
'advanced': 'Sophisticated CSS mastery - multiple advanced properties, complex animations, layered compositions',
|
|
728
|
+
'masterpiece': 'Pushing absolute limits of CSS - mind-bending techniques, photorealistic effects, impossible geometries'
|
|
729
|
+
};
|
|
730
|
+
return guidelines[complexity] || guidelines.intermediate;
|
|
731
|
+
}
|
|
732
|
+
getAnimationGuidelines(animationStyle) {
|
|
733
|
+
const guidelines = {
|
|
734
|
+
'none': 'Static art with no movement - focus on composition, color, and form',
|
|
735
|
+
'subtle': 'Gentle, barely noticeable animations - breathing effects, soft glows, minimal movement',
|
|
736
|
+
'smooth': 'Fluid, purposeful animations that enhance the art - smooth transitions and organic motion',
|
|
737
|
+
'bouncy': 'Playful, elastic animations with spring physics - fun, energetic movement patterns',
|
|
738
|
+
'dramatic': 'Bold, attention-grabbing animations - striking transformations and dynamic effects',
|
|
739
|
+
'infinite': 'Continuous looping animations - hypnotic patterns, rotating elements, endless motion'
|
|
740
|
+
};
|
|
741
|
+
return guidelines[animationStyle] || guidelines.smooth;
|
|
742
|
+
}
|
|
743
|
+
getColorSchemeGuidelines(colorScheme) {
|
|
744
|
+
const guidelines = {
|
|
745
|
+
'vibrant': 'Bold, saturated colors that pop - electric blues, hot pinks, bright greens for maximum visual impact',
|
|
746
|
+
'pastel': 'Soft, dreamy colors - pale pinks, light blues, gentle yellows for calming, elegant aesthetics',
|
|
747
|
+
'monochrome': 'Single-color variations - different shades and tones of one hue for sophisticated, focused art',
|
|
748
|
+
'neon': 'Glowing, electric colors - bright magentas, cyber greens, electric blues with glow effects',
|
|
749
|
+
'earth': 'Natural, organic colors - browns, greens, oranges inspired by nature and landscapes',
|
|
750
|
+
'sunset': 'Warm gradient transitions - oranges, pinks, purples, yellows like golden hour lighting',
|
|
751
|
+
'ocean': 'Cool blue and teal variations - deep navy, turquoise, seafoam for aquatic, serene moods',
|
|
752
|
+
'custom': 'Unique color palette that perfectly matches the artistic vision and theme'
|
|
753
|
+
};
|
|
754
|
+
return guidelines[colorScheme] || guidelines.vibrant;
|
|
755
|
+
}
|
|
756
|
+
getThemeInspiration(theme) {
|
|
757
|
+
const inspirations = {
|
|
758
|
+
'nature': 'Organic forms, flowing lines, botanical elements - trees, leaves, flowers, landscapes with natural textures',
|
|
759
|
+
'geometric': 'Mathematical precision, clean lines, perfect shapes - triangles, circles, polygons in harmonious compositions',
|
|
760
|
+
'character': 'Expressive personalities, faces, figures - cartoon styles, mascots, portraits with emotional depth',
|
|
761
|
+
'space': 'Cosmic wonder, celestial bodies, sci-fi elements - stars, planets, galaxies, futuristic designs',
|
|
762
|
+
'retro': 'Nostalgic aesthetics, vintage vibes - 80s neon, art deco patterns, classic design elements',
|
|
763
|
+
'modern': 'Contemporary design principles - minimalism, bold typography, clean layouts, current trends',
|
|
764
|
+
'fantasy': 'Magical, mythical elements - dragons, castles, enchanted forests, otherworldly creatures',
|
|
765
|
+
'custom': 'Original thematic vision that creates a unique artistic narrative and visual identity'
|
|
766
|
+
};
|
|
767
|
+
return inspirations[theme] || inspirations.modern;
|
|
768
|
+
}
|
|
769
|
+
getBackgroundSuggestion(colorScheme, theme) {
|
|
770
|
+
const backgrounds = {
|
|
771
|
+
'vibrant': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
772
|
+
'pastel': 'linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%)',
|
|
773
|
+
'monochrome': 'linear-gradient(135deg, #2c3e50 0%, #34495e 100%)',
|
|
774
|
+
'neon': 'radial-gradient(circle, #0f0f23 0%, #000000 100%)',
|
|
775
|
+
'earth': 'linear-gradient(135deg, #8B4513 0%, #228B22 100%)',
|
|
776
|
+
'sunset': 'linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%)',
|
|
777
|
+
'ocean': 'linear-gradient(135deg, #667db6 0%, #0082c8 100%)'
|
|
778
|
+
};
|
|
779
|
+
return backgrounds[colorScheme] || backgrounds.vibrant;
|
|
780
|
+
}
|
|
781
|
+
getPrimaryColor(colorScheme) {
|
|
782
|
+
const colors = {
|
|
783
|
+
'vibrant': '#ff6b6b',
|
|
784
|
+
'pastel': '#ffeaa7',
|
|
785
|
+
'monochrome': '#2d3436',
|
|
786
|
+
'neon': '#00f0ff',
|
|
787
|
+
'earth': '#8b4513',
|
|
788
|
+
'sunset': '#ff7675',
|
|
789
|
+
'ocean': '#0984e3'
|
|
790
|
+
};
|
|
791
|
+
return colors[colorScheme] || colors.vibrant;
|
|
792
|
+
}
|
|
793
|
+
getSecondaryColor(colorScheme) {
|
|
794
|
+
const colors = {
|
|
795
|
+
'vibrant': '#4ecdc4',
|
|
796
|
+
'pastel': '#fab1a0',
|
|
797
|
+
'monochrome': '#636e72',
|
|
798
|
+
'neon': '#ff00ff',
|
|
799
|
+
'earth': '#228b22',
|
|
800
|
+
'sunset': '#fd79a8',
|
|
801
|
+
'ocean': '#00cec9'
|
|
802
|
+
};
|
|
803
|
+
return colors[colorScheme] || colors.vibrant;
|
|
804
|
+
}
|
|
805
|
+
getAccentColor(colorScheme) {
|
|
806
|
+
const colors = {
|
|
807
|
+
'vibrant': '#ffe66d',
|
|
808
|
+
'pastel': '#81ecec',
|
|
809
|
+
'monochrome': '#ddd',
|
|
810
|
+
'neon': '#39ff14',
|
|
811
|
+
'earth': '#d2691e',
|
|
812
|
+
'sunset': '#fdcb6e',
|
|
813
|
+
'ocean': '#74b9ff'
|
|
814
|
+
};
|
|
815
|
+
return colors[colorScheme] || colors.vibrant;
|
|
816
|
+
}
|
|
817
|
+
getFileExtensions(analysisType) {
|
|
818
|
+
const extensionMap = {
|
|
819
|
+
'showcase': ['.html', '.css'],
|
|
820
|
+
'educational': ['.html', '.css', '.md'],
|
|
821
|
+
'comprehensive': ['.html', '.css', '.md', '.js']
|
|
822
|
+
};
|
|
823
|
+
return extensionMap[analysisType] || extensionMap.comprehensive;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
export default CSSArtGenerator;
|
|
827
|
+
//# sourceMappingURL=css-art-generator.js.map
|