create-quiver 0.14.1 → 0.15.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +4 -0
  3. package/README_FOR_AI.md +8 -2
  4. package/ROADMAP.md +8 -2
  5. package/docs/CLI_UX_GUIDE.md +64 -4
  6. package/docs/COMMANDS.md.template +7 -1
  7. package/docs/reference/commands.md +4 -0
  8. package/package.json +1 -1
  9. package/specs/quiver-v30-interactive-cli-ux-agent-selection/EVIDENCE_REPORT.md +213 -0
  10. package/specs/quiver-v30-interactive-cli-ux-agent-selection/EXECUTION_PLAN.md +85 -0
  11. package/specs/quiver-v30-interactive-cli-ux-agent-selection/SPEC.md +213 -0
  12. package/specs/quiver-v30-interactive-cli-ux-agent-selection/STATUS.md +31 -0
  13. package/specs/quiver-v30-interactive-cli-ux-agent-selection/pr.md +103 -0
  14. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +33 -0
  15. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +56 -0
  16. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-00-spec-foundation/slice.json +71 -0
  17. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-01-cli-ux-runtime-progress-engine/CLOSURE_BRIEF.md +31 -0
  18. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-01-cli-ux-runtime-progress-engine/EXECUTION_BRIEF.md +54 -0
  19. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-01-cli-ux-runtime-progress-engine/slice.json +69 -0
  20. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-02-agent-profile-selection-selectors/CLOSURE_BRIEF.md +33 -0
  21. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-02-agent-profile-selection-selectors/EXECUTION_BRIEF.md +56 -0
  22. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-02-agent-profile-selection-selectors/slice.json +81 -0
  23. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-03-provider-model-selection-contract/CLOSURE_BRIEF.md +32 -0
  24. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-03-provider-model-selection-contract/EXECUTION_BRIEF.md +54 -0
  25. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-03-provider-model-selection-contract/slice.json +75 -0
  26. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-04-planner-ia-progress-flows/CLOSURE_BRIEF.md +32 -0
  27. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-04-planner-ia-progress-flows/EXECUTION_BRIEF.md +57 -0
  28. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-04-planner-ia-progress-flows/slice.json +85 -0
  29. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-05-executor-pr-progress-flows/CLOSURE_BRIEF.md +33 -0
  30. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-05-executor-pr-progress-flows/EXECUTION_BRIEF.md +57 -0
  31. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-05-executor-pr-progress-flows/slice.json +85 -0
  32. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-06-doctor-visual-json-contract/CLOSURE_BRIEF.md +35 -0
  33. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-06-doctor-visual-json-contract/EXECUTION_BRIEF.md +55 -0
  34. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-06-doctor-visual-json-contract/slice.json +81 -0
  35. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-07-interactive-init-spec-create/CLOSURE_BRIEF.md +34 -0
  36. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-07-interactive-init-spec-create/EXECUTION_BRIEF.md +55 -0
  37. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-07-interactive-init-spec-create/slice.json +85 -0
  38. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-08-tests-docs-cross-platform-release/CLOSURE_BRIEF.md +34 -0
  39. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-08-tests-docs-cross-platform-release/EXECUTION_BRIEF.md +59 -0
  40. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-08-tests-docs-cross-platform-release/slice.json +95 -0
  41. package/src/create-quiver/commands/ai.js +364 -81
  42. package/src/create-quiver/commands/spec.js +106 -6
  43. package/src/create-quiver/index.js +533 -70
  44. package/src/create-quiver/lib/agent-profiles.js +111 -10
  45. package/src/create-quiver/lib/ai/execution-plan.js +106 -8
  46. package/src/create-quiver/lib/ai/executor.js +284 -28
  47. package/src/create-quiver/lib/ai/providers.js +71 -1
  48. package/src/create-quiver/lib/cli/selectors.js +107 -0
  49. package/src/create-quiver/lib/cli/theme.js +5 -2
  50. package/src/create-quiver/lib/cli/ux-flags.js +18 -0
  51. package/src/create-quiver/lib/cli/ux.js +100 -5
@@ -49,6 +49,11 @@ function createUx(options = {}) {
49
49
  write(`${text}\n`);
50
50
  }
51
51
 
