@codemcp/workflows-core 4.7.0 → 4.8.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/dist/beads-state-manager.d.ts +58 -0
- package/dist/beads-state-manager.js +214 -0
- package/dist/beads-state-manager.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/instruction-generator.d.ts +4 -23
- package/dist/instruction-generator.js +10 -48
- package/dist/instruction-generator.js.map +1 -1
- package/dist/interfaces/index.d.ts +9 -0
- package/dist/interfaces/index.js +10 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/instruction-generator.interface.d.ts +39 -0
- package/dist/interfaces/instruction-generator.interface.js +8 -0
- package/dist/interfaces/instruction-generator.interface.js.map +1 -0
- package/dist/interfaces/plan-manager.interface.d.ts +55 -0
- package/dist/interfaces/plan-manager.interface.js +8 -0
- package/dist/interfaces/plan-manager.interface.js.map +1 -0
- package/dist/interfaces/task-backend-client.interface.d.ts +52 -0
- package/dist/interfaces/task-backend-client.interface.js +8 -0
- package/dist/interfaces/task-backend-client.interface.js.map +1 -0
- package/dist/plan-manager.d.ts +2 -7
- package/dist/plan-manager.js +15 -13
- package/dist/plan-manager.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BeadsStateManager
|
|
3
|
+
*
|
|
4
|
+
* Manages beads-specific conversation state including phase task mappings
|
|
5
|
+
* and epic information. Provides persistent storage for beads integration
|
|
6
|
+
* data with proper separation of concerns from conversation management.
|
|
7
|
+
*/
|
|
8
|
+
import type { BeadsPhaseTask } from './beads-integration.js';
|
|
9
|
+
/**
|
|
10
|
+
* Beads-specific conversation state
|
|
11
|
+
*/
|
|
12
|
+
export interface BeadsConversationState {
|
|
13
|
+
conversationId: string;
|
|
14
|
+
projectPath: string;
|
|
15
|
+
epicId: string;
|
|
16
|
+
phaseTasks: BeadsPhaseTask[];
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Manager for beads conversation state persistence
|
|
22
|
+
*/
|
|
23
|
+
export declare class BeadsStateManager {
|
|
24
|
+
private projectPath;
|
|
25
|
+
constructor(projectPath: string);
|
|
26
|
+
/**
|
|
27
|
+
* Get the path to the beads state file for a conversation
|
|
28
|
+
*/
|
|
29
|
+
private getBeadsStatePath;
|
|
30
|
+
/**
|
|
31
|
+
* Create beads state for a conversation
|
|
32
|
+
*/
|
|
33
|
+
createState(conversationId: string, epicId: string, phaseTasks: BeadsPhaseTask[]): Promise<BeadsConversationState>;
|
|
34
|
+
/**
|
|
35
|
+
* Get beads state for a conversation
|
|
36
|
+
*/
|
|
37
|
+
getState(conversationId: string): Promise<BeadsConversationState | null>;
|
|
38
|
+
/**
|
|
39
|
+
* Get phase task ID for a specific phase
|
|
40
|
+
*/
|
|
41
|
+
getPhaseTaskId(conversationId: string, phase: string): Promise<string | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Update beads state for a conversation
|
|
44
|
+
*/
|
|
45
|
+
updateState(conversationId: string, updates: Partial<Omit<BeadsConversationState, 'conversationId' | 'createdAt'>>): Promise<BeadsConversationState | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Clean up beads state for a conversation
|
|
48
|
+
*/
|
|
49
|
+
cleanup(conversationId: string): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Check if beads state exists for a conversation
|
|
52
|
+
*/
|
|
53
|
+
hasState(conversationId: string): Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Save beads state to file
|
|
56
|
+
*/
|
|
57
|
+
private saveState;
|
|
58
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BeadsStateManager
|
|
3
|
+
*
|
|
4
|
+
* Manages beads-specific conversation state including phase task mappings
|
|
5
|
+
* and epic information. Provides persistent storage for beads integration
|
|
6
|
+
* data with proper separation of concerns from conversation management.
|
|
7
|
+
*/
|
|
8
|
+
import { writeFile, readFile, mkdir, access } from 'node:fs/promises';
|
|
9
|
+
import { join, dirname } from 'node:path';
|
|
10
|
+
import { createLogger } from './logger.js';
|
|
11
|
+
const logger = createLogger('BeadsStateManager');
|
|
12
|
+
/**
|
|
13
|
+
* Manager for beads conversation state persistence
|
|
14
|
+
*/
|
|
15
|
+
export class BeadsStateManager {
|
|
16
|
+
projectPath;
|
|
17
|
+
constructor(projectPath) {
|
|
18
|
+
this.projectPath = projectPath;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get the path to the beads state file for a conversation
|
|
22
|
+
*/
|
|
23
|
+
getBeadsStatePath(conversationId) {
|
|
24
|
+
return join(this.projectPath, '.vibe', `beads-state-${conversationId}.json`);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create beads state for a conversation
|
|
28
|
+
*/
|
|
29
|
+
async createState(conversationId, epicId, phaseTasks) {
|
|
30
|
+
const state = {
|
|
31
|
+
conversationId,
|
|
32
|
+
projectPath: this.projectPath,
|
|
33
|
+
epicId,
|
|
34
|
+
phaseTasks,
|
|
35
|
+
createdAt: new Date().toISOString(),
|
|
36
|
+
updatedAt: new Date().toISOString(),
|
|
37
|
+
};
|
|
38
|
+
await this.saveState(state);
|
|
39
|
+
logger.info('Created beads conversation state', {
|
|
40
|
+
conversationId,
|
|
41
|
+
epicId,
|
|
42
|
+
phaseCount: phaseTasks.length,
|
|
43
|
+
projectPath: this.projectPath,
|
|
44
|
+
});
|
|
45
|
+
return state;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get beads state for a conversation
|
|
49
|
+
*/
|
|
50
|
+
async getState(conversationId) {
|
|
51
|
+
const statePath = this.getBeadsStatePath(conversationId);
|
|
52
|
+
try {
|
|
53
|
+
// Check if file exists
|
|
54
|
+
await access(statePath);
|
|
55
|
+
const content = await readFile(statePath, 'utf-8');
|
|
56
|
+
const state = JSON.parse(content);
|
|
57
|
+
logger.debug('Retrieved beads conversation state', {
|
|
58
|
+
conversationId,
|
|
59
|
+
epicId: state.epicId,
|
|
60
|
+
phaseCount: state.phaseTasks.length,
|
|
61
|
+
projectPath: this.projectPath,
|
|
62
|
+
});
|
|
63
|
+
return state;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (error.code === 'ENOENT') {
|
|
67
|
+
// File doesn't exist - this is normal for conversations without beads
|
|
68
|
+
logger.debug('No beads state found for conversation', {
|
|
69
|
+
conversationId,
|
|
70
|
+
projectPath: this.projectPath,
|
|
71
|
+
});
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
// Other errors (permission, invalid JSON, etc.)
|
|
75
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
76
|
+
logger.warn('Failed to read beads state file', {
|
|
77
|
+
error: errorMessage,
|
|
78
|
+
conversationId,
|
|
79
|
+
statePath,
|
|
80
|
+
projectPath: this.projectPath,
|
|
81
|
+
});
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get phase task ID for a specific phase
|
|
87
|
+
*/
|
|
88
|
+
async getPhaseTaskId(conversationId, phase) {
|
|
89
|
+
const state = await this.getState(conversationId);
|
|
90
|
+
if (!state) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const phaseTask = state.phaseTasks.find(task => task.phaseId === phase);
|
|
94
|
+
if (phaseTask) {
|
|
95
|
+
logger.debug('Found phase task ID', {
|
|
96
|
+
conversationId,
|
|
97
|
+
phase,
|
|
98
|
+
taskId: phaseTask.taskId,
|
|
99
|
+
projectPath: this.projectPath,
|
|
100
|
+
});
|
|
101
|
+
return phaseTask.taskId;
|
|
102
|
+
}
|
|
103
|
+
logger.debug('No task ID found for phase', {
|
|
104
|
+
conversationId,
|
|
105
|
+
phase,
|
|
106
|
+
availablePhases: state.phaseTasks.map(t => t.phaseId),
|
|
107
|
+
projectPath: this.projectPath,
|
|
108
|
+
});
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Update beads state for a conversation
|
|
113
|
+
*/
|
|
114
|
+
async updateState(conversationId, updates) {
|
|
115
|
+
const existingState = await this.getState(conversationId);
|
|
116
|
+
if (!existingState) {
|
|
117
|
+
logger.warn('Cannot update non-existent beads state', {
|
|
118
|
+
conversationId,
|
|
119
|
+
projectPath: this.projectPath,
|
|
120
|
+
});
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const updatedState = {
|
|
124
|
+
...existingState,
|
|
125
|
+
...updates,
|
|
126
|
+
conversationId, // Ensure conversationId doesn't change
|
|
127
|
+
updatedAt: new Date().toISOString(),
|
|
128
|
+
};
|
|
129
|
+
await this.saveState(updatedState);
|
|
130
|
+
logger.info('Updated beads conversation state', {
|
|
131
|
+
conversationId,
|
|
132
|
+
updatedFields: Object.keys(updates),
|
|
133
|
+
projectPath: this.projectPath,
|
|
134
|
+
});
|
|
135
|
+
return updatedState;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Clean up beads state for a conversation
|
|
139
|
+
*/
|
|
140
|
+
async cleanup(conversationId) {
|
|
141
|
+
const statePath = this.getBeadsStatePath(conversationId);
|
|
142
|
+
try {
|
|
143
|
+
await access(statePath);
|
|
144
|
+
await writeFile(statePath + '.backup', await readFile(statePath));
|
|
145
|
+
// Note: We could delete the file here, but keeping it for now in case of recovery needs
|
|
146
|
+
// await unlink(statePath);
|
|
147
|
+
logger.info('Cleaned up beads conversation state', {
|
|
148
|
+
conversationId,
|
|
149
|
+
statePath,
|
|
150
|
+
projectPath: this.projectPath,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
if (error.code === 'ENOENT') {
|
|
155
|
+
// File doesn't exist - nothing to clean up
|
|
156
|
+
logger.debug('No beads state to clean up', {
|
|
157
|
+
conversationId,
|
|
158
|
+
projectPath: this.projectPath,
|
|
159
|
+
});
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
163
|
+
logger.warn('Failed to clean up beads state', {
|
|
164
|
+
error: errorMessage,
|
|
165
|
+
conversationId,
|
|
166
|
+
statePath,
|
|
167
|
+
projectPath: this.projectPath,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Check if beads state exists for a conversation
|
|
173
|
+
*/
|
|
174
|
+
async hasState(conversationId) {
|
|
175
|
+
const statePath = this.getBeadsStatePath(conversationId);
|
|
176
|
+
try {
|
|
177
|
+
await access(statePath);
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Save beads state to file
|
|
186
|
+
*/
|
|
187
|
+
async saveState(state) {
|
|
188
|
+
const statePath = this.getBeadsStatePath(state.conversationId);
|
|
189
|
+
const stateDir = dirname(statePath);
|
|
190
|
+
try {
|
|
191
|
+
// Ensure .vibe directory exists
|
|
192
|
+
await mkdir(stateDir, { recursive: true });
|
|
193
|
+
// Write state with pretty formatting for readability
|
|
194
|
+
const content = JSON.stringify(state, null, 2);
|
|
195
|
+
await writeFile(statePath, content, 'utf-8');
|
|
196
|
+
logger.debug('Saved beads state to file', {
|
|
197
|
+
conversationId: state.conversationId,
|
|
198
|
+
statePath,
|
|
199
|
+
fileSize: content.length,
|
|
200
|
+
projectPath: this.projectPath,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
205
|
+
logger.error('Failed to save beads state', error instanceof Error ? error : new Error(errorMessage), {
|
|
206
|
+
conversationId: state.conversationId,
|
|
207
|
+
statePath,
|
|
208
|
+
projectPath: this.projectPath,
|
|
209
|
+
});
|
|
210
|
+
throw error;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=beads-state-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beads-state-manager.js","sourceRoot":"","sources":["../src/beads-state-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,MAAM,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAcjD;;GAEG;AACH,MAAM,OAAO,iBAAiB;IACpB,WAAW,CAAS;IAE5B,YAAY,WAAmB;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED;;OAEG;IACK,iBAAiB,CAAC,cAAsB;QAC9C,OAAO,IAAI,CACT,IAAI,CAAC,WAAW,EAChB,OAAO,EACP,eAAe,cAAc,OAAO,CACrC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CACf,cAAsB,EACtB,MAAc,EACd,UAA4B;QAE5B,MAAM,KAAK,GAA2B;YACpC,cAAc;YACd,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM;YACN,UAAU;YACV,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAC;QAEF,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAE5B,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE;YAC9C,cAAc;YACd,MAAM;YACN,UAAU,EAAE,UAAU,CAAC,MAAM;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;SA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,CAAC,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,EACxD;gBACE,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,SAAS;gBACT,WAAW,EAAE,IAAI,CAAC,WAAW;aAC9B,CACF,CAAC;YACF,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './types.js';
|
|
2
2
|
export * from './state-machine-types.js';
|
|
3
|
+
export * from './interfaces/index.js';
|
|
3
4
|
export * from './state-machine.js';
|
|
4
5
|
export * from './state-machine-loader.js';
|
|
5
6
|
export * from './workflow-manager.js';
|
|
@@ -17,6 +18,7 @@ export * from './config-manager.js';
|
|
|
17
18
|
export * from './git-manager.js';
|
|
18
19
|
export * from './task-backend.js';
|
|
19
20
|
export * from './beads-integration.js';
|
|
21
|
+
export * from './beads-state-manager.js';
|
|
20
22
|
export * from './logger.js';
|
|
21
23
|
export * from './interaction-logger.js';
|
|
22
24
|
export * from './instruction-generator.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Core types and interfaces
|
|
2
2
|
export * from './types.js';
|
|
3
3
|
export * from './state-machine-types.js';
|
|
4
|
+
// Strategy pattern interfaces
|
|
5
|
+
export * from './interfaces/index.js';
|
|
4
6
|
// State machine and workflow management
|
|
5
7
|
export * from './state-machine.js';
|
|
6
8
|
export * from './state-machine-loader.js';
|
|
@@ -21,6 +23,7 @@ export * from './config-manager.js';
|
|
|
21
23
|
export * from './git-manager.js';
|
|
22
24
|
export * from './task-backend.js';
|
|
23
25
|
export * from './beads-integration.js';
|
|
26
|
+
export * from './beads-state-manager.js';
|
|
24
27
|
// Utilities and generators
|
|
25
28
|
export * from './logger.js';
|
|
26
29
|
export * from './interaction-logger.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts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AmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AAEzC,2BAA2B;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC"}
|
|
@@ -6,31 +6,12 @@
|
|
|
6
6
|
* Supports custom state machine definitions for dynamic instruction generation.
|
|
7
7
|
* Handles variable substitution for project artifact references.
|
|
8
8
|
*/
|
|
9
|
-
import type { ConversationContext } from './types.js';
|
|
10
9
|
import { PlanManager } from './plan-manager.js';
|
|
11
10
|
import type { YamlStateMachine } from './state-machine-types.js';
|
|
12
|
-
import {
|
|
13
|
-
export
|
|
14
|
-
phase: string;
|
|
15
|
-
conversationContext: ConversationContext;
|
|
16
|
-
transitionReason: string;
|
|
17
|
-
isModeled: boolean;
|
|
18
|
-
planFileExists: boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface GeneratedInstructions {
|
|
21
|
-
instructions: string;
|
|
22
|
-
planFileGuidance: string;
|
|
23
|
-
metadata: {
|
|
24
|
-
phase: string;
|
|
25
|
-
planFilePath: string;
|
|
26
|
-
transitionReason: string;
|
|
27
|
-
isModeled: boolean;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export declare class InstructionGenerator {
|
|
11
|
+
import type { IInstructionGenerator, InstructionContext, GeneratedInstructions } from './interfaces/instruction-generator.interface.js';
|
|
12
|
+
export declare class InstructionGenerator implements IInstructionGenerator {
|
|
31
13
|
private projectDocsManager;
|
|
32
|
-
|
|
33
|
-
constructor(_planManager: PlanManager, taskBackendDetector?: () => TaskBackendConfig);
|
|
14
|
+
constructor(_planManager: PlanManager);
|
|
34
15
|
/**
|
|
35
16
|
* Set the state machine definition for dynamic instruction generation
|
|
36
17
|
*/
|
|
@@ -53,7 +34,7 @@ export declare class InstructionGenerator {
|
|
|
53
34
|
*/
|
|
54
35
|
private enhanceInstructions;
|
|
55
36
|
/**
|
|
56
|
-
* Generate task management guidance
|
|
37
|
+
* Generate task management guidance for markdown backend
|
|
57
38
|
*/
|
|
58
39
|
private generateTaskManagementGuidance;
|
|
59
40
|
/**
|
|
@@ -7,14 +7,11 @@
|
|
|
7
7
|
* Handles variable substitution for project artifact references.
|
|
8
8
|
*/
|
|
9
9
|
import { ProjectDocsManager } from './project-docs-manager.js';
|
|
10
|
-
import { TaskBackendManager } from './task-backend.js';
|
|
11
10
|
export class InstructionGenerator {
|
|
12
11
|
projectDocsManager;
|
|
13
|
-
|
|
14
|
-
constructor(_planManager, taskBackendDetector = TaskBackendManager.detectTaskBackend) {
|
|
12
|
+
constructor(_planManager) {
|
|
15
13
|
// planManager parameter kept for API compatibility but not stored since unused
|
|
16
14
|
this.projectDocsManager = new ProjectDocsManager();
|
|
17
|
-
this.taskBackendDetector = taskBackendDetector;
|
|
18
15
|
}
|
|
19
16
|
/**
|
|
20
17
|
* Set the state machine definition for dynamic instruction generation
|
|
@@ -66,30 +63,11 @@ export class InstructionGenerator {
|
|
|
66
63
|
*/
|
|
67
64
|
async enhanceInstructions(baseInstructions, context) {
|
|
68
65
|
const { phase, conversationContext, transitionReason, isModeled, planFileExists, } = context;
|
|
69
|
-
// Generate task
|
|
70
|
-
const
|
|
71
|
-
const taskGuidance = this.generateTaskManagementGuidance(taskBackendConfig);
|
|
66
|
+
// Generate task management guidance for markdown backend
|
|
67
|
+
const taskGuidance = this.generateTaskManagementGuidance();
|
|
72
68
|
let enhanced;
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
-
taskBackendConfig.isAvailable) {
|
|
76
|
-
// Beads mode: Focus on bd CLI task management, not plan file
|
|
77
|
-
enhanced = `You are in the ${phase} phase.
|
|
78
|
-
${baseInstructions}
|
|
79
|
-
|
|
80
|
-
**Plan File Guidance:**
|
|
81
|
-
Use the plan file as memory for the current objective
|
|
82
|
-
- Update the "Key Decisions" section with important choices made
|
|
83
|
-
- Add relevant notes to help maintain context
|
|
84
|
-
- Do NOT enter tasks in the plan file, follow the below instructions for plan file management
|
|
85
|
-
|
|
86
|
-
**Task Management Guidance:**
|
|
87
|
-
${taskGuidance}
|
|
88
|
-
`;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
// Markdown mode: Traditional plan file approach
|
|
92
|
-
enhanced = `Check your plan file at \`${conversationContext.planFilePath}\` and focus on the "${this.capitalizePhase(phase)}" section.
|
|
69
|
+
// Markdown mode: Traditional plan file approach
|
|
70
|
+
enhanced = `Check your plan file at \`${conversationContext.planFilePath}\` and focus on the "${this.capitalizePhase(phase)}" section.
|
|
93
71
|
|
|
94
72
|
${baseInstructions}
|
|
95
73
|
|
|
@@ -98,7 +76,6 @@ ${baseInstructions}
|
|
|
98
76
|
${taskGuidance}
|
|
99
77
|
- Update the "Key Decisions" section with important choices made
|
|
100
78
|
- Add relevant notes to help maintain context`;
|
|
101
|
-
}
|
|
102
79
|
// Add project context
|
|
103
80
|
enhanced += `\n\n**Project Context:**
|
|
104
81
|
- Project: ${conversationContext.projectPath}
|
|
@@ -115,33 +92,18 @@ ${taskGuidance}
|
|
|
115
92
|
'\n\n**Note**: Plan file will be created when you first update it.';
|
|
116
93
|
}
|
|
117
94
|
// Add continuity and task management instructions
|
|
118
|
-
const taskReminder = taskBackendConfig.backend === 'beads' && taskBackendConfig.isAvailable
|
|
119
|
-
? 'Use ONLY bd CLI tool for task management - do not use your own task management tools'
|
|
120
|
-
: 'Use ONLY the development plan for task management - do not use your own task management tools';
|
|
121
95
|
enhanced += `\n\n**Important Reminders:**
|
|
122
|
-
-
|
|
96
|
+
- Use ONLY the development plan for task management - do not use your own task management tools
|
|
123
97
|
- Call whats_next() after the next user message to maintain the development workflow`;
|
|
124
98
|
return enhanced;
|
|
125
99
|
}
|
|
126
100
|
/**
|
|
127
|
-
* Generate task management guidance
|
|
101
|
+
* Generate task management guidance for markdown backend
|
|
128
102
|
*/
|
|
129
|
-
generateTaskManagementGuidance(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return `- Use bd CLI tool exclusively
|
|
133
|
-
- **Start by listing ready tasks**: \`bd list --parent <phase-task-id> --status open\`
|
|
134
|
-
- **Create new tasks**: \`bd create 'Task title' --parent <phase-task-id> -p 2\`
|
|
135
|
-
- **Update status when working**: \`bd update <task-id> --status in_progress\`
|
|
136
|
-
- **Complete tasks**: \`bd close <task-id>\`
|
|
137
|
-
- **Focus on ready tasks first** - let beads handle dependencies
|
|
103
|
+
generateTaskManagementGuidance() {
|
|
104
|
+
// Default markdown backend
|
|
105
|
+
return `- Mark completed tasks with [x] as you finish them
|
|
138
106
|
- Add new tasks as they are identified during your work with the user`;
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
// Default markdown backend
|
|
142
|
-
return `- Mark completed tasks with [x] as you finish them
|
|
143
|
-
- Add new tasks as they are identified during your work with the user`;
|
|
144
|
-
}
|
|
145
107
|
}
|
|
146
108
|
/**
|
|
147
109
|
* Capitalize phase name for display
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instruction-generator.js","sourceRoot":"","sources":["../src/instruction-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"instruction-generator.js","sourceRoot":"","sources":["../src/instruction-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAS/D,MAAM,OAAO,oBAAoB;IACvB,kBAAkB,CAAqB;IAE/C,YAAY,YAAyB;QACnC,+EAA+E;QAC/E,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,aAA+B;QAC7C,gFAAgF;QAChF,OAAO;IACT,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oBAAoB,CACxB,gBAAwB,EACxB,OAA2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core Component Interfaces
|
|
3
|
+
*
|
|
4
|
+
* Defines contract interfaces for core components to enable strategy pattern.
|
|
5
|
+
* Enables clean substitution of components based on task backend configuration.
|
|
6
|
+
*/
|
|
7
|
+
export * from './plan-manager.interface.js';
|
|
8
|
+
export * from './instruction-generator.interface.js';
|
|
9
|
+
export * from './task-backend-client.interface.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Component Interfaces
|
|
3
|
+
*
|
|
4
|
+
* Defines contract interfaces for core components to enable strategy pattern.
|
|
5
|
+
* Enables clean substitution of components based on task backend configuration.
|
|
6
|
+
*/
|
|
7
|
+
export * from './plan-manager.interface.js';
|
|
8
|
+
export * from './instruction-generator.interface.js';
|
|
9
|
+
export * from './task-backend-client.interface.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instruction Generator Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for instruction generation functionality.
|
|
5
|
+
* Enables strategy pattern implementation for different task backends.
|
|
6
|
+
*/
|
|
7
|
+
import type { ConversationContext } from '../types.js';
|
|
8
|
+
import type { YamlStateMachine } from '../state-machine-types.js';
|
|
9
|
+
export interface InstructionContext {
|
|
10
|
+
phase: string;
|
|
11
|
+
conversationContext: ConversationContext;
|
|
12
|
+
transitionReason: string;
|
|
13
|
+
isModeled: boolean;
|
|
14
|
+
planFileExists: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface GeneratedInstructions {
|
|
17
|
+
instructions: string;
|
|
18
|
+
planFileGuidance: string;
|
|
19
|
+
metadata: {
|
|
20
|
+
phase: string;
|
|
21
|
+
planFilePath: string;
|
|
22
|
+
transitionReason: string;
|
|
23
|
+
isModeled: boolean;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Interface for instruction generation operations
|
|
28
|
+
* All instruction generators must implement this interface
|
|
29
|
+
*/
|
|
30
|
+
export interface IInstructionGenerator {
|
|
31
|
+
/**
|
|
32
|
+
* Set the state machine definition for dynamic instruction generation
|
|
33
|
+
*/
|
|
34
|
+
setStateMachine(stateMachine: YamlStateMachine): void;
|
|
35
|
+
/**
|
|
36
|
+
* Generate comprehensive instructions for the LLM
|
|
37
|
+
*/
|
|
38
|
+
generateInstructions(baseInstructions: string, context: InstructionContext): Promise<GeneratedInstructions>;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instruction-generator.interface.js","sourceRoot":"","sources":["../../src/interfaces/instruction-generator.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan Manager Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for plan management functionality.
|
|
5
|
+
* Enables strategy pattern implementation for different task backends.
|
|
6
|
+
*/
|
|
7
|
+
import type { YamlStateMachine } from '../state-machine-types.js';
|
|
8
|
+
import type { TaskBackendConfig } from '../task-backend.js';
|
|
9
|
+
export interface PlanFileInfo {
|
|
10
|
+
path: string;
|
|
11
|
+
exists: boolean;
|
|
12
|
+
content?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Interface for plan management operations
|
|
16
|
+
* All plan managers must implement this interface
|
|
17
|
+
*/
|
|
18
|
+
export interface IPlanManager {
|
|
19
|
+
/**
|
|
20
|
+
* Set the state machine definition for dynamic plan generation
|
|
21
|
+
*/
|
|
22
|
+
setStateMachine(stateMachine: YamlStateMachine): void;
|
|
23
|
+
/**
|
|
24
|
+
* Set the task backend configuration
|
|
25
|
+
*/
|
|
26
|
+
setTaskBackend(taskBackend: TaskBackendConfig): void;
|
|
27
|
+
/**
|
|
28
|
+
* Get plan file information
|
|
29
|
+
*/
|
|
30
|
+
getPlanFileInfo(planFilePath: string): Promise<PlanFileInfo>;
|
|
31
|
+
/**
|
|
32
|
+
* Create initial plan file if it doesn't exist
|
|
33
|
+
*/
|
|
34
|
+
ensurePlanFile(planFilePath: string, projectPath: string, gitBranch: string): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Update plan file with new content
|
|
37
|
+
*/
|
|
38
|
+
updatePlanFile(planFilePath: string, content: string): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Get plan file content for LLM context
|
|
41
|
+
*/
|
|
42
|
+
getPlanFileContent(planFilePath: string): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Generate phase-specific plan file guidance based on state machine
|
|
45
|
+
*/
|
|
46
|
+
generatePlanFileGuidance(phase: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Delete plan file
|
|
49
|
+
*/
|
|
50
|
+
deletePlanFile(planFilePath: string): Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Ensure plan file is deleted (verify deletion)
|
|
53
|
+
*/
|
|
54
|
+
ensurePlanFileDeleted(planFilePath: string): Promise<boolean>;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-manager.interface.js","sourceRoot":"","sources":["../../src/interfaces/plan-manager.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Backend Client Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for task backend operations (CLI commands, etc.).
|
|
5
|
+
* Enables clean abstraction of different task backends (beads, GitHub Issues, etc.).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Represents a task from the backend
|
|
9
|
+
*/
|
|
10
|
+
export interface BackendTask {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
status: 'open' | 'in_progress' | 'completed' | 'cancelled';
|
|
14
|
+
priority: number;
|
|
15
|
+
parent?: string;
|
|
16
|
+
children?: BackendTask[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Result of task validation operations
|
|
20
|
+
*/
|
|
21
|
+
export interface TaskValidationResult {
|
|
22
|
+
valid: boolean;
|
|
23
|
+
openTasks: BackendTask[];
|
|
24
|
+
message?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Interface for task backend client operations
|
|
28
|
+
* All task backend clients must implement this interface
|
|
29
|
+
*/
|
|
30
|
+
export interface ITaskBackendClient {
|
|
31
|
+
/**
|
|
32
|
+
* Check if the task backend is available and properly configured
|
|
33
|
+
*/
|
|
34
|
+
isAvailable(): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Get all open tasks for a given parent task
|
|
37
|
+
*/
|
|
38
|
+
getOpenTasks(parentTaskId: string): Promise<BackendTask[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Validate that all tasks under a parent are completed
|
|
41
|
+
* Returns validation result with details about any remaining open tasks
|
|
42
|
+
*/
|
|
43
|
+
validateTasksCompleted(parentTaskId: string): Promise<TaskValidationResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Create a new task under a parent
|
|
46
|
+
*/
|
|
47
|
+
createTask(title: string, parentTaskId: string, priority?: number): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Update task status
|
|
50
|
+
*/
|
|
51
|
+
updateTaskStatus(taskId: string, status: 'open' | 'in_progress' | 'completed' | 'cancelled'): Promise<void>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Backend Client Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for task backend operations (CLI commands, etc.).
|
|
5
|
+
* Enables clean abstraction of different task backends (beads, GitHub Issues, etc.).
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=task-backend-client.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-backend-client.interface.js","sourceRoot":"","sources":["../../src/interfaces/task-backend-client.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/plan-manager.d.ts
CHANGED
|
@@ -7,14 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { YamlStateMachine } from './state-machine-types.js';
|
|
9
9
|
import type { TaskBackendConfig } from './task-backend.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exists: boolean;
|
|
13
|
-
content?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class PlanManager {
|
|
10
|
+
import type { IPlanManager, PlanFileInfo } from './interfaces/plan-manager.interface.js';
|
|
11
|
+
export declare class PlanManager implements IPlanManager {
|
|
16
12
|
private stateMachine;
|
|
17
|
-
private taskBackend;
|
|
18
13
|
/**
|
|
19
14
|
* Set the state machine definition for dynamic plan generation
|
|
20
15
|
*/
|
package/dist/plan-manager.js
CHANGED
|
@@ -12,7 +12,6 @@ import { createLogger } from './logger.js';
|
|
|
12
12
|
const logger = createLogger('PlanManager');
|
|
13
13
|
export class PlanManager {
|
|
14
14
|
stateMachine = null;
|
|
15
|
-
taskBackend = null;
|
|
16
15
|
/**
|
|
17
16
|
* Set the state machine definition for dynamic plan generation
|
|
18
17
|
*/
|
|
@@ -27,8 +26,9 @@ export class PlanManager {
|
|
|
27
26
|
* Set the task backend configuration
|
|
28
27
|
*/
|
|
29
28
|
setTaskBackend(taskBackend) {
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
// Default plan manager only supports markdown backend
|
|
30
|
+
// Task backend information is not stored as it's not used for markdown plan generation
|
|
31
|
+
logger.debug('Task backend set for plan manager (markdown mode)', {
|
|
32
32
|
backend: taskBackend.backend,
|
|
33
33
|
available: taskBackend.isAvailable,
|
|
34
34
|
});
|
|
@@ -112,7 +112,6 @@ export class PlanManager {
|
|
|
112
112
|
}
|
|
113
113
|
const phases = Object.keys(this.stateMachine.states);
|
|
114
114
|
const initialPhase = this.stateMachine.initial_state;
|
|
115
|
-
const isBeadsMode = this.taskBackend?.backend === 'beads';
|
|
116
115
|
const documentationUrl = this.generateWorkflowDocumentationUrl(this.stateMachine.name);
|
|
117
116
|
let content = `# Development Plan: ${projectName}${branchInfo}
|
|
118
117
|
|
|
@@ -120,17 +119,14 @@ export class PlanManager {
|
|
|
120
119
|
*Workflow: ${documentationUrl
|
|
121
120
|
? '[' + this.stateMachine.name + ']' + '(' + documentationUrl + ')'
|
|
122
121
|
: this.stateMachine.name}*
|
|
123
|
-
*Task Management:
|
|
122
|
+
*Task Management: Markdown Checkboxes*
|
|
124
123
|
|
|
125
124
|
## Goal
|
|
126
125
|
*Define what you're building or fixing - this will be updated as requirements are gathered*
|
|
127
126
|
|
|
128
127
|
## ${this.capitalizePhase(initialPhase)}
|
|
129
|
-
${isBeadsMode ? '<!-- beads-phase-id: TBD -->' : ''}
|
|
130
128
|
### Tasks
|
|
131
|
-
|
|
132
|
-
? '**🔧 TASK MANAGEMENT VIA CLI TOOL bd**\n\nTasks are managed via bd CLI tool. Use bd commands to create and manage tasks with proper hierarchy:\n\n- `bd list --parent <phase-task-id>`\n- `bd create "Task title" --parent <phase-task-id> -p 2`\n- `bd close <task-id>`\n\n**Never use [ ] or [x] checkboxes - use bd commands only!**'
|
|
133
|
-
: '- [ ] *Tasks will be added as they are identified*'}
|
|
129
|
+
- [ ] *Tasks will be added as they are identified*
|
|
134
130
|
|
|
135
131
|
### Completed
|
|
136
132
|
- [x] Created development plan file
|
|
@@ -140,11 +136,8 @@ ${isBeadsMode
|
|
|
140
136
|
for (const phase of phases) {
|
|
141
137
|
if (phase !== initialPhase) {
|
|
142
138
|
content += `## ${this.capitalizePhase(phase)}
|
|
143
|
-
${isBeadsMode ? '<!-- beads-phase-id: TBD -->' : ''}
|
|
144
139
|
### Tasks
|
|
145
|
-
|
|
146
|
-
? '**🔧 TASK MANAGEMENT VIA CLI TOOL bd**\n\nTasks are managed via bd CLI tool. Use bd commands to create and manage tasks with proper hierarchy:\n\n- `bd list --parent <phase-task-id>`\n- `bd create "Task title" --parent <phase-task-id> -p 2`\n- `bd close <task-id>`\n\n**Never use [ ] or [x] checkboxes - use bd commands only!**'
|
|
147
|
-
: '- [ ] *To be added when this phase becomes active*'}
|
|
140
|
+
- [ ] *To be added when this phase becomes active*
|
|
148
141
|
|
|
149
142
|
### Completed
|
|
150
143
|
*None yet*
|
|
@@ -185,6 +178,15 @@ ${isBeadsMode
|
|
|
185
178
|
* Generate phase-specific plan file guidance based on state machine
|
|
186
179
|
*/
|
|
187
180
|
generatePlanFileGuidance(phase) {
|
|
181
|
+
if (phase === null || phase === undefined) {
|
|
182
|
+
throw new Error('Phase parameter cannot be null or undefined');
|
|
183
|
+
}
|
|
184
|
+
if (typeof phase !== 'string') {
|
|
185
|
+
throw new Error('Phase parameter must be a string');
|
|
186
|
+
}
|
|
187
|
+
if (phase.trim() === '') {
|
|
188
|
+
throw new Error('Phase parameter cannot be empty');
|
|
189
|
+
}
|
|
188
190
|
if (!this.stateMachine) {
|
|
189
191
|
throw new Error('State machine not set. This should not happen as state machine is always loaded.');
|
|
190
192
|
}
|
package/dist/plan-manager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-manager.js","sourceRoot":"","sources":["../src/plan-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"plan-manager.js","sourceRoot":"","sources":["../src/plan-manager.ts"],"names":[],"mappings":"AAAA;;;;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