sela-core 0.1.0-alpha.1
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.
- package/README.md +103 -0
- package/bin/sela.js +3 -0
- package/dist/cli/ErrorHandler.d.ts +10 -0
- package/dist/cli/ErrorHandler.d.ts.map +1 -0
- package/dist/cli/ErrorHandler.js +70 -0
- package/dist/cli/commands/bulk.d.ts +3 -0
- package/dist/cli/commands/bulk.d.ts.map +1 -0
- package/dist/cli/commands/bulk.js +158 -0
- package/dist/cli/commands/find.d.ts +3 -0
- package/dist/cli/commands/find.d.ts.map +1 -0
- package/dist/cli/commands/find.js +51 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +166 -0
- package/dist/cli/commands/list.d.ts +3 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +56 -0
- package/dist/cli/commands/merge.d.ts +13 -0
- package/dist/cli/commands/merge.d.ts.map +1 -0
- package/dist/cli/commands/merge.js +119 -0
- package/dist/cli/commands/refactor.d.ts +3 -0
- package/dist/cli/commands/refactor.d.ts.map +1 -0
- package/dist/cli/commands/refactor.js +30 -0
- package/dist/cli/commands/showReport.d.ts +3 -0
- package/dist/cli/commands/showReport.d.ts.map +1 -0
- package/dist/cli/commands/showReport.js +82 -0
- package/dist/cli/commands/status.d.ts +3 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +51 -0
- package/dist/cli/commands/sync.d.ts +3 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +131 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +94 -0
- package/dist/cli/ui/DnaTable.d.ts +3 -0
- package/dist/cli/ui/DnaTable.d.ts.map +1 -0
- package/dist/cli/ui/DnaTable.js +77 -0
- package/dist/cli/ui/LocatorPicker.d.ts +8 -0
- package/dist/cli/ui/LocatorPicker.d.ts.map +1 -0
- package/dist/cli/ui/LocatorPicker.js +33 -0
- package/dist/cli/ui/ProgressReporter.d.ts +11 -0
- package/dist/cli/ui/ProgressReporter.d.ts.map +1 -0
- package/dist/cli/ui/ProgressReporter.js +33 -0
- package/dist/cli/ui/RefactorWizard.d.ts +26 -0
- package/dist/cli/ui/RefactorWizard.d.ts.map +1 -0
- package/dist/cli/ui/RefactorWizard.js +295 -0
- package/dist/config/ConfigLoader.d.ts +16 -0
- package/dist/config/ConfigLoader.d.ts.map +1 -0
- package/dist/config/ConfigLoader.js +185 -0
- package/dist/config/DryRunGuard.d.ts +14 -0
- package/dist/config/DryRunGuard.d.ts.map +1 -0
- package/dist/config/DryRunGuard.js +80 -0
- package/dist/config/PathScopeGuard.d.ts +42 -0
- package/dist/config/PathScopeGuard.d.ts.map +1 -0
- package/dist/config/PathScopeGuard.js +192 -0
- package/dist/config/SelaConfig.d.ts +178 -0
- package/dist/config/SelaConfig.d.ts.map +1 -0
- package/dist/config/SelaConfig.js +141 -0
- package/dist/config/defineConfig.d.ts +3 -0
- package/dist/config/defineConfig.d.ts.map +1 -0
- package/dist/config/defineConfig.js +9 -0
- package/dist/engine/FixwrightEngine.d.ts +24 -0
- package/dist/engine/FixwrightEngine.d.ts.map +1 -0
- package/dist/engine/FixwrightEngine.js +403 -0
- package/dist/engine/HealingRegistry.d.ts +40 -0
- package/dist/engine/HealingRegistry.d.ts.map +1 -0
- package/dist/engine/HealingRegistry.js +99 -0
- package/dist/engine/SelaEngine.d.ts +57 -0
- package/dist/engine/SelaEngine.d.ts.map +1 -0
- package/dist/engine/SelaEngine.js +1146 -0
- package/dist/engine/singleton.d.ts +3 -0
- package/dist/engine/singleton.d.ts.map +1 -0
- package/dist/engine/singleton.js +5 -0
- package/dist/errors/SelaError.d.ts +146 -0
- package/dist/errors/SelaError.d.ts.map +1 -0
- package/dist/errors/SelaError.js +168 -0
- package/dist/fixtures/expectProxy.d.ts +12 -0
- package/dist/fixtures/expectProxy.d.ts.map +1 -0
- package/dist/fixtures/expectProxy.js +246 -0
- package/dist/fixtures/index.d.ts +30 -0
- package/dist/fixtures/index.d.ts.map +1 -0
- package/dist/fixtures/index.js +765 -0
- package/dist/fixtures/moduleExpect.d.ts +2 -0
- package/dist/fixtures/moduleExpect.d.ts.map +1 -0
- package/dist/fixtures/moduleExpect.js +54 -0
- package/dist/fixtures/proxyTag.d.ts +12 -0
- package/dist/fixtures/proxyTag.d.ts.map +1 -0
- package/dist/fixtures/proxyTag.js +45 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/reporter/SelaReporter.d.ts +165 -0
- package/dist/reporter/SelaReporter.d.ts.map +1 -0
- package/dist/reporter/SelaReporter.js +517 -0
- package/dist/services/ASTSourceUpdater.d.ts +143 -0
- package/dist/services/ASTSourceUpdater.d.ts.map +1 -0
- package/dist/services/ASTSourceUpdater.js +3514 -0
- package/dist/services/AnchorResolver.d.ts +157 -0
- package/dist/services/AnchorResolver.d.ts.map +1 -0
- package/dist/services/AnchorResolver.js +289 -0
- package/dist/services/ArgumentTypeAnalyzer.d.ts +26 -0
- package/dist/services/ArgumentTypeAnalyzer.d.ts.map +1 -0
- package/dist/services/ArgumentTypeAnalyzer.js +92 -0
- package/dist/services/BlastRadiusAnalyzer.d.ts +15 -0
- package/dist/services/BlastRadiusAnalyzer.d.ts.map +1 -0
- package/dist/services/BlastRadiusAnalyzer.js +107 -0
- package/dist/services/ChainValidator.d.ts +76 -0
- package/dist/services/ChainValidator.d.ts.map +1 -0
- package/dist/services/ChainValidator.js +570 -0
- package/dist/services/CrossFileHealer.d.ts +6 -0
- package/dist/services/CrossFileHealer.d.ts.map +1 -0
- package/dist/services/CrossFileHealer.js +135 -0
- package/dist/services/DecisionEngine.d.ts +51 -0
- package/dist/services/DecisionEngine.d.ts.map +1 -0
- package/dist/services/DecisionEngine.js +260 -0
- package/dist/services/DefinitionTracer.d.ts +41 -0
- package/dist/services/DefinitionTracer.d.ts.map +1 -0
- package/dist/services/DefinitionTracer.js +366 -0
- package/dist/services/DnaEditorService.d.ts +31 -0
- package/dist/services/DnaEditorService.d.ts.map +1 -0
- package/dist/services/DnaEditorService.js +217 -0
- package/dist/services/DnaIndexService.d.ts +24 -0
- package/dist/services/DnaIndexService.d.ts.map +1 -0
- package/dist/services/DnaIndexService.js +131 -0
- package/dist/services/HealBudget.d.ts +32 -0
- package/dist/services/HealBudget.d.ts.map +1 -0
- package/dist/services/HealBudget.js +85 -0
- package/dist/services/HealReportService.d.ts +161 -0
- package/dist/services/HealReportService.d.ts.map +1 -0
- package/dist/services/HealReportService.js +1039 -0
- package/dist/services/HealingAdvisory.d.ts +30 -0
- package/dist/services/HealingAdvisory.d.ts.map +1 -0
- package/dist/services/HealingAdvisory.js +51 -0
- package/dist/services/HealingCacheService.d.ts +135 -0
- package/dist/services/HealingCacheService.d.ts.map +1 -0
- package/dist/services/HealingCacheService.js +404 -0
- package/dist/services/HealthReportService.d.ts +10 -0
- package/dist/services/HealthReportService.d.ts.map +1 -0
- package/dist/services/HealthReportService.js +84 -0
- package/dist/services/InitializerUpdater.d.ts +16 -0
- package/dist/services/InitializerUpdater.d.ts.map +1 -0
- package/dist/services/InitializerUpdater.js +73 -0
- package/dist/services/IntentAuditor.d.ts +56 -0
- package/dist/services/IntentAuditor.d.ts.map +1 -0
- package/dist/services/IntentAuditor.js +326 -0
- package/dist/services/InteractiveReview.d.ts +15 -0
- package/dist/services/InteractiveReview.d.ts.map +1 -0
- package/dist/services/InteractiveReview.js +128 -0
- package/dist/services/LLMService.d.ts +121 -0
- package/dist/services/LLMService.d.ts.map +1 -0
- package/dist/services/LLMService.js +475 -0
- package/dist/services/MutationApplier.d.ts +69 -0
- package/dist/services/MutationApplier.d.ts.map +1 -0
- package/dist/services/MutationApplier.js +360 -0
- package/dist/services/PRAutomationService.d.ts +50 -0
- package/dist/services/PRAutomationService.d.ts.map +1 -0
- package/dist/services/PRAutomationService.js +760 -0
- package/dist/services/PendingPromptLedger.d.ts +51 -0
- package/dist/services/PendingPromptLedger.d.ts.map +1 -0
- package/dist/services/PendingPromptLedger.js +205 -0
- package/dist/services/ReportGenerator.d.ts +156 -0
- package/dist/services/ReportGenerator.d.ts.map +1 -0
- package/dist/services/ReportGenerator.js +278 -0
- package/dist/services/ReportMergeService.d.ts +95 -0
- package/dist/services/ReportMergeService.d.ts.map +1 -0
- package/dist/services/ReportMergeService.js +0 -0
- package/dist/services/SafetyGuard.d.ts +112 -0
- package/dist/services/SafetyGuard.d.ts.map +1 -0
- package/dist/services/SafetyGuard.js +87 -0
- package/dist/services/Sanitizer.d.ts +28 -0
- package/dist/services/Sanitizer.d.ts.map +1 -0
- package/dist/services/Sanitizer.js +142 -0
- package/dist/services/SanitizingAnthropic.d.ts +19 -0
- package/dist/services/SanitizingAnthropic.d.ts.map +1 -0
- package/dist/services/SanitizingAnthropic.js +84 -0
- package/dist/services/SelectorSanitizer.d.ts +52 -0
- package/dist/services/SelectorSanitizer.d.ts.map +1 -0
- package/dist/services/SelectorSanitizer.js +318 -0
- package/dist/services/SnapshotService.d.ts +11 -0
- package/dist/services/SnapshotService.d.ts.map +1 -0
- package/dist/services/SnapshotService.js +352 -0
- package/dist/services/SourceLinkService.d.ts +26 -0
- package/dist/services/SourceLinkService.d.ts.map +1 -0
- package/dist/services/SourceLinkService.js +165 -0
- package/dist/services/SourceUpdater.d.ts +45 -0
- package/dist/services/SourceUpdater.d.ts.map +1 -0
- package/dist/services/SourceUpdater.js +1091 -0
- package/dist/services/TemplateDiffService.d.ts +25 -0
- package/dist/services/TemplateDiffService.d.ts.map +1 -0
- package/dist/services/TemplateDiffService.js +334 -0
- package/dist/services/TraceBackEngine.d.ts +67 -0
- package/dist/services/TraceBackEngine.d.ts.map +1 -0
- package/dist/services/TraceBackEngine.js +672 -0
- package/dist/services/WorkspaceSnapshotService.d.ts +71 -0
- package/dist/services/WorkspaceSnapshotService.d.ts.map +1 -0
- package/dist/services/WorkspaceSnapshotService.js +200 -0
- package/dist/services/safety/PipelineContext.d.ts +63 -0
- package/dist/services/safety/PipelineContext.d.ts.map +1 -0
- package/dist/services/safety/PipelineContext.js +34 -0
- package/dist/services/safety/roleClassifier.d.ts +4 -0
- package/dist/services/safety/roleClassifier.d.ts.map +1 -0
- package/dist/services/safety/roleClassifier.js +233 -0
- package/dist/services/safety/rules/ConfidenceTierRule.d.ts +3 -0
- package/dist/services/safety/rules/ConfidenceTierRule.d.ts.map +1 -0
- package/dist/services/safety/rules/ConfidenceTierRule.js +32 -0
- package/dist/services/safety/rules/DangerousSinkRule.d.ts +10 -0
- package/dist/services/safety/rules/DangerousSinkRule.d.ts.map +1 -0
- package/dist/services/safety/rules/DangerousSinkRule.js +53 -0
- package/dist/services/safety/rules/FunctionalRoleRule.d.ts +3 -0
- package/dist/services/safety/rules/FunctionalRoleRule.d.ts.map +1 -0
- package/dist/services/safety/rules/FunctionalRoleRule.js +64 -0
- package/dist/services/safety/rules/HardConfidenceRule.d.ts +3 -0
- package/dist/services/safety/rules/HardConfidenceRule.d.ts.map +1 -0
- package/dist/services/safety/rules/HardConfidenceRule.js +22 -0
- package/dist/services/safety/rules/IntentAuditorRule.d.ts +3 -0
- package/dist/services/safety/rules/IntentAuditorRule.d.ts.map +1 -0
- package/dist/services/safety/rules/IntentAuditorRule.js +97 -0
- package/dist/services/safety/rules/SemanticOppositeRule.d.ts +3 -0
- package/dist/services/safety/rules/SemanticOppositeRule.d.ts.map +1 -0
- package/dist/services/safety/rules/SemanticOppositeRule.js +30 -0
- package/dist/services/safety/rules/StructuralOnlyRule.d.ts +3 -0
- package/dist/services/safety/rules/StructuralOnlyRule.d.ts.map +1 -0
- package/dist/services/safety/rules/StructuralOnlyRule.js +38 -0
- package/dist/services/safety/rules/VisibilityRule.d.ts +3 -0
- package/dist/services/safety/rules/VisibilityRule.d.ts.map +1 -0
- package/dist/services/safety/rules/VisibilityRule.js +53 -0
- package/dist/services/safety/rules/ZeroTrustRule.d.ts +3 -0
- package/dist/services/safety/rules/ZeroTrustRule.d.ts.map +1 -0
- package/dist/services/safety/rules/ZeroTrustRule.js +37 -0
- package/dist/services/safety/rules/index.d.ts +3 -0
- package/dist/services/safety/rules/index.d.ts.map +1 -0
- package/dist/services/safety/rules/index.js +34 -0
- package/dist/services/types.d.ts +59 -0
- package/dist/services/types.d.ts.map +1 -0
- package/dist/services/types.js +2 -0
- package/dist/storage/SnapshotManager.d.ts +5 -0
- package/dist/storage/SnapshotManager.d.ts.map +1 -0
- package/dist/storage/SnapshotManager.js +32 -0
- package/dist/types/index.d.ts +95 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/utils/DOMUtils.d.ts +49 -0
- package/dist/utils/DOMUtils.d.ts.map +1 -0
- package/dist/utils/DOMUtils.js +466 -0
- package/dist/utils/FileLock.d.ts +44 -0
- package/dist/utils/FileLock.d.ts.map +1 -0
- package/dist/utils/FileLock.js +189 -0
- package/dist/utils/IsolatedDiff.d.ts +45 -0
- package/dist/utils/IsolatedDiff.d.ts.map +1 -0
- package/dist/utils/IsolatedDiff.js +382 -0
- package/dist/utils/StackUtils.d.ts +11 -0
- package/dist/utils/StackUtils.d.ts.map +1 -0
- package/dist/utils/StackUtils.js +120 -0
- package/dist/utils/SummaryTable.d.ts +17 -0
- package/dist/utils/SummaryTable.d.ts.map +1 -0
- package/dist/utils/SummaryTable.js +37 -0
- package/dist/utils/atomicWrite.d.ts +9 -0
- package/dist/utils/atomicWrite.d.ts.map +1 -0
- package/dist/utils/atomicWrite.js +83 -0
- package/dist/utils/logger.d.ts +59 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +123 -0
- package/dist/vendor/enquirer.d.ts +33 -0
- package/dist/vendor/enquirer.d.ts.map +1 -0
- package/dist/vendor/enquirer.js +11 -0
- package/package.json +71 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CrossFileHealer = void 0;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const DefinitionTracer_js_1 = require("./DefinitionTracer.js");
|
|
40
|
+
const InitializerUpdater_js_1 = require("./InitializerUpdater.js");
|
|
41
|
+
const logger_1 = require("../utils/logger");
|
|
42
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
43
|
+
// CrossFileHealer (T-9)
|
|
44
|
+
//
|
|
45
|
+
// Resolves an imported symbol to its definition in an external file,
|
|
46
|
+
// then delegates mutation to InitializerUpdater.
|
|
47
|
+
//
|
|
48
|
+
// Entry point: CrossFileHealer.heal()
|
|
49
|
+
// modulePath - the import specifier string (e.g. "./constants")
|
|
50
|
+
// symbolName - the exported identifier name (e.g. "SHARED_SEL")
|
|
51
|
+
// oldValue - the current string value (used for verification)
|
|
52
|
+
// newValue - the replacement value
|
|
53
|
+
// callerFilePath - absolute path of the file containing the import
|
|
54
|
+
// project - the shared ASTSourceUpdater Project instance
|
|
55
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
56
|
+
const DEPTH_GUARD = 3;
|
|
57
|
+
class CrossFileHealer {
|
|
58
|
+
static heal(modulePath, symbolName, newValue, callerFilePath, project, depth = 0) {
|
|
59
|
+
if (depth >= DEPTH_GUARD) {
|
|
60
|
+
return {
|
|
61
|
+
success: false,
|
|
62
|
+
reason: `CrossFileHealer: re-export chain depth exceeded for "${symbolName}"`,
|
|
63
|
+
strategy: "semantic-cross-file",
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const externalPath = resolveModulePath(modulePath, callerFilePath);
|
|
67
|
+
if (!externalPath) {
|
|
68
|
+
return {
|
|
69
|
+
success: false,
|
|
70
|
+
reason: `CrossFileHealer: module "${modulePath}" not found relative to "${path.basename(callerFilePath)}"`,
|
|
71
|
+
strategy: "semantic-cross-file",
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
// Load external file into the shared project.
|
|
75
|
+
let externalSf = project.getSourceFile(externalPath);
|
|
76
|
+
if (externalSf) {
|
|
77
|
+
externalSf.refreshFromFileSystemSync();
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
try {
|
|
81
|
+
externalSf = project.addSourceFileAtPath(externalPath);
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
return {
|
|
85
|
+
success: false,
|
|
86
|
+
reason: `CrossFileHealer: failed to load "${path.basename(externalPath)}": ${e.message}`,
|
|
87
|
+
strategy: "semantic-cross-file",
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const traceResult = DefinitionTracer_js_1.DefinitionTracer.traceByName(symbolName, externalSf);
|
|
92
|
+
if (!traceResult.found) {
|
|
93
|
+
// Follow re-export chains (barrel files).
|
|
94
|
+
if (traceResult.crossFile) {
|
|
95
|
+
logger_1.logger.debug(`CrossFileHealer "${symbolName}" re-exported from "${traceResult.modulePath}" - following chain`);
|
|
96
|
+
return CrossFileHealer.heal(traceResult.modulePath, traceResult.symbolName, newValue, externalPath, project, depth + 1);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
success: false,
|
|
100
|
+
reason: `CrossFileHealer: ${traceResult.reason}`,
|
|
101
|
+
strategy: "semantic-cross-file",
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const result = InitializerUpdater_js_1.InitializerUpdater.apply(traceResult.targetNode, traceResult.targetFile, newValue);
|
|
105
|
+
if (!result) {
|
|
106
|
+
return {
|
|
107
|
+
success: false,
|
|
108
|
+
reason: `CrossFileHealer: InitializerUpdater rejected node type ${traceResult.targetNode.getKindName()}`,
|
|
109
|
+
strategy: "semantic-cross-file",
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
logger_1.logger.debug(`CrossFileHealer healed "${symbolName}" in ${path.basename(externalPath)} ` +
|
|
113
|
+
`@ line ${result.lineUpdated + 1}`);
|
|
114
|
+
return {
|
|
115
|
+
success: true,
|
|
116
|
+
reason: `definition-site heal in ${path.basename(externalPath)}`,
|
|
117
|
+
strategy: "semantic-cross-file",
|
|
118
|
+
lineUpdated: result.lineUpdated,
|
|
119
|
+
healedLocatorString: newValue,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.CrossFileHealer = CrossFileHealer;
|
|
124
|
+
// ─────────────────────────────────────────────────────────────────
|
|
125
|
+
// Private helpers
|
|
126
|
+
// ─────────────────────────────────────────────────────────────────
|
|
127
|
+
function resolveModulePath(modulePath, fromFile) {
|
|
128
|
+
const base = path.dirname(path.resolve(fromFile));
|
|
129
|
+
const resolved = path.resolve(base, modulePath);
|
|
130
|
+
for (const candidate of [resolved, resolved + ".ts", resolved + ".js"]) {
|
|
131
|
+
if (fs.existsSync(candidate))
|
|
132
|
+
return candidate;
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Node, Block } from "ts-morph";
|
|
2
|
+
import { AnchorKey, SourceSpan } from "./AnchorResolver";
|
|
3
|
+
import { TraceTarget } from "./TraceBackEngine";
|
|
4
|
+
export type DecisionStrategy = "MUTATE_IN_PLACE" | "FORK_AT_TEST" | "PROMPT_INTERACTIVE";
|
|
5
|
+
export interface Edit {
|
|
6
|
+
kind: "replace" | "insert";
|
|
7
|
+
span: SourceSpan;
|
|
8
|
+
replacement: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Decision {
|
|
11
|
+
strategy: DecisionStrategy;
|
|
12
|
+
reason: string;
|
|
13
|
+
/** Read-reference count to the declaration (the blast radius). */
|
|
14
|
+
blastRadius: number;
|
|
15
|
+
/** Distinct test/it blocks referencing the declaration. */
|
|
16
|
+
consumerTests: number;
|
|
17
|
+
/** Ordered edits. Apply via applyEdits (high→low offset). */
|
|
18
|
+
edits: Edit[];
|
|
19
|
+
/** When forking, the (possibly fresh) shadow variable name. */
|
|
20
|
+
forkVarName?: string;
|
|
21
|
+
/** 0..1 routing confidence (§5.3). */
|
|
22
|
+
confidence: number;
|
|
23
|
+
anchor: AnchorKey;
|
|
24
|
+
}
|
|
25
|
+
export interface DecideInput {
|
|
26
|
+
target: TraceTarget;
|
|
27
|
+
/** A node inside the FAILING statement — used to locate the test block. */
|
|
28
|
+
failingCallSite: Node;
|
|
29
|
+
/** Healed locator EXPRESSION text, e.g. `page.locator(".btn-v2")`. */
|
|
30
|
+
newLocatorExpr: string;
|
|
31
|
+
/** Runtime: only the failing test needs the new selector. */
|
|
32
|
+
contextSpecific: boolean;
|
|
33
|
+
/** Runtime: the selector rotted for ALL consumers (proven global). */
|
|
34
|
+
globalCorrect: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare class DecisionEngine {
|
|
37
|
+
static decide(input: DecideInput): Decision;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The Block of the nearest enclosing `test(...)` / `it(...)` callback. Hooks
|
|
41
|
+
* (`beforeEach`, etc.) are intentionally NOT matched — we fork into the test
|
|
42
|
+
* that failed, never into the shared hook.
|
|
43
|
+
*/
|
|
44
|
+
export declare function findEnclosingTestBlock(node: Node): Block | null;
|
|
45
|
+
/**
|
|
46
|
+
* Apply edits to `original`, highest offset first so earlier offsets stay
|
|
47
|
+
* valid (the reverse-offset rule from the concurrency design §3.3.4).
|
|
48
|
+
* Throws on overlapping replace spans — never produces torn text.
|
|
49
|
+
*/
|
|
50
|
+
export declare function applyEdits(original: string, edits: Edit[]): string;
|
|
51
|
+
//# sourceMappingURL=DecisionEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecisionEngine.d.ts","sourceRoot":"","sources":["../../src/services/DecisionEngine.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,IAAI,EAAc,KAAK,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EACL,WAAW,EAGZ,MAAM,mBAAmB,CAAC;AAM3B,MAAM,MAAM,gBAAgB,GACxB,iBAAiB,GACjB,cAAc,GACd,oBAAoB,CAAC;AAEzB,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,2EAA2E;IAC3E,eAAe,EAAE,IAAI,CAAC;IACtB,sEAAsE;IACtE,cAAc,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,eAAe,EAAE,OAAO,CAAC;IACzB,sEAAsE;IACtE,aAAa,EAAE,OAAO,CAAC;CACxB;AAMD,qBAAa,cAAc;IACzB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ;CAuD5C;AAqJD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI,CAc/D;AAwCD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAsBlE"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/services/DecisionEngine.ts
|
|
3
|
+
//
|
|
4
|
+
// Ticket #2 — Stage 3: The Decision Tree & Multi-Consumer Forking.
|
|
5
|
+
//
|
|
6
|
+
// Final semantic phase. Given a trace-back TARGET (Stage 2) + the proposed
|
|
7
|
+
// healed locator expression + runtime evidence, decide HOW to write it:
|
|
8
|
+
//
|
|
9
|
+
// refsToDecl <= 1 ............................. MUTATE_IN_PLACE
|
|
10
|
+
// refsToDecl > 1 & globalCorrect ............. MUTATE_IN_PLACE (all rot)
|
|
11
|
+
// refsToDecl > 1 & contextSpecific ........... FORK_AT_TEST
|
|
12
|
+
// refsToDecl > 1 & scope undeterminable ...... PROMPT_INTERACTIVE
|
|
13
|
+
//
|
|
14
|
+
// FORK_AT_TEST injects a collision-safe shadowing `const <name> = <expr>;`
|
|
15
|
+
// at the top of the FAILING test's block so the other consumers of the
|
|
16
|
+
// shared declaration (e.g. a `beforeEach` locator used by 4 other passing
|
|
17
|
+
// tests) are left untouched. Same-name shadow keeps the call-site intact;
|
|
18
|
+
// a real name collision falls back to a fresh name + a call-site rewrite.
|
|
19
|
+
//
|
|
20
|
+
// Reference census is delegated to BlastRadiusAnalyzer (cross-file accurate
|
|
21
|
+
// via the ts-morph language service) — we do not re-implement findReferences.
|
|
22
|
+
//
|
|
23
|
+
// PURE: produces an edit plan; never writes to disk.
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.DecisionEngine = void 0;
|
|
26
|
+
exports.findEnclosingTestBlock = findEnclosingTestBlock;
|
|
27
|
+
exports.applyEdits = applyEdits;
|
|
28
|
+
const ts_morph_1 = require("ts-morph");
|
|
29
|
+
const BlastRadiusAnalyzer_1 = require("./BlastRadiusAnalyzer");
|
|
30
|
+
const TraceBackEngine_1 = require("./TraceBackEngine");
|
|
31
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
32
|
+
// DecisionEngine
|
|
33
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
34
|
+
class DecisionEngine {
|
|
35
|
+
static decide(input) {
|
|
36
|
+
const { target, newLocatorExpr } = input;
|
|
37
|
+
// Inline call-site or non-declaration target: the call-site is unique,
|
|
38
|
+
// there is nothing to share → mutate in place.
|
|
39
|
+
if (target.declKind === "InlineCallSite" || !target.declaration) {
|
|
40
|
+
return mutateInPlace(target, newLocatorExpr, 1, 1, "inline call-site");
|
|
41
|
+
}
|
|
42
|
+
// Reference census (delegated, cross-file accurate).
|
|
43
|
+
const { totalReferences, consumerTests } = census(target);
|
|
44
|
+
// ── refs <= 1 → safe global mutation ────────────────────────────
|
|
45
|
+
if (totalReferences <= 1) {
|
|
46
|
+
return mutateInPlace(target, newLocatorExpr, totalReferences, consumerTests, `single consumer (refs=${totalReferences})`);
|
|
47
|
+
}
|
|
48
|
+
// ── refs > 1 → multi-consumer ───────────────────────────────────
|
|
49
|
+
if (input.globalCorrect) {
|
|
50
|
+
return mutateInPlace(target, newLocatorExpr, totalReferences, consumerTests, `multi-consumer but selector rot is global (refs=${totalReferences})`, 0.85);
|
|
51
|
+
}
|
|
52
|
+
if (input.contextSpecific) {
|
|
53
|
+
const fork = buildFork(input, totalReferences, consumerTests);
|
|
54
|
+
if (fork)
|
|
55
|
+
return fork;
|
|
56
|
+
// Could not locate a test block to fork into → escalate.
|
|
57
|
+
return promptInteractive(target, totalReferences, consumerTests, "context-specific fix but no enclosing test block to fork into");
|
|
58
|
+
}
|
|
59
|
+
// Scope undeterminable → never silently break the other consumers.
|
|
60
|
+
return promptInteractive(target, totalReferences, consumerTests, `multi-consumer (refs=${totalReferences}) and scope undeterminable — global-vs-fork needs a human`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.DecisionEngine = DecisionEngine;
|
|
64
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
65
|
+
// REFERENCE CENSUS
|
|
66
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
67
|
+
function census(target) {
|
|
68
|
+
const decl = target.declaration;
|
|
69
|
+
try {
|
|
70
|
+
const report = BlastRadiusAnalyzer_1.BlastRadiusAnalyzer.analyze(decl, decl.getSourceFile(), decl.getProject());
|
|
71
|
+
return {
|
|
72
|
+
totalReferences: report.totalReferences,
|
|
73
|
+
consumerTests: report.testFunctionCount,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Census failure must not crash the pipeline; treat as single-consumer
|
|
78
|
+
// (the conservative MUTATE_IN_PLACE path the caller can still gate).
|
|
79
|
+
return { totalReferences: 1, consumerTests: 1 };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
83
|
+
// PLAN BUILDERS
|
|
84
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
85
|
+
function mutateInPlace(target, newLocatorExpr, blastRadius, consumerTests, reason, confidence = 0.9) {
|
|
86
|
+
return {
|
|
87
|
+
strategy: "MUTATE_IN_PLACE",
|
|
88
|
+
reason,
|
|
89
|
+
blastRadius,
|
|
90
|
+
consumerTests,
|
|
91
|
+
confidence,
|
|
92
|
+
anchor: target.anchor,
|
|
93
|
+
edits: [
|
|
94
|
+
{
|
|
95
|
+
kind: "replace",
|
|
96
|
+
span: {
|
|
97
|
+
start: target.targetNode.getStart(),
|
|
98
|
+
end: target.targetNode.getEnd(),
|
|
99
|
+
},
|
|
100
|
+
replacement: newLocatorExpr,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function promptInteractive(target, blastRadius, consumerTests, reason) {
|
|
106
|
+
return {
|
|
107
|
+
strategy: "PROMPT_INTERACTIVE",
|
|
108
|
+
reason,
|
|
109
|
+
blastRadius,
|
|
110
|
+
consumerTests,
|
|
111
|
+
confidence: 0.4,
|
|
112
|
+
anchor: target.anchor,
|
|
113
|
+
edits: [], // no auto-edit; the CLI prompts the user
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function buildFork(input, blastRadius, consumerTests) {
|
|
117
|
+
const { target, failingCallSite, newLocatorExpr } = input;
|
|
118
|
+
const testBlock = findEnclosingTestBlock(failingCallSite);
|
|
119
|
+
if (!testBlock)
|
|
120
|
+
return null;
|
|
121
|
+
const baseName = target.symbolName ?? "healedLocator";
|
|
122
|
+
// Collision-safe shadow naming. A plain block-scoped `const` of the SAME
|
|
123
|
+
// name legally shadows the outer (beforeEach/describe) declaration and the
|
|
124
|
+
// call-site needs no rewrite. Only when the failing test block ALREADY
|
|
125
|
+
// declares that name locally do we need a fresh name + call-site rewrite.
|
|
126
|
+
const localNames = collectBlockLocalNames(testBlock);
|
|
127
|
+
let forkVarName = baseName;
|
|
128
|
+
let needsCallSiteRewrite = false;
|
|
129
|
+
if (localNames.has(baseName)) {
|
|
130
|
+
forkVarName = freshName(baseName, localNames);
|
|
131
|
+
needsCallSiteRewrite = true;
|
|
132
|
+
}
|
|
133
|
+
const edits = [];
|
|
134
|
+
// 1. Insert the shadow declaration at the top of the test block.
|
|
135
|
+
const stmts = testBlock.getStatements();
|
|
136
|
+
const indent = stmts[0]?.getIndentationText() ?? " ";
|
|
137
|
+
const insertPos = stmts[0]
|
|
138
|
+
? stmts[0].getStart()
|
|
139
|
+
: testBlock.getStart() + 1; // just after the `{`
|
|
140
|
+
const insertText = stmts[0]
|
|
141
|
+
? `const ${forkVarName} = ${newLocatorExpr};\n${indent}`
|
|
142
|
+
: `\n${indent}const ${forkVarName} = ${newLocatorExpr};\n`;
|
|
143
|
+
edits.push({
|
|
144
|
+
kind: "insert",
|
|
145
|
+
span: { start: insertPos, end: insertPos },
|
|
146
|
+
replacement: insertText,
|
|
147
|
+
});
|
|
148
|
+
// 2. If we had to rename, rewrite the failing call-site receiver.
|
|
149
|
+
if (needsCallSiteRewrite) {
|
|
150
|
+
const top = (0, TraceBackEngine_1.climbToTopCall)(failingCallSite);
|
|
151
|
+
if (top) {
|
|
152
|
+
const { leftmost } = (0, TraceBackEngine_1.getLeftmostReceiver)(top);
|
|
153
|
+
if (ts_morph_1.Node.isIdentifier(leftmost) && leftmost.getText() === baseName) {
|
|
154
|
+
edits.push({
|
|
155
|
+
kind: "replace",
|
|
156
|
+
span: { start: leftmost.getStart(), end: leftmost.getEnd() },
|
|
157
|
+
replacement: forkVarName,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
strategy: "FORK_AT_TEST",
|
|
164
|
+
reason: `multi-consumer (refs=${blastRadius}, tests=${consumerTests}); context-specific fix forked into the failing test as "${forkVarName}"`,
|
|
165
|
+
blastRadius,
|
|
166
|
+
consumerTests,
|
|
167
|
+
confidence: 0.75,
|
|
168
|
+
forkVarName,
|
|
169
|
+
anchor: target.anchor,
|
|
170
|
+
edits,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
174
|
+
// TEST-BLOCK / SCOPE HELPERS
|
|
175
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
176
|
+
/**
|
|
177
|
+
* The Block of the nearest enclosing `test(...)` / `it(...)` callback. Hooks
|
|
178
|
+
* (`beforeEach`, etc.) are intentionally NOT matched — we fork into the test
|
|
179
|
+
* that failed, never into the shared hook.
|
|
180
|
+
*/
|
|
181
|
+
function findEnclosingTestBlock(node) {
|
|
182
|
+
let cur = node;
|
|
183
|
+
while (cur) {
|
|
184
|
+
if (ts_morph_1.Node.isCallExpression(cur) && isTestCall(cur)) {
|
|
185
|
+
for (const arg of cur.getArguments()) {
|
|
186
|
+
if (ts_morph_1.Node.isArrowFunction(arg) || ts_morph_1.Node.isFunctionExpression(arg)) {
|
|
187
|
+
const body = arg.getBody();
|
|
188
|
+
if (body && ts_morph_1.Node.isBlock(body))
|
|
189
|
+
return body;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
cur = cur.getParent();
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
function isTestCall(call) {
|
|
198
|
+
if (!ts_morph_1.Node.isCallExpression(call))
|
|
199
|
+
return false;
|
|
200
|
+
const expr = call.getExpression();
|
|
201
|
+
const base = ts_morph_1.Node.isPropertyAccessExpression(expr)
|
|
202
|
+
? expr.getExpression().getText()
|
|
203
|
+
: expr.getText();
|
|
204
|
+
return base === "test" || base === "it";
|
|
205
|
+
}
|
|
206
|
+
/** Names declared LOCALLY in this block (top-level var statements + fns). */
|
|
207
|
+
function collectBlockLocalNames(block) {
|
|
208
|
+
const names = new Set();
|
|
209
|
+
for (const stmt of block.getStatements()) {
|
|
210
|
+
if (ts_morph_1.Node.isVariableStatement(stmt)) {
|
|
211
|
+
for (const d of stmt.getDeclarations()) {
|
|
212
|
+
const n = d.getNameNode();
|
|
213
|
+
if (ts_morph_1.Node.isIdentifier(n))
|
|
214
|
+
names.add(n.getText());
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else if (ts_morph_1.Node.isFunctionDeclaration(stmt)) {
|
|
218
|
+
const nm = stmt.getName();
|
|
219
|
+
if (nm)
|
|
220
|
+
names.add(nm);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return names;
|
|
224
|
+
}
|
|
225
|
+
function freshName(base, taken) {
|
|
226
|
+
const candidate = `${base}Healed`;
|
|
227
|
+
if (!taken.has(candidate))
|
|
228
|
+
return candidate;
|
|
229
|
+
let i = 2;
|
|
230
|
+
while (taken.has(`${candidate}${i}`))
|
|
231
|
+
i++;
|
|
232
|
+
return `${candidate}${i}`;
|
|
233
|
+
}
|
|
234
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
235
|
+
// PURE EDIT APPLICATION (used by callers + tests)
|
|
236
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
237
|
+
/**
|
|
238
|
+
* Apply edits to `original`, highest offset first so earlier offsets stay
|
|
239
|
+
* valid (the reverse-offset rule from the concurrency design §3.3.4).
|
|
240
|
+
* Throws on overlapping replace spans — never produces torn text.
|
|
241
|
+
*/
|
|
242
|
+
function applyEdits(original, edits) {
|
|
243
|
+
const sorted = [...edits].sort((a, b) => b.span.start - a.span.start);
|
|
244
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
245
|
+
const prev = sorted[i - 1];
|
|
246
|
+
const cur = sorted[i];
|
|
247
|
+
// prev.start >= cur.start (desc). Overlap if cur.end > prev.start AND
|
|
248
|
+
// both are replacements (inserts are zero-width and may share a point).
|
|
249
|
+
if (cur.span.end > prev.span.start &&
|
|
250
|
+
prev.kind === "replace" &&
|
|
251
|
+
cur.kind === "replace") {
|
|
252
|
+
throw new Error(`[DecisionEngine] overlapping edits at ${cur.span.start}..${cur.span.end} and ${prev.span.start}..${prev.span.end}`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
let text = original;
|
|
256
|
+
for (const e of sorted) {
|
|
257
|
+
text = text.slice(0, e.span.start) + e.replacement + text.slice(e.span.end);
|
|
258
|
+
}
|
|
259
|
+
return text;
|
|
260
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Node, SourceFile, StringLiteral, NoSubstitutionTemplateLiteral, TemplateExpression } from "ts-morph";
|
|
2
|
+
export type TraceResult = {
|
|
3
|
+
found: true;
|
|
4
|
+
targetNode: Node;
|
|
5
|
+
targetFile: SourceFile;
|
|
6
|
+
/** The enclosing VariableDeclaration or PropertyAssignment - used by BlastRadiusAnalyzer. */
|
|
7
|
+
declarationNode?: Node;
|
|
8
|
+
} | {
|
|
9
|
+
found: false;
|
|
10
|
+
crossFile: true;
|
|
11
|
+
modulePath: string;
|
|
12
|
+
symbolName: string;
|
|
13
|
+
} | {
|
|
14
|
+
found: false;
|
|
15
|
+
crossFile: false;
|
|
16
|
+
reason: string;
|
|
17
|
+
};
|
|
18
|
+
export type FunctionalAnalysis = {
|
|
19
|
+
kind: "template";
|
|
20
|
+
templateNode: TemplateExpression;
|
|
21
|
+
bindings: Map<string, string>;
|
|
22
|
+
functionFile: SourceFile;
|
|
23
|
+
functionLine: number;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "literal";
|
|
26
|
+
literalNode: StringLiteral | NoSubstitutionTemplateLiteral;
|
|
27
|
+
functionFile: SourceFile;
|
|
28
|
+
functionLine: number;
|
|
29
|
+
} | {
|
|
30
|
+
kind: "complex";
|
|
31
|
+
reason: string;
|
|
32
|
+
};
|
|
33
|
+
export declare class DefinitionTracer {
|
|
34
|
+
static traceIdentifier(identifierNode: Node, sourceFile: SourceFile, callerLine: number, depth?: number): TraceResult;
|
|
35
|
+
static tracePropertyAccess(propAccessNode: Node, sourceFile: SourceFile, callerLine: number): TraceResult;
|
|
36
|
+
static traceByName(symbolName: string, sourceFile: SourceFile): TraceResult;
|
|
37
|
+
}
|
|
38
|
+
export declare class FunctionalReturnAnalyzer {
|
|
39
|
+
static analyze(callNode: Node, sourceFile: SourceFile): FunctionalAnalysis;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=DefinitionTracer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefinitionTracer.d.ts","sourceRoot":"","sources":["../../src/services/DefinitionTracer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EAKV,aAAa,EACb,6BAA6B,EAC7B,kBAAkB,EAGnB,MAAM,UAAU,CAAC;AAOlB,MAAM,MAAM,WAAW,GACnB;IACE,KAAK,EAAE,IAAI,CAAC;IACZ,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,6FAA6F;IAC7F,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,GACD;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACzE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAC1B;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,kBAAkB,CAAC;IACjC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,YAAY,EAAE,UAAU,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,aAAa,GAAG,6BAA6B,CAAC;IAC3D,YAAY,EAAE,UAAU,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB,GACD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAcxC,qBAAa,gBAAgB;IAK3B,MAAM,CAAC,eAAe,CACpB,cAAc,EAAE,IAAI,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,KAAK,SAAI,GACR,WAAW;IA0Fd,MAAM,CAAC,mBAAmB,CACxB,cAAc,EAAE,IAAI,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,GACjB,WAAW;IA+Ed,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,WAAW;CAkC5E;AASD,qBAAa,wBAAwB;IACnC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,GAAG,kBAAkB;CAmF3E"}
|