@ginkoai/cli 1.6.1 → 1.6.2
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 +34 -0
- package/dist/commands/epic.d.ts +29 -0
- package/dist/commands/epic.d.ts.map +1 -0
- package/dist/commands/epic.js +322 -0
- package/dist/commands/epic.js.map +1 -0
- package/dist/commands/graph/api-client.d.ts +201 -0
- package/dist/commands/graph/api-client.d.ts.map +1 -1
- package/dist/commands/graph/api-client.js +59 -0
- package/dist/commands/graph/api-client.js.map +1 -1
- package/dist/commands/log.d.ts.map +1 -1
- package/dist/commands/log.js +39 -4
- package/dist/commands/log.js.map +1 -1
- package/dist/commands/start/start-reflection.d.ts +11 -0
- package/dist/commands/start/start-reflection.d.ts.map +1 -1
- package/dist/commands/start/start-reflection.js +142 -12
- package/dist/commands/start/start-reflection.js.map +1 -1
- package/dist/core/session-log-manager.d.ts +1 -1
- package/dist/core/session-log-manager.d.ts.map +1 -1
- package/dist/core/session-log-manager.js +12 -3
- package/dist/core/session-log-manager.js.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/event-logger.d.ts +1 -1
- package/dist/lib/event-logger.d.ts.map +1 -1
- package/dist/lib/output-formatter.d.ts +25 -1
- package/dist/lib/output-formatter.d.ts.map +1 -1
- package/dist/lib/output-formatter.js +37 -17
- package/dist/lib/output-formatter.js.map +1 -1
- package/dist/lib/sprint-loader.d.ts +2 -0
- package/dist/lib/sprint-loader.d.ts.map +1 -1
- package/dist/lib/sprint-loader.js +81 -6
- package/dist/lib/sprint-loader.js.map +1 -1
- package/dist/templates/ai-instructions-template.d.ts +3 -2
- package/dist/templates/ai-instructions-template.d.ts.map +1 -1
- package/dist/templates/ai-instructions-template.js +104 -2
- package/dist/templates/ai-instructions-template.js.map +1 -1
- package/dist/templates/epic-template.md +319 -0
- package/dist/utils/command-helpers.d.ts +10 -0
- package/dist/utils/command-helpers.d.ts.map +1 -1
- package/dist/utils/command-helpers.js +52 -1
- package/dist/utils/command-helpers.js.map +1 -1
- package/dist/utils/pattern-confidence.d.ts +82 -0
- package/dist/utils/pattern-confidence.d.ts.map +1 -0
- package/dist/utils/pattern-confidence.js +172 -0
- package/dist/utils/pattern-confidence.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,19 @@ ginko status
|
|
|
33
33
|
- `ginko start [sessionId]` - Start or resume a session
|
|
34
34
|
- `ginko handoff [message]` - Create a session handoff
|
|
35
35
|
- `ginko status` - Show current session status
|
|
36
|
+
- `ginko log [description]` - Log events to session (ADR-033 defensive logging)
|
|
37
|
+
|
|
38
|
+
### Planning & Organization
|
|
39
|
+
- `ginko charter` - Create and manage project charter (AI-assisted)
|
|
40
|
+
- Default: Output template for AI-mediated conversation
|
|
41
|
+
- `--view` - View existing charter
|
|
42
|
+
- `--edit` - Edit charter conversationally
|
|
43
|
+
- `--no-ai` - Interactive CLI mode
|
|
44
|
+
- `ginko epic` - Create and manage epics with sprint breakdown (AI-assisted)
|
|
45
|
+
- Default: Output template for AI-mediated conversation
|
|
46
|
+
- `--list` - List existing epics
|
|
47
|
+
- `--view` - View epic details with sprint progress
|
|
48
|
+
- `--sync` - Sync epic to graph database
|
|
36
49
|
|
|
37
50
|
### Context & Configuration
|
|
38
51
|
- `ginko context` - Manage session context
|
|
@@ -180,6 +193,27 @@ ginko context --show # View tracked files
|
|
|
180
193
|
ginko compact # Clean up old context
|
|
181
194
|
```
|
|
182
195
|
|
|
196
|
+
### Planning with Epics
|
|
197
|
+
```bash
|
|
198
|
+
ginko epic # AI guides epic creation conversation
|
|
199
|
+
# AI asks about goals, success criteria, scope, sprints
|
|
200
|
+
# Creates docs/sprints/EPIC-XXX-name.md and sprint files
|
|
201
|
+
|
|
202
|
+
ginko epic --list # List all epics
|
|
203
|
+
ginko epic --view # View epic with sprint progress
|
|
204
|
+
ginko epic --sync # Sync to graph database
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Project Charter
|
|
208
|
+
```bash
|
|
209
|
+
ginko charter # AI guides charter conversation
|
|
210
|
+
# AI asks about purpose, users, success criteria, scope
|
|
211
|
+
# Creates docs/PROJECT-CHARTER.md
|
|
212
|
+
|
|
213
|
+
ginko charter --view # View existing charter
|
|
214
|
+
ginko charter --edit # Refine charter conversationally
|
|
215
|
+
```
|
|
216
|
+
|
|
183
217
|
## Future Features
|
|
184
218
|
|
|
185
219
|
### Persistent Context Modules (Coming Soon)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: command
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-11-25
|
|
5
|
+
* @tags: [epic, planning, sprint-creation, graph-sync]
|
|
6
|
+
* @related: [charter.ts, ../templates/epic-template.md]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: medium
|
|
9
|
+
* @dependencies: [chalk, fs, path]
|
|
10
|
+
*/
|
|
11
|
+
interface EpicOptions {
|
|
12
|
+
view?: boolean;
|
|
13
|
+
list?: boolean;
|
|
14
|
+
noAi?: boolean;
|
|
15
|
+
sync?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Epic command - Create and manage epics with sprint breakdown
|
|
19
|
+
* Usage:
|
|
20
|
+
* ginko epic - Output template for AI-mediated creation (default)
|
|
21
|
+
* ginko epic --no-ai - Interactive mode (future)
|
|
22
|
+
* ginko epic --list - List existing epics
|
|
23
|
+
* ginko epic --view - View epic details
|
|
24
|
+
* ginko epic --sync - Sync epic to graph
|
|
25
|
+
*/
|
|
26
|
+
export declare function epicCommand(options?: EpicOptions): Promise<void>;
|
|
27
|
+
export declare const epicExamples: string[];
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=epic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../src/commands/epic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAMD;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoC1E;AA4UD,eAAO,MAAM,YAAY,UAKxB,CAAC"}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: command
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-11-25
|
|
5
|
+
* @tags: [epic, planning, sprint-creation, graph-sync]
|
|
6
|
+
* @related: [charter.ts, ../templates/epic-template.md]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: medium
|
|
9
|
+
* @dependencies: [chalk, fs, path]
|
|
10
|
+
*/
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
import * as fs from 'fs/promises';
|
|
13
|
+
import * as path from 'path';
|
|
14
|
+
import { existsSync } from 'fs';
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Main Command
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Epic command - Create and manage epics with sprint breakdown
|
|
20
|
+
* Usage:
|
|
21
|
+
* ginko epic - Output template for AI-mediated creation (default)
|
|
22
|
+
* ginko epic --no-ai - Interactive mode (future)
|
|
23
|
+
* ginko epic --list - List existing epics
|
|
24
|
+
* ginko epic --view - View epic details
|
|
25
|
+
* ginko epic --sync - Sync epic to graph
|
|
26
|
+
*/
|
|
27
|
+
export async function epicCommand(options = {}) {
|
|
28
|
+
try {
|
|
29
|
+
const projectRoot = process.cwd();
|
|
30
|
+
// Handle --list flag
|
|
31
|
+
if (options.list) {
|
|
32
|
+
await listEpics(projectRoot);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// Handle --view flag
|
|
36
|
+
if (options.view) {
|
|
37
|
+
await viewEpics(projectRoot);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Handle --sync flag
|
|
41
|
+
if (options.sync) {
|
|
42
|
+
await syncEpicToGraph(projectRoot);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
// Default: AI-mediated mode (output template) unless --no-ai specified
|
|
46
|
+
if (!options.noAi) {
|
|
47
|
+
await outputEpicTemplate();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
// --no-ai: Interactive mode (not yet implemented)
|
|
51
|
+
console.log(chalk.yellow('\n⚠️ Interactive epic creation not yet implemented'));
|
|
52
|
+
console.log(chalk.dim(' Use AI-mediated mode (default) for now\n'));
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.error(chalk.red(`\n❌ Error: ${error.message}`));
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// ============================================================================
|
|
60
|
+
// Output Epic Template (AI-Mediated Mode)
|
|
61
|
+
// ============================================================================
|
|
62
|
+
/**
|
|
63
|
+
* Output epic template for AI-mediated creation
|
|
64
|
+
* The AI partner will read this, conduct a natural conversation, and create the epic
|
|
65
|
+
*/
|
|
66
|
+
async function outputEpicTemplate() {
|
|
67
|
+
const templatePath = new URL('../templates/epic-template.md', import.meta.url);
|
|
68
|
+
try {
|
|
69
|
+
const template = await fs.readFile(templatePath, 'utf-8');
|
|
70
|
+
// Output template to stdout (AI partner will read this)
|
|
71
|
+
console.log(template);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.error(chalk.red(`\n❌ Error reading epic template: ${error.message}`));
|
|
75
|
+
console.error(chalk.yellow('Template path:', templatePath.pathname));
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// ============================================================================
|
|
80
|
+
// List Epics
|
|
81
|
+
// ============================================================================
|
|
82
|
+
/**
|
|
83
|
+
* List all existing epics
|
|
84
|
+
*/
|
|
85
|
+
async function listEpics(projectRoot) {
|
|
86
|
+
const sprintsDir = path.join(projectRoot, 'docs', 'sprints');
|
|
87
|
+
if (!existsSync(sprintsDir)) {
|
|
88
|
+
console.log(chalk.yellow('\n📋 No epics found'));
|
|
89
|
+
console.log(chalk.dim(' Run `ginko epic` to create one\n'));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
const files = await fs.readdir(sprintsDir);
|
|
94
|
+
const epicFiles = files.filter(f => f.startsWith('EPIC-') && f.endsWith('.md'));
|
|
95
|
+
if (epicFiles.length === 0) {
|
|
96
|
+
console.log(chalk.yellow('\n📋 No epics found'));
|
|
97
|
+
console.log(chalk.dim(' Run `ginko epic` to create one\n'));
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
console.log(chalk.green('\n📋 Epics:\n'));
|
|
101
|
+
for (const file of epicFiles) {
|
|
102
|
+
const content = await fs.readFile(path.join(sprintsDir, file), 'utf-8');
|
|
103
|
+
const titleMatch = content.match(/^# (EPIC-\d+): (.+)$/m);
|
|
104
|
+
const statusMatch = content.match(/status: (\w+)/);
|
|
105
|
+
const progressMatch = content.match(/Progress.*?(\d+)%/i);
|
|
106
|
+
const epicId = titleMatch?.[1] || file.replace('.md', '');
|
|
107
|
+
const title = titleMatch?.[2] || 'Untitled';
|
|
108
|
+
const status = statusMatch?.[1] || 'unknown';
|
|
109
|
+
const progress = progressMatch?.[1] || '0';
|
|
110
|
+
const statusIcon = status === 'active' ? chalk.green('●') :
|
|
111
|
+
status === 'complete' ? chalk.blue('✓') :
|
|
112
|
+
chalk.dim('○');
|
|
113
|
+
console.log(` ${statusIcon} ${chalk.bold(epicId)}: ${title}`);
|
|
114
|
+
console.log(chalk.dim(` Progress: ${progress}% | Status: ${status}`));
|
|
115
|
+
console.log('');
|
|
116
|
+
}
|
|
117
|
+
// List associated sprints
|
|
118
|
+
const sprintFiles = files.filter(f => f.startsWith('SPRINT-') && f.endsWith('.md'));
|
|
119
|
+
if (sprintFiles.length > 0) {
|
|
120
|
+
console.log(chalk.dim(` 📁 ${sprintFiles.length} sprint files in docs/sprints/\n`));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
console.error(chalk.red(`\n❌ Error listing epics: ${error.message}`));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// ============================================================================
|
|
128
|
+
// View Epic Details
|
|
129
|
+
// ============================================================================
|
|
130
|
+
/**
|
|
131
|
+
* View epic details with sprint breakdown
|
|
132
|
+
*/
|
|
133
|
+
async function viewEpics(projectRoot) {
|
|
134
|
+
const sprintsDir = path.join(projectRoot, 'docs', 'sprints');
|
|
135
|
+
if (!existsSync(sprintsDir)) {
|
|
136
|
+
console.log(chalk.yellow('\n📋 No epics found'));
|
|
137
|
+
console.log(chalk.dim(' Run `ginko epic` to create one\n'));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
try {
|
|
141
|
+
const files = await fs.readdir(sprintsDir);
|
|
142
|
+
const epicFiles = files.filter(f => f.startsWith('EPIC-') && f.endsWith('.md'));
|
|
143
|
+
if (epicFiles.length === 0) {
|
|
144
|
+
console.log(chalk.yellow('\n📋 No epics found'));
|
|
145
|
+
console.log(chalk.dim(' Run `ginko epic` to create one\n'));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
for (const file of epicFiles) {
|
|
149
|
+
const content = await fs.readFile(path.join(sprintsDir, file), 'utf-8');
|
|
150
|
+
// Parse epic header
|
|
151
|
+
const titleMatch = content.match(/^# (EPIC-\d+): (.+)$/m);
|
|
152
|
+
const goalMatch = content.match(/## Goal\n\n(.+?)(?=\n\n##|\n##|$)/s);
|
|
153
|
+
const successMatch = content.match(/## Success Criteria\n\n([\s\S]+?)(?=\n\n##|\n##|$)/);
|
|
154
|
+
const epicId = titleMatch?.[1] || file.replace('.md', '');
|
|
155
|
+
const title = titleMatch?.[2] || 'Untitled';
|
|
156
|
+
const goal = goalMatch?.[1]?.trim() || 'No goal defined';
|
|
157
|
+
console.log(chalk.green('\n╔════════════════════════════════════════════════════╗'));
|
|
158
|
+
console.log(chalk.green(`║ ${epicId}: ${title.substring(0, 40).padEnd(40)} ║`));
|
|
159
|
+
console.log(chalk.green('╚════════════════════════════════════════════════════╝\n'));
|
|
160
|
+
console.log(chalk.bold('Goal:'));
|
|
161
|
+
console.log(chalk.dim(` ${goal}\n`));
|
|
162
|
+
if (successMatch) {
|
|
163
|
+
console.log(chalk.bold('Success Criteria:'));
|
|
164
|
+
const criteria = successMatch[1].split('\n').filter(l => l.trim().startsWith('-'));
|
|
165
|
+
criteria.forEach(c => {
|
|
166
|
+
const done = c.includes('[x]');
|
|
167
|
+
const text = c.replace(/^-\s*\[.\]\s*/, '').trim();
|
|
168
|
+
console.log(done ? chalk.green(` ✓ ${text}`) : chalk.dim(` ○ ${text}`));
|
|
169
|
+
});
|
|
170
|
+
console.log('');
|
|
171
|
+
}
|
|
172
|
+
// Find associated sprints
|
|
173
|
+
const epicPrefix = epicId.toLowerCase().replace('epic-', 'epic');
|
|
174
|
+
const associatedSprints = files.filter(f => f.startsWith('SPRINT-') &&
|
|
175
|
+
f.toLowerCase().includes(epicPrefix));
|
|
176
|
+
if (associatedSprints.length > 0) {
|
|
177
|
+
console.log(chalk.bold('Sprints:'));
|
|
178
|
+
for (const sprintFile of associatedSprints) {
|
|
179
|
+
const sprintContent = await fs.readFile(path.join(sprintsDir, sprintFile), 'utf-8');
|
|
180
|
+
const sprintTitleMatch = sprintContent.match(/^# SPRINT: (.+)$/m);
|
|
181
|
+
const progressMatch = sprintContent.match(/\*\*Progress:\*\*\s*(\d+)%/);
|
|
182
|
+
const sprintTitle = sprintTitleMatch?.[1] || sprintFile;
|
|
183
|
+
const progress = progressMatch?.[1] || '0';
|
|
184
|
+
const progressBar = createProgressBar(parseInt(progress));
|
|
185
|
+
console.log(` ${progressBar} ${sprintTitle}`);
|
|
186
|
+
}
|
|
187
|
+
console.log('');
|
|
188
|
+
}
|
|
189
|
+
console.log(chalk.dim(`📄 File: docs/sprints/${file}\n`));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
console.error(chalk.red(`\n❌ Error viewing epics: ${error.message}`));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// ============================================================================
|
|
197
|
+
// Sync Epic to Graph
|
|
198
|
+
// ============================================================================
|
|
199
|
+
/**
|
|
200
|
+
* Sync epic and sprints to graph database
|
|
201
|
+
*/
|
|
202
|
+
async function syncEpicToGraph(projectRoot) {
|
|
203
|
+
console.log(chalk.blue('\n📡 Syncing epic to graph...\n'));
|
|
204
|
+
// Check for graph configuration (in .ginko/graph/config.json)
|
|
205
|
+
const graphConfigPath = path.join(projectRoot, '.ginko', 'graph', 'config.json');
|
|
206
|
+
if (!existsSync(graphConfigPath)) {
|
|
207
|
+
console.log(chalk.yellow('⚠️ Graph not configured'));
|
|
208
|
+
console.log(chalk.dim(' Run `ginko graph init` first\n'));
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
try {
|
|
212
|
+
// Read graph config
|
|
213
|
+
const graphConfig = JSON.parse(await fs.readFile(graphConfigPath, 'utf-8'));
|
|
214
|
+
const graphId = graphConfig.graphId;
|
|
215
|
+
if (!graphId) {
|
|
216
|
+
console.log(chalk.yellow('⚠️ No graph ID configured'));
|
|
217
|
+
console.log(chalk.dim(' Run `ginko graph init` to configure\n'));
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
// Find epic files
|
|
221
|
+
const sprintsDir = path.join(projectRoot, 'docs', 'sprints');
|
|
222
|
+
const files = await fs.readdir(sprintsDir);
|
|
223
|
+
const epicFiles = files.filter(f => f.startsWith('EPIC-') && f.endsWith('.md'));
|
|
224
|
+
if (epicFiles.length === 0) {
|
|
225
|
+
console.log(chalk.yellow('📋 No epics to sync'));
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
// Import API client dynamically to avoid circular deps
|
|
229
|
+
const { GraphApiClient } = await import('./graph/api-client.js');
|
|
230
|
+
const client = new GraphApiClient();
|
|
231
|
+
for (const file of epicFiles) {
|
|
232
|
+
const content = await fs.readFile(path.join(sprintsDir, file), 'utf-8');
|
|
233
|
+
const epicData = parseEpicContent(content);
|
|
234
|
+
console.log(chalk.dim(` Syncing ${epicData.id}...`));
|
|
235
|
+
// Sync epic node
|
|
236
|
+
await client.syncEpic(epicData);
|
|
237
|
+
console.log(chalk.green(` ✓ ${epicData.id}: ${epicData.title}`));
|
|
238
|
+
// Find and sync associated sprints
|
|
239
|
+
const epicPrefix = epicData.id.toLowerCase().replace('epic-', 'epic');
|
|
240
|
+
const sprintFiles = files.filter(f => f.startsWith('SPRINT-') &&
|
|
241
|
+
f.toLowerCase().includes(epicPrefix));
|
|
242
|
+
for (const sprintFile of sprintFiles) {
|
|
243
|
+
const sprintContent = await fs.readFile(path.join(sprintsDir, sprintFile), 'utf-8');
|
|
244
|
+
// Use existing sprint sync
|
|
245
|
+
await client.syncSprint(graphId, sprintContent);
|
|
246
|
+
const sprintName = sprintFile.replace('.md', '');
|
|
247
|
+
console.log(chalk.dim(` ✓ ${sprintName}`));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
console.log(chalk.green('\n✅ Epic sync complete!\n'));
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
console.error(chalk.red(`\n❌ Sync failed: ${error.message}`));
|
|
254
|
+
console.log(chalk.dim(' Check graph connection and authentication\n'));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
// ============================================================================
|
|
258
|
+
// Helpers
|
|
259
|
+
// ============================================================================
|
|
260
|
+
/**
|
|
261
|
+
* Parse epic content from markdown
|
|
262
|
+
*/
|
|
263
|
+
function parseEpicContent(content) {
|
|
264
|
+
const titleMatch = content.match(/^# (EPIC-\d+): (.+)$/m);
|
|
265
|
+
const goalMatch = content.match(/## Goal\n\n(.+?)(?=\n\n##|\n##|$)/s);
|
|
266
|
+
const visionMatch = content.match(/## Vision\n\n(.+?)(?=\n\n##|\n##|$)/s);
|
|
267
|
+
const statusMatch = content.match(/status: (\w+)/);
|
|
268
|
+
// Parse success criteria
|
|
269
|
+
const successSection = content.match(/## Success Criteria\n\n([\s\S]+?)(?=\n\n##|\n##|$)/);
|
|
270
|
+
const successCriteria = successSection?.[1]
|
|
271
|
+
?.split('\n')
|
|
272
|
+
.filter(l => l.trim().startsWith('-'))
|
|
273
|
+
.map(l => l.replace(/^-\s*\[.\]\s*/, '').trim()) || [];
|
|
274
|
+
// Calculate progress from checked items
|
|
275
|
+
const totalCriteria = successCriteria.length;
|
|
276
|
+
const completedCriteria = (successSection?.[1]?.match(/\[x\]/gi) || []).length;
|
|
277
|
+
const progress = totalCriteria > 0 ? Math.round((completedCriteria / totalCriteria) * 100) : 0;
|
|
278
|
+
// Parse scope
|
|
279
|
+
const inScopeMatch = content.match(/### In Scope\n([\s\S]+?)(?=\n###|\n##|$)/);
|
|
280
|
+
const outScopeMatch = content.match(/### Out of Scope\n([\s\S]+?)(?=\n###|\n##|$)/);
|
|
281
|
+
const inScope = inScopeMatch?.[1]
|
|
282
|
+
?.split('\n')
|
|
283
|
+
.filter(l => l.trim().startsWith('-'))
|
|
284
|
+
.map(l => l.replace(/^-\s*/, '').trim()) || [];
|
|
285
|
+
const outOfScope = outScopeMatch?.[1]
|
|
286
|
+
?.split('\n')
|
|
287
|
+
.filter(l => l.trim().startsWith('-'))
|
|
288
|
+
.map(l => l.replace(/^-\s*/, '').trim()) || [];
|
|
289
|
+
return {
|
|
290
|
+
id: titleMatch?.[1] || 'EPIC-000',
|
|
291
|
+
title: titleMatch?.[2] || 'Untitled Epic',
|
|
292
|
+
goal: goalMatch?.[1]?.trim() || '',
|
|
293
|
+
vision: visionMatch?.[1]?.trim() || '',
|
|
294
|
+
status: statusMatch?.[1] || 'active',
|
|
295
|
+
progress,
|
|
296
|
+
successCriteria,
|
|
297
|
+
inScope,
|
|
298
|
+
outOfScope,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Create a simple progress bar
|
|
303
|
+
*/
|
|
304
|
+
function createProgressBar(percent) {
|
|
305
|
+
const filled = Math.round(percent / 10);
|
|
306
|
+
const empty = 10 - filled;
|
|
307
|
+
const bar = '█'.repeat(filled) + '░'.repeat(empty);
|
|
308
|
+
const color = percent === 100 ? chalk.green :
|
|
309
|
+
percent >= 50 ? chalk.yellow :
|
|
310
|
+
chalk.dim;
|
|
311
|
+
return color(`[${bar}] ${percent}%`);
|
|
312
|
+
}
|
|
313
|
+
// ============================================================================
|
|
314
|
+
// Export Examples
|
|
315
|
+
// ============================================================================
|
|
316
|
+
export const epicExamples = [
|
|
317
|
+
'ginko epic # Create new epic via AI conversation',
|
|
318
|
+
'ginko epic --list # List existing epics',
|
|
319
|
+
'ginko epic --view # View epic details with sprints',
|
|
320
|
+
'ginko epic --sync # Sync epic to graph database',
|
|
321
|
+
];
|
|
322
|
+
//# sourceMappingURL=epic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"epic.js","sourceRoot":"","sources":["../../src/commands/epic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAahC,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,UAAuB,EAAE;IACzD,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAElC,qBAAqB;QACrB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,SAAS,CAAC,WAAW,CAAC,CAAC;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yD;IACzD,sDAAsD;CACvD,CAAC"}
|
|
@@ -223,6 +223,110 @@ export declare class GraphApiClient {
|
|
|
223
223
|
* Returns MUST_FOLLOW relationships between task and ADRs
|
|
224
224
|
*/
|
|
225
225
|
getTaskConstraints(taskId: string): Promise<TaskConstraintsResponse>;
|
|
226
|
+
/**
|
|
227
|
+
* Get patterns for a task (EPIC-002 Sprint 3)
|
|
228
|
+
* Returns APPLIES_PATTERN relationships with confidence scores
|
|
229
|
+
*/
|
|
230
|
+
getTaskPatterns(taskId: string): Promise<TaskPatternsResponse>;
|
|
231
|
+
/**
|
|
232
|
+
* Get gotchas for a task (EPIC-002 Sprint 3)
|
|
233
|
+
* Returns AVOID_GOTCHA relationships with severity and resolution stats
|
|
234
|
+
*/
|
|
235
|
+
getTaskGotchas(taskId: string): Promise<TaskGotchasResponse>;
|
|
236
|
+
/**
|
|
237
|
+
* Record a gotcha encounter (EPIC-002 Sprint 3 TASK-4)
|
|
238
|
+
* Called when `ginko log --category=gotcha` references a gotcha
|
|
239
|
+
*
|
|
240
|
+
* @param gotchaId - The gotcha ID to increment encounter count
|
|
241
|
+
* @param context - Optional context about the encounter
|
|
242
|
+
* @returns Updated gotcha stats including effectiveness score
|
|
243
|
+
*/
|
|
244
|
+
recordGotchaEncounter(gotchaId: string, context?: {
|
|
245
|
+
description?: string;
|
|
246
|
+
sessionId?: string;
|
|
247
|
+
commitHash?: string;
|
|
248
|
+
}): Promise<GotchaEncounterResponse>;
|
|
249
|
+
/**
|
|
250
|
+
* Resolve a gotcha (EPIC-002 Sprint 3 TASK-4)
|
|
251
|
+
* Links the gotcha to a fix commit
|
|
252
|
+
*
|
|
253
|
+
* @param gotchaId - The gotcha ID to mark as resolved
|
|
254
|
+
* @param data - Resolution details including commit hash
|
|
255
|
+
* @returns Updated gotcha stats
|
|
256
|
+
*/
|
|
257
|
+
resolveGotcha(gotchaId: string, data: {
|
|
258
|
+
commitHash: string;
|
|
259
|
+
description?: string;
|
|
260
|
+
sessionId?: string;
|
|
261
|
+
files?: string[];
|
|
262
|
+
}): Promise<GotchaResolveResponse>;
|
|
263
|
+
/**
|
|
264
|
+
* Get gotcha resolution history (EPIC-002 Sprint 3 TASK-4)
|
|
265
|
+
*
|
|
266
|
+
* @param gotchaId - The gotcha ID to get history for
|
|
267
|
+
* @returns Gotcha stats and resolution history
|
|
268
|
+
*/
|
|
269
|
+
getGotchaResolutions(gotchaId: string): Promise<GotchaResolutionsResponse>;
|
|
270
|
+
/**
|
|
271
|
+
* Sync an epic to the graph database
|
|
272
|
+
* Creates Epic node with relationships to sprints
|
|
273
|
+
*/
|
|
274
|
+
syncEpic(epicData: EpicSyncData): Promise<EpicSyncResponse>;
|
|
275
|
+
/**
|
|
276
|
+
* Sync a sprint to the graph database
|
|
277
|
+
* Creates Sprint and Task nodes with relationships
|
|
278
|
+
*/
|
|
279
|
+
syncSprint(graphId: string, sprintContent: string): Promise<SprintSyncResponse>;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Gotcha encounter response (EPIC-002 Sprint 3 TASK-4)
|
|
283
|
+
*/
|
|
284
|
+
export interface GotchaEncounterResponse {
|
|
285
|
+
gotcha: {
|
|
286
|
+
id: string;
|
|
287
|
+
encounters: number;
|
|
288
|
+
resolutions: number;
|
|
289
|
+
effectivenessScore: number;
|
|
290
|
+
};
|
|
291
|
+
encounter: {
|
|
292
|
+
timestamp: string;
|
|
293
|
+
description?: string;
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Gotcha resolve response (EPIC-002 Sprint 3 TASK-4)
|
|
298
|
+
*/
|
|
299
|
+
export interface GotchaResolveResponse {
|
|
300
|
+
gotcha: {
|
|
301
|
+
id: string;
|
|
302
|
+
encounters: number;
|
|
303
|
+
resolutions: number;
|
|
304
|
+
effectivenessScore: number;
|
|
305
|
+
};
|
|
306
|
+
resolution: {
|
|
307
|
+
timestamp: string;
|
|
308
|
+
commitHash: string;
|
|
309
|
+
description?: string;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Gotcha resolutions response (EPIC-002 Sprint 3 TASK-4)
|
|
314
|
+
*/
|
|
315
|
+
export interface GotchaResolutionsResponse {
|
|
316
|
+
gotcha: {
|
|
317
|
+
id: string;
|
|
318
|
+
title: string;
|
|
319
|
+
encounters: number;
|
|
320
|
+
resolutions: number;
|
|
321
|
+
effectivenessScore: number;
|
|
322
|
+
};
|
|
323
|
+
resolutionHistory: Array<{
|
|
324
|
+
commitHash: string;
|
|
325
|
+
timestamp: string;
|
|
326
|
+
description?: string;
|
|
327
|
+
sessionId?: string;
|
|
328
|
+
files?: string[];
|
|
329
|
+
}>;
|
|
226
330
|
}
|
|
227
331
|
/**
|
|
228
332
|
* Task constraints response from API (EPIC-002 Phase 1)
|
|
@@ -248,6 +352,103 @@ export interface TaskConstraintsResponse {
|
|
|
248
352
|
}>;
|
|
249
353
|
count: number;
|
|
250
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* Task patterns response from API (EPIC-002 Sprint 3)
|
|
357
|
+
*/
|
|
358
|
+
export interface TaskPatternsResponse {
|
|
359
|
+
task: {
|
|
360
|
+
id: string;
|
|
361
|
+
title: string;
|
|
362
|
+
status: string;
|
|
363
|
+
};
|
|
364
|
+
patterns: Array<{
|
|
365
|
+
pattern: {
|
|
366
|
+
id: string;
|
|
367
|
+
title: string;
|
|
368
|
+
category: string;
|
|
369
|
+
confidence: 'high' | 'medium' | 'low';
|
|
370
|
+
confidenceScore: number;
|
|
371
|
+
usageCount: number;
|
|
372
|
+
content?: string;
|
|
373
|
+
};
|
|
374
|
+
relationship: {
|
|
375
|
+
source: string;
|
|
376
|
+
extracted_at: string;
|
|
377
|
+
};
|
|
378
|
+
usages: Array<{
|
|
379
|
+
fileId: string;
|
|
380
|
+
context?: string;
|
|
381
|
+
}>;
|
|
382
|
+
}>;
|
|
383
|
+
count: number;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Task gotchas response from API (EPIC-002 Sprint 3)
|
|
387
|
+
*/
|
|
388
|
+
export interface TaskGotchasResponse {
|
|
389
|
+
task: {
|
|
390
|
+
id: string;
|
|
391
|
+
title: string;
|
|
392
|
+
status: string;
|
|
393
|
+
};
|
|
394
|
+
gotchas: Array<{
|
|
395
|
+
gotcha: {
|
|
396
|
+
id: string;
|
|
397
|
+
title: string;
|
|
398
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
399
|
+
confidence: 'high' | 'medium' | 'low';
|
|
400
|
+
confidenceScore: number;
|
|
401
|
+
symptom?: string;
|
|
402
|
+
cause?: string;
|
|
403
|
+
solution?: string;
|
|
404
|
+
};
|
|
405
|
+
relationship: {
|
|
406
|
+
source: string;
|
|
407
|
+
extracted_at: string;
|
|
408
|
+
};
|
|
409
|
+
stats: {
|
|
410
|
+
encounters: number;
|
|
411
|
+
resolutions: number;
|
|
412
|
+
resolutionRate: number;
|
|
413
|
+
};
|
|
414
|
+
}>;
|
|
415
|
+
count: number;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Sync an epic to the graph database
|
|
419
|
+
*/
|
|
420
|
+
export interface EpicSyncData {
|
|
421
|
+
id: string;
|
|
422
|
+
title: string;
|
|
423
|
+
goal: string;
|
|
424
|
+
vision: string;
|
|
425
|
+
status: string;
|
|
426
|
+
progress: number;
|
|
427
|
+
successCriteria: string[];
|
|
428
|
+
inScope: string[];
|
|
429
|
+
outOfScope: string[];
|
|
430
|
+
}
|
|
431
|
+
export interface EpicSyncResponse {
|
|
432
|
+
success: boolean;
|
|
433
|
+
epic: {
|
|
434
|
+
id: string;
|
|
435
|
+
title: string;
|
|
436
|
+
status: string;
|
|
437
|
+
};
|
|
438
|
+
nodesCreated: number;
|
|
439
|
+
relationshipsCreated: number;
|
|
440
|
+
}
|
|
441
|
+
export interface SprintSyncResponse {
|
|
442
|
+
success: boolean;
|
|
443
|
+
sprint: {
|
|
444
|
+
id: string;
|
|
445
|
+
name: string;
|
|
446
|
+
progress: number;
|
|
447
|
+
};
|
|
448
|
+
nodes: number;
|
|
449
|
+
relationships: number;
|
|
450
|
+
nextTask?: string;
|
|
451
|
+
}
|
|
251
452
|
/**
|
|
252
453
|
* Helper function to create graph events with default client
|
|
253
454
|
* Used by event-queue for async syncing
|