rrce-workflow 0.2.96 → 0.2.98

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 CHANGED
@@ -1031,6 +1031,7 @@ var init_prompt = __esm({
1031
1031
  description: z.string(),
1032
1032
  "argument-hint": z.union([z.string(), z.array(z.string())]).optional(),
1033
1033
  tools: z.array(z.string()).optional(),
1034
+ mode: z.enum(["primary", "subagent"]).optional(),
1034
1035
  "required-args": z.array(PromptArgSchema).optional(),
1035
1036
  "optional-args": z.array(PromptArgSchema).optional(),
1036
1037
  "auto-identity": AutoIdentitySchema.optional()
@@ -1718,6 +1719,14 @@ var init_rag = __esm({
1718
1719
  this.maybeSaveIndex(true);
1719
1720
  }
1720
1721
  }
1722
+ /**
1723
+ * Get current indexed file paths
1724
+ */
1725
+ getIndexedFiles() {
1726
+ this.loadIndex();
1727
+ if (!this.index || !this.index.fileMetadata) return [];
1728
+ return Object.keys(this.index.fileMetadata);
1729
+ }
1721
1730
  /**
1722
1731
  * Get index statistics
1723
1732
  */
@@ -2354,6 +2363,7 @@ import * as fs15 from "fs";
2354
2363
  import * as path17 from "path";
2355
2364
  import * as os2 from "os";
2356
2365
  import * as crypto from "crypto";
2366
+ import ignore from "ignore";
2357
2367
  function resolveProjectPaths(project, pathInput) {
2358
2368
  const config = loadMCPConfig();
2359
2369
  let workspaceRoot = pathInput;
@@ -2737,6 +2747,33 @@ async function indexKnowledge(projectName, force = false) {
2737
2747
  ".sql"
2738
2748
  ];
2739
2749
  const SKIP_DIRS = ["node_modules", ".git", "dist", "build", ".next", "__pycache__", "venv", ".venv", "target", "vendor"];
2750
+ const gitignorePath = path17.join(scanRoot, ".gitignore");
2751
+ const ig = fs15.existsSync(gitignorePath) ? ignore().add(fs15.readFileSync(gitignorePath, "utf-8")) : null;
2752
+ const toPosixRelativePath = (absolutePath) => {
2753
+ const rel = path17.relative(scanRoot, absolutePath);
2754
+ return rel.split(path17.sep).join("/");
2755
+ };
2756
+ const isUnderGitDir = (absolutePath) => {
2757
+ const rel = toPosixRelativePath(absolutePath);
2758
+ return rel === ".git" || rel.startsWith(".git/");
2759
+ };
2760
+ const isIgnoredByGitignore = (absolutePath, isDir) => {
2761
+ if (!ig) return false;
2762
+ const rel = toPosixRelativePath(absolutePath);
2763
+ return ig.ignores(isDir ? `${rel}/` : rel);
2764
+ };
2765
+ const shouldSkipEntryDir = (absolutePath) => {
2766
+ const dirName = path17.basename(absolutePath);
2767
+ if (dirName === ".git") return true;
2768
+ if (SKIP_DIRS.includes(dirName)) return true;
2769
+ if (isIgnoredByGitignore(absolutePath, true)) return true;
2770
+ return false;
2771
+ };
2772
+ const shouldSkipEntryFile = (absolutePath) => {
2773
+ if (isUnderGitDir(absolutePath)) return true;
2774
+ if (isIgnoredByGitignore(absolutePath, false)) return true;
2775
+ return false;
2776
+ };
2740
2777
  const runIndexing = async () => {
2741
2778
  const indexPath = path17.join(project.knowledgePath || path17.join(scanRoot, ".rrce-workflow", "knowledge"), "embeddings.json");
2742
2779
  const codeIndexPath = path17.join(project.knowledgePath || path17.join(scanRoot, ".rrce-workflow", "knowledge"), "code-embeddings.json");
@@ -2748,29 +2785,45 @@ async function indexKnowledge(projectName, force = false) {
2748
2785
  let skipped = 0;
2749
2786
  let itemsTotal = 0;
2750
2787
  let itemsDone = 0;
2751
- const shouldSkipDir = (dirName) => SKIP_DIRS.includes(dirName) || dirName.startsWith(".");
2752
2788
  const preCount = (dir) => {
2753
2789
  const entries = fs15.readdirSync(dir, { withFileTypes: true });
2754
2790
  for (const entry of entries) {
2755
2791
  const fullPath = path17.join(dir, entry.name);
2756
2792
  if (entry.isDirectory()) {
2757
- if (shouldSkipDir(entry.name)) continue;
2793
+ if (shouldSkipEntryDir(fullPath)) continue;
2758
2794
  preCount(fullPath);
2759
2795
  } else if (entry.isFile()) {
2760
2796
  const ext = path17.extname(entry.name).toLowerCase();
2761
2797
  if (!INDEXABLE_EXTENSIONS.includes(ext)) continue;
2798
+ if (shouldSkipEntryFile(fullPath)) continue;
2762
2799
  itemsTotal++;
2763
2800
  }
2764
2801
  }
2765
2802
  };
2766
2803
  preCount(scanRoot);
2767
2804
  indexingJobs.update(project.name, { itemsTotal });
2805
+ const cleanupIgnoredFiles = async () => {
2806
+ const indexedFiles = [...rag.getIndexedFiles(), ...codeRag.getIndexedFiles()];
2807
+ const unique = Array.from(new Set(indexedFiles));
2808
+ for (const filePath of unique) {
2809
+ if (!path17.isAbsolute(filePath)) continue;
2810
+ const relFilePath = filePath.split(path17.sep).join("/");
2811
+ const relScanRoot = scanRoot.split(path17.sep).join("/");
2812
+ const isInScanRoot = relFilePath === relScanRoot || relFilePath.startsWith(`${relScanRoot}/`);
2813
+ if (!isInScanRoot) continue;
2814
+ if (shouldSkipEntryFile(filePath)) {
2815
+ await rag.removeFile(filePath);
2816
+ await codeRag.removeFile(filePath);
2817
+ }
2818
+ }
2819
+ };
2820
+ await cleanupIgnoredFiles();
2768
2821
  const scanDir = async (dir) => {
2769
2822
  const entries = fs15.readdirSync(dir, { withFileTypes: true });
2770
2823
  for (const entry of entries) {
2771
2824
  const fullPath = path17.join(dir, entry.name);
2772
2825
  if (entry.isDirectory()) {
2773
- if (shouldSkipDir(entry.name)) {
2826
+ if (shouldSkipEntryDir(fullPath)) {
2774
2827
  continue;
2775
2828
  }
2776
2829
  await scanDir(fullPath);
@@ -2779,6 +2832,9 @@ async function indexKnowledge(projectName, force = false) {
2779
2832
  if (!INDEXABLE_EXTENSIONS.includes(ext)) {
2780
2833
  continue;
2781
2834
  }
2835
+ if (shouldSkipEntryFile(fullPath)) {
2836
+ continue;
2837
+ }
2782
2838
  try {
2783
2839
  indexingJobs.update(project.name, { currentItem: fullPath, itemsDone });
2784
2840
  const stat = fs15.statSync(fullPath);
@@ -5260,7 +5316,7 @@ function copyPromptsToDir(prompts, targetDir, extension) {
5260
5316
  function convertToOpenCodeAgent(prompt, useFileReference = false, promptFilePath) {
5261
5317
  const { frontmatter, content } = prompt;
5262
5318
  const tools = {};
5263
- const hostTools = ["read", "write", "edit", "bash", "grep", "glob", "webfetch", "terminalLastCommand"];
5319
+ const hostTools = ["read", "write", "edit", "bash", "grep", "glob", "webfetch", "terminalLastCommand", "task"];
5264
5320
  if (frontmatter.tools) {
5265
5321
  for (const tool of frontmatter.tools) {
5266
5322
  if (hostTools.includes(tool)) {
@@ -5271,10 +5327,11 @@ function convertToOpenCodeAgent(prompt, useFileReference = false, promptFilePath
5271
5327
  }
5272
5328
  }
5273
5329
  tools["webfetch"] = true;
5274
- const invocationHint = " (Invoke via @rrce_*)";
5330
+ const mode = frontmatter.mode || "subagent";
5331
+ const invocationHint = mode === "primary" ? "" : " (Invoke via @rrce_*)";
5275
5332
  return {
5276
5333
  description: `${frontmatter.description}${invocationHint}`,
5277
- mode: "subagent",
5334
+ mode,
5278
5335
  prompt: useFileReference && promptFilePath ? `{file:${promptFilePath}}` : content,
5279
5336
  tools
5280
5337
  };
@@ -5436,6 +5493,9 @@ async function installAgentPrompts(config, workspacePath, dataPaths) {
5436
5493
  const agentConfig = convertToOpenCodeAgent(prompt, true, `./prompts/${promptFileName}`);
5437
5494
  opencodeConfig.agent[agentId] = agentConfig;
5438
5495
  }
5496
+ if (!opencodeConfig.agent) opencodeConfig.agent = {};
5497
+ if (!opencodeConfig.agent.plan) opencodeConfig.agent.plan = {};
5498
+ opencodeConfig.agent.plan.disable = true;
5439
5499
  fs10.writeFileSync(OPENCODE_CONFIG, JSON.stringify(opencodeConfig, null, 2) + "\n");
5440
5500
  } catch (e) {
5441
5501
  console.error("Failed to update global OpenCode config with agents:", e);
@@ -6076,6 +6136,8 @@ function updateOpenCodeAgents(prompts, mode, primaryDataPath) {
6076
6136
  const agentConfig = convertToOpenCodeAgent(prompt, true, `./prompts/${promptFileName}`);
6077
6137
  opencodeConfig.agent[agentId] = agentConfig;
6078
6138
  }
6139
+ if (!opencodeConfig.agent.plan) opencodeConfig.agent.plan = {};
6140
+ opencodeConfig.agent.plan.disable = true;
6079
6141
  fs21.writeFileSync(OPENCODE_CONFIG, JSON.stringify(opencodeConfig, null, 2) + "\n");
6080
6142
  } catch (e) {
6081
6143
  console.error("Failed to update global OpenCode config with agents:", e);
@@ -2,18 +2,18 @@
2
2
 
3
3
  > RR Context Engineering Workflow - A selection-agnostic agentic workflow system
4
4
  >
5
- > **Version**: 0.2.91 | **Last Updated**: 2025-12-31
5
+ > **Version**: 0.2.96 | **Last Updated**: 2026-01-02
6
6
 
7
7
  ## Overview
8
8
 
9
9
  RRCE-Workflow is a TUI-based agentic code workflow generator designed to work seamlessly across:
10
- - **OpenCode** (Native agentic TUI environment with custom Primary Agents)
10
+ - **OpenCode** (Native agentic TUI environment; RRCE installs subagents invoked via `@rrce_<agent>`)
11
11
  - **GitHub Copilot** (VSCode with MCP extension)
12
12
  - **Antigravity IDE** (Google's agentic coding environment)
13
13
  - **Claude Desktop** (MCP Server integration)
14
14
  - **Any MCP-compatible client**
15
15
 
16
- The system provides a structured multi-agent pipeline (7 agents) for software development tasks, with persistent knowledge caching, semantic search (RAG), and workspace-aware context management.
16
+ The system provides a structured multi-agent pipeline (7 agents) for software development tasks, with persistent knowledge caching, semantic search (RAG) across knowledge and code, and workspace-aware context management.
17
17
 
18
18
  ## Core Principles
19
19