ralph-mcp 1.0.7 → 1.0.8

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.
@@ -7,6 +7,7 @@ export declare const startInputSchema: z.ZodObject<{
7
7
  autoMerge: z.ZodDefault<z.ZodBoolean>;
8
8
  notifyOnComplete: z.ZodDefault<z.ZodBoolean>;
9
9
  onConflict: z.ZodDefault<z.ZodEnum<["auto_theirs", "auto_ours", "notify", "agent"]>>;
10
+ contextInjectionPath: z.ZodOptional<z.ZodString>;
10
11
  }, "strip", z.ZodTypeAny, {
11
12
  prdPath: string;
12
13
  onConflict: "auto_theirs" | "auto_ours" | "notify" | "agent";
@@ -15,6 +16,7 @@ export declare const startInputSchema: z.ZodObject<{
15
16
  worktree: boolean;
16
17
  autoStart: boolean;
17
18
  projectRoot?: string | undefined;
19
+ contextInjectionPath?: string | undefined;
18
20
  }, {
19
21
  prdPath: string;
20
22
  projectRoot?: string | undefined;
@@ -23,6 +25,7 @@ export declare const startInputSchema: z.ZodObject<{
23
25
  notifyOnComplete?: boolean | undefined;
24
26
  worktree?: boolean | undefined;
25
27
  autoStart?: boolean | undefined;
28
+ contextInjectionPath?: string | undefined;
26
29
  }>;
27
30
  export type StartInput = z.infer<typeof startInputSchema>;
28
31
  export interface StartResult {
@@ -16,6 +16,10 @@ export const startInputSchema = z.object({
16
16
  .enum(["auto_theirs", "auto_ours", "notify", "agent"])
17
17
  .default("agent")
18
18
  .describe("Conflict resolution strategy for merge"),
19
+ contextInjectionPath: z
20
+ .string()
21
+ .optional()
22
+ .describe("Path to a file (e.g., CLAUDE.md) to inject into the agent prompt"),
19
23
  });
20
24
  export async function start(input) {
21
25
  const projectRoot = input.projectRoot || process.cwd();
@@ -70,6 +74,9 @@ export async function start(input) {
70
74
  // Generate agent prompt if auto-start
71
75
  let agentPrompt = null;
72
76
  if (input.autoStart) {
77
+ const contextPath = input.contextInjectionPath
78
+ ? resolve(projectRoot, input.contextInjectionPath)
79
+ : undefined;
73
80
  agentPrompt = generateAgentPrompt(prd.branchName, prd.description, worktreePath || projectRoot, storyRecords.map((s) => ({
74
81
  storyId: s.storyId,
75
82
  title: s.title,
@@ -77,7 +84,7 @@ export async function start(input) {
77
84
  acceptanceCriteria: s.acceptanceCriteria,
78
85
  priority: s.priority,
79
86
  passes: s.passes,
80
- })));
87
+ })), contextPath);
81
88
  }
82
89
  return {
83
90
  executionId,
@@ -8,7 +8,7 @@ export declare function generateAgentPrompt(branch: string, description: string,
8
8
  acceptanceCriteria: string[];
9
9
  priority: number;
10
10
  passes: boolean;
11
- }>): string;
11
+ }>, contextInjectionPath?: string): string;
12
12
  /**
13
13
  * Generate merge agent prompt for conflict resolution
14
14
  */
@@ -6,7 +6,7 @@ const execAsync = promisify(exec);
6
6
  /**
7
7
  * Generate agent prompt for PRD execution
8
8
  */
9
- export function generateAgentPrompt(branch, description, worktreePath, stories) {
9
+ export function generateAgentPrompt(branch, description, worktreePath, stories, contextInjectionPath) {
10
10
  const pendingStories = stories
11
11
  .filter((s) => !s.passes)
12
12
  .sort((a, b) => a.priority - b.priority);
@@ -33,6 +33,16 @@ ${s.acceptanceCriteria.map((ac) => `- ${ac}`).join("\n")}
33
33
  // Ignore read errors
34
34
  }
35
35
  }
36
+ // Read injected context if provided
37
+ let injectedContext = "";
38
+ if (contextInjectionPath && existsSync(contextInjectionPath)) {
39
+ try {
40
+ injectedContext = readFileSync(contextInjectionPath, "utf-8");
41
+ }
42
+ catch (e) {
43
+ // Ignore read errors
44
+ }
45
+ }
36
46
  return `You are an autonomous coding agent working on the "${branch}" branch.
37
47
 
38
48
  ## Working Directory
@@ -40,6 +50,8 @@ ${worktreePath}
40
50
 
41
51
  ## PRD: ${description}
42
52
 
53
+ ${injectedContext ? `## Project Context\n${injectedContext}\n` : ""}
54
+
43
55
  ${progressLog ? `## Progress & Learnings\n${progressLog}\n` : ""}
44
56
 
45
57
  ## Pending User Stories
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ralph-mcp",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "MCP server for autonomous PRD execution with Claude Code. Git worktree isolation, progress tracking, auto-merge.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,7 +20,7 @@
20
20
  "user-story",
21
21
  "merge-queue"
22
22
  ],
23
- "author": "G0d2i11a",
23
+ "author": "Godzi11a <2492186627@qq.com>",
24
24
  "license": "MIT",
25
25
  "repository": {
26
26
  "type": "git",