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.
Files changed (82) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/COMPATIBILITY.md +281 -0
  3. package/LICENSE +21 -0
  4. package/README.md +375 -0
  5. package/dist/adapters/frameworkEdges.js +586 -0
  6. package/dist/agent/approvalPolicy.js +81 -0
  7. package/dist/agent/commandRunner.js +166 -0
  8. package/dist/agent/flowCommandRunner.js +124 -0
  9. package/dist/agent/mcpToolRunner.js +167 -0
  10. package/dist/auth/githubAuth.js +71 -0
  11. package/dist/auth/modelList.js +127 -0
  12. package/dist/auth/oauthHandler.js +377 -0
  13. package/dist/chat/nativeChatParticipant.js +616 -0
  14. package/dist/cli/mcpServer.js +383 -0
  15. package/dist/cli/runEvaluation.js +789 -0
  16. package/dist/cli/runReplay.js +481 -0
  17. package/dist/commands/checkHostCompatibility.js +149 -0
  18. package/dist/commands/copyAgentPrompt.js +52 -0
  19. package/dist/commands/copyContext.js +54 -0
  20. package/dist/commands/explainSelectionRelevance.js +57 -0
  21. package/dist/commands/findRelevantContext.js +127 -0
  22. package/dist/commands/openEvidence.js +49 -0
  23. package/dist/commands/openMcpConfig.js +81 -0
  24. package/dist/commands/openRelatedTests.js +54 -0
  25. package/dist/commands/rebuildIndex.js +45 -0
  26. package/dist/commands/runEvaluationSuite.js +323 -0
  27. package/dist/commands/runReplaySuite.js +228 -0
  28. package/dist/config/defaultConfig.js +72 -0
  29. package/dist/config/loadConfig.js +84 -0
  30. package/dist/config/loadConfigFromPath.js +60 -0
  31. package/dist/extension.js +513 -0
  32. package/dist/gateway/agentPrompts.js +176 -0
  33. package/dist/gateway/aiGateway.js +1255 -0
  34. package/dist/gateway/aiProviders.js +901 -0
  35. package/dist/gateway/contextExpansion.js +331 -0
  36. package/dist/gateway/editProposalStore.js +238 -0
  37. package/dist/gateway/planProposalStore.js +28 -0
  38. package/dist/index/cacheStore.js +51 -0
  39. package/dist/index/chunker.js +45 -0
  40. package/dist/index/dependencyExtractor.js +107 -0
  41. package/dist/index/fileDiscovery.js +177 -0
  42. package/dist/index/structuredExtractor.js +256 -0
  43. package/dist/index/workspaceIndex.js +518 -0
  44. package/dist/mcp/mcpConfig.js +154 -0
  45. package/dist/mcp/mcpProvider.js +109 -0
  46. package/dist/mcp/mcpTools.js +215 -0
  47. package/dist/pipeline/agentPrompt.js +79 -0
  48. package/dist/pipeline/agentPromptHeadless.js +85 -0
  49. package/dist/pipeline/contextBlueprint.js +346 -0
  50. package/dist/pipeline/contextPack.js +80 -0
  51. package/dist/pipeline/diffPreview.js +79 -0
  52. package/dist/pipeline/evaluationMetrics.js +154 -0
  53. package/dist/pipeline/evidenceGraph.js +389 -0
  54. package/dist/pipeline/feedback.js +215 -0
  55. package/dist/pipeline/fileGroups.js +84 -0
  56. package/dist/pipeline/fileScanner.js +866 -0
  57. package/dist/pipeline/nodeScan.js +219 -0
  58. package/dist/pipeline/ranker.js +563 -0
  59. package/dist/pipeline/responseLanguage.js +39 -0
  60. package/dist/pipeline/retrievalPlan.js +163 -0
  61. package/dist/pipeline/runHeadless.js +54 -0
  62. package/dist/pipeline/runPipeline.js +114 -0
  63. package/dist/pipeline/solvePacket.js +382 -0
  64. package/dist/pipeline/subsystem.js +257 -0
  65. package/dist/pipeline/taskUnderstanding.js +453 -0
  66. package/dist/pipeline/tokenSavings.js +146 -0
  67. package/dist/pipeline/universalScan.js +216 -0
  68. package/dist/pipeline/verifyAfterApply.js +233 -0
  69. package/dist/runtime/capabilities.js +71 -0
  70. package/dist/runtime/hostDetect.js +98 -0
  71. package/dist/runtime/hostTier.js +68 -0
  72. package/dist/runtime/statusBar.js +80 -0
  73. package/dist/skills/skillRegistry.js +208 -0
  74. package/dist/types.js +3 -0
  75. package/dist/ui/chatViewProvider.js +3899 -0
  76. package/dist/ui/resultTreeProvider.js +174 -0
  77. package/dist/usage/quotaTracker.js +358 -0
  78. package/dist/utils/async.js +30 -0
  79. package/dist/utils/logger.js +64 -0
  80. package/dist/utils/text.js +364 -0
  81. package/dist/utils/updateChecker.js +140 -0
  82. package/package.json +561 -0
