rrce-workflow 0.2.80 → 0.2.82
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/agent-core/prompts/doctor.md +3 -3
- package/agent-core/prompts/documentation.md +14 -5
- package/agent-core/prompts/executor.md +16 -7
- package/agent-core/prompts/init.md +5 -1
- package/agent-core/prompts/planning_discussion.md +17 -8
- package/agent-core/prompts/research_discussion.md +17 -8
- package/agent-core/prompts/sync.md +15 -6
- package/dist/index.js +51 -46
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: RRCE Doctor
|
|
3
3
|
description: Analyze codebase health using semantic search; identify issues and recommend improvement tasks.
|
|
4
4
|
argument-hint: "[PROJECT_NAME=<name>] [FOCUS_AREA=<area>]"
|
|
5
|
-
tools: ['search_knowledge', 'get_project_context', 'index_knowledge', 'list_projects']
|
|
5
|
+
tools: ['search_knowledge', 'get_project_context', 'index_knowledge', 'list_projects', 'create_task']
|
|
6
6
|
required-args: []
|
|
7
7
|
optional-args:
|
|
8
8
|
- name: PROJECT_NAME
|
|
@@ -55,7 +55,7 @@ For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
|
55
55
|
### Step 1: Load Project Context
|
|
56
56
|
|
|
57
57
|
```
|
|
58
|
-
Tool:
|
|
58
|
+
Tool: rrce_get_project_context
|
|
59
59
|
Args: { "project": "{{WORKSPACE_NAME}}" }
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -93,7 +93,7 @@ Use `search_knowledge` to efficiently find problem areas. Run queries based on F
|
|
|
93
93
|
|
|
94
94
|
**Query Execution:**
|
|
95
95
|
```
|
|
96
|
-
Tool:
|
|
96
|
+
Tool: rrce_search_knowledge
|
|
97
97
|
Args: { "query": "<query>", "project": "{{WORKSPACE_NAME}}" }
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: RRCE Documentation
|
|
3
3
|
description: Produce project documentation aligned with the latest delivery.
|
|
4
4
|
argument-hint: "DOC_TYPE=<type> [TASK_SLUG=<slug> | TARGET_PATH=<relative>] [RELEASE_REF=<tag/sha>]"
|
|
5
|
-
tools: ['search_knowledge', 'get_project_context', 'list_projects', 'read', 'write', 'edit', 'bash', 'glob', 'grep']
|
|
5
|
+
tools: ['search_knowledge', 'get_project_context', 'list_projects', 'update_task', 'read', 'write', 'edit', 'bash', 'glob', 'grep']
|
|
6
6
|
required-args:
|
|
7
7
|
- name: DOC_TYPE
|
|
8
8
|
prompt: "Enter the documentation type (e.g., api, architecture, runbook, changelog)"
|
|
@@ -24,6 +24,10 @@ You are the Documentation Lead for the project. Operate like a senior engineerin
|
|
|
24
24
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
25
25
|
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
26
26
|
|
|
27
|
+
### Tool Usage Guidance
|
|
28
|
+
- **search_knowledge**: PREFER this tool for finding concepts, logic flow, or documentation. It uses semantic search (RAG) to find relevant code even without exact keyword matches.
|
|
29
|
+
- **grep**: Use ONLY when searching for exact string patterns (e.g., specific function names, error codes).
|
|
30
|
+
|
|
27
31
|
## Supported DOC_TYPE Values
|
|
28
32
|
|
|
29
33
|
| Type | Purpose | Audience |
|
|
@@ -44,11 +48,16 @@ Pipeline Position
|
|
|
44
48
|
1. **Path Resolution**: Always use the "System Resolved Paths" from the context preamble.
|
|
45
49
|
- Use `{{RRCE_DATA}}` for all RRCE-specific storage.
|
|
46
50
|
- Use `{{WORKSPACE_ROOT}}` for project source code.
|
|
47
|
-
2. **
|
|
51
|
+
2. **Metadata Updates**: For `meta.json` changes, use the MCP tool:
|
|
52
|
+
```
|
|
53
|
+
Tool: rrce_update_task
|
|
54
|
+
Args: { "project": "{{WORKSPACE_NAME}}", "task_slug": "{{TASK_SLUG}}", "updates": { ... } }
|
|
55
|
+
```
|
|
56
|
+
This tool saves the file automatically. Do NOT use `write` for meta.json.
|
|
57
|
+
3. **File Writing**: When using the `write` tool for other files:
|
|
48
58
|
- The `content` parameter **MUST be a string**.
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
3. **Directory Safety**: Use `bash` with `mkdir -p` to ensure parent directories exist before writing files if they might be missing.
|
|
59
|
+
- For JSON in other files, stringify first: `JSON.stringify(data, null, 2)`
|
|
60
|
+
4. **Directory Safety**: Use `bash` with `mkdir -p` to ensure parent directories exist before writing files if they might be missing.
|
|
52
61
|
|
|
53
62
|
Prerequisites (RECOMMENDED)
|
|
54
63
|
If a `TASK_SLUG` is provided:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: RRCE Executor
|
|
3
3
|
description: Execute the planned tasks to deliver working code and tests. The ONLY agent authorized to modify source code.
|
|
4
4
|
argument-hint: "TASK_SLUG=<slug> [BRANCH=<git ref>]"
|
|
5
|
-
tools: ['search_knowledge', 'get_project_context', 'index_knowledge', 'terminalLastCommand', 'read', 'write', 'edit', 'bash', 'glob', 'grep']
|
|
5
|
+
tools: ['search_knowledge', 'get_project_context', 'index_knowledge', 'update_task', 'terminalLastCommand', 'read', 'write', 'edit', 'bash', 'glob', 'grep']
|
|
6
6
|
required-args:
|
|
7
7
|
- name: TASK_SLUG
|
|
8
8
|
prompt: "Enter the task slug to execute"
|
|
@@ -20,6 +20,10 @@ You are the Executor for RRCE-Workflow. You are the **ONLY agent in the pipeline
|
|
|
20
20
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
21
21
|
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
22
22
|
|
|
23
|
+
### Tool Usage Guidance
|
|
24
|
+
- **search_knowledge**: PREFER this tool for finding concepts, logic flow, or documentation. It uses semantic search (RAG) to find relevant code even without exact keyword matches.
|
|
25
|
+
- **grep**: Use ONLY when searching for exact string patterns (e.g., specific function names, error codes).
|
|
26
|
+
|
|
23
27
|
## Pipeline Position
|
|
24
28
|
- **Requires**: Both Research AND Planning phases must be complete before execution
|
|
25
29
|
- **Input**: Execution plan from `/plan` agent
|
|
@@ -79,11 +83,16 @@ Before touching ANY code, verify ALL of the following in order:
|
|
|
79
83
|
1. **Path Resolution**: Always use the "System Resolved Paths" from the context preamble.
|
|
80
84
|
- Use `{{RRCE_DATA}}` for all RRCE-specific storage.
|
|
81
85
|
- Use `{{WORKSPACE_ROOT}}` for project source code.
|
|
82
|
-
2. **
|
|
86
|
+
2. **Metadata Updates**: For `meta.json` changes, use the MCP tool:
|
|
87
|
+
```
|
|
88
|
+
Tool: rrce_update_task
|
|
89
|
+
Args: { "project": "{{WORKSPACE_NAME}}", "task_slug": "{{TASK_SLUG}}", "updates": { ... } }
|
|
90
|
+
```
|
|
91
|
+
This tool saves the file automatically. Do NOT use `write` for meta.json.
|
|
92
|
+
3. **File Writing**: When using the `write` tool for other files:
|
|
83
93
|
- The `content` parameter **MUST be a string**.
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
3. **Directory Safety**: Use `bash` with `mkdir -p` to ensure parent directories exist before writing files if they might be missing.
|
|
94
|
+
- For JSON in other files, stringify first: `JSON.stringify(data, null, 2)`
|
|
95
|
+
4. **Directory Safety**: Use `bash` with `mkdir -p` to ensure parent directories exist before writing files if they might be missing.
|
|
87
96
|
|
|
88
97
|
## Mission
|
|
89
98
|
- Implement the scoped work as defined in the execution plan
|
|
@@ -96,7 +105,7 @@ Before touching ANY code, verify ALL of the following in order:
|
|
|
96
105
|
|
|
97
106
|
Before implementing, search for relevant patterns:
|
|
98
107
|
```
|
|
99
|
-
Tool:
|
|
108
|
+
Tool: rrce_search_knowledge
|
|
100
109
|
Args: { "query": "<component or pattern name>", "project": "{{WORKSPACE_NAME}}" }
|
|
101
110
|
```
|
|
102
111
|
|
|
@@ -262,7 +271,7 @@ After completing execution:
|
|
|
262
271
|
|
|
263
272
|
If significant code was added or modified, suggest running:
|
|
264
273
|
```
|
|
265
|
-
Tool:
|
|
274
|
+
Tool: rrce_index_knowledge
|
|
266
275
|
Args: { "project": "{{WORKSPACE_NAME}}" }
|
|
267
276
|
```
|
|
268
277
|
|
|
@@ -19,6 +19,10 @@ You are the Project Initializer for RRCE-Workflow. Your mission: create a compre
|
|
|
19
19
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
20
20
|
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
21
21
|
|
|
22
|
+
### Tool Usage Guidance
|
|
23
|
+
- **search_knowledge**: PREFER this tool for finding concepts, logic flow, or documentation. It uses semantic search (RAG) to find relevant code even without exact keyword matches.
|
|
24
|
+
- **grep**: Use ONLY when searching for exact string patterns (e.g., specific function names, error codes).
|
|
25
|
+
|
|
22
26
|
## Pipeline Position
|
|
23
27
|
- **Entry Point**: Run before any other agent for new projects
|
|
24
28
|
- **Output**: `{{RRCE_DATA}}/knowledge/project-context.md` + semantic search index
|
|
@@ -132,7 +136,7 @@ Scan in this priority order. Stop early if sufficient information gathered:
|
|
|
132
136
|
**Always run after generating/updating context:**
|
|
133
137
|
|
|
134
138
|
```
|
|
135
|
-
Tool:
|
|
139
|
+
Tool: rrce_index_knowledge
|
|
136
140
|
Args: { "project": "{{WORKSPACE_NAME}}" }
|
|
137
141
|
```
|
|
138
142
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: RRCE Planning
|
|
3
3
|
description: Transform research findings into an actionable execution plan through interactive task breakdown.
|
|
4
4
|
argument-hint: "TASK_SLUG=<slug>"
|
|
5
|
-
tools: ['search_knowledge', 'get_project_context', 'list_projects', 'read', 'glob', 'grep', 'write', 'bash']
|
|
5
|
+
tools: ['search_knowledge', 'get_project_context', 'list_projects', 'update_task', 'read', 'glob', 'grep', 'write', 'bash']
|
|
6
6
|
required-args:
|
|
7
7
|
- name: TASK_SLUG
|
|
8
8
|
prompt: "Enter the task slug to create a plan for"
|
|
@@ -17,6 +17,10 @@ You are the Planning & Task Orchestrator for RRCE-Workflow. Your mission: transf
|
|
|
17
17
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
18
18
|
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
19
19
|
|
|
20
|
+
### Tool Usage Guidance
|
|
21
|
+
- **search_knowledge**: PREFER this tool for finding concepts, logic flow, or documentation. It uses semantic search (RAG) to find relevant code even without exact keyword matches.
|
|
22
|
+
- **grep**: Use ONLY when searching for exact string patterns (e.g., specific function names, error codes).
|
|
23
|
+
|
|
20
24
|
## Pipeline Position
|
|
21
25
|
- **Requires**: Research phase must be complete before planning can begin
|
|
22
26
|
- **Input**: Research brief from `/research` agent
|
|
@@ -52,13 +56,18 @@ For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
|
52
56
|
1. **Path Resolution**: Always use the "System Resolved Paths" from the context preamble.
|
|
53
57
|
- Use `{{RRCE_DATA}}` for all RRCE-specific storage.
|
|
54
58
|
- Use `{{WORKSPACE_ROOT}}` for reading project source code (READ ONLY).
|
|
55
|
-
2. **
|
|
59
|
+
2. **Metadata Updates**: For `meta.json` changes, use the MCP tool:
|
|
60
|
+
```
|
|
61
|
+
Tool: rrce_update_task
|
|
62
|
+
Args: { "project": "{{WORKSPACE_NAME}}", "task_slug": "{{TASK_SLUG}}", "updates": { ... } }
|
|
63
|
+
```
|
|
64
|
+
This tool saves the file automatically. Do NOT use `write` for meta.json.
|
|
65
|
+
3. **File Writing**: When using the `write` tool for other files:
|
|
56
66
|
- The `content` parameter **MUST be a string**.
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
3. **Write Permissions**: You may ONLY write to:
|
|
67
|
+
- For JSON in other files, stringify first: `JSON.stringify(data, null, 2)`
|
|
68
|
+
4. **Write Permissions**: You may ONLY write to:
|
|
60
69
|
- `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/planning/` (plan artifacts)
|
|
61
|
-
- `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json` (metadata)
|
|
70
|
+
- `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json` (metadata via rrce_update_task)
|
|
62
71
|
- `{{RRCE_DATA}}/knowledge/` (new knowledge documents)
|
|
63
72
|
|
|
64
73
|
## Prerequisites (STRICT)
|
|
@@ -113,7 +122,7 @@ Extract and internalize:
|
|
|
113
122
|
|
|
114
123
|
Search for related patterns and prior art:
|
|
115
124
|
```
|
|
116
|
-
Tool:
|
|
125
|
+
Tool: rrce_search_knowledge
|
|
117
126
|
Args: { "query": "<task keywords>", "project": "{{WORKSPACE_NAME}}" }
|
|
118
127
|
```
|
|
119
128
|
|
|
@@ -273,7 +282,7 @@ After saving the plan and updating metadata:
|
|
|
273
282
|
|
|
274
283
|
If new knowledge files were created in `{{RRCE_DATA}}/knowledge/`, suggest running:
|
|
275
284
|
```
|
|
276
|
-
Tool:
|
|
285
|
+
Tool: rrce_index_knowledge
|
|
277
286
|
Args: { "project": "{{WORKSPACE_NAME}}" }
|
|
278
287
|
```
|
|
279
288
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: RRCE Research
|
|
3
3
|
description: Interactive research and requirements clarification through constructive dialogue. Achieves 100% understanding before planning.
|
|
4
4
|
argument-hint: REQUEST="<user prompt>" [TASK_SLUG=<slug>] [TITLE="<task title>"] [SOURCE=<url>]
|
|
5
|
-
tools: ['search_knowledge', 'get_project_context', 'list_projects', 'read', 'glob', 'grep', 'write', 'bash']
|
|
5
|
+
tools: ['search_knowledge', 'get_project_context', 'list_projects', 'create_task', 'update_task', 'read', 'glob', 'grep', 'write', 'bash']
|
|
6
6
|
required-args:
|
|
7
7
|
- name: TASK_SLUG
|
|
8
8
|
prompt: "Enter a task slug (kebab-case identifier)"
|
|
@@ -24,6 +24,10 @@ You are the Research & Discussion Lead for RRCE-Workflow. Your mission: achieve
|
|
|
24
24
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
25
25
|
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
26
26
|
|
|
27
|
+
### Tool Usage Guidance
|
|
28
|
+
- **search_knowledge**: PREFER this tool for finding concepts, logic flow, or documentation. It uses semantic search (RAG) to find relevant code even without exact keyword matches.
|
|
29
|
+
- **grep**: Use ONLY when searching for exact string patterns (e.g., specific function names, error codes).
|
|
30
|
+
|
|
27
31
|
## Pipeline Position
|
|
28
32
|
- **Entry Point**: First agent invoked for new tasks (after optional `/init`)
|
|
29
33
|
- **Output**: Research brief document ready for Planning agent
|
|
@@ -57,13 +61,18 @@ For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
|
57
61
|
1. **Path Resolution**: Always use the "System Resolved Paths" from the context preamble.
|
|
58
62
|
- Use `{{RRCE_DATA}}` for all RRCE-specific storage.
|
|
59
63
|
- Use `{{WORKSPACE_ROOT}}` for reading project source code (READ ONLY).
|
|
60
|
-
2. **
|
|
64
|
+
2. **Metadata Updates**: For `meta.json` changes, use the MCP tool:
|
|
65
|
+
```
|
|
66
|
+
Tool: rrce_update_task
|
|
67
|
+
Args: { "project": "{{WORKSPACE_NAME}}", "task_slug": "{{TASK_SLUG}}", "updates": { ... } }
|
|
68
|
+
```
|
|
69
|
+
This tool saves the file automatically. Do NOT use `write` for meta.json.
|
|
70
|
+
3. **File Writing**: When using the `write` tool for other files:
|
|
61
71
|
- The `content` parameter **MUST be a string**.
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
3. **Write Permissions**: You may ONLY write to:
|
|
72
|
+
- For JSON in other files, stringify first: `JSON.stringify(data, null, 2)`
|
|
73
|
+
4. **Write Permissions**: You may ONLY write to:
|
|
65
74
|
- `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/` (task artifacts)
|
|
66
|
-
- `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json` (metadata)
|
|
75
|
+
- `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json` (metadata via rrce_update_task)
|
|
67
76
|
|
|
68
77
|
## Mission
|
|
69
78
|
- Challenge and refine the incoming request until intent, constraints, and success criteria are explicit
|
|
@@ -78,7 +87,7 @@ For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
|
78
87
|
**Search existing knowledge for relevant context:**
|
|
79
88
|
|
|
80
89
|
```
|
|
81
|
-
Tool:
|
|
90
|
+
Tool: rrce_search_knowledge
|
|
82
91
|
Args: { "query": "<keywords from REQUEST>", "project": "{{WORKSPACE_NAME}}" }
|
|
83
92
|
```
|
|
84
93
|
|
|
@@ -91,7 +100,7 @@ Look for:
|
|
|
91
100
|
**Get project context:**
|
|
92
101
|
|
|
93
102
|
```
|
|
94
|
-
Tool:
|
|
103
|
+
Tool: rrce_get_project_context
|
|
95
104
|
Args: { "project": "{{WORKSPACE_NAME}}" }
|
|
96
105
|
```
|
|
97
106
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: RRCE Sync
|
|
3
3
|
description: Reconcile project state with the RRCE knowledge base and update semantic index.
|
|
4
4
|
argument-hint: "[SCOPE=<path|module>]"
|
|
5
|
-
tools: ['search_knowledge', 'get_project_context', 'index_knowledge', 'list_projects', 'read', 'write', 'edit', 'bash', 'glob', 'grep']
|
|
5
|
+
tools: ['search_knowledge', 'get_project_context', 'index_knowledge', 'list_projects', 'update_task', 'read', 'write', 'edit', 'bash', 'glob', 'grep']
|
|
6
6
|
required-args: []
|
|
7
7
|
optional-args:
|
|
8
8
|
- name: SCOPE
|
|
@@ -18,6 +18,10 @@ You are the Knowledge Sync Lead. Act like a senior architect charged with keepin
|
|
|
18
18
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
19
19
|
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
20
20
|
|
|
21
|
+
### Tool Usage Guidance
|
|
22
|
+
- **search_knowledge**: PREFER this tool for finding concepts, logic flow, or documentation. It uses semantic search (RAG) to find relevant code even without exact keyword matches.
|
|
23
|
+
- **grep**: Use ONLY when searching for exact string patterns (e.g., specific function names, error codes).
|
|
24
|
+
|
|
21
25
|
Pipeline Position
|
|
22
26
|
- **Maintenance Agent**: Sync runs periodically or after significant codebase changes to keep knowledge current.
|
|
23
27
|
- **Requires**: Init must have been run at least once (project-context.md must exist).
|
|
@@ -27,11 +31,16 @@ Pipeline Position
|
|
|
27
31
|
1. **Path Resolution**: Always use the "System Resolved Paths" from the context preamble.
|
|
28
32
|
- Use `{{RRCE_DATA}}` for all RRCE-specific storage.
|
|
29
33
|
- Use `{{WORKSPACE_ROOT}}` for project source code.
|
|
30
|
-
2. **
|
|
34
|
+
2. **Metadata Updates**: For `meta.json` changes, use the MCP tool:
|
|
35
|
+
```
|
|
36
|
+
Tool: rrce_update_task
|
|
37
|
+
Args: { "project": "{{WORKSPACE_NAME}}", "task_slug": "{{TASK_SLUG}}", "updates": { ... } }
|
|
38
|
+
```
|
|
39
|
+
This tool saves the file automatically. Do NOT use `write` for meta.json.
|
|
40
|
+
3. **File Writing**: When using the `write` tool for other files:
|
|
31
41
|
- The `content` parameter **MUST be a string**.
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
3. **Directory Safety**: Use `bash` with `mkdir -p` to ensure parent directories exist before writing files if they might be missing.
|
|
42
|
+
- For JSON in other files, stringify first: `JSON.stringify(data, null, 2)`
|
|
43
|
+
4. **Directory Safety**: Use `bash` with `mkdir -p` to ensure parent directories exist before writing files if they might be missing.
|
|
35
44
|
|
|
36
45
|
Prerequisites (STRICT)
|
|
37
46
|
1. **Project Context Exists**: Check `{{RRCE_DATA}}/knowledge/project-context.md` exists.
|
|
@@ -62,7 +71,7 @@ Workflow
|
|
|
62
71
|
5. Summarize any unresolved questions or future sync needs at the bottom of the modified file(s) under a `Checklist` heading.
|
|
63
72
|
6. **Semantic Indexing (MANDATORY)**: After updating any knowledge files, run the indexer to keep search current:
|
|
64
73
|
```
|
|
65
|
-
Tool:
|
|
74
|
+
Tool: rrce_index_knowledge
|
|
66
75
|
Args: { "project": "{{WORKSPACE_NAME}}" }
|
|
67
76
|
```
|
|
68
77
|
|
package/dist/index.js
CHANGED
|
@@ -1997,17 +1997,17 @@ var init_rag = __esm({
|
|
|
1997
1997
|
if (_RAGService.activeModelName === this.modelName && _RAGService.loadPromise) {
|
|
1998
1998
|
return _RAGService.loadPromise;
|
|
1999
1999
|
}
|
|
2000
|
-
logger.info(`RAG
|
|
2000
|
+
logger.info(`[RAG] Initializing model ${this.modelName}...`);
|
|
2001
2001
|
_RAGService.activeModelName = this.modelName;
|
|
2002
2002
|
_RAGService.loadPromise = (async () => {
|
|
2003
2003
|
try {
|
|
2004
2004
|
const { pipeline } = await import("@xenova/transformers");
|
|
2005
2005
|
const pipe = await pipeline("feature-extraction", this.modelName);
|
|
2006
2006
|
_RAGService.pipelineInstance = pipe;
|
|
2007
|
-
logger.info(`RAG
|
|
2007
|
+
logger.info(`[RAG] Model ${this.modelName} initialized successfully.`);
|
|
2008
2008
|
return pipe;
|
|
2009
2009
|
} catch (error) {
|
|
2010
|
-
logger.error(`RAG
|
|
2010
|
+
logger.error(`[RAG] Failed to initialize model ${this.modelName}`, error);
|
|
2011
2011
|
_RAGService.pipelineInstance = null;
|
|
2012
2012
|
_RAGService.activeModelName = null;
|
|
2013
2013
|
_RAGService.loadPromise = null;
|
|
@@ -2025,9 +2025,9 @@ var init_rag = __esm({
|
|
|
2025
2025
|
try {
|
|
2026
2026
|
const data = fs13.readFileSync(this.indexPath, "utf-8");
|
|
2027
2027
|
this.index = JSON.parse(data);
|
|
2028
|
-
logger.info(`RAG
|
|
2028
|
+
logger.info(`[RAG] Loaded index from ${this.indexPath} with ${this.index?.chunks.length} chunks.`);
|
|
2029
2029
|
} catch (error) {
|
|
2030
|
-
logger.error(`RAG
|
|
2030
|
+
logger.error(`[RAG] Failed to load index from ${this.indexPath}`, error);
|
|
2031
2031
|
this.index = {
|
|
2032
2032
|
version: INDEX_VERSION,
|
|
2033
2033
|
baseModel: this.modelName,
|
|
@@ -2040,7 +2040,7 @@ var init_rag = __esm({
|
|
|
2040
2040
|
baseModel: this.modelName,
|
|
2041
2041
|
chunks: []
|
|
2042
2042
|
};
|
|
2043
|
-
logger.info(`RAG
|
|
2043
|
+
logger.info(`[RAG] Created new empty index at ${this.indexPath}`);
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
2046
|
/**
|
|
@@ -2054,9 +2054,9 @@ var init_rag = __esm({
|
|
|
2054
2054
|
fs13.mkdirSync(dir, { recursive: true });
|
|
2055
2055
|
}
|
|
2056
2056
|
fs13.writeFileSync(this.indexPath, JSON.stringify(this.index, null, 2));
|
|
2057
|
-
logger.info(`RAG
|
|
2057
|
+
logger.info(`[RAG] Saved index to ${this.indexPath} with ${this.index.chunks.length} chunks.`);
|
|
2058
2058
|
} catch (error) {
|
|
2059
|
-
logger.error(`RAG
|
|
2059
|
+
logger.error(`[RAG] Failed to save index to ${this.indexPath}`, error);
|
|
2060
2060
|
}
|
|
2061
2061
|
}
|
|
2062
2062
|
/**
|
|
@@ -2068,7 +2068,7 @@ var init_rag = __esm({
|
|
|
2068
2068
|
const output = await pipe(text2, { pooling: "mean", normalize: true });
|
|
2069
2069
|
return Array.from(output.data);
|
|
2070
2070
|
} catch (error) {
|
|
2071
|
-
logger.error("RAG
|
|
2071
|
+
logger.error("[RAG] Error generating embedding", error);
|
|
2072
2072
|
throw error;
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
@@ -2088,11 +2088,11 @@ var init_rag = __esm({
|
|
|
2088
2088
|
if (mtime !== void 0 && this.index.fileMetadata[filePath]) {
|
|
2089
2089
|
const existingMeta = this.index.fileMetadata[filePath];
|
|
2090
2090
|
if (existingMeta.mtime === mtime) {
|
|
2091
|
-
logger.debug(`RAG
|
|
2091
|
+
logger.debug(`[RAG] Skipping unchanged file ${filePath}`);
|
|
2092
2092
|
return false;
|
|
2093
2093
|
}
|
|
2094
2094
|
}
|
|
2095
|
-
logger.info(`RAG
|
|
2095
|
+
logger.info(`[RAG] Indexing file ${filePath}`);
|
|
2096
2096
|
this.index.chunks = this.index.chunks.filter((c) => c.filePath !== filePath);
|
|
2097
2097
|
const chunks = this.chunkContent(content);
|
|
2098
2098
|
for (const chunkText of chunks) {
|
|
@@ -2124,7 +2124,7 @@ var init_rag = __esm({
|
|
|
2124
2124
|
delete this.index.fileMetadata[filePath];
|
|
2125
2125
|
}
|
|
2126
2126
|
if (this.index.chunks.length !== initialCount) {
|
|
2127
|
-
logger.info(`RAG
|
|
2127
|
+
logger.info(`[RAG] Removed file ${filePath} from index (${initialCount - this.index.chunks.length} chunks removed)`);
|
|
2128
2128
|
this.saveIndex();
|
|
2129
2129
|
}
|
|
2130
2130
|
}
|
|
@@ -2156,10 +2156,10 @@ var init_rag = __esm({
|
|
|
2156
2156
|
async search(query, limit = 5) {
|
|
2157
2157
|
this.loadIndex();
|
|
2158
2158
|
if (!this.index || this.index.chunks.length === 0) {
|
|
2159
|
-
logger.warn("RAG
|
|
2159
|
+
logger.warn("[RAG] Search called on empty index");
|
|
2160
2160
|
return [];
|
|
2161
2161
|
}
|
|
2162
|
-
logger.info(`RAG
|
|
2162
|
+
logger.info(`[RAG] Searching for "${query}" (limit: ${limit})`);
|
|
2163
2163
|
const queryEmbedding = await this.generateEmbedding(query);
|
|
2164
2164
|
const results = this.index.chunks.map((chunk) => {
|
|
2165
2165
|
const score = this.cosineSimilarity(queryEmbedding, chunk.embedding);
|
|
@@ -2167,7 +2167,7 @@ var init_rag = __esm({
|
|
|
2167
2167
|
});
|
|
2168
2168
|
results.sort((a, b) => b.score - a.score);
|
|
2169
2169
|
const topResults = results.slice(0, limit);
|
|
2170
|
-
logger.info(`RAG
|
|
2170
|
+
logger.info(`[RAG] Search returned ${topResults.length} matches. Top score: ${topResults[0]?.score.toFixed(4)}`);
|
|
2171
2171
|
return topResults;
|
|
2172
2172
|
}
|
|
2173
2173
|
/**
|
|
@@ -2342,6 +2342,7 @@ async function searchKnowledge(query, projectFilter) {
|
|
|
2342
2342
|
);
|
|
2343
2343
|
const useRAG = projConfig?.semanticSearch?.enabled;
|
|
2344
2344
|
if (useRAG) {
|
|
2345
|
+
logger.info(`[RAG] Using semantic search for project '${project.name}'`);
|
|
2345
2346
|
try {
|
|
2346
2347
|
const indexPath = path16.join(project.knowledgePath, "embeddings.json");
|
|
2347
2348
|
const rag = new RAGService(indexPath, projConfig?.semanticSearch?.model);
|
|
@@ -2355,9 +2356,10 @@ async function searchKnowledge(query, projectFilter) {
|
|
|
2355
2356
|
score: r.score
|
|
2356
2357
|
});
|
|
2357
2358
|
}
|
|
2359
|
+
continue;
|
|
2358
2360
|
} catch (e) {
|
|
2361
|
+
logger.error(`[RAG] Semantic search failed for project '${project.name}', falling back to text search`, e);
|
|
2359
2362
|
}
|
|
2360
|
-
continue;
|
|
2361
2363
|
}
|
|
2362
2364
|
try {
|
|
2363
2365
|
const files = fs14.readdirSync(project.knowledgePath);
|
|
@@ -2821,7 +2823,7 @@ function registerToolHandlers(server) {
|
|
|
2821
2823
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
2822
2824
|
const tools = [
|
|
2823
2825
|
{
|
|
2824
|
-
name: "
|
|
2826
|
+
name: "rrce_search_knowledge",
|
|
2825
2827
|
description: "Search across all exposed project knowledge bases",
|
|
2826
2828
|
inputSchema: {
|
|
2827
2829
|
type: "object",
|
|
@@ -2833,7 +2835,7 @@ function registerToolHandlers(server) {
|
|
|
2833
2835
|
}
|
|
2834
2836
|
},
|
|
2835
2837
|
{
|
|
2836
|
-
name: "
|
|
2838
|
+
name: "rrce_index_knowledge",
|
|
2837
2839
|
description: "Update the semantic search index for a specific project",
|
|
2838
2840
|
inputSchema: {
|
|
2839
2841
|
type: "object",
|
|
@@ -2845,12 +2847,12 @@ function registerToolHandlers(server) {
|
|
|
2845
2847
|
}
|
|
2846
2848
|
},
|
|
2847
2849
|
{
|
|
2848
|
-
name: "
|
|
2850
|
+
name: "rrce_list_projects",
|
|
2849
2851
|
description: "List all projects exposed via MCP. Use these names for project-specific tools.",
|
|
2850
2852
|
inputSchema: { type: "object", properties: {} }
|
|
2851
2853
|
},
|
|
2852
2854
|
{
|
|
2853
|
-
name: "
|
|
2855
|
+
name: "rrce_get_project_context",
|
|
2854
2856
|
description: "Get the project context/architecture for a specific project",
|
|
2855
2857
|
inputSchema: {
|
|
2856
2858
|
type: "object",
|
|
@@ -2859,12 +2861,12 @@ function registerToolHandlers(server) {
|
|
|
2859
2861
|
}
|
|
2860
2862
|
},
|
|
2861
2863
|
{
|
|
2862
|
-
name: "
|
|
2864
|
+
name: "rrce_list_agents",
|
|
2863
2865
|
description: "List available agents (e.g. init, plan) and their arguments. Use this to discover which agent to call.",
|
|
2864
2866
|
inputSchema: { type: "object", properties: {} }
|
|
2865
2867
|
},
|
|
2866
2868
|
{
|
|
2867
|
-
name: "
|
|
2869
|
+
name: "rrce_get_agent_prompt",
|
|
2868
2870
|
description: 'Get the system prompt for a specific agent. Accepts agent Name (e.g. "RRCE Init") or ID (e.g. "init").',
|
|
2869
2871
|
inputSchema: {
|
|
2870
2872
|
type: "object",
|
|
@@ -2876,7 +2878,7 @@ function registerToolHandlers(server) {
|
|
|
2876
2878
|
}
|
|
2877
2879
|
},
|
|
2878
2880
|
{
|
|
2879
|
-
name: "
|
|
2881
|
+
name: "rrce_list_tasks",
|
|
2880
2882
|
description: "List all tasks for a project",
|
|
2881
2883
|
inputSchema: {
|
|
2882
2884
|
type: "object",
|
|
@@ -2885,7 +2887,7 @@ function registerToolHandlers(server) {
|
|
|
2885
2887
|
}
|
|
2886
2888
|
},
|
|
2887
2889
|
{
|
|
2888
|
-
name: "
|
|
2890
|
+
name: "rrce_get_task",
|
|
2889
2891
|
description: "Get details of a specific task",
|
|
2890
2892
|
inputSchema: {
|
|
2891
2893
|
type: "object",
|
|
@@ -2897,7 +2899,7 @@ function registerToolHandlers(server) {
|
|
|
2897
2899
|
}
|
|
2898
2900
|
},
|
|
2899
2901
|
{
|
|
2900
|
-
name: "
|
|
2902
|
+
name: "rrce_create_task",
|
|
2901
2903
|
description: "Create a new task in the project",
|
|
2902
2904
|
inputSchema: {
|
|
2903
2905
|
type: "object",
|
|
@@ -2911,7 +2913,7 @@ function registerToolHandlers(server) {
|
|
|
2911
2913
|
}
|
|
2912
2914
|
},
|
|
2913
2915
|
{
|
|
2914
|
-
name: "
|
|
2916
|
+
name: "rrce_update_task",
|
|
2915
2917
|
description: "Update an existing task",
|
|
2916
2918
|
inputSchema: {
|
|
2917
2919
|
type: "object",
|
|
@@ -2924,7 +2926,7 @@ function registerToolHandlers(server) {
|
|
|
2924
2926
|
}
|
|
2925
2927
|
},
|
|
2926
2928
|
{
|
|
2927
|
-
name: "
|
|
2929
|
+
name: "rrce_delete_task",
|
|
2928
2930
|
description: "Delete a task from the project",
|
|
2929
2931
|
inputSchema: {
|
|
2930
2932
|
type: "object",
|
|
@@ -2939,7 +2941,7 @@ function registerToolHandlers(server) {
|
|
|
2939
2941
|
const projects = getExposedProjects();
|
|
2940
2942
|
if (projects.length === 0) {
|
|
2941
2943
|
tools.push({
|
|
2942
|
-
name: "
|
|
2944
|
+
name: "rrce_help_setup",
|
|
2943
2945
|
description: "Get help on how to configure projects for the RRCE MCP Server",
|
|
2944
2946
|
inputSchema: { type: "object", properties: {} }
|
|
2945
2947
|
});
|
|
@@ -2951,27 +2953,27 @@ function registerToolHandlers(server) {
|
|
|
2951
2953
|
logger.info(`Calling tool: ${name}`, args);
|
|
2952
2954
|
try {
|
|
2953
2955
|
switch (name) {
|
|
2954
|
-
case "
|
|
2956
|
+
case "rrce_search_knowledge": {
|
|
2955
2957
|
const params = args;
|
|
2956
2958
|
const results = await searchKnowledge(params.query, params.project);
|
|
2957
2959
|
return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
|
|
2958
2960
|
}
|
|
2959
|
-
case "
|
|
2961
|
+
case "rrce_index_knowledge": {
|
|
2960
2962
|
const params = args;
|
|
2961
2963
|
const result = await indexKnowledge(params.project, params.force);
|
|
2962
2964
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
2963
2965
|
}
|
|
2964
|
-
case "
|
|
2966
|
+
case "rrce_list_projects": {
|
|
2965
2967
|
const projects = getExposedProjects();
|
|
2966
2968
|
const list = projects.map((p) => ({ name: p.name, source: p.source, path: p.path }));
|
|
2967
2969
|
return {
|
|
2968
2970
|
content: [{
|
|
2969
2971
|
type: "text",
|
|
2970
|
-
text: JSON.stringify(list, null, 2) + "\n\nTip: Use these project names for tools like `
|
|
2972
|
+
text: JSON.stringify(list, null, 2) + "\n\nTip: Use these project names for tools like `rrce_get_project_context` or `rrce_index_knowledge`."
|
|
2971
2973
|
}]
|
|
2972
2974
|
};
|
|
2973
2975
|
}
|
|
2974
|
-
case "
|
|
2976
|
+
case "rrce_get_project_context": {
|
|
2975
2977
|
const context = getProjectContext(args.project);
|
|
2976
2978
|
if (!context) {
|
|
2977
2979
|
const projects = getExposedProjects().map((p) => p.name).join(", ");
|
|
@@ -2982,7 +2984,7 @@ Available projects: ${projects}`;
|
|
|
2982
2984
|
}
|
|
2983
2985
|
return { content: [{ type: "text", text: context }] };
|
|
2984
2986
|
}
|
|
2985
|
-
case "
|
|
2987
|
+
case "rrce_list_agents": {
|
|
2986
2988
|
const prompts = getAllPrompts();
|
|
2987
2989
|
return {
|
|
2988
2990
|
content: [{
|
|
@@ -2992,11 +2994,11 @@ Available projects: ${projects}`;
|
|
|
2992
2994
|
id: p.id,
|
|
2993
2995
|
description: p.description,
|
|
2994
2996
|
arguments: p.arguments
|
|
2995
|
-
})), null, 2) + "\n\nTip: Retrieve the prompt for an agent using `
|
|
2997
|
+
})), null, 2) + "\n\nTip: Retrieve the prompt for an agent using `rrce_get_agent_prompt` with its name or ID."
|
|
2996
2998
|
}]
|
|
2997
2999
|
};
|
|
2998
3000
|
}
|
|
2999
|
-
case "
|
|
3001
|
+
case "rrce_get_agent_prompt": {
|
|
3000
3002
|
const params = args;
|
|
3001
3003
|
const agentName = params.agent;
|
|
3002
3004
|
const promptDef = getPromptDef(agentName);
|
|
@@ -3021,12 +3023,12 @@ The system has pre-resolved the configuration for this project. Use these values
|
|
|
3021
3023
|
`;
|
|
3022
3024
|
return { content: [{ type: "text", text: contextPreamble + rendered }] };
|
|
3023
3025
|
}
|
|
3024
|
-
case "
|
|
3026
|
+
case "rrce_list_tasks": {
|
|
3025
3027
|
const params = args;
|
|
3026
3028
|
const tasks = getProjectTasks(params.project);
|
|
3027
3029
|
return { content: [{ type: "text", text: JSON.stringify(tasks, null, 2) }] };
|
|
3028
3030
|
}
|
|
3029
|
-
case "
|
|
3031
|
+
case "rrce_get_task": {
|
|
3030
3032
|
const params = args;
|
|
3031
3033
|
const task = getTask(params.project, params.task_slug);
|
|
3032
3034
|
if (!task) {
|
|
@@ -3034,26 +3036,28 @@ The system has pre-resolved the configuration for this project. Use these values
|
|
|
3034
3036
|
}
|
|
3035
3037
|
return { content: [{ type: "text", text: JSON.stringify(task, null, 2) }] };
|
|
3036
3038
|
}
|
|
3037
|
-
case "
|
|
3039
|
+
case "rrce_create_task": {
|
|
3038
3040
|
const params = args;
|
|
3039
3041
|
const taskData = {
|
|
3040
3042
|
title: params.title || params.task_slug,
|
|
3041
3043
|
summary: params.summary || ""
|
|
3042
3044
|
};
|
|
3043
3045
|
const task = await createTask(params.project, params.task_slug, taskData);
|
|
3044
|
-
return { content: [{ type: "text", text:
|
|
3046
|
+
return { content: [{ type: "text", text: `\u2713 Task '${params.task_slug}' created. meta.json saved.
|
|
3047
|
+
${JSON.stringify(task, null, 2)}` }] };
|
|
3045
3048
|
}
|
|
3046
|
-
case "
|
|
3049
|
+
case "rrce_update_task": {
|
|
3047
3050
|
const params = args;
|
|
3048
3051
|
const task = await updateTask(params.project, params.task_slug, params.updates);
|
|
3049
|
-
return { content: [{ type: "text", text:
|
|
3052
|
+
return { content: [{ type: "text", text: `\u2713 Task '${params.task_slug}' updated. meta.json saved.
|
|
3053
|
+
${JSON.stringify(task, null, 2)}` }] };
|
|
3050
3054
|
}
|
|
3051
|
-
case "
|
|
3055
|
+
case "rrce_delete_task": {
|
|
3052
3056
|
const params = args;
|
|
3053
3057
|
const success = deleteTask(params.project, params.task_slug);
|
|
3054
|
-
return { content: [{ type: "text", text: success ?
|
|
3058
|
+
return { content: [{ type: "text", text: success ? `\u2713 Task '${params.task_slug}' deleted.` : `\u2717 Failed to delete '${params.task_slug}'.` }] };
|
|
3055
3059
|
}
|
|
3056
|
-
case "
|
|
3060
|
+
case "rrce_help_setup": {
|
|
3057
3061
|
const msg = `
|
|
3058
3062
|
RRCE MCP Server is running, but no projects are configured/exposed.
|
|
3059
3063
|
|
|
@@ -3291,7 +3295,7 @@ async function handleConfigure() {
|
|
|
3291
3295
|
enableSemanticSearch = shouldEnable;
|
|
3292
3296
|
if (enableSemanticSearch) {
|
|
3293
3297
|
note3(
|
|
3294
|
-
`This enables "
|
|
3298
|
+
`This enables "rrce_search_knowledge" tool for agents.
|
|
3295
3299
|
First use will download a ~100MB embedding model (all-MiniLM-L6-v2)
|
|
3296
3300
|
to your local device (one-time).`,
|
|
3297
3301
|
"Semantic Search Enabled"
|
|
@@ -3803,6 +3807,7 @@ var init_LogViewer = __esm({
|
|
|
3803
3807
|
const emptyLines = Math.max(0, height - visibleLogs.length);
|
|
3804
3808
|
const padding = Array(emptyLines).fill("");
|
|
3805
3809
|
const formatLog = (log) => {
|
|
3810
|
+
if (log.includes("[RAG]")) return /* @__PURE__ */ jsx7(Text7, { color: "cyan", children: log });
|
|
3806
3811
|
if (log.includes("[ERROR]")) return /* @__PURE__ */ jsx7(Text7, { color: "red", children: log });
|
|
3807
3812
|
if (log.includes("[WARN]")) return /* @__PURE__ */ jsx7(Text7, { color: "yellow", children: log });
|
|
3808
3813
|
if (log.includes("[INFO]")) return /* @__PURE__ */ jsx7(Text7, { color: "green", children: log });
|