@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,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