rrce-workflow 0.2.77 → 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.
Files changed (2) hide show
  1. package/dist/index.js +56 -40
  2. 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
- OPENCODE_CONFIG = path6.join(os.homedir(), ".config/opencode/opencode.json");
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
 
@@ -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 { stringify } from "yaml";
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
- const opencodeFrontmatter = {
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
- if (fs10.existsSync(workspaceOpencode)) {
1710
- fs10.rmSync(workspaceOpencode, { recursive: true, force: true });
1711
- } else {
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"));
1703
+ }
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;
1718
1709
  }
1719
- fs10.symlinkSync(globalOpencode, workspaceOpencode, "dir");
1710
+ fs10.writeFileSync(OPENCODE_CONFIG, JSON.stringify(opencodeConfig, null, 2) + "\n");
1720
1711
  } catch (e) {
1721
- console.error(`Warning: Could not create OpenCode symlink at ${workspaceOpencode}:`, e instanceof Error ? e.message : String(e));
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,13 +1863,15 @@ function updateGitignore(workspacePath, storageMode, tools) {
1857
1863
  const entries = [];
1858
1864
  if (storageMode === "workspace") {
1859
1865
  entries.push(".rrce-workflow/");
1860
- }
1861
- entries.push(".opencode/");
1862
- if (tools.includes("copilot")) {
1863
- entries.push(".github/agents/");
1864
- }
1865
- if (tools.includes("antigravity")) {
1866
- entries.push(".agent/workflows/");
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
+ }
1867
1875
  }
1868
1876
  entries.push("*.code-workspace");
1869
1877
  if (entries.length === 0) {
@@ -4363,8 +4371,8 @@ async function runExpressSetup(workspacePath, workspaceName, existingProjects, s
4363
4371
  \u2022 Storage: ${storageMode === "global" ? "Global" : "Workspace"}
4364
4372
  \u2022 MCP Server: Enabled
4365
4373
  \u2022 Semantic Search (RAG): Enabled
4366
- \u2022 Git ignore entries: Added
4367
- \u2022 AI Tools: ${toolsText}`,
4374
+ ` + (storageMode === "workspace" ? `\u2022 Git ignore entries: Added
4375
+ ` : "") + `\u2022 AI Tools: ${toolsText}`,
4368
4376
  "Configuration Preview"
4369
4377
  );
4370
4378
  const confirmed = await confirm6({
@@ -4389,6 +4397,10 @@ async function runExpressSetup(workspacePath, workspaceName, existingProjects, s
4389
4397
  enableRAG: true
4390
4398
  };
4391
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
+ }
4392
4404
  const startMCP = await confirm6({
4393
4405
  message: "Start MCP server now?",
4394
4406
  initialValue: true
@@ -4432,7 +4444,7 @@ async function runSetupFlow(workspacePath, workspaceName, existingProjects) {
4432
4444
  if (storageMode !== "global") {
4433
4445
  linkedProjects = await promptLinkedProjects(existingProjects);
4434
4446
  }
4435
- const addToGitignore = await promptGitignore();
4447
+ const addToGitignore = storageMode === "workspace" ? await promptGitignore() : false;
4436
4448
  const enableRAG = await promptRAG();
4437
4449
  const confirmed = await promptConfirmation();
4438
4450
  if (!confirmed) {
@@ -4449,6 +4461,10 @@ async function runSetupFlow(workspacePath, workspaceName, existingProjects) {
4449
4461
  enableRAG
4450
4462
  };
4451
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
+ }
4452
4468
  await handlePostSetup(config, workspacePath, workspaceName, linkedProjects);
4453
4469
  }
4454
4470
  async function executeSetup(config, workspacePath, workspaceName, allProjects, s) {
@@ -4456,9 +4472,9 @@ async function executeSetup(config, workspacePath, workspaceName, allProjects, s
4456
4472
  try {
4457
4473
  const dataPaths = getDataPaths(config.storageMode, workspaceName, workspacePath, config.globalPath);
4458
4474
  createDirectoryStructure(dataPaths);
4459
- installAgentPrompts(config, workspacePath, dataPaths);
4475
+ await installAgentPrompts(config, workspacePath, dataPaths);
4460
4476
  createWorkspaceConfig(config, workspacePath, workspaceName);
4461
- if (config.addToGitignore) {
4477
+ if (config.storageMode === "workspace" && config.addToGitignore) {
4462
4478
  const { updateGitignore: updateGitignore2 } = await Promise.resolve().then(() => (init_gitignore(), gitignore_exports));
4463
4479
  updateGitignore2(workspacePath, config.storageMode, config.tools);
4464
4480
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rrce-workflow",
3
- "version": "0.2.77",
3
+ "version": "0.2.78",
4
4
  "description": "RRCE-Workflow TUI - Agentic code workflow generator for AI-assisted development",
5
5
  "author": "RRCE Team",
6
6
  "license": "MIT",