mcp-task-server 0.1.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 +317 -0
- package/dist/agents.d.ts +25 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +93 -0
- package/dist/agents.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +28 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +38 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +70 -0
- package/dist/context.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +400 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts.d.ts +22 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +259 -0
- package/dist/prompts.js.map +1 -0
- package/dist/storage.d.ts +26 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +293 -0
- package/dist/storage.js.map +1 -0
- package/dist/templates.d.ts +18 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +441 -0
- package/dist/templates.js.map +1 -0
- package/dist/tools.d.ts +401 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +732 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +42 -0
package/dist/prompts.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { getWritingPreferences, getUserIdentity, getWorkflowPreferences, getAllMemoriesForPrompt, } from "./context.js";
|
|
2
|
+
/**
|
|
3
|
+
* Build a user context section for prompts if shared context is available
|
|
4
|
+
*/
|
|
5
|
+
function buildUserContextSection() {
|
|
6
|
+
const sections = [];
|
|
7
|
+
const identity = getUserIdentity();
|
|
8
|
+
if (identity) {
|
|
9
|
+
sections.push(`**User Context**: ${identity}`);
|
|
10
|
+
}
|
|
11
|
+
const writing = getWritingPreferences();
|
|
12
|
+
if (writing) {
|
|
13
|
+
sections.push(`**Writing Preferences**: ${writing}`);
|
|
14
|
+
}
|
|
15
|
+
const workflow = getWorkflowPreferences();
|
|
16
|
+
if (workflow) {
|
|
17
|
+
sections.push(`**Workflow Preferences**: ${workflow}`);
|
|
18
|
+
}
|
|
19
|
+
if (sections.length === 0)
|
|
20
|
+
return "";
|
|
21
|
+
return `\n## User Preferences\n${sections.join("\n\n")}\n`;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Generate a prompt for expanding a task into subtasks
|
|
25
|
+
*/
|
|
26
|
+
export function expandTaskPrompt(task) {
|
|
27
|
+
const userContext = buildUserContextSection();
|
|
28
|
+
return {
|
|
29
|
+
action: "expand",
|
|
30
|
+
task_id: task.id,
|
|
31
|
+
prompt: `Break down the following task into 3-7 actionable subtasks.
|
|
32
|
+
|
|
33
|
+
## Task
|
|
34
|
+
**ID**: ${task.id}
|
|
35
|
+
**Title**: ${task.title}
|
|
36
|
+
${task.description ? `**Description**: ${task.description}\n` : ""}**Priority**: ${task.priority}
|
|
37
|
+
${userContext}
|
|
38
|
+
## Instructions
|
|
39
|
+
1. Analyze the task and identify the key steps needed to complete it
|
|
40
|
+
2. Create 3-7 subtasks that are:
|
|
41
|
+
- Specific and actionable
|
|
42
|
+
- Small enough to complete in one session
|
|
43
|
+
- Ordered by dependency (what must be done first)
|
|
44
|
+
3. For each subtask, provide:
|
|
45
|
+
- A clear, concise description
|
|
46
|
+
- Any dependencies on other subtasks
|
|
47
|
+
|
|
48
|
+
## Response Format
|
|
49
|
+
After analyzing, call \`add_subtask\` for each subtask you identify, in order.
|
|
50
|
+
|
|
51
|
+
Example:
|
|
52
|
+
- add_subtask({ parent_id: "${task.id}", title: "First step description" })
|
|
53
|
+
- add_subtask({ parent_id: "${task.id}", title: "Second step description", dependencies: [1] })
|
|
54
|
+
`,
|
|
55
|
+
context: {
|
|
56
|
+
task_id: task.id,
|
|
57
|
+
task_title: task.title,
|
|
58
|
+
task_priority: task.priority,
|
|
59
|
+
},
|
|
60
|
+
callback: "add_subtask",
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Generate a prompt for parsing a PRD into tasks
|
|
65
|
+
*/
|
|
66
|
+
export function parsePrdPrompt(prdContent) {
|
|
67
|
+
const userContext = buildUserContextSection();
|
|
68
|
+
return {
|
|
69
|
+
action: "parse_prd",
|
|
70
|
+
prompt: `Parse the following PRD (Product Requirements Document) into actionable tasks.
|
|
71
|
+
|
|
72
|
+
## PRD Content
|
|
73
|
+
${prdContent}
|
|
74
|
+
${userContext}
|
|
75
|
+
## Instructions
|
|
76
|
+
1. Read through the entire PRD
|
|
77
|
+
2. Identify distinct features, requirements, and deliverables
|
|
78
|
+
3. Create a task for each major item
|
|
79
|
+
4. Set appropriate priorities based on:
|
|
80
|
+
- Critical: Core functionality, blocking other work
|
|
81
|
+
- High: Important features, should be done early
|
|
82
|
+
- Medium: Standard features
|
|
83
|
+
- Low: Nice-to-have, can be deferred
|
|
84
|
+
5. Identify dependencies between tasks
|
|
85
|
+
|
|
86
|
+
## Response Format
|
|
87
|
+
After analyzing, call \`add_task\` for each task you identify.
|
|
88
|
+
|
|
89
|
+
Example:
|
|
90
|
+
- add_task({ title: "Implement user authentication", priority: "critical" })
|
|
91
|
+
- add_task({ title: "Build dashboard UI", priority: "high", dependencies: ["<auth_task_id>"] })
|
|
92
|
+
`,
|
|
93
|
+
context: {
|
|
94
|
+
prd_length: prdContent.length,
|
|
95
|
+
},
|
|
96
|
+
callback: "add_task",
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Generate a prompt for researching a task
|
|
101
|
+
*/
|
|
102
|
+
export function researchTaskPrompt(task, topic) {
|
|
103
|
+
const researchTopic = topic || task.title;
|
|
104
|
+
const userContext = buildUserContextSection();
|
|
105
|
+
return {
|
|
106
|
+
action: "research",
|
|
107
|
+
task_id: task.id,
|
|
108
|
+
prompt: `Research the following topic to inform task implementation.
|
|
109
|
+
|
|
110
|
+
## Task Context
|
|
111
|
+
**ID**: ${task.id}
|
|
112
|
+
**Title**: ${task.title}
|
|
113
|
+
${task.description ? `**Description**: ${task.description}\n` : ""}
|
|
114
|
+
## Research Topic
|
|
115
|
+
${researchTopic}
|
|
116
|
+
${userContext}
|
|
117
|
+
## Instructions
|
|
118
|
+
1. Identify key technical decisions needed
|
|
119
|
+
2. Research best practices and common patterns
|
|
120
|
+
3. Note any potential challenges or risks
|
|
121
|
+
4. Suggest implementation approaches
|
|
122
|
+
|
|
123
|
+
## Response Format
|
|
124
|
+
Provide your findings, then update the task with relevant notes:
|
|
125
|
+
- update_task({ task_id: "${task.id}", metadata: { research_notes: "..." } })
|
|
126
|
+
|
|
127
|
+
If you discover additional subtasks, add them:
|
|
128
|
+
- add_subtask({ parent_id: "${task.id}", title: "..." })
|
|
129
|
+
`,
|
|
130
|
+
context: {
|
|
131
|
+
task_id: task.id,
|
|
132
|
+
task_title: task.title,
|
|
133
|
+
research_topic: researchTopic,
|
|
134
|
+
},
|
|
135
|
+
callback: "update_task",
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Generate a prompt for analyzing task complexity
|
|
140
|
+
*/
|
|
141
|
+
export function analyzeComplexityPrompt(task) {
|
|
142
|
+
const userContext = buildUserContextSection();
|
|
143
|
+
return {
|
|
144
|
+
action: "analyze_complexity",
|
|
145
|
+
task_id: task.id,
|
|
146
|
+
prompt: `Analyze the complexity of the following task.
|
|
147
|
+
|
|
148
|
+
## Task
|
|
149
|
+
**ID**: ${task.id}
|
|
150
|
+
**Title**: ${task.title}
|
|
151
|
+
${task.description ? `**Description**: ${task.description}\n` : ""}**Priority**: ${task.priority}
|
|
152
|
+
${userContext}
|
|
153
|
+
## Analysis Criteria
|
|
154
|
+
1. **Effort**: Estimate time needed (hours/days)
|
|
155
|
+
2. **Technical Risk**: Unknown technologies, integration complexity
|
|
156
|
+
3. **Dependencies**: External services, other teams, blocking tasks
|
|
157
|
+
4. **Uncertainty**: How well-defined are the requirements?
|
|
158
|
+
|
|
159
|
+
## Scoring
|
|
160
|
+
Rate each criterion from 1-5:
|
|
161
|
+
- 1: Trivial
|
|
162
|
+
- 2: Low
|
|
163
|
+
- 3: Medium
|
|
164
|
+
- 4: High
|
|
165
|
+
- 5: Very High
|
|
166
|
+
|
|
167
|
+
## Response Format
|
|
168
|
+
Provide your analysis, then update the task with complexity metadata:
|
|
169
|
+
- update_task({
|
|
170
|
+
task_id: "${task.id}",
|
|
171
|
+
metadata: {
|
|
172
|
+
complexity: {
|
|
173
|
+
effort: <1-5>,
|
|
174
|
+
technical_risk: <1-5>,
|
|
175
|
+
dependencies: <1-5>,
|
|
176
|
+
uncertainty: <1-5>,
|
|
177
|
+
overall: <1-5>,
|
|
178
|
+
notes: "..."
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
If the task is too complex, recommend breaking it down:
|
|
184
|
+
- expand_task({ task_id: "${task.id}" })
|
|
185
|
+
`,
|
|
186
|
+
context: {
|
|
187
|
+
task_id: task.id,
|
|
188
|
+
task_title: task.title,
|
|
189
|
+
},
|
|
190
|
+
callback: "update_task",
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Generate a prompt for checking compliance against user preferences
|
|
195
|
+
*/
|
|
196
|
+
export function checkCompliancePrompt(path, content, fix) {
|
|
197
|
+
const allMemories = getAllMemoriesForPrompt();
|
|
198
|
+
if (!allMemories) {
|
|
199
|
+
return {
|
|
200
|
+
action: "check_compliance",
|
|
201
|
+
prompt: `No shared context found. Create ~/.cursor/shared-context.json with your preferences to use compliance checking.
|
|
202
|
+
|
|
203
|
+
See: https://github.com/yourusername/mcp-task-server/blob/main/docs/SHARED_CONTEXT.md`,
|
|
204
|
+
context: { path },
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
const fixInstructions = fix
|
|
208
|
+
? `
|
|
209
|
+
|
|
210
|
+
## Fix Mode
|
|
211
|
+
You are in FIX mode. After identifying issues:
|
|
212
|
+
1. Edit the file(s) to fix each compliance issue
|
|
213
|
+
2. Preserve the original meaning and intent
|
|
214
|
+
3. Report what was changed`
|
|
215
|
+
: `
|
|
216
|
+
|
|
217
|
+
## Review Mode
|
|
218
|
+
You are in REVIEW mode. Report findings but do not make changes.`;
|
|
219
|
+
return {
|
|
220
|
+
action: "check_compliance",
|
|
221
|
+
prompt: `Check the following content for compliance with user preferences.
|
|
222
|
+
|
|
223
|
+
## Path
|
|
224
|
+
${path}
|
|
225
|
+
|
|
226
|
+
## Content to Check
|
|
227
|
+
\`\`\`
|
|
228
|
+
${content}
|
|
229
|
+
\`\`\`
|
|
230
|
+
|
|
231
|
+
## User Preferences
|
|
232
|
+
${allMemories}
|
|
233
|
+
${fixInstructions}
|
|
234
|
+
|
|
235
|
+
## Compliance Checklist
|
|
236
|
+
Review against these categories:
|
|
237
|
+
1. **Writing Style**: Tone, voice, formality level
|
|
238
|
+
2. **Language**: British/American English, terminology
|
|
239
|
+
3. **Formatting**: Dates, numbers, units, punctuation
|
|
240
|
+
4. **Conventions**: Emojis, markdown style, structure
|
|
241
|
+
5. **Values**: Alignment with stated principles
|
|
242
|
+
|
|
243
|
+
## Response Format
|
|
244
|
+
For each issue found:
|
|
245
|
+
- **Location**: Line or section
|
|
246
|
+
- **Issue**: What doesn't comply
|
|
247
|
+
- **Preference**: The relevant preference
|
|
248
|
+
- **Suggestion**: How to fix it
|
|
249
|
+
|
|
250
|
+
If fully compliant, state: "Content complies with all preferences."
|
|
251
|
+
`,
|
|
252
|
+
context: {
|
|
253
|
+
path,
|
|
254
|
+
content_length: content.length,
|
|
255
|
+
fix_mode: fix,
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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 -0,0 +1,26 @@
|
|
|
1
|
+
import { Config, Task, TaskStore, Subtask } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Load tasks from JSON storage
|
|
4
|
+
*/
|
|
5
|
+
export declare function loadTasks(config: Config): Promise<TaskStore>;
|
|
6
|
+
/**
|
|
7
|
+
* Save tasks to JSON storage, individual task files, and sync to markdown
|
|
8
|
+
*/
|
|
9
|
+
export declare function saveTasks(config: Config, store: TaskStore): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Generate a unique task ID
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateId(store: TaskStore): string;
|
|
14
|
+
/**
|
|
15
|
+
* Find a task by ID
|
|
16
|
+
*/
|
|
17
|
+
export declare function findTask(store: TaskStore, id: string): Task | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Update a task in the store
|
|
20
|
+
*/
|
|
21
|
+
export declare function updateTask(store: TaskStore, id: string, updates: Partial<Task>): Task | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Add a subtask to a task
|
|
24
|
+
*/
|
|
25
|
+
export declare function addSubtaskToTask(task: Task, subtask: Omit<Subtask, "id">): Subtask;
|
|
26
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA2D9D;;GAEG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAgBlE;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,IAAI,CAAC,CAiBf;AAwND;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAMnD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAEvE;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,EAChB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GACrB,IAAI,GAAG,SAAS,CAMlB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAC3B,OAAO,CAaT"}
|
package/dist/storage.js
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { readFile, writeFile, mkdir } from "fs/promises";
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import { dirname } from "path";
|
|
4
|
+
import { resolvePath, getTaskFilePath } from "./config.js";
|
|
5
|
+
const CURRENT_VERSION = "2.0.0";
|
|
6
|
+
const OLD_JSON_PATH = ".taskmaster/tasks.json";
|
|
7
|
+
/**
|
|
8
|
+
* Create an empty task store
|
|
9
|
+
*/
|
|
10
|
+
function createEmptyStore() {
|
|
11
|
+
return {
|
|
12
|
+
version: CURRENT_VERSION,
|
|
13
|
+
tasks: [],
|
|
14
|
+
agents: [],
|
|
15
|
+
updated_at: new Date().toISOString(),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Ensure directory exists for a file path
|
|
20
|
+
*/
|
|
21
|
+
async function ensureDir(filePath) {
|
|
22
|
+
const dir = dirname(filePath);
|
|
23
|
+
if (!existsSync(dir)) {
|
|
24
|
+
await mkdir(dir, { recursive: true });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check for and migrate old .taskmaster location
|
|
29
|
+
*/
|
|
30
|
+
async function migrateOldLocation(config) {
|
|
31
|
+
const oldPath = resolvePath(config, OLD_JSON_PATH);
|
|
32
|
+
const newPath = resolvePath(config, config.jsonPath);
|
|
33
|
+
if (existsSync(oldPath) && !existsSync(newPath)) {
|
|
34
|
+
try {
|
|
35
|
+
const content = await readFile(oldPath, "utf-8");
|
|
36
|
+
const oldStore = JSON.parse(content);
|
|
37
|
+
// Ensure new directory exists
|
|
38
|
+
await ensureDir(newPath);
|
|
39
|
+
// Save to new location
|
|
40
|
+
await writeFile(newPath, JSON.stringify(oldStore, null, 2), "utf-8");
|
|
41
|
+
// Generate task files for existing tasks
|
|
42
|
+
for (const task of oldStore.tasks) {
|
|
43
|
+
await saveTaskFile(config, task);
|
|
44
|
+
}
|
|
45
|
+
return oldStore;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Load tasks from JSON storage
|
|
55
|
+
*/
|
|
56
|
+
export async function loadTasks(config) {
|
|
57
|
+
// Try migration first
|
|
58
|
+
const migrated = await migrateOldLocation(config);
|
|
59
|
+
if (migrated) {
|
|
60
|
+
return migrated;
|
|
61
|
+
}
|
|
62
|
+
const jsonPath = resolvePath(config, config.jsonPath);
|
|
63
|
+
try {
|
|
64
|
+
const content = await readFile(jsonPath, "utf-8");
|
|
65
|
+
return JSON.parse(content);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// File doesn't exist or is invalid, return empty store
|
|
69
|
+
return createEmptyStore();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Save tasks to JSON storage, individual task files, and sync to markdown
|
|
74
|
+
*/
|
|
75
|
+
export async function saveTasks(config, store) {
|
|
76
|
+
store.updated_at = new Date().toISOString();
|
|
77
|
+
store.version = CURRENT_VERSION;
|
|
78
|
+
// Save JSON registry
|
|
79
|
+
const jsonPath = resolvePath(config, config.jsonPath);
|
|
80
|
+
await ensureDir(jsonPath);
|
|
81
|
+
await writeFile(jsonPath, JSON.stringify(store, null, 2), "utf-8");
|
|
82
|
+
// Save individual task files (only for top-level tasks)
|
|
83
|
+
const topLevelTasks = store.tasks.filter((t) => !t.parent_id);
|
|
84
|
+
for (const task of topLevelTasks) {
|
|
85
|
+
await saveTaskFile(config, task);
|
|
86
|
+
}
|
|
87
|
+
// Sync to markdown summary
|
|
88
|
+
await syncToMarkdown(config, store);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Generate task file content (human-readable format)
|
|
92
|
+
*/
|
|
93
|
+
function generateTaskFileContent(task) {
|
|
94
|
+
const lines = [];
|
|
95
|
+
lines.push(`# Task ID: ${task.id}`);
|
|
96
|
+
lines.push(`# Title: ${task.title}`);
|
|
97
|
+
lines.push(`# Status: ${task.status}`);
|
|
98
|
+
lines.push(`# Dependencies: ${task.dependencies?.length ? task.dependencies.join(", ") : "None"}`);
|
|
99
|
+
lines.push(`# Priority: ${task.priority}`);
|
|
100
|
+
if (task.description) {
|
|
101
|
+
lines.push(`# Description: ${task.description}`);
|
|
102
|
+
}
|
|
103
|
+
if (task.details) {
|
|
104
|
+
lines.push(`# Details:`);
|
|
105
|
+
lines.push(task.details);
|
|
106
|
+
lines.push("");
|
|
107
|
+
}
|
|
108
|
+
if (task.testStrategy) {
|
|
109
|
+
lines.push(`# Test Strategy:`);
|
|
110
|
+
lines.push(task.testStrategy);
|
|
111
|
+
lines.push("");
|
|
112
|
+
}
|
|
113
|
+
if (task.subtasks && task.subtasks.length > 0) {
|
|
114
|
+
lines.push(`# Subtasks:`);
|
|
115
|
+
for (const subtask of task.subtasks) {
|
|
116
|
+
lines.push(formatSubtask(subtask));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return lines.join("\n");
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Format a subtask for the task file
|
|
123
|
+
*/
|
|
124
|
+
function formatSubtask(subtask) {
|
|
125
|
+
const lines = [];
|
|
126
|
+
const statusTag = `[${subtask.status}]`;
|
|
127
|
+
lines.push(`## ${subtask.id}. ${subtask.title} ${statusTag}`);
|
|
128
|
+
if (subtask.dependencies && subtask.dependencies.length > 0) {
|
|
129
|
+
lines.push(`### Dependencies: ${subtask.dependencies.join(", ")}`);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
lines.push(`### Dependencies: None`);
|
|
133
|
+
}
|
|
134
|
+
if (subtask.description) {
|
|
135
|
+
lines.push(`### Description: ${subtask.description}`);
|
|
136
|
+
}
|
|
137
|
+
if (subtask.details) {
|
|
138
|
+
lines.push(`### Details:`);
|
|
139
|
+
lines.push(subtask.details);
|
|
140
|
+
}
|
|
141
|
+
lines.push("");
|
|
142
|
+
return lines.join("\n");
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Save an individual task file
|
|
146
|
+
*/
|
|
147
|
+
async function saveTaskFile(config, task) {
|
|
148
|
+
const filePath = getTaskFilePath(config, task.id);
|
|
149
|
+
await ensureDir(filePath);
|
|
150
|
+
const content = generateTaskFileContent(task);
|
|
151
|
+
await writeFile(filePath, content, "utf-8");
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Generate markdown summary content from task store
|
|
155
|
+
*/
|
|
156
|
+
function generateMarkdown(store) {
|
|
157
|
+
const lines = ["# Implementation Progress", ""];
|
|
158
|
+
// Status header
|
|
159
|
+
lines.push("## Status");
|
|
160
|
+
lines.push(`Last updated: ${store.updated_at}`);
|
|
161
|
+
lines.push("");
|
|
162
|
+
// Get top-level tasks only for summary
|
|
163
|
+
const topLevel = store.tasks.filter((t) => !t.parent_id);
|
|
164
|
+
// Count by status
|
|
165
|
+
const completed = topLevel.filter((t) => t.status === "completed" || t.status === "done");
|
|
166
|
+
const inProgress = topLevel.filter((t) => t.status === "in_progress" || t.status === "claimed");
|
|
167
|
+
const pending = topLevel.filter((t) => t.status === "pending");
|
|
168
|
+
const review = topLevel.filter((t) => t.status === "review" || t.status === "approved");
|
|
169
|
+
const blocked = topLevel.filter((t) => t.status === "rejected" || t.status === "cancelled");
|
|
170
|
+
const total = topLevel.length;
|
|
171
|
+
lines.push("## Task Completion Summary");
|
|
172
|
+
lines.push("");
|
|
173
|
+
// Completed
|
|
174
|
+
if (completed.length > 0) {
|
|
175
|
+
lines.push(`### Completed Tasks (${completed.length}/${total})`);
|
|
176
|
+
for (const task of completed) {
|
|
177
|
+
lines.push(`- ✅ Task ${task.id}: ${task.title}`);
|
|
178
|
+
}
|
|
179
|
+
lines.push("");
|
|
180
|
+
}
|
|
181
|
+
// In Progress
|
|
182
|
+
if (inProgress.length > 0) {
|
|
183
|
+
lines.push(`### In Progress Tasks (${inProgress.length}/${total})`);
|
|
184
|
+
for (const task of inProgress) {
|
|
185
|
+
const subtaskInfo = getSubtaskProgress(task);
|
|
186
|
+
lines.push(`- ⚠️ Task ${task.id}: ${task.title}${subtaskInfo}`);
|
|
187
|
+
}
|
|
188
|
+
lines.push("");
|
|
189
|
+
}
|
|
190
|
+
// In Review
|
|
191
|
+
if (review.length > 0) {
|
|
192
|
+
lines.push(`### In Review (${review.length}/${total})`);
|
|
193
|
+
for (const task of review) {
|
|
194
|
+
lines.push(`- 🔍 Task ${task.id}: ${task.title}`);
|
|
195
|
+
}
|
|
196
|
+
lines.push("");
|
|
197
|
+
}
|
|
198
|
+
// Pending
|
|
199
|
+
if (pending.length > 0) {
|
|
200
|
+
lines.push(`### Pending Tasks (${pending.length}/${total})`);
|
|
201
|
+
for (const task of pending) {
|
|
202
|
+
lines.push(`- ❌ Task ${task.id}: ${task.title}`);
|
|
203
|
+
}
|
|
204
|
+
lines.push("");
|
|
205
|
+
}
|
|
206
|
+
// Blocked/Cancelled
|
|
207
|
+
if (blocked.length > 0) {
|
|
208
|
+
lines.push(`### Blocked/Cancelled (${blocked.length}/${total})`);
|
|
209
|
+
for (const task of blocked) {
|
|
210
|
+
lines.push(`- 🚫 Task ${task.id}: ${task.title} (${task.status})`);
|
|
211
|
+
}
|
|
212
|
+
lines.push("");
|
|
213
|
+
}
|
|
214
|
+
// Recent updates section
|
|
215
|
+
lines.push("## Recent Updates");
|
|
216
|
+
lines.push("");
|
|
217
|
+
// Get last 5 updated tasks
|
|
218
|
+
const recentTasks = [...topLevel]
|
|
219
|
+
.sort((a, b) => new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime())
|
|
220
|
+
.slice(0, 5);
|
|
221
|
+
for (const task of recentTasks) {
|
|
222
|
+
const date = task.updated_at.split("T")[0];
|
|
223
|
+
lines.push(`- ${date}: Task ${task.id} - ${task.title} (${task.status})`);
|
|
224
|
+
}
|
|
225
|
+
lines.push("");
|
|
226
|
+
lines.push("---");
|
|
227
|
+
lines.push("");
|
|
228
|
+
lines.push("*Task details are in `memory_bank/tasks/task_XXX.txt` files.*");
|
|
229
|
+
lines.push("*This summary is auto-generated from `memory_bank/tasks/tasks.json`.*");
|
|
230
|
+
return lines.join("\n");
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Get subtask progress string for a task
|
|
234
|
+
*/
|
|
235
|
+
function getSubtaskProgress(task) {
|
|
236
|
+
if (!task.subtasks || task.subtasks.length === 0) {
|
|
237
|
+
return "";
|
|
238
|
+
}
|
|
239
|
+
const completed = task.subtasks.filter((s) => s.status === "done" || s.status === "completed").length;
|
|
240
|
+
const total = task.subtasks.length;
|
|
241
|
+
return ` (${completed}/${total} subtasks)`;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Sync task store to markdown summary file
|
|
245
|
+
*/
|
|
246
|
+
async function syncToMarkdown(config, store) {
|
|
247
|
+
const mdPath = resolvePath(config, config.markdownPath);
|
|
248
|
+
await ensureDir(mdPath);
|
|
249
|
+
const content = generateMarkdown(store);
|
|
250
|
+
await writeFile(mdPath, content, "utf-8");
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Generate a unique task ID
|
|
254
|
+
*/
|
|
255
|
+
export function generateId(store) {
|
|
256
|
+
const maxId = store.tasks.reduce((max, t) => {
|
|
257
|
+
const num = parseInt(t.id, 10);
|
|
258
|
+
return isNaN(num) ? max : Math.max(max, num);
|
|
259
|
+
}, 0);
|
|
260
|
+
return String(maxId + 1);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Find a task by ID
|
|
264
|
+
*/
|
|
265
|
+
export function findTask(store, id) {
|
|
266
|
+
return store.tasks.find((t) => t.id === id);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Update a task in the store
|
|
270
|
+
*/
|
|
271
|
+
export function updateTask(store, id, updates) {
|
|
272
|
+
const task = findTask(store, id);
|
|
273
|
+
if (!task)
|
|
274
|
+
return undefined;
|
|
275
|
+
Object.assign(task, updates, { updated_at: new Date().toISOString() });
|
|
276
|
+
return task;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Add a subtask to a task
|
|
280
|
+
*/
|
|
281
|
+
export function addSubtaskToTask(task, subtask) {
|
|
282
|
+
if (!task.subtasks) {
|
|
283
|
+
task.subtasks = [];
|
|
284
|
+
}
|
|
285
|
+
const maxId = task.subtasks.reduce((max, s) => Math.max(max, s.id), 0);
|
|
286
|
+
const newSubtask = {
|
|
287
|
+
...subtask,
|
|
288
|
+
id: maxId + 1,
|
|
289
|
+
};
|
|
290
|
+
task.subtasks.push(newSubtask);
|
|
291
|
+
return newSubtask;
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,UAAU,EAAe,MAAM,IAAI,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAQ,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,aAA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AI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,KAAgB,EAChB,EAAU,EACV,OAAsB;IAEtB,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAE5B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACvE,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAU,EACV,OAA4B;IAE5B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,MAAM,UAAU,GAAY;QAC1B,GAAG,OAAO;QACV,EAAE,EAAE,KAAK,GAAG,CAAC;KACd,CAAC;IAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template files for init_project tool
|
|
3
|
+
*
|
|
4
|
+
* All templates use <project> as a placeholder for the project name.
|
|
5
|
+
*/
|
|
6
|
+
export interface TemplateFile {
|
|
7
|
+
path: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get all template files with placeholders replaced
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTemplateFiles(projectName: string): TemplateFile[];
|
|
14
|
+
/**
|
|
15
|
+
* Get the initial empty tasks.json content
|
|
16
|
+
*/
|
|
17
|
+
export declare function getInitialTasksJson(): string;
|
|
18
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,EAAE,CA2CpE;AAuYD;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAW5C"}
|