@vee-stack/delta-cli 2.0.8 → 2.0.10

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.
Files changed (183) hide show
  1. package/dist/adapters/analysis.adapter.d.ts +29 -0
  2. package/dist/analyzer/commands/analyze.d.ts +14 -0
  3. package/dist/analyzer/commands/config.d.ts +12 -0
  4. package/dist/analyzer/commands/report.d.ts +11 -0
  5. package/dist/analyzer/generators/report.generator.d.ts +43 -0
  6. package/dist/analyzer/index.d.ts +8 -0
  7. package/dist/analyzer/scanners/project.scanner.d.ts +29 -0
  8. package/dist/analyzer/validators/contracts.validator.d.ts +27 -0
  9. package/dist/analyzer/validators/maintainability.validator.d.ts +27 -0
  10. package/dist/analyzer/validators/observability.validator.d.ts +27 -0
  11. package/dist/analyzer/validators/performance.validator.d.ts +27 -0
  12. package/dist/analyzer/validators/security.validator.d.ts +27 -0
  13. package/dist/analyzer/validators/soc.validator.d.ts +27 -0
  14. package/dist/auth/device-auth.d.ts +18 -0
  15. package/dist/auth/secure-auth.d.ts +35 -0
  16. package/dist/bundle.mjs +422 -0
  17. package/dist/commands/analyze.d.ts +12 -0
  18. package/dist/commands/auth-new.d.ts +6 -0
  19. package/dist/commands/auth.d.ts +17 -0
  20. package/dist/commands/config.d.ts +8 -0
  21. package/dist/commands/deploy.d.ts +5 -0
  22. package/dist/commands/init.d.ts +7 -0
  23. package/dist/commands/logout.d.ts +2 -0
  24. package/dist/commands/plugins.d.ts +7 -0
  25. package/dist/commands/status.d.ts +5 -0
  26. package/dist/commands/sync.d.ts +5 -0
  27. package/dist/commands/whoami.d.ts +4 -0
  28. package/dist/components/Dashboard.d.ts +8 -0
  29. package/dist/components/DeltaApp.d.ts +13 -0
  30. package/dist/components/UnifiedManager.d.ts +10 -0
  31. package/dist/core/audit.d.ts +60 -0
  32. package/dist/core/completion.d.ts +79 -0
  33. package/dist/core/contracts.d.ts +127 -0
  34. package/dist/core/engine.d.ts +26 -0
  35. package/dist/core/exit-codes.d.ts +19 -0
  36. package/dist/core/hooks.d.ts +50 -0
  37. package/dist/{apps/cli/src/core/index.js → core/index.d.ts} +1 -1
  38. package/dist/core/policy.d.ts +24 -0
  39. package/dist/core/profiles.d.ts +45 -0
  40. package/dist/core/wizard.d.ts +28 -0
  41. package/dist/interactive/index.d.ts +5 -0
  42. package/dist/plugins/GitStatusPlugin.d.ts +25 -0
  43. package/dist/providers/ai-provider.d.ts +21 -0
  44. package/dist/providers/local-provider.d.ts +21 -0
  45. package/dist/providers/remote-provider.d.ts +15 -0
  46. package/dist/telemetry/wrapper.d.ts +18 -0
  47. package/dist/types/api.d.ts +46 -0
  48. package/dist/ui.d.ts +52 -0
  49. package/dist/welcome.d.ts +8 -0
  50. package/package.json +8 -8
  51. package/dist/analyzer/commands/analyze.js +0 -260
  52. package/dist/analyzer/commands/config.js +0 -83
  53. package/dist/analyzer/commands/report.js +0 -38
  54. package/dist/analyzer/generators/report.generator.js +0 -123
  55. package/dist/analyzer/index.js +0 -44
  56. package/dist/analyzer/scanners/project.scanner.js +0 -92
  57. package/dist/analyzer/validators/contracts.validator.js +0 -42
  58. package/dist/analyzer/validators/maintainability.validator.js +0 -40
  59. package/dist/analyzer/validators/observability.validator.js +0 -39
  60. package/dist/analyzer/validators/performance.validator.js +0 -42
  61. package/dist/analyzer/validators/security.validator.js +0 -66
  62. package/dist/analyzer/validators/soc.validator.js +0 -75
  63. package/dist/apps/cli/src/analyzer/commands/analyze.js +0 -256
  64. package/dist/apps/cli/src/analyzer/commands/config.js +0 -83
  65. package/dist/apps/cli/src/analyzer/commands/report.js +0 -38
  66. package/dist/apps/cli/src/analyzer/generators/report.generator.js +0 -123
  67. package/dist/apps/cli/src/analyzer/index.js +0 -44
  68. package/dist/apps/cli/src/analyzer/scanners/project.scanner.js +0 -92
  69. package/dist/apps/cli/src/analyzer/validators/contracts.validator.js +0 -42
  70. package/dist/apps/cli/src/analyzer/validators/maintainability.validator.js +0 -40
  71. package/dist/apps/cli/src/analyzer/validators/observability.validator.js +0 -39
  72. package/dist/apps/cli/src/analyzer/validators/performance.validator.js +0 -42
  73. package/dist/apps/cli/src/analyzer/validators/security.validator.js +0 -66
  74. package/dist/apps/cli/src/analyzer/validators/soc.validator.js +0 -75
  75. package/dist/apps/cli/src/auth/secure-auth.js +0 -312
  76. package/dist/apps/cli/src/commands/analyze.js +0 -286
  77. package/dist/apps/cli/src/commands/auth-new.js +0 -37
  78. package/dist/apps/cli/src/commands/auth.js +0 -122
  79. package/dist/apps/cli/src/commands/config.js +0 -49
  80. package/dist/apps/cli/src/commands/deploy.js +0 -6
  81. package/dist/apps/cli/src/commands/init.js +0 -47
  82. package/dist/apps/cli/src/commands/logout.js +0 -23
  83. package/dist/apps/cli/src/commands/plugins.js +0 -21
  84. package/dist/apps/cli/src/commands/status.js +0 -80
  85. package/dist/apps/cli/src/commands/sync.js +0 -6
  86. package/dist/apps/cli/src/commands/whoami.js +0 -115
  87. package/dist/apps/cli/src/components/Dashboard.js +0 -168
  88. package/dist/apps/cli/src/components/DeltaApp.js +0 -56
  89. package/dist/apps/cli/src/components/UnifiedManager.js +0 -324
  90. package/dist/apps/cli/src/core/audit.js +0 -184
  91. package/dist/apps/cli/src/core/completion.js +0 -294
  92. package/dist/apps/cli/src/core/contracts.js +0 -6
  93. package/dist/apps/cli/src/core/engine.js +0 -124
  94. package/dist/apps/cli/src/core/exit-codes.js +0 -71
  95. package/dist/apps/cli/src/core/hooks.js +0 -181
  96. package/dist/apps/cli/src/core/policy.js +0 -115
  97. package/dist/apps/cli/src/core/profiles.js +0 -161
  98. package/dist/apps/cli/src/core/wizard.js +0 -203
  99. package/dist/apps/cli/src/index.js +0 -636
  100. package/dist/apps/cli/src/interactive/index.js +0 -11
  101. package/dist/apps/cli/src/plugins/GitStatusPlugin.js +0 -99
  102. package/dist/apps/cli/src/providers/ai-provider.js +0 -74
  103. package/dist/apps/cli/src/providers/local-provider.js +0 -302
  104. package/dist/apps/cli/src/providers/remote-provider.js +0 -100
  105. package/dist/apps/cli/src/types/api.js +0 -3
  106. package/dist/apps/cli/src/ui.js +0 -219
  107. package/dist/apps/cli/src/welcome.js +0 -81
  108. package/dist/auth/secure-auth.js +0 -372
  109. package/dist/bundle.js +0 -504
  110. package/dist/commands/analyze.js +0 -390
  111. package/dist/commands/auth-new.js +0 -37
  112. package/dist/commands/auth.js +0 -134
  113. package/dist/commands/config.js +0 -51
  114. package/dist/commands/deploy.js +0 -6
  115. package/dist/commands/init.js +0 -47
  116. package/dist/commands/logout.js +0 -31
  117. package/dist/commands/plugins.js +0 -21
  118. package/dist/commands/status.js +0 -82
  119. package/dist/commands/sync.js +0 -6
  120. package/dist/commands/whoami.js +0 -72
  121. package/dist/components/Dashboard.js +0 -169
  122. package/dist/components/DeltaApp.js +0 -57
  123. package/dist/components/UnifiedManager.js +0 -344
  124. package/dist/core/audit.js +0 -184
  125. package/dist/core/completion.js +0 -294
  126. package/dist/core/contracts.js +0 -6
  127. package/dist/core/engine.js +0 -124
  128. package/dist/core/exit-codes.js +0 -71
  129. package/dist/core/hooks.js +0 -181
  130. package/dist/core/index.js +0 -7
  131. package/dist/core/policy.js +0 -115
  132. package/dist/core/profiles.js +0 -161
  133. package/dist/core/wizard.js +0 -203
  134. package/dist/index.js +0 -387
  135. package/dist/interactive/index.js +0 -11
  136. package/dist/packages/domain/src/constitution/contracts/index.js +0 -43
  137. package/dist/packages/domain/src/constitution/contracts/ts.rules.js +0 -268
  138. package/dist/packages/domain/src/constitution/index.js +0 -139
  139. package/dist/packages/domain/src/constitution/maintainability/index.js +0 -43
  140. package/dist/packages/domain/src/constitution/maintainability/ts.rules.js +0 -344
  141. package/dist/packages/domain/src/constitution/observability/index.js +0 -43
  142. package/dist/packages/domain/src/constitution/observability/ts.rules.js +0 -307
  143. package/dist/packages/domain/src/constitution/performance/index.js +0 -43
  144. package/dist/packages/domain/src/constitution/performance/ts.rules.js +0 -325
  145. package/dist/packages/domain/src/constitution/security/index.js +0 -50
  146. package/dist/packages/domain/src/constitution/security/ts.rules.js +0 -267
  147. package/dist/packages/domain/src/constitution/soc/index.js +0 -43
  148. package/dist/packages/domain/src/constitution/soc/ts.rules.js +0 -360
  149. package/dist/packages/domain/src/contracts/analysis.contract.js +0 -18
  150. package/dist/packages/domain/src/contracts/index.js +0 -7
  151. package/dist/packages/domain/src/contracts/projects.contract.js +0 -18
  152. package/dist/packages/domain/src/control/registry/rules.registry.js +0 -29
  153. package/dist/packages/domain/src/control/schemas/policies.js +0 -6
  154. package/dist/packages/domain/src/core/analysis/discovery.js +0 -163
  155. package/dist/packages/domain/src/core/analysis/engine.contract.js +0 -298
  156. package/dist/packages/domain/src/core/analysis/engine.js +0 -77
  157. package/dist/packages/domain/src/core/analysis/index.js +0 -14
  158. package/dist/packages/domain/src/core/analysis/orchestrator.js +0 -242
  159. package/dist/packages/domain/src/core/comparison/engine.js +0 -29
  160. package/dist/packages/domain/src/core/comparison/index.js +0 -5
  161. package/dist/packages/domain/src/core/documentation/index.js +0 -5
  162. package/dist/packages/domain/src/core/documentation/pipeline.js +0 -41
  163. package/dist/packages/domain/src/core/fs/adapter.js +0 -111
  164. package/dist/packages/domain/src/core/fs/index.js +0 -5
  165. package/dist/packages/domain/src/core/parser/unified-parser.js +0 -166
  166. package/dist/packages/domain/src/index.js +0 -33
  167. package/dist/packages/domain/src/plugin/registry.js +0 -195
  168. package/dist/packages/domain/src/plugin/types.js +0 -6
  169. package/dist/packages/domain/src/ports/analysis.engine.js +0 -7
  170. package/dist/packages/domain/src/ports/audit.logger.js +0 -7
  171. package/dist/packages/domain/src/ports/project.repository.js +0 -7
  172. package/dist/packages/domain/src/rules/index.js +0 -134
  173. package/dist/packages/domain/src/types/analysis.js +0 -6
  174. package/dist/packages/domain/src/types/errors.js +0 -53
  175. package/dist/packages/domain/src/types/fs.js +0 -6
  176. package/dist/packages/domain/src/types/index.js +0 -7
  177. package/dist/plugins/GitStatusPlugin.js +0 -93
  178. package/dist/providers/ai-provider.js +0 -74
  179. package/dist/providers/local-provider.js +0 -304
  180. package/dist/providers/remote-provider.js +0 -100
  181. package/dist/types/api.js +0 -3
  182. package/dist/ui.js +0 -219
  183. package/dist/welcome.js +0 -81