52
+ function formatStatus(status, text) {
53
+ const symbol = mode.theme.symbols[status] || mode.theme.symbols.bullet;
54
+ return mode.theme.status(status, `${symbol} ${text}`);
55
+ }
56
+
52
57
  function heading(text) {
53
58
  if (mode.json) return;
54
59
  if (!mode.decoration) {
@@ -59,15 +64,65 @@ function createUx(options = {}) {
59
64
  line(mode.theme.status('planner', `${prefix} ${text}`));
60
65
  }
61
66
 
67
+ function section(text) {
68
+ if (mode.json) return;
69
+ if (!mode.decoration) {
70
+ line(text);
71
+ return;
72
+ }
73
+ const prefix = mode.theme.symbols.section || mode.theme.symbols.start;
74
+ line(mode.theme.status('command', `${prefix} ${text}`));
75
+ }
76
+
62
77
  function writeStatus(status, text) {
63
78
  if (mode.json) return;
64
79
  if (!mode.decoration) {
65
80
  line(text);
66
81
  return;
67
82
  }
68
- const symbol = mode.theme.symbols[status] || mode.theme.symbols.bullet;
69
- const body = mode.theme.status(status, `${symbol} ${text}`);
70
- line(body);
83
+ line(formatStatus(status, text));
84
+ }
85
+
86
+ function check(text) {
87
+ writeStatus('success', text);
88
+ }
89
+
90
+ function warning(text) {
91
+ writeStatus('warning', text);
92
+ }
93
+
94
+ function error(text) {
95
+ writeStatus('error', text);
96
+ }
97
+
98
+ function info(text) {
99
+ writeStatus('info', text);
100
+ }
101
+
102
+ function summary(items = [], summaryOptions = {}) {
103
+ if (mode.json) return;
104
+ const title = summaryOptions.title || 'Summary';
105
+ section(title);
106
+ for (const item of items) {
107
+ if (typeof item === 'string') {
108
+ line(mode.decoration ? mode.theme.status('muted', ` ${mode.theme.symbols.bullet} ${item}`) : `- ${item}`);
109
+ continue;
110
+ }
111
+ if (item && typeof item === 'object') {
112
+ const label = item.label || item.key || '';
113
+ const value = item.value == null ? '' : String(item.value);
114
+ const text = label ? `${label}: ${value}` : value;
115
+ line(mode.decoration ? mode.theme.status(item.status || 'muted', ` ${mode.theme.symbols.bullet} ${text}`) : `- ${text}`);
116
+ }
117
+ }
118
+ }
119
+
120
+ function nextSteps(steps = [], stepOptions = {}) {
121
+ if (mode.json || !Array.isArray(steps) || steps.length === 0) return;
122
+ section(stepOptions.title || 'Next steps');
123
+ for (const step of steps) {
124
+ line(mode.decoration ? mode.theme.status('command', ` ${mode.theme.symbols.bullet} ${step}`) : `- ${step}`);
125
+ }
71
126
  }
72
127
 
73
128
  async function withSpinner(message, task, spinnerOptions = {}) {
@@ -84,17 +139,49 @@ function createUx(options = {}) {
84
139
 
85
140
  const clack = await loadClack(options.prompts);
86
141
  const spinner = clack.spinner();
142
+ let stopped = false;
143
+ function stop(message, code) {
144
+ if (stopped) return;
145
+ stopped = true;
146
+ spinner.stop(message, code);
147
+ }
87
148
  spinner.start(message);
88
149
  try {
89
150
  const result = await task();
90
- spinner.stop(spinnerOptions.successMessage || message);
151
+ stop(spinnerOptions.successMessage || message);
91
152
  return result;
92
153
  } catch (error) {
93
- spinner.stop(spinnerOptions.failureMessage || `Failed: ${message}`, 1);
154
+ stop(spinnerOptions.failureMessage || `Failed: ${message}`, 1);
94
155
  throw error;
95
156
  }
96
157
  }
97
158
 
159
+ async function taskGroup(title, stages = []) {
160
+ heading(title);
161
+ const results = [];
162
+ for (const stage of stages) {
163
+ const run = typeof stage === 'function' ? stage : stage.run;
164
+ const message = typeof stage === 'function' ? stage.name || 'Running task' : stage.message;
165
+ const successMessage = stage.successMessage || message;
166
+ const useSpinner = stage.spinner === true;
167
+ if (typeof run !== 'function') {
168
+ throw new Error('create-quiver: taskGroup stage requires a run function.');
169
+ }
170
+ const result = useSpinner
171
+ ? await withSpinner(message, run, {
172
+ successMessage,
173
+ failureMessage: stage.failureMessage,
174
+ echo: stage.echo,
175
+ })
176
+ : await run();
177
+ if (!useSpinner) {
178
+ check(successMessage);
179
+ }
180
+ results.push(result);
181
+ }
182
+ return results;
183
+ }
184
+
98
185
  async function promptConfirm(message, promptOptions = {}) {
99
186
  if (!mode.usePrompts) {
100
187
  throw new Error('create-quiver: interactive confirmation requires an interactive TTY. Pass the equivalent flags or rerun with --interactive.');
@@ -114,11 +201,19 @@ function createUx(options = {}) {
114
201
  }
115
202
 
116
203
  return {
204
+ check,
205
+ error,
117
206
  heading,
207
+ info,
118
208
  line,
119
209
  mode,
210
+ nextSteps,
120
211
  promptConfirm,
212
+ section,
213
+ summary,
214
+ taskGroup,
121
215
  theme: mode.theme,
216
+ warning,
122
217
  withSpinner,
123
218
  writeStatus,
124
219
  };