create-quiver 0.14.0 → 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.
- package/CHANGELOG.md +27 -0
- package/README.md +187 -518
- package/README_FOR_AI.md +39 -27
- package/ROADMAP.md +11 -0
- package/assets/quiver-wordmark.svg +22 -0
- package/docs/AI_CONTEXT.md.template +2 -0
- package/docs/AI_ONBOARDING_PROMPT.md.template +9 -1
- package/docs/CLI_UX_GUIDE.md +185 -0
- package/docs/COMMANDS.md.template +22 -3
- package/docs/GITFLOW_PR_GUIDE.md +70 -0
- package/docs/getting-started/linux.md +84 -0
- package/docs/getting-started/macos.md +85 -0
- package/docs/getting-started/windows-git-bash-wsl.md +78 -0
- package/docs/getting-started/windows-powershell.md +96 -0
- package/docs/reference/commands.md +98 -0
- package/docs/workflows/existing-project.md +131 -0
- package/docs/workflows/full-ai-spec-to-pr.md +311 -0
- package/docs/workflows/legacy-quiver-project.md +102 -0
- package/docs/workflows/new-project.md +76 -0
- package/package.json +5 -1
- package/specs/quiver-v29-planner-prepare-context-cli-ux/EVIDENCE_REPORT.md +163 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/EXECUTION_PLAN.md +72 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/SPEC.md +173 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/STATUS.md +34 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/pr.md +95 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-00-cli-ux-spec-foundation/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-00-cli-ux-spec-foundation/EXECUTION_BRIEF.md +45 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-00-cli-ux-spec-foundation/slice.json +58 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-01-cli-ux-primitives-theme/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-01-cli-ux-primitives-theme/EXECUTION_BRIEF.md +49 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-01-cli-ux-primitives-theme/slice.json +75 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-02-planner-context-proposal-contract/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-02-planner-context-proposal-contract/EXECUTION_BRIEF.md +47 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-02-planner-context-proposal-contract/slice.json +71 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-03-prepare-context-planner-review-flow/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-03-prepare-context-planner-review-flow/EXECUTION_BRIEF.md +52 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-03-prepare-context-planner-review-flow/slice.json +82 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-04-ux-flag-matrix-compatibility/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-04-ux-flag-matrix-compatibility/EXECUTION_BRIEF.md +46 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-04-ux-flag-matrix-compatibility/slice.json +73 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-05-progressive-command-adoption/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-05-progressive-command-adoption/EXECUTION_BRIEF.md +46 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-05-progressive-command-adoption/slice.json +83 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-06-docs-tests-smoke-readiness/CLOSURE_BRIEF.md +31 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-06-docs-tests-smoke-readiness/EXECUTION_BRIEF.md +50 -0
- package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-06-docs-tests-smoke-readiness/slice.json +95 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/EVIDENCE_REPORT.md +213 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/EXECUTION_PLAN.md +85 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/SPEC.md +213 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/STATUS.md +31 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/pr.md +103 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +56 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-00-spec-foundation/slice.json +71 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-01-cli-ux-runtime-progress-engine/CLOSURE_BRIEF.md +31 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-01-cli-ux-runtime-progress-engine/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-01-cli-ux-runtime-progress-engine/slice.json +69 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-02-agent-profile-selection-selectors/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-02-agent-profile-selection-selectors/EXECUTION_BRIEF.md +56 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-02-agent-profile-selection-selectors/slice.json +81 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-03-provider-model-selection-contract/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-03-provider-model-selection-contract/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-03-provider-model-selection-contract/slice.json +75 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-04-planner-ia-progress-flows/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-04-planner-ia-progress-flows/EXECUTION_BRIEF.md +57 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-04-planner-ia-progress-flows/slice.json +85 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-05-executor-pr-progress-flows/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-05-executor-pr-progress-flows/EXECUTION_BRIEF.md +57 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-05-executor-pr-progress-flows/slice.json +85 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-06-doctor-visual-json-contract/CLOSURE_BRIEF.md +35 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-06-doctor-visual-json-contract/EXECUTION_BRIEF.md +55 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-06-doctor-visual-json-contract/slice.json +81 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-07-interactive-init-spec-create/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-07-interactive-init-spec-create/EXECUTION_BRIEF.md +55 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-07-interactive-init-spec-create/slice.json +85 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-08-tests-docs-cross-platform-release/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-08-tests-docs-cross-platform-release/EXECUTION_BRIEF.md +59 -0
- package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-08-tests-docs-cross-platform-release/slice.json +95 -0
- package/src/create-quiver/commands/ai.js +809 -71
- package/src/create-quiver/commands/spec.js +167 -5
- package/src/create-quiver/index.js +582 -71
- package/src/create-quiver/lib/agent-profiles.js +111 -10
- package/src/create-quiver/lib/ai/context-proposal.js +389 -0
- package/src/create-quiver/lib/ai/context-proposal.schema.js +31 -0
- package/src/create-quiver/lib/ai/execution-plan.js +106 -8
- package/src/create-quiver/lib/ai/executor.js +284 -28
- package/src/create-quiver/lib/ai/providers.js +71 -1
- package/src/create-quiver/lib/cli/editor.js +118 -0
- package/src/create-quiver/lib/cli/selectors.js +107 -0
- package/src/create-quiver/lib/cli/theme.js +103 -0
- package/src/create-quiver/lib/cli/ux-flags.js +169 -0
- package/src/create-quiver/lib/cli/ux.js +225 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
const { resolveTheme, isTruthy } = require('./theme');
|
|
2
|
+
|
|
3
|
+
function resolveUxMode(options = {}, env = process.env, io = {}) {
|
|
4
|
+
const isTTY = {
|
|
5
|
+
stdin: options.stdinIsTTY ?? Boolean((io.input || process.stdin).isTTY),
|
|
6
|
+
stdout: options.stdoutIsTTY ?? Boolean((io.output || process.stdout).isTTY),
|
|
7
|
+
stderr: options.stderrIsTTY ?? Boolean((io.error || process.stderr).isTTY),
|
|
8
|
+
};
|
|
9
|
+
const json = options.json === true;
|
|
10
|
+
const ci = isTruthy(env.CI);
|
|
11
|
+
const noColor = options.noColor === true || Boolean(env.NO_COLOR);
|
|
12
|
+
const interactive = options.interactive === true;
|
|
13
|
+
const decoration = !json && !ci && isTTY.stdout;
|
|
14
|
+
const usePrompts = decoration && interactive && isTTY.stdin;
|
|
15
|
+
const useSpinners = decoration && options.spinner !== false;
|
|
16
|
+
const theme = resolveTheme({ ...options, json, noColor }, env, {
|
|
17
|
+
stdout: isTTY.stdout,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
ci,
|
|
22
|
+
decoration,
|
|
23
|
+
interactive,
|
|
24
|
+
isTTY,
|
|
25
|
+
json,
|
|
26
|
+
noColor,
|
|
27
|
+
theme,
|
|
28
|
+
usePrompts,
|
|
29
|
+
useSpinners,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function loadClack(injected) {
|
|
34
|
+
if (injected) return injected;
|
|
35
|
+
return import('@clack/prompts');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function createUx(options = {}) {
|
|
39
|
+
const env = options.env || process.env;
|
|
40
|
+
const io = {
|
|
41
|
+
input: options.input || process.stdin,
|
|
42
|
+
output: options.output || process.stdout,
|
|
43
|
+
error: options.error || process.stderr,
|
|
44
|
+
};
|
|
45
|
+
const mode = resolveUxMode(options, env, io);
|
|
46
|
+
const write = options.write || ((text) => io.output.write(text));
|
|
47
|
+
|
|
48
|
+
function line(text = '') {
|
|
49
|
+
write(`${text}\n`);
|
|
50
|
+
}
|
|
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
|
+
|
|
57
|
+
function heading(text) {
|
|
58
|
+
if (mode.json) return;
|
|
59
|
+
if (!mode.decoration) {
|
|
60
|
+
line(text);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const prefix = mode.theme.symbols.start;
|
|
64
|
+
line(mode.theme.status('planner', `${prefix} ${text}`));
|
|
65
|
+
}
|
|
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
|
+
|
|
77
|
+
function writeStatus(status, text) {
|
|
78
|
+
if (mode.json) return;
|
|
79
|
+
if (!mode.decoration) {
|
|
80
|
+
line(text);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
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
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function withSpinner(message, task, spinnerOptions = {}) {
|
|
129
|
+
if (!mode.useSpinners) {
|
|
130
|
+
if (!mode.json && spinnerOptions.echo !== false) {
|
|
131
|
+
if (mode.decoration) {
|
|
132
|
+
writeStatus('info', message);
|
|
133
|
+
} else {
|
|
134
|
+
line(message);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return task();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const clack = await loadClack(options.prompts);
|
|
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
|
+
}
|
|
148
|
+
spinner.start(message);
|
|
149
|
+
try {
|
|
150
|
+
const result = await task();
|
|
151
|
+
stop(spinnerOptions.successMessage || message);
|
|
152
|
+
return result;
|
|
153
|
+
} catch (error) {
|
|
154
|
+
stop(spinnerOptions.failureMessage || `Failed: ${message}`, 1);
|
|
155
|
+
throw error;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
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
|
+
|
|
185
|
+
async function promptConfirm(message, promptOptions = {}) {
|
|
186
|
+
if (!mode.usePrompts) {
|
|
187
|
+
throw new Error('create-quiver: interactive confirmation requires an interactive TTY. Pass the equivalent flags or rerun with --interactive.');
|
|
188
|
+
}
|
|
189
|
+
if (options.promptConfirm) {
|
|
190
|
+
return options.promptConfirm(message, promptOptions);
|
|
191
|
+
}
|
|
192
|
+
const clack = await loadClack(options.prompts);
|
|
193
|
+
const result = await clack.confirm({
|
|
194
|
+
message,
|
|
195
|
+
initialValue: promptOptions.initialValue === true,
|
|
196
|
+
});
|
|
197
|
+
if (clack.isCancel && clack.isCancel(result)) {
|
|
198
|
+
throw new Error('create-quiver: interactive confirmation canceled.');
|
|
199
|
+
}
|
|
200
|
+
return result === true;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
check,
|
|
205
|
+
error,
|
|
206
|
+
heading,
|
|
207
|
+
info,
|
|
208
|
+
line,
|
|
209
|
+
mode,
|
|
210
|
+
nextSteps,
|
|
211
|
+
promptConfirm,
|
|
212
|
+
section,
|
|
213
|
+
summary,
|
|
214
|
+
taskGroup,
|
|
215
|
+
theme: mode.theme,
|
|
216
|
+
warning,
|
|
217
|
+
withSpinner,
|
|
218
|
+
writeStatus,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
module.exports = {
|
|
223
|
+
createUx,
|
|
224
|
+
resolveUxMode,
|
|
225
|
+
};
|