@brucewaynedecoy/make-docs 1.0.0-rc.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/LICENSE +201 -0
- package/README.md +93 -0
- package/dist/chunk-HP3HBG7F.js +626 -0
- package/dist/chunk-HP3HBG7F.js.map +1 -0
- package/dist/chunk-QRFH4J6H.js +1194 -0
- package/dist/chunk-QRFH4J6H.js.map +1 -0
- package/dist/chunk-WM3OXYTW.js +2630 -0
- package/dist/chunk-WM3OXYTW.js.map +1 -0
- package/dist/index.js +1720 -0
- package/dist/index.js.map +1 -0
- package/dist/skills-command-3ESCZ75U.js +547 -0
- package/dist/skills-command-3ESCZ75U.js.map +1 -0
- package/dist/uninstall-GQE4SJF2.js +150 -0
- package/dist/uninstall-GQE4SJF2.js.map +1 -0
- package/package.json +49 -0
- package/skill-registry.json +276 -0
- package/skill-registry.schema.json +64 -0
- package/template/.make-docs/scripts/check_path_hygiene.py +435 -0
- package/template/AGENTS.md +3 -0
- package/template/CLAUDE.md +3 -0
- package/template/docs/AGENTS.md +15 -0
- package/template/docs/CLAUDE.md +15 -0
- package/template/docs/assets/AGENTS.md +9 -0
- package/template/docs/assets/CLAUDE.md +9 -0
- package/template/docs/assets/archive/AGENTS.md +20 -0
- package/template/docs/assets/archive/CLAUDE.md +20 -0
- package/template/docs/assets/history/AGENTS.md +12 -0
- package/template/docs/assets/history/CLAUDE.md +12 -0
- package/template/docs/assets/prompts/AGENTS.md +8 -0
- package/template/docs/assets/prompts/CLAUDE.md +8 -0
- package/template/docs/assets/prompts/designs-to-plan-change.prompt.md +14 -0
- package/template/docs/assets/prompts/designs-to-plan.prompt.md +10 -0
- package/template/docs/assets/prompts/docs-path-hygiene-cleanup.prompt.md +27 -0
- package/template/docs/assets/prompts/plan-to-prd-change.prompt.md +8 -0
- package/template/docs/assets/prompts/plan-to-prd-green-field.prompt.md +6 -0
- package/template/docs/assets/prompts/prd-change-to-work.prompt.md +10 -0
- package/template/docs/assets/prompts/prd-to-work-full-prd.prompt.md +6 -0
- package/template/docs/assets/prompts/prd-to-work-prd-feature.prompt.md +6 -0
- package/template/docs/assets/prompts/request-to-design.prompt.md +16 -0
- package/template/docs/assets/prompts/session-to-history-record.prompt.md +19 -0
- package/template/docs/assets/prompts/update-readme-green-field.prompt.md +6 -0
- package/template/docs/assets/prompts/work-to-commit-message.prompt.md +27 -0
- package/template/docs/assets/prompts/work-to-guides.prompt.md +18 -0
- package/template/docs/assets/references/AGENTS.md +9 -0
- package/template/docs/assets/references/CLAUDE.md +9 -0
- package/template/docs/assets/references/commit-message-convention.md +198 -0
- package/template/docs/assets/references/design-contract.md +62 -0
- package/template/docs/assets/references/design-workflow.md +60 -0
- package/template/docs/assets/references/execution-workflow.md +157 -0
- package/template/docs/assets/references/guide-contract.md +159 -0
- package/template/docs/assets/references/harness-capability-matrix.md +52 -0
- package/template/docs/assets/references/history-record-contract.md +137 -0
- package/template/docs/assets/references/output-contract.md +221 -0
- package/template/docs/assets/references/path-and-link-hygiene.md +49 -0
- package/template/docs/assets/references/planning-workflow.md +160 -0
- package/template/docs/assets/references/prd-change-management.md +129 -0
- package/template/docs/assets/references/wave-model.md +76 -0
- package/template/docs/assets/templates/AGENTS.md +8 -0
- package/template/docs/assets/templates/CLAUDE.md +8 -0
- package/template/docs/assets/templates/design.md +30 -0
- package/template/docs/assets/templates/guide-developer.md +54 -0
- package/template/docs/assets/templates/guide-user.md +58 -0
- package/template/docs/assets/templates/history-record.md +62 -0
- package/template/docs/assets/templates/plan-overview.md +32 -0
- package/template/docs/assets/templates/plan-prd-change.md +99 -0
- package/template/docs/assets/templates/plan-prd-decompose.md +70 -0
- package/template/docs/assets/templates/plan-prd.md +124 -0
- package/template/docs/assets/templates/prd-architecture.md +51 -0
- package/template/docs/assets/templates/prd-change-addition.md +45 -0
- package/template/docs/assets/templates/prd-change-revision.md +45 -0
- package/template/docs/assets/templates/prd-glossary.md +15 -0
- package/template/docs/assets/templates/prd-index.md +45 -0
- package/template/docs/assets/templates/prd-overview.md +43 -0
- package/template/docs/assets/templates/prd-reference.md +17 -0
- package/template/docs/assets/templates/prd-risk-register.md +55 -0
- package/template/docs/assets/templates/prd-subsystem.md +49 -0
- package/template/docs/assets/templates/work-index.md +21 -0
- package/template/docs/assets/templates/work-phase.md +34 -0
- package/template/docs/designs/AGENTS.md +21 -0
- package/template/docs/designs/CLAUDE.md +21 -0
- package/template/docs/guides/AGENTS.md +15 -0
- package/template/docs/guides/CLAUDE.md +15 -0
- package/template/docs/plans/AGENTS.md +20 -0
- package/template/docs/plans/CLAUDE.md +20 -0
- package/template/docs/prd/AGENTS.md +9 -0
- package/template/docs/prd/CLAUDE.md +9 -0
- package/template/docs/work/AGENTS.md +18 -0
- package/template/docs/work/CLAUDE.md +18 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1720 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
runBackupCommand
|
|
4
|
+
} from "./chunk-QRFH4J6H.js";
|
|
5
|
+
import {
|
|
6
|
+
applyInstallPlan,
|
|
7
|
+
findReviewableManagedFileConflicts,
|
|
8
|
+
planInstall
|
|
9
|
+
} from "./chunk-HP3HBG7F.js";
|
|
10
|
+
import {
|
|
11
|
+
Bt,
|
|
12
|
+
CAPABILITIES,
|
|
13
|
+
CAPABILITY_DEPENDENCIES,
|
|
14
|
+
Ct,
|
|
15
|
+
HARNESSES,
|
|
16
|
+
Jt,
|
|
17
|
+
Lt,
|
|
18
|
+
Lt2,
|
|
19
|
+
MANIFEST_RELATIVE_PATH,
|
|
20
|
+
PACKAGE_ROOT,
|
|
21
|
+
Rt,
|
|
22
|
+
U,
|
|
23
|
+
Vt,
|
|
24
|
+
W,
|
|
25
|
+
Wt,
|
|
26
|
+
cloneSelections,
|
|
27
|
+
defaultSelections,
|
|
28
|
+
formatInlineList,
|
|
29
|
+
getRecommendedSkillChoices,
|
|
30
|
+
getSkillRegistryNames,
|
|
31
|
+
h,
|
|
32
|
+
hasEffectiveCapabilities,
|
|
33
|
+
loadManifest,
|
|
34
|
+
loadSkillRegistry,
|
|
35
|
+
q,
|
|
36
|
+
readPackageMeta,
|
|
37
|
+
resolveInstallProfile,
|
|
38
|
+
te,
|
|
39
|
+
x
|
|
40
|
+
} from "./chunk-WM3OXYTW.js";
|
|
41
|
+
|
|
42
|
+
// src/cli.ts
|
|
43
|
+
import path from "path";
|
|
44
|
+
import { stdin as input, stdout as output } from "process";
|
|
45
|
+
|
|
46
|
+
// src/wizard.ts
|
|
47
|
+
import { styleText } from "util";
|
|
48
|
+
var CAPABILITY_METADATA = {
|
|
49
|
+
designs: {
|
|
50
|
+
label: "Designs",
|
|
51
|
+
hint: "Architecture decisions and rationale",
|
|
52
|
+
description: "Adds the architectural decision flow, design templates, and scoped references for long-lived design documentation."
|
|
53
|
+
},
|
|
54
|
+
plans: {
|
|
55
|
+
label: "Plans",
|
|
56
|
+
hint: "Execution plans and strategy docs",
|
|
57
|
+
description: "Adds planning workflows, plan templates, and the shared planning references that drive delivery before implementation starts."
|
|
58
|
+
},
|
|
59
|
+
prd: {
|
|
60
|
+
label: "PRD",
|
|
61
|
+
hint: "Product requirements documents",
|
|
62
|
+
description: "Adds the structured PRD set, architecture overview templates, and requirement references for descriptive product documentation."
|
|
63
|
+
},
|
|
64
|
+
work: {
|
|
65
|
+
label: "Work",
|
|
66
|
+
hint: "Implementation backlogs and task lists",
|
|
67
|
+
description: "Adds execution backlogs, phased work templates, and the prompts that decompose approved PRDs into buildable work."
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var OPTION_METADATA = {
|
|
71
|
+
skills: {
|
|
72
|
+
label: "Skills",
|
|
73
|
+
description: "Install reusable agent skills under the selected harness skill directories."
|
|
74
|
+
},
|
|
75
|
+
skillScope: {
|
|
76
|
+
label: "Skill scope",
|
|
77
|
+
project: "Install skills into this project.",
|
|
78
|
+
global: "Install skills into your home directory for reuse across projects."
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var HARNESS_METADATA = {
|
|
82
|
+
"claude-code": {
|
|
83
|
+
label: "Claude Code",
|
|
84
|
+
hint: "CLAUDE.md + .claude/"
|
|
85
|
+
},
|
|
86
|
+
codex: {
|
|
87
|
+
label: "Codex",
|
|
88
|
+
hint: "AGENTS.md + .agents/"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
var MANAGED_FILE_CONFLICT_GROUP_ORDER = [
|
|
92
|
+
"agent-instructions",
|
|
93
|
+
"references",
|
|
94
|
+
"templates",
|
|
95
|
+
"prompts",
|
|
96
|
+
"skills",
|
|
97
|
+
"managed-files",
|
|
98
|
+
"router-files",
|
|
99
|
+
"routers",
|
|
100
|
+
"other"
|
|
101
|
+
];
|
|
102
|
+
var MANAGED_FILE_CONFLICT_GROUP_LABELS = {
|
|
103
|
+
"agent-instructions": "Agent instructions",
|
|
104
|
+
references: "References",
|
|
105
|
+
templates: "Templates",
|
|
106
|
+
prompts: "Prompts",
|
|
107
|
+
skills: "Skills",
|
|
108
|
+
"managed-files": "Managed files",
|
|
109
|
+
"router-files": "Router files",
|
|
110
|
+
routers: "Router files",
|
|
111
|
+
other: "Other managed files"
|
|
112
|
+
};
|
|
113
|
+
function normalizeWizardSelections(selections) {
|
|
114
|
+
const next = cloneSelections(selections);
|
|
115
|
+
for (const capability of CAPABILITIES) {
|
|
116
|
+
const missingPrerequisites = CAPABILITY_DEPENDENCIES[capability].filter(
|
|
117
|
+
(dependency) => !next.capabilities[dependency]
|
|
118
|
+
);
|
|
119
|
+
if (missingPrerequisites.length > 0) {
|
|
120
|
+
next.capabilities[capability] = false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return next;
|
|
124
|
+
}
|
|
125
|
+
function applyCapabilitySelections(selections, selectedCapabilities) {
|
|
126
|
+
const next = cloneSelections(selections);
|
|
127
|
+
const selectedSet = new Set(selectedCapabilities);
|
|
128
|
+
for (const capability of CAPABILITIES) {
|
|
129
|
+
next.capabilities[capability] = selectedSet.has(capability);
|
|
130
|
+
}
|
|
131
|
+
return normalizeWizardSelections(next);
|
|
132
|
+
}
|
|
133
|
+
function getWizardOptionSelections(selections) {
|
|
134
|
+
return {
|
|
135
|
+
skills: selections.skills,
|
|
136
|
+
skillScope: selections.skillScope,
|
|
137
|
+
selectedSkills: [...selections.selectedSkills].sort()
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function buildSkillSelectionState(options, skillChoices) {
|
|
141
|
+
const selectedSkillSet = new Set(options.selectedSkills);
|
|
142
|
+
const selectedSkillNames = skillChoices.filter((skill) => selectedSkillSet.has(skill.name)).map((skill) => skill.name);
|
|
143
|
+
const promptOptions = skillChoices.map((skill) => ({
|
|
144
|
+
value: skill.name,
|
|
145
|
+
label: skill.name,
|
|
146
|
+
hint: skill.description,
|
|
147
|
+
disabled: false,
|
|
148
|
+
rowKind: "skill"
|
|
149
|
+
}));
|
|
150
|
+
return {
|
|
151
|
+
skills: skillChoices,
|
|
152
|
+
promptOptions,
|
|
153
|
+
selectedSkillNames
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function shouldPromptForSkillSelection(skillSelection) {
|
|
157
|
+
return skillSelection.skills.length > 0;
|
|
158
|
+
}
|
|
159
|
+
function getSelectedHarnesses(selections) {
|
|
160
|
+
return HARNESSES.filter((harness) => selections.harnesses[harness]);
|
|
161
|
+
}
|
|
162
|
+
function applyHarnessSelections(selections, selectedHarnesses) {
|
|
163
|
+
const next = cloneSelections(selections);
|
|
164
|
+
const selectedSet = new Set(selectedHarnesses);
|
|
165
|
+
for (const harness of HARNESSES) {
|
|
166
|
+
next.harnesses[harness] = selectedSet.has(harness);
|
|
167
|
+
}
|
|
168
|
+
return next;
|
|
169
|
+
}
|
|
170
|
+
function buildOptionsStepState(selections) {
|
|
171
|
+
const options = getWizardOptionSelections(selections);
|
|
172
|
+
const skillChoices = getRecommendedSkillChoices();
|
|
173
|
+
return {
|
|
174
|
+
selections,
|
|
175
|
+
options,
|
|
176
|
+
skillSelection: buildSkillSelectionState(options, skillChoices),
|
|
177
|
+
skillScopeOptions: [
|
|
178
|
+
{
|
|
179
|
+
value: "project",
|
|
180
|
+
label: "Project",
|
|
181
|
+
hint: OPTION_METADATA.skillScope.project
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
value: "global",
|
|
185
|
+
label: "Global",
|
|
186
|
+
hint: OPTION_METADATA.skillScope.global
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function applyWizardOptionSelections(selections, options) {
|
|
192
|
+
const next = cloneSelections(selections);
|
|
193
|
+
next.skills = options.skills;
|
|
194
|
+
next.skillScope = options.skillScope;
|
|
195
|
+
next.selectedSkills = options.skills ? Array.from(new Set(options.selectedSkills)).sort() : [];
|
|
196
|
+
return next;
|
|
197
|
+
}
|
|
198
|
+
function buildCapabilityChecklistState(selections) {
|
|
199
|
+
const normalizedSelections = normalizeWizardSelections(selections);
|
|
200
|
+
const profile = resolveInstallProfile(normalizedSelections);
|
|
201
|
+
const options = CAPABILITIES.map((capability) => {
|
|
202
|
+
const metadata = CAPABILITY_METADATA[capability];
|
|
203
|
+
const state = profile.capabilityState[capability];
|
|
204
|
+
const disabled = state.missingPrerequisites.length > 0;
|
|
205
|
+
const dependencyText = CAPABILITY_DEPENDENCIES[capability].length === 0 ? "No prerequisites" : `Requires ${formatInlineList(CAPABILITY_DEPENDENCIES[capability])}`;
|
|
206
|
+
const statusText = state.effectiveSelection ? "Selected" : disabled ? state.disabledReason ?? "Unavailable" : "Available";
|
|
207
|
+
return {
|
|
208
|
+
value: capability,
|
|
209
|
+
label: metadata.label,
|
|
210
|
+
hint: disabled ? state.disabledReason ?? metadata.hint : metadata.hint,
|
|
211
|
+
disabled,
|
|
212
|
+
description: metadata.description,
|
|
213
|
+
dependencyText,
|
|
214
|
+
statusText
|
|
215
|
+
};
|
|
216
|
+
});
|
|
217
|
+
return {
|
|
218
|
+
selections: normalizedSelections,
|
|
219
|
+
profile,
|
|
220
|
+
options,
|
|
221
|
+
selectedCapabilities: CAPABILITIES.filter(
|
|
222
|
+
(capability) => normalizedSelections.capabilities[capability]
|
|
223
|
+
)
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function renderWizardReviewSummary(selections) {
|
|
227
|
+
const normalizedSelections = normalizeWizardSelections(selections);
|
|
228
|
+
const profile = resolveInstallProfile(normalizedSelections);
|
|
229
|
+
const selectedHarnesses = getSelectedHarnesses(normalizedSelections);
|
|
230
|
+
const harnessSummary = selectedHarnesses.length > 0 ? formatInlineList(
|
|
231
|
+
selectedHarnesses.map((harness) => HARNESS_METADATA[harness].label)
|
|
232
|
+
) : "none";
|
|
233
|
+
const selectedSkillSummary = normalizedSelections.selectedSkills.length > 0 ? formatInlineList(normalizedSelections.selectedSkills) : "none";
|
|
234
|
+
const skillsSummary = normalizedSelections.skills ? `Yes (${normalizedSelections.skillScope})` : "No";
|
|
235
|
+
return [
|
|
236
|
+
"Document types",
|
|
237
|
+
...CAPABILITIES.map((capability) => {
|
|
238
|
+
const state = profile.capabilityState[capability];
|
|
239
|
+
const label = CAPABILITY_METADATA[capability].label;
|
|
240
|
+
const value = state.effectiveSelection ? "selected" : state.disabledReason ? `locked (${state.disabledReason})` : "off";
|
|
241
|
+
return `- ${label}: ${value}`;
|
|
242
|
+
}),
|
|
243
|
+
"",
|
|
244
|
+
"Options",
|
|
245
|
+
`- Harnesses: ${harnessSummary}`,
|
|
246
|
+
`- ${OPTION_METADATA.skills.label}: ${skillsSummary}`,
|
|
247
|
+
`- Selected skills: ${normalizedSelections.skills ? selectedSkillSummary : "n/a"}`
|
|
248
|
+
].join("\n");
|
|
249
|
+
}
|
|
250
|
+
async function runSelectionWizard(options) {
|
|
251
|
+
return runSelectionWizardWithRenderer(createClackWizardRenderer(), options);
|
|
252
|
+
}
|
|
253
|
+
async function runSelectionWizardWithRenderer(renderer, options) {
|
|
254
|
+
let selections = normalizeWizardSelections(options.initialSelections);
|
|
255
|
+
let step = options.startStep ?? "capabilities";
|
|
256
|
+
await renderer.beginSession?.(options.introTitle);
|
|
257
|
+
while (true) {
|
|
258
|
+
if (step === "capabilities") {
|
|
259
|
+
const selectedCapabilities = await renderer.editCapabilities({
|
|
260
|
+
selections,
|
|
261
|
+
checklist: buildCapabilityChecklistState(selections)
|
|
262
|
+
});
|
|
263
|
+
if (!selectedCapabilities) {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
selections = applyCapabilitySelections(selections, selectedCapabilities);
|
|
267
|
+
step = "harnesses";
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
if (step === "harnesses") {
|
|
271
|
+
const selectedHarnesses = await renderer.editHarnesses({
|
|
272
|
+
selections,
|
|
273
|
+
options: HARNESSES.map((harness) => ({
|
|
274
|
+
value: harness,
|
|
275
|
+
label: HARNESS_METADATA[harness].label,
|
|
276
|
+
hint: HARNESS_METADATA[harness].hint
|
|
277
|
+
})),
|
|
278
|
+
selectedHarnesses: getSelectedHarnesses(selections)
|
|
279
|
+
});
|
|
280
|
+
if (!selectedHarnesses) {
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
if (selectedHarnesses.length === 0) {
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
selections = applyHarnessSelections(selections, selectedHarnesses);
|
|
287
|
+
step = "options";
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
if (step === "options") {
|
|
291
|
+
const nextOptions = await renderer.editOptions(
|
|
292
|
+
buildOptionsStepState(selections)
|
|
293
|
+
);
|
|
294
|
+
if (!nextOptions) {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
selections = applyWizardOptionSelections(selections, nextOptions);
|
|
298
|
+
step = "review";
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
const reviewAction = await renderer.review({
|
|
302
|
+
selections,
|
|
303
|
+
profile: resolveInstallProfile(selections),
|
|
304
|
+
summary: renderWizardReviewSummary(selections)
|
|
305
|
+
});
|
|
306
|
+
if (reviewAction === "apply") {
|
|
307
|
+
return normalizeWizardSelections(selections);
|
|
308
|
+
}
|
|
309
|
+
if (reviewAction === "edit-capabilities") {
|
|
310
|
+
step = "capabilities";
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
if (reviewAction === "edit-harnesses") {
|
|
314
|
+
step = "harnesses";
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if (reviewAction === "edit-options") {
|
|
318
|
+
step = "options";
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
async function promptForManagedFileConflictResolutions(conflicts) {
|
|
325
|
+
if (conflicts.length === 0) {
|
|
326
|
+
return {};
|
|
327
|
+
}
|
|
328
|
+
const sortedConflicts = sortManagedFileConflicts(conflicts);
|
|
329
|
+
Vt(
|
|
330
|
+
renderManagedFileConflictSummary(sortedConflicts),
|
|
331
|
+
"Resolve managed file conflicts"
|
|
332
|
+
);
|
|
333
|
+
const batchResolution = await Jt({
|
|
334
|
+
message: "How should make-docs handle these existing files?",
|
|
335
|
+
withGuide: true,
|
|
336
|
+
initialValue: "review-each",
|
|
337
|
+
options: [
|
|
338
|
+
{
|
|
339
|
+
value: "overwrite-all",
|
|
340
|
+
label: "Overwrite all"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
value: "skip-all",
|
|
344
|
+
label: "Skip all"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
value: "review-each",
|
|
348
|
+
label: "Review each"
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
});
|
|
352
|
+
if (Ct(batchResolution)) {
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
if (batchResolution === "overwrite-all") {
|
|
356
|
+
return buildManagedFileConflictResolutions(sortedConflicts, "overwrite");
|
|
357
|
+
}
|
|
358
|
+
if (batchResolution === "skip-all") {
|
|
359
|
+
return buildManagedFileConflictResolutions(sortedConflicts, "skip");
|
|
360
|
+
}
|
|
361
|
+
const resolutions = {};
|
|
362
|
+
for (const group of getManagedFileConflictGroups(sortedConflicts)) {
|
|
363
|
+
const groupConflicts = sortedConflicts.filter(
|
|
364
|
+
(conflict) => getManagedFileConflictGroupKey(conflict) === group
|
|
365
|
+
);
|
|
366
|
+
if (groupConflicts.length === 0) {
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
Vt(
|
|
370
|
+
`${groupConflicts.length} ${pluralizeFile(groupConflicts.length)} to review.`,
|
|
371
|
+
styleText("cyan", getManagedFileConflictGroupLabel(group))
|
|
372
|
+
);
|
|
373
|
+
for (const conflict of groupConflicts) {
|
|
374
|
+
const fileNumber = sortedConflicts.indexOf(conflict) + 1;
|
|
375
|
+
Vt(
|
|
376
|
+
[
|
|
377
|
+
`Group: ${getManagedFileConflictGroupLabel(conflict.group)}`,
|
|
378
|
+
`Path: ${conflict.relativePath}`,
|
|
379
|
+
`Conflict: ${conflict.reason}`,
|
|
380
|
+
`File ${fileNumber} of ${sortedConflicts.length}`
|
|
381
|
+
].join("\n"),
|
|
382
|
+
"Existing managed file"
|
|
383
|
+
);
|
|
384
|
+
const resolution = await Jt({
|
|
385
|
+
message: `How should make-docs handle ${conflict.relativePath}?`,
|
|
386
|
+
withGuide: true,
|
|
387
|
+
initialValue: "skip",
|
|
388
|
+
options: [
|
|
389
|
+
{
|
|
390
|
+
value: "overwrite",
|
|
391
|
+
label: "Overwrite"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
value: "skip",
|
|
395
|
+
label: "Skip"
|
|
396
|
+
}
|
|
397
|
+
]
|
|
398
|
+
});
|
|
399
|
+
if (Ct(resolution)) {
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
402
|
+
resolutions[conflict.relativePath] = resolution;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return resolutions;
|
|
406
|
+
}
|
|
407
|
+
function sortManagedFileConflicts(conflicts) {
|
|
408
|
+
return [...conflicts].sort((left, right) => {
|
|
409
|
+
const leftGroup = getManagedFileConflictGroupKey(left);
|
|
410
|
+
const rightGroup = getManagedFileConflictGroupKey(right);
|
|
411
|
+
const groupOrder = getManagedFileConflictGroupOrder(leftGroup) - getManagedFileConflictGroupOrder(rightGroup);
|
|
412
|
+
if (groupOrder !== 0) {
|
|
413
|
+
return groupOrder;
|
|
414
|
+
}
|
|
415
|
+
const groupNameOrder = leftGroup.localeCompare(rightGroup);
|
|
416
|
+
if (groupNameOrder !== 0) {
|
|
417
|
+
return groupNameOrder;
|
|
418
|
+
}
|
|
419
|
+
return left.relativePath.localeCompare(right.relativePath);
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
function renderManagedFileConflictSummary(conflicts) {
|
|
423
|
+
const groups = getManagedFileConflictGroups(conflicts);
|
|
424
|
+
const counts = new Map(groups.map((group) => [group, 0]));
|
|
425
|
+
for (const conflict of conflicts) {
|
|
426
|
+
const group = getManagedFileConflictGroupKey(conflict);
|
|
427
|
+
counts.set(group, (counts.get(group) ?? 0) + 1);
|
|
428
|
+
}
|
|
429
|
+
return [
|
|
430
|
+
`make-docs found ${conflicts.length} existing managed ${pluralizeFile(
|
|
431
|
+
conflicts.length
|
|
432
|
+
)} with content that differs from make-docs.`,
|
|
433
|
+
...groups.map(
|
|
434
|
+
(group) => `${getManagedFileConflictGroupLabel(group)}: ${counts.get(group) ?? 0}`
|
|
435
|
+
),
|
|
436
|
+
`Review order: ${groups.map((group) => getManagedFileConflictGroupLabel(group).toLowerCase()).join(", ")}.`
|
|
437
|
+
].join("\n");
|
|
438
|
+
}
|
|
439
|
+
function buildManagedFileConflictResolutions(conflicts, resolution) {
|
|
440
|
+
const resolutions = {};
|
|
441
|
+
for (const conflict of conflicts) {
|
|
442
|
+
resolutions[conflict.relativePath] = resolution;
|
|
443
|
+
}
|
|
444
|
+
return resolutions;
|
|
445
|
+
}
|
|
446
|
+
function pluralizeFile(count) {
|
|
447
|
+
return count === 1 ? "file" : "files";
|
|
448
|
+
}
|
|
449
|
+
function getManagedFileConflictGroups(conflicts) {
|
|
450
|
+
const groupKeys = conflicts.map(
|
|
451
|
+
(conflict) => getManagedFileConflictGroupKey(conflict)
|
|
452
|
+
);
|
|
453
|
+
return Array.from(new Set(groupKeys)).sort((left, right) => {
|
|
454
|
+
const groupOrder = getManagedFileConflictGroupOrder(left) - getManagedFileConflictGroupOrder(right);
|
|
455
|
+
if (groupOrder !== 0) {
|
|
456
|
+
return groupOrder;
|
|
457
|
+
}
|
|
458
|
+
return left.localeCompare(right);
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
function getManagedFileConflictGroupKey(conflict) {
|
|
462
|
+
return conflict.group;
|
|
463
|
+
}
|
|
464
|
+
function getManagedFileConflictGroupOrder(group) {
|
|
465
|
+
const index = MANAGED_FILE_CONFLICT_GROUP_ORDER.indexOf(group);
|
|
466
|
+
return index === -1 ? MANAGED_FILE_CONFLICT_GROUP_ORDER.length : index;
|
|
467
|
+
}
|
|
468
|
+
function getManagedFileConflictGroupLabel(group) {
|
|
469
|
+
return MANAGED_FILE_CONFLICT_GROUP_LABELS[group] ?? toTitleCase(group);
|
|
470
|
+
}
|
|
471
|
+
function toTitleCase(value) {
|
|
472
|
+
return value.split(/[-_\s]+/).filter(Boolean).map((word) => `${word.slice(0, 1).toUpperCase()}${word.slice(1)}`).join(" ");
|
|
473
|
+
}
|
|
474
|
+
function createClackWizardRenderer() {
|
|
475
|
+
return {
|
|
476
|
+
beginSession(title) {
|
|
477
|
+
Wt(title);
|
|
478
|
+
},
|
|
479
|
+
async editCapabilities(state) {
|
|
480
|
+
return promptForCapabilities(state.selections);
|
|
481
|
+
},
|
|
482
|
+
async editHarnesses(state) {
|
|
483
|
+
return promptForHarnesses(state.selections);
|
|
484
|
+
},
|
|
485
|
+
async editOptions(state) {
|
|
486
|
+
return promptForOptions(state);
|
|
487
|
+
},
|
|
488
|
+
async review(state) {
|
|
489
|
+
Vt(state.summary, "Review selections");
|
|
490
|
+
const result = await Jt({
|
|
491
|
+
message: "What would you like to do next?",
|
|
492
|
+
withGuide: true,
|
|
493
|
+
options: [
|
|
494
|
+
{ value: "apply", label: "Apply", hint: "Use this configuration" },
|
|
495
|
+
{
|
|
496
|
+
value: "edit-capabilities",
|
|
497
|
+
label: "Edit document types",
|
|
498
|
+
hint: "Adjust managed document types"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
value: "edit-harnesses",
|
|
502
|
+
label: "Edit harnesses",
|
|
503
|
+
hint: "Adjust Claude Code and Codex support"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
value: "edit-options",
|
|
507
|
+
label: "Edit options",
|
|
508
|
+
hint: "Adjust skills and skill scope"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
value: "cancel",
|
|
512
|
+
label: "Cancel",
|
|
513
|
+
hint: "Exit without applying changes"
|
|
514
|
+
}
|
|
515
|
+
]
|
|
516
|
+
});
|
|
517
|
+
if (Ct(result)) {
|
|
518
|
+
return "cancel";
|
|
519
|
+
}
|
|
520
|
+
return result;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
async function promptForCapabilities(selections) {
|
|
525
|
+
const promptState = {
|
|
526
|
+
selections: normalizeWizardSelections(selections)
|
|
527
|
+
};
|
|
528
|
+
const prompt = new Lt({
|
|
529
|
+
options: buildCapabilityChecklistState(promptState.selections).options,
|
|
530
|
+
initialValues: buildCapabilityChecklistState(promptState.selections).selectedCapabilities,
|
|
531
|
+
required: true,
|
|
532
|
+
render() {
|
|
533
|
+
return renderCapabilitiesFrame(this, promptState.selections);
|
|
534
|
+
},
|
|
535
|
+
validate(value) {
|
|
536
|
+
if (!value || value.length === 0) {
|
|
537
|
+
return "Please keep at least one capability enabled.";
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
const syncPromptState = () => {
|
|
542
|
+
promptState.selections = applyCapabilitySelections(
|
|
543
|
+
selections,
|
|
544
|
+
prompt.value ?? []
|
|
545
|
+
);
|
|
546
|
+
const checklist = buildCapabilityChecklistState(promptState.selections);
|
|
547
|
+
prompt.options = checklist.options;
|
|
548
|
+
prompt.value = checklist.selectedCapabilities;
|
|
549
|
+
if (prompt.options[prompt.cursor]?.disabled) {
|
|
550
|
+
prompt.cursor = findNearestEnabledIndex(prompt.cursor, prompt.options);
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
prompt.on("value", syncPromptState);
|
|
554
|
+
prompt.on("cursor", syncPromptState);
|
|
555
|
+
prompt.on("key", syncPromptState);
|
|
556
|
+
syncPromptState();
|
|
557
|
+
const result = await prompt.prompt();
|
|
558
|
+
if (Ct(result)) {
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
return buildCapabilityChecklistState(promptState.selections).selectedCapabilities;
|
|
562
|
+
}
|
|
563
|
+
async function promptForHarnesses(selections) {
|
|
564
|
+
const result = await Lt2({
|
|
565
|
+
message: "Which agent platforms will you use?",
|
|
566
|
+
withGuide: true,
|
|
567
|
+
initialValues: getSelectedHarnesses(selections),
|
|
568
|
+
required: true,
|
|
569
|
+
options: HARNESSES.map((harness) => ({
|
|
570
|
+
value: harness,
|
|
571
|
+
label: HARNESS_METADATA[harness].label,
|
|
572
|
+
hint: HARNESS_METADATA[harness].hint
|
|
573
|
+
}))
|
|
574
|
+
});
|
|
575
|
+
if (Ct(result)) {
|
|
576
|
+
return null;
|
|
577
|
+
}
|
|
578
|
+
return result;
|
|
579
|
+
}
|
|
580
|
+
async function promptForOptions(state) {
|
|
581
|
+
const { options, skillSelection, skillScopeOptions } = state;
|
|
582
|
+
const skillsResult = await Rt({
|
|
583
|
+
message: "Install agent skills?",
|
|
584
|
+
withGuide: true,
|
|
585
|
+
initialValue: options.skills,
|
|
586
|
+
active: "Yes",
|
|
587
|
+
inactive: "No"
|
|
588
|
+
});
|
|
589
|
+
if (Ct(skillsResult)) {
|
|
590
|
+
return null;
|
|
591
|
+
}
|
|
592
|
+
let skillScope = options.skillScope;
|
|
593
|
+
let selectedSkills = options.selectedSkills;
|
|
594
|
+
if (skillsResult) {
|
|
595
|
+
const scopeResult = await Jt({
|
|
596
|
+
message: "Where should skills be installed?",
|
|
597
|
+
withGuide: true,
|
|
598
|
+
initialValue: options.skillScope,
|
|
599
|
+
options: skillScopeOptions
|
|
600
|
+
});
|
|
601
|
+
if (Ct(scopeResult)) {
|
|
602
|
+
return null;
|
|
603
|
+
}
|
|
604
|
+
skillScope = scopeResult;
|
|
605
|
+
if (shouldPromptForSkillSelection(skillSelection)) {
|
|
606
|
+
const prompt = new Lt({
|
|
607
|
+
options: skillSelection.promptOptions,
|
|
608
|
+
initialValues: skillSelection.selectedSkillNames,
|
|
609
|
+
required: false,
|
|
610
|
+
render() {
|
|
611
|
+
return renderSkillSelectionFrame(this, skillSelection);
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
const skillResult = await prompt.prompt();
|
|
615
|
+
if (Ct(skillResult)) {
|
|
616
|
+
return null;
|
|
617
|
+
}
|
|
618
|
+
const selectedSkillSet = new Set(skillResult);
|
|
619
|
+
selectedSkills = skillSelection.skills.filter((skill) => selectedSkillSet.has(skill.name)).map((skill) => skill.name);
|
|
620
|
+
} else {
|
|
621
|
+
selectedSkills = [];
|
|
622
|
+
}
|
|
623
|
+
} else {
|
|
624
|
+
selectedSkills = [];
|
|
625
|
+
}
|
|
626
|
+
return {
|
|
627
|
+
skills: skillsResult,
|
|
628
|
+
skillScope,
|
|
629
|
+
selectedSkills
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
function renderSkillSelectionFrame(prompt, skillSelection) {
|
|
633
|
+
const lineColor = prompt.state === "error" ? "yellow" : "cyan";
|
|
634
|
+
const header = [
|
|
635
|
+
styleText("gray", h),
|
|
636
|
+
Bt(
|
|
637
|
+
process.stdout,
|
|
638
|
+
"Select skills to install",
|
|
639
|
+
`${styleText(lineColor, h)} `,
|
|
640
|
+
`${W(prompt.state)} `
|
|
641
|
+
)
|
|
642
|
+
];
|
|
643
|
+
const bodyPrefix = `${styleText(lineColor, h)} `;
|
|
644
|
+
const selectedSkillNames = new Set(
|
|
645
|
+
prompt.value ?? skillSelection.selectedSkillNames
|
|
646
|
+
);
|
|
647
|
+
const selectedSummary = selectedSkillNames.size > 0 ? formatInlineList(Array.from(selectedSkillNames)) : "no skills";
|
|
648
|
+
if (prompt.state === "submit") {
|
|
649
|
+
return `${header.join("\n")}
|
|
650
|
+
${styleText("gray", h)} ${styleText("dim", selectedSummary)}`;
|
|
651
|
+
}
|
|
652
|
+
if (prompt.state === "cancel") {
|
|
653
|
+
return `${header.join("\n")}
|
|
654
|
+
${styleText("gray", h)} ${styleText(
|
|
655
|
+
["strikethrough", "dim"],
|
|
656
|
+
selectedSummary
|
|
657
|
+
)}`;
|
|
658
|
+
}
|
|
659
|
+
const focusedOption = getFocusedSkillSelectionOption(prompt, skillSelection);
|
|
660
|
+
const skillLines = renderSkillSelectionLines(
|
|
661
|
+
skillSelection.promptOptions,
|
|
662
|
+
prompt.cursor,
|
|
663
|
+
selectedSkillNames
|
|
664
|
+
);
|
|
665
|
+
const detailLines = renderDetailBox(
|
|
666
|
+
focusedOption.label,
|
|
667
|
+
[
|
|
668
|
+
focusedOption.hint || "No additional description available.",
|
|
669
|
+
"",
|
|
670
|
+
`Status: ${selectedSkillNames.has(focusedOption.value) ? "Selected" : "Available"}`
|
|
671
|
+
],
|
|
672
|
+
process.stdout.columns
|
|
673
|
+
);
|
|
674
|
+
const hintLines = [
|
|
675
|
+
`${styleText("dim", "Selected now:")} ${selectedSkillNames.size > 0 ? selectedSummary : styleText("dim", "none")}`,
|
|
676
|
+
`${styleText("dim", "Use \u2191/\u2193 to navigate")} \u2022 ${styleText(
|
|
677
|
+
"dim",
|
|
678
|
+
"Space toggles skills"
|
|
679
|
+
)} \u2022 ${styleText("dim", "Enter to confirm")}`
|
|
680
|
+
];
|
|
681
|
+
const footer = styleText(lineColor, x);
|
|
682
|
+
const spacer = styleText(lineColor, h);
|
|
683
|
+
const errorLines = prompt.state === "error" && prompt.error ? prompt.error.split("\n").map(
|
|
684
|
+
(line, index) => index === 0 ? `${styleText("yellow", x)} ${styleText("yellow", line)}` : ` ${styleText("yellow", line)}`
|
|
685
|
+
) : [];
|
|
686
|
+
return [
|
|
687
|
+
...header,
|
|
688
|
+
spacer,
|
|
689
|
+
...skillLines.map((line) => `${bodyPrefix}${line}`),
|
|
690
|
+
spacer,
|
|
691
|
+
...detailLines.map((line) => `${bodyPrefix}${line}`),
|
|
692
|
+
spacer,
|
|
693
|
+
`${bodyPrefix}${hintLines[0]}`,
|
|
694
|
+
`${bodyPrefix}${hintLines[1]}`,
|
|
695
|
+
footer,
|
|
696
|
+
...errorLines
|
|
697
|
+
].join("\n");
|
|
698
|
+
}
|
|
699
|
+
function getFocusedSkillSelectionOption(prompt, skillSelection) {
|
|
700
|
+
const activeOption = skillSelection.promptOptions[prompt.cursor];
|
|
701
|
+
if (activeOption) {
|
|
702
|
+
return activeOption;
|
|
703
|
+
}
|
|
704
|
+
return skillSelection.promptOptions[0] ?? {
|
|
705
|
+
value: "__skills",
|
|
706
|
+
label: "Skills",
|
|
707
|
+
hint: "",
|
|
708
|
+
disabled: true,
|
|
709
|
+
rowKind: "skill"
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
function renderSkillSelectionOption(option, active, selectedSkillNames) {
|
|
713
|
+
const selected = selectedSkillNames.has(option.value);
|
|
714
|
+
if (selected && active) {
|
|
715
|
+
return ` ${styleText("green", U)} ${styleText("white", option.label)}${option.hint ? ` ${styleText("dim", `(${option.hint})`)}` : ""}`;
|
|
716
|
+
}
|
|
717
|
+
if (selected) {
|
|
718
|
+
return ` ${styleText("green", U)} ${styleText("dim", option.label)}${option.hint ? ` ${styleText("dim", `(${option.hint})`)}` : ""}`;
|
|
719
|
+
}
|
|
720
|
+
if (active) {
|
|
721
|
+
return ` ${styleText("cyan", te)} ${styleText(
|
|
722
|
+
["bold", "white"],
|
|
723
|
+
option.label
|
|
724
|
+
)}${option.hint ? ` ${styleText("dim", `(${option.hint})`)}` : ""}`;
|
|
725
|
+
}
|
|
726
|
+
return ` ${styleText("dim", q)} ${styleText("dim", option.label)}${option.hint ? ` ${styleText("dim", `(${option.hint})`)}` : ""}`;
|
|
727
|
+
}
|
|
728
|
+
function renderSkillSelectionLines(options, activeIndex, selectedSkillNames) {
|
|
729
|
+
const lines = [];
|
|
730
|
+
options.forEach((option, index) => {
|
|
731
|
+
lines.push(
|
|
732
|
+
renderSkillSelectionOption(
|
|
733
|
+
option,
|
|
734
|
+
index === activeIndex,
|
|
735
|
+
selectedSkillNames
|
|
736
|
+
)
|
|
737
|
+
);
|
|
738
|
+
});
|
|
739
|
+
return lines;
|
|
740
|
+
}
|
|
741
|
+
function renderCapabilitiesFrame(prompt, selections) {
|
|
742
|
+
const checklist = buildCapabilityChecklistState(selections);
|
|
743
|
+
const lineColor = prompt.state === "error" ? "yellow" : "cyan";
|
|
744
|
+
const header = [
|
|
745
|
+
styleText("gray", h),
|
|
746
|
+
Bt(
|
|
747
|
+
process.stdout,
|
|
748
|
+
"Choose the document types to manage in this project:",
|
|
749
|
+
`${styleText(lineColor, h)} `,
|
|
750
|
+
`${W(prompt.state)} `
|
|
751
|
+
)
|
|
752
|
+
];
|
|
753
|
+
const bodyPrefix = `${styleText(lineColor, h)} `;
|
|
754
|
+
const focusedOption = checklist.options[prompt.cursor] ?? checklist.options[0];
|
|
755
|
+
const selectedLabels = checklist.selectedCapabilities.length > 0 ? checklist.selectedCapabilities.map(
|
|
756
|
+
(capability) => CAPABILITY_METADATA[capability].label
|
|
757
|
+
) : [];
|
|
758
|
+
if (prompt.state === "submit") {
|
|
759
|
+
const submittedSummary = selectedLabels.length > 0 ? formatInlineList(selectedLabels) : "no capability families";
|
|
760
|
+
return `${header.join("\n")}
|
|
761
|
+
${styleText("gray", h)} ${styleText("dim", submittedSummary)}`;
|
|
762
|
+
}
|
|
763
|
+
if (prompt.state === "cancel") {
|
|
764
|
+
const cancelledSummary = selectedLabels.length > 0 ? formatInlineList(selectedLabels) : "no capability families";
|
|
765
|
+
return `${header.join("\n")}
|
|
766
|
+
${styleText("gray", h)} ${styleText(
|
|
767
|
+
["strikethrough", "dim"],
|
|
768
|
+
cancelledSummary
|
|
769
|
+
)}`;
|
|
770
|
+
}
|
|
771
|
+
const checklistLines = checklist.options.map(
|
|
772
|
+
(option, index) => renderCapabilityOption(
|
|
773
|
+
option,
|
|
774
|
+
index === prompt.cursor,
|
|
775
|
+
checklist.selectedCapabilities
|
|
776
|
+
)
|
|
777
|
+
);
|
|
778
|
+
const detailLines = renderDetailBox(
|
|
779
|
+
focusedOption.label,
|
|
780
|
+
[
|
|
781
|
+
`${focusedOption.description}`,
|
|
782
|
+
"",
|
|
783
|
+
`Status: ${focusedOption.statusText}`,
|
|
784
|
+
`Prerequisites: ${focusedOption.dependencyText.replace(/^Requires /, "")}`
|
|
785
|
+
],
|
|
786
|
+
process.stdout.columns
|
|
787
|
+
);
|
|
788
|
+
const hintLines = [
|
|
789
|
+
`${styleText("dim", "Selected now:")} ${selectedLabels.length > 0 ? formatInlineList(selectedLabels) : styleText("dim", "none")}`,
|
|
790
|
+
`${styleText("dim", "Use \u2191/\u2193 to navigate")} \u2022 ${styleText(
|
|
791
|
+
"dim",
|
|
792
|
+
"Space to select or deselect"
|
|
793
|
+
)} \u2022 ${styleText("dim", "Enter to confirm")}`
|
|
794
|
+
];
|
|
795
|
+
const footer = styleText(lineColor, x);
|
|
796
|
+
const spacer = styleText(lineColor, h);
|
|
797
|
+
const errorLines = prompt.state === "error" ? prompt.error.split("\n").map(
|
|
798
|
+
(line, index) => index === 0 ? `${styleText("yellow", x)} ${styleText("yellow", line)}` : ` ${styleText("yellow", line)}`
|
|
799
|
+
) : [];
|
|
800
|
+
return [
|
|
801
|
+
...header,
|
|
802
|
+
spacer,
|
|
803
|
+
...checklistLines.map((line) => `${bodyPrefix}${line}`),
|
|
804
|
+
spacer,
|
|
805
|
+
...detailLines.map((line) => `${bodyPrefix}${line}`),
|
|
806
|
+
spacer,
|
|
807
|
+
...hintLines.map((line) => `${bodyPrefix}${line}`),
|
|
808
|
+
footer,
|
|
809
|
+
...errorLines
|
|
810
|
+
].join("\n");
|
|
811
|
+
}
|
|
812
|
+
function renderCapabilityOption(option, active, selectedCapabilities) {
|
|
813
|
+
const selected = selectedCapabilities.includes(option.value);
|
|
814
|
+
if (option.disabled) {
|
|
815
|
+
return `${styleText("gray", q)} ${styleText(
|
|
816
|
+
["strikethrough", "gray"],
|
|
817
|
+
option.label
|
|
818
|
+
)}`;
|
|
819
|
+
}
|
|
820
|
+
if (selected && active) {
|
|
821
|
+
return `${styleText("green", U)} ${option.label}`;
|
|
822
|
+
}
|
|
823
|
+
if (selected) {
|
|
824
|
+
return `${styleText("green", U)} ${styleText("dim", option.label)}`;
|
|
825
|
+
}
|
|
826
|
+
if (active) {
|
|
827
|
+
return `${styleText("cyan", te)} ${option.label}`;
|
|
828
|
+
}
|
|
829
|
+
return `${styleText("dim", q)} ${styleText("dim", option.label)}`;
|
|
830
|
+
}
|
|
831
|
+
function renderDetailBox(title, lines, columns) {
|
|
832
|
+
const maxWidth = Math.max(46, Math.min(columns - 8, 88));
|
|
833
|
+
const contentWidth = Math.max(24, maxWidth - 4);
|
|
834
|
+
const boxLines = [
|
|
835
|
+
`${unicodeFrame("\u256D", "+")} ${title} ${unicodeFrame("\u2500", "-").repeat(
|
|
836
|
+
Math.max(1, contentWidth - title.length)
|
|
837
|
+
)}${unicodeFrame("\u256E", "+")}`
|
|
838
|
+
];
|
|
839
|
+
for (const line of lines) {
|
|
840
|
+
for (const wrappedLine of wrapPlainText(line, contentWidth)) {
|
|
841
|
+
boxLines.push(
|
|
842
|
+
`${unicodeFrame("\u2502", "|")} ${wrappedLine.padEnd(contentWidth)} ${unicodeFrame("\u2502", "|")}`
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
boxLines.push(
|
|
847
|
+
`${unicodeFrame("\u2570", "+")}${unicodeFrame("\u2500", "-").repeat(contentWidth + 2)}${unicodeFrame(
|
|
848
|
+
"\u256F",
|
|
849
|
+
"+"
|
|
850
|
+
)}`
|
|
851
|
+
);
|
|
852
|
+
return boxLines.map((line) => styleText("dim", line));
|
|
853
|
+
}
|
|
854
|
+
function wrapPlainText(text, width) {
|
|
855
|
+
const words = text.split(/\s+/).filter((word) => word.length > 0);
|
|
856
|
+
if (words.length === 0) {
|
|
857
|
+
return [""];
|
|
858
|
+
}
|
|
859
|
+
const lines = [];
|
|
860
|
+
let current = "";
|
|
861
|
+
for (const word of words) {
|
|
862
|
+
const candidate = current.length === 0 ? word : `${current} ${word}`;
|
|
863
|
+
if (candidate.length <= width) {
|
|
864
|
+
current = candidate;
|
|
865
|
+
continue;
|
|
866
|
+
}
|
|
867
|
+
if (current.length > 0) {
|
|
868
|
+
lines.push(current);
|
|
869
|
+
}
|
|
870
|
+
if (word.length <= width) {
|
|
871
|
+
current = word;
|
|
872
|
+
continue;
|
|
873
|
+
}
|
|
874
|
+
let remaining = word;
|
|
875
|
+
while (remaining.length > width) {
|
|
876
|
+
lines.push(remaining.slice(0, width - 1) + "\u2026");
|
|
877
|
+
remaining = remaining.slice(width - 1);
|
|
878
|
+
}
|
|
879
|
+
current = remaining;
|
|
880
|
+
}
|
|
881
|
+
if (current.length > 0) {
|
|
882
|
+
lines.push(current);
|
|
883
|
+
}
|
|
884
|
+
return lines;
|
|
885
|
+
}
|
|
886
|
+
function unicodeFrame(primary, fallback) {
|
|
887
|
+
return process.env.TERM === "linux" ? fallback : primary;
|
|
888
|
+
}
|
|
889
|
+
function findNearestEnabledIndex(cursor, options) {
|
|
890
|
+
const enabledIndices = options.map((option, index) => ({ option, index })).filter(({ option }) => !option.disabled).map(({ index }) => index);
|
|
891
|
+
if (enabledIndices.length === 0) {
|
|
892
|
+
return 0;
|
|
893
|
+
}
|
|
894
|
+
if (enabledIndices.includes(cursor)) {
|
|
895
|
+
return cursor;
|
|
896
|
+
}
|
|
897
|
+
return enabledIndices.find((index) => index > cursor) ?? enabledIndices[0];
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// src/cli.ts
|
|
901
|
+
var RENDERED_ACTION_KIND_ORDER = {
|
|
902
|
+
generate: 0,
|
|
903
|
+
update: 1,
|
|
904
|
+
skip: 2,
|
|
905
|
+
remove: 3
|
|
906
|
+
};
|
|
907
|
+
var uninstallCommandLoaderOverride = null;
|
|
908
|
+
var skillsCommandRunnerOverride = null;
|
|
909
|
+
async function runCli(argv = process.argv.slice(2)) {
|
|
910
|
+
const parsed = parseArgs(argv);
|
|
911
|
+
if (parsed.help) {
|
|
912
|
+
printHelp(parsed.command);
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
const targetDir = path.resolve(parsed.targetDir ?? process.cwd());
|
|
916
|
+
if (parsed.command === "backup") {
|
|
917
|
+
await runBackupCommand({
|
|
918
|
+
targetDir,
|
|
919
|
+
permissions: parsed.yes ? "allow-all" : "confirm"
|
|
920
|
+
});
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
if (parsed.command === "uninstall") {
|
|
924
|
+
const runUninstallCommand = await loadUninstallCommand();
|
|
925
|
+
await runUninstallCommand({
|
|
926
|
+
targetDir,
|
|
927
|
+
backup: parsed.backup,
|
|
928
|
+
permissions: parsed.yes ? "allow-all" : "confirm"
|
|
929
|
+
});
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
if (parsed.command === "skills") {
|
|
933
|
+
await runSkillsCommand({
|
|
934
|
+
targetDir,
|
|
935
|
+
dryRun: parsed.dryRun,
|
|
936
|
+
yes: parsed.yes,
|
|
937
|
+
remove: parsed.remove,
|
|
938
|
+
noCodex: parsed.noCodex,
|
|
939
|
+
noClaudeCode: parsed.noClaudeCode,
|
|
940
|
+
skillScope: parsed.skillScope,
|
|
941
|
+
selectedSkills: parsed.selectedSkills === void 0 ? void 0 : [...parsed.selectedSkills]
|
|
942
|
+
});
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
const existingManifest = loadManifest(targetDir);
|
|
946
|
+
const installIntent = inferInstallIntent(parsed);
|
|
947
|
+
if (installIntent === "reconfigure" && !existingManifest) {
|
|
948
|
+
throw new Error(
|
|
949
|
+
"No make-docs manifest was found in the target directory. Run `make-docs` first."
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
const interactive = !parsed.yes;
|
|
953
|
+
if (!interactive && installIntent === "reconfigure" && !hasSelectionOverrides(parsed)) {
|
|
954
|
+
throw new Error(
|
|
955
|
+
"`make-docs reconfigure --yes` requires at least one selection flag. Provide selection flags or run `make-docs reconfigure` interactively."
|
|
956
|
+
);
|
|
957
|
+
}
|
|
958
|
+
if (interactive && (!input.isTTY || !output.isTTY)) {
|
|
959
|
+
throw new Error("Interactive prompts require a TTY. Use --yes for non-interactive runs.");
|
|
960
|
+
}
|
|
961
|
+
let selections = resolveSelections({
|
|
962
|
+
parsed,
|
|
963
|
+
existingManifest
|
|
964
|
+
});
|
|
965
|
+
let selectionSource = describeSelectionSource({
|
|
966
|
+
parsed,
|
|
967
|
+
existingManifest,
|
|
968
|
+
installIntent
|
|
969
|
+
});
|
|
970
|
+
let skipApplyConfirm = false;
|
|
971
|
+
if (interactive) {
|
|
972
|
+
if (!existingManifest && installIntent === "apply") {
|
|
973
|
+
const wizardSelections = await runSelectionWizard({
|
|
974
|
+
initialSelections: selections,
|
|
975
|
+
introTitle: "Let's configure your make-docs install"
|
|
976
|
+
});
|
|
977
|
+
if (!wizardSelections) {
|
|
978
|
+
output.write("Installer cancelled.\n");
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
selections = wizardSelections;
|
|
982
|
+
selectionSource = "interactive wizard selections";
|
|
983
|
+
skipApplyConfirm = true;
|
|
984
|
+
} else if (installIntent === "reconfigure") {
|
|
985
|
+
const wizardSelections = await runSelectionWizard({
|
|
986
|
+
initialSelections: selections,
|
|
987
|
+
introTitle: "Let's reconfigure your make-docs install"
|
|
988
|
+
});
|
|
989
|
+
if (!wizardSelections) {
|
|
990
|
+
output.write("Installer cancelled.\n");
|
|
991
|
+
return;
|
|
992
|
+
}
|
|
993
|
+
selections = wizardSelections;
|
|
994
|
+
selectionSource = "interactive reconfigure wizard";
|
|
995
|
+
skipApplyConfirm = true;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
const packageMeta = readPackageMeta();
|
|
999
|
+
let plan = await planInstall({
|
|
1000
|
+
targetDir,
|
|
1001
|
+
selections,
|
|
1002
|
+
existingManifest,
|
|
1003
|
+
packageMeta
|
|
1004
|
+
});
|
|
1005
|
+
if (interactive) {
|
|
1006
|
+
const managedFileConflicts = findReviewableManagedFileConflicts(plan);
|
|
1007
|
+
if (managedFileConflicts.length > 0) {
|
|
1008
|
+
const managedFileConflictResolutions = await promptForManagedFileConflictResolutions(managedFileConflicts);
|
|
1009
|
+
if (!managedFileConflictResolutions) {
|
|
1010
|
+
output.write("Installer cancelled.\n");
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
1013
|
+
plan = await planInstall({
|
|
1014
|
+
targetDir,
|
|
1015
|
+
selections,
|
|
1016
|
+
existingManifest,
|
|
1017
|
+
packageMeta,
|
|
1018
|
+
managedFileConflictResolutions
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
if (!hasEffectiveCapabilities(plan.profile)) {
|
|
1023
|
+
throw new Error("At least one capability must remain enabled.");
|
|
1024
|
+
}
|
|
1025
|
+
const hasPlannedChanges = plan.actions.some((action) => action.type !== "noop");
|
|
1026
|
+
printPlan({
|
|
1027
|
+
actions: plan.actions,
|
|
1028
|
+
dryRun: parsed.dryRun,
|
|
1029
|
+
existingManifest,
|
|
1030
|
+
installIntent,
|
|
1031
|
+
packageName: plan.packageName,
|
|
1032
|
+
packageVersion: plan.packageVersion,
|
|
1033
|
+
selectionSource,
|
|
1034
|
+
targetDir
|
|
1035
|
+
});
|
|
1036
|
+
if (parsed.dryRun) {
|
|
1037
|
+
output.write("\nDry run complete.\n");
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
const unresolvedManagedFileConflicts = findReviewableManagedFileConflicts(plan);
|
|
1041
|
+
if (!interactive && unresolvedManagedFileConflicts.length > 0) {
|
|
1042
|
+
throw new Error(
|
|
1043
|
+
[
|
|
1044
|
+
"Non-interactive make-docs runs cannot apply unresolved managed-file diffs.",
|
|
1045
|
+
"Run `make-docs` without `--yes` to review the conflicts interactively.",
|
|
1046
|
+
"Conflicting managed files:",
|
|
1047
|
+
...unresolvedManagedFileConflicts.map(
|
|
1048
|
+
(conflict) => `- ${conflict.relativePath}`
|
|
1049
|
+
)
|
|
1050
|
+
].join("\n")
|
|
1051
|
+
);
|
|
1052
|
+
}
|
|
1053
|
+
if (interactive && !skipApplyConfirm && hasPlannedChanges) {
|
|
1054
|
+
const proceed = await Rt({
|
|
1055
|
+
message: getApplyConfirmationMessage({
|
|
1056
|
+
existingManifest,
|
|
1057
|
+
installIntent
|
|
1058
|
+
}),
|
|
1059
|
+
initialValue: true,
|
|
1060
|
+
active: "Yes",
|
|
1061
|
+
inactive: "No",
|
|
1062
|
+
withGuide: true
|
|
1063
|
+
});
|
|
1064
|
+
if (Ct(proceed) || !proceed) {
|
|
1065
|
+
output.write("Installer cancelled.\n");
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
const applied = applyInstallPlan({
|
|
1070
|
+
targetDir,
|
|
1071
|
+
plan,
|
|
1072
|
+
existingManifest
|
|
1073
|
+
});
|
|
1074
|
+
if (hasPlannedChanges) {
|
|
1075
|
+
writeApplyCompletionSummary({
|
|
1076
|
+
existingManifest,
|
|
1077
|
+
installIntent,
|
|
1078
|
+
manifest: applied.manifest,
|
|
1079
|
+
targetDir
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
if (applied.conflictFiles.length > 0) {
|
|
1083
|
+
output.write("Conflicts were staged for manual review:\n");
|
|
1084
|
+
for (const conflictFile of applied.conflictFiles) {
|
|
1085
|
+
output.write(`- ${conflictFile}
|
|
1086
|
+
`);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
function inferInstallIntent(parsed) {
|
|
1091
|
+
return parsed.command === "reconfigure" ? "reconfigure" : "apply";
|
|
1092
|
+
}
|
|
1093
|
+
function describeSelectionSource(options) {
|
|
1094
|
+
const { parsed, existingManifest, installIntent } = options;
|
|
1095
|
+
if (installIntent === "reconfigure") {
|
|
1096
|
+
return hasSelectionOverrides(parsed) ? "saved manifest selections plus reconfigure flags" : "saved manifest selections";
|
|
1097
|
+
}
|
|
1098
|
+
if (existingManifest) {
|
|
1099
|
+
return hasSelectionOverrides(parsed) ? "saved manifest selections plus command-line flags" : "saved manifest selections";
|
|
1100
|
+
}
|
|
1101
|
+
return hasSelectionOverrides(parsed) ? "default selections plus command-line flags" : "default selections";
|
|
1102
|
+
}
|
|
1103
|
+
function resolveSelections(options) {
|
|
1104
|
+
const { parsed, existingManifest } = options;
|
|
1105
|
+
const baseSelections = existingManifest ? existingManifest.selections : defaultSelections();
|
|
1106
|
+
const selections = cloneSelections(baseSelections);
|
|
1107
|
+
if (parsed.noDesigns) {
|
|
1108
|
+
selections.capabilities.designs = false;
|
|
1109
|
+
}
|
|
1110
|
+
if (parsed.noPlans) {
|
|
1111
|
+
selections.capabilities.plans = false;
|
|
1112
|
+
}
|
|
1113
|
+
if (parsed.noPrd) {
|
|
1114
|
+
selections.capabilities.prd = false;
|
|
1115
|
+
}
|
|
1116
|
+
if (parsed.noWork) {
|
|
1117
|
+
selections.capabilities.work = false;
|
|
1118
|
+
}
|
|
1119
|
+
if (parsed.noCodex) {
|
|
1120
|
+
selections.harnesses.codex = false;
|
|
1121
|
+
}
|
|
1122
|
+
if (parsed.noClaudeCode) {
|
|
1123
|
+
selections.harnesses["claude-code"] = false;
|
|
1124
|
+
}
|
|
1125
|
+
if (parsed.noSkills) {
|
|
1126
|
+
selections.skills = false;
|
|
1127
|
+
selections.selectedSkills = [];
|
|
1128
|
+
} else {
|
|
1129
|
+
if (parsed.skillScope || parsed.selectedSkills !== void 0) {
|
|
1130
|
+
selections.skills = true;
|
|
1131
|
+
}
|
|
1132
|
+
if (parsed.skillScope) {
|
|
1133
|
+
selections.skillScope = parsed.skillScope;
|
|
1134
|
+
}
|
|
1135
|
+
if (parsed.selectedSkills !== void 0) {
|
|
1136
|
+
selections.selectedSkills = [...parsed.selectedSkills];
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
return selections;
|
|
1140
|
+
}
|
|
1141
|
+
function hasSelectionOverrides(parsed) {
|
|
1142
|
+
return Boolean(
|
|
1143
|
+
parsed.noDesigns || parsed.noPlans || parsed.noPrd || parsed.noWork || parsed.noCodex || parsed.noClaudeCode || parsed.noSkills || parsed.skillScope || parsed.selectedSkills !== void 0
|
|
1144
|
+
);
|
|
1145
|
+
}
|
|
1146
|
+
function isLifecycleCommand(command) {
|
|
1147
|
+
return command === "backup" || command === "uninstall";
|
|
1148
|
+
}
|
|
1149
|
+
async function loadUninstallCommand() {
|
|
1150
|
+
if (uninstallCommandLoaderOverride) {
|
|
1151
|
+
return uninstallCommandLoaderOverride();
|
|
1152
|
+
}
|
|
1153
|
+
const uninstallModule = await import("./uninstall-GQE4SJF2.js");
|
|
1154
|
+
if (typeof uninstallModule.runUninstallCommand !== "function") {
|
|
1155
|
+
throw new Error(
|
|
1156
|
+
"The `uninstall` command module must export `runUninstallCommand(options)`."
|
|
1157
|
+
);
|
|
1158
|
+
}
|
|
1159
|
+
return uninstallModule.runUninstallCommand;
|
|
1160
|
+
}
|
|
1161
|
+
async function runSkillsCommand(options) {
|
|
1162
|
+
if (skillsCommandRunnerOverride) {
|
|
1163
|
+
await skillsCommandRunnerOverride(options);
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
const skillsModule = await import("./skills-command-3ESCZ75U.js");
|
|
1167
|
+
await skillsModule.runSkillsCommand(options);
|
|
1168
|
+
}
|
|
1169
|
+
function getSelectionOverrideFlags(parsed) {
|
|
1170
|
+
const flags = [];
|
|
1171
|
+
if (parsed.noDesigns) {
|
|
1172
|
+
flags.push("--no-designs");
|
|
1173
|
+
}
|
|
1174
|
+
if (parsed.noPlans) {
|
|
1175
|
+
flags.push("--no-plans");
|
|
1176
|
+
}
|
|
1177
|
+
if (parsed.noPrd) {
|
|
1178
|
+
flags.push("--no-prd");
|
|
1179
|
+
}
|
|
1180
|
+
if (parsed.noWork) {
|
|
1181
|
+
flags.push("--no-work");
|
|
1182
|
+
}
|
|
1183
|
+
if (parsed.noCodex) {
|
|
1184
|
+
flags.push("--no-codex");
|
|
1185
|
+
}
|
|
1186
|
+
if (parsed.noClaudeCode) {
|
|
1187
|
+
flags.push("--no-claude-code");
|
|
1188
|
+
}
|
|
1189
|
+
if (parsed.noSkills) {
|
|
1190
|
+
flags.push("--no-skills");
|
|
1191
|
+
}
|
|
1192
|
+
if (parsed.skillScope) {
|
|
1193
|
+
flags.push("--skill-scope");
|
|
1194
|
+
}
|
|
1195
|
+
if (parsed.selectedSkills !== void 0) {
|
|
1196
|
+
flags.push("--selected-skills");
|
|
1197
|
+
}
|
|
1198
|
+
return flags;
|
|
1199
|
+
}
|
|
1200
|
+
function parseArgs(argv) {
|
|
1201
|
+
const parsed = {
|
|
1202
|
+
dryRun: false,
|
|
1203
|
+
yes: false,
|
|
1204
|
+
help: false,
|
|
1205
|
+
backup: false,
|
|
1206
|
+
remove: false,
|
|
1207
|
+
noDesigns: false,
|
|
1208
|
+
noPlans: false,
|
|
1209
|
+
noPrd: false,
|
|
1210
|
+
noWork: false,
|
|
1211
|
+
noCodex: false,
|
|
1212
|
+
noClaudeCode: false,
|
|
1213
|
+
noSkills: false
|
|
1214
|
+
};
|
|
1215
|
+
const args = [...argv];
|
|
1216
|
+
rejectRemovedUpdateReconfigure(args);
|
|
1217
|
+
rejectRemovedReconfigureFlag(args);
|
|
1218
|
+
rejectRemovedCommand(args);
|
|
1219
|
+
if (args[0] === "reconfigure" || args[0] === "skills" || args[0] === "backup" || args[0] === "uninstall") {
|
|
1220
|
+
parsed.command = args.shift();
|
|
1221
|
+
}
|
|
1222
|
+
while (args.length > 0) {
|
|
1223
|
+
const arg = args.shift();
|
|
1224
|
+
switch (arg) {
|
|
1225
|
+
case "--target":
|
|
1226
|
+
parsed.targetDir = args.shift();
|
|
1227
|
+
break;
|
|
1228
|
+
case "--dry-run":
|
|
1229
|
+
parsed.dryRun = true;
|
|
1230
|
+
break;
|
|
1231
|
+
case "--yes":
|
|
1232
|
+
parsed.yes = true;
|
|
1233
|
+
break;
|
|
1234
|
+
case "--help":
|
|
1235
|
+
case "-h":
|
|
1236
|
+
parsed.help = true;
|
|
1237
|
+
break;
|
|
1238
|
+
case "--backup":
|
|
1239
|
+
parsed.backup = true;
|
|
1240
|
+
break;
|
|
1241
|
+
case "--remove":
|
|
1242
|
+
parsed.remove = true;
|
|
1243
|
+
break;
|
|
1244
|
+
case "--no-designs":
|
|
1245
|
+
parsed.noDesigns = true;
|
|
1246
|
+
break;
|
|
1247
|
+
case "--no-plans":
|
|
1248
|
+
parsed.noPlans = true;
|
|
1249
|
+
break;
|
|
1250
|
+
case "--no-prd":
|
|
1251
|
+
parsed.noPrd = true;
|
|
1252
|
+
break;
|
|
1253
|
+
case "--no-work":
|
|
1254
|
+
parsed.noWork = true;
|
|
1255
|
+
break;
|
|
1256
|
+
case "--no-codex":
|
|
1257
|
+
case "--no-agents":
|
|
1258
|
+
parsed.noCodex = true;
|
|
1259
|
+
break;
|
|
1260
|
+
case "--no-claude-code":
|
|
1261
|
+
case "--no-claude":
|
|
1262
|
+
parsed.noClaudeCode = true;
|
|
1263
|
+
break;
|
|
1264
|
+
case "--no-skills":
|
|
1265
|
+
parsed.noSkills = true;
|
|
1266
|
+
break;
|
|
1267
|
+
case "--skill-scope": {
|
|
1268
|
+
const value = args.shift();
|
|
1269
|
+
if (value !== "project" && value !== "global") {
|
|
1270
|
+
throw new Error("`--skill-scope` must be either `project` or `global`.");
|
|
1271
|
+
}
|
|
1272
|
+
parsed.skillScope = value;
|
|
1273
|
+
break;
|
|
1274
|
+
}
|
|
1275
|
+
case "--selected-skills": {
|
|
1276
|
+
const value = args.shift();
|
|
1277
|
+
if (!value) {
|
|
1278
|
+
throw new Error("`--selected-skills` requires a comma-separated value, `all`, or `none`.");
|
|
1279
|
+
}
|
|
1280
|
+
parsed.selectedSkills = parseSelectedSkillsValue(value);
|
|
1281
|
+
if (value !== "none" && value !== "all" && parsed.selectedSkills.length === 0) {
|
|
1282
|
+
throw new Error("`--selected-skills` requires at least one skill id, `all`, or `none`.");
|
|
1283
|
+
}
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1286
|
+
default:
|
|
1287
|
+
throw new Error(`Unknown argument: ${arg}`);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
validateParsedArgs(parsed);
|
|
1291
|
+
return parsed;
|
|
1292
|
+
}
|
|
1293
|
+
function parseSelectedSkillsValue(value) {
|
|
1294
|
+
if (value === "none") {
|
|
1295
|
+
return [];
|
|
1296
|
+
}
|
|
1297
|
+
if (value === "all") {
|
|
1298
|
+
return getSkillRegistryNames(loadSkillRegistry(PACKAGE_ROOT));
|
|
1299
|
+
}
|
|
1300
|
+
return Array.from(
|
|
1301
|
+
new Set(
|
|
1302
|
+
value.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0)
|
|
1303
|
+
)
|
|
1304
|
+
).sort();
|
|
1305
|
+
}
|
|
1306
|
+
function rejectRemovedUpdateReconfigure(args) {
|
|
1307
|
+
if (args[0] !== "update" || !args.includes("--reconfigure")) {
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
throw new Error(
|
|
1311
|
+
"The `update --reconfigure` command was removed. Use `make-docs reconfigure` instead."
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1314
|
+
function rejectRemovedCommand(args) {
|
|
1315
|
+
const command = args[0];
|
|
1316
|
+
if (command !== "init" && command !== "update") {
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
const suggestedArgs = args.slice(1).join(" ");
|
|
1320
|
+
const suggestedCommand = suggestedArgs ? `make-docs ${suggestedArgs}` : "make-docs";
|
|
1321
|
+
throw new Error(
|
|
1322
|
+
`The \`${command}\` command was removed. Use \`${suggestedCommand}\` instead.`
|
|
1323
|
+
);
|
|
1324
|
+
}
|
|
1325
|
+
function rejectRemovedReconfigureFlag(args) {
|
|
1326
|
+
if (!args.includes("--reconfigure")) {
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1329
|
+
throw new Error(
|
|
1330
|
+
"`--reconfigure` was removed. Use `make-docs reconfigure` instead."
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
function getInvalidSkillsCommandFlags(parsed) {
|
|
1334
|
+
const flags = [];
|
|
1335
|
+
if (parsed.noDesigns) {
|
|
1336
|
+
flags.push("--no-designs");
|
|
1337
|
+
}
|
|
1338
|
+
if (parsed.noPlans) {
|
|
1339
|
+
flags.push("--no-plans");
|
|
1340
|
+
}
|
|
1341
|
+
if (parsed.noPrd) {
|
|
1342
|
+
flags.push("--no-prd");
|
|
1343
|
+
}
|
|
1344
|
+
if (parsed.noWork) {
|
|
1345
|
+
flags.push("--no-work");
|
|
1346
|
+
}
|
|
1347
|
+
if (parsed.noSkills) {
|
|
1348
|
+
flags.push("--no-skills");
|
|
1349
|
+
}
|
|
1350
|
+
return flags;
|
|
1351
|
+
}
|
|
1352
|
+
function validateParsedArgs(parsed) {
|
|
1353
|
+
if (parsed.backup && parsed.command !== "uninstall") {
|
|
1354
|
+
throw new Error(
|
|
1355
|
+
`\`--backup\` is only valid with \`uninstall\`, not \`${parsed.command ?? "no command"}\`.`
|
|
1356
|
+
);
|
|
1357
|
+
}
|
|
1358
|
+
if (parsed.remove && parsed.command !== "skills") {
|
|
1359
|
+
throw new Error(
|
|
1360
|
+
`\`--remove\` is only valid with \`make-docs skills\`, not \`${parsed.command ?? "no command"}\`.`
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
if (parsed.command === "skills") {
|
|
1364
|
+
const invalidSkillsFlags = getInvalidSkillsCommandFlags(parsed);
|
|
1365
|
+
if (invalidSkillsFlags.length > 0) {
|
|
1366
|
+
const label = invalidSkillsFlags.length === 1 ? "flag" : "flags";
|
|
1367
|
+
const verb = invalidSkillsFlags.length === 1 ? "is" : "are";
|
|
1368
|
+
throw new Error(
|
|
1369
|
+
`Selection ${label} ${invalidSkillsFlags.join(", ")} ${verb} not valid with \`make-docs skills\`. Use skills command options such as \`--remove\`, \`--skill-scope\`, or \`--selected-skills\`.`
|
|
1370
|
+
);
|
|
1371
|
+
}
|
|
1372
|
+
if (parsed.remove && parsed.selectedSkills !== void 0) {
|
|
1373
|
+
throw new Error(
|
|
1374
|
+
"`--selected-skills` cannot be combined with `make-docs skills --remove`."
|
|
1375
|
+
);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
const selectionOverrideFlags = getSelectionOverrideFlags(parsed);
|
|
1379
|
+
if (isLifecycleCommand(parsed.command) && selectionOverrideFlags.length > 0) {
|
|
1380
|
+
const label = selectionOverrideFlags.length === 1 ? "flag" : "flags";
|
|
1381
|
+
const verb = selectionOverrideFlags.length === 1 ? "is" : "are";
|
|
1382
|
+
throw new Error(
|
|
1383
|
+
`Selection ${label} ${selectionOverrideFlags.join(", ")} ${verb} only valid with \`make-docs\` or \`make-docs reconfigure\`, not \`${parsed.command}\`.`
|
|
1384
|
+
);
|
|
1385
|
+
}
|
|
1386
|
+
if (parsed.noSkills && (parsed.skillScope || parsed.selectedSkills !== void 0)) {
|
|
1387
|
+
throw new Error(
|
|
1388
|
+
"`--no-skills` cannot be combined with `--skill-scope` or `--selected-skills`."
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
if (parsed.selectedSkills === void 0) {
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
const registry = loadSkillRegistry(PACKAGE_ROOT);
|
|
1395
|
+
const registrySkills = new Set(getSkillRegistryNames(registry));
|
|
1396
|
+
for (const skillName of parsed.selectedSkills) {
|
|
1397
|
+
if (!registrySkills.has(skillName)) {
|
|
1398
|
+
const validList = Array.from(registrySkills).sort().join(", ");
|
|
1399
|
+
throw new Error(
|
|
1400
|
+
`Unknown selected skill \`${skillName}\`. Valid skills: ${validList || "(none)"}.`
|
|
1401
|
+
);
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
function printPlan(options) {
|
|
1406
|
+
const {
|
|
1407
|
+
actions,
|
|
1408
|
+
dryRun,
|
|
1409
|
+
existingManifest,
|
|
1410
|
+
installIntent,
|
|
1411
|
+
packageName,
|
|
1412
|
+
packageVersion,
|
|
1413
|
+
selectionSource,
|
|
1414
|
+
targetDir
|
|
1415
|
+
} = options;
|
|
1416
|
+
const nonNoop = actions.filter((action) => action.type !== "noop");
|
|
1417
|
+
const renderedActions = getRenderedActions(actions);
|
|
1418
|
+
const noopCount = actions.length - nonNoop.length;
|
|
1419
|
+
const counts = countActions(actions);
|
|
1420
|
+
const manifestPath = path.join(targetDir, MANIFEST_RELATIVE_PATH);
|
|
1421
|
+
const mode = describeApplyMode({ existingManifest, installIntent });
|
|
1422
|
+
Vt(
|
|
1423
|
+
[
|
|
1424
|
+
`Target: ${targetDir}`,
|
|
1425
|
+
`Mode: ${mode}`,
|
|
1426
|
+
existingManifest ? `Manifest: ${manifestPath} (found)` : `Manifest: ${manifestPath} (will be created)`,
|
|
1427
|
+
existingManifest ? `Installed version: ${existingManifest.packageVersion}` : "Installed version: none detected",
|
|
1428
|
+
`Package version: ${packageName} ${packageVersion}`,
|
|
1429
|
+
`Selection source: ${selectionSource}`,
|
|
1430
|
+
`Managed files evaluated: ${actions.length}`,
|
|
1431
|
+
`Already current: ${noopCount}`,
|
|
1432
|
+
`Changes planned: ${nonNoop.length}`,
|
|
1433
|
+
`Generate: ${counts.create + counts.generate}`,
|
|
1434
|
+
`Update: ${counts.update + counts["update-conflict"]}`,
|
|
1435
|
+
`Skip: ${counts.skip + counts["skip-conflict"]}`,
|
|
1436
|
+
`Remove: ${counts["remove-managed"]}`
|
|
1437
|
+
].join("\n"),
|
|
1438
|
+
"Information"
|
|
1439
|
+
);
|
|
1440
|
+
if (nonNoop.length === 0) {
|
|
1441
|
+
renderNoopExplanation({ dryRun, existingManifest });
|
|
1442
|
+
return;
|
|
1443
|
+
}
|
|
1444
|
+
Vt(renderedActions.map(formatActionLine).join("\n"), "Planned file operations");
|
|
1445
|
+
}
|
|
1446
|
+
function countActions(actions) {
|
|
1447
|
+
return {
|
|
1448
|
+
create: actions.filter((action) => action.type === "create").length,
|
|
1449
|
+
generate: actions.filter((action) => action.type === "generate").length,
|
|
1450
|
+
noop: actions.filter((action) => action.type === "noop").length,
|
|
1451
|
+
"remove-managed": actions.filter((action) => action.type === "remove-managed").length,
|
|
1452
|
+
skip: actions.filter((action) => action.type === "skip").length,
|
|
1453
|
+
"skip-conflict": actions.filter((action) => action.type === "skip-conflict").length,
|
|
1454
|
+
update: actions.filter((action) => action.type === "update").length,
|
|
1455
|
+
"update-conflict": actions.filter((action) => action.type === "update-conflict").length
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
function describeApplyMode(options) {
|
|
1459
|
+
if (options.installIntent === "reconfigure") {
|
|
1460
|
+
return "existing install reconfigure";
|
|
1461
|
+
}
|
|
1462
|
+
return options.existingManifest ? "existing install sync" : "first install";
|
|
1463
|
+
}
|
|
1464
|
+
function renderNoopExplanation(options) {
|
|
1465
|
+
const noChangeText = options.dryRun ? "No managed file changes would be made." : "No managed file changes are needed.";
|
|
1466
|
+
const lines = [noChangeText];
|
|
1467
|
+
if (options.existingManifest) {
|
|
1468
|
+
lines.push(
|
|
1469
|
+
"Every managed file already matched the desired content.",
|
|
1470
|
+
""
|
|
1471
|
+
);
|
|
1472
|
+
} else {
|
|
1473
|
+
lines.push(
|
|
1474
|
+
"make-docs did not find an existing manifest, so this run used first-install mode.",
|
|
1475
|
+
"The selected files already matched make-docs content.",
|
|
1476
|
+
"Applying will create the manifest that tracks future syncs.",
|
|
1477
|
+
""
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
lines.push(
|
|
1481
|
+
"Useful next steps:",
|
|
1482
|
+
"- Run `make-docs reconfigure` to change which docs, harnesses, or skills are managed.",
|
|
1483
|
+
"- Run `make-docs --dry-run` after upgrading make-docs to preview future changes."
|
|
1484
|
+
);
|
|
1485
|
+
Vt(lines.join("\n"), "Results");
|
|
1486
|
+
}
|
|
1487
|
+
function getRenderedActions(actions) {
|
|
1488
|
+
return actions.filter((action) => getRenderedActionKind(action) !== null).sort(compareRenderedActions);
|
|
1489
|
+
}
|
|
1490
|
+
function formatActionLine(action) {
|
|
1491
|
+
const kind = getRenderedActionKind(action);
|
|
1492
|
+
if (!kind) {
|
|
1493
|
+
throw new Error(`Cannot render no-op action for ${action.relativePath}.`);
|
|
1494
|
+
}
|
|
1495
|
+
return `- ${kind}: ${action.relativePath}`;
|
|
1496
|
+
}
|
|
1497
|
+
function compareRenderedActions(left, right) {
|
|
1498
|
+
const leftKind = getRenderedActionKind(left);
|
|
1499
|
+
const rightKind = getRenderedActionKind(right);
|
|
1500
|
+
if (leftKind && rightKind && leftKind !== rightKind) {
|
|
1501
|
+
return RENDERED_ACTION_KIND_ORDER[leftKind] - RENDERED_ACTION_KIND_ORDER[rightKind];
|
|
1502
|
+
}
|
|
1503
|
+
return comparePosixTreePath(left.relativePath, right.relativePath);
|
|
1504
|
+
}
|
|
1505
|
+
function getRenderedActionKind(action) {
|
|
1506
|
+
switch (action.type) {
|
|
1507
|
+
case "create":
|
|
1508
|
+
case "generate":
|
|
1509
|
+
return "generate";
|
|
1510
|
+
case "update":
|
|
1511
|
+
case "update-conflict":
|
|
1512
|
+
return "update";
|
|
1513
|
+
case "skip":
|
|
1514
|
+
case "skip-conflict":
|
|
1515
|
+
return "skip";
|
|
1516
|
+
case "remove-managed":
|
|
1517
|
+
return "remove";
|
|
1518
|
+
case "noop":
|
|
1519
|
+
return null;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
function comparePosixTreePath(left, right) {
|
|
1523
|
+
if (left === right) {
|
|
1524
|
+
return 0;
|
|
1525
|
+
}
|
|
1526
|
+
return left < right ? -1 : 1;
|
|
1527
|
+
}
|
|
1528
|
+
function getApplyConfirmationMessage(options) {
|
|
1529
|
+
if (options.installIntent === "reconfigure") {
|
|
1530
|
+
return "Apply this reconfiguration?";
|
|
1531
|
+
}
|
|
1532
|
+
return options.existingManifest ? "Apply this make-docs sync?" : "Install make-docs with this plan?";
|
|
1533
|
+
}
|
|
1534
|
+
function writeApplyCompletionSummary(options) {
|
|
1535
|
+
if (options.installIntent === "reconfigure") {
|
|
1536
|
+
output.write(
|
|
1537
|
+
`
|
|
1538
|
+
Reconfigured make-docs ${options.manifest.packageVersion} in ${options.targetDir}.
|
|
1539
|
+
`
|
|
1540
|
+
);
|
|
1541
|
+
return;
|
|
1542
|
+
}
|
|
1543
|
+
if (options.existingManifest) {
|
|
1544
|
+
output.write(
|
|
1545
|
+
`
|
|
1546
|
+
Synced make-docs ${options.manifest.packageVersion} in ${options.targetDir}.
|
|
1547
|
+
`
|
|
1548
|
+
);
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
output.write(
|
|
1552
|
+
`
|
|
1553
|
+
Installed make-docs ${options.manifest.packageVersion} into ${options.targetDir}.
|
|
1554
|
+
`
|
|
1555
|
+
);
|
|
1556
|
+
}
|
|
1557
|
+
function printHelp(command) {
|
|
1558
|
+
switch (command) {
|
|
1559
|
+
case "reconfigure":
|
|
1560
|
+
output.write(`make-docs reconfigure
|
|
1561
|
+
|
|
1562
|
+
Change the configured make-docs footprint for an existing install.
|
|
1563
|
+
Requires an existing ${MANIFEST_RELATIVE_PATH} in the target directory.
|
|
1564
|
+
|
|
1565
|
+
Interactive runs open the selection wizard using the saved manifest selections.
|
|
1566
|
+
Non-interactive runs with --yes must include at least one selection flag.
|
|
1567
|
+
|
|
1568
|
+
Usage:
|
|
1569
|
+
make-docs reconfigure [options]
|
|
1570
|
+
|
|
1571
|
+
Options:
|
|
1572
|
+
|
|
1573
|
+
General options:
|
|
1574
|
+
--target <dir> Reconfigure a different make-docs install directory.
|
|
1575
|
+
--dry-run Show planned changes without writing files.
|
|
1576
|
+
--yes Skip interactive prompts; requires a selection flag.
|
|
1577
|
+
--help, -h Show help for this command.
|
|
1578
|
+
|
|
1579
|
+
Content options:
|
|
1580
|
+
--no-designs Skip docs/designs scaffolding.
|
|
1581
|
+
--no-plans Skip docs/plans scaffolding.
|
|
1582
|
+
--no-prd Skip docs/prd scaffolding.
|
|
1583
|
+
--no-work Skip docs/work scaffolding.
|
|
1584
|
+
|
|
1585
|
+
Harness options:
|
|
1586
|
+
--no-codex Skip the Codex harness.
|
|
1587
|
+
--no-claude-code Skip the Claude Code harness.
|
|
1588
|
+
Deprecated aliases: --no-agents, --no-claude
|
|
1589
|
+
|
|
1590
|
+
Skill options:
|
|
1591
|
+
--no-skills Skip skill installation entirely.
|
|
1592
|
+
--skill-scope project|global Choose whether skills install in the repo or the global Codex home.
|
|
1593
|
+
--selected-skills <csv|all|none>
|
|
1594
|
+
Replace the selected skill set.
|
|
1595
|
+
|
|
1596
|
+
Examples:
|
|
1597
|
+
make-docs reconfigure
|
|
1598
|
+
make-docs reconfigure --target ~/Projects/example --dry-run
|
|
1599
|
+
make-docs reconfigure --yes --no-work
|
|
1600
|
+
make-docs reconfigure --yes --no-codex --skill-scope global --selected-skills decompose-codebase
|
|
1601
|
+
`);
|
|
1602
|
+
return;
|
|
1603
|
+
case "skills":
|
|
1604
|
+
output.write(`make-docs skills
|
|
1605
|
+
|
|
1606
|
+
Sync or remove managed make-docs skills without changing the docs scaffold.
|
|
1607
|
+
|
|
1608
|
+
Usage:
|
|
1609
|
+
make-docs skills [options]
|
|
1610
|
+
|
|
1611
|
+
General options:
|
|
1612
|
+
--target <dir> Sync skills for a different make-docs install directory.
|
|
1613
|
+
--dry-run Show planned skill changes without writing files.
|
|
1614
|
+
--yes Skip interactive prompts.
|
|
1615
|
+
--help, -h Show help for this command.
|
|
1616
|
+
|
|
1617
|
+
Platform options:
|
|
1618
|
+
--no-codex Skip Codex skill files.
|
|
1619
|
+
--no-claude-code Skip Claude Code skill files.
|
|
1620
|
+
Deprecated aliases: --no-agents, --no-claude
|
|
1621
|
+
|
|
1622
|
+
Skill options:
|
|
1623
|
+
--remove Remove managed skills owned by make-docs.
|
|
1624
|
+
--skill-scope project|global Choose whether skills install in the repo or the global Codex home.
|
|
1625
|
+
--selected-skills <csv|all|none>
|
|
1626
|
+
Replace the selected skill set.
|
|
1627
|
+
|
|
1628
|
+
Examples:
|
|
1629
|
+
make-docs skills
|
|
1630
|
+
make-docs skills --dry-run
|
|
1631
|
+
make-docs skills --remove
|
|
1632
|
+
make-docs skills --skill-scope global
|
|
1633
|
+
make-docs skills --selected-skills all
|
|
1634
|
+
`);
|
|
1635
|
+
return;
|
|
1636
|
+
case "backup":
|
|
1637
|
+
output.write(`make-docs backup
|
|
1638
|
+
|
|
1639
|
+
Create a backup of the managed make-docs files in the target directory.
|
|
1640
|
+
This command is non-destructive: source files remain in place.
|
|
1641
|
+
|
|
1642
|
+
Usage:
|
|
1643
|
+
make-docs backup [--target <dir>] [--yes] [--help]
|
|
1644
|
+
|
|
1645
|
+
Options:
|
|
1646
|
+
--target <dir> Back up a different make-docs install directory.
|
|
1647
|
+
--yes Skip confirmation prompts after showing the audit summary.
|
|
1648
|
+
--help, -h Show help for this command.
|
|
1649
|
+
|
|
1650
|
+
Examples:
|
|
1651
|
+
make-docs backup
|
|
1652
|
+
make-docs backup --target ~/Projects/example
|
|
1653
|
+
make-docs backup --yes
|
|
1654
|
+
`);
|
|
1655
|
+
return;
|
|
1656
|
+
case "uninstall":
|
|
1657
|
+
output.write(`make-docs uninstall
|
|
1658
|
+
|
|
1659
|
+
Remove the managed make-docs files from the target directory.
|
|
1660
|
+
This command is destructive: audited managed files are removed after review.
|
|
1661
|
+
|
|
1662
|
+
Usage:
|
|
1663
|
+
make-docs uninstall [--target <dir>] [--backup] [--yes] [--help]
|
|
1664
|
+
|
|
1665
|
+
Options:
|
|
1666
|
+
--target <dir> Uninstall from a different make-docs install directory.
|
|
1667
|
+
--backup Create a backup before removing files.
|
|
1668
|
+
--yes Skip confirmation prompts after showing warnings and the audit summary.
|
|
1669
|
+
--help, -h Show help for this command.
|
|
1670
|
+
|
|
1671
|
+
Examples:
|
|
1672
|
+
make-docs uninstall
|
|
1673
|
+
make-docs uninstall --backup
|
|
1674
|
+
make-docs uninstall --target ~/Projects/example --yes
|
|
1675
|
+
`);
|
|
1676
|
+
return;
|
|
1677
|
+
default:
|
|
1678
|
+
output.write(`make-docs
|
|
1679
|
+
|
|
1680
|
+
Apply, sync, reconfigure, back up, and remove make-docs installs.
|
|
1681
|
+
|
|
1682
|
+
Usage:
|
|
1683
|
+
make-docs [options]
|
|
1684
|
+
make-docs reconfigure [options]
|
|
1685
|
+
make-docs skills [options]
|
|
1686
|
+
make-docs backup [options]
|
|
1687
|
+
make-docs uninstall [options]
|
|
1688
|
+
|
|
1689
|
+
Primary workflow:
|
|
1690
|
+
Run make-docs with no command to install into a new target or sync an existing manifest using saved selections.
|
|
1691
|
+
|
|
1692
|
+
Commands:
|
|
1693
|
+
reconfigure Change saved selections for an existing install.
|
|
1694
|
+
skills Sync or remove managed skills.
|
|
1695
|
+
backup Create a backup of managed files.
|
|
1696
|
+
uninstall Remove managed files, with an optional backup first.
|
|
1697
|
+
|
|
1698
|
+
Examples:
|
|
1699
|
+
make-docs
|
|
1700
|
+
make-docs --yes
|
|
1701
|
+
make-docs --target ~/Projects/example --dry-run
|
|
1702
|
+
make-docs reconfigure
|
|
1703
|
+
make-docs reconfigure --yes --no-skills
|
|
1704
|
+
make-docs skills --dry-run
|
|
1705
|
+
make-docs backup --yes
|
|
1706
|
+
make-docs uninstall --backup
|
|
1707
|
+
|
|
1708
|
+
Use --help or -h with any command for command-specific options and examples.
|
|
1709
|
+
`);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
// src/index.ts
|
|
1714
|
+
runCli().catch((error) => {
|
|
1715
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1716
|
+
process.stderr.write(`${message}
|
|
1717
|
+
`);
|
|
1718
|
+
process.exitCode = 1;
|
|
1719
|
+
});
|
|
1720
|
+
//# sourceMappingURL=index.js.map
|