rrce-workflow 0.2.76 → 0.2.78
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 +60 -47
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1032,14 +1032,15 @@ function isVSCodeInstalled() {
|
|
|
1032
1032
|
const configDir = path6.join(os.homedir(), ".config/Code/User");
|
|
1033
1033
|
return fs5.existsSync(configDir);
|
|
1034
1034
|
}
|
|
1035
|
-
var ANTIGRAVITY_CONFIG, CLAUDE_CONFIG, VSCODE_GLOBAL_CONFIG, OPENCODE_CONFIG;
|
|
1035
|
+
var ANTIGRAVITY_CONFIG, CLAUDE_CONFIG, VSCODE_GLOBAL_CONFIG, OPENCODE_CONFIG_DIR, OPENCODE_CONFIG;
|
|
1036
1036
|
var init_install = __esm({
|
|
1037
1037
|
"src/mcp/install.ts"() {
|
|
1038
1038
|
"use strict";
|
|
1039
1039
|
ANTIGRAVITY_CONFIG = path6.join(os.homedir(), ".gemini/antigravity/mcp_config.json");
|
|
1040
1040
|
CLAUDE_CONFIG = path6.join(os.homedir(), ".config/claude/claude_desktop_config.json");
|
|
1041
1041
|
VSCODE_GLOBAL_CONFIG = path6.join(os.homedir(), ".config/Code/User/settings.json");
|
|
1042
|
-
|
|
1042
|
+
OPENCODE_CONFIG_DIR = path6.join(os.homedir(), ".config/opencode");
|
|
1043
|
+
OPENCODE_CONFIG = path6.join(OPENCODE_CONFIG_DIR, "opencode.json");
|
|
1043
1044
|
}
|
|
1044
1045
|
});
|
|
1045
1046
|
|
|
@@ -1120,8 +1121,8 @@ async function promptLinkedProjects(existingProjects) {
|
|
|
1120
1121
|
}
|
|
1121
1122
|
async function promptGitignore() {
|
|
1122
1123
|
const result = await confirm({
|
|
1123
|
-
message: "Add generated folders to .gitignore?
|
|
1124
|
-
initialValue:
|
|
1124
|
+
message: "Add generated folders to .gitignore?",
|
|
1125
|
+
initialValue: true
|
|
1125
1126
|
});
|
|
1126
1127
|
if (isCancel2(result)) {
|
|
1127
1128
|
cancel("Setup cancelled.");
|
|
@@ -1249,7 +1250,7 @@ var init_prompts = __esm({
|
|
|
1249
1250
|
// src/commands/wizard/utils.ts
|
|
1250
1251
|
import * as fs7 from "fs";
|
|
1251
1252
|
import * as path8 from "path";
|
|
1252
|
-
import
|
|
1253
|
+
import "yaml";
|
|
1253
1254
|
function copyPromptsToDir(prompts, targetDir, extension) {
|
|
1254
1255
|
for (const prompt of prompts) {
|
|
1255
1256
|
const baseName = path8.basename(prompt.filePath, ".md");
|
|
@@ -1276,14 +1277,12 @@ function convertToOpenCodeAgent(prompt) {
|
|
|
1276
1277
|
tools[`rrce_${tool}`] = true;
|
|
1277
1278
|
}
|
|
1278
1279
|
}
|
|
1279
|
-
|
|
1280
|
+
return {
|
|
1280
1281
|
description: frontmatter.description,
|
|
1281
1282
|
mode: "primary",
|
|
1283
|
+
prompt: content,
|
|
1282
1284
|
tools
|
|
1283
1285
|
};
|
|
1284
|
-
return `---
|
|
1285
|
-
${stringify(opencodeFrontmatter)}---
|
|
1286
|
-
${content}`;
|
|
1287
1286
|
}
|
|
1288
1287
|
function copyDirRecursive(src, dest) {
|
|
1289
1288
|
const entries = fs7.readdirSync(src, { withFileTypes: true });
|
|
@@ -1657,6 +1656,7 @@ import * as fs10 from "fs";
|
|
|
1657
1656
|
import * as path12 from "path";
|
|
1658
1657
|
import pc4 from "picocolors";
|
|
1659
1658
|
import { note as note2 } from "@clack/prompts";
|
|
1659
|
+
import { stringify as stringify2 } from "yaml";
|
|
1660
1660
|
function createDirectoryStructure(dataPaths) {
|
|
1661
1661
|
for (const dataPath of dataPaths) {
|
|
1662
1662
|
ensureDir(dataPath);
|
|
@@ -1666,7 +1666,7 @@ function createDirectoryStructure(dataPaths) {
|
|
|
1666
1666
|
ensureDir(path12.join(dataPath, "templates"));
|
|
1667
1667
|
}
|
|
1668
1668
|
}
|
|
1669
|
-
function installAgentPrompts(config, workspacePath, dataPaths) {
|
|
1669
|
+
async function installAgentPrompts(config, workspacePath, dataPaths) {
|
|
1670
1670
|
const agentCoreDir = getAgentCoreDir();
|
|
1671
1671
|
syncMetadataToAll(agentCoreDir, dataPaths);
|
|
1672
1672
|
copyDirToAllStoragePaths(path12.join(agentCoreDir, "templates"), "templates", dataPaths);
|
|
@@ -1695,30 +1695,36 @@ function installAgentPrompts(config, workspacePath, dataPaths) {
|
|
|
1695
1695
|
if (config.tools.includes("opencode")) {
|
|
1696
1696
|
const primaryDataPath = dataPaths[0];
|
|
1697
1697
|
if (primaryDataPath) {
|
|
1698
|
-
const opencodePath = path12.join(primaryDataPath, ".opencode", "agent");
|
|
1699
|
-
ensureDir(opencodePath);
|
|
1700
|
-
for (const prompt of prompts) {
|
|
1701
|
-
const baseName = path12.basename(prompt.filePath, ".md");
|
|
1702
|
-
const content = convertToOpenCodeAgent(prompt);
|
|
1703
|
-
fs10.writeFileSync(path12.join(opencodePath, `${baseName}.md`), content);
|
|
1704
|
-
}
|
|
1705
1698
|
if (config.storageMode === "global") {
|
|
1706
|
-
const workspaceOpencode = path12.join(workspacePath, ".opencode");
|
|
1707
|
-
const globalOpencode = path12.join(primaryDataPath, ".opencode");
|
|
1708
1699
|
try {
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
try {
|
|
1713
|
-
if (fs10.lstatSync(workspaceOpencode).isSymbolicLink()) {
|
|
1714
|
-
fs10.unlinkSync(workspaceOpencode);
|
|
1715
|
-
}
|
|
1716
|
-
} catch (e) {
|
|
1717
|
-
}
|
|
1700
|
+
let opencodeConfig = { $schema: "https://opencode.ai/config.json" };
|
|
1701
|
+
if (fs10.existsSync(OPENCODE_CONFIG)) {
|
|
1702
|
+
opencodeConfig = JSON.parse(fs10.readFileSync(OPENCODE_CONFIG, "utf-8"));
|
|
1718
1703
|
}
|
|
1719
|
-
|
|
1704
|
+
if (!opencodeConfig.agent) opencodeConfig.agent = {};
|
|
1705
|
+
for (const prompt of prompts) {
|
|
1706
|
+
const baseName = path12.basename(prompt.filePath, ".md");
|
|
1707
|
+
const agentConfig = convertToOpenCodeAgent(prompt);
|
|
1708
|
+
opencodeConfig.agent[baseName] = agentConfig;
|
|
1709
|
+
}
|
|
1710
|
+
fs10.writeFileSync(OPENCODE_CONFIG, JSON.stringify(opencodeConfig, null, 2) + "\n");
|
|
1720
1711
|
} catch (e) {
|
|
1721
|
-
console.error(
|
|
1712
|
+
console.error("Failed to update global OpenCode config with agents:", e);
|
|
1713
|
+
}
|
|
1714
|
+
} else {
|
|
1715
|
+
const opencodeBaseDir = path12.join(primaryDataPath, ".opencode", "agent");
|
|
1716
|
+
ensureDir(opencodeBaseDir);
|
|
1717
|
+
for (const prompt of prompts) {
|
|
1718
|
+
const baseName = path12.basename(prompt.filePath, ".md");
|
|
1719
|
+
const agentConfig = convertToOpenCodeAgent(prompt);
|
|
1720
|
+
const content = `---
|
|
1721
|
+
${stringify2({
|
|
1722
|
+
description: agentConfig.description,
|
|
1723
|
+
mode: agentConfig.mode,
|
|
1724
|
+
tools: agentConfig.tools
|
|
1725
|
+
})}---
|
|
1726
|
+
${agentConfig.prompt}`;
|
|
1727
|
+
fs10.writeFileSync(path12.join(opencodeBaseDir, `${baseName}.md`), content);
|
|
1722
1728
|
}
|
|
1723
1729
|
}
|
|
1724
1730
|
}
|
|
@@ -1857,15 +1863,15 @@ function updateGitignore(workspacePath, storageMode, tools) {
|
|
|
1857
1863
|
const entries = [];
|
|
1858
1864
|
if (storageMode === "workspace") {
|
|
1859
1865
|
entries.push(".rrce-workflow/");
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1866
|
+
if (tools.includes("opencode")) {
|
|
1867
|
+
entries.push(".opencode/");
|
|
1868
|
+
}
|
|
1869
|
+
if (tools.includes("copilot")) {
|
|
1870
|
+
entries.push(".github/agents/");
|
|
1871
|
+
}
|
|
1872
|
+
if (tools.includes("antigravity")) {
|
|
1873
|
+
entries.push(".agent/workflows/");
|
|
1874
|
+
}
|
|
1869
1875
|
}
|
|
1870
1876
|
entries.push("*.code-workspace");
|
|
1871
1877
|
if (entries.length === 0) {
|
|
@@ -1881,8 +1887,7 @@ function updateGitignore(workspacePath, storageMode, tools) {
|
|
|
1881
1887
|
}
|
|
1882
1888
|
const newSection = `
|
|
1883
1889
|
${sectionMarker}
|
|
1884
|
-
|
|
1885
|
-
${entries.map((e) => `# ${e}`).join("\n")}
|
|
1890
|
+
${entries.join("\n")}
|
|
1886
1891
|
`;
|
|
1887
1892
|
const updatedContent = existingContent.trimEnd() + newSection;
|
|
1888
1893
|
fs11.writeFileSync(gitignorePath, updatedContent);
|
|
@@ -4366,8 +4371,8 @@ async function runExpressSetup(workspacePath, workspaceName, existingProjects, s
|
|
|
4366
4371
|
\u2022 Storage: ${storageMode === "global" ? "Global" : "Workspace"}
|
|
4367
4372
|
\u2022 MCP Server: Enabled
|
|
4368
4373
|
\u2022 Semantic Search (RAG): Enabled
|
|
4369
|
-
|
|
4370
|
-
|
|
4374
|
+
` + (storageMode === "workspace" ? `\u2022 Git ignore entries: Added
|
|
4375
|
+
` : "") + `\u2022 AI Tools: ${toolsText}`,
|
|
4371
4376
|
"Configuration Preview"
|
|
4372
4377
|
);
|
|
4373
4378
|
const confirmed = await confirm6({
|
|
@@ -4387,11 +4392,15 @@ async function runExpressSetup(workspacePath, workspaceName, existingProjects, s
|
|
|
4387
4392
|
globalPath: customGlobalPath,
|
|
4388
4393
|
tools: defaultTools,
|
|
4389
4394
|
linkedProjects: [],
|
|
4390
|
-
addToGitignore:
|
|
4395
|
+
addToGitignore: true,
|
|
4391
4396
|
exposeToMCP: true,
|
|
4392
4397
|
enableRAG: true
|
|
4393
4398
|
};
|
|
4394
4399
|
await executeSetup(config, workspacePath, workspaceName, existingProjects, s);
|
|
4400
|
+
if (config.storageMode === "workspace") {
|
|
4401
|
+
const { updateGitignore: updateGitignore2 } = await Promise.resolve().then(() => (init_gitignore(), gitignore_exports));
|
|
4402
|
+
updateGitignore2(workspacePath, config.storageMode, config.tools);
|
|
4403
|
+
}
|
|
4395
4404
|
const startMCP = await confirm6({
|
|
4396
4405
|
message: "Start MCP server now?",
|
|
4397
4406
|
initialValue: true
|
|
@@ -4435,7 +4444,7 @@ async function runSetupFlow(workspacePath, workspaceName, existingProjects) {
|
|
|
4435
4444
|
if (storageMode !== "global") {
|
|
4436
4445
|
linkedProjects = await promptLinkedProjects(existingProjects);
|
|
4437
4446
|
}
|
|
4438
|
-
const addToGitignore = await promptGitignore();
|
|
4447
|
+
const addToGitignore = storageMode === "workspace" ? await promptGitignore() : false;
|
|
4439
4448
|
const enableRAG = await promptRAG();
|
|
4440
4449
|
const confirmed = await promptConfirmation();
|
|
4441
4450
|
if (!confirmed) {
|
|
@@ -4452,6 +4461,10 @@ async function runSetupFlow(workspacePath, workspaceName, existingProjects) {
|
|
|
4452
4461
|
enableRAG
|
|
4453
4462
|
};
|
|
4454
4463
|
await executeSetup(config, workspacePath, workspaceName, existingProjects, s);
|
|
4464
|
+
if (config.storageMode === "workspace" && config.addToGitignore) {
|
|
4465
|
+
const { updateGitignore: updateGitignore2 } = await Promise.resolve().then(() => (init_gitignore(), gitignore_exports));
|
|
4466
|
+
updateGitignore2(workspacePath, config.storageMode, config.tools);
|
|
4467
|
+
}
|
|
4455
4468
|
await handlePostSetup(config, workspacePath, workspaceName, linkedProjects);
|
|
4456
4469
|
}
|
|
4457
4470
|
async function executeSetup(config, workspacePath, workspaceName, allProjects, s) {
|
|
@@ -4459,9 +4472,9 @@ async function executeSetup(config, workspacePath, workspaceName, allProjects, s
|
|
|
4459
4472
|
try {
|
|
4460
4473
|
const dataPaths = getDataPaths(config.storageMode, workspaceName, workspacePath, config.globalPath);
|
|
4461
4474
|
createDirectoryStructure(dataPaths);
|
|
4462
|
-
installAgentPrompts(config, workspacePath, dataPaths);
|
|
4475
|
+
await installAgentPrompts(config, workspacePath, dataPaths);
|
|
4463
4476
|
createWorkspaceConfig(config, workspacePath, workspaceName);
|
|
4464
|
-
if (config.addToGitignore) {
|
|
4477
|
+
if (config.storageMode === "workspace" && config.addToGitignore) {
|
|
4465
4478
|
const { updateGitignore: updateGitignore2 } = await Promise.resolve().then(() => (init_gitignore(), gitignore_exports));
|
|
4466
4479
|
updateGitignore2(workspacePath, config.storageMode, config.tools);
|
|
4467
4480
|
}
|