flowseeker 0.1.7
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/CHANGELOG.md +111 -0
- package/COMPATIBILITY.md +281 -0
- package/LICENSE +21 -0
- package/README.md +375 -0
- package/dist/adapters/frameworkEdges.js +586 -0
- package/dist/agent/approvalPolicy.js +81 -0
- package/dist/agent/commandRunner.js +166 -0
- package/dist/agent/flowCommandRunner.js +124 -0
- package/dist/agent/mcpToolRunner.js +167 -0
- package/dist/auth/githubAuth.js +71 -0
- package/dist/auth/modelList.js +127 -0
- package/dist/auth/oauthHandler.js +377 -0
- package/dist/chat/nativeChatParticipant.js +616 -0
- package/dist/cli/mcpServer.js +383 -0
- package/dist/cli/runEvaluation.js +789 -0
- package/dist/cli/runReplay.js +481 -0
- package/dist/commands/checkHostCompatibility.js +149 -0
- package/dist/commands/copyAgentPrompt.js +52 -0
- package/dist/commands/copyContext.js +54 -0
- package/dist/commands/explainSelectionRelevance.js +57 -0
- package/dist/commands/findRelevantContext.js +127 -0
- package/dist/commands/openEvidence.js +49 -0
- package/dist/commands/openMcpConfig.js +81 -0
- package/dist/commands/openRelatedTests.js +54 -0
- package/dist/commands/rebuildIndex.js +45 -0
- package/dist/commands/runEvaluationSuite.js +323 -0
- package/dist/commands/runReplaySuite.js +228 -0
- package/dist/config/defaultConfig.js +72 -0
- package/dist/config/loadConfig.js +84 -0
- package/dist/config/loadConfigFromPath.js +60 -0
- package/dist/extension.js +513 -0
- package/dist/gateway/agentPrompts.js +176 -0
- package/dist/gateway/aiGateway.js +1255 -0
- package/dist/gateway/aiProviders.js +901 -0
- package/dist/gateway/contextExpansion.js +331 -0
- package/dist/gateway/editProposalStore.js +238 -0
- package/dist/gateway/planProposalStore.js +28 -0
- package/dist/index/cacheStore.js +51 -0
- package/dist/index/chunker.js +45 -0
- package/dist/index/dependencyExtractor.js +107 -0
- package/dist/index/fileDiscovery.js +177 -0
- package/dist/index/structuredExtractor.js +256 -0
- package/dist/index/workspaceIndex.js +518 -0
- package/dist/mcp/mcpConfig.js +154 -0
- package/dist/mcp/mcpProvider.js +109 -0
- package/dist/mcp/mcpTools.js +215 -0
- package/dist/pipeline/agentPrompt.js +79 -0
- package/dist/pipeline/agentPromptHeadless.js +85 -0
- package/dist/pipeline/contextBlueprint.js +346 -0
- package/dist/pipeline/contextPack.js +80 -0
- package/dist/pipeline/diffPreview.js +79 -0
- package/dist/pipeline/evaluationMetrics.js +154 -0
- package/dist/pipeline/evidenceGraph.js +389 -0
- package/dist/pipeline/feedback.js +215 -0
- package/dist/pipeline/fileGroups.js +84 -0
- package/dist/pipeline/fileScanner.js +866 -0
- package/dist/pipeline/nodeScan.js +219 -0
- package/dist/pipeline/ranker.js +563 -0
- package/dist/pipeline/responseLanguage.js +39 -0
- package/dist/pipeline/retrievalPlan.js +163 -0
- package/dist/pipeline/runHeadless.js +54 -0
- package/dist/pipeline/runPipeline.js +114 -0
- package/dist/pipeline/solvePacket.js +382 -0
- package/dist/pipeline/subsystem.js +257 -0
- package/dist/pipeline/taskUnderstanding.js +453 -0
- package/dist/pipeline/tokenSavings.js +146 -0
- package/dist/pipeline/universalScan.js +216 -0
- package/dist/pipeline/verifyAfterApply.js +233 -0
- package/dist/runtime/capabilities.js +71 -0
- package/dist/runtime/hostDetect.js +98 -0
- package/dist/runtime/hostTier.js +68 -0
- package/dist/runtime/statusBar.js +80 -0
- package/dist/skills/skillRegistry.js +208 -0
- package/dist/types.js +3 -0
- package/dist/ui/chatViewProvider.js +3899 -0
- package/dist/ui/resultTreeProvider.js +174 -0
- package/dist/usage/quotaTracker.js +358 -0
- package/dist/utils/async.js +30 -0
- package/dist/utils/logger.js +64 -0
- package/dist/utils/text.js +364 -0
- package/dist/utils/updateChecker.js +140 -0
- package/package.json +561 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRetrievalPlan = createRetrievalPlan;
|
|
4
|
+
const contextBlueprint_1 = require("./contextBlueprint");
|
|
5
|
+
const text_1 = require("../utils/text");
|
|
6
|
+
function createRetrievalPlan(input, config) {
|
|
7
|
+
const strategies = detectStrategies(input.normalizedTask, input.concepts);
|
|
8
|
+
const passes = [
|
|
9
|
+
{
|
|
10
|
+
id: "seed",
|
|
11
|
+
label: "Seed concepts",
|
|
12
|
+
strategy: "seed_search",
|
|
13
|
+
purpose: "seed",
|
|
14
|
+
terms: weightedTerms(input.concepts, 3, "concept")
|
|
15
|
+
.concat(weightedTerms(input.actions, 1.5, "action"))
|
|
16
|
+
.concat(weightedTerms(expandConfigSynonyms(input.keywords, config), 2, "synonym"))
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
const behaviorChange = extractBehaviorChange(input.normalizedTask);
|
|
20
|
+
if (behaviorChange) {
|
|
21
|
+
passes.push({
|
|
22
|
+
id: "current-behavior",
|
|
23
|
+
label: "Current behavior",
|
|
24
|
+
strategy: "behavior_change",
|
|
25
|
+
purpose: "find_current",
|
|
26
|
+
terms: weightedTerms((0, text_1.splitIdentifier)(behaviorChange.current), 4, "current_behavior")
|
|
27
|
+
});
|
|
28
|
+
passes.push({
|
|
29
|
+
id: "target-behavior",
|
|
30
|
+
label: "Target behavior",
|
|
31
|
+
strategy: "behavior_change",
|
|
32
|
+
purpose: "find_target",
|
|
33
|
+
terms: weightedTerms((0, text_1.splitIdentifier)(behaviorChange.target), 4, "target_behavior")
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const transition = extractStateTransition(input.normalizedTask);
|
|
37
|
+
if (transition) {
|
|
38
|
+
passes.push({
|
|
39
|
+
id: "transition-gate",
|
|
40
|
+
label: "State transition gate",
|
|
41
|
+
strategy: "state_transition_side_effect",
|
|
42
|
+
purpose: "find_transition",
|
|
43
|
+
terms: weightedTerms((0, text_1.splitIdentifier)(transition.when), 4, "constraint")
|
|
44
|
+
});
|
|
45
|
+
passes.push({
|
|
46
|
+
id: "side-effect",
|
|
47
|
+
label: "Side effect",
|
|
48
|
+
strategy: "state_transition_side_effect",
|
|
49
|
+
purpose: "find_target",
|
|
50
|
+
terms: weightedTerms((0, text_1.splitIdentifier)(transition.then), 4, "target_behavior")
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (strategies.includes("identity_or_key_change")) {
|
|
54
|
+
passes.push({
|
|
55
|
+
id: "identity-key",
|
|
56
|
+
label: "Identity/key usage",
|
|
57
|
+
strategy: "identity_or_key_change",
|
|
58
|
+
purpose: "find_current",
|
|
59
|
+
terms: weightedTerms(["id", "key", "name", "slug", "lookup", "find", "where", "filter", "compare"], 2.5, "strategy")
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (strategies.includes("failure_investigation")) {
|
|
63
|
+
passes.push({
|
|
64
|
+
id: "failure-signals",
|
|
65
|
+
label: "Failure and handling signals",
|
|
66
|
+
strategy: "failure_investigation",
|
|
67
|
+
purpose: "find_context",
|
|
68
|
+
terms: weightedTerms(["error", "fail", "failed", "exception", "catch", "retry", "fallback", "log", "warning"], 2, "strategy")
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
for (const slot of (0, contextBlueprint_1.allContextSlots)(input.blueprint)) {
|
|
72
|
+
const slotTerms = (0, contextBlueprint_1.slotSearchTerms)(slot);
|
|
73
|
+
if (slotTerms.length === 0) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
passes.push({
|
|
77
|
+
id: `coverage-${slot}`,
|
|
78
|
+
label: `${(0, contextBlueprint_1.contextSlotLabel)(slot)} coverage`,
|
|
79
|
+
strategy: "flow_coverage",
|
|
80
|
+
purpose: slot === "tests" ? "find_tests" : "find_coverage",
|
|
81
|
+
terms: weightedTerms(slotTerms, input.blueprint.requiredSlots.includes(slot) ? 0.35 : 0.25, "coverage")
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
passes.push({
|
|
85
|
+
id: "tests",
|
|
86
|
+
label: "Tests and verification",
|
|
87
|
+
strategy: "seed_search",
|
|
88
|
+
purpose: "find_tests",
|
|
89
|
+
terms: weightedTerms(input.concepts, 1.5, "strategy")
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
strategies: (0, text_1.uniq)(strategies.concat("seed_search", "flow_coverage")),
|
|
93
|
+
passes: passes.map((pass) => ({ ...pass, terms: mergeTerms(pass.terms) })).filter((pass) => pass.terms.length > 0)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function detectStrategies(normalizedTask, concepts) {
|
|
97
|
+
const strategies = ["seed_search"];
|
|
98
|
+
if (/\b(tu|from|instead|instead of|thay vi|thay bang|sang|doi tu|change from)\b/.test(normalizedTask)) {
|
|
99
|
+
strategies.push("behavior_change");
|
|
100
|
+
}
|
|
101
|
+
if (/\b(sau khi|after|when|once|on success|success|successful|thanh cong)\b/.test(normalizedTask)) {
|
|
102
|
+
strategies.push("state_transition_side_effect");
|
|
103
|
+
}
|
|
104
|
+
if (/\b(id|key|name|ten|slug|identifier)\b/.test(normalizedTask) && /\b(thay vi|instead|bang|by|lookup|find|where)\b/.test(normalizedTask)) {
|
|
105
|
+
strategies.push("identity_or_key_change");
|
|
106
|
+
}
|
|
107
|
+
if (/\b(error|fail|failed|bug|loi|khong|exception|crash|timeout)\b/.test(normalizedTask)) {
|
|
108
|
+
strategies.push("failure_investigation");
|
|
109
|
+
}
|
|
110
|
+
if (concepts.some((term) => ["config", "env", "schema", "migration", "database", "table"].includes(term))) {
|
|
111
|
+
strategies.push("data_or_config_change");
|
|
112
|
+
}
|
|
113
|
+
return (0, text_1.uniq)(strategies);
|
|
114
|
+
}
|
|
115
|
+
function extractBehaviorChange(normalizedTask) {
|
|
116
|
+
const patterns = [
|
|
117
|
+
/(?:tu|from)\s+(.+?)\s+(?:sang|to|thanh|thanh\s+|instead|thay vi)\s+(.+)$/,
|
|
118
|
+
/(?:thay|change|doi)\s+(.+?)\s+(?:bang|by|with|to)\s+(.+)$/
|
|
119
|
+
];
|
|
120
|
+
for (const pattern of patterns) {
|
|
121
|
+
const match = normalizedTask.match(pattern);
|
|
122
|
+
if (match?.[1] && match[2]) {
|
|
123
|
+
return { current: match[1], target: match[2] };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
function extractStateTransition(normalizedTask) {
|
|
129
|
+
const match = normalizedTask.match(/(?:sau khi|after|when|once)\s+(.+?)\s+(?:moi|then|thi|do|run|send|call)\s+(.+)$/);
|
|
130
|
+
if (match?.[1] && match[2]) {
|
|
131
|
+
return { when: match[1], then: match[2] };
|
|
132
|
+
}
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
function expandConfigSynonyms(keywords, config) {
|
|
136
|
+
const normalized = new Set(keywords.map(text_1.normalizeText));
|
|
137
|
+
const expanded = [];
|
|
138
|
+
for (const [key, values] of Object.entries(config.synonyms)) {
|
|
139
|
+
const candidates = [key, ...values];
|
|
140
|
+
if (candidates.some((candidate) => normalized.has((0, text_1.normalizeText)(candidate)))) {
|
|
141
|
+
expanded.push(...candidates);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return expanded;
|
|
145
|
+
}
|
|
146
|
+
function weightedTerms(terms, weight, source) {
|
|
147
|
+
return terms
|
|
148
|
+
.map(text_1.normalizeText)
|
|
149
|
+
.flatMap(text_1.splitIdentifier)
|
|
150
|
+
.filter((term) => term.length > 1)
|
|
151
|
+
.map((term) => ({ term, weight, source }));
|
|
152
|
+
}
|
|
153
|
+
function mergeTerms(terms) {
|
|
154
|
+
const byTerm = new Map();
|
|
155
|
+
for (const term of terms) {
|
|
156
|
+
const existing = byTerm.get(term.term);
|
|
157
|
+
if (!existing || term.weight > existing.weight) {
|
|
158
|
+
byTerm.set(term.term, term);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return Array.from(byTerm.values());
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=retrievalPlan.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runFlowSeekerHeadless = runFlowSeekerHeadless;
|
|
4
|
+
const async_1 = require("../utils/async");
|
|
5
|
+
const contextPack_1 = require("./contextPack");
|
|
6
|
+
const evidenceGraph_1 = require("./evidenceGraph");
|
|
7
|
+
const contextBlueprint_1 = require("./contextBlueprint");
|
|
8
|
+
const nodeScan_1 = require("./nodeScan");
|
|
9
|
+
const ranker_1 = require("./ranker");
|
|
10
|
+
const solvePacket_1 = require("./solvePacket");
|
|
11
|
+
const taskUnderstanding_1 = require("./taskUnderstanding");
|
|
12
|
+
const tokenSavings_1 = require("./tokenSavings");
|
|
13
|
+
async function runFlowSeekerHeadless(workspacePath, task, config, options = {}) {
|
|
14
|
+
const log = (stage, detail) => options.onStage?.(stage, detail);
|
|
15
|
+
log("task", task);
|
|
16
|
+
const profile = (0, taskUnderstanding_1.understandTask)(task, config);
|
|
17
|
+
log("scan", `${profile.intent} | ${profile.keywords.length} keywords`);
|
|
18
|
+
const scan = await (0, nodeScan_1.nodeScanWorkspace)(workspacePath, profile, config, options);
|
|
19
|
+
log("rank", `${scan.units.length} raw units from ${scan.stats.scannedFiles} files`);
|
|
20
|
+
const ranked = (0, ranker_1.rankEvidence)(scan.units, config, profile);
|
|
21
|
+
log("graph", `${ranked.length} units`);
|
|
22
|
+
const graph = (0, evidenceGraph_1.buildEvidenceGraph)(ranked);
|
|
23
|
+
const frameworkResult = await (0, async_1.withTimeout)((0, evidenceGraph_1.extractFrameworkEdges)(ranked, (msg) => options.onStage?.("framework", msg)), 15000, "framework edge extraction").catch(() => ({ edges: [], newUnits: [] }));
|
|
24
|
+
if (frameworkResult.edges.length > 0 || frameworkResult.newUnits.length > 0) {
|
|
25
|
+
log("framework", `${frameworkResult.edges.length} edges, ${frameworkResult.newUnits.length} discovered`);
|
|
26
|
+
}
|
|
27
|
+
let allUnits = ranked;
|
|
28
|
+
if (frameworkResult.edges.length > 0) {
|
|
29
|
+
graph.edges.push(...frameworkResult.edges);
|
|
30
|
+
}
|
|
31
|
+
if (frameworkResult.newUnits.length > 0) {
|
|
32
|
+
allUnits = [...ranked, ...frameworkResult.newUnits];
|
|
33
|
+
}
|
|
34
|
+
const graphBoosted = (0, evidenceGraph_1.boostWithGraph)(allUnits, graph);
|
|
35
|
+
const finalUnits = (0, ranker_1.rankEvidence)(graphBoosted, config, profile);
|
|
36
|
+
const contextPack = (0, contextPack_1.createContextPack)(task, finalUnits, config);
|
|
37
|
+
const result = {
|
|
38
|
+
task,
|
|
39
|
+
profile,
|
|
40
|
+
units: finalUnits,
|
|
41
|
+
contextPack,
|
|
42
|
+
stats: {
|
|
43
|
+
...scan.stats,
|
|
44
|
+
rankedEvidenceCount: finalUnits.length,
|
|
45
|
+
maxCandidates: config.pipeline.maxCandidates,
|
|
46
|
+
capped: scan.stats.rawEvidenceCount > finalUnits.length
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
result.solvePacket = await (0, solvePacket_1.buildSolvePacket)(result, config);
|
|
50
|
+
result.contextCoverage = (0, contextBlueprint_1.computeContextCoverage)(profile, finalUnits);
|
|
51
|
+
result.tokenSavings = (0, tokenSavings_1.computeTokenSavings)(result);
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=runHeadless.js.map
|
|
@@ -0,0 +1,114 @@
|
|
|
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.runFlowSeeker = runFlowSeeker;
|
|
37
|
+
const vscode = __importStar(require("vscode"));
|
|
38
|
+
const loadConfig_1 = require("../config/loadConfig");
|
|
39
|
+
const async_1 = require("../utils/async");
|
|
40
|
+
const contextPack_1 = require("./contextPack");
|
|
41
|
+
const evidenceGraph_1 = require("./evidenceGraph");
|
|
42
|
+
const contextBlueprint_1 = require("./contextBlueprint");
|
|
43
|
+
const ranker_1 = require("./ranker");
|
|
44
|
+
const solvePacket_1 = require("./solvePacket");
|
|
45
|
+
const taskUnderstanding_1 = require("./taskUnderstanding");
|
|
46
|
+
const tokenSavings_1 = require("./tokenSavings");
|
|
47
|
+
const universalScan_1 = require("./universalScan");
|
|
48
|
+
async function runFlowSeeker(task, options = {}) {
|
|
49
|
+
const config = await (0, loadConfig_1.loadConfig)();
|
|
50
|
+
const profile = (0, taskUnderstanding_1.understandTask)(task, config);
|
|
51
|
+
// Collect editor context for ranking bias (only in VS Code; null in headless).
|
|
52
|
+
const editorContext = options.editorContext ?? collectEditorContext();
|
|
53
|
+
options.progress?.report({ message: `Scanning workspace for "${task.slice(0, 60)}..."` });
|
|
54
|
+
const scan = await (0, universalScan_1.universalScan)(profile, config, options);
|
|
55
|
+
options.progress?.report({ message: `Ranking ${scan.units.length} evidence units from ${scan.stats.scannedFiles} files...` });
|
|
56
|
+
const ranked = (0, ranker_1.rankEvidence)(scan.units, config, profile, { editorContext });
|
|
57
|
+
options.progress?.report({ message: "Building evidence graph..." });
|
|
58
|
+
(0, async_1.checkCancelled)(options.token);
|
|
59
|
+
const graph = (0, evidenceGraph_1.buildEvidenceGraph)(ranked);
|
|
60
|
+
options.progress?.report({ message: "Extracting framework edges..." });
|
|
61
|
+
(0, async_1.checkCancelled)(options.token);
|
|
62
|
+
const frameworkResult = await (0, async_1.withTimeout)((0, evidenceGraph_1.extractFrameworkEdges)(ranked, (msg) => options.progress?.report({ message: msg })), 15000, "framework edge extraction").catch(() => {
|
|
63
|
+
options.progress?.report({ message: "Framework edges timed out — continuing without them." });
|
|
64
|
+
return { edges: [], newUnits: [] };
|
|
65
|
+
});
|
|
66
|
+
let allUnits = ranked;
|
|
67
|
+
if (frameworkResult.edges.length > 0) {
|
|
68
|
+
graph.edges.push(...frameworkResult.edges);
|
|
69
|
+
}
|
|
70
|
+
if (frameworkResult.newUnits.length > 0) {
|
|
71
|
+
allUnits = [...ranked, ...frameworkResult.newUnits];
|
|
72
|
+
}
|
|
73
|
+
const graphBoosted = (0, evidenceGraph_1.boostWithGraph)(allUnits, graph);
|
|
74
|
+
const finalUnits = (0, ranker_1.rankEvidence)(graphBoosted, config, profile, { editorContext });
|
|
75
|
+
const contextPack = (0, contextPack_1.createContextPack)(task, finalUnits, config);
|
|
76
|
+
const result = {
|
|
77
|
+
task,
|
|
78
|
+
profile,
|
|
79
|
+
units: finalUnits,
|
|
80
|
+
contextPack,
|
|
81
|
+
stats: {
|
|
82
|
+
...scan.stats,
|
|
83
|
+
rankedEvidenceCount: finalUnits.length,
|
|
84
|
+
maxCandidates: config.pipeline.maxCandidates,
|
|
85
|
+
capped: scan.stats.rawEvidenceCount > finalUnits.length
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
result.solvePacket = await (0, solvePacket_1.buildSolvePacket)(result, config);
|
|
89
|
+
result.contextCoverage = (0, contextBlueprint_1.computeContextCoverage)(profile, finalUnits);
|
|
90
|
+
result.tokenSavings = (0, tokenSavings_1.computeTokenSavings)(result);
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
function collectEditorContext() {
|
|
94
|
+
try {
|
|
95
|
+
const activeEditorUri = vscode.window.activeTextEditor?.document.uri.fsPath;
|
|
96
|
+
const tabs = vscode.window.tabGroups.all
|
|
97
|
+
.flatMap((group) => group.tabs)
|
|
98
|
+
.filter((tab) => {
|
|
99
|
+
const input = tab.input;
|
|
100
|
+
return input !== undefined && input !== null && typeof input === "object" && "uri" in input;
|
|
101
|
+
})
|
|
102
|
+
.map((tab) => tab.input.uri.fsPath)
|
|
103
|
+
.filter(Boolean);
|
|
104
|
+
const uniqueTabs = Array.from(new Set(tabs));
|
|
105
|
+
return {
|
|
106
|
+
activeFile: activeEditorUri,
|
|
107
|
+
recentFiles: uniqueTabs.length > 0 ? uniqueTabs.slice(0, 10) : undefined
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=runPipeline.js.map
|