jumbo-cli 2.2.0 → 2.3.1
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 +4 -6
- package/assets/skills/refine-jumbo-goals/SKILL.md +1 -1
- package/dist/application/context/sessions/get/SessionContextQueryHandler.js +1 -1
- package/dist/application/context/sessions/get/SessionContextQueryHandler.js.map +1 -1
- package/dist/application/context/sessions/start/IBrownfieldStatusReader.d.ts +17 -0
- package/dist/application/context/sessions/start/IBrownfieldStatusReader.d.ts.map +1 -0
- package/dist/application/{SolutionContextView.js → context/sessions/start/IBrownfieldStatusReader.js} +1 -1
- package/dist/application/context/sessions/start/IBrownfieldStatusReader.js.map +1 -0
- package/dist/application/context/sessions/start/LocalStartSessionGateway.d.ts +3 -3
- package/dist/application/context/sessions/start/LocalStartSessionGateway.d.ts.map +1 -1
- package/dist/application/context/sessions/start/LocalStartSessionGateway.js +3 -3
- package/dist/application/context/sessions/start/LocalStartSessionGateway.js.map +1 -1
- package/dist/application/host/IApplicationContainer.d.ts +2 -4
- package/dist/application/host/IApplicationContainer.d.ts.map +1 -1
- package/dist/infrastructure/context/sessions/start/SqliteBrownfieldStatusReader.d.ts +16 -0
- package/dist/infrastructure/context/sessions/start/SqliteBrownfieldStatusReader.d.ts.map +1 -0
- package/dist/infrastructure/context/sessions/start/SqliteBrownfieldStatusReader.js +32 -0
- package/dist/infrastructure/context/sessions/start/SqliteBrownfieldStatusReader.js.map +1 -0
- package/dist/infrastructure/host/HostBuilder.d.ts.map +1 -1
- package/dist/infrastructure/host/HostBuilder.js +7 -11
- package/dist/infrastructure/host/HostBuilder.js.map +1 -1
- package/dist/presentation/cli/commands/goals/list/GoalListOutputBuilder.d.ts +9 -5
- package/dist/presentation/cli/commands/goals/list/GoalListOutputBuilder.d.ts.map +1 -1
- package/dist/presentation/cli/commands/goals/list/GoalListOutputBuilder.js +69 -70
- package/dist/presentation/cli/commands/goals/list/GoalListOutputBuilder.js.map +1 -1
- package/dist/presentation/cli/commands/sessions/start/SessionContextOutputBuilder.d.ts +33 -0
- package/dist/presentation/cli/commands/sessions/start/SessionContextOutputBuilder.d.ts.map +1 -0
- package/dist/presentation/cli/commands/sessions/start/SessionContextOutputBuilder.js +178 -0
- package/dist/presentation/cli/commands/sessions/start/SessionContextOutputBuilder.js.map +1 -0
- package/dist/presentation/cli/commands/sessions/start/SessionGoalsOutputBuilder.d.ts +41 -0
- package/dist/presentation/cli/commands/sessions/start/SessionGoalsOutputBuilder.d.ts.map +1 -0
- package/dist/presentation/cli/commands/sessions/start/SessionGoalsOutputBuilder.js +111 -0
- package/dist/presentation/cli/commands/sessions/start/SessionGoalsOutputBuilder.js.map +1 -0
- package/dist/presentation/cli/commands/sessions/start/SessionStartOutputBuilder.d.ts +26 -0
- package/dist/presentation/cli/commands/sessions/start/SessionStartOutputBuilder.d.ts.map +1 -0
- package/dist/presentation/cli/commands/sessions/start/SessionStartOutputBuilder.js +72 -0
- package/dist/presentation/cli/commands/sessions/start/SessionStartOutputBuilder.js.map +1 -0
- package/dist/presentation/cli/commands/sessions/start/SessionStartTextRenderer.d.ts +6 -28
- package/dist/presentation/cli/commands/sessions/start/SessionStartTextRenderer.d.ts.map +1 -1
- package/dist/presentation/cli/commands/sessions/start/SessionStartTextRenderer.js +27 -223
- package/dist/presentation/cli/commands/sessions/start/SessionStartTextRenderer.js.map +1 -1
- package/dist/presentation/cli/commands/sessions/start/session.start.d.ts +1 -1
- package/dist/presentation/cli/commands/sessions/start/session.start.d.ts.map +1 -1
- package/dist/presentation/cli/commands/sessions/start/session.start.js +6 -22
- package/dist/presentation/cli/commands/sessions/start/session.start.js.map +1 -1
- package/package.json +1 -1
- package/dist/application/ISolutionContextReader.d.ts +0 -17
- package/dist/application/ISolutionContextReader.d.ts.map +0 -1
- package/dist/application/ISolutionContextReader.js +0 -3
- package/dist/application/ISolutionContextReader.js.map +0 -1
- package/dist/application/SolutionContextView.d.ts +0 -26
- package/dist/application/SolutionContextView.d.ts.map +0 -1
- package/dist/application/SolutionContextView.js.map +0 -1
- package/dist/application/UnprimedBrownfieldQualifier.d.ts +0 -29
- package/dist/application/UnprimedBrownfieldQualifier.d.ts.map +0 -1
- package/dist/application/UnprimedBrownfieldQualifier.js +0 -47
- package/dist/application/UnprimedBrownfieldQualifier.js.map +0 -1
- package/dist/infrastructure/SqliteSolutionContextReader.d.ts +0 -20
- package/dist/infrastructure/SqliteSolutionContextReader.d.ts.map +0 -1
- package/dist/infrastructure/SqliteSolutionContextReader.js +0 -138
- package/dist/infrastructure/SqliteSolutionContextReader.js.map +0 -1
|
@@ -1,242 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SessionStartTextRenderer = void 0;
|
|
4
|
-
const
|
|
4
|
+
const SessionStartOutputBuilder_js_1 = require("./SessionStartOutputBuilder.js");
|
|
5
|
+
const SessionContextOutputBuilder_js_1 = require("./SessionContextOutputBuilder.js");
|
|
5
6
|
/**
|
|
6
|
-
* SessionStartTextRenderer - Formats session start context for LLM orientation
|
|
7
|
+
* SessionStartTextRenderer - Formats session start context for LLM orientation.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* - Target audiences
|
|
11
|
-
* - Active audience pains
|
|
12
|
-
* - Session context (focus, status, paused goals, recent decisions)
|
|
13
|
-
* - In-progress goals
|
|
14
|
-
* - Planned goals
|
|
15
|
-
*
|
|
16
|
-
* Output Format: YAML (more LLM-friendly than JSON)
|
|
9
|
+
* Delegates to SessionStartOutputBuilder for composition.
|
|
10
|
+
* Retained for backward compatibility with existing callers and tests.
|
|
17
11
|
*/
|
|
18
12
|
class SessionStartTextRenderer {
|
|
19
13
|
constructor() {
|
|
20
|
-
this.
|
|
14
|
+
this.sessionStartOutputBuilder = new SessionStartOutputBuilder_js_1.SessionStartOutputBuilder();
|
|
15
|
+
this.sessionContextOutputBuilder = new SessionContextOutputBuilder_js_1.SessionContextOutputBuilder();
|
|
21
16
|
}
|
|
22
17
|
render(context) {
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
blocks.
|
|
30
|
-
blocks.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
const output = this.sessionStartOutputBuilder.buildSessionStartOutput(context);
|
|
19
|
+
const blocks = output.getSections()
|
|
20
|
+
.filter(s => s.type === "prompt" && s.content)
|
|
21
|
+
.map(s => s.content);
|
|
22
|
+
// Last two sections are the separator and goal start instruction.
|
|
23
|
+
// Extract the instruction separately for the legacy return shape.
|
|
24
|
+
const goalStartIndex = blocks.findIndex(b => b.includes("@LLM: Prompt the user"));
|
|
25
|
+
const llmInstruction = goalStartIndex >= 0 ? blocks.splice(goalStartIndex, 1)[0] : "";
|
|
26
|
+
// Remove separator block
|
|
27
|
+
const separatorIndex = blocks.findIndex(b => b.trim() === "---");
|
|
28
|
+
if (separatorIndex >= 0) {
|
|
29
|
+
blocks.splice(separatorIndex, 1);
|
|
30
|
+
}
|
|
31
|
+
return { blocks, llmInstruction };
|
|
35
32
|
}
|
|
36
33
|
buildStructuredContext(context) {
|
|
37
|
-
const
|
|
34
|
+
const structured = this.sessionStartOutputBuilder.buildStructuredOutput(context, "");
|
|
38
35
|
return {
|
|
39
|
-
projectContext:
|
|
40
|
-
sessionContext:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
llmInstructions: {
|
|
44
|
-
sessionContext: sessionContextResult.llmInstruction ?? null,
|
|
45
|
-
goalStart: this.renderGoalStartInstruction(),
|
|
46
|
-
},
|
|
36
|
+
projectContext: structured.projectContext,
|
|
37
|
+
sessionContext: structured.sessionContext,
|
|
38
|
+
goals: structured.goals,
|
|
39
|
+
llmInstructions: structured.llmInstructions,
|
|
47
40
|
};
|
|
48
41
|
}
|
|
49
42
|
renderSessionSummary(context) {
|
|
50
|
-
|
|
51
|
-
let output = this.yamlFormatter.toYaml(sessionContextResult.data);
|
|
52
|
-
if (sessionContextResult.llmInstruction) {
|
|
53
|
-
output += sessionContextResult.llmInstruction;
|
|
54
|
-
}
|
|
55
|
-
return output;
|
|
56
|
-
}
|
|
57
|
-
renderProjectContext(projectContext) {
|
|
58
|
-
const contextData = this.buildProjectContextData(projectContext);
|
|
59
|
-
if (!contextData) {
|
|
60
|
-
return "";
|
|
61
|
-
}
|
|
62
|
-
return this.yamlFormatter.toYaml({ projectContext: contextData });
|
|
63
|
-
}
|
|
64
|
-
renderInProgressGoals(goals) {
|
|
65
|
-
const data = this.buildInProgressGoalsData(goals);
|
|
66
|
-
return this.yamlFormatter.toYaml({ inProgressGoals: data });
|
|
67
|
-
}
|
|
68
|
-
renderPlannedGoals(goals) {
|
|
69
|
-
const data = this.buildPlannedGoalsData(goals);
|
|
70
|
-
return this.yamlFormatter.toYaml({ plannedGoals: data });
|
|
71
|
-
}
|
|
72
|
-
renderGoalStartInstruction() {
|
|
73
|
-
const llmInstruction = [
|
|
74
|
-
"@LLM: Prompt the user for input about what goal to start. ",
|
|
75
|
-
"For example, \"I can see we've recently worked on X, Y, Z. ",
|
|
76
|
-
"Everything was completed without blockers. Goals A, B, and N ",
|
|
77
|
-
"are planned. Do you want to start with A, or something else?\"",
|
|
78
|
-
"IMPORTANT: Run 'jumbo goal start --id <id>' before doing any work!",
|
|
79
|
-
];
|
|
80
|
-
return llmInstruction.join("\n");
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Format message when no session summary exists (first-ever session on brownfield project)
|
|
84
|
-
*
|
|
85
|
-
* Outputs direct LLM instructions that cause the agent to proactively offer
|
|
86
|
-
* to help transfer existing project context into Jumbo.
|
|
87
|
-
*/
|
|
88
|
-
buildProjectContextData(projectContext) {
|
|
89
|
-
if (!projectContext) {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
const contextData = {
|
|
93
|
-
name: projectContext.project.name,
|
|
94
|
-
purpose: projectContext.project.purpose || "Not defined",
|
|
95
|
-
};
|
|
96
|
-
if (projectContext.audiences.length > 0) {
|
|
97
|
-
contextData.audiences = projectContext.audiences.map((a) => ({
|
|
98
|
-
name: a.name,
|
|
99
|
-
description: a.description,
|
|
100
|
-
priority: a.priority,
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
if (projectContext.audiencePains.length > 0) {
|
|
104
|
-
contextData.audiencePains = projectContext.audiencePains.map((p) => ({
|
|
105
|
-
title: p.title,
|
|
106
|
-
description: p.description,
|
|
107
|
-
}));
|
|
108
|
-
}
|
|
109
|
-
return contextData;
|
|
110
|
-
}
|
|
111
|
-
buildInProgressGoalsData(goals) {
|
|
112
|
-
if (goals.length === 0) {
|
|
113
|
-
return {
|
|
114
|
-
count: 0,
|
|
115
|
-
message: "No goals currently in progress. Use 'jumbo goal start --id <id>' to begin working on a goal.",
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
return {
|
|
119
|
-
count: goals.length,
|
|
120
|
-
goals: goals.map((g) => ({
|
|
121
|
-
goalId: g.goalId,
|
|
122
|
-
objective: g.objective,
|
|
123
|
-
status: g.status,
|
|
124
|
-
createdAt: g.createdAt,
|
|
125
|
-
})),
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
buildPlannedGoalsData(goals) {
|
|
129
|
-
if (goals.length === 0) {
|
|
130
|
-
return {
|
|
131
|
-
count: 0,
|
|
132
|
-
message: "No planned goals available. Use 'jumbo goal add' to create a new goal to work on.",
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
return {
|
|
136
|
-
count: goals.length,
|
|
137
|
-
goals: goals.map((g) => ({
|
|
138
|
-
goalId: g.goalId,
|
|
139
|
-
objective: g.objective,
|
|
140
|
-
status: g.status,
|
|
141
|
-
createdAt: g.createdAt,
|
|
142
|
-
})),
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
buildSessionContextData(context) {
|
|
146
|
-
if (context.instructions.includes("brownfield-onboarding")) {
|
|
147
|
-
return {
|
|
148
|
-
data: {
|
|
149
|
-
sessionContext: {
|
|
150
|
-
message: "No previous session context available. This appears to be your first session with Jumbo on this project.",
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
llmInstruction: this.buildBrownfieldInstruction(),
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
if (!context.session) {
|
|
157
|
-
return {
|
|
158
|
-
data: {
|
|
159
|
-
sessionContext: {
|
|
160
|
-
message: "No previous session context available.",
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
const contextData = {
|
|
166
|
-
sessionContext: {
|
|
167
|
-
focus: context.session.focus ?? "Not yet defined",
|
|
168
|
-
status: context.session.status,
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
const sessionCtx = contextData.sessionContext;
|
|
172
|
-
if (context.context.pausedGoals.length > 0) {
|
|
173
|
-
sessionCtx.pausedGoals = context.context.pausedGoals.map((g) => {
|
|
174
|
-
const pausedGoal = {
|
|
175
|
-
goalId: g.goalId,
|
|
176
|
-
objective: g.objective,
|
|
177
|
-
pausedAt: g.updatedAt,
|
|
178
|
-
};
|
|
179
|
-
if (g.note) {
|
|
180
|
-
pausedGoal.note = g.note;
|
|
181
|
-
}
|
|
182
|
-
return pausedGoal;
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
if (context.context.recentDecisions.length > 0) {
|
|
186
|
-
sessionCtx.recentDecisions = context.context.recentDecisions.map((d) => ({
|
|
187
|
-
decisionId: d.decisionId,
|
|
188
|
-
title: d.title,
|
|
189
|
-
rationale: d.rationale,
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
if (context.context.deactivatedRelations.count > 0) {
|
|
193
|
-
sessionCtx.deactivatedRelations = {
|
|
194
|
-
count: context.context.deactivatedRelations.count,
|
|
195
|
-
summary: context.context.deactivatedRelations.summary,
|
|
196
|
-
};
|
|
197
|
-
sessionCtx.warning =
|
|
198
|
-
"Deactivated relations detected. Review them before relying on architecture links.";
|
|
199
|
-
}
|
|
200
|
-
const llmInstruction = context.context.pausedGoals.length > 0
|
|
201
|
-
? "\n\n@LLM: Goals were paused. To resume a paused goal, run:\n jumbo goal resume --id <goal-id>"
|
|
202
|
-
: undefined;
|
|
203
|
-
return { data: contextData, llmInstruction };
|
|
204
|
-
}
|
|
205
|
-
buildBrownfieldInstruction() {
|
|
206
|
-
return [
|
|
207
|
-
"",
|
|
208
|
-
"@LLM: This is a BROWNFIELD PROJECT with no Jumbo context yet.",
|
|
209
|
-
"",
|
|
210
|
-
"REQUIRED ACTION: Proactively engage the user with the following approach:",
|
|
211
|
-
"",
|
|
212
|
-
"1. GREET and ACKNOWLEDGE: \"Hi! I can see that you've added Jumbo to this project. ",
|
|
213
|
-
" This looks like an existing codebase with valuable context to preserve.\"",
|
|
214
|
-
"",
|
|
215
|
-
"2. OFFER HELP: \"Would you like me to help transfer your existing project knowledge into Jumbo? ",
|
|
216
|
-
" I can scan your documentation, code structure, and patterns to capture:\"",
|
|
217
|
-
" - Project purpose and target audience (from README, docs)",
|
|
218
|
-
" - Architectural components and dependencies (from code structure)",
|
|
219
|
-
" - Development guidelines and coding standards (from patterns)",
|
|
220
|
-
" - Architectural decisions (from docs, comments, ADRs)",
|
|
221
|
-
"",
|
|
222
|
-
"3. GET PERMISSION: \"I'll ask for your confirmation before adding anything to Jumbo. ",
|
|
223
|
-
" Should we start by scanning your project documentation?\"",
|
|
224
|
-
"",
|
|
225
|
-
"IMPORTANT:",
|
|
226
|
-
"- Take initiative: Don't wait passively. Actively offer to help.",
|
|
227
|
-
"- Be conversational: Use natural language, not robotic instructions.",
|
|
228
|
-
"- Human-in-the-loop: Always get user confirmation before running jumbo commands.",
|
|
229
|
-
"- Start with docs: README.md, package.json, or docs/ are good starting points.",
|
|
230
|
-
"",
|
|
231
|
-
"AVAILABLE COMMANDS (use after getting user permission):",
|
|
232
|
-
"- jumbo architecture define --help",
|
|
233
|
-
"- jumbo component add --name 'ComponentName' --description 'What it does'",
|
|
234
|
-
"- jumbo decision add --title 'Decision' --rationale 'Why' --context 'Background'",
|
|
235
|
-
"- jumbo guideline add --category 'testing' --description 'Guideline text'",
|
|
236
|
-
"- jumbo invariant add --category 'architecture' --description 'Non-negotiable rule'",
|
|
237
|
-
"",
|
|
238
|
-
"Run 'jumbo --help' to see all available commands.",
|
|
239
|
-
].join("\n");
|
|
43
|
+
return this.sessionContextOutputBuilder.renderSessionSummary(context);
|
|
240
44
|
}
|
|
241
45
|
}
|
|
242
46
|
exports.SessionStartTextRenderer = SessionStartTextRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionStartTextRenderer.js","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/SessionStartTextRenderer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SessionStartTextRenderer.js","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/SessionStartTextRenderer.ts"],"names":[],"mappings":";;;AACA,iFAA2E;AAC3E,qFAA+E;AAiB/E;;;;;GAKG;AACH,MAAa,wBAAwB;IAInC;QACE,IAAI,CAAC,yBAAyB,GAAG,IAAI,wDAAyB,EAAE,CAAC;QACjE,IAAI,CAAC,2BAA2B,GAAG,IAAI,4DAA2B,EAAE,CAAC;IACvE,CAAC;IAED,MAAM,CAAC,OAA+B;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,yBAAyB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAE/E,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE;aAChC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC;aAC7C,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAiB,CAAC,CAAC;QAEjC,kEAAkE;QAClE,kEAAkE;QAClE,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAClF,MAAM,cAAc,GAAG,cAAc,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAEtF,yBAAyB;QACzB,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC;QACjE,IAAI,cAAc,IAAI,CAAC,EAAE,CAAC;YACxB,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IACpC,CAAC;IAED,sBAAsB,CAAC,OAA+B;QACpD,MAAM,UAAU,GAAG,IAAI,CAAC,yBAAyB,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACrF,OAAO;YACL,cAAc,EAAE,UAAU,CAAC,cAAgD;YAC3E,cAAc,EAAE,UAAU,CAAC,cAAyC;YACpE,KAAK,EAAE,UAAU,CAAC,KAAgC;YAClD,eAAe,EAAE,UAAU,CAAC,eAG3B;SACF,CAAC;IACJ,CAAC;IAED,oBAAoB,CAAC,OAA+B;QAClD,OAAO,IAAI,CAAC,2BAA2B,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACxE,CAAC;CACF;AA9CD,4DA8CC"}
|
|
@@ -15,7 +15,7 @@ export declare const metadata: CommandMetadata;
|
|
|
15
15
|
*
|
|
16
16
|
* Responsibilities (presentation layer only):
|
|
17
17
|
* - Call SessionStartController for orchestrated session start
|
|
18
|
-
* - Render the result
|
|
18
|
+
* - Render the result via SessionStartOutputBuilder
|
|
19
19
|
*
|
|
20
20
|
* Orchestration is delegated to SessionStartController in the application layer.
|
|
21
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.start.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/session.start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;
|
|
1
|
+
{"version":3,"file":"session.start.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/session.start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AAIjG;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,eAWtB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAC9B,SAAS,EAAE,qBAAqB,iBAiCjC"}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.metadata = void 0;
|
|
9
9
|
exports.sessionStart = sessionStart;
|
|
10
10
|
const Renderer_js_1 = require("../../../rendering/Renderer.js");
|
|
11
|
-
const
|
|
11
|
+
const SessionStartOutputBuilder_js_1 = require("./SessionStartOutputBuilder.js");
|
|
12
12
|
/**
|
|
13
13
|
* Command metadata for auto-registration
|
|
14
14
|
*/
|
|
@@ -30,7 +30,7 @@ exports.metadata = {
|
|
|
30
30
|
*
|
|
31
31
|
* Responsibilities (presentation layer only):
|
|
32
32
|
* - Call SessionStartController for orchestrated session start
|
|
33
|
-
* - Render the result
|
|
33
|
+
* - Render the result via SessionStartOutputBuilder
|
|
34
34
|
*
|
|
35
35
|
* Orchestration is delegated to SessionStartController in the application layer.
|
|
36
36
|
*/
|
|
@@ -45,22 +45,16 @@ async function sessionStart(options, container) {
|
|
|
45
45
|
// 1. CONTROLLER: Orchestrate session start
|
|
46
46
|
const response = await container.sessionStartController.handle({});
|
|
47
47
|
// 2. RENDER: Display context and result
|
|
48
|
+
const outputBuilder = new SessionStartOutputBuilder_js_1.SessionStartOutputBuilder();
|
|
48
49
|
if (isTextOutput) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
for (const block of textOutput.blocks) {
|
|
52
|
-
if (block) {
|
|
53
|
-
renderer.info(block);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
renderer.info("---\n");
|
|
57
|
-
renderer.info(textOutput.llmInstruction);
|
|
50
|
+
const output = outputBuilder.buildSessionStartOutput(response.context);
|
|
51
|
+
renderer.info(output.toHumanReadable());
|
|
58
52
|
renderer.success("Session started", {
|
|
59
53
|
sessionId: response.sessionId,
|
|
60
54
|
});
|
|
61
55
|
}
|
|
62
56
|
else {
|
|
63
|
-
renderer.data(
|
|
57
|
+
renderer.data(outputBuilder.buildStructuredOutput(response.context, response.sessionId));
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
catch (error) {
|
|
@@ -69,14 +63,4 @@ async function sessionStart(options, container) {
|
|
|
69
63
|
}
|
|
70
64
|
// NO CLEANUP - infrastructure manages itself!
|
|
71
65
|
}
|
|
72
|
-
function buildStructuredSessionStartOutput(sessionContext, sessionId) {
|
|
73
|
-
const textRenderer = new SessionStartTextRenderer_js_1.SessionStartTextRenderer();
|
|
74
|
-
const structuredContext = textRenderer.buildStructuredContext(sessionContext);
|
|
75
|
-
return {
|
|
76
|
-
...structuredContext,
|
|
77
|
-
sessionStart: {
|
|
78
|
-
sessionId,
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
66
|
//# sourceMappingURL=session.start.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.start.js","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/session.start.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;
|
|
1
|
+
{"version":3,"file":"session.start.js","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/session.start.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAiCH,oCAmCC;AAhED,gEAA0D;AAC1D,iFAA2E;AAE3E;;GAEG;AACU,QAAA,QAAQ,GAAoB;IACvC,WAAW,EAAE,6BAA6B;IAC1C,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE;QACR;YACE,OAAO,EAAE,qBAAqB;YAC9B,WAAW,EAAE,6BAA6B;SAC3C;KACF;IACD,OAAO,EAAE,CAAC,aAAa,EAAE,eAAe,EAAE,YAAY,CAAC;CACxD,CAAC;AAEF;;;;;;;;;GASG;AACI,KAAK,UAAU,YAAY,CAChC,OAA8B,EAC9B,SAAgC;IAEhC,MAAM,QAAQ,GAAG,sBAAQ,CAAC,WAAW,EAAE,CAAC;IAExC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;QAE9C,IAAI,YAAY,EAAE,CAAC;YACjB,QAAQ,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACpD,CAAC;QAED,2CAA2C;QAC3C,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAEnE,wCAAwC;QACxC,MAAM,aAAa,GAAG,IAAI,wDAAyB,EAAE,CAAC;QAEtD,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,MAAM,GAAG,aAAa,CAAC,uBAAuB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACvE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC;YAExC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,EAAE;gBAClC,SAAS,EAAE,QAAQ,CAAC,SAAS;aAC9B,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,QAAQ,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,8CAA8C;AAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SolutionContextView } from "./SolutionContextView.js";
|
|
2
|
-
/**
|
|
3
|
-
* ISolutionContextReader - Port interface for reading aggregated solution context
|
|
4
|
-
*
|
|
5
|
-
* Infrastructure implementations query the data store and return solution views.
|
|
6
|
-
* Application layer services (like UnprimedBrownfieldQualifier) use this data
|
|
7
|
-
* to make business decisions.
|
|
8
|
-
*/
|
|
9
|
-
export interface ISolutionContextReader {
|
|
10
|
-
/**
|
|
11
|
-
* Get all solution context recorded in Jumbo
|
|
12
|
-
*
|
|
13
|
-
* @returns Aggregated view of architecture, components, decisions, invariants, guidelines
|
|
14
|
-
*/
|
|
15
|
-
getSolutionContext(): Promise<SolutionContextView>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=ISolutionContextReader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ISolutionContextReader.d.ts","sourceRoot":"","sources":["../../src/application/ISolutionContextReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,kBAAkB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ISolutionContextReader.js","sourceRoot":"","sources":["../../src/application/ISolutionContextReader.ts"],"names":[],"mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ArchitectureView } from "./context/architecture/ArchitectureView.js";
|
|
2
|
-
import { ComponentView } from "./context/components/ComponentView.js";
|
|
3
|
-
import { DecisionView } from "./context/decisions/DecisionView.js";
|
|
4
|
-
import { InvariantView } from "./context/invariants/InvariantView.js";
|
|
5
|
-
import { GuidelineView } from "./context/guidelines/GuidelineView.js";
|
|
6
|
-
/**
|
|
7
|
-
* SolutionContextView - Aggregated view of all solution context
|
|
8
|
-
*
|
|
9
|
-
* Contains the full solution context that has been recorded in Jumbo:
|
|
10
|
-
* - Architecture definition (patterns, principles, tech stack, data flow)
|
|
11
|
-
* - Components (system parts and their responsibilities)
|
|
12
|
-
* - Decisions (architectural and design choices with rationale)
|
|
13
|
-
* - Invariants (non-negotiable constraints)
|
|
14
|
-
* - Guidelines (coding standards and practices)
|
|
15
|
-
*
|
|
16
|
-
* Used by application layer services to make business decisions about
|
|
17
|
-
* solution state (e.g., determining if a brownfield project needs priming).
|
|
18
|
-
*/
|
|
19
|
-
export interface SolutionContextView {
|
|
20
|
-
readonly architecture: ArchitectureView | null;
|
|
21
|
-
readonly components: ComponentView[];
|
|
22
|
-
readonly decisions: DecisionView[];
|
|
23
|
-
readonly invariants: InvariantView[];
|
|
24
|
-
readonly guidelines: GuidelineView[];
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=SolutionContextView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SolutionContextView.d.ts","sourceRoot":"","sources":["../../src/application/SolutionContextView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,UAAU,EAAE,aAAa,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,aAAa,EAAE,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,aAAa,EAAE,CAAC;CACtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SolutionContextView.js","sourceRoot":"","sources":["../../src/application/SolutionContextView.ts"],"names":[],"mappings":""}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ISolutionContextReader } from "./ISolutionContextReader.js";
|
|
2
|
-
/**
|
|
3
|
-
* UnprimedBrownfieldQualifier - Determines if a brownfield project needs priming
|
|
4
|
-
*
|
|
5
|
-
* A brownfield project is "unprimed" when it has been added to Jumbo but no
|
|
6
|
-
* solution context has been recorded yet. In this state, LLMs should be prompted
|
|
7
|
-
* to help transfer existing project knowledge into Jumbo.
|
|
8
|
-
*
|
|
9
|
-
* This is the single source of truth for determining "unprimed brownfield" state.
|
|
10
|
-
* To adjust what counts as "primed", modify the isUnprimed() method.
|
|
11
|
-
*
|
|
12
|
-
* Current rule: A project is primed if it has ANY of the following:
|
|
13
|
-
* - Architecture definition
|
|
14
|
-
* - At least one component
|
|
15
|
-
* - At least one decision
|
|
16
|
-
* - At least one invariant
|
|
17
|
-
* - At least one guideline
|
|
18
|
-
*/
|
|
19
|
-
export declare class UnprimedBrownfieldQualifier {
|
|
20
|
-
private readonly solutionContextReader;
|
|
21
|
-
constructor(solutionContextReader: ISolutionContextReader);
|
|
22
|
-
/**
|
|
23
|
-
* Check if the project is in an unprimed brownfield state
|
|
24
|
-
*
|
|
25
|
-
* @returns true if the project needs priming (no solution context exists)
|
|
26
|
-
*/
|
|
27
|
-
isUnprimed(): Promise<boolean>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=UnprimedBrownfieldQualifier.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UnprimedBrownfieldQualifier.d.ts","sourceRoot":"","sources":["../../src/application/UnprimedBrownfieldQualifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,sBAAsB;IAE1E;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;CAmBrC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnprimedBrownfieldQualifier = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* UnprimedBrownfieldQualifier - Determines if a brownfield project needs priming
|
|
6
|
-
*
|
|
7
|
-
* A brownfield project is "unprimed" when it has been added to Jumbo but no
|
|
8
|
-
* solution context has been recorded yet. In this state, LLMs should be prompted
|
|
9
|
-
* to help transfer existing project knowledge into Jumbo.
|
|
10
|
-
*
|
|
11
|
-
* This is the single source of truth for determining "unprimed brownfield" state.
|
|
12
|
-
* To adjust what counts as "primed", modify the isUnprimed() method.
|
|
13
|
-
*
|
|
14
|
-
* Current rule: A project is primed if it has ANY of the following:
|
|
15
|
-
* - Architecture definition
|
|
16
|
-
* - At least one component
|
|
17
|
-
* - At least one decision
|
|
18
|
-
* - At least one invariant
|
|
19
|
-
* - At least one guideline
|
|
20
|
-
*/
|
|
21
|
-
class UnprimedBrownfieldQualifier {
|
|
22
|
-
constructor(solutionContextReader) {
|
|
23
|
-
this.solutionContextReader = solutionContextReader;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Check if the project is in an unprimed brownfield state
|
|
27
|
-
*
|
|
28
|
-
* @returns true if the project needs priming (no solution context exists)
|
|
29
|
-
*/
|
|
30
|
-
async isUnprimed() {
|
|
31
|
-
const context = await this.solutionContextReader.getSolutionContext();
|
|
32
|
-
const hasArchitecture = context.architecture !== null;
|
|
33
|
-
const hasComponents = context.components.length > 0;
|
|
34
|
-
const hasDecisions = context.decisions.length > 0;
|
|
35
|
-
const hasInvariants = context.invariants.length > 0;
|
|
36
|
-
const hasGuidelines = context.guidelines.length > 0;
|
|
37
|
-
// Primed if ANY solution context exists
|
|
38
|
-
const isPrimed = hasArchitecture ||
|
|
39
|
-
hasComponents ||
|
|
40
|
-
hasDecisions ||
|
|
41
|
-
hasInvariants ||
|
|
42
|
-
hasGuidelines;
|
|
43
|
-
return !isPrimed;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.UnprimedBrownfieldQualifier = UnprimedBrownfieldQualifier;
|
|
47
|
-
//# sourceMappingURL=UnprimedBrownfieldQualifier.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UnprimedBrownfieldQualifier.js","sourceRoot":"","sources":["../../src/application/UnprimedBrownfieldQualifier.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,2BAA2B;IACtC,YAA6B,qBAA6C;QAA7C,0BAAqB,GAArB,qBAAqB,CAAwB;IAAG,CAAC;IAE9E;;;;OAIG;IACH,KAAK,CAAC,UAAU;QACd,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,EAAE,CAAC;QAEtE,MAAM,eAAe,GAAG,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC;QACtD,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QACpD,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QACpD,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QAEpD,wCAAwC;QACxC,MAAM,QAAQ,GACZ,eAAe;YACf,aAAa;YACb,YAAY;YACZ,aAAa;YACb,aAAa,CAAC;QAEhB,OAAO,CAAC,QAAQ,CAAC;IACnB,CAAC;CACF;AA3BD,kEA2BC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SqliteSolutionContextReader - Aggregates solution context from multiple readers
|
|
3
|
-
*
|
|
4
|
-
* Composes existing solution context readers to build the aggregated view.
|
|
5
|
-
* This avoids duplicating SQL queries and row mapping logic.
|
|
6
|
-
*/
|
|
7
|
-
import { Database } from "better-sqlite3";
|
|
8
|
-
import { ISolutionContextReader } from "../application/ISolutionContextReader.js";
|
|
9
|
-
import { SolutionContextView } from "../application/SolutionContextView.js";
|
|
10
|
-
export declare class SqliteSolutionContextReader implements ISolutionContextReader {
|
|
11
|
-
private readonly db;
|
|
12
|
-
constructor(db: Database);
|
|
13
|
-
getSolutionContext(): Promise<SolutionContextView>;
|
|
14
|
-
private getArchitecture;
|
|
15
|
-
private getActiveComponents;
|
|
16
|
-
private getActiveDecisions;
|
|
17
|
-
private getInvariants;
|
|
18
|
-
private getActiveGuidelines;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=SqliteSolutionContextReader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SqliteSolutionContextReader.d.ts","sourceRoot":"","sources":["../../src/infrastructure/SqliteSolutionContextReader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAS5E,qBAAa,2BAA4B,YAAW,sBAAsB;IAC5D,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAEnC,kBAAkB,IAAI,OAAO,CAAC,mBAAmB,CAAC;YAmB1C,eAAe;YAwBf,mBAAmB;YAuBnB,kBAAkB;YAyBlB,aAAa;YAoBb,mBAAmB;CAwBlC"}
|