@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
@@ -1,41 +0,0 @@
1
- /**
2
- * Documentation pipeline - Core domain logic for documentation generation
3
- * @see docs/architecture/OVERVIEW.md#data-flow
4
- */
5
- /**
6
- * Documentation generator
7
- * Transforms analysis results into various documentation formats
8
- */
9
- export class DocumentationPipeline {
10
- /**
11
- * Generate documentation from analysis result
12
- * @param result - Analysis result
13
- * @param format - Output format
14
- * @returns Generated documentation content
15
- */
16
- async generate(result, format) {
17
- switch (format) {
18
- case 'md':
19
- return this.generateMarkdown(result);
20
- case 'html':
21
- return this.generateHtml(result);
22
- case 'pdf':
23
- return this.generatePdf(result);
24
- default:
25
- throw new Error(`Unsupported format: ${format}`);
26
- }
27
- }
28
- generateMarkdown(_result) {
29
- // Implementation placeholder
30
- return '# Analysis Report\n\nDocumentation placeholder.';
31
- }
32
- generateHtml(_result) {
33
- // Implementation placeholder
34
- return '<html><body><h1>Analysis Report</h1><p>Documentation placeholder.</p></body></html>';
35
- }
36
- generatePdf(_result) {
37
- // Implementation placeholder
38
- return Buffer.from('PDF placeholder');
39
- }
40
- }
41
- //# sourceMappingURL=pipeline.js.map
@@ -1,111 +0,0 @@
1
- /**
2
- * File system adapter - Local FS implementation
3
- * Uses fs-extra for enhanced FS operations and fast-glob for efficient file matching
4
- * @see docs/architecture/OVERVIEW.md#file-system-abstraction
5
- */
6
- import fse from 'fs-extra';
7
- import path from 'node:path';
8
- import fg from 'fast-glob';
9
- import { FileSystemError } from '../../types/errors.js';
10
- /**
11
- * Local file system adapter
12
- * Implements FileSystemAdapter for local disk access
13
- */
14
- export class LocalFSAdapter {
15
- basePath;
16
- constructor(basePath) {
17
- this.basePath = path.resolve(basePath);
18
- }
19
- async readFile(filePath) {
20
- const fullPath = this.resolvePath(filePath);
21
- try {
22
- return await fse.readFile(fullPath);
23
- }
24
- catch (error) {
25
- throw new FileSystemError(`Failed to read file ${filePath}: ${error instanceof Error ? error.message : 'Unknown error'}`);
26
- }
27
- }
28
- async readDir(dirPath) {
29
- const fullPath = this.resolvePath(dirPath);
30
- try {
31
- const entries = await fse.readdir(fullPath, { withFileTypes: true });
32
- return entries.map(entry => entry.name);
33
- }
34
- catch (error) {
35
- throw new FileSystemError(`Failed to read directory ${dirPath}: ${error instanceof Error ? error.message : 'Unknown error'}`);
36
- }
37
- }
38
- async exists(filePath) {
39
- const fullPath = this.resolvePath(filePath);
40
- return await fse.pathExists(fullPath);
41
- }
42
- async stat(filePath) {
43
- const fullPath = this.resolvePath(filePath);
44
- try {
45
- const stats = await fse.stat(fullPath);
46
- return {
47
- size: stats.size,
48
- isFile: stats.isFile(),
49
- isDirectory: stats.isDirectory(),
50
- modifiedTime: stats.mtime,
51
- createdTime: stats.birthtime,
52
- };
53
- }
54
- catch (error) {
55
- throw new FileSystemError(`Failed to stat ${filePath}: ${error instanceof Error ? error.message : 'Unknown error'}`);
56
- }
57
- }
58
- /**
59
- * Collect file information using fast-glob
60
- * @param dirPath - Directory to scan
61
- * @param patterns - Glob patterns to include/exclude
62
- * @returns Array of file info objects
63
- */
64
- async collectFiles(dirPath, patterns = {}) {
65
- const fullPath = this.resolvePath(dirPath);
66
- const include = patterns.include || ['**/*'];
67
- const exclude = patterns.exclude || ['**/node_modules/**', '**/.git/**'];
68
- const entries = await fg.glob(include, {
69
- cwd: fullPath,
70
- ignore: exclude,
71
- absolute: true,
72
- onlyFiles: true,
73
- stats: true,
74
- });
75
- return entries.map(entry => {
76
- const stats = entry.stats;
77
- return {
78
- path: entry.path,
79
- relativePath: path.relative(fullPath, entry.path),
80
- size: stats.size,
81
- extension: path.extname(entry.path),
82
- };
83
- });
84
- }
85
- /**
86
- * Ensure directory exists (create if not)
87
- * @param dirPath - Directory path
88
- */
89
- async ensureDir(dirPath) {
90
- const fullPath = this.resolvePath(dirPath);
91
- await fse.ensureDir(fullPath);
92
- }
93
- /**
94
- * Write file (create directory if not exists)
95
- * @param filePath - File path
96
- * @param content - File content
97
- */
98
- async writeFile(filePath, content) {
99
- const fullPath = this.resolvePath(filePath);
100
- await fse.outputFile(fullPath, content);
101
- }
102
- resolvePath(filePath) {
103
- const resolved = path.resolve(this.basePath, filePath);
104
- // Security: ensure path doesn't escape basePath
105
- if (!resolved.startsWith(this.basePath)) {
106
- throw new FileSystemError(`Path escapes jail: ${filePath}`);
107
- }
108
- return resolved;
109
- }
110
- }
111
- //# sourceMappingURL=adapter.js.map
@@ -1,5 +0,0 @@
1
- /**
2
- * FS core index
3
- */
4
- export { LocalFSAdapter } from './adapter.js';
5
- //# sourceMappingURL=index.js.map
@@ -1,166 +0,0 @@
1
- /**
2
- * AST Parser Module
3
- * Unified AST parsing with error isolation per file
4
- */
5
- // Temporarily commented out for build
6
- // import * as tsEstree from '@typescript-eslint/typescript-estree';
7
- // import * as babel from '@babel/parser';
8
- // TODO: Fix parser imports
9
- const parseTS = (_code, _options) => null;
10
- const parseBabel = (_code, _options) => null;
11
- const EXT_TO_LANGUAGE = {
12
- '.js': 'js',
13
- '.jsx': 'jsx',
14
- '.ts': 'ts',
15
- '.tsx': 'tsx',
16
- '.mjs': 'mjs',
17
- '.cjs': 'cjs',
18
- '.mts': 'mts',
19
- '.cts': 'cts',
20
- };
21
- export function detectLanguage(filePath) {
22
- const ext = filePath.slice(filePath.lastIndexOf('.')).toLowerCase();
23
- return EXT_TO_LANGUAGE[ext] || 'unknown';
24
- }
25
- export function detectModuleType(source) {
26
- if (/^\s*import\s+/m.test(source) || /^\s*export\s+/m.test(source))
27
- return 'esm';
28
- if (/\brequire\s*\(/m.test(source) || /\bmodule\.exports\b/m.test(source))
29
- return 'cjs';
30
- return 'unknown';
31
- }
32
- function calculateMetrics(ast) {
33
- const metrics = {
34
- loc: 0,
35
- functions: 0,
36
- classes: 0,
37
- imports: 0,
38
- exports: 0,
39
- complexity: 1,
40
- };
41
- function visit(node) {
42
- if (!node || typeof node !== 'object')
43
- return;
44
- const n = node;
45
- switch (n.type) {
46
- case 'FunctionDeclaration':
47
- case 'FunctionExpression':
48
- case 'ArrowFunctionExpression':
49
- metrics.functions++;
50
- break;
51
- case 'ClassDeclaration':
52
- case 'ClassExpression':
53
- metrics.classes++;
54
- break;
55
- case 'ImportDeclaration':
56
- metrics.imports++;
57
- break;
58
- case 'ExportNamedDeclaration':
59
- case 'ExportDefaultDeclaration':
60
- case 'ExportAllDeclaration':
61
- metrics.exports++;
62
- break;
63
- case 'IfStatement':
64
- case 'ConditionalExpression':
65
- case 'SwitchCase':
66
- case 'ForStatement':
67
- case 'ForInStatement':
68
- case 'ForOfStatement':
69
- case 'WhileStatement':
70
- case 'DoWhileStatement':
71
- metrics.complexity++;
72
- break;
73
- case 'LogicalExpression':
74
- if (n.operator === '&&' || n.operator === '||')
75
- metrics.complexity++;
76
- break;
77
- }
78
- // Visit children
79
- for (const key of Object.keys(n)) {
80
- const val = n[key];
81
- if (Array.isArray(val))
82
- val.forEach(visit);
83
- else if (val && typeof val === 'object')
84
- visit(val);
85
- }
86
- }
87
- visit(ast);
88
- return metrics;
89
- }
90
- export function parseSource(source, options) {
91
- const start = Date.now();
92
- const detectedLang = options.language || detectLanguage(options.filePath);
93
- // Skip non-JS/TS files
94
- if (detectedLang === 'unknown') {
95
- return {
96
- success: false,
97
- errors: [{ message: 'Unsupported file type', code: 'UNSUPPORTED' }],
98
- language: 'unknown',
99
- moduleType: 'unknown',
100
- metrics: { loc: 0, functions: 0, classes: 0, imports: 0, exports: 0, complexity: 0 },
101
- duration: Date.now() - start,
102
- };
103
- }
104
- const isTypeScript = detectedLang.startsWith('t') || detectedLang === 'mts' || detectedLang === 'cts';
105
- const isJSX = detectedLang === 'jsx' || detectedLang === 'tsx';
106
- try {
107
- let ast;
108
- if (isTypeScript) {
109
- ast = parseTS(source, {
110
- loc: true,
111
- range: true,
112
- comment: true,
113
- jsx: isJSX,
114
- errorOnUnknownASTType: false,
115
- });
116
- }
117
- else {
118
- ast = parseBabel(source, {
119
- sourceType: 'unambiguous',
120
- allowImportExportEverywhere: true,
121
- plugins: [
122
- 'jsx',
123
- 'typescript',
124
- 'decorators-legacy',
125
- 'classProperties',
126
- 'dynamicImport',
127
- 'optionalChaining',
128
- ],
129
- });
130
- }
131
- const metrics = calculateMetrics(ast);
132
- metrics.loc = source.split('\n').length;
133
- return {
134
- success: true,
135
- ast,
136
- errors: [],
137
- language: detectedLang,
138
- moduleType: detectModuleType(source),
139
- metrics,
140
- duration: Date.now() - start,
141
- };
142
- }
143
- catch (err) {
144
- return {
145
- success: false,
146
- errors: [
147
- {
148
- message: err instanceof Error ? err.message : 'Parse failed',
149
- code: 'PARSE_ERROR',
150
- },
151
- ],
152
- language: detectedLang,
153
- moduleType: detectModuleType(source),
154
- metrics: {
155
- loc: source.split('\n').length,
156
- functions: 0,
157
- classes: 0,
158
- imports: 0,
159
- exports: 0,
160
- complexity: 0,
161
- },
162
- duration: Date.now() - start,
163
- };
164
- }
165
- }
166
- //# sourceMappingURL=unified-parser.js.map
@@ -1,33 +0,0 @@
1
- /**
2
- * Delta Domain Package
3
- * @description Pure business logic, constitution, rules, and core engine
4
- * @package @delta/domain
5
- */
6
- // Constitution - explicit exports to avoid conflicts
7
- export { SevenAxes, SupportedLanguages, ConstitutionVersion, calculateOverallScore, getRulesForLanguage, isLanguageSupported, } from './constitution/index.js';
8
- // Export constitution axes as namespaces
9
- export * as Security from './constitution/security/index.js';
10
- export * as Performance from './constitution/performance/index.js';
11
- export * as Soc from './constitution/soc/index.js';
12
- export * as Contracts from './constitution/contracts/index.js';
13
- export * as Maintainability from './constitution/maintainability/index.js';
14
- export * as Observability from './constitution/observability/index.js';
15
- // Core Engine - selective exports
16
- export { AnalysisEngineV1 } from './core/analysis/engine.contract.js';
17
- export { analyze, createSession } from './core/analysis/engine.js';
18
- export { discoverFiles, isValidProjectRoot, analyzeProjectTypes, } from './core/analysis/discovery.js';
19
- export { runAnalysis, generateReport, saveReport, } from './core/analysis/orchestrator.js';
20
- // Other core modules
21
- export * from './core/documentation/index.js';
22
- export * from './core/comparison/index.js';
23
- export * from './core/fs/index.js';
24
- // Rules
25
- export * from './rules/index.js';
26
- // Types
27
- export * from './types/index.js';
28
- // Contracts
29
- export * from './contracts/index.js';
30
- export { rulesRegistry } from './control/registry/rules.registry.js';
31
- // Plugin System
32
- export { PluginRegistry, } from './plugin/registry.js';
33
- //# sourceMappingURL=index.js.map
@@ -1,195 +0,0 @@
1
- /**
2
- * Delta Plugin Registry
3
- * Central management for all plugins
4
- */
5
- export class PluginRegistry {
6
- plugins = new Map();
7
- commands = new Map();
8
- widgets = new Map();
9
- logHandlers = new Map();
10
- listeners = [];
11
- pluginStates = new Map();
12
- constructor(_context) {
13
- // _context stored for future use
14
- }
15
- /**
16
- * Register a new plugin
17
- */
18
- async register(plugin) {
19
- if (this.plugins.has(plugin.id)) {
20
- throw new Error(`Plugin ${plugin.id} is already registered`);
21
- }
22
- // Store plugin
23
- this.plugins.set(plugin.id, plugin);
24
- // Register commands
25
- const commands = plugin.registerCommands?.() || [];
26
- commands.forEach((cmd) => {
27
- const key = `${plugin.id}:${cmd.id}`;
28
- this.commands.set(key, { plugin, command: cmd });
29
- });
30
- // Register widgets
31
- const widgets = plugin.registerDashboardWidgets?.() || [];
32
- widgets.forEach((widget) => {
33
- const key = `${plugin.id}:${widget.id}`;
34
- this.widgets.set(key, { plugin, widget });
35
- });
36
- // Register log handlers
37
- const handlers = plugin.registerLogHandlers?.() || [];
38
- if (handlers.length > 0) {
39
- this.logHandlers.set(plugin.id, handlers.map((h) => ({ plugin, handler: h })));
40
- }
41
- // Initialize state
42
- this.pluginStates.set(plugin.id, {
43
- id: plugin.id,
44
- enabled: true,
45
- settings: {},
46
- });
47
- // Activate plugin
48
- await plugin.onActivate();
49
- this.emit({ type: 'plugin:registered', pluginId: plugin.id });
50
- this.emit({ type: 'plugin:activated', pluginId: plugin.id });
51
- }
52
- /**
53
- * Unregister a plugin
54
- */
55
- async unregister(pluginId) {
56
- const plugin = this.plugins.get(pluginId);
57
- if (!plugin)
58
- return;
59
- // Deactivate
60
- await plugin.onDeactivate?.();
61
- // Remove commands
62
- for (const [key, { plugin: p }] of this.commands) {
63
- if (p.id === pluginId)
64
- this.commands.delete(key);
65
- }
66
- // Remove widgets
67
- for (const [key, { plugin: p }] of this.widgets) {
68
- if (p.id === pluginId)
69
- this.widgets.delete(key);
70
- }
71
- // Remove log handlers
72
- this.logHandlers.delete(pluginId);
73
- // Remove plugin
74
- this.plugins.delete(pluginId);
75
- this.pluginStates.delete(pluginId);
76
- this.emit({ type: 'plugin:deactivated', pluginId });
77
- }
78
- /**
79
- * Execute a plugin command
80
- */
81
- async executeCommand(pluginId, commandId) {
82
- const key = `${pluginId}:${commandId}`;
83
- const entry = this.commands.get(key);
84
- if (!entry)
85
- throw new Error(`Command ${commandId} not found in plugin ${pluginId}`);
86
- await entry.command.execute();
87
- this.emit({ type: 'command:executed', pluginId, commandId });
88
- }
89
- /**
90
- * Get all registered commands with their plugins
91
- */
92
- getAllCommands() {
93
- return Array.from(this.commands.entries()).map(([key, { command }]) => {
94
- const [pluginId] = key.split(':');
95
- return { pluginId, command };
96
- });
97
- }
98
- /**
99
- * Get commands for menu display (with shortcuts)
100
- */
101
- getMenuCommands() {
102
- const all = this.getAllCommands();
103
- let counter = 9; // Start after built-in 1-8
104
- return all.map(({ pluginId, command }) => ({
105
- pluginId,
106
- command,
107
- num: command.shortcut || String(counter++),
108
- }));
109
- }
110
- /**
111
- * Get all widgets grouped by position
112
- */
113
- getWidgetsByPosition() {
114
- const result = {
115
- sidebar: [],
116
- main: [],
117
- 'status-bar': [],
118
- };
119
- for (const { widget } of this.widgets.values()) {
120
- result[widget.position].push(widget);
121
- }
122
- // Sort by priority (higher first)
123
- Object.keys(result).forEach((pos) => {
124
- result[pos].sort((a, b) => (b.priority || 0) - (a.priority || 0));
125
- });
126
- return result;
127
- }
128
- /**
129
- * Process a log entry through all handlers
130
- */
131
- processLog(entry) {
132
- let result = entry;
133
- for (const handlers of this.logHandlers.values()) {
134
- for (const { handler } of handlers) {
135
- // Check patterns
136
- if (handler.servicePattern && !handler.servicePattern.test(result.service)) {
137
- continue;
138
- }
139
- if (handler.messagePattern && !handler.messagePattern.test(result.message)) {
140
- continue;
141
- }
142
- // Apply transform
143
- if (handler.transform) {
144
- result = handler.transform(result);
145
- if (result === null)
146
- return null; // Filtered out
147
- }
148
- // Apply enrich
149
- if (handler.enrich) {
150
- result = handler.enrich(result);
151
- }
152
- }
153
- }
154
- return result;
155
- }
156
- /**
157
- * Get plugin state
158
- */
159
- getPluginState(pluginId) {
160
- return this.pluginStates.get(pluginId);
161
- }
162
- /**
163
- * Update plugin settings
164
- */
165
- updatePluginSettings(pluginId, settings) {
166
- const state = this.pluginStates.get(pluginId);
167
- if (state) {
168
- state.settings = { ...state.settings, ...settings };
169
- this.pluginStates.set(pluginId, state);
170
- const plugin = this.plugins.get(pluginId);
171
- plugin?.onSettingsChange?.(state.settings);
172
- }
173
- }
174
- /**
175
- * Subscribe to plugin events
176
- */
177
- subscribe(listener) {
178
- this.listeners.push(listener);
179
- return () => {
180
- const index = this.listeners.indexOf(listener);
181
- if (index > -1)
182
- this.listeners.splice(index, 1);
183
- };
184
- }
185
- /**
186
- * Get all registered plugin IDs
187
- */
188
- getRegisteredPlugins() {
189
- return Array.from(this.plugins.keys());
190
- }
191
- emit(event) {
192
- this.listeners.forEach((listener) => listener(event));
193
- }
194
- }
195
- //# sourceMappingURL=registry.js.map
@@ -1,6 +0,0 @@
1
- /**
2
- * Delta Plugin System - Core Types and Interfaces
3
- * Extensible architecture for Delta Manager TUI
4
- */
5
- export {};
6
- //# sourceMappingURL=types.js.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Analysis Engine Port
3
- * @description Interface for code analysis operations
4
- * @module packages/domain/ports/analysis.engine
5
- */
6
- export {};
7
- //# sourceMappingURL=analysis.engine.js.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Audit Logger Port
3
- * @description Interface for audit logging operations
4
- * @module packages/domain/ports/audit.logger
5
- */
6
- export {};
7
- //# sourceMappingURL=audit.logger.js.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Project Repository Port
3
- * @description Interface for project persistence operations
4
- * @module packages/domain/ports/project.repository
5
- */
6
- export {};
7
- //# sourceMappingURL=project.repository.js.map