rrce-workflow 0.2.70 → 0.2.72
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/README.md +16 -12
- package/agent-core/prompts/doctor.md +3 -3
- package/agent-core/prompts/documentation.md +3 -3
- package/agent-core/prompts/executor.md +3 -3
- package/agent-core/prompts/init.md +3 -3
- package/agent-core/prompts/planning_orchestrator.md +4 -4
- package/agent-core/prompts/research_discussion.md +4 -4
- package/agent-core/prompts/sync.md +1 -1
- package/dist/index.js +99 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,19 +66,23 @@ The easiest way to connect is via the TUI (`npx rrce-workflow mcp` -> **Install*
|
|
|
66
66
|
|
|
67
67
|
#### OpenCode
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
RRCE-Workflow integrates with OpenCode both as an MCP server and by providing **Custom Primary Agents**.
|
|
70
|
+
|
|
71
|
+
1. **Register MCP Server**: Add the following to `~/.config/opencode/opencode.json`:
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"$schema": "https://opencode.ai/config.json",
|
|
75
|
+
"mcp": {
|
|
76
|
+
"rrce": {
|
|
77
|
+
"type": "local",
|
|
78
|
+
"command": ["npx", "-y", "rrce-workflow", "mcp", "start"],
|
|
79
|
+
"enabled": true
|
|
80
|
+
}
|
|
81
|
+
}
|
|
78
82
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
2. **Install Agents**: Run `npx rrce-workflow` and select **OpenCode** as a tool. This will generate specialized primary agents (Research, Planning, etc.) in `.opencode/agent/` that you can cycle through using the **Tab** key in the OpenCode TUI.
|
|
82
86
|
|
|
83
87
|
#### VSCode (with MCP Extension)
|
|
84
88
|
Add to `.vscode/mcp.json`:
|
|
@@ -20,7 +20,7 @@ You are the Project Doctor for RRCE-Workflow. Perform a health check on the code
|
|
|
20
20
|
|
|
21
21
|
## Path Resolution
|
|
22
22
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
23
|
-
For details, see: `{{
|
|
23
|
+
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
24
24
|
|
|
25
25
|
## Pipeline Position
|
|
26
26
|
- **Input**: Can be triggered at any time for project health analysis
|
|
@@ -142,7 +142,7 @@ Rank findings using this matrix:
|
|
|
142
142
|
### Step 6: Generate Output
|
|
143
143
|
|
|
144
144
|
1. Create task directory: `{{RRCE_DATA}}/tasks/doctor-{{YYYYMMDD}}/`
|
|
145
|
-
2. Write diagnosis using template: `{{
|
|
145
|
+
2. Write diagnosis using template: `{{RRCE_DATA}}/templates/doctor_output.md`
|
|
146
146
|
3. Save to: `{{RRCE_DATA}}/tasks/doctor-{{YYYYMMDD}}/diagnosis.md`
|
|
147
147
|
|
|
148
148
|
**Output includes:**
|
|
@@ -176,7 +176,7 @@ Report:
|
|
|
176
176
|
## Deliverable
|
|
177
177
|
|
|
178
178
|
- **File**: `{{RRCE_DATA}}/tasks/doctor-{{YYYYMMDD}}/diagnosis.md`
|
|
179
|
-
- **Template**: `{{
|
|
179
|
+
- **Template**: `{{RRCE_DATA}}/templates/doctor_output.md`
|
|
180
180
|
- **Outcome**: Structured diagnosis with prioritized, actionable tasks
|
|
181
181
|
|
|
182
182
|
## Focus Area Deep Dive
|
|
@@ -22,7 +22,7 @@ You are the Documentation Lead for the project. Operate like a senior engineerin
|
|
|
22
22
|
|
|
23
23
|
## Path Resolution
|
|
24
24
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
25
|
-
For details, see: `{{
|
|
25
|
+
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
26
26
|
|
|
27
27
|
## Supported DOC_TYPE Values
|
|
28
28
|
|
|
@@ -68,7 +68,7 @@ Workflow
|
|
|
68
68
|
- If `TASK_SLUG` is provided, ensure `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/docs` exists and target `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/docs/{{TASK_SLUG}}-{{DOC_TYPE}}.md`.
|
|
69
69
|
- Else if `TARGET_PATH` is provided, ensure its parent directory exists (must remain under `{{RRCE_DATA}}/`) and target `{{RRCE_DATA}}/{{TARGET_PATH}}`.
|
|
70
70
|
- Otherwise, default to `{{RRCE_DATA}}/knowledge/{{DOC_TYPE}}.md` and ensure `{{RRCE_DATA}}/knowledge` exists.
|
|
71
|
-
3. Select a template: prefer `{{
|
|
71
|
+
3. Select a template: prefer `{{RRCE_DATA}}/templates/docs/{{DOC_TYPE}}.md`; fallback to `{{RRCE_DATA}}/templates/documentation_output.md`.
|
|
72
72
|
4. Populate contextual metadata (`AUTHOR`, `RELEASE_REF`, task references, dates) and render the document using the chosen template.
|
|
73
73
|
5. If operating on a task slug, update `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json` with documentation artifact paths, new references, final decisions, checklist completions, and remaining follow-ups.
|
|
74
74
|
6. When broader knowledge changed, update the relevant `{{RRCE_DATA}}/knowledge/*.md` entries with `Updated: YYYY-MM-DD` markers, lean changelog bullets, and a small checklist of follow-ups.
|
|
@@ -76,5 +76,5 @@ Workflow
|
|
|
76
76
|
|
|
77
77
|
Deliverable
|
|
78
78
|
- File: Resolved from `DOC_TYPE` plus either `TASK_SLUG`, `TARGET_PATH`, or default knowledge location.
|
|
79
|
-
- Format: `{{
|
|
79
|
+
- Format: `{{RRCE_DATA}}/templates/docs/{{DOC_TYPE}}.md` when available; otherwise `{{RRCE_DATA}}/templates/documentation_output.md`.
|
|
80
80
|
- Outcome: Documentation tailored to the requested type, summarizing scope, implementation, validations, decisions, references, and leftover work while keeping project knowledge synchronized.
|
|
@@ -18,7 +18,7 @@ You are the Executor for the project. Operate like a senior individual contribut
|
|
|
18
18
|
|
|
19
19
|
## Path Resolution
|
|
20
20
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
21
|
-
For details, see: `{{
|
|
21
|
+
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
22
22
|
|
|
23
23
|
Pipeline Position
|
|
24
24
|
- **Requires**: Planning phase must be complete before execution can begin.
|
|
@@ -85,7 +85,7 @@ Workflow
|
|
|
85
85
|
2. Set `agents.executor.status` in `meta.json` to `in_progress` while working and `complete` after delivering.
|
|
86
86
|
3. Maintain checklist entries with current progress markers and timestamps where helpful.
|
|
87
87
|
4. Record checkpoints, blockers, and validation steps in `agents.executor.notes` and `references`.
|
|
88
|
-
5. Capture your implementation log using `{{
|
|
88
|
+
5. Capture your implementation log using `{{RRCE_DATA}}/templates/executor_output.md` and save it to `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/execution/{{TASK_SLUG}}-execution.md`, noting the provided `BRANCH` or current git ref.
|
|
89
89
|
6. Summarize test evidence, code pointers, and outstanding follow-ups so documentation can build on it seamlessly.
|
|
90
90
|
7. **Semantic Indexing**: If significant code was added or modified, suggest running `index_knowledge` to update the semantic search index:
|
|
91
91
|
- Tool: `index_knowledge`
|
|
@@ -93,5 +93,5 @@ Workflow
|
|
|
93
93
|
|
|
94
94
|
Deliverable
|
|
95
95
|
- File: `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/execution/{{TASK_SLUG}}-execution.md`
|
|
96
|
-
- Format: `{{
|
|
96
|
+
- Format: `{{RRCE_DATA}}/templates/executor_output.md`
|
|
97
97
|
- Outcome: Implementation log covering what was built, how it was validated, and what remains, kept lean and actionable.
|
|
@@ -17,7 +17,7 @@ You are the Project Initializer for RRCE-Workflow. Your mission: create a compre
|
|
|
17
17
|
|
|
18
18
|
## Path Resolution
|
|
19
19
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
20
|
-
For details, see: `{{
|
|
20
|
+
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
21
21
|
|
|
22
22
|
## Pipeline Position
|
|
23
23
|
- **Entry Point**: Run before any other agent for new projects
|
|
@@ -122,7 +122,7 @@ Scan in this priority order. Stop early if sufficient information gathered:
|
|
|
122
122
|
### Step 3: Generate Project Context
|
|
123
123
|
|
|
124
124
|
1. Ensure `{{RRCE_DATA}}/knowledge/` directory exists (create if absent)
|
|
125
|
-
2. Compile findings using template: `{{
|
|
125
|
+
2. Compile findings using template: `{{RRCE_DATA}}/templates/init_output.md`
|
|
126
126
|
3. Save to: `{{RRCE_DATA}}/knowledge/project-context.md`
|
|
127
127
|
4. Update `{{RRCE_DATA}}/workspace.json` with project metadata if it exists
|
|
128
128
|
|
|
@@ -160,7 +160,7 @@ Provide a brief summary:
|
|
|
160
160
|
## Deliverable
|
|
161
161
|
|
|
162
162
|
- **File**: `{{RRCE_DATA}}/knowledge/project-context.md`
|
|
163
|
-
- **Template**: `{{
|
|
163
|
+
- **Template**: `{{RRCE_DATA}}/templates/init_output.md`
|
|
164
164
|
- **Index**: `{{RRCE_DATA}}/knowledge/embeddings.json`
|
|
165
165
|
- **Outcome**: Comprehensive project context + searchable semantic index
|
|
166
166
|
|
|
@@ -15,7 +15,7 @@ You are the Planning & Task Orchestrator for the project. Operate like an engine
|
|
|
15
15
|
|
|
16
16
|
## Path Resolution
|
|
17
17
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
18
|
-
For details, see: `{{
|
|
18
|
+
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
19
19
|
|
|
20
20
|
Pipeline Position
|
|
21
21
|
- **Requires**: Research phase must be complete before planning can begin.
|
|
@@ -58,12 +58,12 @@ Non-Negotiables
|
|
|
58
58
|
|
|
59
59
|
Workflow
|
|
60
60
|
1. Confirm `TASK_SLUG` (prompt if missing) and ensure directories exist at `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/planning` and `{{RRCE_DATA}}/knowledge`, creating them automatically if absent.
|
|
61
|
-
2. Update `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json` (copy the template from `{{
|
|
61
|
+
2. Update `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json` (copy the template from `{{RRCE_DATA}}/templates/meta.template.json` if it is not already present):
|
|
62
62
|
- Mark `agents.planning.status` as `in_progress` while drafting and `complete` upon handoff.
|
|
63
63
|
- Link the plan artifact path in `agents.planning.artifact`.
|
|
64
64
|
- Populate or refresh `summary`, `references`, `milestones`, `checklist`, and `open_questions`.
|
|
65
65
|
3. Where new persistent knowledge is created (API notes, domain decisions, etc.), append or create records in `{{RRCE_DATA}}/knowledge/{{DOMAIN}}.md` and log the file path inside `meta.json.references`.
|
|
66
|
-
4. Structure the plan using `{{
|
|
66
|
+
4. Structure the plan using `{{RRCE_DATA}}/templates/planning_output.md` and store it at `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/planning/{{TASK_SLUG}}-plan.md`.
|
|
67
67
|
5. Provide clear guidance on validation, testing strategy, rollout sequencing, and success criteria for the Executor.
|
|
68
68
|
6. **Semantic Indexing**: If new knowledge files were created in `{{RRCE_DATA}}/knowledge/`, suggest running `index_knowledge` to update the semantic search index:
|
|
69
69
|
- Tool: `index_knowledge`
|
|
@@ -71,5 +71,5 @@ Workflow
|
|
|
71
71
|
|
|
72
72
|
Deliverable
|
|
73
73
|
- File: `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/planning/{{TASK_SLUG}}-plan.md`
|
|
74
|
-
- Format: `{{
|
|
74
|
+
- Format: `{{RRCE_DATA}}/templates/planning_output.md`
|
|
75
75
|
- Outcome: Ordered, actionable roadmap with dependencies, acceptance criteria, context links, and knowledge updates ready for implementation.
|
|
@@ -22,7 +22,7 @@ You are the Research & Discussion Lead for RRCE-Workflow. Your mission: refine i
|
|
|
22
22
|
|
|
23
23
|
## Path Resolution
|
|
24
24
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
25
|
-
For details, see: `{{
|
|
25
|
+
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
26
26
|
|
|
27
27
|
## Pipeline Position
|
|
28
28
|
- **Entry Point**: First agent invoked for new tasks
|
|
@@ -83,7 +83,7 @@ Based on knowledge search, create a gap analysis:
|
|
|
83
83
|
### Step 3: Setup Task Structure
|
|
84
84
|
|
|
85
85
|
1. Ensure directory exists: `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/research/`
|
|
86
|
-
2. Copy meta template if new task: `{{
|
|
86
|
+
2. Copy meta template if new task: `{{RRCE_DATA}}/templates/meta.template.json` → `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json`
|
|
87
87
|
3. Populate initial metadata:
|
|
88
88
|
- `task_id`: Generate UUID
|
|
89
89
|
- `task_slug`: From argument
|
|
@@ -127,7 +127,7 @@ Document the decision in `meta.json.decisions`.
|
|
|
127
127
|
|
|
128
128
|
### Step 6: Generate Research Brief
|
|
129
129
|
|
|
130
|
-
1. Compile findings using template: `{{
|
|
130
|
+
1. Compile findings using template: `{{RRCE_DATA}}/templates/research_output.md`
|
|
131
131
|
2. Save to: `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/research/{{TASK_SLUG}}-research.md`
|
|
132
132
|
|
|
133
133
|
**Brief includes:**
|
|
@@ -188,7 +188,7 @@ Research is complete when:
|
|
|
188
188
|
## Deliverable
|
|
189
189
|
|
|
190
190
|
- **File**: `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/research/{{TASK_SLUG}}-research.md`
|
|
191
|
-
- **Template**: `{{
|
|
191
|
+
- **Template**: `{{RRCE_DATA}}/templates/research_output.md`
|
|
192
192
|
- **Metadata**: `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json` with status `complete`
|
|
193
193
|
- **Outcome**: Planning agent can proceed without re-asking the same questions
|
|
194
194
|
|
|
@@ -16,7 +16,7 @@ You are the Knowledge Sync Lead. Act like a senior architect charged with keepin
|
|
|
16
16
|
|
|
17
17
|
## Path Resolution
|
|
18
18
|
Use the pre-resolved paths from the "System Resolved Paths" table in the context preamble.
|
|
19
|
-
For details, see: `{{
|
|
19
|
+
For details, see: `{{RRCE_DATA}}/docs/path-resolution.md`
|
|
20
20
|
|
|
21
21
|
Pipeline Position
|
|
22
22
|
- **Maintenance Agent**: Sync runs periodically or after significant codebase changes to keep knowledge current.
|
package/dist/index.js
CHANGED
|
@@ -1241,6 +1241,7 @@ var init_prompts = __esm({
|
|
|
1241
1241
|
// src/commands/wizard/utils.ts
|
|
1242
1242
|
import * as fs7 from "fs";
|
|
1243
1243
|
import * as path8 from "path";
|
|
1244
|
+
import { stringify } from "yaml";
|
|
1244
1245
|
function copyPromptsToDir(prompts, targetDir, extension) {
|
|
1245
1246
|
for (const prompt of prompts) {
|
|
1246
1247
|
const baseName = path8.basename(prompt.filePath, ".md");
|
|
@@ -1250,6 +1251,23 @@ function copyPromptsToDir(prompts, targetDir, extension) {
|
|
|
1250
1251
|
fs7.writeFileSync(targetPath, content);
|
|
1251
1252
|
}
|
|
1252
1253
|
}
|
|
1254
|
+
function convertToOpenCodeAgent(prompt) {
|
|
1255
|
+
const { frontmatter, content } = prompt;
|
|
1256
|
+
const tools = {};
|
|
1257
|
+
if (frontmatter.tools) {
|
|
1258
|
+
for (const tool of frontmatter.tools) {
|
|
1259
|
+
tools[`rrce_${tool}`] = true;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
const opencodeFrontmatter = {
|
|
1263
|
+
description: frontmatter.description,
|
|
1264
|
+
mode: "primary",
|
|
1265
|
+
tools: Object.keys(tools).length > 0 ? tools : void 0
|
|
1266
|
+
};
|
|
1267
|
+
return `---
|
|
1268
|
+
${stringify(opencodeFrontmatter)}---
|
|
1269
|
+
${content}`;
|
|
1270
|
+
}
|
|
1253
1271
|
function copyDirRecursive(src, dest) {
|
|
1254
1272
|
const entries = fs7.readdirSync(src, { withFileTypes: true });
|
|
1255
1273
|
for (const entry of entries) {
|
|
@@ -1608,17 +1626,35 @@ function installAgentPrompts(config, workspacePath, dataPaths) {
|
|
|
1608
1626
|
syncMetadataToAll(agentCoreDir, dataPaths);
|
|
1609
1627
|
copyDirToAllStoragePaths(path11.join(agentCoreDir, "templates"), "templates", dataPaths);
|
|
1610
1628
|
copyDirToAllStoragePaths(path11.join(agentCoreDir, "prompts"), "prompts", dataPaths);
|
|
1611
|
-
|
|
1629
|
+
copyDirToAllStoragePaths(path11.join(agentCoreDir, "docs"), "docs", dataPaths);
|
|
1630
|
+
const rrceHome = config.globalPath || getDefaultRRCEHome2();
|
|
1631
|
+
ensureDir(path11.join(rrceHome, "templates"));
|
|
1632
|
+
ensureDir(path11.join(rrceHome, "docs"));
|
|
1633
|
+
copyDirRecursive(path11.join(agentCoreDir, "templates"), path11.join(rrceHome, "templates"));
|
|
1634
|
+
copyDirRecursive(path11.join(agentCoreDir, "docs"), path11.join(rrceHome, "docs"));
|
|
1635
|
+
const needsIDEPrompts = config.storageMode === "workspace" && (config.tools.includes("copilot") || config.tools.includes("antigravity")) || config.tools.includes("opencode");
|
|
1636
|
+
if (needsIDEPrompts) {
|
|
1612
1637
|
const prompts = loadPromptsFromDir(getAgentCorePromptsDir());
|
|
1613
|
-
if (config.
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1638
|
+
if (config.storageMode === "workspace") {
|
|
1639
|
+
if (config.tools.includes("copilot")) {
|
|
1640
|
+
const copilotPath = getAgentPromptPath(workspacePath, "copilot");
|
|
1641
|
+
ensureDir(copilotPath);
|
|
1642
|
+
copyPromptsToDir(prompts, copilotPath, ".agent.md");
|
|
1643
|
+
}
|
|
1644
|
+
if (config.tools.includes("antigravity")) {
|
|
1645
|
+
const antigravityPath = getAgentPromptPath(workspacePath, "antigravity");
|
|
1646
|
+
ensureDir(antigravityPath);
|
|
1647
|
+
copyPromptsToDir(prompts, antigravityPath, ".md");
|
|
1648
|
+
}
|
|
1617
1649
|
}
|
|
1618
|
-
if (config.tools.includes("
|
|
1619
|
-
const
|
|
1620
|
-
ensureDir(
|
|
1621
|
-
|
|
1650
|
+
if (config.tools.includes("opencode")) {
|
|
1651
|
+
const opencodePath = path11.join(workspacePath, ".opencode", "agent");
|
|
1652
|
+
ensureDir(opencodePath);
|
|
1653
|
+
for (const prompt of prompts) {
|
|
1654
|
+
const baseName = path11.basename(prompt.filePath, ".md");
|
|
1655
|
+
const content = convertToOpenCodeAgent(prompt);
|
|
1656
|
+
fs10.writeFileSync(path11.join(opencodePath, `${baseName}.md`), content);
|
|
1657
|
+
}
|
|
1622
1658
|
}
|
|
1623
1659
|
}
|
|
1624
1660
|
}
|
|
@@ -2519,6 +2555,7 @@ var init_resources2 = __esm({
|
|
|
2519
2555
|
});
|
|
2520
2556
|
|
|
2521
2557
|
// src/mcp/prompts.ts
|
|
2558
|
+
import * as path16 from "path";
|
|
2522
2559
|
function getAllPrompts() {
|
|
2523
2560
|
const prompts = loadPromptsFromDir(getAgentCorePromptsDir());
|
|
2524
2561
|
return prompts.map((p) => {
|
|
@@ -2555,6 +2592,40 @@ function getPromptDef(name) {
|
|
|
2555
2592
|
(p) => p.name === name || p.id === name || p.name.toLowerCase() === search || p.id.toLowerCase() === search
|
|
2556
2593
|
);
|
|
2557
2594
|
}
|
|
2595
|
+
function renderPromptWithContext(content, args) {
|
|
2596
|
+
const renderArgs = { ...args };
|
|
2597
|
+
const activeProject = detectActiveProject();
|
|
2598
|
+
const DEFAULT_RRCE_HOME = getEffectiveGlobalPath();
|
|
2599
|
+
let resolvedRrceData = ".rrce-workflow/";
|
|
2600
|
+
let resolvedRrceHome = DEFAULT_RRCE_HOME;
|
|
2601
|
+
let resolvedWorkspaceRoot = process.cwd();
|
|
2602
|
+
let resolvedWorkspaceName = "current-project";
|
|
2603
|
+
if (activeProject) {
|
|
2604
|
+
resolvedRrceData = activeProject.dataPath;
|
|
2605
|
+
if (!resolvedRrceData.endsWith("/") && !resolvedRrceData.endsWith("\\")) {
|
|
2606
|
+
resolvedRrceData += "/";
|
|
2607
|
+
}
|
|
2608
|
+
resolvedWorkspaceRoot = activeProject.sourcePath || activeProject.path || activeProject.dataPath;
|
|
2609
|
+
resolvedWorkspaceName = activeProject.name;
|
|
2610
|
+
if (activeProject.source === "global") {
|
|
2611
|
+
const workspacesDir = path16.dirname(activeProject.dataPath);
|
|
2612
|
+
resolvedRrceHome = path16.dirname(workspacesDir);
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
if (!renderArgs["RRCE_DATA"]) renderArgs["RRCE_DATA"] = resolvedRrceData;
|
|
2616
|
+
if (!renderArgs["RRCE_HOME"]) renderArgs["RRCE_HOME"] = resolvedRrceHome;
|
|
2617
|
+
if (!renderArgs["WORKSPACE_ROOT"]) renderArgs["WORKSPACE_ROOT"] = resolvedWorkspaceRoot;
|
|
2618
|
+
if (!renderArgs["WORKSPACE_NAME"]) renderArgs["WORKSPACE_NAME"] = resolvedWorkspaceName;
|
|
2619
|
+
return {
|
|
2620
|
+
rendered: renderPrompt(content, renderArgs),
|
|
2621
|
+
context: {
|
|
2622
|
+
RRCE_DATA: resolvedRrceData,
|
|
2623
|
+
RRCE_HOME: resolvedRrceHome,
|
|
2624
|
+
WORKSPACE_ROOT: resolvedWorkspaceRoot,
|
|
2625
|
+
WORKSPACE_NAME: resolvedWorkspaceName
|
|
2626
|
+
}
|
|
2627
|
+
};
|
|
2628
|
+
}
|
|
2558
2629
|
function renderPrompt(content, args) {
|
|
2559
2630
|
let rendered = content;
|
|
2560
2631
|
for (const [key, val] of Object.entries(args)) {
|
|
@@ -2566,6 +2637,8 @@ var init_prompts2 = __esm({
|
|
|
2566
2637
|
"src/mcp/prompts.ts"() {
|
|
2567
2638
|
"use strict";
|
|
2568
2639
|
init_prompts();
|
|
2640
|
+
init_resources();
|
|
2641
|
+
init_paths();
|
|
2569
2642
|
}
|
|
2570
2643
|
});
|
|
2571
2644
|
|
|
@@ -2707,9 +2780,17 @@ Available projects: ${projects}`;
|
|
|
2707
2780
|
for (const [key, val] of Object.entries(renderArgs)) {
|
|
2708
2781
|
stringArgs[key] = String(val);
|
|
2709
2782
|
}
|
|
2710
|
-
const
|
|
2711
|
-
|
|
2712
|
-
|
|
2783
|
+
const { rendered, context } = renderPromptWithContext(promptDef.content, stringArgs);
|
|
2784
|
+
let contextPreamble = getContextPreamble();
|
|
2785
|
+
contextPreamble += `
|
|
2786
|
+
### System Resolved Paths (OVERRIDE)
|
|
2787
|
+
The system has pre-resolved the configuration for this project. Use these values instead of manual resolution:
|
|
2788
|
+
- **RRCE_DATA**: \`${context.RRCE_DATA}\` (Stores knowledge, tasks, refs)
|
|
2789
|
+
- **WORKSPACE_ROOT**: \`${context.WORKSPACE_ROOT}\` (Source code location)
|
|
2790
|
+
- **RRCE_HOME**: \`${context.RRCE_HOME}\`
|
|
2791
|
+
- **Current Project**: ${context.WORKSPACE_NAME}
|
|
2792
|
+
`;
|
|
2793
|
+
return { content: [{ type: "text", text: contextPreamble + rendered }] };
|
|
2713
2794
|
}
|
|
2714
2795
|
case "help_setup": {
|
|
2715
2796
|
const msg = `
|
|
@@ -2747,7 +2828,6 @@ import {
|
|
|
2747
2828
|
ListPromptsRequestSchema,
|
|
2748
2829
|
GetPromptRequestSchema
|
|
2749
2830
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
2750
|
-
import * as path16 from "path";
|
|
2751
2831
|
function registerPromptHandlers(server) {
|
|
2752
2832
|
server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
2753
2833
|
logger.debug("Listing prompts");
|
|
@@ -2782,34 +2862,15 @@ function registerPromptHandlers(server) {
|
|
|
2782
2862
|
for (const [key, val] of Object.entries(providedArgs)) {
|
|
2783
2863
|
renderArgs[key] = String(val);
|
|
2784
2864
|
}
|
|
2785
|
-
const
|
|
2786
|
-
const DEFAULT_RRCE_HOME = getEffectiveGlobalPath();
|
|
2787
|
-
let resolvedRrceData = ".rrce-workflow/";
|
|
2788
|
-
let resolvedRrceHome = DEFAULT_RRCE_HOME;
|
|
2789
|
-
let resolvedWorkspaceRoot = process.cwd();
|
|
2790
|
-
let resolvedWorkspaceName = "current-project";
|
|
2791
|
-
if (activeProject) {
|
|
2792
|
-
resolvedRrceData = activeProject.dataPath + "/";
|
|
2793
|
-
resolvedWorkspaceRoot = activeProject.sourcePath || activeProject.path || activeProject.dataPath;
|
|
2794
|
-
resolvedWorkspaceName = activeProject.name;
|
|
2795
|
-
if (activeProject.source === "global") {
|
|
2796
|
-
const workspacesDir = path16.dirname(activeProject.dataPath);
|
|
2797
|
-
resolvedRrceHome = path16.dirname(workspacesDir);
|
|
2798
|
-
}
|
|
2799
|
-
}
|
|
2800
|
-
if (!renderArgs["RRCE_DATA"]) renderArgs["RRCE_DATA"] = resolvedRrceData;
|
|
2801
|
-
if (!renderArgs["RRCE_HOME"]) renderArgs["RRCE_HOME"] = resolvedRrceHome;
|
|
2802
|
-
if (!renderArgs["WORKSPACE_ROOT"]) renderArgs["WORKSPACE_ROOT"] = resolvedWorkspaceRoot;
|
|
2803
|
-
if (!renderArgs["WORKSPACE_NAME"]) renderArgs["WORKSPACE_NAME"] = resolvedWorkspaceName;
|
|
2804
|
-
const content = renderPrompt(promptDef.content, renderArgs);
|
|
2865
|
+
const { rendered, context } = renderPromptWithContext(promptDef.content, renderArgs);
|
|
2805
2866
|
let contextPreamble = getContextPreamble();
|
|
2806
2867
|
contextPreamble += `
|
|
2807
2868
|
### System Resolved Paths (OVERRIDE)
|
|
2808
2869
|
The system has pre-resolved the configuration for this project. Use these values instead of manual resolution:
|
|
2809
|
-
- **RRCE_DATA**: \`${
|
|
2810
|
-
- **WORKSPACE_ROOT**: \`${
|
|
2811
|
-
- **RRCE_HOME**: \`${
|
|
2812
|
-
- **Current Project**: ${
|
|
2870
|
+
- **RRCE_DATA**: \`${context.RRCE_DATA}\` (Stores knowledge, tasks, refs)
|
|
2871
|
+
- **WORKSPACE_ROOT**: \`${context.WORKSPACE_ROOT}\` (Source code location)
|
|
2872
|
+
- **RRCE_HOME**: \`${context.RRCE_HOME}\`
|
|
2873
|
+
- **Current Project**: ${context.WORKSPACE_NAME}
|
|
2813
2874
|
`;
|
|
2814
2875
|
return {
|
|
2815
2876
|
messages: [
|
|
@@ -2817,7 +2878,7 @@ The system has pre-resolved the configuration for this project. Use these values
|
|
|
2817
2878
|
role: "user",
|
|
2818
2879
|
content: {
|
|
2819
2880
|
type: "text",
|
|
2820
|
-
text: contextPreamble +
|
|
2881
|
+
text: contextPreamble + rendered
|
|
2821
2882
|
}
|
|
2822
2883
|
}
|
|
2823
2884
|
]
|