rrce-workflow 0.2.57 → 0.2.58

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 +141 -34
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1188,6 +1188,12 @@ tools:
1188
1188
  copilot: ${config.storageMode === "workspace" && config.tools.includes("copilot")}
1189
1189
  antigravity: ${config.storageMode === "workspace" && config.tools.includes("antigravity")}
1190
1190
  `;
1191
+ if (config.enableRAG) {
1192
+ content += `
1193
+ semantic_search:
1194
+ enabled: true
1195
+ `;
1196
+ }
1191
1197
  if (config.linkedProjects.length > 0) {
1192
1198
  content += `
1193
1199
  linked_projects:
@@ -1663,6 +1669,10 @@ function getExposedProjects() {
1663
1669
  }
1664
1670
  return [...globalProjects, ...linkedProjects];
1665
1671
  }
1672
+ function getRAGIndexPath(project) {
1673
+ const scanRoot = project.path || project.dataPath;
1674
+ return path14.join(project.knowledgePath || path14.join(scanRoot, ".rrce-workflow", "knowledge"), "embeddings.json");
1675
+ }
1666
1676
  function detectActiveProject(knownProjects) {
1667
1677
  let scanList = knownProjects;
1668
1678
  if (!scanList) {
@@ -3133,10 +3143,93 @@ var init_StatusBoard = __esm({
3133
3143
  }
3134
3144
  });
3135
3145
 
3146
+ // src/mcp/ui/IndexingStatus.tsx
3147
+ import { useState as useState4, useEffect as useEffect3 } from "react";
3148
+ import { Box as Box9, Text as Text9 } from "ink";
3149
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
3150
+ var IndexingStatus;
3151
+ var init_IndexingStatus = __esm({
3152
+ "src/mcp/ui/IndexingStatus.tsx"() {
3153
+ "use strict";
3154
+ init_rag();
3155
+ init_resources();
3156
+ init_config_utils();
3157
+ IndexingStatus = ({ projects, config }) => {
3158
+ const [stats, setStats] = useState4([]);
3159
+ const [loading, setLoading] = useState4(true);
3160
+ useEffect3(() => {
3161
+ const fetchStats = async () => {
3162
+ const newStats = [];
3163
+ for (const project of projects) {
3164
+ const projConfig = findProjectConfig(config, { name: project.name, path: project.path });
3165
+ const enabled = projConfig?.semanticSearch?.enabled ?? false;
3166
+ if (!enabled) {
3167
+ newStats.push({
3168
+ projectName: project.name,
3169
+ enabled: false,
3170
+ totalFiles: 0,
3171
+ totalChunks: 0
3172
+ });
3173
+ continue;
3174
+ }
3175
+ try {
3176
+ const indexPath = getRAGIndexPath(project);
3177
+ const rag = new RAGService(indexPath, "dummy");
3178
+ const s = rag.getStats();
3179
+ newStats.push({
3180
+ projectName: project.name,
3181
+ enabled: true,
3182
+ totalFiles: s.totalFiles,
3183
+ totalChunks: s.totalChunks,
3184
+ lastFullIndex: s.lastFullIndex
3185
+ });
3186
+ } catch (e) {
3187
+ newStats.push({
3188
+ projectName: project.name,
3189
+ enabled: true,
3190
+ totalFiles: 0,
3191
+ totalChunks: 0,
3192
+ error: String(e)
3193
+ });
3194
+ }
3195
+ }
3196
+ setStats(newStats);
3197
+ setLoading(false);
3198
+ };
3199
+ fetchStats();
3200
+ const interval = setInterval(fetchStats, 5e3);
3201
+ return () => clearInterval(interval);
3202
+ }, [projects, config]);
3203
+ if (loading && stats.length === 0) {
3204
+ return /* @__PURE__ */ jsx9(Text9, { children: "Loading indexing status..." });
3205
+ }
3206
+ return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "blue", flexGrow: 1, children: [
3207
+ /* @__PURE__ */ jsx9(Text9, { bold: true, color: "blue", children: " RAG Indexing Status " }),
3208
+ /* @__PURE__ */ jsxs8(Box9, { marginTop: 1, flexDirection: "column", children: [
3209
+ /* @__PURE__ */ jsxs8(Box9, { children: [
3210
+ /* @__PURE__ */ jsx9(Box9, { width: 25, children: /* @__PURE__ */ jsx9(Text9, { underline: true, children: "Project" }) }),
3211
+ /* @__PURE__ */ jsx9(Box9, { width: 15, children: /* @__PURE__ */ jsx9(Text9, { underline: true, children: "Status" }) }),
3212
+ /* @__PURE__ */ jsx9(Box9, { width: 15, children: /* @__PURE__ */ jsx9(Text9, { underline: true, children: "Indexed Files" }) }),
3213
+ /* @__PURE__ */ jsx9(Box9, { width: 15, children: /* @__PURE__ */ jsx9(Text9, { underline: true, children: "Total Chunks" }) }),
3214
+ /* @__PURE__ */ jsx9(Box9, { children: /* @__PURE__ */ jsx9(Text9, { underline: true, children: "Last Index" }) })
3215
+ ] }),
3216
+ stats.length === 0 ? /* @__PURE__ */ jsx9(Text9, { color: "dim", children: "No exposed projects found." }) : stats.map((s) => /* @__PURE__ */ jsxs8(Box9, { marginTop: 0, children: [
3217
+ /* @__PURE__ */ jsx9(Box9, { width: 25, children: /* @__PURE__ */ jsx9(Text9, { color: "white", children: s.projectName }) }),
3218
+ /* @__PURE__ */ jsx9(Box9, { width: 15, children: /* @__PURE__ */ jsx9(Text9, { color: s.enabled ? "green" : "dim", children: s.enabled ? "Enabled" : "Disabled" }) }),
3219
+ /* @__PURE__ */ jsx9(Box9, { width: 15, children: /* @__PURE__ */ jsx9(Text9, { children: s.enabled ? s.totalFiles : "-" }) }),
3220
+ /* @__PURE__ */ jsx9(Box9, { width: 15, children: /* @__PURE__ */ jsx9(Text9, { children: s.enabled ? s.totalChunks : "-" }) }),
3221
+ /* @__PURE__ */ jsx9(Box9, { children: /* @__PURE__ */ jsx9(Text9, { children: s.lastFullIndex ? new Date(s.lastFullIndex).toLocaleTimeString() : "-" }) })
3222
+ ] }, s.projectName))
3223
+ ] })
3224
+ ] });
3225
+ };
3226
+ }
3227
+ });
3228
+
3136
3229
  // src/mcp/ui/components/TabBar.tsx