@@ -1,115 +0,0 @@
1
- /**
2
- * Default Execution Policy
3
- * Determines how tasks are executed and which provider to use
4
- */
5
- import { ExitCode } from './exit-codes.js';
6
- export class DefaultExecutionPolicy {
7
- config;
8
- constructor(config) {
9
- this.config = config;
10
- }
11
- // Validate if a task can be executed
12
- validate(request) {
13
- // Check if provider is specified and valid
14
- if (request.options.provider) {
15
- const allowedProviders = ['local', 'remote', 'ai'];
16
- if (!allowedProviders.includes(request.options.provider)) {
17
- return {
18
- valid: false,
19
- reason: `Invalid provider '${request.options.provider}'. Allowed: local, remote, ai`,
20
- exitCode: ExitCode.VALIDATION_ERROR,
21
- };
22
- }
23
- // Check if AI is requested but not available
24
- if (request.options.provider === 'ai' && !this.config.providers.ai?.enabled) {
25
- return {
26
- valid: false,
27
- reason: 'AI provider is not enabled. Use --provider=local or --provider=remote',
28
- exitCode: ExitCode.POLICY_BLOCKED,
29
- };
30
- }
31
- }
32
- // Validate task type
33
- const validTypes = ['analyze', 'init', 'status', 'sync', 'deploy', 'config', 'auth', 'plugin'];
34
- if (!validTypes.includes(request.type)) {
35
- return {
36
- valid: false,
37
- reason: `Invalid task type '${request.type}'`,
38
- exitCode: ExitCode.VALIDATION_ERROR,
39
- };
40
- }
41
- return { valid: true };
42
- }
43
- // Select appropriate provider for a task
44
- selectProvider(request, providers) {
45
- // If user explicitly specified a provider, use it
46
- if (request.options.provider) {
47
- const provider = providers.get(request.options.provider);
48
- if (provider && provider.capabilities.commands.includes(request.type)) {
49
- return provider;
50
- }
51
- return null;
52
- }
53
- // Auto-select based on task type and availability
54
- const preferredProvider = this.getPreferredProvider(request.type);
55
- const provider = providers.get(preferredProvider);
56
- if (provider && provider.capabilities.commands.includes(request.type)) {
57
- return provider;
58
- }
59
- // Fallback to any provider that supports this command
60
- for (const [, provider] of providers) {
61
- if (provider.capabilities.commands.includes(request.type)) {
62
- return provider;
63
- }
64
- }
65
- return null;
66
- }
67
- // Get preferred provider based on task type
68
- getPreferredProvider(taskType) {
69
- switch (taskType) {
70
- case 'analyze':
71
- // Prefer remote for heavy analysis if available
72
- if (this.config.providers.remote?.enabled) {
73
- return 'remote';
74
- }
75
- return 'local';
76
- case 'sync':
77
- case 'deploy':
78
- // These require remote/cloud
79
- if (this.config.providers.remote?.enabled) {
80
- return 'remote';
81
- }
82
- return 'local';
83
- case 'init':
84
- case 'status':
85
- case 'config':
86
- case 'auth':
87
- default:
88
- // Default to local for simple operations
89
- return 'local';
90
- }
91
- }
92
- // Transform request before execution
93
- transform(request) {
94
- // Add non-interactive mode detection
95
- const isNonTTY = !process.stdout.isTTY;
96
- if (isNonTTY && !request.options.json) {
97
- // Force JSON output in non-TTY mode for better piping
98
- return {
99
- ...request,
100
- options: {
101
- ...request.options,
102
- nonInteractive: true,
103
- json: true,
104
- },
105
- };
106
- }
107
- return request;
108
- }
109
- // Check if user has capability to execute (placeholder for future auth checks)
110
- checkCapabilities(_request) {
111
- // For now, always allow
112
- return { allowed: true };
113
- }
114
- }
115
- //# sourceMappingURL=policy.js.map
@@ -1,161 +0,0 @@
1
- /**
2
- * Profile Management System
3
- * Manage multiple environments: dev, staging, prod
4
- * Auto-select provider and settings based on active profile
5
- */
6
- import { promises as fs } from 'fs';
7
- import { homedir } from 'os';
8
- import { join } from 'path';
9
- const PROFILES_FILE = join(homedir(), '.delta', 'profiles.json');
10
- const DEFAULT_PROFILES = {
11
- dev: {
12
- name: 'dev',
13
- provider: 'local',
14
- timeout: 30000,
15
- retries: 1,
16
- features: {
17
- analytics: false,
18
- caching: false,
19
- autoSync: false,
20
- },
21
- env: {
22
- NODE_ENV: 'development',
23
- DELTA_LOG_LEVEL: 'debug',
24
- },
25
- },
26
- staging: {
27
- name: 'staging',
28
- provider: 'remote',
29
- apiUrl: 'https://api-staging.delta.dev',
30
- timeout: 60000,
31
- retries: 2,
32
- features: {
33
- analytics: true,
34
- caching: true,
35
- autoSync: true,
36
- },
37
- env: {
38
- NODE_ENV: 'staging',
39
- DELTA_LOG_LEVEL: 'info',
40
- },
41
- },
42
- prod: {
43
- name: 'prod',
44
- provider: 'remote',
45
- apiUrl: 'https://api.delta.dev',
46
- timeout: 120000,
47
- retries: 3,
48
- features: {
49
- analytics: true,
50
- caching: true,
51
- autoSync: true,
52
- },
53
- env: {
54
- NODE_ENV: 'production',
55
- DELTA_LOG_LEVEL: 'warn',
56
- },
57
- },
58
- };
59
- export class ProfileManager {
60
- data;
61
- loaded = false;
62
- constructor() {
63
- this.data = {
64
- activeProfile: 'dev',
65
- profiles: { ...DEFAULT_PROFILES },
66
- };
67
- }
68
- async load() {
69
- if (this.loaded)
70
- return;
71
- try {
72
- const data = await fs.readFile(PROFILES_FILE, 'utf-8');
73
- const parsed = JSON.parse(data);
74
- this.data = {
75
- activeProfile: parsed.activeProfile || 'dev',
76
- profiles: { ...DEFAULT_PROFILES, ...parsed.profiles },
77
- };
78
- }
79
- catch {
80
- // Use defaults
81
- await this.save();
82
- }
83
- this.loaded = true;
84
- }
85
- async save() {
86
- await fs.mkdir(join(homedir(), '.delta'), { recursive: true });
87
- await fs.writeFile(PROFILES_FILE, JSON.stringify(this.data, null, 2), 'utf-8');
88
- }
89
- getActiveProfile() {
90
- return this.data.profiles[this.data.activeProfile] || this.data.profiles.dev;
91
- }
92
- getProfile(name) {
93
- return this.data.profiles[name];
94
- }
95
- async setActiveProfile(name) {
96
- if (!this.data.profiles[name]) {
97
- throw new Error(`Profile '${name}' not found. Create it first.`);
98
- }
99
- this.data.activeProfile = name;
100
- await this.save();
101
- }
102
- async createProfile(name, config) {
103
- this.data.profiles[name] = {
104
- name,
105
- provider: config.provider || 'local',
106
- apiUrl: config.apiUrl,
107
- apiKey: config.apiKey,
108
- timeout: config.timeout || 30000,
109
- retries: config.retries || 1,
110
- features: config.features || { analytics: false, caching: false, autoSync: false },
111
- env: config.env || {},
112
- };
113
- await this.save();
114
- }
115
- async deleteProfile(name) {
116
- if (name === this.data.activeProfile) {
117
- throw new Error('Cannot delete active profile');
118
- }
119
- if (DEFAULT_PROFILES[name]) {
120
- throw new Error(`Cannot delete default profile '${name}'`);
121
- }
122
- delete this.data.profiles[name];
123
- await this.save();
124
- }
125
- listProfiles() {
126
- return Object.keys(this.data.profiles).map(name => ({
127
- name,
128
- active: name === this.data.activeProfile,
129
- provider: this.data.profiles[name].provider,
130
- }));
131
- }
132
- applyToEnvironment() {
133
- const profile = this.getActiveProfile();
134
- // Apply environment variables
135
- for (const [key, value] of Object.entries(profile.env)) {
136
- process.env[key] = value;
137
- }
138
- // Set provider preference
139
- process.env.DELTA_PROVIDER = profile.provider;
140
- if (profile.apiUrl) {
141
- process.env.DELTA_API_URL = profile.apiUrl;
142
- }
143
- }
144
- getProviderForCommand(command) {
145
- const profile = this.getActiveProfile();
146
- // Some commands should always use local in dev
147
- if (profile.name === 'dev' && ['init', 'config', 'status'].includes(command)) {
148
- return 'local';
149
- }
150
- return profile.provider;
151
- }
152
- }
153
- // Singleton instance
154
- let profileManager = null;
155
- export function getProfileManager() {
156
- if (!profileManager) {
157
- profileManager = new ProfileManager();
158
- }
159
- return profileManager;
160
- }
161
- //# sourceMappingURL=profiles.js.map
@@ -1,203 +0,0 @@
1
- /**
2
- * Interactive Wizard Mode
3
- * Step-by-step guided experience for complex commands
4
- */
5
- import prompts from 'prompts';
6
- import chalk from 'chalk';
7
- // Init Wizard Steps
8
- const initWizardSteps = [
9
- {
10
- name: 'projectName',
11
- message: 'What is your project name?',
12
- type: 'text',
13
- initial: 'my-delta-project',
14
- validate: (value) => value.length > 0 || 'Project name is required',
15
- },
16
- {
17
- name: 'template',
18
- message: 'Choose a project template:',
19
- type: 'select',
20
- choices: [
21
- { title: 'Default', value: 'default', description: 'Basic Delta project structure' },
22
- { title: 'Next.js', value: 'nextjs', description: 'Next.js app with Delta integration' },
23
- { title: 'React', value: 'react', description: 'React SPA with Delta support' },
24
- { title: 'Node.js', value: 'node', description: 'Node.js backend service' },
25
- { title: 'Python', value: 'python', description: 'Python project with Delta CLI' },
26
- ],
27
- },
28
- {
29
- name: 'features',
30
- message: 'Select features to enable:',
31
- type: 'multiselect',
32
- choices: [
33
- { title: 'Code Analysis', value: 'analysis', description: 'Auto-analyze on commits' },
34
- { title: 'Documentation', value: 'docs', description: 'Auto-generate docs' },
35
- { title: 'CI/CD Config', value: 'cicd', description: 'GitHub Actions workflow' },
36
- { title: 'Docker', value: 'docker', description: 'Docker configuration' },
37
- { title: 'TypeScript', value: 'typescript', description: 'TypeScript setup' },
38
- ],
39
- },
40
- {
41
- name: 'initializeGit',
42
- message: 'Initialize Git repository?',
43
- type: 'confirm',
44
- initial: true,
45
- },
46
- {
47
- name: 'installDependencies',
48
- message: 'Install dependencies now?',
49
- type: 'confirm',
50
- initial: true,
51
- },
52
- ];
53
- // Run Init Wizard
54
- export async function runInitWizard() {
55
- console.log(chalk.bold.cyan('\nšŸš€ Delta Project Wizard\n'));
56
- console.log(chalk.gray('Answer a few questions to set up your project.\n'));
57
- const answers = {};
58
- for (const step of initWizardSteps) {
59
- const response = await prompts({
60
- type: step.type,
61
- name: step.name,
62
- message: step.message,
63
- choices: step.choices,
64
- initial: step.initial,
65
- validate: step.validate,
66
- }, {
67
- onCancel: () => {
68
- console.log(chalk.yellow('\nāš ļø Wizard cancelled'));
69
- process.exit(0);
70
- },
71
- });
72
- answers[step.name] = response[step.name];
73
- }
74
- // Derive project path from name
75
- const projectPath = `./${answers.projectName}`;
76
- return {
77
- projectName: answers.projectName,
78
- projectPath,
79
- template: answers.template,
80
- initializeGit: answers.initializeGit,
81
- installDependencies: answers.installDependencies,
82
- features: answers.features || [],
83
- };
84
- }
85
- // Execute wizard actions
86
- export async function executeWizardActions(result) {
87
- console.log(chalk.bold.cyan('\nšŸ“¦ Creating Project...\n'));
88
- const steps = [
89
- { name: 'Creating directory', action: () => `mkdir -p ${result.projectPath}` },
90
- { name: 'Writing config', action: () => 'config' },
91
- { name: 'Setting up template', action: () => result.template },
92
- ];
93
- if (result.initializeGit) {
94
- steps.push({ name: 'Initializing Git', action: () => 'git init' });
95
- }
96
- if (result.features.includes('docker')) {
97
- steps.push({ name: 'Creating Dockerfile', action: () => 'docker' });
98
- }
99
- if (result.features.includes('cicd')) {
100
- steps.push({ name: 'Creating CI/CD workflow', action: () => 'cicd' });
101
- }
102
- // Simulate progress
103
- for (let i = 0; i < steps.length; i++) {
104
- const step = steps[i];
105
- process.stdout.write(chalk.gray(` [${i + 1}/${steps.length}] ${step.name}... `));
106
- // Simulate work
107
- await new Promise(resolve => setTimeout(resolve, 300));
108
- console.log(chalk.green('āœ“'));
109
- }
110
- // Summary
111
- console.log(chalk.bold.green('\nāœ… Project created successfully!\n'));
112
- console.log(chalk.cyan('Next steps:'));
113
- console.log(chalk.gray(` cd ${result.projectPath}`));
114
- console.log(chalk.gray(' delta /analyze # Analyze your code'));
115
- console.log(chalk.gray(' delta /status # Check project status'));
116
- console.log();
117
- }
118
- // Quick wizard for other commands
119
- export async function runQuickWizard(command) {
120
- switch (command) {
121
- case 'analyze':
122
- return runAnalyzeWizard();
123
- case 'deploy':
124
- return runDeployWizard();
125
- default:
126
- return null;
127
- }
128
- }
129
- async function runAnalyzeWizard() {
130
- console.log(chalk.bold.cyan('\nšŸ” Analysis Wizard\n'));
131
- const response = await prompts([
132
- {
133
- type: 'text',
134
- name: 'path',
135
- message: 'Path to analyze?',
136
- initial: '.',
137
- },
138
- {
139
- type: 'multiselect',
140
- name: 'scans',
141
- message: 'Select scans to run:',
142
- choices: [
143
- { title: 'Security', value: 'security', selected: true },
144
- { title: 'Performance', value: 'performance', selected: true },
145
- { title: 'Code Quality', value: 'quality', selected: true },
146
- { title: 'AI Insights', value: 'ai', selected: false },
147
- ],
148
- hint: 'Space to select, Enter to confirm',
149
- },
150
- {
151
- type: 'select',
152
- name: 'format',
153
- message: 'Output format?',
154
- choices: [
155
- { title: 'JSON', value: 'json' },
156
- { title: 'HTML Report', value: 'html' },
157
- { title: 'Markdown', value: 'markdown' },
158
- ],
159
- initial: 0,
160
- },
161
- ], {
162
- onCancel: () => {
163
- console.log(chalk.yellow('\nāš ļø Wizard cancelled'));
164
- process.exit(0);
165
- },
166
- });
167
- return response;
168
- }
169
- async function runDeployWizard() {
170
- console.log(chalk.bold.cyan('\nšŸš€ Deploy Wizard\n'));
171
- const response = await prompts([
172
- {
173
- type: 'select',
174
- name: 'target',
175
- message: 'Deploy target?',
176
- choices: [
177
- { title: 'Delta Cloud', value: 'delta' },
178
- { title: 'Vercel', value: 'vercel' },
179
- { title: 'Netlify', value: 'netlify' },
180
- { title: 'Custom Server', value: 'custom' },
181
- ],
182
- },
183
- {
184
- type: 'confirm',
185
- name: 'buildFirst',
186
- message: 'Build before deploy?',
187
- initial: true,
188
- },
189
- {
190
- type: 'confirm',
191
- name: 'runTests',
192
- message: 'Run tests before deploy?',
193
- initial: true,
194
- },
195
- ], {
196
- onCancel: () => {
197
- console.log(chalk.yellow('\nāš ļø Wizard cancelled'));
198
- process.exit(0);
199
- },
200
- });
201
- return response;
202
- }
203
- //# sourceMappingURL=wizard.js.map