flowseeker 0.1.7 → 0.1.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 (50) hide show
  1. package/.env.example +7 -0
  2. package/CHANGELOG.md +143 -108
  3. package/README.md +288 -221
  4. package/dist/chat/nativeChatParticipant.js +1 -1
  5. package/dist/cli/flowCommand.js +175 -0
  6. package/dist/cli/main.js +1810 -0
  7. package/dist/cli/mcpServer.js +7 -1
  8. package/dist/cli/runEvaluation.js +281 -2
  9. package/dist/config/defaultConfig.js +11 -1
  10. package/dist/config/env.js +118 -0
  11. package/dist/config/loadConfig.js +18 -1
  12. package/dist/config/loadConfigFromPath.js +3 -1
  13. package/dist/eval/accuracyV2.js +483 -0
  14. package/dist/eval/goldenTask.js +192 -0
  15. package/dist/extension.js +23 -0
  16. package/dist/framework/laravel.js +177 -0
  17. package/dist/gateway/embeddingProviders.js +852 -0
  18. package/dist/index/cacheStore.js +43 -0
  19. package/dist/index/configRouteDiscoveryProbe.js +288 -0
  20. package/dist/index/embeddingIndex.js +193 -0
  21. package/dist/index/graphIndex.js +460 -0
  22. package/dist/index/indexWatcher.js +86 -0
  23. package/dist/index/semanticChunkIndex.js +388 -0
  24. package/dist/index/structuredExtractor.js +303 -12
  25. package/dist/index/treeSitterExtractor.js +264 -0
  26. package/dist/index/vectorStore.js +41 -0
  27. package/dist/index/workspaceIndex.js +901 -26
  28. package/dist/mcp/mcpTools.js +1678 -2
  29. package/dist/pipeline/contextBlueprint.js +15 -2
  30. package/dist/pipeline/contextPack.js +3 -3
  31. package/dist/pipeline/deterministicReranker.js +358 -0
  32. package/dist/pipeline/evaluationMetrics.js +14 -2
  33. package/dist/pipeline/fileGroups.js +7 -1
  34. package/dist/pipeline/fileScanner.js +209 -12
  35. package/dist/pipeline/fusionTrace.js +149 -0
  36. package/dist/pipeline/llmReranker.js +151 -0
  37. package/dist/pipeline/nodeScan.js +102 -12
  38. package/dist/pipeline/ranker.js +875 -16
  39. package/dist/pipeline/retrievalFusion.js +41 -0
  40. package/dist/pipeline/roleRefinement.js +62 -0
  41. package/dist/pipeline/runHeadless.js +60 -5
  42. package/dist/pipeline/runPipeline.js +2 -2
  43. package/dist/pipeline/solvePacket.js +656 -43
  44. package/dist/pipeline/subsystem.js +21 -0
  45. package/dist/pipeline/taskUnderstanding.js +2 -2
  46. package/dist/ui/chatViewProvider.js +1 -1
  47. package/docs/demo-screenshot-checklist.md +86 -0
  48. package/docs/marketplace-copy.md +92 -0
  49. package/docs/mcp-onboarding.md +191 -0
  50. package/package.json +633 -561
package/dist/extension.js CHANGED
@@ -64,6 +64,7 @@ const statusBar_1 = require("./runtime/statusBar");
64
64
  const chatViewProvider_1 = require("./ui/chatViewProvider");
65
65
  const resultTreeProvider_1 = require("./ui/resultTreeProvider");
66
66
  const logger_1 = require("./utils/logger");
67
+ const indexWatcher_1 = require("./index/indexWatcher");
67
68
  const updateChecker_1 = require("./utils/updateChecker");
68
69
  const oauthHandler_1 = require("./auth/oauthHandler");
69
70
  const githubAuth_1 = require("./auth/githubAuth");
