@vee-stack/delta-cli 2.0.3 → 2.0.5
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/dist/analyzer/commands/analyze.js +260 -0
- package/dist/analyzer/commands/config.js +83 -0
- package/dist/analyzer/commands/report.js +38 -0
- package/dist/analyzer/generators/report.generator.js +123 -0
- package/dist/analyzer/index.js +44 -0
- package/dist/analyzer/scanners/project.scanner.js +92 -0
- package/dist/analyzer/validators/contracts.validator.js +42 -0
- package/dist/analyzer/validators/maintainability.validator.js +40 -0
- package/dist/analyzer/validators/observability.validator.js +39 -0
- package/dist/analyzer/validators/performance.validator.js +42 -0
- package/dist/analyzer/validators/security.validator.js +66 -0
- package/dist/analyzer/validators/soc.validator.js +75 -0
- package/dist/apps/cli/src/analyzer/commands/analyze.js +256 -0
- package/dist/apps/cli/src/analyzer/commands/config.js +83 -0
- package/dist/apps/cli/src/analyzer/commands/report.js +38 -0
- package/dist/apps/cli/src/analyzer/generators/report.generator.js +123 -0
- package/dist/apps/cli/src/analyzer/index.js +44 -0
- package/dist/apps/cli/src/analyzer/scanners/project.scanner.js +92 -0
- package/dist/apps/cli/src/analyzer/validators/contracts.validator.js +42 -0
- package/dist/apps/cli/src/analyzer/validators/maintainability.validator.js +40 -0
- package/dist/apps/cli/src/analyzer/validators/observability.validator.js +39 -0
- package/dist/apps/cli/src/analyzer/validators/performance.validator.js +42 -0
- package/dist/apps/cli/src/analyzer/validators/security.validator.js +66 -0
- package/dist/apps/cli/src/analyzer/validators/soc.validator.js +75 -0
- package/dist/apps/cli/src/auth/secure-auth.js +312 -0
- package/dist/apps/cli/src/commands/analyze.js +286 -0
- package/dist/apps/cli/src/commands/auth-new.js +37 -0
- package/dist/apps/cli/src/commands/auth.js +122 -0
- package/dist/apps/cli/src/commands/config.js +49 -0
- package/dist/apps/cli/src/commands/deploy.js +6 -0
- package/dist/apps/cli/src/commands/init.js +47 -0
- package/dist/apps/cli/src/commands/logout.js +23 -0
- package/dist/apps/cli/src/commands/plugins.js +21 -0
- package/dist/apps/cli/src/commands/status.js +80 -0
- package/dist/apps/cli/src/commands/sync.js +6 -0
- package/dist/apps/cli/src/commands/whoami.js +115 -0
- package/dist/apps/cli/src/components/Dashboard.js +168 -0
- package/dist/apps/cli/src/components/DeltaApp.js +56 -0
- package/dist/apps/cli/src/components/UnifiedManager.js +324 -0
- package/dist/apps/cli/src/core/audit.js +184 -0
- package/dist/apps/cli/src/core/completion.js +294 -0
- package/dist/apps/cli/src/core/contracts.js +6 -0
- package/dist/apps/cli/src/core/engine.js +124 -0
- package/dist/apps/cli/src/core/exit-codes.js +71 -0
- package/dist/apps/cli/src/core/hooks.js +181 -0
- package/dist/apps/cli/src/core/index.js +7 -0
- package/dist/apps/cli/src/core/policy.js +115 -0
- package/dist/apps/cli/src/core/profiles.js +161 -0
- package/dist/apps/cli/src/core/wizard.js +203 -0
- package/dist/apps/cli/src/index.js +636 -0
- package/dist/apps/cli/src/interactive/index.js +11 -0
- package/dist/apps/cli/src/plugins/GitStatusPlugin.js +99 -0
- package/dist/apps/cli/src/providers/ai-provider.js +74 -0
- package/dist/apps/cli/src/providers/local-provider.js +302 -0
- package/dist/apps/cli/src/providers/remote-provider.js +100 -0
- package/dist/apps/cli/src/types/api.js +3 -0
- package/dist/apps/cli/src/ui.js +219 -0
- package/dist/apps/cli/src/welcome.js +81 -0
- package/dist/auth/secure-auth.js +418 -0
- package/dist/bundle.js +45 -46
- package/dist/commands/analyze.js +363 -0
- package/dist/commands/auth-new.js +37 -0
- package/dist/commands/auth.js +133 -0
- package/dist/commands/config.js +50 -0
- package/dist/commands/deploy.js +6 -0
- package/dist/commands/init.js +47 -0
- package/dist/commands/logout.js +30 -0
- package/dist/commands/plugins.js +21 -0
- package/dist/commands/status.js +82 -0
- package/dist/commands/sync.js +6 -0
- package/dist/commands/whoami.js +71 -0
- package/dist/components/Dashboard.js +169 -0
- package/dist/components/DeltaApp.js +57 -0
- package/dist/components/UnifiedManager.js +344 -0
- package/dist/core/audit.js +184 -0
- package/dist/core/completion.js +294 -0
- package/dist/core/contracts.js +6 -0
- package/dist/core/engine.js +124 -0
- package/dist/core/exit-codes.js +71 -0
- package/dist/core/hooks.js +181 -0
- package/dist/core/index.js +7 -0
- package/dist/core/policy.js +115 -0
- package/dist/core/profiles.js +161 -0
- package/dist/core/wizard.js +203 -0
- package/dist/index.js +387 -0
- package/dist/interactive/index.js +11 -0
- package/dist/packages/domain/src/constitution/contracts/index.js +43 -0
- package/dist/packages/domain/src/constitution/contracts/ts.rules.js +268 -0
- package/dist/packages/domain/src/constitution/index.js +139 -0
- package/dist/packages/domain/src/constitution/maintainability/index.js +43 -0
- package/dist/packages/domain/src/constitution/maintainability/ts.rules.js +344 -0
- package/dist/packages/domain/src/constitution/observability/index.js +43 -0
- package/dist/packages/domain/src/constitution/observability/ts.rules.js +307 -0
- package/dist/packages/domain/src/constitution/performance/index.js +43 -0
- package/dist/packages/domain/src/constitution/performance/ts.rules.js +325 -0
- package/dist/packages/domain/src/constitution/security/index.js +50 -0
- package/dist/packages/domain/src/constitution/security/ts.rules.js +267 -0
- package/dist/packages/domain/src/constitution/soc/index.js +43 -0
- package/dist/packages/domain/src/constitution/soc/ts.rules.js +360 -0
- package/dist/packages/domain/src/contracts/analysis.contract.js +18 -0
- package/dist/packages/domain/src/contracts/index.js +7 -0
- package/dist/packages/domain/src/contracts/projects.contract.js +18 -0
- package/dist/packages/domain/src/control/registry/rules.registry.js +29 -0
- package/dist/packages/domain/src/control/schemas/policies.js +6 -0
- package/dist/packages/domain/src/core/analysis/discovery.js +163 -0
- package/dist/packages/domain/src/core/analysis/engine.contract.js +298 -0
- package/dist/packages/domain/src/core/analysis/engine.js +77 -0
- package/dist/packages/domain/src/core/analysis/index.js +14 -0
- package/dist/packages/domain/src/core/analysis/orchestrator.js +242 -0
- package/dist/packages/domain/src/core/comparison/engine.js +29 -0
- package/dist/packages/domain/src/core/comparison/index.js +5 -0
- package/dist/packages/domain/src/core/documentation/index.js +5 -0
- package/dist/packages/domain/src/core/documentation/pipeline.js +41 -0
- package/dist/packages/domain/src/core/fs/adapter.js +111 -0
- package/dist/packages/domain/src/core/fs/index.js +5 -0
- package/dist/packages/domain/src/core/parser/unified-parser.js +166 -0
- package/dist/packages/domain/src/index.js +33 -0
- package/dist/packages/domain/src/plugin/registry.js +195 -0
- package/dist/packages/domain/src/plugin/types.js +6 -0
- package/dist/packages/domain/src/ports/analysis.engine.js +7 -0
- package/dist/packages/domain/src/ports/audit.logger.js +7 -0
- package/dist/packages/domain/src/ports/project.repository.js +7 -0
- package/dist/packages/domain/src/rules/index.js +134 -0
- package/dist/packages/domain/src/types/analysis.js +6 -0
- package/dist/packages/domain/src/types/errors.js +53 -0
- package/dist/packages/domain/src/types/fs.js +6 -0
- package/dist/packages/domain/src/types/index.js +7 -0
- package/dist/plugins/GitStatusPlugin.js +93 -0
- package/dist/providers/ai-provider.js +74 -0
- package/dist/providers/local-provider.js +304 -0
- package/dist/providers/remote-provider.js +100 -0
- package/dist/types/api.js +3 -0
- package/dist/ui.js +219 -0
- package/dist/welcome.js +81 -0
- package/package.json +18 -18
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remote Execution Provider
|
|
3
|
+
* Connects to Delta API for cloud-based execution
|
|
4
|
+
*/
|
|
5
|
+
import { ExitCode } from '../core/exit-codes.js';
|
|
6
|
+
import { SecureTokenStore } from '../auth/secure-auth.js';
|
|
7
|
+
export class RemoteProvider {
|
|
8
|
+
name = 'remote';
|
|
9
|
+
version = '2.0.0';
|
|
10
|
+
capabilities = {
|
|
11
|
+
commands: ['analyze', 'status', 'sync', 'deploy'],
|
|
12
|
+
features: {
|
|
13
|
+
json: true,
|
|
14
|
+
streaming: true,
|
|
15
|
+
caching: true,
|
|
16
|
+
ai: false,
|
|
17
|
+
},
|
|
18
|
+
constraints: {
|
|
19
|
+
maxFileSize: 50 * 1024 * 1024, // 50MB
|
|
20
|
+
maxFiles: 10000,
|
|
21
|
+
requiresAuth: true,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
config;
|
|
25
|
+
constructor(config) {
|
|
26
|
+
this.config = config;
|
|
27
|
+
}
|
|
28
|
+
async isAvailable() {
|
|
29
|
+
try {
|
|
30
|
+
const controller = new AbortController();
|
|
31
|
+
const timeout = setTimeout(() => controller.abort(), 5000);
|
|
32
|
+
const response = await fetch(`${this.config.apiUrl}/health`, {
|
|
33
|
+
method: 'GET',
|
|
34
|
+
signal: controller.signal,
|
|
35
|
+
});
|
|
36
|
+
clearTimeout(timeout);
|
|
37
|
+
return response.ok;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async execute(request) {
|
|
44
|
+
const startTime = Date.now();
|
|
45
|
+
try {
|
|
46
|
+
const pat = await SecureTokenStore.getAccessToken();
|
|
47
|
+
if (!pat) {
|
|
48
|
+
throw new Error('Authentication required for remote execution');
|
|
49
|
+
}
|
|
50
|
+
// Call remote API
|
|
51
|
+
const response = await fetch(`${this.config.apiUrl}/api/cli/execute`, {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers: {
|
|
54
|
+
'Authorization': `Bearer ${pat}`,
|
|
55
|
+
'Content-Type': 'application/json',
|
|
56
|
+
},
|
|
57
|
+
body: JSON.stringify({
|
|
58
|
+
type: request.type,
|
|
59
|
+
command: request.command,
|
|
60
|
+
payload: request.payload,
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
if (!response.ok) {
|
|
64
|
+
const error = await response.text();
|
|
65
|
+
throw new Error(`Remote execution failed: ${error}`);
|
|
66
|
+
}
|
|
67
|
+
const data = await response.json();
|
|
68
|
+
return {
|
|
69
|
+
success: true,
|
|
70
|
+
exitCode: ExitCode.SUCCESS,
|
|
71
|
+
meta: {
|
|
72
|
+
command: request.command,
|
|
73
|
+
duration: Date.now() - startTime,
|
|
74
|
+
timestamp: new Date().toISOString(),
|
|
75
|
+
version: this.version,
|
|
76
|
+
provider: this.name,
|
|
77
|
+
},
|
|
78
|
+
data: data,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return {
|
|
83
|
+
success: false,
|
|
84
|
+
exitCode: ExitCode.NETWORK_ERROR,
|
|
85
|
+
meta: {
|
|
86
|
+
command: request.command,
|
|
87
|
+
duration: Date.now() - startTime,
|
|
88
|
+
timestamp: new Date().toISOString(),
|
|
89
|
+
version: this.version,
|
|
90
|
+
provider: this.name,
|
|
91
|
+
},
|
|
92
|
+
error: {
|
|
93
|
+
code: 'REMOTE_EXECUTION_ERROR',
|
|
94
|
+
message: error instanceof Error ? error.message : String(error),
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=remote-provider.js.map
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Professional UI Components for Delta CLI
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import Table from 'cli-table3';
|
|
7
|
+
import prompts from 'prompts';
|
|
8
|
+
// Icons and symbols
|
|
9
|
+
export const icons = {
|
|
10
|
+
success: chalk.green('✔'),
|
|
11
|
+
error: chalk.red('✖'),
|
|
12
|
+
warning: chalk.yellow('⚠'),
|
|
13
|
+
info: chalk.blue('ℹ'),
|
|
14
|
+
arrow: chalk.cyan('→'),
|
|
15
|
+
bullet: chalk.dim('•'),
|
|
16
|
+
star: chalk.yellow('★'),
|
|
17
|
+
check: chalk.green('✓'),
|
|
18
|
+
cross: chalk.red('✗'),
|
|
19
|
+
loading: chalk.cyan('⏳'),
|
|
20
|
+
rocket: chalk.magenta('🚀'),
|
|
21
|
+
lock: chalk.yellow('🔒'),
|
|
22
|
+
user: chalk.blue('👤'),
|
|
23
|
+
package: chalk.cyan('📦'),
|
|
24
|
+
chart: chalk.green('📊'),
|
|
25
|
+
folder: chalk.yellow('📁'),
|
|
26
|
+
gear: chalk.gray('⚙️'),
|
|
27
|
+
link: chalk.blue('🔗'),
|
|
28
|
+
sparkles: chalk.yellow('✨'),
|
|
29
|
+
dot: chalk.cyan('⏵'),
|
|
30
|
+
};
|
|
31
|
+
// Spinner management
|
|
32
|
+
let currentSpinner = null;
|
|
33
|
+
export function startSpinner(text) {
|
|
34
|
+
if (currentSpinner) {
|
|
35
|
+
currentSpinner.stop();
|
|
36
|
+
}
|
|
37
|
+
currentSpinner = ora({
|
|
38
|
+
text: chalk.cyan(text),
|
|
39
|
+
spinner: 'dots',
|
|
40
|
+
color: 'cyan',
|
|
41
|
+
}).start();
|
|
42
|
+
return currentSpinner;
|
|
43
|
+
}
|
|
44
|
+
export function stopSpinner(success = true, text) {
|
|
45
|
+
if (currentSpinner) {
|
|
46
|
+
if (success) {
|
|
47
|
+
currentSpinner.succeed(text ? chalk.green(text) : undefined);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
currentSpinner.fail(text ? chalk.red(text) : undefined);
|
|
51
|
+
}
|
|
52
|
+
currentSpinner = null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export function updateSpinnerText(text) {
|
|
56
|
+
if (currentSpinner) {
|
|
57
|
+
currentSpinner.text = chalk.cyan(text);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Headers and sections
|
|
61
|
+
export function printHeader(title) {
|
|
62
|
+
console.log();
|
|
63
|
+
console.log(chalk.bold(chalk.cyan(` ${icons.rocket} ${title}`)));
|
|
64
|
+
console.log(chalk.dim(' ' + '─'.repeat(title.length + 4)));
|
|
65
|
+
}
|
|
66
|
+
export function printSection(title) {
|
|
67
|
+
console.log();
|
|
68
|
+
console.log(chalk.bold(chalk.white(` ${icons.dot} ${title}`)));
|
|
69
|
+
}
|
|
70
|
+
export function printSubSection(title) {
|
|
71
|
+
console.log(chalk.dim(` ${icons.bullet} ${title}`));
|
|
72
|
+
}
|
|
73
|
+
// Success/Error/Warning messages
|
|
74
|
+
export function printSuccess(message) {
|
|
75
|
+
console.log(` ${icons.success} ${chalk.green(message)}`);
|
|
76
|
+
}
|
|
77
|
+
export function printError(message, details) {
|
|
78
|
+
console.log(` ${icons.error} ${chalk.red(message)}`);
|
|
79
|
+
if (details) {
|
|
80
|
+
console.log(chalk.dim(` ${details}`));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export function printWarning(message) {
|
|
84
|
+
console.log(` ${icons.warning} ${chalk.yellow(message)}`);
|
|
85
|
+
}
|
|
86
|
+
export function printInfo(message) {
|
|
87
|
+
console.log(` ${icons.info} ${chalk.blue(message)}`);
|
|
88
|
+
}
|
|
89
|
+
// Key-value pairs
|
|
90
|
+
export function printKeyValue(key, value, keyColor = chalk.gray) {
|
|
91
|
+
console.log(` ${keyColor(key.padEnd(20))} ${chalk.white(value)}`);
|
|
92
|
+
}
|
|
93
|
+
// Table creation
|
|
94
|
+
export function createTable(headers) {
|
|
95
|
+
return new Table({
|
|
96
|
+
head: headers.map(h => chalk.bold(chalk.cyan(h))),
|
|
97
|
+
style: {
|
|
98
|
+
head: [],
|
|
99
|
+
border: [chalk.dim('gray')],
|
|
100
|
+
},
|
|
101
|
+
chars: {
|
|
102
|
+
top: '─',
|
|
103
|
+
'top-mid': '┬',
|
|
104
|
+
'top-left': '┌',
|
|
105
|
+
'top-right': '┐',
|
|
106
|
+
bottom: '─',
|
|
107
|
+
'bottom-mid': '┴',
|
|
108
|
+
'bottom-left': '└',
|
|
109
|
+
'bottom-right': '┘',
|
|
110
|
+
left: '│',
|
|
111
|
+
'left-mid': '├',
|
|
112
|
+
mid: '─',
|
|
113
|
+
'mid-mid': '┼',
|
|
114
|
+
right: '│',
|
|
115
|
+
'right-mid': '┤',
|
|
116
|
+
middle: '│',
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// Interactive prompts wrapper
|
|
121
|
+
export async function confirm(message, initial = true) {
|
|
122
|
+
const response = await prompts({
|
|
123
|
+
type: 'confirm',
|
|
124
|
+
name: 'value',
|
|
125
|
+
message: chalk.cyan(message),
|
|
126
|
+
initial,
|
|
127
|
+
});
|
|
128
|
+
return response.value ?? false;
|
|
129
|
+
}
|
|
130
|
+
export async function select(message, choices) {
|
|
131
|
+
const response = await prompts({
|
|
132
|
+
type: 'select',
|
|
133
|
+
name: 'value',
|
|
134
|
+
message: chalk.cyan(message),
|
|
135
|
+
choices: choices.map(c => ({
|
|
136
|
+
title: c.title,
|
|
137
|
+
value: c.value,
|
|
138
|
+
description: c.description,
|
|
139
|
+
})),
|
|
140
|
+
});
|
|
141
|
+
return response.value ?? null;
|
|
142
|
+
}
|
|
143
|
+
export async function input(message, initial, validate) {
|
|
144
|
+
const response = await prompts({
|
|
145
|
+
type: 'text',
|
|
146
|
+
name: 'value',
|
|
147
|
+
message: chalk.cyan(message),
|
|
148
|
+
initial,
|
|
149
|
+
validate,
|
|
150
|
+
});
|
|
151
|
+
return response.value ?? null;
|
|
152
|
+
}
|
|
153
|
+
export async function password(message) {
|
|
154
|
+
const response = await prompts({
|
|
155
|
+
type: 'password',
|
|
156
|
+
name: 'value',
|
|
157
|
+
message: chalk.cyan(message),
|
|
158
|
+
});
|
|
159
|
+
return response.value ?? null;
|
|
160
|
+
}
|
|
161
|
+
// Progress bar for file operations
|
|
162
|
+
export function printProgress(current, total, prefix = 'Progress') {
|
|
163
|
+
const percentage = Math.round((current / total) * 100);
|
|
164
|
+
const filled = Math.round((current / total) * 20);
|
|
165
|
+
const empty = 20 - filled;
|
|
166
|
+
const bar = chalk.green('█'.repeat(filled)) + chalk.gray('░'.repeat(empty));
|
|
167
|
+
process.stdout.write(`\r ${chalk.cyan(prefix)} ${bar} ${chalk.white(`${percentage}%`)} (${current}/${total})`);
|
|
168
|
+
if (current === total) {
|
|
169
|
+
process.stdout.write('\n');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// Box drawing
|
|
173
|
+
export function printBox(title, lines) {
|
|
174
|
+
const maxLength = Math.max(title.length, ...lines.map(l => l.length));
|
|
175
|
+
const width = maxLength + 4;
|
|
176
|
+
console.log(chalk.cyan(' ┌' + '─'.repeat(width - 2) + '┐'));
|
|
177
|
+
console.log(chalk.cyan(` │ ${chalk.bold(title).padEnd(width - 3)}│`));
|
|
178
|
+
console.log(chalk.cyan(' ├' + '─'.repeat(width - 2) + '┤'));
|
|
179
|
+
lines.forEach(line => {
|
|
180
|
+
console.log(chalk.cyan(` │ ${line.padEnd(width - 3)}│`));
|
|
181
|
+
});
|
|
182
|
+
console.log(chalk.cyan(' └' + '─'.repeat(width - 2) + '┘'));
|
|
183
|
+
}
|
|
184
|
+
// Format bytes
|
|
185
|
+
export function formatBytes(bytes) {
|
|
186
|
+
if (bytes === 0)
|
|
187
|
+
return '0 B';
|
|
188
|
+
const k = 1024;
|
|
189
|
+
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
190
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
191
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
|
192
|
+
}
|
|
193
|
+
// Format duration
|
|
194
|
+
export function formatDuration(ms) {
|
|
195
|
+
if (ms < 1000)
|
|
196
|
+
return `${ms}ms`;
|
|
197
|
+
if (ms < 60000)
|
|
198
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
199
|
+
return `${(ms / 60000).toFixed(1)}m`;
|
|
200
|
+
}
|
|
201
|
+
// Command hint
|
|
202
|
+
export function printCommandHint(command, description) {
|
|
203
|
+
console.log(` ${chalk.dim('$')} ${chalk.cyan(command)} ${chalk.gray(description)}`);
|
|
204
|
+
}
|
|
205
|
+
// Divider
|
|
206
|
+
export function printDivider() {
|
|
207
|
+
console.log(chalk.dim(' ' + '─'.repeat(60)));
|
|
208
|
+
}
|
|
209
|
+
// Welcome message
|
|
210
|
+
export function printWelcome() {
|
|
211
|
+
console.log();
|
|
212
|
+
console.log(chalk.cyan(' ╭──────────────────────────────────────────────╮'));
|
|
213
|
+
console.log(chalk.cyan(' │') + ' ' + chalk.bold(chalk.magenta('🚀 Delta CLI')) + chalk.dim(' - Code Analysis & Documentation ') + chalk.cyan('│'));
|
|
214
|
+
console.log(chalk.cyan(' ├──────────────────────────────────────────────┤'));
|
|
215
|
+
console.log(chalk.cyan(' │') + ' ' + chalk.gray('Local-first analysis with cloud power ') + chalk.cyan('│'));
|
|
216
|
+
console.log(chalk.cyan(' ╰──────────────────────────────────────────────╯'));
|
|
217
|
+
console.log();
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=ui.js.map
|
package/dist/welcome.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import gradient from 'gradient-string';
|
|
3
|
+
import figlet from 'figlet';
|
|
4
|
+
import updateNotifier from 'update-notifier';
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import { readFileSync } from 'fs';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import { dirname, join } from 'path';
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
// Read package.json for version info
|
|
12
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
|
|
13
|
+
// Check for updates
|
|
14
|
+
const notifier = updateNotifier({
|
|
15
|
+
pkg,
|
|
16
|
+
updateCheckInterval: 1000 * 60 * 60 // 1 hour
|
|
17
|
+
});
|
|
18
|
+
// Define gradient themes
|
|
19
|
+
export const gradients = {
|
|
20
|
+
delta: gradient(['#00d4ff', '#7b2cbf', '#ff006e']),
|
|
21
|
+
cyber: gradient(['#00f5ff', '#0080ff', '#8000ff']),
|
|
22
|
+
sunset: gradient(['#ff4e50', '#fca311', '#e85d04']),
|
|
23
|
+
neon: gradient(['#39ff14', '#00ffff', '#ff00ff']),
|
|
24
|
+
ocean: gradient(['#0066ff', '#00ccff', '#66ffff']),
|
|
25
|
+
fire: gradient(['#ff4e00', '#ff9500', '#ffcc00']),
|
|
26
|
+
};
|
|
27
|
+
// Print animated logo
|
|
28
|
+
export function printLogo(variant = 'delta') {
|
|
29
|
+
const text = figlet.textSync('DELTA', {
|
|
30
|
+
font: 'Big Money-nw',
|
|
31
|
+
horizontalLayout: 'default',
|
|
32
|
+
verticalLayout: 'default',
|
|
33
|
+
});
|
|
34
|
+
console.log('\n' + gradients[variant](text) + '\n');
|
|
35
|
+
}
|
|
36
|
+
// Print minimal logo
|
|
37
|
+
export function printMinimalLogo() {
|
|
38
|
+
const text = figlet.textSync('Δ', {
|
|
39
|
+
font: 'ANSI Shadow',
|
|
40
|
+
horizontalLayout: 'default',
|
|
41
|
+
});
|
|
42
|
+
console.log(gradients.delta(text));
|
|
43
|
+
}
|
|
44
|
+
// Print welcome screen
|
|
45
|
+
export function printWelcome() {
|
|
46
|
+
console.clear();
|
|
47
|
+
printLogo();
|
|
48
|
+
console.log(chalk.dim(' ═══════════════════════════════════════════════════════════════'));
|
|
49
|
+
console.log();
|
|
50
|
+
console.log(chalk.white.bold(' 🚀 Delta CLI v2.0') + chalk.gray(' — Next-gen code analysis & documentation'));
|
|
51
|
+
console.log();
|
|
52
|
+
console.log(chalk.gray(' Local-first architecture with ') + chalk.cyan('cloud power') + chalk.gray(' & ') + chalk.magenta('AI intelligence'));
|
|
53
|
+
console.log();
|
|
54
|
+
console.log(chalk.dim(' ═══════════════════════════════════════════════════════════════'));
|
|
55
|
+
console.log();
|
|
56
|
+
// Update notification
|
|
57
|
+
if (notifier.update) {
|
|
58
|
+
console.log(chalk.yellow.bold(' ⚡ Update Available!'));
|
|
59
|
+
console.log(chalk.gray(` ${notifier.update.current} → ${notifier.update.latest}`));
|
|
60
|
+
console.log(chalk.cyan(` Run: npm install -g ${pkg.name}`));
|
|
61
|
+
console.log();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Print tips
|
|
65
|
+
export function printTips() {
|
|
66
|
+
const tips = [
|
|
67
|
+
{ cmd: 'delta login', desc: 'Authenticate with your account' },
|
|
68
|
+
{ cmd: 'delta analyze', desc: 'Run code analysis on current project' },
|
|
69
|
+
{ cmd: 'delta dashboard', desc: 'Open interactive dashboard' },
|
|
70
|
+
{ cmd: 'delta --help', desc: 'Show all available commands' },
|
|
71
|
+
];
|
|
72
|
+
console.log(chalk.bold.cyan(' Quick Start:'));
|
|
73
|
+
console.log();
|
|
74
|
+
tips.forEach(({ cmd, desc }) => {
|
|
75
|
+
console.log(chalk.gray(' • ') + chalk.cyan(cmd) + chalk.gray(` — ${desc}`));
|
|
76
|
+
});
|
|
77
|
+
console.log();
|
|
78
|
+
console.log(chalk.dim(' Press ') + chalk.bold('Ctrl+T') + chalk.dim(' for variants • ') + chalk.bold('Tab') + chalk.dim(' for agents • ') + chalk.bold('Ctrl+P') + chalk.dim(' for commands'));
|
|
79
|
+
console.log();
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=welcome.js.map
|
package/package.json
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vee-stack/delta-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Delta CLI v2 - Next-gen terminal interface with React Ink",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"default": "./dist/
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"delta": "dist/
|
|
16
|
-
"dt": "dist/
|
|
15
|
+
"delta": "dist/index.js",
|
|
16
|
+
"dt": "dist/index.js"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
-
"dist
|
|
19
|
+
"dist/**/*.js",
|
|
20
20
|
"dist/index.d.ts",
|
|
21
21
|
"README.md"
|
|
22
22
|
],
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc && node scripts/add-shebang.js",
|
|
28
|
+
"bundle": "node scripts/bundle.mjs",
|
|
29
|
+
"build:publish": "pnpm run build",
|
|
30
|
+
"dev": "tsx watch src/index.tsx",
|
|
31
|
+
"start": "node dist/index.js",
|
|
32
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"package": "pkg . --out-path=./bin",
|
|
35
|
+
"package:all": "pkg . --targets=node18-win-x64,node18-macos-x64,node18-linux-x64 --out-path=./bin"
|
|
36
|
+
},
|
|
26
37
|
"pkg": {
|
|
27
38
|
"scripts": [
|
|
28
39
|
"dist/**/*.js"
|
|
@@ -83,16 +94,5 @@
|
|
|
83
94
|
},
|
|
84
95
|
"engines": {
|
|
85
96
|
"node": ">=18.0.0"
|
|
86
|
-
},
|
|
87
|
-
"scripts": {
|
|
88
|
-
"build": "tsc && node scripts/add-shebang.js",
|
|
89
|
-
"bundle": "node scripts/bundle.mjs",
|
|
90
|
-
"build:publish": "pnpm run build && pnpm run bundle",
|
|
91
|
-
"dev": "tsx watch src/index.tsx",
|
|
92
|
-
"start": "node dist/bundle.js",
|
|
93
|
-
"lint": "eslint src --ext .ts,.tsx",
|
|
94
|
-
"test": "vitest run",
|
|
95
|
-
"package": "pkg . --out-path=./bin",
|
|
96
|
-
"package:all": "pkg . --targets=node18-win-x64,node18-macos-x64,node18-linux-x64 --out-path=./bin"
|
|
97
97
|
}
|
|
98
|
-
}
|
|
98
|
+
}
|