@vee-stack/delta-cli 2.0.8 → 2.0.9

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 (109) hide show
  1. package/dist/adapters/analysis.adapter.js +42 -0
  2. package/dist/analyzer/commands/analyze.js +74 -114
  3. package/dist/auth/device-auth.js +261 -0
  4. package/dist/auth/secure-auth.js +45 -16
  5. package/dist/commands/analyze.js +30 -27
  6. package/dist/commands/auth.js +13 -16
  7. package/dist/commands/status.js +2 -2
  8. package/dist/commands/whoami.js +6 -6
  9. package/dist/components/Dashboard.js +3 -5
  10. package/dist/components/DeltaApp.js +1 -1
  11. package/dist/components/UnifiedManager.js +48 -20
  12. package/dist/core/completion.js +14 -3
  13. package/dist/core/engine.js +10 -4
  14. package/dist/core/exit-codes.js +12 -4
  15. package/dist/core/wizard.js +1 -1
  16. package/dist/index.js +21 -5
  17. package/dist/providers/remote-provider.js +2 -2
  18. package/dist/telemetry/wrapper.js +114 -0
  19. package/dist/ui.js +9 -2
  20. package/dist/welcome.js +14 -4
  21. package/package.json +3 -1
  22. package/dist/apps/cli/src/analyzer/commands/analyze.js +0 -256
  23. package/dist/apps/cli/src/analyzer/commands/config.js +0 -83
  24. package/dist/apps/cli/src/analyzer/commands/report.js +0 -38
  25. package/dist/apps/cli/src/analyzer/generators/report.generator.js +0 -123
  26. package/dist/apps/cli/src/analyzer/index.js +0 -44
  27. package/dist/apps/cli/src/analyzer/scanners/project.scanner.js +0 -92
  28. package/dist/apps/cli/src/analyzer/validators/contracts.validator.js +0 -42
  29. package/dist/apps/cli/src/analyzer/validators/maintainability.validator.js +0 -40
  30. package/dist/apps/cli/src/analyzer/validators/observability.validator.js +0 -39
  31. package/dist/apps/cli/src/analyzer/validators/performance.validator.js +0 -42
  32. package/dist/apps/cli/src/analyzer/validators/security.validator.js +0 -66
  33. package/dist/apps/cli/src/analyzer/validators/soc.validator.js +0 -75
  34. package/dist/apps/cli/src/auth/secure-auth.js +0 -312
  35. package/dist/apps/cli/src/commands/analyze.js +0 -286
  36. package/dist/apps/cli/src/commands/auth-new.js +0 -37
  37. package/dist/apps/cli/src/commands/auth.js +0 -122
  38. package/dist/apps/cli/src/commands/config.js +0 -49
  39. package/dist/apps/cli/src/commands/deploy.js +0 -6
  40. package/dist/apps/cli/src/commands/init.js +0 -47
  41. package/dist/apps/cli/src/commands/logout.js +0 -23
  42. package/dist/apps/cli/src/commands/plugins.js +0 -21
  43. package/dist/apps/cli/src/commands/status.js +0 -80
  44. package/dist/apps/cli/src/commands/sync.js +0 -6
  45. package/dist/apps/cli/src/commands/whoami.js +0 -115
  46. package/dist/apps/cli/src/components/Dashboard.js +0 -168
  47. package/dist/apps/cli/src/components/DeltaApp.js +0 -56
  48. package/dist/apps/cli/src/components/UnifiedManager.js +0 -324
  49. package/dist/apps/cli/src/core/audit.js +0 -184
  50. package/dist/apps/cli/src/core/completion.js +0 -294
  51. package/dist/apps/cli/src/core/contracts.js +0 -6
  52. package/dist/apps/cli/src/core/engine.js +0 -124
  53. package/dist/apps/cli/src/core/exit-codes.js +0 -71
  54. package/dist/apps/cli/src/core/hooks.js +0 -181
  55. package/dist/apps/cli/src/core/index.js +0 -7
  56. package/dist/apps/cli/src/core/policy.js +0 -115
  57. package/dist/apps/cli/src/core/profiles.js +0 -161
  58. package/dist/apps/cli/src/core/wizard.js +0 -203
  59. package/dist/apps/cli/src/index.js +0 -636
  60. package/dist/apps/cli/src/interactive/index.js +0 -11
  61. package/dist/apps/cli/src/plugins/GitStatusPlugin.js +0 -99
  62. package/dist/apps/cli/src/providers/ai-provider.js +0 -74
  63. package/dist/apps/cli/src/providers/local-provider.js +0 -302
  64. package/dist/apps/cli/src/providers/remote-provider.js +0 -100
  65. package/dist/apps/cli/src/types/api.js +0 -3
  66. package/dist/apps/cli/src/ui.js +0 -219
  67. package/dist/apps/cli/src/welcome.js +0 -81
  68. package/dist/bundle.js +0 -504
  69. package/dist/packages/domain/src/constitution/contracts/index.js +0 -43
  70. package/dist/packages/domain/src/constitution/contracts/ts.rules.js +0 -268
  71. package/dist/packages/domain/src/constitution/index.js +0 -139
  72. package/dist/packages/domain/src/constitution/maintainability/index.js +0 -43
  73. package/dist/packages/domain/src/constitution/maintainability/ts.rules.js +0 -344
  74. package/dist/packages/domain/src/constitution/observability/index.js +0 -43
  75. package/dist/packages/domain/src/constitution/observability/ts.rules.js +0 -307
  76. package/dist/packages/domain/src/constitution/performance/index.js +0 -43
  77. package/dist/packages/domain/src/constitution/performance/ts.rules.js +0 -325
  78. package/dist/packages/domain/src/constitution/security/index.js +0 -50
  79. package/dist/packages/domain/src/constitution/security/ts.rules.js +0 -267
  80. package/dist/packages/domain/src/constitution/soc/index.js +0 -43
  81. package/dist/packages/domain/src/constitution/soc/ts.rules.js +0 -360
  82. package/dist/packages/domain/src/contracts/analysis.contract.js +0 -18
  83. package/dist/packages/domain/src/contracts/index.js +0 -7
  84. package/dist/packages/domain/src/contracts/projects.contract.js +0 -18
  85. package/dist/packages/domain/src/control/registry/rules.registry.js +0 -29
  86. package/dist/packages/domain/src/control/schemas/policies.js +0 -6
  87. package/dist/packages/domain/src/core/analysis/discovery.js +0 -163
  88. package/dist/packages/domain/src/core/analysis/engine.contract.js +0 -298
  89. package/dist/packages/domain/src/core/analysis/engine.js +0 -77
  90. package/dist/packages/domain/src/core/analysis/index.js +0 -14
  91. package/dist/packages/domain/src/core/analysis/orchestrator.js +0 -242
  92. package/dist/packages/domain/src/core/comparison/engine.js +0 -29
  93. package/dist/packages/domain/src/core/comparison/index.js +0 -5
  94. package/dist/packages/domain/src/core/documentation/index.js +0 -5
  95. package/dist/packages/domain/src/core/documentation/pipeline.js +0 -41
  96. package/dist/packages/domain/src/core/fs/adapter.js +0 -111
  97. package/dist/packages/domain/src/core/fs/index.js +0 -5
  98. package/dist/packages/domain/src/core/parser/unified-parser.js +0 -166
  99. package/dist/packages/domain/src/index.js +0 -33
  100. package/dist/packages/domain/src/plugin/registry.js +0 -195
  101. package/dist/packages/domain/src/plugin/types.js +0 -6
  102. package/dist/packages/domain/src/ports/analysis.engine.js +0 -7
  103. package/dist/packages/domain/src/ports/audit.logger.js +0 -7
  104. package/dist/packages/domain/src/ports/project.repository.js +0 -7
  105. package/dist/packages/domain/src/rules/index.js +0 -134
  106. package/dist/packages/domain/src/types/analysis.js +0 -6
  107. package/dist/packages/domain/src/types/errors.js +0 -53
  108. package/dist/packages/domain/src/types/fs.js +0 -6
  109. package/dist/packages/domain/src/types/index.js +0 -7
