rrce-workflow 0.2.62 → 0.2.63
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/index.js +16 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -209,17 +209,20 @@ function scanGlobalStorage(excludeWorkspace) {
|
|
|
209
209
|
const knowledgePath = path2.join(projectDataPath, "knowledge");
|
|
210
210
|
const refsPath = path2.join(projectDataPath, "refs");
|
|
211
211
|
const tasksPath = path2.join(projectDataPath, "tasks");
|
|
212
|
+
const configPath = path2.join(projectDataPath, "config.yaml");
|
|
213
|
+
const config = parseWorkspaceConfig(configPath);
|
|
212
214
|
projects.push({
|
|
213
|
-
name: entry.name,
|
|
215
|
+
name: config?.name || entry.name,
|
|
214
216
|
path: projectDataPath,
|
|
215
|
-
//
|
|
217
|
+
// Still use dataPath as defaults, BUT...
|
|
218
|
+
sourcePath: config?.sourcePath,
|
|
219
|
+
// ...expose sourcePath if available
|
|
216
220
|
dataPath: projectDataPath,
|
|
217
221
|
source: "global",
|
|
218
222
|
knowledgePath: fs2.existsSync(knowledgePath) ? knowledgePath : void 0,
|
|
219
223
|
refsPath: fs2.existsSync(refsPath) ? refsPath : void 0,
|
|
220
224
|
tasksPath: fs2.existsSync(tasksPath) ? tasksPath : void 0,
|
|
221
|
-
|
|
222
|
-
semanticSearchEnabled: parseWorkspaceConfig(path2.join(projectDataPath, "config.yaml"))?.semanticSearchEnabled
|
|
225
|
+
semanticSearchEnabled: config?.semanticSearchEnabled
|
|
223
226
|
});
|
|
224
227
|
}
|
|
225
228
|
} catch {
|
|
@@ -276,6 +279,7 @@ function parseWorkspaceConfig(configPath) {
|
|
|
276
279
|
try {
|
|
277
280
|
const content = fs2.readFileSync(configPath, "utf-8");
|
|
278
281
|
const nameMatch = content.match(/name:\s*["']?([^"'\n]+)["']?/);
|
|
282
|
+
const sourcePathMatch = content.match(/sourcePath:\s*["']?([^"'\n]+)["']?/);
|
|
279
283
|
const modeMatch = content.match(/mode:\s*(global|workspace)/);
|
|
280
284
|
const linkedProjects = [];
|
|
281
285
|
const linkedMatch = content.match(/linked_projects:\s*\n((?:\s+-\s+[^\n]+\n?)+)/);
|
|
@@ -292,6 +296,7 @@ function parseWorkspaceConfig(configPath) {
|
|
|
292
296
|
const semanticSearchEnabled = semanticSearchMatch ? semanticSearchMatch[1] === "true" : false;
|
|
293
297
|
return {
|
|
294
298
|
name: nameMatch?.[1]?.trim() || path2.basename(path2.dirname(path2.dirname(configPath))),
|
|
299
|
+
sourcePath: sourcePathMatch?.[1]?.trim(),
|
|
295
300
|
storageMode: modeMatch?.[1] || "global",
|
|
296
301
|
linkedProjects: linkedProjects.length > 0 ? linkedProjects : void 0,
|
|
297
302
|
semanticSearchEnabled
|
|
@@ -1216,6 +1221,7 @@ storage:
|
|
|
1216
1221
|
|
|
1217
1222
|
project:
|
|
1218
1223
|
name: "${workspaceName}"
|
|
1224
|
+
sourcePath: "${workspacePath}"
|
|
1219
1225
|
|
|
1220
1226
|
tools:
|
|
1221
1227
|
copilot: ${config.storageMode === "workspace" && config.tools.includes("copilot")}
|
|
@@ -1833,11 +1839,12 @@ async function indexKnowledge(projectName, force = false) {
|
|
|
1833
1839
|
}
|
|
1834
1840
|
const projConfig = config.projects.find(
|
|
1835
1841
|
(p) => p.path && p.path === project.dataPath || !p.path && p.name === project.name
|
|
1836
|
-
);
|
|
1837
|
-
|
|
1842
|
+
) || (project.source === "global" ? { semanticSearch: { enabled: true, model: "Xenova/all-MiniLM-L6-v2" } } : void 0);
|
|
1843
|
+
const isEnabled = projConfig?.semanticSearch?.enabled || project.semanticSearchEnabled;
|
|
1844
|
+
if (!isEnabled) {
|
|
1838
1845
|
return { success: false, message: "Semantic Search is not enabled for this project", filesIndexed: 0, filesSkipped: 0 };
|
|
1839
1846
|
}
|
|
1840
|
-
const scanRoot = project.path || project.dataPath;
|
|
1847
|
+
const scanRoot = project.sourcePath || project.path || project.dataPath;
|
|
1841
1848
|
if (!fs13.existsSync(scanRoot)) {
|
|
1842
1849
|
return { success: false, message: "Project root not found", filesIndexed: 0, filesSkipped: 0 };
|
|
1843
1850
|
}
|
|
@@ -1882,7 +1889,8 @@ async function indexKnowledge(projectName, force = false) {
|
|
|
1882
1889
|
const SKIP_DIRS = ["node_modules", ".git", "dist", "build", ".next", "__pycache__", "venv", ".venv", "target", "vendor"];
|
|
1883
1890
|
try {
|
|
1884
1891
|
const indexPath = path14.join(project.knowledgePath || path14.join(scanRoot, ".rrce-workflow", "knowledge"), "embeddings.json");
|
|
1885
|
-
const
|
|
1892
|
+
const model = projConfig?.semanticSearch?.model || "Xenova/all-MiniLM-L6-v2";
|
|
1893
|
+
const rag = new RAGService(indexPath, model);
|
|
1886
1894
|
let indexed = 0;
|
|
1887
1895
|
let skipped = 0;
|
|
1888
1896
|
const scanDir = async (dir) => {
|