codesearch-mcp 0.0.4-alpha → 0.0.6-alpha
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/dist/app.js +7 -3
- package/dist/src/project-selector.js +6 -1
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -57,9 +57,10 @@ function printSummary(allStats) {
|
|
|
57
57
|
}
|
|
58
58
|
async function main() {
|
|
59
59
|
const argv1 = path.basename(process.argv[1] ?? '');
|
|
60
|
+
const isIndex = argv1 === 'rag-index' || process.argv[2] === 'index';
|
|
60
61
|
const isMcp = argv1 === 'rag-mcp' || process.argv[2] === 'mcp';
|
|
61
62
|
const isSetup = argv1 === 'rag-setup' || process.argv[2] === 'setup';
|
|
62
|
-
const mode = isMcp ? 'mcp' : isSetup ? 'setup' : (process.argv[2] ?? '');
|
|
63
|
+
const mode = isIndex ? 'index' : isMcp ? 'mcp' : isSetup ? 'setup' : (process.argv[2] ?? '');
|
|
63
64
|
if (mode === 'index') {
|
|
64
65
|
const { initDbWithSchema } = await Promise.resolve().then(() => __importStar(require('./src/db')));
|
|
65
66
|
const { discoverProjects, scanAndIndex } = await Promise.resolve().then(() => __importStar(require('./src/indexer')));
|
|
@@ -67,11 +68,14 @@ async function main() {
|
|
|
67
68
|
const { selectProjects } = await Promise.resolve().then(() => __importStar(require('./src/project-selector')));
|
|
68
69
|
const { generateProjectGraph } = await Promise.resolve().then(() => __importStar(require('./src/graph')));
|
|
69
70
|
const args = process.argv.slice(argv1 === 'rag-index' ? 2 : 3);
|
|
70
|
-
const
|
|
71
|
+
const argPath = args.find(a => !a.startsWith('--'));
|
|
71
72
|
const force = args.includes('--reindex');
|
|
72
73
|
const forceSelect = args.includes('--select');
|
|
74
|
+
// Prefer explicit arg, then WORKSPACE_ROOT from config
|
|
75
|
+
const workspacePath = argPath ?? process.env.WORKSPACE_ROOT;
|
|
73
76
|
if (!workspacePath) {
|
|
74
|
-
console.error('Usage: rag-index
|
|
77
|
+
console.error('Usage: rag-index [path] [--reindex] [--select]');
|
|
78
|
+
console.error(' path defaults to WORKSPACE_ROOT set during rag-setup');
|
|
75
79
|
process.exit(1);
|
|
76
80
|
}
|
|
77
81
|
process.env.WORKSPACE_ROOT ??= workspacePath;
|
|
@@ -74,9 +74,14 @@ async function selectProjects(allProjects, workspaceDir, forceSelect) {
|
|
|
74
74
|
const toShow = forceSelect
|
|
75
75
|
? allProjects.filter(p => !config.skipped.has(p.name))
|
|
76
76
|
: newProjects;
|
|
77
|
+
const alreadyIncluded = allProjects.filter(p => config.included.has(p.name));
|
|
78
|
+
if (!forceSelect && alreadyIncluded.length > 0) {
|
|
79
|
+
console.log(`Already selected (will be re-indexed): ${alreadyIncluded.map(p => p.name).join(', ')}`);
|
|
80
|
+
console.log('Run with --select to change the full selection.\n');
|
|
81
|
+
}
|
|
77
82
|
const message = forceSelect
|
|
78
83
|
? 'Select projects to index'
|
|
79
|
-
: `Found ${newProjects.length} new project(s) — select which to
|
|
84
|
+
: `Found ${newProjects.length} new project(s) — select which to add`;
|
|
80
85
|
// Checkbox: pre-check previously included projects
|
|
81
86
|
const chosen = await (0, prompts_1.checkbox)({
|
|
82
87
|
message,
|
package/package.json
CHANGED