@@ -1,134 +0,0 @@
1
- /**
2
- * Rules Implementation - First Rule Engine
3
- * Concrete rule implementations using pure functions
4
- * @module rules
5
- */
6
- import { rulesRegistry } from '../control/registry/rules.registry.js';
7
- /**
8
- * File Size Rule
9
- * Checks if file exceeds maximum size
10
- */
11
- const fileSizeRule = (input, policy) => {
12
- if (policy.type !== 'file-size')
13
- return [];
14
- const contentSizeKB = Buffer.byteLength(input.content, 'utf8') / 1024;
15
- const findings = [];
16
- if (policy.maxSizeKB && contentSizeKB > policy.maxSizeKB) {
17
- findings.push({
18
- id: `file-size-${input.file}`,
19
- ruleId: policy.id,
20
- severity: policy.severity,
21
- category: policy.category,
22
- message: `File size (${contentSizeKB.toFixed(2)} KB) exceeds maximum (${policy.maxSizeKB} KB)`,
23
- filePath: input.file,
24
- line: 1,
25
- column: 1,
26
- suggestion: 'Consider splitting this file into smaller modules',
27
- relatedFindings: [],
28
- });
29
- }
30
- return findings;
31
- };
32
- /**
33
- * Forbidden Patterns Rule
34
- * Detects forbidden patterns in code
35
- */
36
- const forbiddenPatternsRule = (input, policy) => {
37
- if (policy.type !== 'forbidden-patterns')
38
- return [];
39
- const findings = [];
40
- if (!policy.patterns)
41
- return findings;
42
- for (const pattern of policy.patterns) {
43
- const regex = new RegExp(pattern.pattern, pattern.caseSensitive ? 'g' : 'gi');
44
- const lines = input.content.split('\n');
45
- for (let i = 0; i < lines.length; i++) {
46
- const line = lines[i];
47
- const matches = line.match(regex);
48
- if (matches) {
49
- findings.push({
50
- id: `forbidden-${policy.id}-${i}`,
51
- ruleId: policy.id,
52
- severity: pattern.severity,
53
- category: policy.category,
54
- message: pattern.message,
55
- filePath: input.file,
56
- line: i + 1,
57
- column: line.indexOf(matches[0]) + 1,
58
- suggestion: 'Remove or replace this pattern',
59
- relatedFindings: [],
60
- });
61
- }
62
- }
63
- }
64
- return findings;
65
- };
66
- /**
67
- * Complexity Rule
68
- * Calculates code complexity
69
- */
70
- const complexityRule = (input, policy) => {
71
- if (policy.type !== 'complexity')
72
- return [];
73
- const findings = [];
74
- // Count decision points (if, switch, for, while, etc.)
75
- const decisionPoints = [
76
- /\bif\s*\(/g,
77
- /\bswitch\s*\(/g,
78
- /\bfor\s*\(/g,
79
- /\bwhile\s*\(/g,
80
- /\bcatch\s*\(/g,
81
- /\?\s*[^:]+:/g, // ternary
82
- ];
83
- let cyclomaticComplexity = 1; // base complexity
84
- for (const pattern of decisionPoints) {
85
- const matches = input.content.match(pattern);
86
- if (matches) {
87
- cyclomaticComplexity += matches.length;
88
- }
89
- }
90
- if (policy.maxCyclomaticComplexity && cyclomaticComplexity > policy.maxCyclomaticComplexity) {
91
- findings.push({
92
- id: `complexity-${input.file}`,
93
- ruleId: policy.id,
94
- severity: policy.severity,
95
- category: policy.category,
96
- message: `Cyclomatic complexity (${cyclomaticComplexity}) exceeds maximum (${policy.maxCyclomaticComplexity})`,
97
- filePath: input.file,
98
- line: 1,
99
- column: 1,
100
- suggestion: 'Refactor into smaller functions to reduce complexity',
101
- relatedFindings: [],
102
- });
103
- }
104
- return findings;
105
- };
106
- /**
107
- * Register all rules
108
- */
109
- export function registerDefaultRules() {
110
- rulesRegistry.register({
111
- id: 'file-size',
112
- name: 'File Size Check',
113
- description: 'Checks if files exceed maximum size limits',
114
- category: 'maintainability',
115
- execute: fileSizeRule,
116
- });
117
- rulesRegistry.register({
118
- id: 'forbidden-patterns',
119
- name: 'Forbidden Patterns',
120
- description: 'Detects forbidden patterns in code',
121
- category: 'security',
122
- execute: forbiddenPatternsRule,
123
- });
124
- rulesRegistry.register({
125
- id: 'complexity',
126
- name: 'Code Complexity',
127
- description: 'Analyzes code complexity metrics',
128
- category: 'maintainability',
129
- execute: complexityRule,
130
- });
131
- }
132
- // Auto-register on module load
133
- registerDefaultRules();
134
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- /**
2
- * Analysis types
3
- * @see docs/architecture/OVERVIEW.md#data-flow
4
- */
5
- export {};
6
- //# sourceMappingURL=analysis.js.map
@@ -1,53 +0,0 @@
1
- /**
2
- * Base error class for Delta Platform
3
- * @see docs/architecture/OVERVIEW.md#error-handling
4
- */
5
- export class DeltaError extends Error {
6
- code;
7
- incidentId;
8
- timestamp;
9
- constructor(code, message, incidentId) {
10
- super(message);
11
- this.code = code;
12
- this.incidentId = incidentId;
13
- this.timestamp = new Date();
14
- this.name = 'DeltaError';
15
- }
16
- }
17
- /**
18
- * Configuration-related errors
19
- */
20
- export class ConfigError extends DeltaError {
21
- constructor(message, incidentId) {
22
- super('CONFIG_ERROR', message, incidentId);
23
- this.name = 'ConfigError';
24
- }
25
- }
26
- /**
27
- * Analysis-related errors
28
- */
29
- export class AnalysisError extends DeltaError {
30
- constructor(message, incidentId) {
31
- super('ANALYSIS_ERROR', message, incidentId);
32
- this.name = 'AnalysisError';
33
- }
34
- }
35
- /**
36
- * Sync-related errors
37
- */
38
- export class SyncError extends DeltaError {
39
- constructor(message, incidentId) {
40
- super('SYNC_ERROR', message, incidentId);
41
- this.name = 'SyncError';
42
- }
43
- }
44
- /**
45
- * File system-related errors
46
- */
47
- export class FileSystemError extends DeltaError {
48
- constructor(message, incidentId) {
49
- super('FS_ERROR', message, incidentId);
50
- this.name = 'FileSystemError';
51
- }
52
- }
53
- //# sourceMappingURL=errors.js.map
@@ -1,6 +0,0 @@
1
- /**
2
- * File system types
3
- * @see docs/architecture/OVERVIEW.md#file-system-abstraction
4
- */
5
- export {};
6
- //# sourceMappingURL=fs.js.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Core types index
3
- */
4
- export * from './errors.js';
5
- export * from './fs.js';
6
- export * from './analysis.js';
7
- //# sourceMappingURL=index.js.map