rrce-workflow 0.2.36 → 0.2.37
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 +75 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1134,12 +1134,58 @@ import * as path10 from "path";
|
|
|
1134
1134
|
function getExposedProjects() {
|
|
1135
1135
|
const config = loadMCPConfig();
|
|
1136
1136
|
const allProjects = scanForProjects();
|
|
1137
|
-
|
|
1137
|
+
const globalProjects = allProjects.filter((project) => isProjectExposed(config, project.name, project.dataPath));
|
|
1138
|
+
const activeProject = detectActiveProject(globalProjects);
|
|
1139
|
+
let linkedProjects = [];
|
|
1140
|
+
if (activeProject) {
|
|
1141
|
+
const localConfigPath = path10.join(activeProject.dataPath, "config.yaml");
|
|
1142
|
+
let cfgContent = null;
|
|
1143
|
+
if (fs9.existsSync(path10.join(activeProject.dataPath, ".rrce-workflow", "config.yaml"))) {
|
|
1144
|
+
cfgContent = fs9.readFileSync(path10.join(activeProject.dataPath, ".rrce-workflow", "config.yaml"), "utf-8");
|
|
1145
|
+
} else if (fs9.existsSync(path10.join(activeProject.dataPath, ".rrce-workflow.yaml"))) {
|
|
1146
|
+
cfgContent = fs9.readFileSync(path10.join(activeProject.dataPath, ".rrce-workflow.yaml"), "utf-8");
|
|
1147
|
+
}
|
|
1148
|
+
if (cfgContent) {
|
|
1149
|
+
if (cfgContent.includes("linked_projects:")) {
|
|
1150
|
+
const lines = cfgContent.split("\n");
|
|
1151
|
+
let inLinked = false;
|
|
1152
|
+
for (const line of lines) {
|
|
1153
|
+
const trimmed = line.trim();
|
|
1154
|
+
if (trimmed.startsWith("linked_projects:")) {
|
|
1155
|
+
inLinked = true;
|
|
1156
|
+
continue;
|
|
1157
|
+
}
|
|
1158
|
+
if (inLinked) {
|
|
1159
|
+
if (trimmed.startsWith("-") || trimmed.startsWith("linked_projects")) {
|
|
1160
|
+
} else if (trimmed !== "" && !trimmed.startsWith("#")) {
|
|
1161
|
+
inLinked = false;
|
|
1162
|
+
}
|
|
1163
|
+
if (inLinked && trimmed.startsWith("-")) {
|
|
1164
|
+
const val = trimmed.replace(/^-\s*/, "").trim();
|
|
1165
|
+
const [pName] = val.split(":");
|
|
1166
|
+
if (!globalProjects.some((p) => p.name === pName) && !linkedProjects.some((p) => p.name === pName)) {
|
|
1167
|
+
const found = allProjects.find((p) => p.name === pName);
|
|
1168
|
+
if (found) {
|
|
1169
|
+
linkedProjects.push(found);
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
return [...globalProjects, ...linkedProjects];
|
|
1138
1179
|
}
|
|
1139
|
-
function detectActiveProject() {
|
|
1140
|
-
|
|
1180
|
+
function detectActiveProject(knownProjects) {
|
|
1181
|
+
let scanList = knownProjects;
|
|
1182
|
+
if (!scanList) {
|
|
1183
|
+
const config = loadMCPConfig();
|
|
1184
|
+
const all = scanForProjects();
|
|
1185
|
+
scanList = all.filter((project) => isProjectExposed(config, project.name, project.dataPath));
|
|
1186
|
+
}
|
|
1141
1187
|
const cwd = process.cwd();
|
|
1142
|
-
const matches =
|
|
1188
|
+
const matches = scanList.filter((p) => cwd.startsWith(p.path));
|
|
1143
1189
|
matches.sort((a, b) => b.path.length - a.path.length);
|
|
1144
1190
|
return matches[0];
|
|
1145
1191
|
}
|
|
@@ -2921,7 +2967,7 @@ var init_setup_flow = __esm({
|
|
|
2921
2967
|
});
|
|
2922
2968
|
|
|
2923
2969
|
// src/commands/wizard/link-flow.ts
|
|
2924
|
-
import { multiselect as multiselect4, spinner as spinner4, note as note8, outro as outro3, cancel as cancel3, isCancel as isCancel7 } from "@clack/prompts";
|
|
2970
|
+
import { multiselect as multiselect4, spinner as spinner4, note as note8, outro as outro3, cancel as cancel3, isCancel as isCancel7, confirm as confirm4 } from "@clack/prompts";
|
|
2925
2971
|
import pc9 from "picocolors";
|
|
2926
2972
|
import * as fs13 from "fs";
|
|
2927
2973
|
async function runLinkProjectsFlow(workspacePath, workspaceName) {
|
|
@@ -3000,6 +3046,23 @@ linked_projects:
|
|
|
3000
3046
|
];
|
|
3001
3047
|
note8(summary.join("\n"), "Link Summary");
|
|
3002
3048
|
outro3(pc9.green(`\u2713 Projects linked! Open ${pc9.bold(workspaceFile)} in VSCode to access linked data.`));
|
|
3049
|
+
const shouldExpose = await confirm4({
|
|
3050
|
+
message: "Also expose these linked projects to the MCP server (for Agent access)?",
|
|
3051
|
+
initialValue: true
|
|
3052
|
+
});
|
|
3053
|
+
if (shouldExpose && !isCancel7(shouldExpose)) {
|
|
3054
|
+
try {
|
|
3055
|
+
const { loadMCPConfig: loadMCPConfig2, saveMCPConfig: saveMCPConfig2, setProjectConfig: setProjectConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
3056
|
+
const mcpConfig = loadMCPConfig2();
|
|
3057
|
+
for (const project of selectedProjects) {
|
|
3058
|
+
setProjectConfig2(mcpConfig, project.name, true, void 0, project.dataPath);
|
|
3059
|
+
}
|
|
3060
|
+
saveMCPConfig2(mcpConfig);
|
|
3061
|
+
note8("Projects have been added to the global MCP configuration.", "MCP Updated");
|
|
3062
|
+
} catch (err) {
|
|
3063
|
+
note8(`Failed to update MCP config: ${err}`, "MCP Update Failed");
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3003
3066
|
}
|
|
3004
3067
|
var init_link_flow = __esm({
|
|
3005
3068
|
"src/commands/wizard/link-flow.ts"() {
|
|
@@ -3011,7 +3074,7 @@ var init_link_flow = __esm({
|
|
|
3011
3074
|
});
|
|
3012
3075
|
|
|
3013
3076
|
// src/commands/wizard/sync-flow.ts
|
|
3014
|
-
import { confirm as
|
|
3077
|
+
import { confirm as confirm5, spinner as spinner5, note as note9, outro as outro4, cancel as cancel4, isCancel as isCancel8 } from "@clack/prompts";
|
|
3015
3078
|
import pc10 from "picocolors";
|
|
3016
3079
|
import * as fs14 from "fs";
|
|
3017
3080
|
import * as path13 from "path";
|
|
@@ -3034,7 +3097,7 @@ ${existingDirs.map((d) => ` \u2022 ${d}/`).join("\n")}
|
|
|
3034
3097
|
Destination: ${pc10.cyan(globalPath)}`,
|
|
3035
3098
|
"Sync Preview"
|
|
3036
3099
|
);
|
|
3037
|
-
const shouldSync = await
|
|
3100
|
+
const shouldSync = await confirm5({
|
|
3038
3101
|
message: "Proceed with sync to global storage?",
|
|
3039
3102
|
initialValue: true
|
|
3040
3103
|
});
|
|
@@ -3078,7 +3141,7 @@ var init_sync_flow = __esm({
|
|
|
3078
3141
|
});
|
|
3079
3142
|
|
|
3080
3143
|
// src/commands/wizard/update-flow.ts
|
|
3081
|
-
import { confirm as
|
|
3144
|
+
import { confirm as confirm6, spinner as spinner6, note as note10, outro as outro5, cancel as cancel5, isCancel as isCancel9 } from "@clack/prompts";
|
|
3082
3145
|
import pc11 from "picocolors";
|
|
3083
3146
|
import * as fs15 from "fs";
|
|
3084
3147
|
import * as path14 from "path";
|
|
@@ -3101,7 +3164,7 @@ Target locations:
|
|
|
3101
3164
|
${dataPaths.map((p) => ` \u2022 ${p}`).join("\n")}`,
|
|
3102
3165
|
"Update Preview"
|
|
3103
3166
|
);
|
|
3104
|
-
const shouldUpdate = await
|
|
3167
|
+
const shouldUpdate = await confirm6({
|
|
3105
3168
|
message: "Proceed with update?",
|
|
3106
3169
|
initialValue: true
|
|
3107
3170
|
});
|
|
@@ -3223,6 +3286,7 @@ Workspace: ${pc12.bold(workspaceName)}`,
|
|
|
3223
3286
|
});
|
|
3224
3287
|
}
|
|
3225
3288
|
menuOptions.push({ value: "update", label: "\u{1F4E6} Update from package", hint: "Get latest prompts & templates" });
|
|
3289
|
+
menuOptions.push({ value: "reconfigure", label: "\u{1F527} Reconfigure project", hint: "Change storage mode, tools, etc." });
|
|
3226
3290
|
menuOptions.push({ value: "exit", label: "\u21A9 Exit" });
|
|
3227
3291
|
const action = await select4({
|
|
3228
3292
|
message: "This workspace is already configured. What would you like to do?",
|
|
@@ -3248,6 +3312,8 @@ Workspace: ${pc12.bold(workspaceName)}`,
|
|
|
3248
3312
|
await runUpdateFlow(workspacePath, workspaceName, currentStorageMode);
|
|
3249
3313
|
return;
|
|
3250
3314
|
}
|
|
3315
|
+
if (action === "reconfigure") {
|
|
3316
|
+
}
|
|
3251
3317
|
}
|
|
3252
3318
|
await runSetupFlow(workspacePath, workspaceName, detectedProjects);
|
|
3253
3319
|
}
|