@@ -146,6 +147,28 @@ async function activate(context) {
146
147
  if (mcpProvider) {
147
148
  context.subscriptions.push(mcpProvider);
148
149
  }
150
+ // Index watcher: debounce + batch + stale invalidation
151
+ const workspaceFolders = vscode.workspace.workspaceFolders;
152
+ if (workspaceFolders && workspaceFolders.length > 0) {
153
+ const staleState = { stale: false, changedPaths: new Set(), deletedPaths: new Set(), lastInvalidatedAt: undefined };
154
+ const watcher = (0, indexWatcher_1.createIndexWatcher)({
155
+ debounceMs: 2000,
156
+ onFlush: (changed, deleted) => {
157
+ staleState.stale = true;
158
+ staleState.lastInvalidatedAt = Date.now();
159
+ for (const p of changed)
160
+ staleState.changedPaths.add(p);
161
+ for (const p of deleted)
162
+ staleState.deletedPaths.add(p);
163
+ }
164
+ });
165
+ const cwd = workspaceFolders[0].uri.fsPath;
166
+ const fsw = vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(cwd, "**/*"));
167
+ fsw.onDidChange((uri) => (0, indexWatcher_1.onFileChanged)(watcher, vscode.workspace.asRelativePath(uri)));
168
+ fsw.onDidCreate((uri) => (0, indexWatcher_1.onFileCreated)(watcher, vscode.workspace.asRelativePath(uri)));
169
+ fsw.onDidDelete((uri) => (0, indexWatcher_1.onFileDeleted)(watcher, vscode.workspace.asRelativePath(uri)));
170
+ context.subscriptions.push({ dispose: () => { fsw.dispose(); (0, indexWatcher_1.dispose)(watcher); } });
171
+ }
149
172
  (0, logger_1.logInfo)("FlowSeeker commands and result tree registered.");
150
173
  }
151
174
  function deactivate() { }
