nightshift-mcp 1.0.0
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 +670 -0
- package/dist/agent-spawner.d.ts +55 -0
- package/dist/agent-spawner.d.ts.map +1 -0
- package/dist/agent-spawner.js +468 -0
- package/dist/agent-spawner.js.map +1 -0
- package/dist/chat-manager.d.ts +72 -0
- package/dist/chat-manager.d.ts.map +1 -0
- package/dist/chat-manager.js +331 -0
- package/dist/chat-manager.js.map +1 -0
- package/dist/daemon.d.ts +65 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +563 -0
- package/dist/daemon.js.map +1 -0
- package/dist/file-lock.d.ts +41 -0
- package/dist/file-lock.d.ts.map +1 -0
- package/dist/file-lock.js +157 -0
- package/dist/file-lock.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2433 -0
- package/dist/index.js.map +1 -0
- package/dist/ralph-manager.d.ts +148 -0
- package/dist/ralph-manager.d.ts.map +1 -0
- package/dist/ralph-manager.js +399 -0
- package/dist/ralph-manager.js.map +1 -0
- package/dist/tool-registry.d.ts +130 -0
- package/dist/tool-registry.d.ts.map +1 -0
- package/dist/tool-registry.js +280 -0
- package/dist/tool-registry.js.map +1 -0
- package/dist/tools/agents.d.ts +7 -0
- package/dist/tools/agents.d.ts.map +1 -0
- package/dist/tools/agents.js +366 -0
- package/dist/tools/agents.js.map +1 -0
- package/dist/tools/bugs.d.ts +6 -0
- package/dist/tools/bugs.d.ts.map +1 -0
- package/dist/tools/bugs.js +184 -0
- package/dist/tools/bugs.js.map +1 -0
- package/dist/tools/chat.d.ts +10 -0
- package/dist/tools/chat.d.ts.map +1 -0
- package/dist/tools/chat.js +287 -0
- package/dist/tools/chat.js.map +1 -0
- package/dist/tools/index.d.ts +33 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +51 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/prd.d.ts +8 -0
- package/dist/tools/prd.d.ts.map +1 -0
- package/dist/tools/prd.js +275 -0
- package/dist/tools/prd.js.map +1 -0
- package/dist/tools/progress.d.ts +5 -0
- package/dist/tools/progress.d.ts.map +1 -0
- package/dist/tools/progress.js +81 -0
- package/dist/tools/progress.js.map +1 -0
- package/dist/tools/savepoints.d.ts +5 -0
- package/dist/tools/savepoints.d.ts.map +1 -0
- package/dist/tools/savepoints.js +100 -0
- package/dist/tools/savepoints.js.map +1 -0
- package/dist/tools/utility.d.ts +4 -0
- package/dist/tools/utility.d.ts.map +1 -0
- package/dist/tools/utility.js +375 -0
- package/dist/tools/utility.js.map +1 -0
- package/dist/tools/workflow.d.ts +10 -0
- package/dist/tools/workflow.d.ts.map +1 -0
- package/dist/tools/workflow.js +321 -0
- package/dist/tools/workflow.js.map +1 -0
- package/dist/types.d.ts +105 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/workflow-manager.d.ts +154 -0
- package/dist/workflow-manager.d.ts.map +1 -0
- package/dist/workflow-manager.js +356 -0
- package/dist/workflow-manager.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const readPrd: import("../tool-registry.js").ToolDefinition;
|
|
2
|
+
export declare const getNextStory: import("../tool-registry.js").ToolDefinition;
|
|
3
|
+
export declare const markStoryComplete: import("../tool-registry.js").ToolDefinition;
|
|
4
|
+
export declare const getIncompleteStories: import("../tool-registry.js").ToolDefinition;
|
|
5
|
+
export declare const claimStory: import("../tool-registry.js").ToolDefinition;
|
|
6
|
+
export declare const completeStory: import("../tool-registry.js").ToolDefinition;
|
|
7
|
+
export declare const prdTools: import("../tool-registry.js").ToolDefinition[];
|
|
8
|
+
//# sourceMappingURL=prd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prd.d.ts","sourceRoot":"","sources":["../../src/tools/prd.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,8CA2BlB,CAAC;AAEH,eAAO,MAAM,YAAY,8CAgCvB,CAAC;AAEH,eAAO,MAAM,iBAAiB,8CAmC5B,CAAC;AAEH,eAAO,MAAM,oBAAoB,8CA0B/B,CAAC;AAEH,eAAO,MAAM,UAAU,8CA+DrB,CAAC;AAEH,eAAO,MAAM,aAAa,8CA8FxB,CAAC;AAGH,eAAO,MAAM,QAAQ,gDAOpB,CAAC"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineTool } from "../tool-registry.js";
|
|
3
|
+
export const readPrd = defineTool({
|
|
4
|
+
name: "read_prd",
|
|
5
|
+
category: "prd",
|
|
6
|
+
description: "Read the PRD file with user stories",
|
|
7
|
+
fullDescription: "Read the PRD (Product Requirements Document) file. Returns structured task list with user stories and their completion status.",
|
|
8
|
+
inputSchema: z.object({}),
|
|
9
|
+
handler: async (_params, ctx) => {
|
|
10
|
+
try {
|
|
11
|
+
if (!ctx.ralphManager.hasPRD()) {
|
|
12
|
+
return {
|
|
13
|
+
content: [{ type: "text", text: "No prd.json found in project. Create one to use Ralph-style task management." }],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const prd = ctx.ralphManager.readPRD();
|
|
17
|
+
const summary = ctx.ralphManager.getCompletionSummary();
|
|
18
|
+
return {
|
|
19
|
+
content: [{ type: "text", text: JSON.stringify({ prd, summary }, null, 2) }],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
return {
|
|
24
|
+
content: [{ type: "text", text: `Error reading PRD: ${error instanceof Error ? error.message : String(error)}` }],
|
|
25
|
+
isError: true,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export const getNextStory = defineTool({
|
|
31
|
+
name: "get_next_story",
|
|
32
|
+
category: "prd",
|
|
33
|
+
description: "Get the next story to work on (highest priority)",
|
|
34
|
+
fullDescription: "Get the next user story to work on (highest priority incomplete story). Use this to claim your next task.",
|
|
35
|
+
inputSchema: z.object({}),
|
|
36
|
+
handler: async (_params, ctx) => {
|
|
37
|
+
try {
|
|
38
|
+
const story = ctx.ralphManager.getNextStory();
|
|
39
|
+
if (!story) {
|
|
40
|
+
const summary = ctx.ralphManager.getCompletionSummary();
|
|
41
|
+
if (summary.total === 0) {
|
|
42
|
+
return {
|
|
43
|
+
content: [{ type: "text", text: "No PRD found or no stories defined." }],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
content: [{ type: "text", text: "<promise>COMPLETE</promise>\nAll stories are complete!" }],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
content: [{ type: "text", text: JSON.stringify(story, null, 2) }],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
return {
|
|
56
|
+
content: [{ type: "text", text: `Error getting next story: ${error instanceof Error ? error.message : String(error)}` }],
|
|
57
|
+
isError: true,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
export const markStoryComplete = defineTool({
|
|
63
|
+
name: "mark_story_complete",
|
|
64
|
+
category: "prd",
|
|
65
|
+
description: "Mark a user story as complete",
|
|
66
|
+
fullDescription: "Mark a user story as complete (sets passes: true). Use after successfully implementing and testing a story.",
|
|
67
|
+
inputSchema: z.object({
|
|
68
|
+
storyId: z.string().describe("The story ID to mark complete (e.g., 'US-001')"),
|
|
69
|
+
notes: z.string().optional().describe("Optional notes about the implementation"),
|
|
70
|
+
}),
|
|
71
|
+
handler: async ({ storyId, notes }, ctx) => {
|
|
72
|
+
try {
|
|
73
|
+
const story = ctx.ralphManager.markStoryComplete(storyId, notes);
|
|
74
|
+
if (!story) {
|
|
75
|
+
return {
|
|
76
|
+
content: [{ type: "text", text: `Story ${storyId} not found in PRD.` }],
|
|
77
|
+
isError: true,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const summary = ctx.ralphManager.getCompletionSummary();
|
|
81
|
+
return {
|
|
82
|
+
content: [{
|
|
83
|
+
type: "text",
|
|
84
|
+
text: `Story ${storyId} marked complete!\n\nProgress: ${summary.complete}/${summary.total} (${summary.percentComplete}%)${summary.incomplete === 0 ? "\n\n<promise>COMPLETE</promise>\nAll stories are complete!" : ""}`,
|
|
85
|
+
}],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
return {
|
|
90
|
+
content: [{ type: "text", text: `Error marking story complete: ${error instanceof Error ? error.message : String(error)}` }],
|
|
91
|
+
isError: true,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
export const getIncompleteStories = defineTool({
|
|
97
|
+
name: "get_incomplete_stories",
|
|
98
|
+
category: "prd",
|
|
99
|
+
description: "Get all incomplete stories sorted by priority",
|
|
100
|
+
fullDescription: "Get all incomplete stories from the PRD, sorted by priority.",
|
|
101
|
+
inputSchema: z.object({}),
|
|
102
|
+
handler: async (_params, ctx) => {
|
|
103
|
+
try {
|
|
104
|
+
const stories = ctx.ralphManager.getIncompleteStories();
|
|
105
|
+
if (stories.length === 0) {
|
|
106
|
+
return {
|
|
107
|
+
content: [{ type: "text", text: "No incomplete stories found. All done!" }],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
content: [{ type: "text", text: JSON.stringify(stories, null, 2) }],
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
return {
|
|
116
|
+
content: [{ type: "text", text: `Error getting incomplete stories: ${error instanceof Error ? error.message : String(error)}` }],
|
|
117
|
+
isError: true,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
export const claimStory = defineTool({
|
|
123
|
+
name: "claim_story",
|
|
124
|
+
category: "prd",
|
|
125
|
+
description: "Claim a story and notify other agents",
|
|
126
|
+
fullDescription: "Claim a story to work on and notify other agents via chat. Combines getting next story and posting STORY_CLAIMED message.",
|
|
127
|
+
inputSchema: z.object({
|
|
128
|
+
agent: z.string().describe("Your agent name (e.g., 'Claude', 'Codex', 'Gemini')"),
|
|
129
|
+
storyId: z.string().optional().describe("Specific story ID to claim (optional - defaults to next available)"),
|
|
130
|
+
}),
|
|
131
|
+
handler: async ({ agent, storyId }, ctx) => {
|
|
132
|
+
try {
|
|
133
|
+
let story;
|
|
134
|
+
if (storyId) {
|
|
135
|
+
const prd = ctx.ralphManager.readPRD();
|
|
136
|
+
story = prd?.userStories.find((s) => s.id === storyId && !s.passes);
|
|
137
|
+
if (!story) {
|
|
138
|
+
return {
|
|
139
|
+
content: [{ type: "text", text: `Story ${storyId} not found or already complete.` }],
|
|
140
|
+
isError: true,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
story = ctx.ralphManager.getNextStory();
|
|
146
|
+
}
|
|
147
|
+
if (!story) {
|
|
148
|
+
return {
|
|
149
|
+
content: [{ type: "text", text: "<promise>COMPLETE</promise>\nAll stories are complete!" }],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
// Assign in workflow state (atomic operation to prevent race conditions)
|
|
153
|
+
const assignResult = await ctx.workflowManager.assignStory(story.id, agent);
|
|
154
|
+
if (!assignResult.success) {
|
|
155
|
+
return {
|
|
156
|
+
content: [{
|
|
157
|
+
type: "text",
|
|
158
|
+
text: assignResult.existingAgent
|
|
159
|
+
? `Story ${story.id} is already being worked on by ${assignResult.existingAgent}.`
|
|
160
|
+
: assignResult.error || `Failed to assign story ${story.id} - it may have been claimed by another agent.`,
|
|
161
|
+
}],
|
|
162
|
+
isError: true,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
// Post claim message to chat
|
|
166
|
+
await ctx.chatManager.writeMessage({
|
|
167
|
+
agent,
|
|
168
|
+
type: "STORY_CLAIMED",
|
|
169
|
+
content: `Claiming story: ${story.id} - ${story.title}\n\nDescription: ${story.description}\n\nAcceptance Criteria:\n${story.acceptanceCriteria.map((c) => `- ${c}`).join("\n")}`,
|
|
170
|
+
});
|
|
171
|
+
return {
|
|
172
|
+
content: [{ type: "text", text: `Claimed story ${story.id}: ${story.title}\n\n${JSON.stringify(story, null, 2)}` }],
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
return {
|
|
177
|
+
content: [{ type: "text", text: `Error claiming story: ${error instanceof Error ? error.message : String(error)}` }],
|
|
178
|
+
isError: true,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
export const completeStory = defineTool({
|
|
184
|
+
name: "complete_story",
|
|
185
|
+
category: "prd",
|
|
186
|
+
description: "Mark story complete and notify via chat",
|
|
187
|
+
fullDescription: "Mark a story complete and notify other agents via chat. Combines marking complete and posting STORY_COMPLETE message.",
|
|
188
|
+
inputSchema: z.object({
|
|
189
|
+
agent: z.string().describe("Your agent name"),
|
|
190
|
+
storyId: z.string().describe("The story ID to mark complete"),
|
|
191
|
+
summary: z.string().describe("Brief summary of what was implemented"),
|
|
192
|
+
filesModified: z.array(z.string()).optional().describe("List of files modified"),
|
|
193
|
+
learnings: z.string().optional().describe("Learnings/gotchas for future iterations"),
|
|
194
|
+
}),
|
|
195
|
+
handler: async ({ agent, storyId, summary, filesModified, learnings }, ctx) => {
|
|
196
|
+
try {
|
|
197
|
+
// Validate that this agent owns the story assignment
|
|
198
|
+
const isOwner = ctx.workflowManager.isAgentOwner(storyId, agent);
|
|
199
|
+
const existingAssignment = ctx.workflowManager.isStoryAssigned(storyId);
|
|
200
|
+
if (existingAssignment && !isOwner) {
|
|
201
|
+
return {
|
|
202
|
+
content: [{ type: "text", text: `Cannot complete story ${storyId} - it is assigned to ${existingAssignment.agent}, not ${agent}.` }],
|
|
203
|
+
isError: true,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
const story = ctx.ralphManager.markStoryComplete(storyId, summary);
|
|
207
|
+
if (!story) {
|
|
208
|
+
return {
|
|
209
|
+
content: [{ type: "text", text: `Story ${storyId} not found.` }],
|
|
210
|
+
isError: true,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
// Mark assignment as completed in workflow state
|
|
214
|
+
await ctx.workflowManager.completeAssignment(storyId);
|
|
215
|
+
// Build progress entry
|
|
216
|
+
let progressEntry = `Story: ${storyId} - ${story.title}\nAgent: ${agent}\n\n${summary}`;
|
|
217
|
+
if (filesModified && filesModified.length > 0) {
|
|
218
|
+
progressEntry += `\n\nFiles Modified:\n${filesModified.map((f) => `- ${f}`).join("\n")}`;
|
|
219
|
+
}
|
|
220
|
+
if (learnings) {
|
|
221
|
+
progressEntry += `\n\n**Learnings for future iterations:**\n${learnings}`;
|
|
222
|
+
}
|
|
223
|
+
// Append to progress file
|
|
224
|
+
ctx.ralphManager.appendProgress(progressEntry);
|
|
225
|
+
// Post completion message to chat
|
|
226
|
+
let chatContent = `Completed: ${storyId} - ${story.title}\n\n${summary}`;
|
|
227
|
+
if (filesModified && filesModified.length > 0) {
|
|
228
|
+
chatContent += `\n\nFiles: ${filesModified.join(", ")}`;
|
|
229
|
+
}
|
|
230
|
+
await ctx.chatManager.writeMessage({
|
|
231
|
+
agent,
|
|
232
|
+
type: "STORY_COMPLETE",
|
|
233
|
+
content: chatContent,
|
|
234
|
+
});
|
|
235
|
+
// Auto-create savepoint
|
|
236
|
+
const savepoint = ctx.ralphManager.createSavepoint(storyId, `Completed: ${storyId} - ${story.title}`);
|
|
237
|
+
const prdSummary = ctx.ralphManager.getCompletionSummary();
|
|
238
|
+
const allWorkDone = ctx.ralphManager.isAllWorkComplete();
|
|
239
|
+
// If all work is done, notify READY_TO_TEST
|
|
240
|
+
if (allWorkDone) {
|
|
241
|
+
await ctx.chatManager.writeMessage({
|
|
242
|
+
agent: "NightShift",
|
|
243
|
+
type: "READY_TO_TEST",
|
|
244
|
+
content: `All stories and bugs complete!\n\nStories: ${prdSummary.complete}/${prdSummary.total}\n\nReady for human review and testing.`,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
let response = `Story ${storyId} completed!\n\nProgress: ${prdSummary.complete}/${prdSummary.total} (${prdSummary.percentComplete}%)`;
|
|
248
|
+
if (savepoint.success) {
|
|
249
|
+
response += `\nSavepoint: ${savepoint.tag}`;
|
|
250
|
+
}
|
|
251
|
+
if (allWorkDone) {
|
|
252
|
+
response += "\n\n<promise>COMPLETE</promise>\nAll work complete! Ready to test.";
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
content: [{ type: "text", text: response }],
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
return {
|
|
260
|
+
content: [{ type: "text", text: `Error completing story: ${error instanceof Error ? error.message : String(error)}` }],
|
|
261
|
+
isError: true,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
// Export all PRD tools as an array
|
|
267
|
+
export const prdTools = [
|
|
268
|
+
readPrd,
|
|
269
|
+
getNextStory,
|
|
270
|
+
markStoryComplete,
|
|
271
|
+
getIncompleteStories,
|
|
272
|
+
claimStory,
|
|
273
|
+
completeStory,
|
|
274
|
+
];
|
|
275
|
+
//# sourceMappingURL=prd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prd.js","sourceRoot":"","sources":["../../src/tools/prd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAqC,MAAM,qBAAqB,CAAC;AAEpF,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;IAChC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,qCAAqC;IAClD,eAAe,EAAE,gIAAgI;IACjJ,WAAW,E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AAO;IACP,YAAY;IACZ,iBAAiB;IACjB,oBAAoB;IACpB,UAAU;IACV,aAAa;CACd,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const readProgress: import("../tool-registry.js").ToolDefinition;
|
|
2
|
+
export declare const appendProgress: import("../tool-registry.js").ToolDefinition;
|
|
3
|
+
export declare const addCodebasePattern: import("../tool-registry.js").ToolDefinition;
|
|
4
|
+
export declare const progressTools: import("../tool-registry.js").ToolDefinition[];
|
|
5
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/tools/progress.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,8CA0BvB,CAAC;AAEH,eAAO,MAAM,cAAc,8CAsBzB,CAAC;AAEH,eAAO,MAAM,kBAAkB,8CAsB7B,CAAC;AAGH,eAAO,MAAM,aAAa,gDAIzB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineTool } from "../tool-registry.js";
|
|
3
|
+
export const readProgress = defineTool({
|
|
4
|
+
name: "read_progress",
|
|
5
|
+
category: "progress",
|
|
6
|
+
description: "Read progress.txt with learnings and patterns",
|
|
7
|
+
fullDescription: "Read the progress.txt file containing learnings and patterns from previous iterations.",
|
|
8
|
+
inputSchema: z.object({}),
|
|
9
|
+
handler: async (_params, ctx) => {
|
|
10
|
+
try {
|
|
11
|
+
const content = ctx.ralphManager.readProgress();
|
|
12
|
+
if (!content) {
|
|
13
|
+
return {
|
|
14
|
+
content: [{ type: "text", text: "No progress.txt found. One will be created when you append progress." }],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
content: [{ type: "text", text: content }],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return {
|
|
23
|
+
content: [{ type: "text", text: `Error reading progress: ${error instanceof Error ? error.message : String(error)}` }],
|
|
24
|
+
isError: true,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
export const appendProgress = defineTool({
|
|
30
|
+
name: "append_progress",
|
|
31
|
+
category: "progress",
|
|
32
|
+
description: "Append a progress entry to progress.txt",
|
|
33
|
+
fullDescription: "Append a progress entry to progress.txt. Include what was implemented, files changed, and learnings for future iterations.",
|
|
34
|
+
inputSchema: z.object({
|
|
35
|
+
content: z.string().describe("Progress entry content including: what was implemented, files changed, learnings/gotchas discovered"),
|
|
36
|
+
}),
|
|
37
|
+
handler: async ({ content }, ctx) => {
|
|
38
|
+
try {
|
|
39
|
+
ctx.ralphManager.appendProgress(content);
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: "text", text: "Progress entry added successfully." }],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
return {
|
|
46
|
+
content: [{ type: "text", text: `Error appending progress: ${error instanceof Error ? error.message : String(error)}` }],
|
|
47
|
+
isError: true,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
export const addCodebasePattern = defineTool({
|
|
53
|
+
name: "add_codebase_pattern",
|
|
54
|
+
category: "progress",
|
|
55
|
+
description: "Add a reusable pattern to progress.txt",
|
|
56
|
+
fullDescription: "Add a reusable pattern to the Codebase Patterns section of progress.txt. Use for general patterns future iterations should know.",
|
|
57
|
+
inputSchema: z.object({
|
|
58
|
+
pattern: z.string().describe("A reusable pattern (e.g., 'Use sql<number> template for aggregations')"),
|
|
59
|
+
}),
|
|
60
|
+
handler: async ({ pattern }, ctx) => {
|
|
61
|
+
try {
|
|
62
|
+
ctx.ralphManager.addCodebasePattern(pattern);
|
|
63
|
+
return {
|
|
64
|
+
content: [{ type: "text", text: `Pattern added: ${pattern}` }],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
return {
|
|
69
|
+
content: [{ type: "text", text: `Error adding pattern: ${error instanceof Error ? error.message : String(error)}` }],
|
|
70
|
+
isError: true,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
// Export all progress tools as an array
|
|
76
|
+
export const progressTools = [
|
|
77
|
+
readProgress,
|
|
78
|
+
appendProgress,
|
|
79
|
+
addCodebasePattern,
|
|
80
|
+
];
|
|
81
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/tools/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAqC,MAAM,qBAAqB,CAAC;AAEpF,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACrC,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,+CAA+C;IAC5D,eAAe,EAAE,wFAAwF;IACzG,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAgB,EAAuB,EAAE;QAChE,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;YAEhD,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,sEAAsE,EAAE,CAAC;iBAC1G,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;aAC3C,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,E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AkI;IACnJ,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wEAAwE,CAAC;KACvG,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,GAAgB,EAAuB,EAAE;QACpE,IAAI,CAAC;YACH,GAAG,CAAC,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;YAE7C,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,OAAO,EAAE,EAAE,CAAC;aAC/D,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBACpH,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,wCAAwC;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY;IACZ,cAAc;IACd,kBAAkB;CACnB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const createSavepoint: import("../tool-registry.js").ToolDefinition;
|
|
2
|
+
export declare const listSavepoints: import("../tool-registry.js").ToolDefinition;
|
|
3
|
+
export declare const rollbackSavepoint: import("../tool-registry.js").ToolDefinition;
|
|
4
|
+
export declare const savepointTools: import("../tool-registry.js").ToolDefinition[];
|
|
5
|
+
//# sourceMappingURL=savepoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"savepoints.d.ts","sourceRoot":"","sources":["../../src/tools/savepoints.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,8CA8B1B,CAAC;AAEH,eAAO,MAAM,cAAc,8CA0BzB,CAAC;AAEH,eAAO,MAAM,iBAAiB,8CAoC5B,CAAC;AAGH,eAAO,MAAM,cAAc,gDAI1B,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineTool } from "../tool-registry.js";
|
|
3
|
+
export const createSavepoint = defineTool({
|
|
4
|
+
name: "create_savepoint",
|
|
5
|
+
category: "savepoints",
|
|
6
|
+
description: "Create a manual savepoint (git commit + tag)",
|
|
7
|
+
fullDescription: "Create a manual savepoint (git commit + tag). Use for checkpoints during work.",
|
|
8
|
+
inputSchema: z.object({
|
|
9
|
+
label: z.string().describe("Label for the savepoint (e.g., 'auth-working', 'pre-refactor')"),
|
|
10
|
+
message: z.string().optional().describe("Optional commit message"),
|
|
11
|
+
}),
|
|
12
|
+
handler: async ({ label, message }, ctx) => {
|
|
13
|
+
try {
|
|
14
|
+
const result = ctx.ralphManager.createSavepoint(label, message);
|
|
15
|
+
if (!result.success) {
|
|
16
|
+
return {
|
|
17
|
+
content: [{ type: "text", text: `Failed to create savepoint: ${result.error}` }],
|
|
18
|
+
isError: true,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
content: [{ type: "text", text: `Savepoint created: ${result.tag}\n\nRollback with: rollback_savepoint("${label}")` }],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
return {
|
|
27
|
+
content: [{ type: "text", text: `Error creating savepoint: ${error instanceof Error ? error.message : String(error)}` }],
|
|
28
|
+
isError: true,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
export const listSavepoints = defineTool({
|
|
34
|
+
name: "list_savepoints",
|
|
35
|
+
category: "savepoints",
|
|
36
|
+
description: "List all savepoints (git tags)",
|
|
37
|
+
fullDescription: "List all savepoints (git tags with savepoint/ prefix).",
|
|
38
|
+
inputSchema: z.object({}),
|
|
39
|
+
handler: async (_params, ctx) => {
|
|
40
|
+
try {
|
|
41
|
+
const savepoints = ctx.ralphManager.listSavepoints();
|
|
42
|
+
if (savepoints.length === 0) {
|
|
43
|
+
return {
|
|
44
|
+
content: [{ type: "text", text: "No savepoints found." }],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
content: [{ type: "text", text: `Savepoints:\n${savepoints.map((s) => ` - ${s}`).join("\n")}` }],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return {
|
|
53
|
+
content: [{ type: "text", text: `Error listing savepoints: ${error instanceof Error ? error.message : String(error)}` }],
|
|
54
|
+
isError: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
export const rollbackSavepoint = defineTool({
|
|
60
|
+
name: "rollback_savepoint",
|
|
61
|
+
category: "savepoints",
|
|
62
|
+
description: "Rollback to a previous savepoint",
|
|
63
|
+
fullDescription: "Rollback to a previous savepoint. WARNING: This discards all changes after the savepoint.",
|
|
64
|
+
inputSchema: z.object({
|
|
65
|
+
label: z.string().describe("Savepoint label to rollback to (e.g., 'US-001' or 'auth-working')"),
|
|
66
|
+
}),
|
|
67
|
+
handler: async ({ label }, ctx) => {
|
|
68
|
+
try {
|
|
69
|
+
const result = ctx.ralphManager.rollbackToSavepoint(label);
|
|
70
|
+
if (!result.success) {
|
|
71
|
+
return {
|
|
72
|
+
content: [{ type: "text", text: `Failed to rollback: ${result.error}` }],
|
|
73
|
+
isError: true,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// Notify via chat
|
|
77
|
+
await ctx.chatManager.writeMessage({
|
|
78
|
+
agent: "NightShift",
|
|
79
|
+
type: "INFO",
|
|
80
|
+
content: `Rolled back to savepoint: ${label}`,
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
content: [{ type: "text", text: `Rolled back to savepoint/${label}\n\nAll changes after this point have been discarded.` }],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
return {
|
|
88
|
+
content: [{ type: "text", text: `Error rolling back: ${error instanceof Error ? error.message : String(error)}` }],
|
|
89
|
+
isError: true,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
// Export all savepoint tools as an array
|
|
95
|
+
export const savepointTools = [
|
|
96
|
+
createSavepoint,
|
|
97
|
+
listSavepoints,
|
|
98
|
+
rollbackSavepoint,
|
|
99
|
+
];
|
|
100
|
+
//# sourceMappingURL=savepoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"savepoints.js","sourceRoot":"","sources":["../../src/tools/savepoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAqC,MAAM,qBAAqB,CAAC;AAEpF,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,8CAA8C;IAC3D,eAAe,EAAE,gFAAgF;IACjG,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gEAAgE,CAAC;QAC5F,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KACnE,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAgB,EAAuB,EAAE;QAC3E,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAEhE,IAAI,CAAC,MAAM,CAAC,OAAO,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AY,CAAC;gBACjC,KAAK,EAAE,YAAY;gBACnB,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,6BAA6B,KAAK,EAAE;aAC9C,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,KAAK,uDAAuD,EAAE,CAAC;aAC5H,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBAClH,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,yCAAyC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,cAAc;IACd,iBAAiB;CAClB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const nightshiftSetup: import("../tool-registry.js").ToolDefinition;
|
|
2
|
+
export declare const nightshiftDebug: import("../tool-registry.js").ToolDefinition;
|
|
3
|
+
export declare const utilityTools: import("../tool-registry.js").ToolDefinition[];
|
|
4
|
+
//# sourceMappingURL=utility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/tools/utility.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,8CA+J1B,CAAC;AAEH,eAAO,MAAM,eAAe,8CA+M1B,CAAC;AAGH,eAAO,MAAM,YAAY,gDAGxB,CAAC"}
|