3137
3230
  import "react";
3138
- import { Box as Box9, Text as Text9, useInput as useInput2 } from "ink";
3139
- import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
3231
+ import { Box as Box10, Text as Text10, useInput as useInput2 } from "ink";
3232
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
3140
3233
  var TabBar;
3141
3234
  var init_TabBar = __esm({
3142
3235
  "src/mcp/ui/components/TabBar.tsx"() {
@@ -3163,11 +3256,11 @@ var init_TabBar = __esm({
3163
3256
  if (tab) onChange(tab.id);
3164
3257
  }
3165
3258
  });
3166
- return /* @__PURE__ */ jsxs8(Box9, { borderStyle: "single", paddingX: 1, borderColor: "gray", children: [
3259
+ return /* @__PURE__ */ jsxs9(Box10, { borderStyle: "single", paddingX: 1, borderColor: "gray", children: [
3167
3260
  tabs.map((tab, index) => {
3168
3261
  const isActive = tab.id === activeTab;
3169
- return /* @__PURE__ */ jsx9(Box9, { marginRight: 2, children: /* @__PURE__ */ jsx9(
3170
- Text9,
3262
+ return /* @__PURE__ */ jsx10(Box10, { marginRight: 2, children: /* @__PURE__ */ jsx10(
3263
+ Text10,
3171
3264
  {
3172
3265
  color: isActive ? "cyan" : "white",
3173
3266
  bold: isActive,
@@ -3176,8 +3269,8 @@ var init_TabBar = __esm({
3176
3269
  }
3177
3270
  ) }, tab.id);
3178
3271
  }),
3179
- /* @__PURE__ */ jsx9(Box9, { flexGrow: 1 }),
3180
- /* @__PURE__ */ jsx9(Text9, { color: "dim", children: "Use \u25C4/\u25BA arrows to navigate" })
3272
+ /* @__PURE__ */ jsx10(Box10, { flexGrow: 1 }),
3273
+ /* @__PURE__ */ jsx10(Text10, { color: "dim", children: "Use \u25C4/\u25BA arrows to navigate" })
3181
3274
  ] });
3182
3275
  };
3183
3276
  }
@@ -3188,11 +3281,11 @@ var App_exports = {};
3188
3281
  __export(App_exports, {
3189
3282
  App: () => App
3190
3283
  });
3191
- import { useState as useState4, useEffect as useEffect3, useMemo as useMemo2, useCallback } from "react";
3192
- import { Box as Box10, useInput as useInput3, useApp } from "ink";
3284
+ import { useState as useState5, useEffect as useEffect4, useMemo as useMemo2, useCallback } from "react";
3285
+ import { Box as Box11, useInput as useInput3, useApp } from "ink";
3193
3286
  import fs15 from "fs";
3194
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
3195
- var TABS, App;
3287
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
3288
+ var App;
3196
3289
  var init_App = __esm({
3197
3290
  "src/mcp/ui/App.tsx"() {
3198
3291
  "use strict";
@@ -3201,6 +3294,7 @@ var init_App = __esm({
3201
3294
  init_InstallView();
3202
3295
  init_LogViewer();
3203
3296
  init_StatusBoard();
3297
+ init_IndexingStatus();
3204
3298
  init_TabBar();
3205
3299
  init_config();
3206
3300
  init_config_utils();
@@ -3209,23 +3303,17 @@ var init_App = __esm({
3209
3303
  init_server();
3210
3304
  init_install();
3211
3305
  init_paths();
3212
- TABS = [
3213
- { id: "overview", label: "Overview" },
3214
- { id: "logs", label: "Logs" },
3215
- { id: "projects", label: "Projects" },
3216
- { id: "install", label: "Install" }
3217
- ];
3218
3306
  App = ({ onExit, initialPort }) => {
3219
3307
  const { exit } = useApp();
3220
- const [activeTab, setActiveTab] = useState4("overview");
3221
- const [logs, setLogs] = useState4([]);
3222
- const [serverInfo, setServerInfo] = useState4({
3308
+ const [activeTab, setActiveTab] = useState5("overview");
3309
+ const [logs, setLogs] = useState5([]);
3310
+ const [serverInfo, setServerInfo] = useState5({
3223
3311
  port: initialPort,
3224
3312
  pid: process.pid,
3225
3313
  running: false
3226
3314
  });
3227
- const [config, setConfig] = useState4(() => loadMCPConfig());
3228
- const [projects, setProjects] = useState4(() => scanForProjects());
3315
+ const [config, setConfig] = useState5(() => loadMCPConfig());
3316
+ const [projects, setProjects] = useState5(() => scanForProjects());
3229
3317
  const refreshData = useCallback(() => {
3230
3318
  setConfig(loadMCPConfig());
3231
3319
  setProjects(scanForProjects());
@@ -3239,6 +3327,24 @@ var init_App = __esm({
3239
3327
  }),
3240
3328
  [projects, config]
3241
3329
  );
3330
+ const isRAGEnabled = useMemo2(() => {
3331
+ return exposedProjects.some((p) => {
3332
+ const cfg = findProjectConfig(config, { name: p.name, path: p.path });
3333
+ return cfg?.semanticSearch?.enabled;
3334
+ });
3335
+ }, [exposedProjects, config]);
3336
+ const tabs = useMemo2(() => {
3337
+ const baseTabs = [
3338
+ { id: "overview", label: "Overview" },
3339
+ { id: "logs", label: "Logs" },
3340
+ { id: "projects", label: "Projects" },
3341
+ { id: "install", label: "Install" }
3342
+ ];
3343
+ if (isRAGEnabled) {
3344
+ baseTabs.splice(3, 0, { id: "indexing", label: "Indexing" });
3345
+ }
3346
+ return baseTabs;
3347
+ }, [isRAGEnabled]);
3242
3348
  const workspacePath = detectWorkspaceRoot();
3243
3349
  const installStatus = checkInstallStatus(workspacePath);
3244
3350
  const installedCount = [
@@ -3247,7 +3353,7 @@ var init_App = __esm({
3247
3353
  installStatus.vscodeGlobal,
3248
3354
  installStatus.vscodeWorkspace
3249
3355
  ].filter(Boolean).length;
3250
- useEffect3(() => {
3356
+ useEffect4(() => {
3251
3357
  const start = async () => {
3252
3358
  const status = getMCPServerStatus();
3253
3359
  if (!status.running) {
@@ -3263,7 +3369,7 @@ var init_App = __esm({
3263
3369
  };
3264
3370
  start();
3265
3371
  }, []);
3266
- useEffect3(() => {
3372
+ useEffect4(() => {
3267
3373
  const logPath = getLogFilePath();
3268
3374
  let lastSize = 0;
3269
3375
  if (fs15.existsSync(logPath)) {
@@ -3314,10 +3420,10 @@ var init_App = __esm({
3314
3420
  const handleConfigChange = useCallback(() => {
3315
3421
  refreshData();
3316
3422
  }, [refreshData]);
3317
- return /* @__PURE__ */ jsxs9(Box10, { flexDirection: "column", padding: 0, height: termHeight, children: [
3318
- /* @__PURE__ */ jsx10(TabBar, { tabs: TABS, activeTab, onChange: setActiveTab }),
3319
- /* @__PURE__ */ jsxs9(Box10, { marginTop: 1, flexGrow: 1, children: [
3320
- activeTab === "overview" && /* @__PURE__ */ jsx10(
3423
+ return /* @__PURE__ */ jsxs10(Box11, { flexDirection: "column", padding: 0, height: termHeight, children: [
3424
+ /* @__PURE__ */ jsx11(TabBar, { tabs, activeTab, onChange: setActiveTab }),
3425
+ /* @__PURE__ */ jsxs10(Box11, { marginTop: 1, flexGrow: 1, children: [
3426
+ activeTab === "overview" && /* @__PURE__ */ jsx11(
3321
3427
  Overview,
3322
3428
  {
3323
3429
  serverStatus: serverInfo,
@@ -3328,11 +3434,12 @@ var init_App = __esm({
3328
3434
  }
3329
3435
  }
3330
3436
  ),
3331
- activeTab === "projects" && /* @__PURE__ */ jsx10(ProjectsView, { config, projects, onConfigChange: handleConfigChange }),
3332
- activeTab === "install" && /* @__PURE__ */ jsx10(InstallView, {}),
3333
- activeTab === "logs" && /* @__PURE__ */ jsx10(LogViewer, { logs, height: contentHeight })
3437
+ activeTab === "projects" && /* @__PURE__ */ jsx11(ProjectsView, { config, projects, onConfigChange: handleConfigChange }),
3438
+ activeTab === "indexing" && /* @__PURE__ */ jsx11(IndexingStatus, { config, projects: exposedProjects }),
3439
+ activeTab === "install" && /* @__PURE__ */ jsx11(InstallView, {}),
3440
+ activeTab === "logs" && /* @__PURE__ */ jsx11(LogViewer, { logs, height: contentHeight })
3334
3441
  ] }),
3335
- /* @__PURE__ */ jsx10(Box10, { marginTop: 0, children: /* @__PURE__ */ jsx10(
3442
+ /* @__PURE__ */ jsx11(Box11, { marginTop: 0, children: /* @__PURE__ */ jsx11(
3336
3443
  StatusBoard,
3337
3444
  {
3338
3445
  exposedLabel: `${exposedProjects.length} / ${projects.length} projects`,
@@ -3349,7 +3456,7 @@ var init_App = __esm({
3349
3456
  // src/mcp/commands/start.ts
3350
3457
  import { confirm as confirm3, isCancel as isCancel5, text } from "@clack/prompts";
3351
3458
  async function handleStartServer() {
3352
- const React11 = await import("react");
3459
+ const React12 = await import("react");
3353
3460
  const { render } = await import("ink");
3354
3461
  const { App: App2 } = await Promise.resolve().then(() => (init_App(), App_exports));
3355
3462
  const config = loadMCPConfig();
@@ -3390,7 +3497,7 @@ async function handleStartServer() {
3390
3497
  }
3391
3498
  }
3392
3499
  process.stdin.resume();
3393
- const app = render(React11.createElement(App2, {
3500
+ const app = render(React12.createElement(App2, {
3394
3501
  initialPort,
3395
3502
  onExit: () => {
3396
3503
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rrce-workflow",
3
- "version": "0.2.57",
3
+ "version": "0.2.58",
4
4
  "description": "RRCE-Workflow TUI - Agentic code workflow generator for AI-assisted development",
5
5
  "author": "RRCE Team",
6
6
  "license": "MIT",