@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
package/dist/index.js DELETED
@@ -1,387 +0,0 @@
1
- #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import gradient from 'gradient-string';
4
- import figlet from 'figlet';
5
- import updateNotifier from 'update-notifier';
6
- import chalk from 'chalk';
7
- import { readFileSync } from 'fs';
8
- import { fileURLToPath } from 'url';
9
- import { dirname, join } from 'path';
10
- // Core Engine Imports
11
- import { createEngine } from './core/engine.js';
12
- import { DefaultExecutionPolicy } from './core/policy.js';
13
- import { LocalProvider } from './providers/local-provider.js';
14
- import { RemoteProvider } from './providers/remote-provider.js';
15
- import { AIProviderPlaceholder } from './providers/ai-provider.js';
16
- import { installCompletion, generateCompletionScript } from './core/completion.js';
17
- import { runInitWizard, executeWizardActions } from './core/wizard.js';
18
- import { loadConfig } from './commands/auth.js';
19
- import { SecureTokenStore } from './auth/secure-auth.js';
20
- const __filename = fileURLToPath(import.meta.url);
21
- const __dirname = dirname(__filename);
22
- // Read package.json for version info
23
- const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
24
- // Check for updates
25
- const notifier = updateNotifier({
26
- pkg,
27
- updateCheckInterval: 1000 * 60 * 60 // 1 hour
28
- });
29
- // Define gradient themes
30
- export const gradients = {
31
- delta: gradient(['#00d4ff', '#7b2cbf', '#ff006e']),
32
- cyber: gradient(['#00f5ff', '#0080ff', '#8000ff']),
33
- sunset: gradient(['#ff4e50', '#fca311', '#e85d04']),
34
- neon: gradient(['#39ff14', '#00ffff', '#ff00ff']),
35
- ocean: gradient(['#0066ff', '#00ccff', '#66ffff']),
36
- fire: gradient(['#ff4e00', '#ff9500', '#ffcc00']),
37
- };
38
- // Print animated logo
39
- export function printLogo(variant = 'delta') {
40
- const text = figlet.textSync('DELTA', {
41
- font: 'Big Money-nw',
42
- horizontalLayout: 'default',
43
- verticalLayout: 'default',
44
- });
45
- console.log('\n' + gradients[variant](text) + '\n');
46
- }
47
- // Print minimal logo
48
- export function printMinimalLogo() {
49
- const text = figlet.textSync('Ī”', {
50
- font: 'ANSI Shadow',
51
- horizontalLayout: 'default',
52
- });
53
- console.log(gradients.delta(text));
54
- }
55
- // Print welcome screen
56
- export function printWelcome() {
57
- console.clear();
58
- printLogo();
59
- console.log(chalk.dim(' ═══════════════════════════════════════════════════════════════'));
60
- console.log();
61
- console.log(chalk.white.bold(' šŸš€ Delta CLI v2.0') + chalk.gray(' — Next-gen code analysis & documentation'));
62
- console.log();
63
- console.log(chalk.gray(' Local-first architecture with ') + chalk.cyan('cloud power') + chalk.gray(' & ') + chalk.magenta('AI intelligence'));
64
- console.log();
65
- console.log(chalk.dim(' ═══════════════════════════════════════════════════════════════'));
66
- console.log();
67
- // Update notification
68
- if (notifier.update) {
69
- console.log(chalk.yellow.bold(' ⚔ Update Available!'));
70
- console.log(chalk.gray(` ${notifier.update.current} → ${notifier.update.latest}`));
71
- console.log(chalk.cyan(` Run: npm install -g ${pkg.name}`));
72
- console.log();
73
- }
74
- }
75
- // Print tips
76
- export function printTips() {
77
- const tips = [
78
- { cmd: 'delta /help', desc: 'Quick help with slash commands' },
79
- { cmd: 'delta /analyze', desc: 'Run analysis with / command' },
80
- { cmd: 'delta /status', desc: 'Check project status' },
81
- { cmd: 'delta --interactive', desc: 'Open interactive dashboard' },
82
- ];
83
- console.log(chalk.bold.cyan(' Quick Start (Slash Commands Available):'));
84
- console.log();
85
- tips.forEach(({ cmd, desc }) => {
86
- console.log(chalk.gray(' • ') + chalk.cyan(cmd) + chalk.gray(` — ${desc}`));
87
- });
88
- console.log();
89
- console.log(chalk.dim(' Try ') + chalk.cyan('/help') + chalk.dim(', ') + chalk.cyan('/analyze') + chalk.dim(', ') + chalk.cyan('/status') + chalk.dim(' for quick access'));
90
- 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'));
91
- console.log();
92
- }
93
- // Initialize Core Engine
94
- let engine = null;
95
- async function initializeEngine() {
96
- if (engine)
97
- return engine;
98
- const auth = await loadConfig();
99
- const hasPat = await SecureTokenStore.hasTokens();
100
- const config = {
101
- defaultProvider: 'local',
102
- providers: {
103
- local: {
104
- enabled: true,
105
- maxFileSize: 10 * 1024 * 1024, // 10MB
106
- excludePatterns: ['node_modules', 'dist', '.git', 'coverage'],
107
- },
108
- remote: {
109
- enabled: hasPat,
110
- apiUrl: auth.apiUrl || 'http://localhost:3000',
111
- timeout: 30000,
112
- retryAttempts: 3,
113
- },
114
- ai: {
115
- enabled: false, // Reserved for future
116
- provider: 'openai',
117
- },
118
- },
119
- features: {
120
- cache: true,
121
- offlineMode: !hasPat,
122
- autoUpdate: true,
123
- },
124
- };
125
- const policy = new DefaultExecutionPolicy(config);
126
- engine = createEngine(config, policy);
127
- // Register providers
128
- engine.registerProvider(new LocalProvider(config.providers.local));
129
- if (config.providers.remote.enabled) {
130
- engine.registerProvider(new RemoteProvider(config.providers.remote));
131
- }
132
- engine.registerProvider(new AIProviderPlaceholder(config.providers.ai));
133
- return engine;
134
- }
135
- // JSON Output Helper
136
- function outputJSON(response) {
137
- console.log(JSON.stringify(response, null, 2));
138
- }
139
- // Non-TTY Detection
140
- function isNonTTY() {
141
- return !process.stdout.isTTY || process.env.CI === 'true' || process.env.NO_COLOR === 'true';
142
- }
143
- // CLI Program Setup
144
- const program = new Command();
145
- program
146
- .name('delta')
147
- .description('Delta Platform - Next-gen code analysis and documentation')
148
- .version(pkg.version, '-v, --version', 'Display version number')
149
- .usage('<command> [options]')
150
- .helpOption('-h, --help', 'Display help for command')
151
- .addHelpCommand('help [command]', 'Display help for command');
152
- // Global options - Simplified (no --interactive)
153
- program
154
- .option('--no-color', 'Disable colored output', false)
155
- .option('--verbose', 'Enable verbose logging', false);
156
- // Auth commands
157
- program
158
- .command('login')
159
- .description('šŸ” Authenticate with Delta cloud (OAuth2 + secure keychain storage)')
160
- .option('--method <type>', 'Auth method: oauth, pat, github, google', 'oauth')
161
- .option('--token <token>', 'Personal Access Token (for CI/CD)')
162
- .action(async (options) => {
163
- printWelcome();
164
- const { loginCommand } = await import('./commands/auth.js');
165
- await loginCommand(options);
166
- });
167
- program
168
- .command('logout')
169
- .description('šŸ”“ Remove stored authentication and clear credentials')
170
- .action(async () => {
171
- const { logoutCommand } = await import('./commands/logout.js');
172
- await logoutCommand();
173
- });
174
- program
175
- .command('whoami')
176
- .alias('me')
177
- .description('šŸ‘¤ Show current user, plan, quota, and session info')
178
- .option('--format <type>', 'Output format: table, json, compact', 'table')
179
- .action(async (options) => {
180
- const { whoamiCommand } = await import('./commands/whoami.js');
181
- await whoamiCommand(options);
182
- });
183
- // Main commands - Simplified CLI (no TUI)
184
- program
185
- .command('analyze [path]')
186
- .alias('a')
187
- .description('šŸ” Run code analysis and optionally upload to cloud')
188
- .option('-f, --format <type>', 'Output format: json, html, markdown', 'json')
189
- .option('-o, --output <dir>', 'Output directory', './delta-reports')
190
- .option('-i, --include <patterns...>', 'Include file patterns')
191
- .option('-e, --exclude <patterns...>', 'Exclude file patterns')
192
- .option('--max-size <bytes>', 'Max file size', '10485760')
193
- .option('--upload', 'Upload report to Delta cloud', false)
194
- .option('--project-name <name>', 'Project name for the report')
195
- .option('--json', 'Output results as JSON', false)
196
- .action(async (path, options) => {
197
- const { analyzeCommand } = await import('./commands/analyze.js');
198
- await analyzeCommand(path || '.', {
199
- format: options.format,
200
- output: options.output,
201
- include: options.include?.join(','),
202
- exclude: options.exclude?.join(','),
203
- maxSize: options.maxSize,
204
- upload: options.upload,
205
- projectName: options.projectName,
206
- });
207
- });
208
- program
209
- .command('init [path]')
210
- .description('šŸš€ Initialize a new Delta project with wizard')
211
- .option('-t, --template <name>', 'Project template: default, nextjs, react, node, python', 'default')
212
- .option('-f, --force', 'Overwrite existing config', false)
213
- .option('--git', 'Initialize git repository', false)
214
- .option('--json', 'Output results as JSON', false)
215
- .option('--provider <name>', 'Execution provider: local, remote', 'local')
216
- .option('-w, --wizard', 'Run interactive wizard', false)
217
- .action(async (path, options) => {
218
- // Run wizard if requested or no path provided
219
- if (options.wizard || !path) {
220
- const wizardResult = await runInitWizard();
221
- await executeWizardActions(wizardResult);
222
- // Then run engine init with wizard results
223
- const engine = await initializeEngine();
224
- const response = await engine.execute({
225
- type: 'init',
226
- command: 'init',
227
- payload: {
228
- projectPath: wizardResult.projectPath,
229
- template: wizardResult.template,
230
- force: options.force,
231
- git: wizardResult.initializeGit,
232
- },
233
- options: {
234
- json: options.json || isNonTTY(),
235
- provider: options.provider,
236
- },
237
- });
238
- if (options.json || isNonTTY()) {
239
- outputJSON(response);
240
- }
241
- return;
242
- }
243
- // Standard init flow
244
- const engine = await initializeEngine();
245
- const projectPath = path || '.';
246
- const response = await engine.execute({
247
- type: 'init',
248
- command: 'init',
249
- payload: {
250
- projectPath,
251
- template: options.template,
252
- force: options.force,
253
- git: options.git,
254
- },
255
- options: {
256
- json: options.json || isNonTTY(),
257
- provider: options.provider,
258
- },
259
- });
260
- if (options.json || isNonTTY()) {
261
- outputJSON(response);
262
- }
263
- else {
264
- printWelcome();
265
- if (response.success) {
266
- console.log('\nšŸ“ Project initialized');
267
- console.log(` Path: ${response.data?.projectPath}`);
268
- console.log(` Config: ${response.data?.configPath}`);
269
- console.log(` Template: ${response.data?.template}`);
270
- }
271
- else {
272
- console.error('\nāŒ Init failed:', response.error?.message);
273
- process.exit(1);
274
- }
275
- }
276
- });
277
- program
278
- .command('config')
279
- .description('āš™ļø Manage CLI configuration with schema validation')
280
- .option('-g, --get <key>', 'Get config value')
281
- .option('-s, --set <key=value>', 'Set config value')
282
- .option('-l, --list', 'List all config')
283
- .option('--reset', 'Reset to default configuration')
284
- .action(async (options) => {
285
- const { configCommand } = await import('./commands/config.js');
286
- await configCommand(options);
287
- });
288
- program
289
- .command('status [path]')
290
- .alias('st')
291
- .description('šŸ“ˆ Check project health, connection status, and diagnostics')
292
- .option('--diagnostics', 'Run full diagnostics', false)
293
- .option('--fix', 'Auto-fix issues where possible', false)
294
- .option('--json', 'Output results as JSON', false)
295
- .action(async (path, options) => {
296
- const engine = await initializeEngine();
297
- const projectPath = path || '.';
298
- const response = await engine.execute({
299
- type: 'status',
300
- command: 'status',
301
- payload: {
302
- projectPath,
303
- diagnostics: options.diagnostics,
304
- fix: options.fix,
305
- },
306
- options: {
307
- json: options.json || isNonTTY(),
308
- },
309
- });
310
- if (options.json || isNonTTY()) {
311
- outputJSON(response);
312
- }
313
- else {
314
- if (response.success) {
315
- const data = response.data;
316
- console.log('\nšŸ“Š Project Status');
317
- console.log(` Path: ${data?.project?.path || 'N/A'}`);
318
- console.log(` Config: ${data?.project?.hasConfig ? 'āœ…' : 'āŒ'}`);
319
- console.log(` Auth: ${data?.auth?.authenticated ? 'āœ…' : 'āŒ'}`);
320
- }
321
- else {
322
- console.error('\nāŒ Status check failed:', response.error?.message);
323
- }
324
- }
325
- });
326
- program
327
- .command('completion [shell]')
328
- .description('šŸ”§ Generate shell completion script')
329
- .option('--install', 'Install completion for current shell', false)
330
- .action(async (shell, options) => {
331
- const targetShell = shell || 'bash';
332
- if (options.install) {
333
- await installCompletion(targetShell);
334
- }
335
- else {
336
- console.log(generateCompletionScript(targetShell));
337
- }
338
- });
339
- // Parse arguments
340
- const args = process.argv.slice(2);
341
- // Handle slash commands (simplified)
342
- const slashCommandMap = {
343
- '/help': 'help',
344
- '/h': 'help',
345
- '/analyze': 'analyze',
346
- '/a': 'analyze',
347
- '/status': 'status',
348
- '/st': 'status',
349
- '/init': 'init',
350
- '/i': 'init',
351
- '/login': 'login',
352
- '/logout': 'logout',
353
- '/whoami': 'whoami',
354
- '/me': 'whoami',
355
- '/config': 'config',
356
- '/version': '--version',
357
- '/v': '--version',
358
- };
359
- // Convert slash commands to regular commands
360
- if (args.length > 0 && args[0].startsWith('/')) {
361
- const slashCmd = args[0].toLowerCase();
362
- const mappedCmd = slashCommandMap[slashCmd];
363
- if (mappedCmd) {
364
- if (mappedCmd.startsWith('--')) {
365
- // It's a flag like --version
366
- args[0] = mappedCmd;
367
- }
368
- else {
369
- // It's a command
370
- args[0] = mappedCmd;
371
- }
372
- }
373
- else {
374
- // Unknown slash command
375
- console.error(chalk.red(`āŒ Unknown command: ${slashCmd}`));
376
- console.log(chalk.gray('Run /help to see available commands'));
377
- process.exit(1);
378
- }
379
- }
380
- program.parse(['node', 'delta', ...args]);
381
- // If no command provided, show welcome and help
382
- if (process.argv.length <= 2) {
383
- printWelcome();
384
- printTips();
385
- program.help();
386
- }
387
- //# sourceMappingURL=index.js.map
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from 'ink';
3
- import { DeltaApp } from '../components/DeltaApp.js';
4
- import { UnifiedManager } from '../components/UnifiedManager.js';
5
- export async function runInteractiveMode(options) {
6
- // Render the React Ink app
7
- const Component = options.mode === 'manager' ? UnifiedManager : DeltaApp;
8
- const { waitUntilExit } = render(_jsx(Component, {}));
9
- await waitUntilExit();
10
- }
11
- //# sourceMappingURL=index.js.map
@@ -1,43 +0,0 @@
1
- /**
2
- * Delta Constitution - Contracts Rules Index
3
- * @description Contract rules for all supported languages
4
- * @version 1.0.0
5
- */
6
- // TypeScript / Node.js Rules
7
- export { default as ts, ContractsRules as TSContractsRules } from './ts.rules';
8
- // Language-agnostic exports
9
- export const ContractsAxis = {
10
- name: 'Contracts',
11
- description: 'Type-safe, versioned interfaces between layers',
12
- weight: 15,
13
- languages: ['typescript', 'javascript', 'node'],
14
- principles: [
15
- {
16
- id: 'CONTRACT-001',
17
- name: 'One Contract Per Module',
18
- description: 'Every module must export a corresponding contract',
19
- },
20
- {
21
- id: 'CONTRACT-002',
22
- name: 'Features Use Contracts Only',
23
- description: 'Features can only import from Contracts, not Modules directly',
24
- },
25
- {
26
- id: 'CONTRACT-003',
27
- name: 'Semantic Versioning',
28
- description: 'Contracts follow semver: major.breaking, minor.feature, patch.fix',
29
- },
30
- {
31
- id: 'CONTRACT-004',
32
- name: 'Interface Design',
33
- description: 'Clear naming, required/optional fields, documentation',
34
- },
35
- {
36
- id: 'CONTRACT-005',
37
- name: 'Validation',
38
- description: 'Runtime validation with Zod schemas',
39
- },
40
- ],
41
- };
42
- export default ContractsAxis;
43
- //# sourceMappingURL=index.js.map