@@ -0,0 +1,219 @@
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.nodeScanWorkspace = nodeScanWorkspace;
37
+ const fs = __importStar(require("fs/promises"));
38
+ const path = __importStar(require("path"));
39
+ const fileDiscovery_1 = require("../index/fileDiscovery");
40
+ const workspaceIndex_1 = require("../index/workspaceIndex");
41
+ const text_1 = require("../utils/text");
42
+ const fileScanner_1 = require("./fileScanner");
43
+ async function nodeScanWorkspace(workspacePath, profile, config, options = {}) {
44
+ const startedAt = Date.now();
45
+ const rootPath = path.resolve(workspacePath);
46
+ const discovery = await discoverScanFiles(rootPath, profile, config, startedAt, options);
47
+ const scanStartedAt = Date.now();
48
+ const maxBytes = config.pipeline.maxTotalBytesMb * 1024 * 1024;
49
+ const maxRawEvidence = Math.max(config.pipeline.maxCandidates, config.pipeline.maxRawEvidence);
50
+ let stopReason = discovery.stopReason;
51
+ const allUnits = [];
52
+ let scannedFiles = 0;
53
+ let skippedFiles = 0;
54
+ let scannedBytes = 0;
55
+ let scannedTokens = 0;
56
+ for (const file of discovery.files) {
57
+ const processedFiles = scannedFiles + skippedFiles;
58
+ if (options.shouldCancel?.()) {
59
+ stopReason = "cancelled";
60
+ break;
61
+ }
62
+ if (Date.now() - scanStartedAt > config.pipeline.maxScanMs) {
63
+ stopReason = combineStopReason(stopReason, `maxScanMs ${config.pipeline.maxScanMs} reached during candidate scan`);
64
+ break;
65
+ }
66
+ if (scannedBytes >= maxBytes) {
67
+ stopReason = combineStopReason(stopReason, `maxTotalBytesMb ${config.pipeline.maxTotalBytesMb} reached during candidate scan`);
68
+ break;
69
+ }
70
+ if (allUnits.length >= maxRawEvidence) {
71
+ stopReason = combineStopReason(stopReason, `maxRawEvidence ${maxRawEvidence} reached during candidate scan`);
72
+ break;
73
+ }
74
+ if (processedFiles % 15 === 0) {
75
+ options.onProgress?.(`Scanning ${processedFiles + 1}/${discovery.files.length}: ${formatProgressPath(file.relativePath)}`);
76
+ }
77
+ const fileStartedAt = Date.now();
78
+ const result = await scanNodeFile(file, profile, config);
79
+ const fileDurationMs = Date.now() - fileStartedAt;
80
+ if (result.scanned) {
81
+ scannedFiles += 1;
82
+ scannedBytes += result.size;
83
+ scannedTokens += result.tokenCount;
84
+ }
85
+ else {
86
+ skippedFiles += 1;
87
+ }
88
+ allUnits.push(...result.units);
89
+ if (fileDurationMs > 1000) {
90
+ options.onProgress?.(`Slow scan ${fileDurationMs}ms: ${formatProgressPath(file.relativePath)} (${result.units.length} evidence)`);
91
+ }
92
+ if ((scannedFiles + skippedFiles) % 15 === 0) {
93
+ options.onProgress?.(`Scanned ${scannedFiles}/${discovery.files.length} files, ${allUnits.length} evidence`);
94
+ }
95
+ if (allUnits.length >= maxRawEvidence) {
96
+ stopReason = combineStopReason(stopReason, `maxRawEvidence ${maxRawEvidence} reached during candidate scan`);
97
+ break;
98
+ }
99
+ if ((scannedFiles + skippedFiles) % 25 === 0) {
100
+ await yieldToHost();
101
+ }
102
+ }
103
+ return {
104
+ units: allUnits,
105
+ stats: {
106
+ scannedFiles,
107
+ skippedFiles,
108
+ discoveredFiles: discovery.discoveredFiles ?? discovery.files.length,
109
+ scannedBytes,
110
+ scannedTokens,
111
+ rawEvidenceCount: allUnits.length,
112
+ rankedEvidenceCount: allUnits.length,
113
+ maxCandidates: config.pipeline.maxCandidates,
114
+ capped: allUnits.length > config.pipeline.maxCandidates,
115
+ stoppedEarly: Boolean(stopReason),
116
+ stopReason,
117
+ indexedFiles: discovery.indexedFiles,
118
+ indexedBytes: discovery.indexedBytes,
119
+ indexedTokens: discovery.indexedTokens,
120
+ candidateFiles: discovery.candidateFiles,
121
+ indexReusedFiles: discovery.indexReusedFiles,
122
+ indexUpdatedFiles: discovery.indexUpdatedFiles
123
+ }
124
+ };
125
+ }
126
+ function combineStopReason(existing, next) {
127
+ return existing ? `${existing}; ${next}` : next;
128
+ }
129
+ function formatProgressPath(relativePath) {
130
+ return relativePath.length > 120 ? `...${relativePath.slice(-117)}` : relativePath;
131
+ }
132
+ function yieldToHost() {
133
+ return new Promise((resolve) => setTimeout(resolve, 0));
134
+ }
135
+ async function discoverScanFiles(rootPath, profile, config, startedAt, options) {
136
+ if (!config.index.enableWorkspaceIndex) {
137
+ return (0, fileDiscovery_1.discoverWorkspaceFiles)(rootPath, config, { startedAt, shouldCancel: options.shouldCancel });
138
+ }
139
+ const indexed = await (0, workspaceIndex_1.loadOrBuildWorkspaceIndex)(rootPath, config, {
140
+ startedAt,
141
+ shouldCancel: options.shouldCancel,
142
+ onProgress: options.onProgress
143
+ });
144
+ const candidates = (0, workspaceIndex_1.selectIndexCandidates)(indexed.index, profile, config);
145
+ const files = candidates.length > 0
146
+ ? candidates
147
+ : fallbackIndexCandidates(rootPath, indexed.index.files, config.index.maxIndexedCandidateFiles);
148
+ return {
149
+ files,
150
+ stopReason: indexed.stopReason,
151
+ discoveredFiles: indexed.discoveredFiles,
152
+ indexedFiles: indexed.index.files.length,
153
+ indexedBytes: indexed.indexedBytes,
154
+ indexedTokens: indexed.indexedTokens,
155
+ candidateFiles: files.length,
156
+ indexReusedFiles: indexed.reusedFiles,
157
+ indexUpdatedFiles: indexed.updatedFiles
158
+ };
159
+ }
160
+ function fallbackIndexCandidates(rootPath, files, maxFiles) {
161
+ return [...files]
162
+ .sort((left, right) => fallbackPathPriority(right.relativePath) - fallbackPathPriority(left.relativePath) || left.size - right.size)
163
+ .slice(0, maxFiles)
164
+ .map((file) => ({ absolutePath: path.join(rootPath, file.relativePath), relativePath: file.relativePath }));
165
+ }
166
+ function fallbackPathPriority(relativePath) {
167
+ const normalized = relativePath.replace(/\\/g, "/").toLowerCase();
168
+ let score = 0;
169
+ if (/(^|\/)(src|app|lib|server|backend|frontend|packages|modules)(\/|$)/.test(normalized))
170
+ score += 10;
171
+ if (/(controller|handler|service|repository|model|route|router|worker|job|listener|command|resolver)/.test(normalized))
172
+ score += 8;
173
+ if (/(test|spec|__tests__)/.test(normalized))
174
+ score += 5;
175
+ if (/(config|schema|migration|database)/.test(normalized))
176
+ score += 4;
177
+ if (/(node_modules|vendor|dist|build|coverage|cache|public|assets|storage\/framework)/.test(normalized))
178
+ score -= 20;
179
+ return score;
180
+ }
181
+ async function scanNodeFile(file, profile, config) {
182
+ if (!(0, text_1.isLikelyTextPath)(file.relativePath)) {
183
+ return { units: [], scanned: false, size: 0, tokenCount: 0 };
184
+ }
185
+ let stat;
186
+ try {
187
+ stat = await fs.stat(file.absolutePath);
188
+ }
189
+ catch {
190
+ return { units: [], scanned: false, size: 0, tokenCount: 0 };
191
+ }
192
+ if (stat.size > config.project.maxFileSizeKb * 1024) {
193
+ return { units: [], scanned: false, size: stat.size, tokenCount: 0 };
194
+ }
195
+ let content;
196
+ try {
197
+ content = await fs.readFile(file.absolutePath, "utf8");
198
+ }
199
+ catch {
200
+ return { units: [], scanned: false, size: stat.size, tokenCount: 0 };
201
+ }
202
+ if (content.includes("\u0000")) {
203
+ return { units: [], scanned: false, size: stat.size, tokenCount: 0 };
204
+ }
205
+ return {
206
+ units: (0, fileScanner_1.scanTextFile)({
207
+ file: file.absolutePath,
208
+ relativePath: file.relativePath,
209
+ content,
210
+ size: stat.size,
211
+ profile,
212
+ config
213
+ }),
214
+ scanned: true,
215
+ size: stat.size,
216
+ tokenCount: (0, text_1.fastTokenEstimate)(`${file.relativePath}\n${content}`)
217
+ };
218
+ }
219
+ //# sourceMappingURL=nodeScan.js.map