@vee-stack/delta-cli 2.0.9 → 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 (98) 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/core/{index.js → 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 -10
  51. package/dist/adapters/analysis.adapter.js +0 -42
  52. package/dist/analyzer/commands/analyze.js +0 -220
  53. package/dist/analyzer/commands/config.js +0 -83
  54. package/dist/analyzer/commands/report.js +0 -38
  55. package/dist/analyzer/generators/report.generator.js +0 -123
  56. package/dist/analyzer/index.js +0 -44
  57. package/dist/analyzer/scanners/project.scanner.js +0 -92
  58. package/dist/analyzer/validators/contracts.validator.js +0 -42
  59. package/dist/analyzer/validators/maintainability.validator.js +0 -40
  60. package/dist/analyzer/validators/observability.validator.js +0 -39
  61. package/dist/analyzer/validators/performance.validator.js +0 -42
  62. package/dist/analyzer/validators/security.validator.js +0 -66
  63. package/dist/analyzer/validators/soc.validator.js +0 -75
  64. package/dist/auth/device-auth.js +0 -261
  65. package/dist/auth/secure-auth.js +0 -401
  66. package/dist/commands/analyze.js +0 -393
  67. package/dist/commands/auth-new.js +0 -37
  68. package/dist/commands/auth.js +0 -131
  69. package/dist/commands/config.js +0 -51
  70. package/dist/commands/deploy.js +0 -6
  71. package/dist/commands/init.js +0 -47
  72. package/dist/commands/logout.js +0 -31
  73. package/dist/commands/plugins.js +0 -21
  74. package/dist/commands/status.js +0 -82
  75. package/dist/commands/sync.js +0 -6
  76. package/dist/commands/whoami.js +0 -72
  77. package/dist/components/Dashboard.js +0 -167
  78. package/dist/components/DeltaApp.js +0 -57
  79. package/dist/components/UnifiedManager.js +0 -372
  80. package/dist/core/audit.js +0 -184
  81. package/dist/core/completion.js +0 -305
  82. package/dist/core/contracts.js +0 -6
  83. package/dist/core/engine.js +0 -130
  84. package/dist/core/exit-codes.js +0 -79
  85. package/dist/core/hooks.js +0 -181
  86. package/dist/core/policy.js +0 -115
  87. package/dist/core/profiles.js +0 -161
  88. package/dist/core/wizard.js +0 -203
  89. package/dist/index.js +0 -403
  90. package/dist/interactive/index.js +0 -11
  91. package/dist/plugins/GitStatusPlugin.js +0 -93
  92. package/dist/providers/ai-provider.js +0 -74
  93. package/dist/providers/local-provider.js +0 -304
  94. package/dist/providers/remote-provider.js +0 -100
  95. package/dist/telemetry/wrapper.js +0 -114
  96. package/dist/types/api.js +0 -3
  97. package/dist/ui.js +0 -226
  98. package/dist/welcome.js +0 -91
@@ -1,181 +0,0 @@
1
- /**
2
- * Hooks & Notifications System
3
- * Post-command hooks for Slack, Teams, Webhooks
4
- * Enterprise CI/CD integration
5
- */
6
- import { promises as fs } from 'fs';
7
- import { homedir } from 'os';
8
- import { join } from 'path';
9
- const HOOKS_FILE = join(homedir(), '.delta', 'hooks.json');
10
- export class HookManager {
11
- hooks = [];
12
- loaded = false;
13
- async load() {
14
- if (this.loaded)
15
- return;
16
- try {
17
- const data = await fs.readFile(HOOKS_FILE, 'utf-8');
18
- this.hooks = JSON.parse(data);
19
- }
20
- catch {
21
- this.hooks = [];
22
- }
23
- this.loaded = true;
24
- }
25
- async save() {
26
- await fs.mkdir(join(homedir(), '.delta'), { recursive: true });
27
- await fs.writeFile(HOOKS_FILE, JSON.stringify(this.hooks, null, 2), 'utf-8');
28
- }
29
- async addHook(hook) {
30
- const newHook = {
31
- ...hook,
32
- id: `hook-${Date.now()}`,
33
- };
34
- this.hooks.push(newHook);
35
- await this.save();
36
- return newHook;
37
- }
38
- async removeHook(id) {
39
- this.hooks = this.hooks.filter(h => h.id !== id);
40
- await this.save();
41
- }
42
- async listHooks() {
43
- await this.load();
44
- return this.hooks;
45
- }
46
- async toggleHook(id) {
47
- const hook = this.hooks.find(h => h.id === id);
48
- if (hook) {
49
- hook.enabled = !hook.enabled;
50
- await this.save();
51
- }
52
- }
53
- async executeHooks(type, command, response, startTime) {
54
- await this.load();
55
- const matchingHooks = this.hooks.filter(h => h.enabled && h.type === type && (!h.command || h.command === command));
56
- const payload = {
57
- command,
58
- success: response.success,
59
- exitCode: response.exitCode || (response.success ? 0 : 1),
60
- duration: Date.now() - startTime,
61
- timestamp: new Date().toISOString(),
62
- project: process.env.DELTA_PROJECT,
63
- user: process.env.USER || process.env.USERNAME,
64
- error: response.error?.message,
65
- summary: this.generateSummary(command, response),
66
- };
67
- // Execute hooks in parallel
68
- await Promise.all(matchingHooks.map(hook => this.sendNotification(hook, payload).catch(() => { })));
69
- }
70
- async sendNotification(hook, payload) {
71
- const body = hook.payload
72
- ? this.renderTemplate(hook.payload, payload)
73
- : JSON.stringify(payload);
74
- const response = await fetch(hook.url, {
75
- method: hook.method,
76
- headers: {
77
- 'Content-Type': 'application/json',
78
- ...hook.headers,
79
- },
80
- body: hook.method === 'POST' ? body : undefined,
81
- });
82
- if (!response.ok) {
83
- throw new Error(`Hook failed: ${response.status}`);
84
- }
85
- }
86
- renderTemplate(template, payload) {
87
- return template
88
- .replace(/\{\{command\}\}/g, payload.command)
89
- .replace(/\{\{success\}\}/g, payload.success ? 'success' : 'failed')
90
- .replace(/\{\{exitCode\}\}/g, String(payload.exitCode))
91
- .replace(/\{\{duration\}\}/g, String(payload.duration))
92
- .replace(/\{\{project\}\}/g, payload.project || 'unknown')
93
- .replace(/\{\{user\}\}/g, payload.user || 'unknown');
94
- }
95
- generateSummary(command, response) {
96
- switch (command) {
97
- case 'analyze':
98
- return response.success
99
- ? `Analyzed ${response.data?.filesAnalyzed || 0} files, found ${response.data?.findings || 0} issues`
100
- : 'Analysis failed';
101
- case 'deploy':
102
- return response.success ? 'Deployment successful' : 'Deployment failed';
103
- default:
104
- return response.success ? 'Command completed' : 'Command failed';
105
- }
106
- }
107
- }
108
- // Predefined templates for common services
109
- export const hookTemplates = {
110
- slack: (webhookUrl) => ({
111
- name: 'Slack Notifications',
112
- type: 'post-always',
113
- url: webhookUrl,
114
- method: 'POST',
115
- headers: {},
116
- payload: JSON.stringify({
117
- text: 'Delta CLI: {{command}} {{success}}',
118
- blocks: [
119
- {
120
- type: 'section',
121
- text: {
122
- type: 'mrkdwn',
123
- text: '*Delta CLI Notification*',
124
- },
125
- },
126
- {
127
- type: 'section',
128
- fields: [
129
- { type: 'mrkdwn', text: `*Command:*\n{{command}}` },
130
- { type: 'mrkdwn', text: `*Status:*\n{{success}}` },
131
- { type: 'mrkdwn', text: `*Duration:*\n{{duration}}ms` },
132
- { type: 'mrkdwn', text: `*Project:*\n{{project}}` },
133
- ],
134
- },
135
- ],
136
- }),
137
- enabled: true,
138
- }),
139
- teams: (webhookUrl) => ({
140
- name: 'Teams Notifications',
141
- type: 'post-always',
142
- url: webhookUrl,
143
- method: 'POST',
144
- headers: {},
145
- payload: JSON.stringify({
146
- '@type': 'MessageCard',
147
- '@context': 'https://schema.org/extensions',
148
- summary: 'Delta CLI {{command}}',
149
- themeColor: '{{#if success}}00FF00{{else}}FF0000{{/if}}',
150
- sections: [
151
- {
152
- activityTitle: 'Delta CLI Notification',
153
- facts: [
154
- { name: 'Command', value: '{{command}}' },
155
- { name: 'Status', value: '{{success}}' },
156
- { name: 'Duration', value: '{{duration}}ms' },
157
- { name: 'Project', value: '{{project}}' },
158
- ],
159
- },
160
- ],
161
- }),
162
- enabled: true,
163
- }),
164
- generic: (url) => ({
165
- name: 'Webhook',
166
- type: 'post-always',
167
- url,
168
- method: 'POST',
169
- headers: {},
170
- enabled: true,
171
- }),
172
- };
173
- // Singleton instance
174
- let hookManager = null;
175
- export function getHookManager() {
176
- if (!hookManager) {
177
- hookManager = new HookManager();
178
- }
179
- return hookManager;
180
- }
181
- //# sourceMappingURL=hooks.js.map
@@ -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: 'http://localhost:3000',
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: 'http://localhost:3000',
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