@ginkoai/cli 1.4.13 → 1.6.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/commands/graph/api-client.d.ts +16 -1
- package/dist/commands/graph/api-client.d.ts.map +1 -1
- package/dist/commands/graph/api-client.js +79 -4
- package/dist/commands/graph/api-client.js.map +1 -1
- package/dist/commands/graph/health.d.ts +22 -0
- package/dist/commands/graph/health.d.ts.map +1 -0
- package/dist/commands/graph/health.js +37 -0
- package/dist/commands/graph/health.js.map +1 -0
- package/dist/commands/graph/index.d.ts.map +1 -1
- package/dist/commands/graph/index.js +8 -0
- package/dist/commands/graph/index.js.map +1 -1
- package/dist/commands/handoff.d.ts +7 -1
- package/dist/commands/handoff.d.ts.map +1 -1
- package/dist/commands/handoff.js +8 -0
- package/dist/commands/handoff.js.map +1 -1
- package/dist/commands/log.d.ts +5 -4
- package/dist/commands/log.d.ts.map +1 -1
- package/dist/commands/log.js +197 -216
- package/dist/commands/log.js.map +1 -1
- package/dist/commands/start/start-reflection.d.ts +22 -0
- package/dist/commands/start/start-reflection.d.ts.map +1 -1
- package/dist/commands/start/start-reflection.js +249 -30
- package/dist/commands/start/start-reflection.js.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/charter-loader.d.ts +74 -0
- package/dist/lib/charter-loader.d.ts.map +1 -0
- package/dist/lib/charter-loader.js +328 -0
- package/dist/lib/charter-loader.js.map +1 -0
- package/dist/lib/context-loader-events.d.ts +49 -0
- package/dist/lib/context-loader-events.d.ts.map +1 -1
- package/dist/lib/context-loader-events.js +280 -34
- package/dist/lib/context-loader-events.js.map +1 -1
- package/dist/lib/event-logger.d.ts +8 -5
- package/dist/lib/event-logger.d.ts.map +1 -1
- package/dist/lib/event-logger.js +54 -14
- package/dist/lib/event-logger.js.map +1 -1
- package/dist/lib/event-task-linker.d.ts +81 -0
- package/dist/lib/event-task-linker.d.ts.map +1 -0
- package/dist/lib/event-task-linker.js +132 -0
- package/dist/lib/event-task-linker.js.map +1 -0
- package/dist/lib/output-formatter.d.ts +172 -0
- package/dist/lib/output-formatter.d.ts.map +1 -0
- package/dist/lib/output-formatter.js +219 -0
- package/dist/lib/output-formatter.js.map +1 -0
- package/dist/lib/session-cursor.d.ts +12 -5
- package/dist/lib/session-cursor.d.ts.map +1 -1
- package/dist/lib/session-cursor.js +12 -5
- package/dist/lib/session-cursor.js.map +1 -1
- package/dist/lib/sprint-loader.d.ts +91 -0
- package/dist/lib/sprint-loader.d.ts.map +1 -0
- package/dist/lib/sprint-loader.js +296 -0
- package/dist/lib/sprint-loader.js.map +1 -0
- package/dist/lib/sprint-parser.d.ts +79 -0
- package/dist/lib/sprint-parser.d.ts.map +1 -0
- package/dist/lib/sprint-parser.js +346 -0
- package/dist/lib/sprint-parser.js.map +1 -0
- package/dist/lib/write-dispatcher/adapters/local-adapter.d.ts.map +1 -1
- package/dist/lib/write-dispatcher/adapters/local-adapter.js +8 -2
- package/dist/lib/write-dispatcher/adapters/local-adapter.js.map +1 -1
- package/dist/utils/command-helpers.d.ts +76 -0
- package/dist/utils/command-helpers.d.ts.map +1 -0
- package/dist/utils/command-helpers.js +314 -0
- package/dist/utils/command-helpers.js.map +1 -0
- package/dist/utils/graph-health-monitor.d.ts +75 -0
- package/dist/utils/graph-health-monitor.d.ts.map +1 -0
- package/dist/utils/graph-health-monitor.js +108 -0
- package/dist/utils/graph-health-monitor.js.map +1 -0
- package/dist/utils/synthesis.d.ts.map +1 -1
- package/dist/utils/synthesis.js +17 -9
- package/dist/utils/synthesis.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-11-19
|
|
5
|
+
* @tags: [charter, strategic-context, epic-001]
|
|
6
|
+
* @related: [context-loader-events.ts, start-reflection.ts]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: low
|
|
9
|
+
* @dependencies: [fs-extra, path]
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Structured charter data
|
|
13
|
+
*/
|
|
14
|
+
export interface Charter {
|
|
15
|
+
purpose: string;
|
|
16
|
+
goals: string[];
|
|
17
|
+
successCriteria: string[];
|
|
18
|
+
scope?: {
|
|
19
|
+
inScope: string[];
|
|
20
|
+
outOfScope: string[];
|
|
21
|
+
tbd: string[];
|
|
22
|
+
};
|
|
23
|
+
constraints?: string;
|
|
24
|
+
team?: string[];
|
|
25
|
+
updatedAt?: Date;
|
|
26
|
+
version?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Charter graph structure for syncing to Neo4j
|
|
30
|
+
* Represents nodes and relationships extracted from charter
|
|
31
|
+
*/
|
|
32
|
+
export interface CharterGraph {
|
|
33
|
+
epic: {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
vision: string;
|
|
37
|
+
purpose: string;
|
|
38
|
+
};
|
|
39
|
+
problems: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
description: string;
|
|
42
|
+
}>;
|
|
43
|
+
goals: Array<{
|
|
44
|
+
id: string;
|
|
45
|
+
text: string;
|
|
46
|
+
type: 'qualitative' | 'quantitative';
|
|
47
|
+
}>;
|
|
48
|
+
users: Array<{
|
|
49
|
+
id: string;
|
|
50
|
+
description: string;
|
|
51
|
+
segment: 'primary' | 'secondary' | 'long-term';
|
|
52
|
+
}>;
|
|
53
|
+
relationships: {
|
|
54
|
+
epicSolvesProblems: string[][];
|
|
55
|
+
epicHasGoals: string[][];
|
|
56
|
+
problemsImpactUsers: string[][];
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Load charter from filesystem
|
|
61
|
+
*
|
|
62
|
+
* @param projectRoot - Project root directory (defaults to git root)
|
|
63
|
+
* @returns Parsed charter or null if not found
|
|
64
|
+
*/
|
|
65
|
+
export declare function loadCharter(projectRoot?: string): Promise<Charter | null>;
|
|
66
|
+
/**
|
|
67
|
+
* Parse charter markdown into graph structure (TASK-1)
|
|
68
|
+
* Extracts Epic, Problem, Goal, and User nodes with relationships
|
|
69
|
+
*
|
|
70
|
+
* @param content - Raw charter markdown content
|
|
71
|
+
* @returns Structured graph data ready for Neo4j sync
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseCharterToGraph(content: string): CharterGraph;
|
|
74
|
+
//# sourceMappingURL=charter-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"charter-loader.d.ts","sourceRoot":"","sources":["../../src/lib/charter-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAmBH;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,GAAG,EAAE,MAAM,EAAE,CAAC;KACf,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,QAAQ,EAAE,KAAK,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;IACH,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,aAAa,GAAG,cAAc,CAAC;KACtC,CAAC,CAAC;IACH,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;KAChD,CAAC,CAAC;IACH,aAAa,EAAE;QACb,kBAAkB,EAAE,MAAM,EAAE,EAAE,CAAC;QAC/B,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;QACzB,mBAAmB,EAAE,MAAM,EAAE,EAAE,CAAC;KACjC,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAe/E;AAoID;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CA0KjE"}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-11-19
|
|
5
|
+
* @tags: [charter, strategic-context, epic-001]
|
|
6
|
+
* @related: [context-loader-events.ts, start-reflection.ts]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: low
|
|
9
|
+
* @dependencies: [fs-extra, path]
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Charter Loader (EPIC-001 TASK-1)
|
|
13
|
+
*
|
|
14
|
+
* Loads project charter from filesystem (docs/PROJECT-CHARTER.md)
|
|
15
|
+
* and parses into structured format for strategic context display.
|
|
16
|
+
*
|
|
17
|
+
* Charter provides AI partners with:
|
|
18
|
+
* - Project purpose and vision
|
|
19
|
+
* - Success criteria
|
|
20
|
+
* - Goals and scope boundaries
|
|
21
|
+
* - Constraints and team info
|
|
22
|
+
*/
|
|
23
|
+
import fs from 'fs-extra';
|
|
24
|
+
import path from 'path';
|
|
25
|
+
import { execSync } from 'child_process';
|
|
26
|
+
/**
|
|
27
|
+
* Load charter from filesystem
|
|
28
|
+
*
|
|
29
|
+
* @param projectRoot - Project root directory (defaults to git root)
|
|
30
|
+
* @returns Parsed charter or null if not found
|
|
31
|
+
*/
|
|
32
|
+
export async function loadCharter(projectRoot) {
|
|
33
|
+
try {
|
|
34
|
+
const root = projectRoot || await findGitRoot();
|
|
35
|
+
const charterPath = path.join(root, 'docs', 'PROJECT-CHARTER.md');
|
|
36
|
+
if (!fs.existsSync(charterPath)) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const content = await fs.readFile(charterPath, 'utf-8');
|
|
40
|
+
return parseCharterMarkdown(content);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error('Failed to load charter:', error.message);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Find git root directory
|
|
49
|
+
*/
|
|
50
|
+
async function findGitRoot() {
|
|
51
|
+
try {
|
|
52
|
+
const gitRoot = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim();
|
|
53
|
+
return gitRoot;
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
// Fallback to cwd if not in a git repo
|
|
57
|
+
return process.cwd();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parse charter markdown into structured data
|
|
62
|
+
*
|
|
63
|
+
* Extracts key sections:
|
|
64
|
+
* - Purpose (## Purpose)
|
|
65
|
+
* - Goals (extracted from Purpose or Success Criteria)
|
|
66
|
+
* - Success Criteria (## Success Criteria)
|
|
67
|
+
* - Scope (## Scope)
|
|
68
|
+
* - Constraints (## Constraints)
|
|
69
|
+
* - Team (## Team)
|
|
70
|
+
*/
|
|
71
|
+
function parseCharterMarkdown(content) {
|
|
72
|
+
const charter = {
|
|
73
|
+
purpose: '',
|
|
74
|
+
goals: [],
|
|
75
|
+
successCriteria: [],
|
|
76
|
+
};
|
|
77
|
+
// Extract version from frontmatter
|
|
78
|
+
const versionMatch = content.match(/version:\s*([^\n]+)/);
|
|
79
|
+
if (versionMatch) {
|
|
80
|
+
charter.version = versionMatch[1].trim();
|
|
81
|
+
}
|
|
82
|
+
// Extract updated date from frontmatter
|
|
83
|
+
const updatedMatch = content.match(/updated:\s*([^\n]+)/);
|
|
84
|
+
if (updatedMatch) {
|
|
85
|
+
charter.updatedAt = new Date(updatedMatch[1].trim());
|
|
86
|
+
}
|
|
87
|
+
// Extract Purpose section
|
|
88
|
+
const purposeMatch = content.match(/##\s+Purpose\s+([\s\S]*?)(?=\n##|\n---|$)/);
|
|
89
|
+
if (purposeMatch) {
|
|
90
|
+
// Get first paragraph or "Solution:" section
|
|
91
|
+
const purposeText = purposeMatch[1].trim();
|
|
92
|
+
const solutionMatch = purposeText.match(/\*\*Solution:\*\*\s+([^\n]+(?:\n(?!\*\*)[^\n]+)*)/);
|
|
93
|
+
if (solutionMatch) {
|
|
94
|
+
charter.purpose = solutionMatch[1].trim();
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// Take first substantial paragraph
|
|
98
|
+
const firstPara = purposeText.split('\n\n')[0];
|
|
99
|
+
charter.purpose = firstPara.replace(/\*\*[^*]+:\*\*/g, '').trim();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Extract Goals from Purpose section (if present)
|
|
103
|
+
if (purposeMatch) {
|
|
104
|
+
const visionMatch = purposeMatch[1].match(/\*\*Vision:\*\*\s+([^\n]+)/);
|
|
105
|
+
if (visionMatch) {
|
|
106
|
+
charter.goals.push(visionMatch[1].trim());
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Extract Success Criteria
|
|
110
|
+
const successMatch = content.match(/###?\s+(?:Qualitative|Success Criteria)\s+(?:\(Primary\))?\s+([\s\S]*?)(?=\n###?\s+(?:Quantitative|Validation|##)|$)/);
|
|
111
|
+
if (successMatch) {
|
|
112
|
+
const criteriaText = successMatch[1];
|
|
113
|
+
const checkboxes = criteriaText.match(/- \[.\]\s+\*\*([^*]+)\*\*:?([^\n]*)/g);
|
|
114
|
+
if (checkboxes) {
|
|
115
|
+
checkboxes.forEach(line => {
|
|
116
|
+
const match = line.match(/\*\*([^*]+)\*\*:?\s*([^\n]*)/);
|
|
117
|
+
if (match) {
|
|
118
|
+
const criterion = match[2] || match[1];
|
|
119
|
+
charter.successCriteria.push(criterion.trim());
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Extract Scope
|
|
125
|
+
const scopeInMatch = content.match(/###\s+In Scope[^\n]*\s+([\s\S]*?)(?=\n###|$)/);
|
|
126
|
+
const scopeOutMatch = content.match(/###\s+Out of Scope[^\n]*\s+([\s\S]*?)(?=\n###|$)/);
|
|
127
|
+
const scopeTbdMatch = content.match(/###\s+To Be Determined[^\n]*\s+([\s\S]*?)(?=\n###|$)/);
|
|
128
|
+
if (scopeInMatch || scopeOutMatch || scopeTbdMatch) {
|
|
129
|
+
charter.scope = {
|
|
130
|
+
inScope: extractBulletPoints(scopeInMatch?.[1] || ''),
|
|
131
|
+
outOfScope: extractBulletPoints(scopeOutMatch?.[1] || ''),
|
|
132
|
+
tbd: extractBulletPoints(scopeTbdMatch?.[1] || ''),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
// Extract Constraints section
|
|
136
|
+
const constraintsMatch = content.match(/##\s+Constraints\s+([\s\S]*?)(?=\n##|$)/);
|
|
137
|
+
if (constraintsMatch) {
|
|
138
|
+
charter.constraints = constraintsMatch[1].trim();
|
|
139
|
+
}
|
|
140
|
+
// Extract Team
|
|
141
|
+
const teamMatch = content.match(/##\s+Team\s+([\s\S]*?)(?=\n##|$)/);
|
|
142
|
+
if (teamMatch) {
|
|
143
|
+
const teamText = teamMatch[1];
|
|
144
|
+
const members = teamText.match(/[-*]\s+\*\*([^*]+)\*\*/g);
|
|
145
|
+
if (members) {
|
|
146
|
+
charter.team = members.map(m => m.replace(/[-*]\s+\*\*([^*]+)\*\*.*/, '$1').trim());
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return charter;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Extract bullet points from markdown section
|
|
153
|
+
*/
|
|
154
|
+
function extractBulletPoints(text) {
|
|
155
|
+
const bullets = text.match(/^[-*]\s+\*\*([^*]+)\*\*:?\s*([^\n]*)/gm);
|
|
156
|
+
if (!bullets)
|
|
157
|
+
return [];
|
|
158
|
+
return bullets.map(line => {
|
|
159
|
+
const match = line.match(/\*\*([^*]+)\*\*:?\s*([^\n]*)/);
|
|
160
|
+
if (match) {
|
|
161
|
+
return match[2].trim() || match[1].trim();
|
|
162
|
+
}
|
|
163
|
+
return line.replace(/^[-*]\s+/, '').trim();
|
|
164
|
+
}).filter(s => s.length > 0);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Parse charter markdown into graph structure (TASK-1)
|
|
168
|
+
* Extracts Epic, Problem, Goal, and User nodes with relationships
|
|
169
|
+
*
|
|
170
|
+
* @param content - Raw charter markdown content
|
|
171
|
+
* @returns Structured graph data ready for Neo4j sync
|
|
172
|
+
*/
|
|
173
|
+
export function parseCharterToGraph(content) {
|
|
174
|
+
const charter = parseCharterMarkdown(content);
|
|
175
|
+
// Generate unique IDs
|
|
176
|
+
const epicId = `epic_ginko_${Date.now()}`;
|
|
177
|
+
// Extract epic (project-level)
|
|
178
|
+
const epic = {
|
|
179
|
+
id: epicId,
|
|
180
|
+
name: 'Ginko',
|
|
181
|
+
vision: charter.goals[0] || charter.purpose,
|
|
182
|
+
purpose: charter.purpose,
|
|
183
|
+
};
|
|
184
|
+
// Extract problems from Purpose section
|
|
185
|
+
const problems = [];
|
|
186
|
+
const purposeMatch = content.match(/##\s+Purpose\s+([\s\S]*?)(?=\n##|\n---|$)/);
|
|
187
|
+
if (purposeMatch) {
|
|
188
|
+
const purposeText = purposeMatch[1];
|
|
189
|
+
// Extract problem bullets from "**Problem:**" section
|
|
190
|
+
const problemSection = purposeText.match(/\*\*Problem:\*\*\s+([\s\S]*?)(?=\*\*Solution:\*\*|$)/);
|
|
191
|
+
if (problemSection) {
|
|
192
|
+
const problemBullets = problemSection[1].match(/^[-*]\s+\*\*([^*]+)\*\*:/gm);
|
|
193
|
+
if (problemBullets) {
|
|
194
|
+
problemBullets.forEach((bullet, index) => {
|
|
195
|
+
const match = bullet.match(/\*\*([^*]+)\*\*:/);
|
|
196
|
+
if (match) {
|
|
197
|
+
const problemId = `problem_${index + 1}_${Date.now()}`;
|
|
198
|
+
problems.push({
|
|
199
|
+
id: problemId,
|
|
200
|
+
description: match[1].trim(),
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// Extract goals from Success Criteria (qualitative and quantitative)
|
|
208
|
+
const goals = [];
|
|
209
|
+
// Qualitative goals
|
|
210
|
+
const qualitativeMatch = content.match(/###\s+Qualitative\s+\(Primary\)\s+([\s\S]*?)(?=\n###|$)/);
|
|
211
|
+
if (qualitativeMatch) {
|
|
212
|
+
const checkboxes = qualitativeMatch[1].match(/- \[.\]\s+\*\*([^*]+)\*\*:?([^\n]*)/g);
|
|
213
|
+
if (checkboxes) {
|
|
214
|
+
checkboxes.forEach((line, index) => {
|
|
215
|
+
const match = line.match(/\*\*([^*]+)\*\*:?\s*([^\n]*)/);
|
|
216
|
+
if (match) {
|
|
217
|
+
const goalId = `goal_qual_${index + 1}_${Date.now()}`;
|
|
218
|
+
goals.push({
|
|
219
|
+
id: goalId,
|
|
220
|
+
text: match[1].trim(),
|
|
221
|
+
type: 'qualitative',
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
// Quantitative goals (no bold formatting)
|
|
228
|
+
const quantitativeMatch = content.match(/###\s+Quantitative\s+\(Secondary\)\s+([\s\S]*?)(?=\n###|$)/);
|
|
229
|
+
if (quantitativeMatch) {
|
|
230
|
+
const checkboxes = quantitativeMatch[1].match(/- \[.\]\s+([^\n]+)/g);
|
|
231
|
+
if (checkboxes) {
|
|
232
|
+
checkboxes.forEach((line, index) => {
|
|
233
|
+
const match = line.match(/- \[.\]\s+(.+)/);
|
|
234
|
+
if (match) {
|
|
235
|
+
const goalId = `goal_quant_${index + 1}_${Date.now()}`;
|
|
236
|
+
goals.push({
|
|
237
|
+
id: goalId,
|
|
238
|
+
text: match[1].trim(),
|
|
239
|
+
type: 'quantitative',
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// Extract users from Users section
|
|
246
|
+
const users = [];
|
|
247
|
+
const usersMatch = content.match(/##\s+Users\s+([\s\S]*?)(?=\n##|$)/);
|
|
248
|
+
if (usersMatch) {
|
|
249
|
+
const usersText = usersMatch[1];
|
|
250
|
+
// Primary users
|
|
251
|
+
const primaryMatch = usersText.match(/\*\*Primary[^:]*:\*\*\s+([\s\S]*?)(?=\n\*\*Secondary|$)/);
|
|
252
|
+
if (primaryMatch) {
|
|
253
|
+
const primaryBullets = primaryMatch[1].match(/^[-*]\s+\*\*([^*]+)\*\*/gm);
|
|
254
|
+
if (primaryBullets) {
|
|
255
|
+
primaryBullets.forEach((bullet, index) => {
|
|
256
|
+
const match = bullet.match(/\*\*([^*]+)\*\*/);
|
|
257
|
+
if (match) {
|
|
258
|
+
const userId = `user_primary_${index + 1}_${Date.now()}`;
|
|
259
|
+
users.push({
|
|
260
|
+
id: userId,
|
|
261
|
+
description: match[1].trim(),
|
|
262
|
+
segment: 'primary',
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// Secondary users
|
|
269
|
+
const secondaryMatch = usersText.match(/\*\*Secondary[^:]*:\*\*\s+([\s\S]*?)(?=\n\*\*Long-term|$)/);
|
|
270
|
+
if (secondaryMatch) {
|
|
271
|
+
const secondaryBullets = secondaryMatch[1].match(/^[-*]\s+\*\*([^*]+)\*\*/gm);
|
|
272
|
+
if (secondaryBullets) {
|
|
273
|
+
secondaryBullets.forEach((bullet, index) => {
|
|
274
|
+
const match = bullet.match(/\*\*([^*]+)\*\*/);
|
|
275
|
+
if (match) {
|
|
276
|
+
const userId = `user_secondary_${index + 1}_${Date.now()}`;
|
|
277
|
+
users.push({
|
|
278
|
+
id: userId,
|
|
279
|
+
description: match[1].trim(),
|
|
280
|
+
segment: 'secondary',
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
// Long-term users
|
|
287
|
+
const longTermMatch = usersText.match(/\*\*Long-term Vision:\*\*\s+([\s\S]*?)(?=\n\*\*|$)/);
|
|
288
|
+
if (longTermMatch) {
|
|
289
|
+
const longTermBullets = longTermMatch[1].match(/^[-*]\s+([^\n]+)/gm);
|
|
290
|
+
if (longTermBullets) {
|
|
291
|
+
longTermBullets.forEach((bullet, index) => {
|
|
292
|
+
const text = bullet.replace(/^[-*]\s+/, '').trim();
|
|
293
|
+
if (text) {
|
|
294
|
+
const userId = `user_long_term_${index + 1}_${Date.now()}`;
|
|
295
|
+
users.push({
|
|
296
|
+
id: userId,
|
|
297
|
+
description: text,
|
|
298
|
+
segment: 'long-term',
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// Build relationships
|
|
306
|
+
const epicSolvesProblems = problems.map(p => [epicId, p.id]);
|
|
307
|
+
const epicHasGoals = goals.map(g => [epicId, g.id]);
|
|
308
|
+
// Each problem impacts all primary users
|
|
309
|
+
const problemsImpactUsers = [];
|
|
310
|
+
const primaryUsers = users.filter(u => u.segment === 'primary');
|
|
311
|
+
problems.forEach(problem => {
|
|
312
|
+
primaryUsers.forEach(user => {
|
|
313
|
+
problemsImpactUsers.push([problem.id, user.id]);
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
return {
|
|
317
|
+
epic,
|
|
318
|
+
problems,
|
|
319
|
+
goals,
|
|
320
|
+
users,
|
|
321
|
+
relationships: {
|
|
322
|
+
epicSolvesProblems,
|
|
323
|
+
epicHasGoals,
|
|
324
|
+
problemsImpactUsers,
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
//# sourceMappingURL=charter-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"charter-loader.js","sourceRoot":"","sources":["../../src/lib/charter-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAoDzC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,WAAoB;IACpD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,WAAW,IAAI,MAAM,WAAW,EAAE,CAAC;QAChD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC;QAElE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC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AC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;IAChE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACzB,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC1B,mBAAmB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,KAAK;QACL,KAAK;QACL,aAAa,EAAE;YACb,kBAAkB;YAClB,YAAY;YACZ,mBAAmB;SACpB;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -89,10 +89,59 @@ export interface LoadedContext {
|
|
|
89
89
|
documents: KnowledgeNode[];
|
|
90
90
|
relatedDocs: KnowledgeNode[];
|
|
91
91
|
sprint?: Sprint;
|
|
92
|
+
strategicContext?: StrategicContextData;
|
|
92
93
|
loaded_at: Date;
|
|
93
94
|
event_count: number;
|
|
94
95
|
token_estimate: number;
|
|
95
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Strategic context from GraphQL query (EPIC-001)
|
|
99
|
+
*/
|
|
100
|
+
export interface StrategicContextData {
|
|
101
|
+
charter?: {
|
|
102
|
+
purpose: string;
|
|
103
|
+
goals: string[];
|
|
104
|
+
successCriteria: string[];
|
|
105
|
+
scope?: {
|
|
106
|
+
inScope: string[];
|
|
107
|
+
outOfScope: string[];
|
|
108
|
+
tbd: string[];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
teamActivity: Array<{
|
|
112
|
+
category: string;
|
|
113
|
+
description: string;
|
|
114
|
+
impact?: string;
|
|
115
|
+
user: string;
|
|
116
|
+
timestamp: string;
|
|
117
|
+
}>;
|
|
118
|
+
patterns: Array<{
|
|
119
|
+
title: string;
|
|
120
|
+
content: string;
|
|
121
|
+
tags: string[];
|
|
122
|
+
category?: string;
|
|
123
|
+
}>;
|
|
124
|
+
metadata: {
|
|
125
|
+
charterStatus: string;
|
|
126
|
+
teamEventCount: number;
|
|
127
|
+
patternCount: number;
|
|
128
|
+
loadTimeMs: number;
|
|
129
|
+
tokenEstimate: number;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Load recent events without cursor (TASK-011: Simplified chronological loading)
|
|
134
|
+
*
|
|
135
|
+
* Simple chronological query for last N events - no cursor state needed.
|
|
136
|
+
* Replaces cursor-based loading with direct "ORDER BY timestamp DESC LIMIT N" query.
|
|
137
|
+
*
|
|
138
|
+
* TASK-012: Cloud-first architecture
|
|
139
|
+
* - Cloud-only mode (GINKO_CLOUD_ONLY=true): Fails loudly if graph unavailable
|
|
140
|
+
* - Dual-mode (default): Falls back to strategic loading if graph fails
|
|
141
|
+
*
|
|
142
|
+
* Performance: ~2-3s for consolidated load
|
|
143
|
+
*/
|
|
144
|
+
export declare function loadRecentEvents(userId: string, projectId: string, options?: ContextLoadOptions): Promise<LoadedContext>;
|
|
96
145
|
/**
|
|
97
146
|
* Load context from cursor position by reading events backwards
|
|
98
147
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-loader-events.d.ts","sourceRoot":"","sources":["../../src/lib/context-loader-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"context-loader-events.d.ts","sourceRoot":"","sources":["../../src/lib/context-loader-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAsBH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,aAAa,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ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