@@ -0,0 +1,177 @@
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.laravelSlotMapping = void 0;
37
+ exports.detectLaravelFramework = detectLaravelFramework;
38
+ exports.classifyLaravelTask = classifyLaravelTask;
39
+ exports.laravelCategoryRequiredSlots = laravelCategoryRequiredSlots;
40
+ exports.laravelMissingLinkHints = laravelMissingLinkHints;
41
+ exports.applyLaravelTemplate = applyLaravelTemplate;
42
+ const fs = __importStar(require("fs/promises"));
43
+ const path = __importStar(require("path"));
44
+ const laravelSignals = [
45
+ { path: "artisan", weight: 8, label: "artisan" },
46
+ { path: "routes/web.php", weight: 6, label: "routes/web.php" },
47
+ { path: "routes/api.php", weight: 5, label: "routes/api.php" },
48
+ { path: "app/Http/Controllers", weight: 5, label: "app/Http/Controllers" },
49
+ { path: "app/Models", weight: 4, label: "app/Models" },
50
+ { path: "resources/views", weight: 4, label: "resources/views" },
51
+ { path: "config/app.php", weight: 3, label: "config/app.php" },
52
+ { path: "bootstrap/app.php", weight: 3, label: "bootstrap/app.php" },
53
+ { path: "app/Providers", weight: 2, label: "app/Providers" },
54
+ { path: "app/Http/Middleware", weight: 2, label: "app/Http/Middleware" },
55
+ { path: "database/migrations", weight: 2, label: "database/migrations" },
56
+ { path: "app/Console", weight: 2, label: "app/Console" },
57
+ { path: "vite.config.js", weight: 1, label: "vite.config.js" },
58
+ ];
59
+ const minScoreForLaravel = 12;
60
+ async function detectLaravelFramework(rootPath) {
61
+ const signals = [];
62
+ let score = 0;
63
+ for (const signal of laravelSignals) {
64
+ try {
65
+ await fs.access(path.join(rootPath, signal.path));
66
+ score += signal.weight;
67
+ signals.push(signal.label);
68
+ }
69
+ catch {
70
+ // path doesn't exist
71
+ }
72
+ }
73
+ // Check composer.json for laravel/framework dependency
74
+ try {
75
+ const composerRaw = await fs.readFile(path.join(rootPath, "composer.json"), "utf8");
76
+ const composer = JSON.parse(composerRaw);
77
+ const deps = { ...(composer.require ?? {}), ...(composer["require-dev"] ?? {}) };
78
+ if (deps["laravel/framework"]) {
79
+ score += 10;
80
+ signals.push("composer:laravel/framework");
81
+ }
82
+ const illuminateDeps = Object.keys(deps).filter((k) => k.startsWith("illuminate/"));
83
+ if (illuminateDeps.length > 0) {
84
+ score += Math.min(5, illuminateDeps.length);
85
+ signals.push(`composer:illuminate(${illuminateDeps.length})`);
86
+ }
87
+ }
88
+ catch {
89
+ // no composer.json
90
+ }
91
+ const confidence = Math.min(1, score / 25);
92
+ return {
93
+ isLaravel: score >= minScoreForLaravel,
94
+ confidence,
95
+ signals,
96
+ };
97
+ }
98
+ // ── Laravel slot → directory mapping ──────────────────────────────────────────
99
+ exports.laravelSlotMapping = {
100
+ entry: ["routes/*.php"],
101
+ handler: ["app/Http/Controllers/**"],
102
+ domain: ["app/Services/**", "app/Actions/**", "app/Exports/**", "app/Imports/**"],
103
+ data: ["app/Models/**", "app/Repositories/**", "database/migrations/**"],
104
+ validation: ["app/Http/Requests/**"],
105
+ permission: ["app/Policies/**", "app/Http/Middleware/**"],
106
+ config: ["config/**", ".env", ".env.example"],
107
+ side_effect: ["app/Jobs/**", "app/Events/**", "app/Listeners/**", "app/Mail/**", "app/Notifications/**"],
108
+ ui: ["resources/views/**"],
109
+ tests: ["tests/**"],
110
+ docs: [],
111
+ unknown: [],
112
+ };
113
+ function classifyLaravelTask(normalizedTask) {
114
+ const t = normalizedTask.toLowerCase();
115
+ if (/\bimport\b/.test(t) || /\bupload\b/.test(t))
116
+ return "import";
117
+ if (/\b(export|download|excel|csv|report|pdf)\b/.test(t))
118
+ return "export_report";
119
+ if (/\b(auth|login|logout|register|permission|role|policy|guard)\b/.test(t))
120
+ return "auth_permission";
121
+ if (/\b(payment|invoice|billing|checkout|refund|gateway)\b/.test(t))
122
+ return "payment_invoice";
123
+ if (/\b(email|notification|notify|mail|job|event|listener|dispatch)\b/.test(t))
124
+ return "notification_email";
125
+ if (/\b(view|display|page|blade|layout|render|frontend|ui|modal)\b/.test(t))
126
+ return "view_display";
127
+ return "generic";
128
+ }
129
+ function laravelCategoryRequiredSlots(category) {
130
+ const mapping = {
131
+ export_report: ["entry", "handler", "domain", "data", "side_effect", "tests"],
132
+ import: ["entry", "handler", "domain", "validation", "data", "tests"],
133
+ auth_permission: ["entry", "handler", "permission", "domain", "data", "tests"],
134
+ payment_invoice: ["entry", "handler", "domain", "data", "side_effect", "tests"],
135
+ notification_email: ["entry", "handler", "side_effect", "data", "tests"],
136
+ view_display: ["entry", "handler", "ui", "data", "tests"],
137
+ generic: ["entry", "handler", "domain", "data", "tests"],
138
+ };
139
+ return mapping[category] ?? mapping.generic;
140
+ }
141
+ // ── Missing-link hints ────────────────────────────────────────────────────────
142
+ function laravelMissingLinkHints(missingSlots) {
143
+ const hints = [];
144
+ for (const slot of missingSlots) {
145
+ const dirs = exports.laravelSlotMapping[slot];
146
+ if (dirs && dirs.length > 0) {
147
+ hints.push(`missing ${slot}: check ${dirs.join(", ")}`);
148
+ }
149
+ }
150
+ return hints;
151
+ }
152
+ async function applyLaravelTemplate(rootPath, normalizedTask, existingRequiredSlots) {
153
+ const detection = await detectLaravelFramework(rootPath);
154
+ if (!detection.isLaravel) {
155
+ return {
156
+ detected: false,
157
+ confidence: detection.confidence,
158
+ category: "generic",
159
+ suggestedRequiredSlots: [],
160
+ missingLinkHints: [],
161
+ };
162
+ }
163
+ const category = classifyLaravelTask(normalizedTask);
164
+ const templateSlots = laravelCategoryRequiredSlots(category);
165
+ const existing = new Set(existingRequiredSlots);
166
+ const suggested = templateSlots.filter((s) => !existing.has(s));
167
+ const missing = templateSlots.filter((s) => !existing.has(s));
168
+ const hints = laravelMissingLinkHints(missing);
169
+ return {
170
+ detected: true,
171
+ confidence: detection.confidence,
172
+ category,
173
+ suggestedRequiredSlots: suggested,
174
+ missingLinkHints: hints,
175
+ };
176
+ }
177
+ //# sourceMappingURL=laravel.js.map