@compilr-dev/cli 0.7.3 → 0.7.5
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/agent.d.ts +7 -2
- package/dist/agent.js +55 -39
- package/dist/commands-v2/handlers/project.js +65 -2
- package/dist/commands-v2/handlers/settings.js +18 -26
- package/dist/compilr-diff-companion.vsix +0 -0
- package/dist/db/schema.d.ts +1 -1
- package/dist/episodes/index.d.ts +13 -13
- package/dist/episodes/index.js +13 -14
- package/dist/guide/cli-guide-entries.js +54 -2
- package/dist/handlers/delegation-handlers.js +228 -50
- package/dist/handlers/interactive-flow-handlers.d.ts +26 -0
- package/dist/handlers/interactive-flow-handlers.js +61 -0
- package/dist/handlers/propose-alternatives-handlers.d.ts +36 -0
- package/dist/handlers/propose-alternatives-handlers.js +65 -0
- package/dist/index.js +13 -2
- package/dist/repl-v2.d.ts +66 -0
- package/dist/repl-v2.js +382 -53
- package/dist/shared-handlers.d.ts +57 -5
- package/dist/shared-handlers.js +50 -0
- package/dist/tools/consult.d.ts +14 -0
- package/dist/tools/consult.js +73 -0
- package/dist/tools/delegate.d.ts +12 -6
- package/dist/tools/delegate.js +35 -19
- package/dist/tools/interactive-flow.d.ts +13 -0
- package/dist/tools/interactive-flow.js +19 -0
- package/dist/tools/platform-adapter.d.ts +14 -2
- package/dist/tools/platform-adapter.js +16 -4
- package/dist/tools/propose-alternatives.d.ts +13 -0
- package/dist/tools/propose-alternatives.js +19 -0
- package/dist/tools.d.ts +22 -98
- package/dist/tools.js +27 -382
- package/dist/ui/markdown-renderer.js +26 -7
- package/dist/ui/overlay/data/tutorial-registry.js +2 -0
- package/dist/ui/overlay/data/tutorials/projects/interactive-flows.d.ts +9 -0
- package/dist/ui/overlay/data/tutorials/projects/interactive-flows.js +94 -0
- package/dist/ui/overlay/data/tutorials/projects/new-project.js +56 -20
- package/dist/ui/overlay/impl/interactive-flow-overlay-v2.d.ts +79 -0
- package/dist/ui/overlay/impl/interactive-flow-overlay-v2.js +580 -0
- package/dist/ui/overlay/impl/new-overlay-v2.d.ts +32 -0
- package/dist/ui/overlay/impl/new-overlay-v2.js +305 -66
- package/dist/ui/overlay/impl/propose-alternatives-overlay-v2.d.ts +53 -0
- package/dist/ui/overlay/impl/propose-alternatives-overlay-v2.js +326 -0
- package/dist/ui/overlay/index.d.ts +2 -0
- package/dist/ui/overlay/index.js +2 -0
- package/dist/ui/tool-formatters.js +61 -3
- package/package.json +3 -3
|
@@ -88,24 +88,30 @@ export const newProjectTutorial = (s) => ({
|
|
|
88
88
|
'',
|
|
89
89
|
],
|
|
90
90
|
},
|
|
91
|
-
// Page 5:
|
|
91
|
+
// Page 5: Project Type [3/8]
|
|
92
92
|
{
|
|
93
|
-
title: '
|
|
93
|
+
title: 'Project Type',
|
|
94
94
|
lines: [
|
|
95
95
|
'',
|
|
96
96
|
` ${s.primaryBold('Initialize New Project')} ${s.muted('[3/8]')}`,
|
|
97
97
|
'',
|
|
98
|
-
` ${s.primary('
|
|
98
|
+
` ${s.primary('What kind of project are you starting?')}`,
|
|
99
99
|
'',
|
|
100
|
-
` ${s.primary('>')}
|
|
101
|
-
`
|
|
102
|
-
''
|
|
103
|
-
`
|
|
104
|
-
`
|
|
100
|
+
` ${s.primary('>')} Software Development ${s.muted('Web apps, APIs, CLIs, libraries')}`,
|
|
101
|
+
` General Purpose ${s.muted('Blank workspace — define your own')}`,
|
|
102
|
+
` Research Paper ${s.muted('Academic / analytical document')}`,
|
|
103
|
+
` Content & Marketing ${s.muted('Blog posts, social copy, content')}`,
|
|
104
|
+
` Technical Documentation ${s.muted('API docs, user guides, tutorials')}`,
|
|
105
|
+
` Book ${s.muted('Long-form writing, fiction / nonfic')}`,
|
|
106
|
+
` Business Plan ${s.muted('Vision, market, financials, pitch')}`,
|
|
107
|
+
` Course ${s.muted('Curriculum, modules, lessons')}`,
|
|
105
108
|
'',
|
|
106
109
|
` ${s.muted('Up/Down Navigate | Enter Select | Esc Back')}`,
|
|
107
110
|
'',
|
|
108
|
-
` ${s.warning('TIP:')}
|
|
111
|
+
` ${s.warning('TIP:')} Picking a type tailors the wizard. Software types ask about`,
|
|
112
|
+
` tech stack + coding standards; non-software types skip those`,
|
|
113
|
+
` steps. The type also drives the team-roster suggestion two`,
|
|
114
|
+
` steps from now.`,
|
|
109
115
|
'',
|
|
110
116
|
],
|
|
111
117
|
},
|
|
@@ -178,24 +184,50 @@ export const newProjectTutorial = (s) => ({
|
|
|
178
184
|
'',
|
|
179
185
|
],
|
|
180
186
|
},
|
|
181
|
-
// Page 9:
|
|
187
|
+
// Page 9: Team Roster [7/8]
|
|
182
188
|
{
|
|
183
|
-
title: '
|
|
189
|
+
title: 'Team Roster',
|
|
184
190
|
lines: [
|
|
185
191
|
'',
|
|
186
192
|
` ${s.primaryBold('Initialize New Project')} ${s.muted('[7/8]')}`,
|
|
187
193
|
'',
|
|
188
|
-
` ${s.primary('
|
|
194
|
+
` ${s.primary('Team roster')}`,
|
|
189
195
|
'',
|
|
190
|
-
` ${s.
|
|
191
|
-
` 2. Guided (structured step-by-step workflow)`,
|
|
196
|
+
` ${s.muted('Software Development suggests these specialists:')}`,
|
|
192
197
|
'',
|
|
193
|
-
`
|
|
194
|
-
`
|
|
198
|
+
` ${s.muted('[▲_▲] Developer Writes and debugs code')}`,
|
|
199
|
+
` ${s.muted('[◈_◈] Architect System design')}`,
|
|
200
|
+
` ${s.muted('[◉_◉] QA Testing and quality')}`,
|
|
201
|
+
` ${s.muted('[▣_▣] PM Project planning')}`,
|
|
195
202
|
'',
|
|
196
|
-
` ${s.
|
|
203
|
+
` ${s.primary('How should we set up the team?')}`,
|
|
204
|
+
'',
|
|
205
|
+
` ${s.primary('>')} Add all suggested (4) ${s.muted('← recommended')}`,
|
|
206
|
+
` Customize selection`,
|
|
207
|
+
` Skip — start with just $default`,
|
|
208
|
+
'',
|
|
209
|
+
` ${s.muted('Up/Down Navigate | Enter Confirm | Esc Back')}`,
|
|
210
|
+
'',
|
|
211
|
+
` ${s.secondary('Three options:')}`,
|
|
197
212
|
'',
|
|
198
|
-
` ${s.
|
|
213
|
+
` ${s.primary('1.')} ${s.primaryBold('Add all suggested')} (default)`,
|
|
214
|
+
` Specialists are spawned automatically when the project is created.`,
|
|
215
|
+
` A chat with each agent is ready as soon as you finish.`,
|
|
216
|
+
'',
|
|
217
|
+
` ${s.primary('2.')} ${s.primaryBold('Customize selection')}`,
|
|
218
|
+
` Opens a checklist of the suggested agents. Use ${s.primary('Space')} to`,
|
|
219
|
+
` toggle each one on/off. ${s.primary('Enter')} when done. You can still`,
|
|
220
|
+
` run ${s.primary('/team add <role>')} later for roles outside the suggestion.`,
|
|
221
|
+
'',
|
|
222
|
+
` ${s.primary('3.')} ${s.primaryBold('Skip')}`,
|
|
223
|
+
` The project starts with only ${s.primary('$default')}. Useful for very`,
|
|
224
|
+
` small projects or when you prefer to add agents one at a time.`,
|
|
225
|
+
'',
|
|
226
|
+
` For project types with no default team (like General Purpose), this`,
|
|
227
|
+
` step is skipped automatically.`,
|
|
228
|
+
'',
|
|
229
|
+
` ${s.warning('TIP:')} If you accidentally skip and want the team back, run`,
|
|
230
|
+
` ${s.primary('/team add')} for each role you want.`,
|
|
199
231
|
'',
|
|
200
232
|
],
|
|
201
233
|
},
|
|
@@ -209,13 +241,13 @@ export const newProjectTutorial = (s) => ({
|
|
|
209
241
|
` ${s.primary('Ready to create project?')}`,
|
|
210
242
|
'',
|
|
211
243
|
` Project: ${s.primary('my-first-project')}`,
|
|
244
|
+
` Type: ${s.primary('Software Development')}`,
|
|
212
245
|
` Location: ${s.primary('./my-first-project/')}`,
|
|
213
|
-
` Structure: ${s.primary('Single repo')}`,
|
|
214
246
|
` Tech: ${s.primary('React + Node.js + PostgreSQL')}`,
|
|
215
247
|
` Standards: ${s.primary('TypeScript Strict (recommended)')}`,
|
|
216
248
|
` Git: ${s.primary('Yes')}`,
|
|
217
249
|
` Remote: ${s.primary('https://github.com/user/my-first-project')}`,
|
|
218
|
-
`
|
|
250
|
+
` Team: ${s.primary('4 specialists')} ${s.muted('($dev, $arch, $qa, $pm)')}`,
|
|
219
251
|
'',
|
|
220
252
|
` ${s.primary('>')} Create`,
|
|
221
253
|
` Cancel`,
|
|
@@ -243,6 +275,10 @@ export const newProjectTutorial = (s) => ({
|
|
|
243
275
|
` ${s.success('✓')} ${s.primary('Git repository')} with initial commit`,
|
|
244
276
|
` ${s.muted('Remote configured if you provided a URL')}`,
|
|
245
277
|
'',
|
|
278
|
+
` ${s.success('✓')} ${s.primary('Team specialists')} added to the project's team`,
|
|
279
|
+
` ${s.muted('Based on the type you picked + roster option chosen')}`,
|
|
280
|
+
` ${s.muted('Run /team to see them')}`,
|
|
281
|
+
'',
|
|
246
282
|
` You'll return to the Dashboard with your new project selected.`,
|
|
247
283
|
'',
|
|
248
284
|
],
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive Flow Overlay V2
|
|
3
|
+
*
|
|
4
|
+
* Multi-screen wizard for the `build_interactive_flow` DSL. Walks the
|
|
5
|
+
* user through a tree of nodes (question / info / branch / summary)
|
|
6
|
+
* defined by the agent. Branches are pure routing — never rendered.
|
|
7
|
+
*
|
|
8
|
+
* The state-machine logic (next-resolution, branch evaluation,
|
|
9
|
+
* backtrack) lives in `@compilr-dev/sdk/flow-runner` as pure helpers
|
|
10
|
+
* shared with Desktop. This overlay only handles per-node rendering +
|
|
11
|
+
* keyboard input + the renderer-specific transient state (cursor
|
|
12
|
+
* position, multi-selections, text buffer).
|
|
13
|
+
*
|
|
14
|
+
* Renderer collapses: the SDK has many `render` variants (tile-row,
|
|
15
|
+
* card-grid, segmented, …) that target GUIs. The terminal collapses
|
|
16
|
+
* them all to one rendering per input mode — `render` is ignored, as
|
|
17
|
+
* are `tone`, `density`, `icon`.
|
|
18
|
+
*
|
|
19
|
+
* Phase coverage (per spec):
|
|
20
|
+
* - Phase A: single + text(single-line) + info + summary + branch ✓
|
|
21
|
+
* - Phase B: multi + text(multiline) ✓
|
|
22
|
+
* - Phase C: proposal mode — rendered inline as a numbered list with
|
|
23
|
+
* pros + cons under each option. Same selection UX as 'single' mode
|
|
24
|
+
* (arrows / 1-9 / Enter). Result is the chosen Proposal's id, which
|
|
25
|
+
* `lookupLabel` resolves to the option's label for the summary table.
|
|
26
|
+
*
|
|
27
|
+
* Spec: project-docs/00-requirements/compilr-dev-cli/interactive-flow-cli-spec.md
|
|
28
|
+
*/
|
|
29
|
+
import { BaseOverlayV2 } from '../../base/index.js';
|
|
30
|
+
import type { RenderContext, OverlayAction, KeyEvent } from '../types.js';
|
|
31
|
+
import type { Flow, AnswerValue, InteractiveFlowResult, NodeId } from '../../../shared-handlers.js';
|
|
32
|
+
interface FlowState {
|
|
33
|
+
/** Stack of every node visited, in order. Last element is current. */
|
|
34
|
+
path: NodeId[];
|
|
35
|
+
/** Final answers per question node */
|
|
36
|
+
answers: Record<NodeId, AnswerValue>;
|
|
37
|
+
/** Human-readable labels for the answers */
|
|
38
|
+
answerLabels: Record<NodeId, AnswerValue>;
|
|
39
|
+
/** Wall-clock start for durationMs */
|
|
40
|
+
startedAt: number;
|
|
41
|
+
/** Cursor index for single/multi questions */
|
|
42
|
+
selectedIndex: number;
|
|
43
|
+
/** Selections for multi mode (zero-based choice indices) */
|
|
44
|
+
multiSelections: Set<number>;
|
|
45
|
+
/** Text buffer for text-input questions */
|
|
46
|
+
inputBuffer: string;
|
|
47
|
+
/** Last warning message (e.g. multi-select min/max not met) */
|
|
48
|
+
warning: string;
|
|
49
|
+
}
|
|
50
|
+
export interface InteractiveFlowOptionsV2 {
|
|
51
|
+
flow: Flow;
|
|
52
|
+
}
|
|
53
|
+
export type InteractiveFlowResultV2 = InteractiveFlowResult;
|
|
54
|
+
export declare class InteractiveFlowOverlayV2 extends BaseOverlayV2<FlowState, InteractiveFlowResultV2> {
|
|
55
|
+
readonly type: "inline";
|
|
56
|
+
readonly id = "interactive-flow-overlay-v2";
|
|
57
|
+
private readonly flow;
|
|
58
|
+
constructor(options: InteractiveFlowOptionsV2);
|
|
59
|
+
protected renderContent(context: RenderContext): string[];
|
|
60
|
+
handleKey(key: KeyEvent): OverlayAction<InteractiveFlowResultV2>;
|
|
61
|
+
getCloseSummary(result: InteractiveFlowResultV2): string | null;
|
|
62
|
+
private currentNodeId;
|
|
63
|
+
private currentNode;
|
|
64
|
+
private renderQuestion;
|
|
65
|
+
private handleQuestionKey;
|
|
66
|
+
private renderInfo;
|
|
67
|
+
private handleInfoKey;
|
|
68
|
+
private renderSummary;
|
|
69
|
+
private handleSummaryKey;
|
|
70
|
+
private advance;
|
|
71
|
+
private advanceInfo;
|
|
72
|
+
private handleBackOrCancel;
|
|
73
|
+
private resetTransientState;
|
|
74
|
+
private makeCompleted;
|
|
75
|
+
private makeAborted;
|
|
76
|
+
private footerHints;
|
|
77
|
+
private tinted;
|
|
78
|
+
}
|
|
79
|
+
export {};
|