@vee-stack/delta-cli 2.0.9 → 2.0.11

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
package/dist/index.js DELETED
@@ -1,403 +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') +
62
- chalk.gray(' — Next-gen code analysis & documentation'));
63
- console.log();
64
- console.log(chalk.gray(' Local-first architecture with ') +
65
- chalk.cyan('cloud power') +
66
- chalk.gray(' & ') +
67
- chalk.magenta('AI intelligence'));
68
- console.log();
69
- console.log(chalk.dim(' ═══════════════════════════════════════════════════════════════'));
70
- console.log();
71
- // Update notification
72
- if (notifier.update) {
73
- console.log(chalk.yellow.bold(' ⚡ Update Available!'));
74
- console.log(chalk.gray(` ${notifier.update.current} → ${notifier.update.latest}`));
75
- console.log(chalk.cyan(` Run: npm install -g ${pkg.name}`));
76
- console.log();
77
- }
78
- }
79
- // Print tips
80
- export function printTips() {
81
- const tips = [
82
- { cmd: 'delta /help', desc: 'Quick help with slash commands' },
83
- { cmd: 'delta /analyze', desc: 'Run analysis with / command' },
84
- { cmd: 'delta /status', desc: 'Check project status' },
85
- { cmd: 'delta --interactive', desc: 'Open interactive dashboard' },
86
- ];
87
- console.log(chalk.bold.cyan(' Quick Start (Slash Commands Available):'));
88
- console.log();
89
- tips.forEach(({ cmd, desc }) => {
90
- console.log(chalk.gray(' • ') + chalk.cyan(cmd) + chalk.gray(` — ${desc}`));
91
- });
92
- console.log();
93
- console.log(chalk.dim(' Try ') +
94
- chalk.cyan('/help') +
95
- chalk.dim(', ') +
96
- chalk.cyan('/analyze') +
97
- chalk.dim(', ') +
98
- chalk.cyan('/status') +
99
- chalk.dim(' for quick access'));
100
- console.log(chalk.dim(' Press ') +
101
- chalk.bold('Ctrl+T') +
102
- chalk.dim(' for variants • ') +
103
- chalk.bold('Tab') +
104
- chalk.dim(' for agents • ') +
105
- chalk.bold('Ctrl+P') +
106
- chalk.dim(' for commands'));
107
- console.log();
108
- }
109
- // Initialize Core Engine
110
- let engine = null;
111
- async function initializeEngine() {
112
- if (engine)
113
- return engine;
114
- const auth = await loadConfig();
115
- const hasPat = await SecureTokenStore.hasTokens();
116
- const config = {
117
- defaultProvider: 'local',
118
- providers: {
119
- local: {
120
- enabled: true,
121
- maxFileSize: 10 * 1024 * 1024, // 10MB
122
- excludePatterns: ['node_modules', 'dist', '.git', 'coverage'],
123
- },
124
- remote: {
125
- enabled: hasPat,
126
- apiUrl: auth.apiUrl || 'http://localhost:3000',
127
- timeout: 30000,
128
- retryAttempts: 3,
129
- },
130
- ai: {
131
- enabled: false, // Reserved for future
132
- provider: 'openai',
133
- },
134
- },
135
- features: {
136
- cache: true,
137
- offlineMode: !hasPat,
138
- autoUpdate: true,
139
- },
140
- };
141
- const policy = new DefaultExecutionPolicy(config);
142
- engine = createEngine(config, policy);
143
- // Register providers
144
- engine.registerProvider(new LocalProvider(config.providers.local));
145
- if (config.providers.remote.enabled) {
146
- engine.registerProvider(new RemoteProvider(config.providers.remote));
147
- }
148
- engine.registerProvider(new AIProviderPlaceholder(config.providers.ai));
149
- return engine;
150
- }
151
- // JSON Output Helper
152
- function outputJSON(response) {
153
- console.log(JSON.stringify(response, null, 2));
154
- }
155
- // Non-TTY Detection
156
- function isNonTTY() {
157
- return !process.stdout.isTTY || process.env.CI === 'true' || process.env.NO_COLOR === 'true';
158
- }
159
- // CLI Program Setup
160
- const program = new Command();
161
- program
162
- .name('delta')
163
- .description('Delta Platform - Next-gen code analysis and documentation')
164
- .version(pkg.version, '-v, --version', 'Display version number')
165
- .usage('<command> [options]')
166
- .helpOption('-h, --help', 'Display help for command')
167
- .addHelpCommand('help [command]', 'Display help for command');
168
- // Global options - Simplified (no --interactive)
169
- program
170
- .option('--no-color', 'Disable colored output', false)
171
- .option('--verbose', 'Enable verbose logging', false);
172
- // Auth commands
173
- program
174
- .command('login')
175
- .description('🔐 Authenticate with Delta cloud (OAuth2 + secure keychain storage)')
176
- .option('--method <type>', 'Auth method: oauth, pat, github, google', 'oauth')
177
- .option('--token <token>', 'Personal Access Token (for CI/CD)')
178
- .action(async (options) => {
179
- printWelcome();
180
- const { loginCommand } = await import('./commands/auth.js');
181
- await loginCommand(options);
182
- });
183
- program
184
- .command('logout')
185
- .description('🔓 Remove stored authentication and clear credentials')
186
- .action(async () => {
187
- const { logoutCommand } = await import('./commands/logout.js');
188
- await logoutCommand();
189
- });
190
- program
191
- .command('whoami')
192
- .alias('me')
193
- .description('👤 Show current user, plan, quota, and session info')
194
- .option('--format <type>', 'Output format: table, json, compact', 'table')
195
- .action(async (options) => {
196
- const { whoamiCommand } = await import('./commands/whoami.js');
197
- await whoamiCommand(options);
198
- });
199
- // Main commands - Simplified CLI (no TUI)
200
- program
201
- .command('analyze [path]')
202
- .alias('a')
203
- .description('🔍 Run code analysis and optionally upload to cloud')
204
- .option('-f, --format <type>', 'Output format: json, html, markdown', 'json')
205
- .option('-o, --output <dir>', 'Output directory', './delta-reports')
206
- .option('-i, --include <patterns...>', 'Include file patterns')
207
- .option('-e, --exclude <patterns...>', 'Exclude file patterns')
208
- .option('--max-size <bytes>', 'Max file size', '10485760')
209
- .option('--upload', 'Upload report to Delta cloud', false)
210
- .option('--project-name <name>', 'Project name for the report')
211
- .option('--json', 'Output results as JSON', false)
212
- .action(async (path, options) => {
213
- const { analyzeCommand } = await import('./commands/analyze.js');
214
- await analyzeCommand(path || '.', {
215
- format: options.format,
216
- output: options.output,
217
- include: options.include?.join(','),
218
- exclude: options.exclude?.join(','),
219
- maxSize: options.maxSize,
220
- upload: options.upload,
221
- projectName: options.projectName,
222
- });
223
- });
224
- program
225
- .command('init [path]')
226
- .description('🚀 Initialize a new Delta project with wizard')
227
- .option('-t, --template <name>', 'Project template: default, nextjs, react, node, python', 'default')
228
- .option('-f, --force', 'Overwrite existing config', false)
229
- .option('--git', 'Initialize git repository', false)
230
- .option('--json', 'Output results as JSON', false)
231
- .option('--provider <name>', 'Execution provider: local, remote', 'local')
232
- .option('-w, --wizard', 'Run interactive wizard', false)
233
- .action(async (path, options) => {
234
- // Run wizard if requested or no path provided
235
- if (options.wizard || !path) {
236
- const wizardResult = await runInitWizard();
237
- await executeWizardActions(wizardResult);
238
- // Then run engine init with wizard results
239
- const engine = await initializeEngine();
240
- const response = await engine.execute({
241
- type: 'init',
242
- command: 'init',
243
- payload: {
244
- projectPath: wizardResult.projectPath,
245
- template: wizardResult.template,
246
- force: options.force,
247
- git: wizardResult.initializeGit,
248
- },
249
- options: {
250
- json: options.json || isNonTTY(),
251
- provider: options.provider,
252
- },
253
- });
254
- if (options.json || isNonTTY()) {
255
- outputJSON(response);
256
- }
257
- return;
258
- }
259
- // Standard init flow
260
- const engine = await initializeEngine();
261
- const projectPath = path || '.';
262
- const response = await engine.execute({
263
- type: 'init',
264
- command: 'init',
265
- payload: {
266
- projectPath,
267
- template: options.template,
268
- force: options.force,
269
- git: options.git,
270
- },
271
- options: {
272
- json: options.json || isNonTTY(),
273
- provider: options.provider,
274
- },
275
- });
276
- if (options.json || isNonTTY()) {
277
- outputJSON(response);
278
- }
279
- else {
280
- printWelcome();
281
- if (response.success) {
282
- console.log('\n📁 Project initialized');
283
- console.log(` Path: ${response.data?.projectPath}`);
284
- console.log(` Config: ${response.data?.configPath}`);
285
- console.log(` Template: ${response.data?.template}`);
286
- }
287
- else {
288
- console.error('\n❌ Init failed:', response.error?.message);
289
- process.exit(1);
290
- }
291
- }
292
- });
293
- program
294
- .command('config')
295
- .description('⚙️ Manage CLI configuration with schema validation')
296
- .option('-g, --get <key>', 'Get config value')
297
- .option('-s, --set <key=value>', 'Set config value')
298
- .option('-l, --list', 'List all config')
299
- .option('--reset', 'Reset to default configuration')
300
- .action(async (options) => {
301
- const { configCommand } = await import('./commands/config.js');
302
- await configCommand(options);
303
- });
304
- program
305
- .command('status [path]')
306
- .alias('st')
307
- .description('📈 Check project health, connection status, and diagnostics')
308
- .option('--diagnostics', 'Run full diagnostics', false)
309
- .option('--fix', 'Auto-fix issues where possible', false)
310
- .option('--json', 'Output results as JSON', false)
311
- .action(async (path, options) => {
312
- const engine = await initializeEngine();
313
- const projectPath = path || '.';
314
- const response = await engine.execute({
315
- type: 'status',
316
- command: 'status',
317
- payload: {
318
- projectPath,
319
- diagnostics: options.diagnostics,
320
- fix: options.fix,
321
- },
322
- options: {
323
- json: options.json || isNonTTY(),
324
- },
325
- });
326
- if (options.json || isNonTTY()) {
327
- outputJSON(response);
328
- }
329
- else {
330
- if (response.success) {
331
- const data = response.data;
332
- console.log('\n📊 Project Status');
333
- console.log(` Path: ${data?.project?.path || 'N/A'}`);
334
- console.log(` Config: ${data?.project?.hasConfig ? '✅' : '❌'}`);
335
- console.log(` Auth: ${data?.auth?.authenticated ? '✅' : '❌'}`);
336
- }
337
- else {
338
- console.error('\n❌ Status check failed:', response.error?.message);
339
- }
340
- }
341
- });
342
- program
343
- .command('completion [shell]')
344
- .description('🔧 Generate shell completion script')
345
- .option('--install', 'Install completion for current shell', false)
346
- .action(async (shell, options) => {
347
- const targetShell = shell || 'bash';
348
- if (options.install) {
349
- await installCompletion(targetShell);
350
- }
351
- else {
352
- console.log(generateCompletionScript(targetShell));
353
- }
354
- });
355
- // Parse arguments
356
- const args = process.argv.slice(2);
357
- // Handle slash commands (simplified)
358
- const slashCommandMap = {
359
- '/help': 'help',
360
- '/h': 'help',
361
- '/analyze': 'analyze',
362
- '/a': 'analyze',
363
- '/status': 'status',
364
- '/st': 'status',
365
- '/init': 'init',
366
- '/i': 'init',
367
- '/login': 'login',
368
- '/logout': 'logout',
369
- '/whoami': 'whoami',
370
- '/me': 'whoami',
371
- '/config': 'config',
372
- '/version': '--version',
373
- '/v': '--version',
374
- };
375
- // Convert slash commands to regular commands
376
- if (args.length > 0 && args[0].startsWith('/')) {
377
- const slashCmd = args[0].toLowerCase();
378
- const mappedCmd = slashCommandMap[slashCmd];
379
- if (mappedCmd) {
380
- if (mappedCmd.startsWith('--')) {
381
- // It's a flag like --version
382
- args[0] = mappedCmd;
383
- }
384
- else {
385
- // It's a command
386
- args[0] = mappedCmd;
387
- }
388
- }
389
- else {
390
- // Unknown slash command
391
- console.error(chalk.red(`❌ Unknown command: ${slashCmd}`));
392
- console.log(chalk.gray('Run /help to see available commands'));
393
- process.exit(1);
394
- }
395
- }
396
- program.parse(['node', 'delta', ...args]);
397
- // If no command provided, show welcome and help
398
- if (process.argv.length <= 2) {
399
- printWelcome();
400
- printTips();
401
- program.help();
402
- }
403
- //# 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,93 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * GitStatusPlugin - MVP Plugin Example
4
- * Displays git repository status in the sidebar
5
- * Demonstrates Plugin System capabilities
6
- */
7
- import { execSync } from 'child_process';
8
- import { Box, Text } from 'ink';
9
- export class GitStatusPlugin {
10
- id = 'git-status';
11
- name = 'Git Status';
12
- version = '1.0.0';
13
- description = 'Displays git repository status in the dashboard';
14
- context;
15
- branch = 'unknown';
16
- status = 'clean';
17
- aheadBehind = '';
18
- constructor(context) {
19
- this.context = context;
20
- }
21
- onActivate() {
22
- this.updateGitStatus();
23
- // Auto-update every 10 seconds
24
- setInterval(() => this.updateGitStatus(), 10000);
25
- this.context.addLog('GitStatus', 'Git Status Plugin activated', 'info');
26
- }
27
- onDeactivate() {
28
- this.context.addLog('GitStatus', 'Git Status Plugin deactivated', 'info');
29
- }
30
- registerCommands() {
31
- return [
32
- {
33
- id: 'refresh',
34
- label: 'Refresh Git Status',
35
- shortcut: 'g',
36
- icon: '🔄',
37
- execute: () => {
38
- this.updateGitStatus();
39
- this.context.addLog('GitStatus', 'Git status refreshed manually', 'success');
40
- },
41
- },
42
- ];
43
- }
44
- registerDashboardWidgets() {
45
- return [
46
- {
47
- id: 'git-info',
48
- title: 'Git Status',
49
- position: 'sidebar',
50
- priority: 10,
51
- render: () => this.renderWidget(),
52
- updateInterval: 10000,
53
- },
54
- ];
55
- }
56
- updateGitStatus() {
57
- try {
58
- // Check if we're in a git repo
59
- execSync('git rev-parse --git-dir', { stdio: 'pipe' });
60
- // Get current branch
61
- this.branch = execSync('git branch --show-current', { encoding: 'utf-8' }).trim();
62
- // Check for uncommitted changes
63
- const status = execSync('git status --porcelain', { encoding: 'utf-8' });
64
- this.status = status.trim() ? 'dirty' : 'clean';
65
- // Get ahead/behind info
66
- try {
67
- const aheadBehind = execSync('git rev-list --left-right --count HEAD...@{u} 2>/dev/null || echo "0\t0"', { encoding: 'utf-8' }).trim();
68
- const [ahead, behind] = aheadBehind.split('\t');
69
- if (ahead !== '0' || behind !== '0') {
70
- this.aheadBehind = `${ahead}↑ ${behind}↓`;
71
- }
72
- else {
73
- this.aheadBehind = '';
74
- }
75
- }
76
- catch {
77
- this.aheadBehind = '';
78
- }
79
- }
80
- catch {
81
- this.branch = 'not a repo';
82
- this.status = 'clean';
83
- this.aheadBehind = '';
84
- }
85
- }
86
- renderWidget() {
87
- const statusIcon = this.status === 'clean' ? '✓' : '⚡';
88
- const statusColor = this.status === 'clean' ? 'green' : 'yellow';
89
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, width: 28, marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "\uD83C\uDF3F Git Status" }), _jsxs(Text, { color: "white", children: ["Branch: ", this.branch] }), _jsxs(Text, { color: statusColor, children: [statusIcon, " ", this.status === 'clean' ? 'Clean' : 'Modified'] }), this.aheadBehind ? _jsx(Text, { color: "yellow", children: this.aheadBehind }) : null] }));
90
- }
91
- }
92
- export default GitStatusPlugin;
93
- //# sourceMappingURL=GitStatusPlugin.js.map
@@ -1,74 +0,0 @@
1
- /**
2
- * AI Provider (Placeholder)
3
- * Reserved for future AI integration without breaking existing architecture
4
- */
5
- import { ExitCode } from '../core/exit-codes.js';
6
- export class AIProviderPlaceholder {
7
- name = 'ai';
8
- version = '2.0.0-placeholder';
9
- capabilities = {
10
- commands: ['analyze'],
11
- features: {
12
- json: true,
13
- streaming: true,
14
- caching: false,
15
- ai: true,
16
- },
17
- constraints: {
18
- maxFileSize: 100 * 1024 * 1024, // 100MB
19
- requiresAuth: true,
20
- },
21
- };
22
- config;
23
- constructor(config) {
24
- this.config = config;
25
- }
26
- async isAvailable() {
27
- // AI provider is not available in current version
28
- // This will return true when AI is implemented
29
- return this.config.enabled && !!this.config.apiKey;
30
- }
31
- async execute(request) {
32
- const startTime = Date.now();
33
- // Placeholder: Return error indicating AI is not implemented
34
- return {
35
- success: false,
36
- exitCode: ExitCode.POLICY_BLOCKED,
37
- meta: {
38
- command: request.command,
39
- duration: Date.now() - startTime,
40
- timestamp: new Date().toISOString(),
41
- version: this.version,
42
- provider: this.name,
43
- },
44
- error: {
45
- code: 'AI_NOT_IMPLEMENTED',
46
- message: 'AI features are reserved for future releases. Use --provider=local for now.',
47
- details: {
48
- note: 'AI integration will be available in v2.1.0 without requiring any CLI changes',
49
- alternative: 'Use --provider=local for local execution or --provider=remote for cloud execution',
50
- },
51
- },
52
- };
53
- }
54
- // AI-specific methods (to be implemented)
55
- async generate(input, _context) {
56
- if (!this.config.enabled) {
57
- throw new Error('AI provider is not enabled');
58
- }
59
- // Placeholder implementation
60
- return `AI generation not implemented. Input received: ${input.substring(0, 50)}...`;
61
- }
62
- async analyzeCode(_code, _language) {
63
- if (!this.config.enabled) {
64
- throw new Error('AI provider is not enabled');
65
- }
66
- // Placeholder implementation
67
- return {
68
- insights: ['AI code analysis not yet implemented'],
69
- suggestions: ['Use --provider=local for current analysis capabilities'],
70
- score: 0,
71
- };
72
- }
73
- }
74
- //# sourceMappingURL=ai-provider.js.map