@vee-stack/delta-cli 2.0.7 → 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,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
@@ -1,268 +0,0 @@
1
- /**
2
- * Delta Constitution - Contracts Rules
3
- * @description Contract standards and API interface definitions
4
- * @version 1.0.0
5
- * @see docs/architecture/CONSTITUTION.md
6
- */
7
- // =============================================================================
8
- // CONTRACTS RULE DEFINITIONS
9
- // =============================================================================
10
- export const ContractsRules = {
11
- version: '1.0.0',
12
- lastUpdated: '2026-02-10',
13
- // ============================================================================
14
- // 1. CONTRACT REQUIREMENTS
15
- // ============================================================================
16
- requirements: {
17
- enabled: true,
18
- required: true,
19
- description: 'Every Module must have a corresponding Contract',
20
- requiredContracts: [
21
- {
22
- name: 'AuthContract',
23
- file: 'src/contracts/auth.contract.ts',
24
- module: 'src/modules/auth/',
25
- features: ['src/features/auth/'],
26
- },
27
- {
28
- name: 'UploadContract',
29
- file: 'src/contracts/upload.contract.ts',
30
- module: 'src/modules/upload/',
31
- features: ['src/features/upload/'],
32
- },
33
- {
34
- name: 'ProjectsContract',
35
- file: 'src/contracts/projects.contract.ts',
36
- module: 'src/modules/projects/',
37
- features: ['src/features/projects/'],
38
- },
39
- {
40
- name: 'AnalysisContract',
41
- file: 'src/contracts/analysis.contract.ts',
42
- module: 'src/modules/analysis/',
43
- features: ['src/features/dashboard/'],
44
- },
45
- ],
46
- rules: [
47
- {
48
- id: 'CONTRACT-001',
49
- name: 'One Contract Per Module',
50
- description: 'Every module must export a corresponding contract',
51
- severity: 'error',
52
- },
53
- {
54
- id: 'CONTRACT-002',
55
- name: 'Features Use Contracts Only',
56
- description: 'Features can only import from Contracts, not Modules directly',
57
- severity: 'error',
58
- },
59
- ],
60
- },
61
- // ============================================================================
62
- // 2. CONTRACT STRUCTURE
63
- // ============================================================================
64
- structure: {
65
- enabled: true,
66
- required: true,
67
- description: 'Standard contract file structure',
68
- requiredSections: {
69
- header: {
70
- description: 'JSDoc header with version and stability',
71
- template: `
72
- /**
73
- * [Name] Contract v[version]
74
- * @description [Description]
75
- * @version [major].[minor].[patch]
76
- * @stability [stable|experimental|deprecated]
77
- */`,
78
- },
79
- inputContracts: {
80
- description: 'Input interfaces and types',
81
- naming: '[Action]Input',
82
- example: 'InitUploadInput, UploadChunkInput',
83
- },
84
- outputContracts: {
85
- description: 'Output interfaces and types',
86
- naming: '[Action]Output or [Entity]',
87
- example: 'UploadSession, UploadResult',
88
- },
89
- errorContracts: {
90
- description: 'Error types and codes',
91
- required: true,
92
- },
93
- },
94
- example: `
95
- /**
96
- * Upload Contract v1.0.0
97
- * @description Public API for File Upload operations
98
- * @version 1.0.0
99
- * @stability stable
100
- */
101
-
102
- // Input Contracts
103
- export interface InitUploadInput {
104
- filename: string;
105
- fileSize: number;
106
- // ...
107
- }
108
-
109
- // Output Contracts
110
- export interface UploadSession {
111
- id: string;
112
- status: 'initializing' | 'uploading' | 'completed';
113
- // ...
114
- }
115
-
116
- // Error Contracts
117
- export interface UploadError {
118
- code: string;
119
- message: string;
120
- statusCode: number;
121
- }
122
- `,
123
- },
124
- // ============================================================================
125
- // 3. VERSIONING
126
- // ============================================================================
127
- versioning: {
128
- enabled: true,
129
- required: true,
130
- description: 'Semantic versioning for contracts',
131
- scheme: 'semver',
132
- rules: {
133
- major: {
134
- bump: 'Breaking changes',
135
- examples: [
136
- 'Removing or renaming interfaces',
137
- 'Changing required fields',
138
- 'Changing behavior significantly',
139
- ],
140
- },
141
- minor: {
142
- bump: 'New features, backwards compatible',
143
- examples: ['Adding optional fields', 'Adding new interfaces', 'Extending functionality'],
144
- },
145
- patch: {
146
- bump: 'Bug fixes, documentation',
147
- examples: ['Fixing types', 'Documentation updates', 'Non-breaking corrections'],
148
- },
149
- },
150
- stability: {
151
- stable: 'Production ready, no breaking changes expected',
152
- experimental: 'May change, not recommended for production',
153
- deprecated: 'Will be removed in next major version',
154
- },
155
- },
156
- // ============================================================================
157
- // 4. INTERFACE DESIGN
158
- // ============================================================================
159
- interfaceDesign: {
160
- enabled: true,
161
- required: true,
162
- description: 'Best practices for contract interfaces',
163
- naming: {
164
- inputs: '[Action]Input',
165
- outputs: '[Action]Output or descriptive noun',
166
- errors: '[Domain]Error',
167
- enums: 'PascalCase',
168
- },
169
- requiredFields: {
170
- id: 'Unique identifier for tracking',
171
- timestamp: 'ISO 8601 timestamp',
172
- userId: 'Actor who performed the action',
173
- },
174
- optionalFields: {
175
- metadata: 'Additional context (key-value)',
176
- tags: 'Labels for categorization',
177
- },
178
- documentation: {
179
- required: true,
180
- format: 'JSDoc',
181
- content: 'Purpose, type, examples for each field',
182
- },
183
- },
184
- // ============================================================================
185
- // 5. VALIDATION
186
- // ============================================================================
187
- validation: {
188
- enabled: true,
189
- required: true,
190
- description: 'Contract input validation requirements',
191
- schemas: {
192
- required: true,
193
- tool: 'Zod',
194
- location: 'Contracts must include Zod schemas',
195
- },
196
- runtime: {
197
- description: 'Validate at runtime using Zod',
198
- pattern: 'parse() or safeParse()',
199
- },
200
- compileTime: {
201
- description: 'TypeScript types from Zod schemas',
202
- pattern: 'z.infer<typeof Schema>',
203
- },
204
- },
205
- // ============================================================================
206
- // 6. BREAKING CHANGES
207
- // ============================================================================
208
- breakingChanges: {
209
- enabled: true,
210
- required: true,
211
- description: 'Handling breaking changes in contracts',
212
- policy: {
213
- deprecation: 'Mark old contract as deprecated for 1 major version',
214
- migration: 'Provide migration guide',
215
- coexistence: 'Support both versions during transition period',
216
- },
217
- process: [
218
- '1. Mark current contract as @deprecated',
219
- '2. Create new contract with v[major+1]',
220
- '3. Update all consumers gradually',
221
- '4. Remove deprecated contract in next major release',
222
- ],
223
- },
224
- };
225
- export function validateContract(check) {
226
- const violations = [];
227
- let score = 100;
228
- if (!check.hasVersion) {
229
- violations.push('CONTRACT-STRUCT-001: Missing version in contract header');
230
- score -= 15;
231
- }
232
- if (!check.hasStability) {
233
- violations.push('CONTRACT-STRUCT-002: Missing stability annotation');
234
- score -= 10;
235
- }
236
- if (!check.hasInputContracts) {
237
- violations.push('CONTRACT-STRUCT-003: Missing input contracts');
238
- score -= 20;
239
- }
240
- if (!check.hasOutputContracts) {
241
- violations.push('CONTRACT-STRUCT-004: Missing output contracts');
242
- score -= 20;
243
- }
244
- if (!check.hasErrorContracts) {
245
- violations.push('CONTRACT-STRUCT-005: Missing error contracts');
246
- score -= 15;
247
- }
248
- if (!check.hasZodSchemas) {
249
- violations.push('CONTRACT-VALID-001: Missing Zod validation schemas');
250
- score -= 20;
251
- }
252
- return {
253
- valid: violations.length === 0,
254
- violations,
255
- score: Math.max(0, score),
256
- };
257
- }
258
- export function checkContractCoverage(existingContracts, requiredContracts) {
259
- const missing = requiredContracts.filter(required => !existingContracts.some(existing => existing.includes(required)));
260
- const percentage = Math.round(((requiredContracts.length - missing.length) / requiredContracts.length) * 100);
261
- return {
262
- complete: missing.length === 0,
263
- missing,
264
- percentage,
265
- };
266
- }
267
- export default ContractsRules;
268
- //# sourceMappingURL=ts.rules.js.map
@@ -1,139 +0,0 @@
1
- /**
2
- * Delta Constitution
3
- * @description The 7 Axes of Delta Architecture - Multi-language support
4
- * @version 1.0.0
5
- * @see docs/architecture/CONSTITUTION.md
6
- *
7
- * This module exports all constitutional rules for analyzing projects
8
- * against the Delta Architecture standards.
9
- */
10
- // =============================================================================
11
- // 7 AXES EXPORTS
12
- // =============================================================================
13
- export * as Security from './security';
14
- export * as Performance from './performance';
15
- export * as Soc from './soc';
16
- export * as Contracts from './contracts';
17
- export * as Maintainability from './maintainability';
18
- export * as Observability from './observability';
19
- // =============================================================================
20
- // 7 AXES METADATA
21
- // =============================================================================
22
- export const SevenAxes = [
23
- {
24
- name: 'Security',
25
- weight: 25,
26
- description: 'Policy-driven, Fail-Closed, Audit, Rate Limiting',
27
- critical: true,
28
- },
29
- {
30
- name: 'Performance',
31
- weight: 20,
32
- description: 'Lazy Loading, Caching, Code Splitting',
33
- critical: false,
34
- },
35
- {
36
- name: 'Separation of Concerns',
37
- weight: 20,
38
- description: 'Layer boundaries, import rules, locality',
39
- critical: true,
40
- },
41
- {
42
- name: 'Contracts',
43
- weight: 15,
44
- description: 'Type-safe, versioned interfaces',
45
- critical: true,
46
- },
47
- {
48
- name: 'Maintainability',
49
- weight: 10,
50
- description: 'Tests, Docs, Pure Functions',
51
- critical: false,
52
- },
53
- {
54
- name: 'Observability',
55
- weight: 5,
56
- description: 'Health Checks, Logging, Metrics',
57
- critical: false,
58
- },
59
- {
60
- name: 'Best Practices',
61
- weight: 5,
62
- description: 'Clean Architecture, Stateless Core',
63
- critical: false,
64
- },
65
- ];
66
- // =============================================================================
67
- // SUPPORTED LANGUAGES
68
- // =============================================================================
69
- export const SupportedLanguages = [
70
- {
71
- code: 'ts',
72
- name: 'TypeScript',
73
- extension: '.ts',
74
- runtime: 'Node.js',
75
- status: 'stable',
76
- },
77
- {
78
- code: 'js',
79
- name: 'JavaScript',
80
- extension: '.js',
81
- runtime: 'Node.js',
82
- status: 'stable',
83
- },
84
- // Future support:
85
- // { code: 'py', name: 'Python', extension: '.py', runtime: 'CPython', status: 'planned' },
86
- // { code: 'java', name: 'Java', extension: '.java', runtime: 'JVM', status: 'planned' },
87
- // { code: 'cs', name: 'C#', extension: '.cs', runtime: '.NET', status: 'planned' },
88
- // { code: 'go', name: 'Go', extension: '.go', runtime: 'Go', status: 'planned' },
89
- ];
90
- // =============================================================================
91
- // CONSTITUTION VERSION
92
- // =============================================================================
93
- export const ConstitutionVersion = {
94
- major: 1,
95
- minor: 0,
96
- patch: 0,
97
- full: '1.0.0',
98
- date: '2026-02-10',
99
- status: 'stable',
100
- };
101
- export function calculateOverallScore(axisScores) {
102
- const totalWeight = SevenAxes.reduce((sum, axis) => sum + axis.weight, 0);
103
- let weightedScore = 0;
104
- SevenAxes.forEach(axis => {
105
- const score = axisScores[axis.name] || 0;
106
- weightedScore += (score * axis.weight) / 100;
107
- });
108
- const percentage = Math.round((weightedScore / totalWeight) * 100);
109
- const grade = percentage >= 90
110
- ? 'A'
111
- : percentage >= 80
112
- ? 'B'
113
- : percentage >= 70
114
- ? 'C'
115
- : percentage >= 60
116
- ? 'D'
117
- : 'F';
118
- return { total: weightedScore, percentage, grade };
119
- }
120
- export function getRulesForLanguage(_language) {
121
- // Language-specific rules can be loaded from axis subdirectories
122
- // e.g., Security.ts, Performance.ts, etc.
123
- return null;
124
- }
125
- export function isLanguageSupported(language) {
126
- return SupportedLanguages.some(lang => lang.code === language.toLowerCase() || lang.name.toLowerCase() === language.toLowerCase());
127
- }
128
- // =============================================================================
129
- // DEFAULT EXPORT
130
- // =============================================================================
131
- export default {
132
- version: ConstitutionVersion,
133
- axes: SevenAxes,
134
- languages: SupportedLanguages,
135
- calculateOverallScore,
136
- getRulesForLanguage,
137
- isLanguageSupported,
138
- };
139
- //# sourceMappingURL=index.js.map
@@ -1,43 +0,0 @@
1
- /**
2
- * Delta Constitution - Maintainability Rules Index
3
- * @description Maintainability rules for all supported languages
4
- * @version 1.0.0
5
- */
6
- // TypeScript / Node.js Rules
7
- export { default as ts, MaintainabilityRules as TSMaintainabilityRules } from './ts.rules';
8
- // Language-agnostic exports
9
- export const MaintainabilityAxis = {
10
- name: 'Maintainability',
11
- description: 'Locality of Behavior, Tests, Docs, Pure Functions',
12
- weight: 10,
13
- languages: ['typescript', 'javascript', 'node'],
14
- principles: [
15
- {
16
- id: 'MAINT-001',
17
- name: 'Locality of Behavior',
18
- description: 'All related code in one place',
19
- },
20
- {
21
- id: 'MAINT-002',
22
- name: 'Testing',
23
- description: 'Unit ≥80%, Integration ≥60%, E2E ≥30% coverage',
24
- },
25
- {
26
- id: 'MAINT-003',
27
- name: 'Documentation',
28
- description: 'JSDoc, READMEs, Blueprints for every layer',
29
- },
30
- {
31
- id: 'MAINT-004',
32
- name: 'Pure Functions',
33
- description: 'Core uses pure functions only',
34
- },
35
- {
36
- id: 'MAINT-005',
37
- name: 'Code Quality',
38
- description: 'Linting, formatting, complexity limits',
39
- },
40
- ],
41
- };
42
- export default MaintainabilityAxis;
43
- //# sourceMappingURL=index.js.map