jumbo-cli 2.1.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/project/init/IAgentFileProtocol.d.ts +33 -9
- package/dist/application/context/project/init/IAgentFileProtocol.d.ts.map +1 -1
- package/dist/application/context/project/init/IAgentFileProtocol.js +2 -1
- package/dist/application/context/project/init/IAgentFileProtocol.js.map +1 -1
- package/dist/application/context/project/init/LocalInitializeProjectGateway.d.ts +3 -1
- package/dist/application/context/project/init/LocalInitializeProjectGateway.d.ts.map +1 -1
- package/dist/application/context/project/init/LocalInitializeProjectGateway.js +4 -1
- package/dist/application/context/project/init/LocalInitializeProjectGateway.js.map +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/evolve/EvolveController.d.ts.map +1 -1
- package/dist/application/evolve/EvolveController.js +3 -0
- package/dist/application/evolve/EvolveController.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/domain/project/AgentFileReferenceContent.d.ts +11 -10
- package/dist/domain/project/AgentFileReferenceContent.d.ts.map +1 -1
- package/dist/domain/project/AgentFileReferenceContent.js +17 -31
- package/dist/domain/project/AgentFileReferenceContent.js.map +1 -1
- package/dist/domain/project/AgentsMdContent.d.ts +4 -3
- package/dist/domain/project/AgentsMdContent.d.ts.map +1 -1
- package/dist/domain/project/AgentsMdContent.js +6 -74
- package/dist/domain/project/AgentsMdContent.js.map +1 -1
- package/dist/domain/project/CopilotInstructionsContent.d.ts +11 -6
- package/dist/domain/project/CopilotInstructionsContent.d.ts.map +1 -1
- package/dist/domain/project/CopilotInstructionsContent.js +35 -48
- package/dist/domain/project/CopilotInstructionsContent.js.map +1 -1
- package/dist/domain/project/JumboMdContent.d.ts +45 -0
- package/dist/domain/project/JumboMdContent.d.ts.map +1 -0
- package/dist/domain/project/JumboMdContent.js +157 -0
- package/dist/domain/project/JumboMdContent.js.map +1 -0
- package/dist/infrastructure/context/project/init/AgentFileProtocol.d.ts +10 -2
- package/dist/infrastructure/context/project/init/AgentFileProtocol.d.ts.map +1 -1
- package/dist/infrastructure/context/project/init/AgentFileProtocol.js +60 -10
- package/dist/infrastructure/context/project/init/AgentFileProtocol.js.map +1 -1
- package/dist/infrastructure/context/project/init/ClaudeConfigurer.d.ts +3 -3
- package/dist/infrastructure/context/project/init/ClaudeConfigurer.d.ts.map +1 -1
- package/dist/infrastructure/context/project/init/ClaudeConfigurer.js +13 -14
- package/dist/infrastructure/context/project/init/ClaudeConfigurer.js.map +1 -1
- package/dist/infrastructure/context/project/init/CopilotConfigurer.d.ts +2 -2
- package/dist/infrastructure/context/project/init/CopilotConfigurer.d.ts.map +1 -1
- package/dist/infrastructure/context/project/init/CopilotConfigurer.js +16 -8
- package/dist/infrastructure/context/project/init/CopilotConfigurer.js.map +1 -1
- package/dist/infrastructure/context/project/init/GeminiConfigurer.d.ts +3 -3
- package/dist/infrastructure/context/project/init/GeminiConfigurer.d.ts.map +1 -1
- package/dist/infrastructure/context/project/init/GeminiConfigurer.js +13 -14
- package/dist/infrastructure/context/project/init/GeminiConfigurer.js.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 +8 -12
- 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
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionContextOutputBuilder = void 0;
|
|
4
|
+
const TerminalOutputBuilder_js_1 = require("../../../output/TerminalOutputBuilder.js");
|
|
5
|
+
const YamlFormatter_js_1 = require("../../../formatting/YamlFormatter.js");
|
|
6
|
+
/**
|
|
7
|
+
* SessionContextOutputBuilder - Builds output for session context orientation.
|
|
8
|
+
*
|
|
9
|
+
* Renders project context (name, purpose, audiences, pains) and session summary
|
|
10
|
+
* (focus, status, paused goals, recent decisions, deactivated relations).
|
|
11
|
+
* Includes brownfield onboarding and paused goals resume @LLM prompts.
|
|
12
|
+
*/
|
|
13
|
+
class SessionContextOutputBuilder {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.builder = new TerminalOutputBuilder_js_1.TerminalOutputBuilder();
|
|
16
|
+
this.yamlFormatter = new YamlFormatter_js_1.YamlFormatter();
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build human-readable session context output.
|
|
20
|
+
* Returns project context block (if available) and session summary block.
|
|
21
|
+
*/
|
|
22
|
+
buildSessionContext(context) {
|
|
23
|
+
this.builder.reset();
|
|
24
|
+
const projectContextYaml = this.renderProjectContext(context.context.projectContext);
|
|
25
|
+
if (projectContextYaml) {
|
|
26
|
+
this.builder.addPrompt(projectContextYaml);
|
|
27
|
+
}
|
|
28
|
+
this.builder.addPrompt(this.renderSessionSummary(context));
|
|
29
|
+
return this.builder.build();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build structured session context data for JSON output.
|
|
33
|
+
*/
|
|
34
|
+
buildStructuredSessionContext(context) {
|
|
35
|
+
const sessionContextResult = this.buildSessionContextData(context);
|
|
36
|
+
return {
|
|
37
|
+
projectContext: this.buildProjectContextData(context.context.projectContext),
|
|
38
|
+
sessionContext: sessionContextResult.data.sessionContext,
|
|
39
|
+
llmSessionContextInstruction: sessionContextResult.llmInstruction ?? null,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
renderProjectContext(projectContext) {
|
|
43
|
+
const contextData = this.buildProjectContextData(projectContext);
|
|
44
|
+
if (!contextData) {
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
47
|
+
return this.yamlFormatter.toYaml({ projectContext: contextData });
|
|
48
|
+
}
|
|
49
|
+
renderSessionSummary(context) {
|
|
50
|
+
const sessionContextResult = this.buildSessionContextData(context);
|
|
51
|
+
let output = this.yamlFormatter.toYaml(sessionContextResult.data);
|
|
52
|
+
if (sessionContextResult.llmInstruction) {
|
|
53
|
+
output += sessionContextResult.llmInstruction;
|
|
54
|
+
}
|
|
55
|
+
return output;
|
|
56
|
+
}
|
|
57
|
+
buildProjectContextData(projectContext) {
|
|
58
|
+
if (!projectContext) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const contextData = {
|
|
62
|
+
name: projectContext.project.name,
|
|
63
|
+
purpose: projectContext.project.purpose || "Not defined",
|
|
64
|
+
};
|
|
65
|
+
if (projectContext.audiences.length > 0) {
|
|
66
|
+
contextData.audiences = projectContext.audiences.map((a) => ({
|
|
67
|
+
name: a.name,
|
|
68
|
+
description: a.description,
|
|
69
|
+
priority: a.priority,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
if (projectContext.audiencePains.length > 0) {
|
|
73
|
+
contextData.audiencePains = projectContext.audiencePains.map((p) => ({
|
|
74
|
+
title: p.title,
|
|
75
|
+
description: p.description,
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
return contextData;
|
|
79
|
+
}
|
|
80
|
+
buildSessionContextData(context) {
|
|
81
|
+
if (context.instructions.includes("brownfield-onboarding")) {
|
|
82
|
+
return {
|
|
83
|
+
data: {
|
|
84
|
+
sessionContext: {
|
|
85
|
+
message: "No previous session context available. This appears to be your first session with Jumbo on this project.",
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
llmInstruction: this.buildBrownfieldInstruction(),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (!context.session) {
|
|
92
|
+
return {
|
|
93
|
+
data: {
|
|
94
|
+
sessionContext: {
|
|
95
|
+
message: "No previous session context available.",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const contextData = {
|
|
101
|
+
sessionContext: {
|
|
102
|
+
focus: context.session.focus ?? "Not yet defined",
|
|
103
|
+
status: context.session.status,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
const sessionCtx = contextData.sessionContext;
|
|
107
|
+
if (context.context.pausedGoals.length > 0) {
|
|
108
|
+
sessionCtx.pausedGoals = context.context.pausedGoals.map((g) => {
|
|
109
|
+
const pausedGoal = {
|
|
110
|
+
goalId: g.goalId,
|
|
111
|
+
objective: g.objective,
|
|
112
|
+
pausedAt: g.updatedAt,
|
|
113
|
+
};
|
|
114
|
+
if (g.note) {
|
|
115
|
+
pausedGoal.note = g.note;
|
|
116
|
+
}
|
|
117
|
+
return pausedGoal;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (context.context.recentDecisions.length > 0) {
|
|
121
|
+
sessionCtx.recentDecisions = context.context.recentDecisions.map((d) => ({
|
|
122
|
+
decisionId: d.decisionId,
|
|
123
|
+
title: d.title,
|
|
124
|
+
rationale: d.rationale,
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
if (context.context.deactivatedRelations.count > 0) {
|
|
128
|
+
sessionCtx.deactivatedRelations = {
|
|
129
|
+
count: context.context.deactivatedRelations.count,
|
|
130
|
+
summary: context.context.deactivatedRelations.summary,
|
|
131
|
+
};
|
|
132
|
+
sessionCtx.warning =
|
|
133
|
+
"Deactivated relations detected. Review them before relying on architecture links.";
|
|
134
|
+
}
|
|
135
|
+
const llmInstruction = context.context.pausedGoals.length > 0
|
|
136
|
+
? "\n\n@LLM: Goals were paused. To resume a paused goal, run:\n jumbo goal resume --id <goal-id>"
|
|
137
|
+
: undefined;
|
|
138
|
+
return { data: contextData, llmInstruction };
|
|
139
|
+
}
|
|
140
|
+
buildBrownfieldInstruction() {
|
|
141
|
+
return [
|
|
142
|
+
"",
|
|
143
|
+
"@LLM: This is a BROWNFIELD PROJECT with no Jumbo context yet.",
|
|
144
|
+
"",
|
|
145
|
+
"REQUIRED ACTION: Proactively engage the user with the following approach:",
|
|
146
|
+
"",
|
|
147
|
+
"1. GREET and ACKNOWLEDGE: \"Hi! I can see that you've added Jumbo to this project. ",
|
|
148
|
+
" This looks like an existing codebase with valuable context to preserve.\"",
|
|
149
|
+
"",
|
|
150
|
+
"2. OFFER HELP: \"Would you like me to help transfer your existing project knowledge into Jumbo? ",
|
|
151
|
+
" I can scan your documentation, code structure, and patterns to capture:\"",
|
|
152
|
+
" - Project purpose and target audience (from README, docs)",
|
|
153
|
+
" - Architectural components and dependencies (from code structure)",
|
|
154
|
+
" - Development guidelines and coding standards (from patterns)",
|
|
155
|
+
" - Architectural decisions (from docs, comments, ADRs)",
|
|
156
|
+
"",
|
|
157
|
+
"3. GET PERMISSION: \"I'll ask for your confirmation before adding anything to Jumbo. ",
|
|
158
|
+
" Should we start by scanning your project documentation?\"",
|
|
159
|
+
"",
|
|
160
|
+
"IMPORTANT:",
|
|
161
|
+
"- Take initiative: Don't wait passively. Actively offer to help.",
|
|
162
|
+
"- Be conversational: Use natural language, not robotic instructions.",
|
|
163
|
+
"- Human-in-the-loop: Always get user confirmation before running jumbo commands.",
|
|
164
|
+
"- Start with docs: README.md, package.json, or docs/ are good starting points.",
|
|
165
|
+
"",
|
|
166
|
+
"AVAILABLE COMMANDS (use after getting user permission):",
|
|
167
|
+
"- jumbo architecture define --help",
|
|
168
|
+
"- jumbo component add --name 'ComponentName' --description 'What it does'",
|
|
169
|
+
"- jumbo decision add --title 'Decision' --rationale 'Why' --context 'Background'",
|
|
170
|
+
"- jumbo guideline add --category 'testing' --description 'Guideline text'",
|
|
171
|
+
"- jumbo invariant add --category 'architecture' --description 'Non-negotiable rule'",
|
|
172
|
+
"",
|
|
173
|
+
"Run 'jumbo --help' to see all available commands.",
|
|
174
|
+
].join("\n");
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.SessionContextOutputBuilder = SessionContextOutputBuilder;
|
|
178
|
+
//# sourceMappingURL=SessionContextOutputBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionContextOutputBuilder.js","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/SessionContext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YAC3E,qFAAqF;YACrF,EAAE;YACF,mDAAmD;SACpD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;CACF;AA9MD,kEA8MC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TerminalOutput } from "../../../output/TerminalOutput.js";
|
|
2
|
+
import { GoalView } from "../../../../../application/context/goals/GoalView.js";
|
|
3
|
+
interface GoalGroupEntry {
|
|
4
|
+
goalId: string;
|
|
5
|
+
objective: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
}
|
|
8
|
+
interface GoalGroup {
|
|
9
|
+
hint: string;
|
|
10
|
+
count: number;
|
|
11
|
+
goals: GoalGroupEntry[];
|
|
12
|
+
}
|
|
13
|
+
export type GroupedGoals = Record<string, GoalGroup>;
|
|
14
|
+
/**
|
|
15
|
+
* SessionGoalsOutputBuilder - Builds output for session start goal sections.
|
|
16
|
+
*
|
|
17
|
+
* Groups all goals by status with per-state next-step hints.
|
|
18
|
+
* Includes the @LLM goal start instruction prompt.
|
|
19
|
+
*/
|
|
20
|
+
export declare class SessionGoalsOutputBuilder {
|
|
21
|
+
private readonly builder;
|
|
22
|
+
private readonly yamlFormatter;
|
|
23
|
+
constructor();
|
|
24
|
+
/**
|
|
25
|
+
* Build human-readable goals output for session start.
|
|
26
|
+
* Groups goals by status with hints, ordered by STATUS_ORDER.
|
|
27
|
+
* Empty groups are omitted.
|
|
28
|
+
*/
|
|
29
|
+
buildGoalsOutput(allGoals: GoalView[]): TerminalOutput;
|
|
30
|
+
/**
|
|
31
|
+
* Build structured goals data for JSON output.
|
|
32
|
+
*/
|
|
33
|
+
buildStructuredGoals(allGoals: GoalView[]): {
|
|
34
|
+
goals: GroupedGoals;
|
|
35
|
+
llmGoalStartInstruction: string;
|
|
36
|
+
};
|
|
37
|
+
renderGoalStartInstruction(): string;
|
|
38
|
+
private buildGroupedGoals;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=SessionGoalsOutputBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionGoalsOutputBuilder.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/SessionGoalsOutputBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,sDAAsD,CAAC;AAyChF,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAErD;;;;;GAKG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;;IAO9C;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,cAAc;IAWtD;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG;QAC1C,KAAK,EAAE,YAAY,CAAC;QACpB,uBAAuB,EAAE,MAAM,CAAC;KACjC;IAOD,0BAA0B,IAAI,MAAM;IAapC,OAAO,CAAC,iBAAiB;CA4B1B"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionGoalsOutputBuilder = void 0;
|
|
4
|
+
const TerminalOutputBuilder_js_1 = require("../../../output/TerminalOutputBuilder.js");
|
|
5
|
+
const YamlFormatter_js_1 = require("../../../formatting/YamlFormatter.js");
|
|
6
|
+
/**
|
|
7
|
+
* Status ordering for session start goal display.
|
|
8
|
+
* Ordered reverse of the goal workflow: most progressed statuses appear first.
|
|
9
|
+
* Matches GoalListOutputBuilder's STATUS_ORDER.
|
|
10
|
+
*/
|
|
11
|
+
const STATUS_ORDER = {
|
|
12
|
+
"approved": 0,
|
|
13
|
+
"in-review": 1,
|
|
14
|
+
"submitted": 2,
|
|
15
|
+
"paused": 3,
|
|
16
|
+
"doing": 4,
|
|
17
|
+
"blocked": 5,
|
|
18
|
+
"unblocked": 6,
|
|
19
|
+
"rejected": 7,
|
|
20
|
+
"in-refinement": 8,
|
|
21
|
+
"codifying": 9,
|
|
22
|
+
"refined": 10,
|
|
23
|
+
"defined": 11,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Next-step hints per goal status.
|
|
27
|
+
*/
|
|
28
|
+
const STATUS_HINTS = {
|
|
29
|
+
"defined": "jumbo goal refine --id <id>",
|
|
30
|
+
"refined": "jumbo goal start --id <id>",
|
|
31
|
+
"doing": "jumbo goal submit --id <id>",
|
|
32
|
+
"paused": "jumbo goal resume --id <id>",
|
|
33
|
+
"blocked": "jumbo goal unblock --id <id>",
|
|
34
|
+
"unblocked": "jumbo goal start --id <id>",
|
|
35
|
+
"in-review": "Awaiting QA review",
|
|
36
|
+
"approved": "jumbo goal codify --id <id>",
|
|
37
|
+
"rejected": "jumbo goal start --id <id>",
|
|
38
|
+
"submitted": "jumbo goal review --id <id>",
|
|
39
|
+
"in-refinement": "Awaiting refinement completion",
|
|
40
|
+
"codifying": "Awaiting codification completion",
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* SessionGoalsOutputBuilder - Builds output for session start goal sections.
|
|
44
|
+
*
|
|
45
|
+
* Groups all goals by status with per-state next-step hints.
|
|
46
|
+
* Includes the @LLM goal start instruction prompt.
|
|
47
|
+
*/
|
|
48
|
+
class SessionGoalsOutputBuilder {
|
|
49
|
+
constructor() {
|
|
50
|
+
this.builder = new TerminalOutputBuilder_js_1.TerminalOutputBuilder();
|
|
51
|
+
this.yamlFormatter = new YamlFormatter_js_1.YamlFormatter();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Build human-readable goals output for session start.
|
|
55
|
+
* Groups goals by status with hints, ordered by STATUS_ORDER.
|
|
56
|
+
* Empty groups are omitted.
|
|
57
|
+
*/
|
|
58
|
+
buildGoalsOutput(allGoals) {
|
|
59
|
+
this.builder.reset();
|
|
60
|
+
const grouped = this.buildGroupedGoals(allGoals);
|
|
61
|
+
this.builder.addPrompt(this.yamlFormatter.toYaml({ goals: grouped }));
|
|
62
|
+
this.builder.addPrompt("---\n");
|
|
63
|
+
this.builder.addPrompt(this.renderGoalStartInstruction());
|
|
64
|
+
return this.builder.build();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Build structured goals data for JSON output.
|
|
68
|
+
*/
|
|
69
|
+
buildStructuredGoals(allGoals) {
|
|
70
|
+
return {
|
|
71
|
+
goals: this.buildGroupedGoals(allGoals),
|
|
72
|
+
llmGoalStartInstruction: this.renderGoalStartInstruction(),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
renderGoalStartInstruction() {
|
|
76
|
+
const llmInstruction = [
|
|
77
|
+
"@LLM: Prompt the user for input about what goal to work on. ",
|
|
78
|
+
"For example, \"I can see we've recently worked on X, Y, Z. ",
|
|
79
|
+
"Everything was completed without blockers. Goals A, B, and N ",
|
|
80
|
+
"are available. Do you want to start with A, or something else?\"",
|
|
81
|
+
"Each goal group includes a hint with the suggested next-step command.",
|
|
82
|
+
"IMPORTANT: Run the suggested command for the chosen goal before doing any work!",
|
|
83
|
+
];
|
|
84
|
+
return llmInstruction.join("\n");
|
|
85
|
+
}
|
|
86
|
+
buildGroupedGoals(allGoals) {
|
|
87
|
+
const groupMap = new Map();
|
|
88
|
+
for (const goal of allGoals) {
|
|
89
|
+
const group = groupMap.get(goal.status) ?? [];
|
|
90
|
+
group.push(goal);
|
|
91
|
+
groupMap.set(goal.status, group);
|
|
92
|
+
}
|
|
93
|
+
const orderedStatuses = [...groupMap.keys()].sort((a, b) => (STATUS_ORDER[a] ?? 99) - (STATUS_ORDER[b] ?? 99));
|
|
94
|
+
const grouped = {};
|
|
95
|
+
for (const status of orderedStatuses) {
|
|
96
|
+
const goals = groupMap.get(status);
|
|
97
|
+
grouped[status] = {
|
|
98
|
+
hint: STATUS_HINTS[status] ?? "No action available",
|
|
99
|
+
count: goals.length,
|
|
100
|
+
goals: goals.map((g) => ({
|
|
101
|
+
goalId: g.goalId,
|
|
102
|
+
objective: g.objective,
|
|
103
|
+
createdAt: g.createdAt,
|
|
104
|
+
})),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return grouped;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.SessionGoalsOutputBuilder = SessionGoalsOutputBuilder;
|
|
111
|
+
//# sourceMappingURL=SessionGoalsOutputBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionGoalsOutputBuilder.js","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/SessionGoalsOutputBuilder.ts"],"names":[],"mappings":";;;AAAA,uFAAiF;AAGjF,2EAAqE;AAErE;;;;GAIG;AACH,MAAM,YAAY,GAAqC;IACrD,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,CAAC;IACb,eAAe,EAAE,CAAC;IAClB,WAAW,EAAE,CAAC;IACd,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,YAAY,GAAqC;IACrD,SAAS,EAAE,6BAA6B;IACxC,SAAS,EAAE,4BAA4B;IACvC,OAAO,EAAE,6BAA6B;IACtC,QAAQ,EAAE,6BAA6B;I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 +1,26 @@
|
|
|
1
|
+
import { TerminalOutput } from "../../../output/TerminalOutput.js";
|
|
2
|
+
import { EnrichedSessionContext } from "../../../../../application/context/sessions/get/EnrichedSessionContext.js";
|
|
3
|
+
/**
|
|
4
|
+
* SessionStartOutputBuilder - Top-level output builder for session start command.
|
|
5
|
+
*
|
|
6
|
+
* Composes SessionContextOutputBuilder and SessionGoalsOutputBuilder to produce
|
|
7
|
+
* the complete session start output. Supports both human-readable and structured modes.
|
|
8
|
+
*
|
|
9
|
+
* Pattern: Follows OutputBuilder composition pattern per decision dec_34f667f7.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SessionStartOutputBuilder {
|
|
12
|
+
private readonly builder;
|
|
13
|
+
private readonly sessionContextOutputBuilder;
|
|
14
|
+
private readonly sessionGoalsOutputBuilder;
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Build complete human-readable session start output.
|
|
18
|
+
* Composes project context, session summary, goals, and LLM instructions.
|
|
19
|
+
*/
|
|
20
|
+
buildSessionStartOutput(context: EnrichedSessionContext): TerminalOutput;
|
|
21
|
+
/**
|
|
22
|
+
* Build structured JSON output for session start command.
|
|
23
|
+
*/
|
|
24
|
+
buildStructuredOutput(context: EnrichedSessionContext, sessionId: string): Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=SessionStartOutputBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionStartOutputBuilder.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/SessionStartOutputBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2EAA2E,CAAC;AAGnH;;;;;;;GAOG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAA8B;IAC1E,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA4B;;IAQtE;;;OAGG;IACH,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,GAAG,cAAc;IAyBxE;;OAEG;IACH,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAuBnG"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionStartOutputBuilder = void 0;
|
|
4
|
+
const TerminalOutputBuilder_js_1 = require("../../../output/TerminalOutputBuilder.js");
|
|
5
|
+
const SessionContextOutputBuilder_js_1 = require("./SessionContextOutputBuilder.js");
|
|
6
|
+
const SessionGoalsOutputBuilder_js_1 = require("./SessionGoalsOutputBuilder.js");
|
|
7
|
+
/**
|
|
8
|
+
* SessionStartOutputBuilder - Top-level output builder for session start command.
|
|
9
|
+
*
|
|
10
|
+
* Composes SessionContextOutputBuilder and SessionGoalsOutputBuilder to produce
|
|
11
|
+
* the complete session start output. Supports both human-readable and structured modes.
|
|
12
|
+
*
|
|
13
|
+
* Pattern: Follows OutputBuilder composition pattern per decision dec_34f667f7.
|
|
14
|
+
*/
|
|
15
|
+
class SessionStartOutputBuilder {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.builder = new TerminalOutputBuilder_js_1.TerminalOutputBuilder();
|
|
18
|
+
this.sessionContextOutputBuilder = new SessionContextOutputBuilder_js_1.SessionContextOutputBuilder();
|
|
19
|
+
this.sessionGoalsOutputBuilder = new SessionGoalsOutputBuilder_js_1.SessionGoalsOutputBuilder();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Build complete human-readable session start output.
|
|
23
|
+
* Composes project context, session summary, goals, and LLM instructions.
|
|
24
|
+
*/
|
|
25
|
+
buildSessionStartOutput(context) {
|
|
26
|
+
this.builder.reset();
|
|
27
|
+
const contextOutput = this.sessionContextOutputBuilder.buildSessionContext(context);
|
|
28
|
+
for (const section of contextOutput.getSections()) {
|
|
29
|
+
if (section.type === "prompt" && section.content) {
|
|
30
|
+
this.builder.addPrompt(section.content);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const allGoals = [
|
|
34
|
+
...context.context.activeGoals,
|
|
35
|
+
...context.context.pausedGoals,
|
|
36
|
+
...context.context.plannedGoals,
|
|
37
|
+
];
|
|
38
|
+
const goalsOutput = this.sessionGoalsOutputBuilder.buildGoalsOutput(allGoals);
|
|
39
|
+
for (const section of goalsOutput.getSections()) {
|
|
40
|
+
if (section.type === "prompt" && section.content) {
|
|
41
|
+
this.builder.addPrompt(section.content);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return this.builder.build();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Build structured JSON output for session start command.
|
|
48
|
+
*/
|
|
49
|
+
buildStructuredOutput(context, sessionId) {
|
|
50
|
+
const allGoals = [
|
|
51
|
+
...context.context.activeGoals,
|
|
52
|
+
...context.context.pausedGoals,
|
|
53
|
+
...context.context.plannedGoals,
|
|
54
|
+
];
|
|
55
|
+
const contextData = this.sessionContextOutputBuilder.buildStructuredSessionContext(context);
|
|
56
|
+
const goalsData = this.sessionGoalsOutputBuilder.buildStructuredGoals(allGoals);
|
|
57
|
+
return {
|
|
58
|
+
projectContext: contextData.projectContext,
|
|
59
|
+
sessionContext: contextData.sessionContext,
|
|
60
|
+
goals: goalsData.goals,
|
|
61
|
+
llmInstructions: {
|
|
62
|
+
sessionContext: contextData.llmSessionContextInstruction,
|
|
63
|
+
goalStart: goalsData.llmGoalStartInstruction,
|
|
64
|
+
},
|
|
65
|
+
sessionStart: {
|
|
66
|
+
sessionId,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.SessionStartOutputBuilder = SessionStartOutputBuilder;
|
|
72
|
+
//# sourceMappingURL=SessionStartOutputBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionStartOutputBuilder.js","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/SessionStartOutputBuilder.ts"],"names":[],"mappings":";;;AAAA,uFAAiF;AAGjF,qFAA+E;AAC/E,iFAA2E;AAC3E;;;;;;;GAOG;AACH,MAAa,yBAAyB;IAKpC;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,gDAAqB,EAAE,CAAC;QAC3C,IAAI,CAAC,2BAA2B,GAAG,IAAI,4DAA2B,EAAE,CAAC;QACrE,IAAI,CAAC,yBAAyB,GAAG,IAAI,wDAAyB,EAAE,CAAC;IACnE,CAAC;IAED;;;OAGG;IACH,uBAAuB,CAAC,OAA+B;QACrD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAErB,MAAM,aAAa,GAAG,IAAI,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACpF,KAAK,MAAM,OAAO,IAAI,aAAa,CAAC,WAAW,EAAE,EAAE,CAAC;YAClD,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACjD,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAiB,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;QAED,MAAM,QAAQ,GAAG;YACf,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW;YAC9B,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW;YAC9B,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY;SAChC,CAAC;QACF,MAAM,WAAW,GAAG,IAAI,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAC9E,KAAK,MAAM,OAAO,IAAI,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC;YAChD,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACjD,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAiB,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,qBAAqB,CAAC,OAA+B,EAAE,SAAiB;QACtE,MAAM,QAAQ,GAAG;YACf,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW;YAC9B,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW;YAC9B,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY;SAChC,CAAC;QAEF,MAAM,WAAW,GAAG,IAAI,CAAC,2BAA2B,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC;QAC5F,MAAM,SAAS,GAAG,IAAI,CAAC,yBAAyB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAEhF,OAAO;YACL,cAAc,EAAE,WAAW,CAAC,cAAc;YAC1C,cAAc,EAAE,WAAW,CAAC,cAAc;YAC1C,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,eAAe,EAAE;gBACf,cAAc,EAAE,WAAW,CAAC,4BAA4B;gBACxD,SAAS,EAAE,SAAS,CAAC,uBAAuB;aAC7C;YACD,YAAY,EAAE;gBACZ,SAAS;aACV;SACF,CAAC;IACJ,CAAC;CACF;AAlED,8DAkEC"}
|
|
@@ -6,46 +6,24 @@ export interface SessionStartTextRenderResult {
|
|
|
6
6
|
export interface SessionStartStructuredContext {
|
|
7
7
|
readonly projectContext: Record<string, unknown> | null;
|
|
8
8
|
readonly sessionContext: Record<string, unknown>;
|
|
9
|
-
readonly
|
|
10
|
-
readonly plannedGoals: Record<string, unknown>;
|
|
9
|
+
readonly goals: Record<string, unknown>;
|
|
11
10
|
readonly llmInstructions: {
|
|
12
11
|
readonly sessionContext: string | null;
|
|
13
12
|
readonly goalStart: string;
|
|
14
13
|
};
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
17
|
-
* SessionStartTextRenderer - Formats session start context for LLM orientation
|
|
16
|
+
* SessionStartTextRenderer - Formats session start context for LLM orientation.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* - Target audiences
|
|
22
|
-
* - Active audience pains
|
|
23
|
-
* - Session context (focus, status, paused goals, recent decisions)
|
|
24
|
-
* - In-progress goals
|
|
25
|
-
* - Planned goals
|
|
26
|
-
*
|
|
27
|
-
* Output Format: YAML (more LLM-friendly than JSON)
|
|
18
|
+
* Delegates to SessionStartOutputBuilder for composition.
|
|
19
|
+
* Retained for backward compatibility with existing callers and tests.
|
|
28
20
|
*/
|
|
29
21
|
export declare class SessionStartTextRenderer {
|
|
30
|
-
private readonly
|
|
22
|
+
private readonly sessionStartOutputBuilder;
|
|
23
|
+
private readonly sessionContextOutputBuilder;
|
|
31
24
|
constructor();
|
|
32
25
|
render(context: EnrichedSessionContext): SessionStartTextRenderResult;
|
|
33
26
|
buildStructuredContext(context: EnrichedSessionContext): SessionStartStructuredContext;
|
|
34
27
|
renderSessionSummary(context: EnrichedSessionContext): string;
|
|
35
|
-
private renderProjectContext;
|
|
36
|
-
private renderInProgressGoals;
|
|
37
|
-
private renderPlannedGoals;
|
|
38
|
-
private renderGoalStartInstruction;
|
|
39
|
-
/**
|
|
40
|
-
* Format message when no session summary exists (first-ever session on brownfield project)
|
|
41
|
-
*
|
|
42
|
-
* Outputs direct LLM instructions that cause the agent to proactively offer
|
|
43
|
-
* to help transfer existing project context into Jumbo.
|
|
44
|
-
*/
|
|
45
|
-
private buildProjectContextData;
|
|
46
|
-
private buildInProgressGoalsData;
|
|
47
|
-
private buildPlannedGoalsData;
|
|
48
|
-
private buildSessionContextData;
|
|
49
|
-
private buildBrownfieldInstruction;
|
|
50
28
|
}
|
|
51
29
|
//# sourceMappingURL=SessionStartTextRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionStartTextRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/SessionStartTextRenderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SessionStartTextRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/sessions/start/SessionStartTextRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2EAA2E,CAAC;AAInH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,eAAe,EAAE;QACxB,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH;AAED;;;;;GAKG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA4B;IACtE,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAA8B;;IAO1E,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,4BAA4B;IAqBrE,sBAAsB,CAAC,OAAO,EAAE,sBAAsB,GAAG,6BAA6B;IAatF,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM;CAG9D"}
|