flowseeker 0.1.7 → 0.1.8
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/.env.example +7 -0
- package/CHANGELOG.md +131 -108
- package/README.md +288 -221
- package/dist/cli/flowCommand.js +175 -0
- package/dist/cli/main.js +1794 -0
- package/dist/cli/mcpServer.js +7 -1
- package/dist/cli/runEvaluation.js +178 -2
- package/dist/config/defaultConfig.js +11 -1
- package/dist/config/env.js +118 -0
- package/dist/config/loadConfig.js +18 -1
- package/dist/config/loadConfigFromPath.js +3 -1
- package/dist/extension.js +23 -0
- package/dist/gateway/embeddingProviders.js +852 -0
- package/dist/index/cacheStore.js +43 -0
- package/dist/index/configRouteDiscoveryProbe.js +288 -0
- package/dist/index/embeddingIndex.js +193 -0
- package/dist/index/graphIndex.js +460 -0
- package/dist/index/indexWatcher.js +86 -0
- package/dist/index/structuredExtractor.js +303 -12
- package/dist/index/treeSitterExtractor.js +264 -0
- package/dist/index/vectorStore.js +41 -0
- package/dist/index/workspaceIndex.js +591 -26
- package/dist/mcp/mcpTools.js +51 -0
- package/dist/pipeline/contextPack.js +3 -3
- package/dist/pipeline/deterministicReranker.js +358 -0
- package/dist/pipeline/evaluationMetrics.js +14 -2
- package/dist/pipeline/fileGroups.js +7 -1
- package/dist/pipeline/fileScanner.js +93 -11
- package/dist/pipeline/llmReranker.js +151 -0
- package/dist/pipeline/nodeScan.js +91 -12
- package/dist/pipeline/ranker.js +875 -16
- package/dist/pipeline/retrievalFusion.js +41 -0
- package/dist/pipeline/runHeadless.js +35 -0
- package/dist/pipeline/solvePacket.js +549 -42
- package/dist/pipeline/subsystem.js +21 -0
- package/docs/demo-screenshot-checklist.md +86 -0
- package/docs/marketplace-copy.md +92 -0
- package/docs/mcp-onboarding.md +191 -0
- package/package.json +633 -561
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const fs = __importStar(require("fs/promises"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const mcpTools_1 = require("../mcp/mcpTools");
|
|
40
|
+
void main().catch((error) => {
|
|
41
|
+
const message = error instanceof Error ? error.stack ?? error.message : String(error);
|
|
42
|
+
console.error(message);
|
|
43
|
+
process.exitCode = 1;
|
|
44
|
+
});
|
|
45
|
+
async function main() {
|
|
46
|
+
const options = parseArgs(process.argv);
|
|
47
|
+
const toolName = modeToToolName(options.mode);
|
|
48
|
+
const input = {
|
|
49
|
+
task: options.task,
|
|
50
|
+
workspace: options.workspace,
|
|
51
|
+
maxFiles: options.maxFiles,
|
|
52
|
+
limit: options.limit
|
|
53
|
+
};
|
|
54
|
+
const result = await (0, mcpTools_1.handleToolCall)(toolName, input, options.workspace);
|
|
55
|
+
const text = result.content.map((item) => item.text).join("\n\n");
|
|
56
|
+
if (options.outFile) {
|
|
57
|
+
await fs.mkdir(path.dirname(path.resolve(options.outFile)), { recursive: true });
|
|
58
|
+
await fs.writeFile(options.outFile, text, "utf8");
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
process.stdout.write(`${text}\n`);
|
|
62
|
+
}
|
|
63
|
+
if (result.isError) {
|
|
64
|
+
process.exitCode = 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function parseArgs(argv) {
|
|
68
|
+
const invoked = path.basename(argv[1] ?? "").toLowerCase();
|
|
69
|
+
let mode = invoked.includes("auto") ? "auto" :
|
|
70
|
+
invoked.includes("files") ? "files" :
|
|
71
|
+
invoked.includes("retrieve") ? "retrieve" :
|
|
72
|
+
"guide";
|
|
73
|
+
let workspace = process.cwd();
|
|
74
|
+
let maxFiles;
|
|
75
|
+
let limit;
|
|
76
|
+
let outFile;
|
|
77
|
+
const taskParts = [];
|
|
78
|
+
for (let i = 2; i < argv.length; i++) {
|
|
79
|
+
const arg = argv[i];
|
|
80
|
+
const next = argv[i + 1];
|
|
81
|
+
if (arg === "--help" || arg === "-h") {
|
|
82
|
+
printHelp(invoked || "fs-guide");
|
|
83
|
+
process.exit(0);
|
|
84
|
+
}
|
|
85
|
+
if (arg === "--mode" && next) {
|
|
86
|
+
mode = parseMode(next);
|
|
87
|
+
i++;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if ((arg === "--workspace" || arg === "-w") && next) {
|
|
91
|
+
workspace = path.resolve(next);
|
|
92
|
+
i++;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (arg === "--max-files" && next) {
|
|
96
|
+
maxFiles = parsePositiveInt(next, "--max-files");
|
|
97
|
+
i++;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if ((arg === "--limit" || arg === "-n") && next) {
|
|
101
|
+
limit = parsePositiveInt(next, "--limit");
|
|
102
|
+
i++;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if ((arg === "--out" || arg === "-o") && next) {
|
|
106
|
+
outFile = next;
|
|
107
|
+
i++;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (arg.startsWith("-")) {
|
|
111
|
+
throw new Error(`Unknown option: ${arg}`);
|
|
112
|
+
}
|
|
113
|
+
taskParts.push(arg);
|
|
114
|
+
}
|
|
115
|
+
const task = taskParts.join(" ").trim();
|
|
116
|
+
if (!task) {
|
|
117
|
+
printHelp(invoked || "fs-guide");
|
|
118
|
+
throw new Error("Task is required.");
|
|
119
|
+
}
|
|
120
|
+
return { mode, workspace, task, maxFiles, limit, outFile };
|
|
121
|
+
}
|
|
122
|
+
function parseMode(value) {
|
|
123
|
+
if (value === "guide" || value === "auto" || value === "files" || value === "retrieve") {
|
|
124
|
+
return value;
|
|
125
|
+
}
|
|
126
|
+
throw new Error(`Invalid --mode value: ${value}`);
|
|
127
|
+
}
|
|
128
|
+
function parsePositiveInt(value, option) {
|
|
129
|
+
const parsed = Number(value);
|
|
130
|
+
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
131
|
+
throw new Error(`${option} must be a positive integer.`);
|
|
132
|
+
}
|
|
133
|
+
return parsed;
|
|
134
|
+
}
|
|
135
|
+
function modeToToolName(mode) {
|
|
136
|
+
switch (mode) {
|
|
137
|
+
case "auto":
|
|
138
|
+
return "flowseeker_auto";
|
|
139
|
+
case "files":
|
|
140
|
+
return "flowseeker_files";
|
|
141
|
+
case "retrieve":
|
|
142
|
+
return "flowseeker_retrieve";
|
|
143
|
+
case "guide":
|
|
144
|
+
default:
|
|
145
|
+
return "flowseeker_guide";
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function printHelp(command) {
|
|
149
|
+
const usage = [
|
|
150
|
+
"FlowSeeker short CLI commands",
|
|
151
|
+
"",
|
|
152
|
+
"Usage:",
|
|
153
|
+
` ${command} \"Fix checkout webhook retry\"`,
|
|
154
|
+
` ${command} -w D:\\Path\\To\\Repo \"Add CSV export\"`,
|
|
155
|
+
` ${command} --out .flowseeker/guide.md \"Find auth middleware\"`,
|
|
156
|
+
"",
|
|
157
|
+
"Commands:",
|
|
158
|
+
" fs-guide Build an agent guidance prompt from retrieved context.",
|
|
159
|
+
" fs-auto Build a reviewable implementation-plan prompt.",
|
|
160
|
+
" fs-files Print top ranked files only.",
|
|
161
|
+
" fs-retrieve Print the full Solve Packet.",
|
|
162
|
+
" fs-mcp Start the FlowSeeker MCP server.",
|
|
163
|
+
"",
|
|
164
|
+
"Options:",
|
|
165
|
+
" -w, --workspace <path> Workspace root. Default: current directory.",
|
|
166
|
+
" -o, --out <file> Write output to a file instead of stdout.",
|
|
167
|
+
" -n, --limit <count> File limit for fs-files. Default: 15.",
|
|
168
|
+
" --max-files <count> Scan cap for fs-retrieve.",
|
|
169
|
+
" --mode <mode> Override mode: guide, auto, files, retrieve.",
|
|
170
|
+
" -h, --help Show help.",
|
|
171
|
+
""
|
|
172
|
+
];
|
|
173
|
+
console.error(usage.join("\n"));
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=flowCommand.js.map
|