@brucewaynedecoy/make-docs 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{backup-GCM64IPN.js → backup-2OT4A6LR.js} +5 -5
- package/dist/chunk-3EXHM5L2.js +1225 -0
- package/dist/chunk-3EXHM5L2.js.map +1 -0
- package/dist/{chunk-2HNJCJJE.js → chunk-46MGH32G.js} +6 -4
- package/dist/chunk-46MGH32G.js.map +1 -0
- package/dist/{chunk-O2UZ35PV.js → chunk-CCYP5NU2.js} +20 -20
- package/dist/{chunk-O2UZ35PV.js.map → chunk-CCYP5NU2.js.map} +1 -1
- package/dist/{chunk-C2IBRVUA.js → chunk-CLSOY7NV.js} +153 -6
- package/dist/chunk-CLSOY7NV.js.map +1 -0
- package/dist/{chunk-GPVKIBFC.js → chunk-CMNKQM7L.js} +3 -3
- package/dist/{chunk-U25GFKNZ.js → chunk-HXWD2EUD.js} +20 -15
- package/dist/chunk-HXWD2EUD.js.map +1 -0
- package/dist/{chunk-DNDM7DUQ.js → chunk-I4FADOUK.js} +3 -3
- package/dist/{chunk-DNDM7DUQ.js.map → chunk-I4FADOUK.js.map} +1 -1
- package/dist/{chunk-DFQJENNL.js → chunk-ISSMVKIA.js} +224 -20
- package/dist/chunk-ISSMVKIA.js.map +1 -0
- package/dist/{chunk-IHMZ2OCS.js → chunk-UNR4CYVX.js} +116 -37
- package/dist/chunk-UNR4CYVX.js.map +1 -0
- package/dist/{chunk-57GN6ALR.js → chunk-VMKG3H4B.js} +2 -2
- package/dist/{chunk-4LLSMDWJ.js → chunk-XDSWX4Y4.js} +9085 -2912
- package/dist/chunk-XDSWX4Y4.js.map +1 -0
- package/dist/index.js +308 -176
- package/dist/index.js.map +1 -1
- package/dist/registry-PC5GKAKM.js +50 -0
- package/dist/registry-PC5GKAKM.js.map +1 -0
- package/dist/{self-UHPM4A2U.js → self-WYVXO23B.js} +18 -18
- package/dist/{self-UHPM4A2U.js.map → self-WYVXO23B.js.map} +1 -1
- package/dist/server-BQOG6FTA.js +1113 -0
- package/dist/server-BQOG6FTA.js.map +1 -0
- package/dist/{setup-system-JUHGDZJW.js → setup-system-KN7FTTLT.js} +267 -44
- package/dist/setup-system-KN7FTTLT.js.map +1 -0
- package/dist/{skills-command-W3SE3OFP.js → skills-command-KEW7MOEW.js} +39 -29
- package/dist/skills-command-KEW7MOEW.js.map +1 -0
- package/dist/{uninstall-BGMJ6KCI.js → uninstall-45XF4CHD.js} +10 -10
- package/dist/virtual_make-docs-first-party-skills-ECJESFL2.js +11 -0
- package/dist/virtual_make-docs-first-party-skills-ECJESFL2.js.map +1 -0
- package/package.json +8 -8
- package/skill-registry.json +24 -8
- package/skill-registry.schema.json +2 -1
- package/template/.make-docs/system/contracts/output-contract.md +3 -1
- package/template/.make-docs/system/contracts/system-resource-contract.md +16 -0
- package/template/.make-docs/system/references/prd-change-management.md +14 -2
- package/template/.make-docs/system-resources.catalog.json +415 -0
- package/template/.make-docs/system-resources.schema.json +25 -0
- package/dist/chunk-2HNJCJJE.js.map +0 -1
- package/dist/chunk-4LLSMDWJ.js.map +0 -1
- package/dist/chunk-C2IBRVUA.js.map +0 -1
- package/dist/chunk-DFQJENNL.js.map +0 -1
- package/dist/chunk-IHMZ2OCS.js.map +0 -1
- package/dist/chunk-U25GFKNZ.js.map +0 -1
- package/dist/chunk-Z5K4FHYP.js +0 -922
- package/dist/chunk-Z5K4FHYP.js.map +0 -1
- package/dist/server-N7XAAV3X.js +0 -512
- package/dist/server-N7XAAV3X.js.map +0 -1
- package/dist/setup-system-JUHGDZJW.js.map +0 -1
- package/dist/skills-command-W3SE3OFP.js.map +0 -1
- package/dist/virtual_make-docs-first-party-skills-VXSUUHTL.js +0 -11
- package/dist/virtual_make-docs-first-party-skills-VXSUUHTL.js.map +0 -1
- /package/dist/{backup-GCM64IPN.js.map → backup-2OT4A6LR.js.map} +0 -0
- /package/dist/{chunk-GPVKIBFC.js.map → chunk-CMNKQM7L.js.map} +0 -0
- /package/dist/{chunk-57GN6ALR.js.map → chunk-VMKG3H4B.js.map} +0 -0
- /package/dist/{uninstall-BGMJ6KCI.js.map → uninstall-45XF4CHD.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
COMPLETE_PROJECT_CAPABILITIES,
|
|
4
|
+
describeHarnessSupport,
|
|
5
|
+
resolveUnifiedSetupState
|
|
6
|
+
} from "./chunk-I4FADOUK.js";
|
|
2
7
|
import {
|
|
3
8
|
classifyCompatibilityState,
|
|
4
9
|
formatCompatibilityClassification,
|
|
5
10
|
importLegacyInstallationState,
|
|
6
11
|
previewLegacyInstallationState,
|
|
7
12
|
scopeCompatibilityToInstallPlan
|
|
8
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CMNKQM7L.js";
|
|
9
14
|
import {
|
|
10
15
|
Checkpoint9ReceiptProjectionError,
|
|
11
16
|
MigrationSafetyError,
|
|
@@ -21,63 +26,64 @@ import {
|
|
|
21
26
|
operationCliProjection,
|
|
22
27
|
resolveCliOperationLaunch,
|
|
23
28
|
serializeOperationError
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import {
|
|
26
|
-
runBackupCommand
|
|
27
|
-
} from "./chunk-O2UZ35PV.js";
|
|
28
|
-
import "./chunk-2HNJCJJE.js";
|
|
29
|
-
import {
|
|
30
|
-
OperationError,
|
|
31
|
-
listLifecycleRuns,
|
|
32
|
-
loadGlobalConfig,
|
|
33
|
-
previewStoreCompatibilityBridge,
|
|
34
|
-
resolveProjectIdentity,
|
|
35
|
-
writeGlobalConfig
|
|
36
|
-
} from "./chunk-IHMZ2OCS.js";
|
|
37
|
-
import {
|
|
38
|
-
COMPLETE_PROJECT_CAPABILITIES,
|
|
39
|
-
describeHarnessSupport,
|
|
40
|
-
resolveUnifiedSetupState
|
|
41
|
-
} from "./chunk-DNDM7DUQ.js";
|
|
29
|
+
} from "./chunk-XDSWX4Y4.js";
|
|
42
30
|
import {
|
|
31
|
+
MCP_SERVER_PROFILES,
|
|
43
32
|
applyInstallPlan,
|
|
44
33
|
createDefaultMakeDocsConfig,
|
|
45
34
|
findReviewableManagedFileConflicts,
|
|
46
35
|
getConfigRenderingLabels,
|
|
47
36
|
getDocumentKindLabel,
|
|
48
37
|
loadMakeDocsConfigOrThrow,
|
|
38
|
+
parseMcpServerProfile,
|
|
49
39
|
planInstall,
|
|
50
40
|
planProjectHarnessIntegrationWrite,
|
|
51
41
|
registerSkillAdoptionRecovery
|
|
52
|
-
} from "./chunk-
|
|
53
|
-
import
|
|
42
|
+
} from "./chunk-CLSOY7NV.js";
|
|
43
|
+
import {
|
|
44
|
+
runBackupCommand
|
|
45
|
+
} from "./chunk-CCYP5NU2.js";
|
|
46
|
+
import "./chunk-46MGH32G.js";
|
|
47
|
+
import "./chunk-VMKG3H4B.js";
|
|
54
48
|
import {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} from "./chunk-
|
|
49
|
+
S_BAR,
|
|
50
|
+
S_BAR_END,
|
|
51
|
+
S_CHECKBOX_ACTIVE,
|
|
52
|
+
S_CHECKBOX_INACTIVE,
|
|
53
|
+
S_CHECKBOX_SELECTED,
|
|
54
|
+
a,
|
|
55
|
+
confirm,
|
|
56
|
+
intro,
|
|
57
|
+
isCancel,
|
|
58
|
+
multiselect,
|
|
59
|
+
note,
|
|
60
|
+
select,
|
|
61
|
+
symbol,
|
|
62
|
+
wrapTextWithPrefix
|
|
63
|
+
} from "./chunk-3EXHM5L2.js";
|
|
64
|
+
import {
|
|
65
|
+
OperationError,
|
|
66
|
+
listLifecycleRuns,
|
|
67
|
+
loadGlobalConfig,
|
|
68
|
+
previewStoreCompatibilityBridge,
|
|
69
|
+
resolveProjectIdentity,
|
|
70
|
+
writeGlobalConfig
|
|
71
|
+
} from "./chunk-UNR4CYVX.js";
|
|
70
72
|
import {
|
|
71
73
|
HARNESS_CALLER_IDENTITY_ARG,
|
|
72
74
|
HARNESS_CALLER_IDENTITY_ENV,
|
|
73
75
|
HARNESS_CALLER_REFERENCE_ARG,
|
|
76
|
+
MCP_CONNECTION_ID_ENV,
|
|
77
|
+
MCP_CONNECTION_KEY_ENV,
|
|
78
|
+
createMcpConnection,
|
|
74
79
|
encodeHarnessCallerIdentity,
|
|
75
80
|
parseHarnessCallerIdentity,
|
|
76
81
|
parseHarnessCallerIdentityArgument,
|
|
77
82
|
parseHarnessCallerReference,
|
|
83
|
+
redactMcpNativeValue,
|
|
78
84
|
sha256,
|
|
79
85
|
verifyMakeDocsExecutable
|
|
80
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-ISSMVKIA.js";
|
|
81
87
|
import {
|
|
82
88
|
CAPABILITIES,
|
|
83
89
|
CAPABILITY_DEPENDENCIES,
|
|
@@ -106,7 +112,7 @@ import {
|
|
|
106
112
|
validateAndMigrateManifest,
|
|
107
113
|
withStoreDatabase,
|
|
108
114
|
writeTextFile
|
|
109
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-HXWD2EUD.js";
|
|
110
116
|
import "./chunk-D4HDZEJT.js";
|
|
111
117
|
|
|
112
118
|
// src/cli.ts
|
|
@@ -246,6 +252,14 @@ function renderPrdAuthorityValidation(value) {
|
|
|
246
252
|
const lines = [
|
|
247
253
|
`PRD authority validation: ${text(report, "status") ?? "unknown"} (${String(report.prdFilesScanned ?? "?")} PRD files, ${diagnostics.length} errors).`
|
|
248
254
|
];
|
|
255
|
+
const coverage = asRecord(report.markdownSourceCoverage);
|
|
256
|
+
if (coverage) {
|
|
257
|
+
lines.push(
|
|
258
|
+
`Markdown checked: ${String(report.markdownFilesScanned ?? "?")} (PRD ${String(coverage.prd ?? 0)}, design ${String(coverage.design ?? 0)}, plan ${String(coverage.plan ?? 0)}, work ${String(coverage.work ?? 0)}, custom ${String(coverage.custom ?? 0)}).`
|
|
259
|
+
);
|
|
260
|
+
const customPaths = stringList(coverage, "customPaths");
|
|
261
|
+
if (customPaths.length > 0) lines.push(`Custom sources: ${customPaths.join(", ")}`);
|
|
262
|
+
}
|
|
249
263
|
for (const diagnostic of diagnostics) {
|
|
250
264
|
lines.push(
|
|
251
265
|
`${text(diagnostic, "code") ?? "PRD-AUTH-?"} ${text(diagnostic, "path") ?? "?"}:${String(diagnostic.line ?? "?")} ${text(diagnostic, "message") ?? "Validation error."}`,
|
|
@@ -301,10 +315,16 @@ function renderBacklogSnapshot(value) {
|
|
|
301
315
|
return lines;
|
|
302
316
|
}
|
|
303
317
|
var TEXT_RENDERERS = {
|
|
318
|
+
"backlog.review.open": renderBacklogReview,
|
|
319
|
+
"backlog.review.refresh": renderBacklogReview,
|
|
304
320
|
"prd.authority.validate": renderPrdAuthorityValidation,
|
|
305
321
|
"performance.evidence.validate": renderPerformanceEvidenceValidation,
|
|
306
322
|
"work.backlog.snapshot": renderBacklogSnapshot
|
|
307
323
|
};
|
|
324
|
+
function renderBacklogReview(value) {
|
|
325
|
+
const content = recordEntries(asRecord(value)?.content);
|
|
326
|
+
return content.length === 1 && text(content[0], "type") === "text" ? [text(content[0], "text") ?? ""] : null;
|
|
327
|
+
}
|
|
308
328
|
function genericRenderer(value) {
|
|
309
329
|
const record = asRecord(value);
|
|
310
330
|
const lines = stringList(record, "lines");
|
|
@@ -516,6 +536,14 @@ var RUN_CLI_ADAPTERS = {
|
|
|
516
536
|
)
|
|
517
537
|
}
|
|
518
538
|
}),
|
|
539
|
+
"backlog.review.open": (options) => ({ input: { report: parseJsonPayload(
|
|
540
|
+
requiredValue(options, "report-json", operationPath("backlog.review.open")),
|
|
541
|
+
"report-json"
|
|
542
|
+
) } }),
|
|
543
|
+
"backlog.review.refresh": (options) => ({ input: { envelope: parseJsonPayload(
|
|
544
|
+
requiredValue(options, "envelope-json", operationPath("backlog.review.refresh")),
|
|
545
|
+
"envelope-json"
|
|
546
|
+
) } }),
|
|
519
547
|
"work.backlog-cache.lookup": (options) => ({
|
|
520
548
|
input: {
|
|
521
549
|
targetRoot: path.resolve(
|
|
@@ -1178,6 +1206,10 @@ var HARNESS_METADATA = {
|
|
|
1178
1206
|
codex: {
|
|
1179
1207
|
label: "Codex",
|
|
1180
1208
|
hint: "AGENTS.md + .agents/"
|
|
1209
|
+
},
|
|
1210
|
+
"github-copilot": {
|
|
1211
|
+
label: "GitHub Copilot CLI",
|
|
1212
|
+
hint: "AGENTS.md + .agents/"
|
|
1181
1213
|
}
|
|
1182
1214
|
};
|
|
1183
1215
|
var MANAGED_FILE_CONFLICT_GROUP_ORDER = [
|
|
@@ -1488,11 +1520,11 @@ async function promptForManagedFileConflictResolutions(conflicts) {
|
|
|
1488
1520
|
return {};
|
|
1489
1521
|
}
|
|
1490
1522
|
const sortedConflicts = sortManagedFileConflicts(conflicts);
|
|
1491
|
-
|
|
1523
|
+
note(
|
|
1492
1524
|
renderManagedFileConflictSummary(sortedConflicts),
|
|
1493
1525
|
"Resolve managed file conflicts"
|
|
1494
1526
|
);
|
|
1495
|
-
const batchResolution = await
|
|
1527
|
+
const batchResolution = await select({
|
|
1496
1528
|
message: "How should make-docs handle these existing files?",
|
|
1497
1529
|
withGuide: true,
|
|
1498
1530
|
initialValue: "review-each",
|
|
@@ -1511,7 +1543,7 @@ async function promptForManagedFileConflictResolutions(conflicts) {
|
|
|
1511
1543
|
}
|
|
1512
1544
|
]
|
|
1513
1545
|
});
|
|
1514
|
-
if (
|
|
1546
|
+
if (isCancel(batchResolution)) {
|
|
1515
1547
|
return null;
|
|
1516
1548
|
}
|
|
1517
1549
|
if (batchResolution === "overwrite-all") {
|
|
@@ -1528,13 +1560,13 @@ async function promptForManagedFileConflictResolutions(conflicts) {
|
|
|
1528
1560
|
if (groupConflicts.length === 0) {
|
|
1529
1561
|
continue;
|
|
1530
1562
|
}
|
|
1531
|
-
|
|
1563
|
+
note(
|
|
1532
1564
|
`${groupConflicts.length} ${pluralizeFile(groupConflicts.length)} to review.`,
|
|
1533
1565
|
styleText("cyan", getManagedFileConflictGroupLabel(group))
|
|
1534
1566
|
);
|
|
1535
1567
|
for (const conflict of groupConflicts) {
|
|
1536
1568
|
const fileNumber = sortedConflicts.indexOf(conflict) + 1;
|
|
1537
|
-
|
|
1569
|
+
note(
|
|
1538
1570
|
[
|
|
1539
1571
|
`Group: ${getManagedFileConflictGroupLabel(conflict.group)}`,
|
|
1540
1572
|
`Path: ${conflict.relativePath}`,
|
|
@@ -1543,7 +1575,7 @@ async function promptForManagedFileConflictResolutions(conflicts) {
|
|
|
1543
1575
|
].join("\n"),
|
|
1544
1576
|
"Existing managed file"
|
|
1545
1577
|
);
|
|
1546
|
-
const resolution = await
|
|
1578
|
+
const resolution = await select({
|
|
1547
1579
|
message: `How should make-docs handle ${conflict.relativePath}?`,
|
|
1548
1580
|
withGuide: true,
|
|
1549
1581
|
initialValue: conflict.scope === "managed-block" ? "overwrite" : "skip",
|
|
@@ -1558,7 +1590,7 @@ async function promptForManagedFileConflictResolutions(conflicts) {
|
|
|
1558
1590
|
}
|
|
1559
1591
|
]
|
|
1560
1592
|
});
|
|
1561
|
-
if (
|
|
1593
|
+
if (isCancel(resolution)) {
|
|
1562
1594
|
return null;
|
|
1563
1595
|
}
|
|
1564
1596
|
resolutions[conflict.relativePath] = resolution;
|
|
@@ -1639,10 +1671,10 @@ function toTitleCase(value) {
|
|
|
1639
1671
|
function createClackWizardRenderer() {
|
|
1640
1672
|
return {
|
|
1641
1673
|
beginSession(title) {
|
|
1642
|
-
|
|
1674
|
+
intro(title);
|
|
1643
1675
|
},
|
|
1644
1676
|
showProjectState(state) {
|
|
1645
|
-
|
|
1677
|
+
note(`${state}.`, "Project state");
|
|
1646
1678
|
},
|
|
1647
1679
|
async editCapabilities(state) {
|
|
1648
1680
|
return promptForCapabilities(state.selections, state.config);
|
|
@@ -1654,8 +1686,8 @@ function createClackWizardRenderer() {
|
|
|
1654
1686
|
return promptForOptions(state);
|
|
1655
1687
|
},
|
|
1656
1688
|
async review(state) {
|
|
1657
|
-
|
|
1658
|
-
const result = await
|
|
1689
|
+
note(state.summary, "Review selections");
|
|
1690
|
+
const result = await select({
|
|
1659
1691
|
message: "What would you like to do next?",
|
|
1660
1692
|
withGuide: true,
|
|
1661
1693
|
options: [
|
|
@@ -1688,7 +1720,7 @@ function createClackWizardRenderer() {
|
|
|
1688
1720
|
}
|
|
1689
1721
|
]
|
|
1690
1722
|
});
|
|
1691
|
-
if (
|
|
1723
|
+
if (isCancel(result)) {
|
|
1692
1724
|
return "cancel";
|
|
1693
1725
|
}
|
|
1694
1726
|
return result;
|
|
@@ -1699,7 +1731,7 @@ async function promptForCapabilities(selections, config = createDefaultMakeDocsC
|
|
|
1699
1731
|
const promptState = {
|
|
1700
1732
|
selections: normalizeWizardSelections(selections)
|
|
1701
1733
|
};
|
|
1702
|
-
const prompt = new
|
|
1734
|
+
const prompt = new a({
|
|
1703
1735
|
options: buildCapabilityChecklistState(promptState.selections, config).options,
|
|
1704
1736
|
initialValues: buildCapabilityChecklistState(promptState.selections, config).selectedCapabilities,
|
|
1705
1737
|
required: true,
|
|
@@ -1729,13 +1761,13 @@ async function promptForCapabilities(selections, config = createDefaultMakeDocsC
|
|
|
1729
1761
|
prompt.on("key", syncPromptState);
|
|
1730
1762
|
syncPromptState();
|
|
1731
1763
|
const result = await prompt.prompt();
|
|
1732
|
-
if (
|
|
1764
|
+
if (isCancel(result)) {
|
|
1733
1765
|
return null;
|
|
1734
1766
|
}
|
|
1735
1767
|
return buildCapabilityChecklistState(promptState.selections, config).selectedCapabilities;
|
|
1736
1768
|
}
|
|
1737
1769
|
async function promptForHarnesses(selections) {
|
|
1738
|
-
const result = await
|
|
1770
|
+
const result = await multiselect({
|
|
1739
1771
|
message: "Which agent platforms will you use?",
|
|
1740
1772
|
withGuide: true,
|
|
1741
1773
|
initialValues: getSelectedHarnesses(selections),
|
|
@@ -1746,7 +1778,7 @@ async function promptForHarnesses(selections) {
|
|
|
1746
1778
|
hint: HARNESS_METADATA[harness].hint
|
|
1747
1779
|
}))
|
|
1748
1780
|
});
|
|
1749
|
-
if (
|
|
1781
|
+
if (isCancel(result)) {
|
|
1750
1782
|
return null;
|
|
1751
1783
|
}
|
|
1752
1784
|
return result;
|
|
@@ -1757,34 +1789,34 @@ async function promptForOptions(state) {
|
|
|
1757
1789
|
(harness) => HARNESS_METADATA[harness].label
|
|
1758
1790
|
);
|
|
1759
1791
|
if (state.skillsLocked) {
|
|
1760
|
-
|
|
1792
|
+
note(
|
|
1761
1793
|
"This setup keeps the saved Skill selection. Use `make-docs setup skills` to change the enabled state, scope, source, or selected names.",
|
|
1762
1794
|
"Skills"
|
|
1763
1795
|
);
|
|
1764
1796
|
}
|
|
1765
|
-
const skillsResult = state.skillsLocked ? options.skills : await
|
|
1797
|
+
const skillsResult = state.skillsLocked ? options.skills : await confirm({
|
|
1766
1798
|
message: `Install optional Skills for ${formatInlineList(harnessLabels)}? Skills guide agents. They do not grant Store access.`,
|
|
1767
1799
|
withGuide: true,
|
|
1768
1800
|
initialValue: options.skills,
|
|
1769
1801
|
active: "Yes",
|
|
1770
1802
|
inactive: "No"
|
|
1771
1803
|
});
|
|
1772
|
-
if (
|
|
1804
|
+
if (isCancel(skillsResult)) return null;
|
|
1773
1805
|
let skillScope = options.skillScope;
|
|
1774
1806
|
let selectedSkills = options.selectedSkills;
|
|
1775
1807
|
if (skillsResult && !state.skillsLocked) {
|
|
1776
|
-
const scopeResult = await
|
|
1808
|
+
const scopeResult = await select({
|
|
1777
1809
|
message: "Where should skills be installed?",
|
|
1778
1810
|
withGuide: true,
|
|
1779
1811
|
initialValue: options.skillScope,
|
|
1780
1812
|
options: skillScopeOptions
|
|
1781
1813
|
});
|
|
1782
|
-
if (
|
|
1814
|
+
if (isCancel(scopeResult)) {
|
|
1783
1815
|
return null;
|
|
1784
1816
|
}
|
|
1785
1817
|
skillScope = scopeResult;
|
|
1786
1818
|
if (shouldPromptForSkillSelection(skillSelection)) {
|
|
1787
|
-
const prompt = new
|
|
1819
|
+
const prompt = new a({
|
|
1788
1820
|
options: skillSelection.promptOptions,
|
|
1789
1821
|
initialValues: skillSelection.selectedSkillNames,
|
|
1790
1822
|
required: false,
|
|
@@ -1793,7 +1825,7 @@ async function promptForOptions(state) {
|
|
|
1793
1825
|
}
|
|
1794
1826
|
});
|
|
1795
1827
|
const skillResult = await prompt.prompt();
|
|
1796
|
-
if (
|
|
1828
|
+
if (isCancel(skillResult)) {
|
|
1797
1829
|
return null;
|
|
1798
1830
|
}
|
|
1799
1831
|
const selectedSkillSet = new Set(skillResult);
|
|
@@ -1804,7 +1836,7 @@ async function promptForOptions(state) {
|
|
|
1804
1836
|
} else if (!skillsResult) {
|
|
1805
1837
|
selectedSkills = [];
|
|
1806
1838
|
}
|
|
1807
|
-
const resourceProjection = await
|
|
1839
|
+
const resourceProjection = await multiselect({
|
|
1808
1840
|
message: "Which system resources should also be copied into this project? Provider reads need no Store access.",
|
|
1809
1841
|
withGuide: true,
|
|
1810
1842
|
initialValues: options.resourceProjection ?? [],
|
|
@@ -1815,7 +1847,7 @@ async function promptForOptions(state) {
|
|
|
1815
1847
|
hint: "Optional local copy for portability. It does not grant harness or Store access."
|
|
1816
1848
|
}))
|
|
1817
1849
|
});
|
|
1818
|
-
if (
|
|
1850
|
+
if (isCancel(resourceProjection)) {
|
|
1819
1851
|
return null;
|
|
1820
1852
|
}
|
|
1821
1853
|
return {
|
|
@@ -1828,26 +1860,26 @@ async function promptForOptions(state) {
|
|
|
1828
1860
|
function renderSkillSelectionFrame(prompt, skillSelection) {
|
|
1829
1861
|
const lineColor = prompt.state === "error" ? "yellow" : "cyan";
|
|
1830
1862
|
const header = [
|
|
1831
|
-
styleText("gray",
|
|
1832
|
-
|
|
1863
|
+
styleText("gray", S_BAR),
|
|
1864
|
+
wrapTextWithPrefix(
|
|
1833
1865
|
process.stdout,
|
|
1834
1866
|
"Select skills to install",
|
|
1835
|
-
`${styleText(lineColor,
|
|
1836
|
-
`${
|
|
1867
|
+
`${styleText(lineColor, S_BAR)} `,
|
|
1868
|
+
`${symbol(prompt.state)} `
|
|
1837
1869
|
)
|
|
1838
1870
|
];
|
|
1839
|
-
const bodyPrefix = `${styleText(lineColor,
|
|
1871
|
+
const bodyPrefix = `${styleText(lineColor, S_BAR)} `;
|
|
1840
1872
|
const selectedSkillNames = new Set(
|
|
1841
1873
|
prompt.value ?? skillSelection.selectedSkillNames
|
|
1842
1874
|
);
|
|
1843
1875
|
const selectedSummary = selectedSkillNames.size > 0 ? formatInlineList(Array.from(selectedSkillNames)) : "no skills";
|
|
1844
1876
|
if (prompt.state === "submit") {
|
|
1845
1877
|
return `${header.join("\n")}
|
|
1846
|
-
${styleText("gray",
|
|
1878
|
+
${styleText("gray", S_BAR)} ${styleText("dim", selectedSummary)}`;
|
|
1847
1879
|
}
|
|
1848
1880
|
if (prompt.state === "cancel") {
|
|
1849
1881
|
return `${header.join("\n")}
|
|
1850
|
-
${styleText("gray",
|
|
1882
|
+
${styleText("gray", S_BAR)} ${styleText(
|
|
1851
1883
|
["strikethrough", "dim"],
|
|
1852
1884
|
selectedSummary
|
|
1853
1885
|
)}`;
|
|
@@ -1870,10 +1902,10 @@ ${styleText("gray", h)} ${styleText(
|
|
|
1870
1902
|
"Space toggles skills"
|
|
1871
1903
|
)} \u2022 ${styleText("dim", "Enter to confirm")}`
|
|
1872
1904
|
];
|
|
1873
|
-
const footer = styleText(lineColor,
|
|
1874
|
-
const spacer = styleText(lineColor,
|
|
1905
|
+
const footer = styleText(lineColor, S_BAR_END);
|
|
1906
|
+
const spacer = styleText(lineColor, S_BAR);
|
|
1875
1907
|
const errorLines = prompt.state === "error" && prompt.error ? prompt.error.split("\n").map(
|
|
1876
|
-
(line, index) => index === 0 ? `${styleText("yellow",
|
|
1908
|
+
(line, index) => index === 0 ? `${styleText("yellow", S_BAR_END)} ${styleText("yellow", line)}` : ` ${styleText("yellow", line)}`
|
|
1877
1909
|
) : [];
|
|
1878
1910
|
return [
|
|
1879
1911
|
...header,
|
|
@@ -1904,18 +1936,18 @@ function getFocusedSkillSelectionOption(prompt, skillSelection) {
|
|
|
1904
1936
|
function renderSkillSelectionOption(option, active, selectedSkillNames) {
|
|
1905
1937
|
const selected = selectedSkillNames.has(option.value);
|
|
1906
1938
|
if (selected && active) {
|
|
1907
|
-
return ` ${styleText("green",
|
|
1939
|
+
return ` ${styleText("green", S_CHECKBOX_SELECTED)} ${styleText("white", option.label)}${option.hint ? ` ${styleText("dim", `(${option.hint})`)}` : ""}`;
|
|
1908
1940
|
}
|
|
1909
1941
|
if (selected) {
|
|
1910
|
-
return ` ${styleText("green",
|
|
1942
|
+
return ` ${styleText("green", S_CHECKBOX_SELECTED)} ${styleText("dim", option.label)}${option.hint ? ` ${styleText("dim", `(${option.hint})`)}` : ""}`;
|
|
1911
1943
|
}
|
|
1912
1944
|
if (active) {
|
|
1913
|
-
return ` ${styleText("cyan",
|
|
1945
|
+
return ` ${styleText("cyan", S_CHECKBOX_ACTIVE)} ${styleText(
|
|
1914
1946
|
["bold", "white"],
|
|
1915
1947
|
option.label
|
|
1916
1948
|
)}${option.hint ? ` ${styleText("dim", `(${option.hint})`)}` : ""}`;
|
|
1917
1949
|
}
|
|
1918
|
-
return ` ${styleText("dim",
|
|
1950
|
+
return ` ${styleText("dim", S_CHECKBOX_INACTIVE)} ${styleText("dim", option.label)}${option.hint ? ` ${styleText("dim", `(${option.hint})`)}` : ""}`;
|
|
1919
1951
|
}
|
|
1920
1952
|
function renderSkillSelectionLines(options, activeIndex, selectedSkillNames) {
|
|
1921
1953
|
const lines = [];
|
|
@@ -1937,15 +1969,15 @@ function renderCapabilitiesFrame(prompt, selections) {
|
|
|
1937
1969
|
const checklist = buildCapabilityChecklistState(selections);
|
|
1938
1970
|
const lineColor = prompt.state === "error" ? "yellow" : "cyan";
|
|
1939
1971
|
const header = [
|
|
1940
|
-
styleText("gray",
|
|
1941
|
-
|
|
1972
|
+
styleText("gray", S_BAR),
|
|
1973
|
+
wrapTextWithPrefix(
|
|
1942
1974
|
process.stdout,
|
|
1943
1975
|
"Choose the document types to manage in this project:",
|
|
1944
|
-
`${styleText(lineColor,
|
|
1945
|
-
`${
|
|
1976
|
+
`${styleText(lineColor, S_BAR)} `,
|
|
1977
|
+
`${symbol(prompt.state)} `
|
|
1946
1978
|
)
|
|
1947
1979
|
];
|
|
1948
|
-
const bodyPrefix = `${styleText(lineColor,
|
|
1980
|
+
const bodyPrefix = `${styleText(lineColor, S_BAR)} `;
|
|
1949
1981
|
const focusedOption = checklist.options[prompt.cursor] ?? checklist.options[0];
|
|
1950
1982
|
const selectedLabels = checklist.selectedCapabilities.length > 0 ? checklist.selectedCapabilities.map(
|
|
1951
1983
|
(capability) => CAPABILITY_METADATA[capability].label
|
|
@@ -1953,12 +1985,12 @@ function renderCapabilitiesFrame(prompt, selections) {
|
|
|
1953
1985
|
if (prompt.state === "submit") {
|
|
1954
1986
|
const submittedSummary = selectedLabels.length > 0 ? formatInlineList(selectedLabels) : "no capability families";
|
|
1955
1987
|
return `${header.join("\n")}
|
|
1956
|
-
${styleText("gray",
|
|
1988
|
+
${styleText("gray", S_BAR)} ${styleText("dim", submittedSummary)}`;
|
|
1957
1989
|
}
|
|
1958
1990
|
if (prompt.state === "cancel") {
|
|
1959
1991
|
const cancelledSummary = selectedLabels.length > 0 ? formatInlineList(selectedLabels) : "no capability families";
|
|
1960
1992
|
return `${header.join("\n")}
|
|
1961
|
-
${styleText("gray",
|
|
1993
|
+
${styleText("gray", S_BAR)} ${styleText(
|
|
1962
1994
|
["strikethrough", "dim"],
|
|
1963
1995
|
cancelledSummary
|
|
1964
1996
|
)}`;
|
|
@@ -1987,10 +2019,10 @@ ${styleText("gray", h)} ${styleText(
|
|
|
1987
2019
|
"Space to select or deselect"
|
|
1988
2020
|
)} \u2022 ${styleText("dim", "Enter to confirm")}`
|
|
1989
2021
|
];
|
|
1990
|
-
const footer = styleText(lineColor,
|
|
1991
|
-
const spacer = styleText(lineColor,
|
|
2022
|
+
const footer = styleText(lineColor, S_BAR_END);
|
|
2023
|
+
const spacer = styleText(lineColor, S_BAR);
|
|
1992
2024
|
const errorLines = prompt.state === "error" ? prompt.error.split("\n").map(
|
|
1993
|
-
(line, index) => index === 0 ? `${styleText("yellow",
|
|
2025
|
+
(line, index) => index === 0 ? `${styleText("yellow", S_BAR_END)} ${styleText("yellow", line)}` : ` ${styleText("yellow", line)}`
|
|
1994
2026
|
) : [];
|
|
1995
2027
|
return [
|
|
1996
2028
|
...header,
|
|
@@ -2007,21 +2039,21 @@ ${styleText("gray", h)} ${styleText(
|
|
|
2007
2039
|
function renderCapabilityOption(option, active, selectedCapabilities) {
|
|
2008
2040
|
const selected = selectedCapabilities.includes(option.value);
|
|
2009
2041
|
if (option.disabled) {
|
|
2010
|
-
return `${styleText("gray",
|
|
2042
|
+
return `${styleText("gray", S_CHECKBOX_INACTIVE)} ${styleText(
|
|
2011
2043
|
["strikethrough", "gray"],
|
|
2012
2044
|
option.label
|
|
2013
2045
|
)}`;
|
|
2014
2046
|
}
|
|
2015
2047
|
if (selected && active) {
|
|
2016
|
-
return `${styleText("green",
|
|
2048
|
+
return `${styleText("green", S_CHECKBOX_SELECTED)} ${option.label}`;
|
|
2017
2049
|
}
|
|
2018
2050
|
if (selected) {
|
|
2019
|
-
return `${styleText("green",
|
|
2051
|
+
return `${styleText("green", S_CHECKBOX_SELECTED)} ${styleText("dim", option.label)}`;
|
|
2020
2052
|
}
|
|
2021
2053
|
if (active) {
|
|
2022
|
-
return `${styleText("cyan",
|
|
2054
|
+
return `${styleText("cyan", S_CHECKBOX_ACTIVE)} ${option.label}`;
|
|
2023
2055
|
}
|
|
2024
|
-
return `${styleText("dim",
|
|
2056
|
+
return `${styleText("dim", S_CHECKBOX_INACTIVE)} ${styleText("dim", option.label)}`;
|
|
2025
2057
|
}
|
|
2026
2058
|
function renderDetailBox(title, lines, columns) {
|
|
2027
2059
|
const maxWidth = Math.max(46, Math.min(columns - 8, 88));
|
|
@@ -2232,7 +2264,6 @@ function renderSetupProjectRecovery(review) {
|
|
|
2232
2264
|
}
|
|
2233
2265
|
|
|
2234
2266
|
// src/generic-mcp-setup.ts
|
|
2235
|
-
import { randomBytes } from "crypto";
|
|
2236
2267
|
import os from "os";
|
|
2237
2268
|
import path3 from "path";
|
|
2238
2269
|
function validateGenericMcpClientLabel(label) {
|
|
@@ -2249,17 +2280,18 @@ function prepareGenericMcpSetup(options) {
|
|
|
2249
2280
|
const storeRoot = options.storeRoot ?? resolveStoreRoot();
|
|
2250
2281
|
const existing = loadGlobalConfig(storeRoot).config.settings.harnesses[harnessId];
|
|
2251
2282
|
const active = isCurrentGenericIntent(existing, clientLabel);
|
|
2252
|
-
const accessCeiling = { store: "write", project: "write", hostConfig: "none" };
|
|
2283
|
+
const accessCeiling = existing?.accessCeiling ? { ...existing.accessCeiling } : { store: "write", project: "write", hostConfig: "none" };
|
|
2253
2284
|
if (action === "remove") {
|
|
2285
|
+
const enabled = Boolean(existing?.selected || existing?.mcpConnection?.active);
|
|
2254
2286
|
return {
|
|
2255
2287
|
schemaVersion: 1,
|
|
2256
2288
|
clientLabel,
|
|
2257
2289
|
harnessId,
|
|
2258
2290
|
action,
|
|
2259
|
-
changed:
|
|
2260
|
-
state:
|
|
2291
|
+
changed: enabled,
|
|
2292
|
+
state: enabled ? "planned" : "missing",
|
|
2261
2293
|
accessCeiling,
|
|
2262
|
-
review:
|
|
2294
|
+
review: enabled ? `Remove the Make Docs-owned generic MCP profile '${clientLabel}'. No client-owned file changes.` : `Generic MCP profile '${clientLabel}' is already absent. No client-owned file changes.`,
|
|
2263
2295
|
nextAction: null,
|
|
2264
2296
|
configuration: null,
|
|
2265
2297
|
configurationDigest: null,
|
|
@@ -2287,40 +2319,30 @@ function prepareGenericMcpSetup(options) {
|
|
|
2287
2319
|
const executable = options.executable ?? verifyMakeDocsExecutable({
|
|
2288
2320
|
executablePath: path3.resolve(process.argv[1] ?? "")
|
|
2289
2321
|
});
|
|
2290
|
-
const proof = randomBytes(32).toString("base64url");
|
|
2291
2322
|
const machineRoot = path3.resolve(options.machineRoot ?? os.homedir());
|
|
2292
|
-
const
|
|
2293
|
-
schemaVersion: 1,
|
|
2294
|
-
kind: "make-docs-generic-mcp-caller",
|
|
2295
|
-
adapterId: "generic-mcp",
|
|
2296
|
-
adapterVersion: 1,
|
|
2297
|
-
harnessId,
|
|
2298
|
-
connectionMethod: "mcp",
|
|
2299
|
-
scope: "machine",
|
|
2300
|
-
root: machineRoot,
|
|
2301
|
-
executable,
|
|
2302
|
-
proof
|
|
2303
|
-
};
|
|
2323
|
+
const connection = createMcpConnection(harnessId);
|
|
2304
2324
|
const configuration = {
|
|
2305
2325
|
mcpServers: {
|
|
2306
2326
|
"make-docs": {
|
|
2307
2327
|
command: executable.path,
|
|
2308
2328
|
args: ["mcp"],
|
|
2309
|
-
env: {
|
|
2329
|
+
env: {
|
|
2330
|
+
[MCP_CONNECTION_ID_ENV]: connection.id,
|
|
2331
|
+
[MCP_CONNECTION_KEY_ENV]: connection.key
|
|
2332
|
+
}
|
|
2310
2333
|
}
|
|
2311
2334
|
}
|
|
2312
2335
|
};
|
|
2313
2336
|
const configurationDigest = sha256(JSON.stringify(configuration));
|
|
2314
|
-
const priorRevision = typeof existing?.identityRevision === "number" ? existing.identityRevision : 0;
|
|
2315
2337
|
const intent = {
|
|
2338
|
+
...existing,
|
|
2316
2339
|
selected: true,
|
|
2317
2340
|
maximumMethod: "mcp",
|
|
2318
2341
|
accessCeiling: { ...accessCeiling },
|
|
2319
2342
|
profileKind: "generic-mcp",
|
|
2320
2343
|
clientLabel,
|
|
2321
2344
|
machineRoot,
|
|
2322
|
-
|
|
2323
|
-
identityRevision: priorRevision + 1,
|
|
2345
|
+
mcpConnection: connection.record,
|
|
2324
2346
|
configurationDigest,
|
|
2325
2347
|
lifecycleState: "active"
|
|
2326
2348
|
};
|
|
@@ -2344,7 +2366,16 @@ function applyGenericMcpSetup(plan) {
|
|
|
2344
2366
|
if (!plan.changed) return { ...plan, state: plan.state === "missing" ? "missing" : "current" };
|
|
2345
2367
|
const loaded = loadGlobalConfig(plan.storeRoot);
|
|
2346
2368
|
if (plan.action === "remove") {
|
|
2347
|
-
|
|
2369
|
+
const prior = loaded.config.settings.harnesses[plan.harnessId];
|
|
2370
|
+
if (prior) {
|
|
2371
|
+
loaded.config.settings.harnesses[plan.harnessId] = {
|
|
2372
|
+
...prior,
|
|
2373
|
+
selected: false,
|
|
2374
|
+
maximumMethod: null,
|
|
2375
|
+
mcpConnection: prior.mcpConnection ? { ...prior.mcpConnection, active: false } : void 0,
|
|
2376
|
+
lifecycleState: "disabled"
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2348
2379
|
} else if (plan.intent) {
|
|
2349
2380
|
loaded.config.settings.harnesses[plan.harnessId] = {
|
|
2350
2381
|
...plan.intent,
|
|
@@ -2369,7 +2400,8 @@ function renderGenericMcpSetupResult(plan) {
|
|
|
2369
2400
|
plan.review
|
|
2370
2401
|
];
|
|
2371
2402
|
if (plan.configuration) {
|
|
2372
|
-
|
|
2403
|
+
const configuration = plan.state === "planned" ? redactMcpNativeValue(plan.configuration) : plan.configuration;
|
|
2404
|
+
lines.push("Client-owned configuration object:", JSON.stringify(configuration, null, 2));
|
|
2373
2405
|
}
|
|
2374
2406
|
if (plan.nextAction) lines.push(`Next: ${plan.nextAction}`);
|
|
2375
2407
|
return `${lines.join("\n")}
|
|
@@ -2377,7 +2409,7 @@ function renderGenericMcpSetupResult(plan) {
|
|
|
2377
2409
|
}
|
|
2378
2410
|
function isCurrentGenericIntent(value, clientLabel) {
|
|
2379
2411
|
return Boolean(
|
|
2380
|
-
value?.selected === true && value.maximumMethod === "mcp" && value.profileKind === "generic-mcp" && value.clientLabel === clientLabel && value.lifecycleState === "active" &&
|
|
2412
|
+
value?.selected === true && value.maximumMethod === "mcp" && value.profileKind === "generic-mcp" && value.clientLabel === clientLabel && value.lifecycleState === "active" && value.mcpConnection?.active === true && value.mcpConnection.owner === `generic-mcp-${clientLabel}` && typeof value.mcpConnection.keySha256 === "string" && /^[a-f0-9]{64}$/.test(value.mcpConnection.keySha256)
|
|
2381
2413
|
);
|
|
2382
2414
|
}
|
|
2383
2415
|
|
|
@@ -2530,12 +2562,12 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2530
2562
|
return;
|
|
2531
2563
|
}
|
|
2532
2564
|
if (parsed.command === "mcp") {
|
|
2533
|
-
const { runMcpServer } = await import("./server-
|
|
2534
|
-
await runMcpServer();
|
|
2565
|
+
const { runMcpServer } = await import("./server-BQOG6FTA.js");
|
|
2566
|
+
await runMcpServer({ profile: parsed.mcpProfile ?? "all" });
|
|
2535
2567
|
return;
|
|
2536
2568
|
}
|
|
2537
2569
|
if (parsed.command === "update") {
|
|
2538
|
-
const { runToolUpdateCommand } = await import("./self-
|
|
2570
|
+
const { runToolUpdateCommand } = await import("./self-WYVXO23B.js");
|
|
2539
2571
|
await runToolUpdateCommand({
|
|
2540
2572
|
yes: parsed.yes,
|
|
2541
2573
|
...parsed.targetDir ? { targetDir: path4.resolve(parsed.targetDir) } : {}
|
|
@@ -2543,27 +2575,30 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2543
2575
|
return;
|
|
2544
2576
|
}
|
|
2545
2577
|
if (parsed.command === "uninstall") {
|
|
2546
|
-
const { runToolUninstallCommand } = await import("./self-
|
|
2578
|
+
const { runToolUninstallCommand } = await import("./self-WYVXO23B.js");
|
|
2547
2579
|
await runToolUninstallCommand({ yes: parsed.yes, removeStore: parsed.removeStore });
|
|
2548
2580
|
return;
|
|
2549
2581
|
}
|
|
2550
2582
|
validateParsedArgs(parsed);
|
|
2551
2583
|
if (parsed.setupSubcommand === "system") {
|
|
2552
|
-
const { runSystemSetupCommand } = await import("./setup-system-
|
|
2584
|
+
const { runSystemSetupCommand } = await import("./setup-system-KN7FTTLT.js");
|
|
2553
2585
|
const result = await runSystemSetupCommand({
|
|
2554
2586
|
dryRun: parsed.dryRun,
|
|
2555
2587
|
yes: parsed.yes,
|
|
2588
|
+
rotateMcp: parsed.rotateMcp,
|
|
2556
2589
|
promptForMethods: !parsed.yes && !parsed.dryRun && !parsed.json && Boolean(input.isTTY && output.isTTY),
|
|
2557
2590
|
targetRoot: path4.resolve(parsed.targetDir ?? process.cwd()),
|
|
2558
2591
|
methods: {
|
|
2559
2592
|
...parsed.codexMethod !== void 0 ? { codex: parsed.codexMethod } : {},
|
|
2560
|
-
...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {}
|
|
2593
|
+
...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {},
|
|
2594
|
+
...parsed.githubCopilotMethod !== void 0 ? { "github-copilot": parsed.githubCopilotMethod } : {}
|
|
2561
2595
|
},
|
|
2562
2596
|
harnesses: {
|
|
2563
2597
|
"claude-code": parsed.claudeCodeMethod !== void 0 || !parsed.noClaudeCode,
|
|
2564
|
-
codex: parsed.codexMethod !== void 0 || !parsed.noCodex
|
|
2598
|
+
codex: parsed.codexMethod !== void 0 || !parsed.noCodex,
|
|
2599
|
+
"github-copilot": parsed.githubCopilotMethod !== void 0 && !parsed.noGithubCopilot
|
|
2565
2600
|
},
|
|
2566
|
-
...!parsed.json && output.isTTY ? { onReview: (review) =>
|
|
2601
|
+
...!parsed.json && output.isTTY ? { onReview: (review) => note(review, "This computer") } : {}
|
|
2567
2602
|
});
|
|
2568
2603
|
let genericPlan = null;
|
|
2569
2604
|
if (parsed.genericMcpClient) {
|
|
@@ -2574,14 +2609,14 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2574
2609
|
if (!parsed.dryRun) {
|
|
2575
2610
|
let approved = parsed.yes;
|
|
2576
2611
|
if (!approved && input.isTTY && output.isTTY) {
|
|
2577
|
-
const answer = await
|
|
2612
|
+
const answer = await confirm({
|
|
2578
2613
|
message: `${genericPlan.review} Apply this Make Docs-owned profile?`,
|
|
2579
2614
|
initialValue: false,
|
|
2580
2615
|
active: "Yes",
|
|
2581
2616
|
inactive: "No",
|
|
2582
2617
|
withGuide: true
|
|
2583
2618
|
});
|
|
2584
|
-
approved = !
|
|
2619
|
+
approved = !isCancel(answer) && Boolean(answer);
|
|
2585
2620
|
}
|
|
2586
2621
|
if (approved || !genericPlan.changed) genericPlan = applyGenericMcpSetup(genericPlan);
|
|
2587
2622
|
}
|
|
@@ -2626,6 +2661,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2626
2661
|
remove: parsed.remove,
|
|
2627
2662
|
noCodex: parsed.noCodex,
|
|
2628
2663
|
noClaudeCode: parsed.noClaudeCode,
|
|
2664
|
+
...parsed.noGithubCopilot ? { noGithubCopilot: true } : {},
|
|
2629
2665
|
skillScope: parsed.skillScope,
|
|
2630
2666
|
selectedSkills: parsed.selectedSkills === void 0 ? void 0 : [...parsed.selectedSkills],
|
|
2631
2667
|
skillsManifest: parsed.skillsManifest,
|
|
@@ -2696,7 +2732,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2696
2732
|
let selectedMode = parsed.projectRecovery;
|
|
2697
2733
|
const availableChoices = projectRecoveryReview.choices.filter((choice) => choice.available);
|
|
2698
2734
|
if (!selectedMode && interactive && availableChoices.length > 0) {
|
|
2699
|
-
const selected = await
|
|
2735
|
+
const selected = await select({
|
|
2700
2736
|
message: "How should setup recover this unfinished project work?",
|
|
2701
2737
|
options: projectRecoveryReview.choices.map((choice) => ({
|
|
2702
2738
|
value: choice.mode,
|
|
@@ -2706,7 +2742,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2706
2742
|
})),
|
|
2707
2743
|
initialValue: projectRecoveryReview.recommendation ?? void 0
|
|
2708
2744
|
});
|
|
2709
|
-
if (
|
|
2745
|
+
if (isCancel(selected)) {
|
|
2710
2746
|
output.write("Setup cancelled. The unfinished project work was not changed.\n");
|
|
2711
2747
|
return;
|
|
2712
2748
|
}
|
|
@@ -2825,7 +2861,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2825
2861
|
});
|
|
2826
2862
|
}
|
|
2827
2863
|
if (!freshInstallTarget) {
|
|
2828
|
-
const { detectPreV2Install, promptPreV2Choice } = await import("./self-
|
|
2864
|
+
const { detectPreV2Install, promptPreV2Choice } = await import("./self-WYVXO23B.js");
|
|
2829
2865
|
const preV2 = detectPreV2Install({
|
|
2830
2866
|
targetDir,
|
|
2831
2867
|
classification: compatibilityClassification
|
|
@@ -2877,7 +2913,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2877
2913
|
}
|
|
2878
2914
|
let interactiveMethodSelections = {};
|
|
2879
2915
|
if (interactive) {
|
|
2880
|
-
const { inspectSystemHarnesses, promptForSystemSetupMethods } = await import("./setup-system-
|
|
2916
|
+
const { inspectSystemHarnesses, promptForSystemSetupMethods } = await import("./setup-system-KN7FTTLT.js");
|
|
2881
2917
|
const harnessSupport = inspectSystemHarnesses();
|
|
2882
2918
|
const afterHarnessSelection = async (wizardSelections) => {
|
|
2883
2919
|
interactiveMethodSelections = await promptForSystemSetupMethods({
|
|
@@ -2886,11 +2922,13 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2886
2922
|
promptForMethods: true,
|
|
2887
2923
|
methods: {
|
|
2888
2924
|
...parsed.codexMethod !== void 0 ? { codex: parsed.codexMethod } : {},
|
|
2889
|
-
...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {}
|
|
2925
|
+
...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {},
|
|
2926
|
+
...parsed.githubCopilotMethod !== void 0 ? { "github-copilot": parsed.githubCopilotMethod } : {}
|
|
2890
2927
|
},
|
|
2891
2928
|
harnesses: {
|
|
2892
2929
|
codex: wizardSelections.harnesses.codex,
|
|
2893
|
-
"claude-code": wizardSelections.harnesses["claude-code"]
|
|
2930
|
+
"claude-code": wizardSelections.harnesses["claude-code"],
|
|
2931
|
+
"github-copilot": wizardSelections.harnesses["github-copilot"]
|
|
2894
2932
|
},
|
|
2895
2933
|
projectHarnessIntegrations: makeDocsConfig.harnessIntegrations,
|
|
2896
2934
|
targetRoot: targetDir,
|
|
@@ -2953,7 +2991,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2953
2991
|
applyPreparedSystemSetup,
|
|
2954
2992
|
prepareSystemSetupCommand,
|
|
2955
2993
|
resumePendingSystemSetupCommand
|
|
2956
|
-
} = await import("./setup-system-
|
|
2994
|
+
} = await import("./setup-system-KN7FTTLT.js");
|
|
2957
2995
|
const systemOptions = {
|
|
2958
2996
|
dryRun: parsed.dryRun,
|
|
2959
2997
|
yes: parsed.yes,
|
|
@@ -2961,13 +2999,16 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2961
2999
|
methods: {
|
|
2962
3000
|
...interactiveMethodSelections,
|
|
2963
3001
|
...parsed.codexMethod !== void 0 ? { codex: parsed.codexMethod } : {},
|
|
2964
|
-
...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {}
|
|
3002
|
+
...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {},
|
|
3003
|
+
...parsed.githubCopilotMethod !== void 0 ? { "github-copilot": parsed.githubCopilotMethod } : {}
|
|
2965
3004
|
},
|
|
2966
3005
|
harnesses: {
|
|
2967
3006
|
"claude-code": selections.harnesses["claude-code"],
|
|
2968
|
-
codex: selections.harnesses.codex
|
|
3007
|
+
codex: selections.harnesses.codex,
|
|
3008
|
+
"github-copilot": selections.harnesses["github-copilot"]
|
|
2969
3009
|
},
|
|
2970
3010
|
projectHarnessIntegrations: makeDocsConfig.harnessIntegrations,
|
|
3011
|
+
manualMcpOutput: !jsonOutput,
|
|
2971
3012
|
targetRoot: targetDir,
|
|
2972
3013
|
persistIntent: true
|
|
2973
3014
|
};
|
|
@@ -3173,8 +3214,8 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
3173
3214
|
return reviewedProjectFingerprint !== previousFingerprint ? "changed" : "unchanged";
|
|
3174
3215
|
};
|
|
3175
3216
|
const hasMachineMutation = preparedSystemSetup.changed || Boolean(genericMcpPlan?.changed) || storeBridgePreview.changes.store.length > 0;
|
|
3176
|
-
if (!jsonOutput)
|
|
3177
|
-
if (!jsonOutput && genericMcpPlan)
|
|
3217
|
+
if (!jsonOutput) note(preparedSystemSetup.review, "This computer");
|
|
3218
|
+
if (!jsonOutput && genericMcpPlan) note(renderGenericMcpSetupResult(genericMcpPlan), "Generic MCP client");
|
|
3178
3219
|
if (!jsonOutput && storeBridgePreview.changes.store.length) {
|
|
3179
3220
|
output.write("Store prerequisite for This computer:\n");
|
|
3180
3221
|
for (const change of storeBridgePreview.changes.store) output.write(`- ${change}
|
|
@@ -3275,18 +3316,18 @@ Next: ${migrationReviewBlock.nextAction}
|
|
|
3275
3316
|
}
|
|
3276
3317
|
let systemApproved = parsed.yes || !hasMachineMutation;
|
|
3277
3318
|
if (interactive && hasMachineMutation) {
|
|
3278
|
-
const proceed = await
|
|
3319
|
+
const proceed = await confirm({
|
|
3279
3320
|
message: "Apply the reviewed changes to this computer?",
|
|
3280
3321
|
initialValue: false,
|
|
3281
3322
|
active: "Yes",
|
|
3282
3323
|
inactive: "No",
|
|
3283
3324
|
withGuide: true
|
|
3284
3325
|
});
|
|
3285
|
-
systemApproved = !
|
|
3326
|
+
systemApproved = !isCancel(proceed) && Boolean(proceed);
|
|
3286
3327
|
}
|
|
3287
3328
|
let projectApproved = parsed.yes || !hasInstallMutation;
|
|
3288
3329
|
if (interactive && hasInstallMutation) {
|
|
3289
|
-
const proceed = await
|
|
3330
|
+
const proceed = await confirm({
|
|
3290
3331
|
message: getApplyConfirmationMessage({
|
|
3291
3332
|
existingManifest: planningManifest,
|
|
3292
3333
|
installIntent
|
|
@@ -3296,7 +3337,7 @@ Next: ${migrationReviewBlock.nextAction}
|
|
|
3296
3337
|
inactive: "No",
|
|
3297
3338
|
withGuide: true
|
|
3298
3339
|
});
|
|
3299
|
-
projectApproved = !
|
|
3340
|
+
projectApproved = !isCancel(proceed) && Boolean(proceed);
|
|
3300
3341
|
}
|
|
3301
3342
|
if (!systemApproved) {
|
|
3302
3343
|
if (jsonOutput) writeCanonicalSetupResult({ status: "blocked", dryRun: false, targetRoot: targetDir, prepared: preparedSystemSetup, genericMcp: genericMcpPlan, storeBridge: storeBridgePreview, projectRecovery: priorProjectRecovery, storeMutationState: "none", projectChanged: recoveredProjectChanged, projectMutationState: recoveredProjectChanged ? "applied" : "none", projectActions: plan.actions, failedCondition: "Machine setup was not approved.", nextAction: "Run setup with --yes after you review the plan." });
|
|
@@ -3371,18 +3412,18 @@ Next: ${nextAction}
|
|
|
3371
3412
|
output.write(
|
|
3372
3413
|
"The verified Store state changed the computer review. Review the current computer plan.\n"
|
|
3373
3414
|
);
|
|
3374
|
-
|
|
3415
|
+
note(preparedSystemSetup.review, "This computer");
|
|
3375
3416
|
}
|
|
3376
3417
|
systemApproved = parsed.yes || !preparedSystemSetup.changed;
|
|
3377
3418
|
if (interactive && preparedSystemSetup.changed) {
|
|
3378
|
-
const proceed = await
|
|
3419
|
+
const proceed = await confirm({
|
|
3379
3420
|
message: "Apply the reviewed changes to this computer?",
|
|
3380
3421
|
initialValue: false,
|
|
3381
3422
|
active: "Yes",
|
|
3382
3423
|
inactive: "No",
|
|
3383
3424
|
withGuide: true
|
|
3384
3425
|
});
|
|
3385
|
-
systemApproved = !
|
|
3426
|
+
systemApproved = !isCancel(proceed) && Boolean(proceed);
|
|
3386
3427
|
}
|
|
3387
3428
|
if (!systemApproved) {
|
|
3388
3429
|
const nextAction = "Run `make-docs setup` again to review the current computer and project plans.";
|
|
@@ -3455,14 +3496,14 @@ Next: ${nextAction}
|
|
|
3455
3496
|
if (projectApproved) {
|
|
3456
3497
|
projectApproved = parsed.yes || !hasInstallMutation;
|
|
3457
3498
|
if (interactive && hasInstallMutation) {
|
|
3458
|
-
const proceed = await
|
|
3499
|
+
const proceed = await confirm({
|
|
3459
3500
|
message: getApplyConfirmationMessage({ existingManifest: planningManifest, installIntent }),
|
|
3460
3501
|
initialValue: true,
|
|
3461
3502
|
active: "Yes",
|
|
3462
3503
|
inactive: "No",
|
|
3463
3504
|
withGuide: true
|
|
3464
3505
|
});
|
|
3465
|
-
projectApproved = !
|
|
3506
|
+
projectApproved = !isCancel(proceed) && Boolean(proceed);
|
|
3466
3507
|
}
|
|
3467
3508
|
}
|
|
3468
3509
|
}
|
|
@@ -3471,9 +3512,9 @@ Next: ${nextAction}
|
|
|
3471
3512
|
if (!jsonOutput && appliedGenericMcpPlan?.configuration) {
|
|
3472
3513
|
output.write(renderGenericMcpSetupResult(appliedGenericMcpPlan));
|
|
3473
3514
|
}
|
|
3474
|
-
if (["blocked", "failed", "recovery"].includes(systemSetup.status)) {
|
|
3475
|
-
if (jsonOutput) writeCanonicalSetupResult({ status: "blocked", dryRun: false, targetRoot: targetDir, system: systemSetup, prepared: preparedSystemSetup, genericMcp: appliedGenericMcpPlan, storeBridge: appliedStoreBridge, projectRecovery: priorProjectRecovery, projectChanged: recoveredProjectChanged, projectMutationState: recoveredProjectChanged ? "applied" : "none", projectActions: plan.actions, failedCondition: systemSetup.blocked[0]?.reason ?? systemSetup.status, nextAction: systemSetup.
|
|
3476
|
-
else output.write(`Setup stopped at machine scope. ${systemSetup.
|
|
3515
|
+
if (systemSetup.projectMayProceed === false || systemSetup.projectMayProceed === void 0 && ["blocked", "failed", "recovery"].includes(systemSetup.status)) {
|
|
3516
|
+
if (jsonOutput) writeCanonicalSetupResult({ status: "blocked", dryRun: false, targetRoot: targetDir, system: systemSetup, prepared: preparedSystemSetup, genericMcp: appliedGenericMcpPlan, storeBridge: appliedStoreBridge, projectRecovery: priorProjectRecovery, projectChanged: recoveredProjectChanged, projectMutationState: recoveredProjectChanged ? "applied" : "none", projectActions: plan.actions, failedCondition: systemSetup.blocked[0]?.reason ?? systemSetup.status, nextAction: systemSetup.nextAction });
|
|
3517
|
+
else output.write(`Setup stopped at machine scope. ${systemSetup.nextAction ?? "Review the machine state."}
|
|
3477
3518
|
`);
|
|
3478
3519
|
return;
|
|
3479
3520
|
}
|
|
@@ -3534,14 +3575,14 @@ Next: ${nextAction}
|
|
|
3534
3575
|
}
|
|
3535
3576
|
projectApproved = parsed.yes || !hasInstallMutation;
|
|
3536
3577
|
if (interactive && hasInstallMutation) {
|
|
3537
|
-
const proceed = await
|
|
3578
|
+
const proceed = await confirm({
|
|
3538
3579
|
message: getApplyConfirmationMessage({ existingManifest: planningManifest, installIntent }),
|
|
3539
3580
|
initialValue: true,
|
|
3540
3581
|
active: "Yes",
|
|
3541
3582
|
inactive: "No",
|
|
3542
3583
|
withGuide: true
|
|
3543
3584
|
});
|
|
3544
|
-
projectApproved = !
|
|
3585
|
+
projectApproved = !isCancel(proceed) && Boolean(proceed);
|
|
3545
3586
|
}
|
|
3546
3587
|
if (!projectApproved) {
|
|
3547
3588
|
if (jsonOutput) {
|
|
@@ -3636,7 +3677,7 @@ Next: ${nextAction}
|
|
|
3636
3677
|
}
|
|
3637
3678
|
if (jsonOutput) {
|
|
3638
3679
|
writeCanonicalSetupResult({
|
|
3639
|
-
status: "complete",
|
|
3680
|
+
status: systemSetup.status === "partial" ? "partial" : "complete",
|
|
3640
3681
|
dryRun: false,
|
|
3641
3682
|
targetRoot: targetDir,
|
|
3642
3683
|
system: systemSetup,
|
|
@@ -3648,8 +3689,24 @@ Next: ${nextAction}
|
|
|
3648
3689
|
projectMutationState: projectPrerequisiteChanged || applied.mutationApplied ? "applied" : "none",
|
|
3649
3690
|
projectActions: applied.appliedActions,
|
|
3650
3691
|
failedCondition: null,
|
|
3651
|
-
nextAction: null
|
|
3692
|
+
nextAction: systemSetup.blocked[0]?.nextAction ?? null
|
|
3652
3693
|
});
|
|
3694
|
+
} else if (systemSetup.status === "partial") {
|
|
3695
|
+
output.write("Project setup: ready. MCP setup still needs manual work for these platforms:\n");
|
|
3696
|
+
for (const item of systemSetup.blocked) {
|
|
3697
|
+
output.write(`- ${item.harness}: pending. ${item.reason}
|
|
3698
|
+
`);
|
|
3699
|
+
output.write(` Next: ${item.nextAction}
|
|
3700
|
+
`);
|
|
3701
|
+
const manual = systemSetup.manualInstructions?.find((entry) => entry.harness === item.harness);
|
|
3702
|
+
if (manual) {
|
|
3703
|
+
output.write(` Add this one-time MCP entry in ${manual.path} (${manual.entryId}):
|
|
3704
|
+
`);
|
|
3705
|
+
output.write(`${manual.text}
|
|
3706
|
+
`);
|
|
3707
|
+
output.write(" The client may still block this entry by policy. Run setup again after you add it.\n");
|
|
3708
|
+
}
|
|
3709
|
+
}
|
|
3653
3710
|
}
|
|
3654
3711
|
}
|
|
3655
3712
|
async function runProjectPathHygieneCommand(argv, repair = false, launch = resolveCliOperationLaunch()) {
|
|
@@ -3825,12 +3882,14 @@ function resolveSelections(options) {
|
|
|
3825
3882
|
if (parsed.noClaudeCode) {
|
|
3826
3883
|
selections.harnesses["claude-code"] = false;
|
|
3827
3884
|
}
|
|
3885
|
+
if (parsed.noGithubCopilot) selections.harnesses["github-copilot"] = false;
|
|
3828
3886
|
if (parsed.codexMethod !== void 0) {
|
|
3829
3887
|
selections.harnesses.codex = true;
|
|
3830
3888
|
}
|
|
3831
3889
|
if (parsed.claudeCodeMethod !== void 0) {
|
|
3832
3890
|
selections.harnesses["claude-code"] = true;
|
|
3833
3891
|
}
|
|
3892
|
+
if (parsed.githubCopilotMethod !== void 0) selections.harnesses["github-copilot"] = true;
|
|
3834
3893
|
if (parsed.noSkills) {
|
|
3835
3894
|
selections.skills = false;
|
|
3836
3895
|
selections.selectedSkills = [];
|
|
@@ -3901,7 +3960,7 @@ function reconcileExistingInstallSkillSelection(options) {
|
|
|
3901
3960
|
}
|
|
3902
3961
|
function hasSelectionOverrides(parsed) {
|
|
3903
3962
|
return Boolean(
|
|
3904
|
-
parsed.noDesigns || parsed.noPlans || parsed.noPrd || parsed.noWork || parsed.noCodex || parsed.noClaudeCode || parsed.codexMethod !== void 0 || parsed.claudeCodeMethod !== void 0 || parsed.noSkills || parsed.skillsManifest || parsed.skillScope || parsed.selectedSkills !== void 0 || parsed.projectResources !== void 0
|
|
3963
|
+
parsed.noDesigns || parsed.noPlans || parsed.noPrd || parsed.noWork || parsed.noCodex || parsed.noClaudeCode || parsed.noGithubCopilot || parsed.codexMethod !== void 0 || parsed.claudeCodeMethod !== void 0 || parsed.githubCopilotMethod !== void 0 || parsed.noSkills || parsed.skillsManifest || parsed.skillScope || parsed.selectedSkills !== void 0 || parsed.projectResources !== void 0
|
|
3905
3964
|
);
|
|
3906
3965
|
}
|
|
3907
3966
|
function isLifecycleCommand(parsed) {
|
|
@@ -3911,7 +3970,7 @@ async function loadUninstallCommand() {
|
|
|
3911
3970
|
if (uninstallCommandLoaderOverride) {
|
|
3912
3971
|
return uninstallCommandLoaderOverride();
|
|
3913
3972
|
}
|
|
3914
|
-
const uninstallModule = await import("./uninstall-
|
|
3973
|
+
const uninstallModule = await import("./uninstall-45XF4CHD.js");
|
|
3915
3974
|
if (typeof uninstallModule.runUninstallCommand !== "function") {
|
|
3916
3975
|
throw new Error(
|
|
3917
3976
|
"The `uninstall` command module must export `runUninstallCommand(options)`."
|
|
@@ -3924,7 +3983,7 @@ async function runSkillsCommand(options) {
|
|
|
3924
3983
|
await skillsCommandRunnerOverride(options);
|
|
3925
3984
|
return;
|
|
3926
3985
|
}
|
|
3927
|
-
const skillsModule = await import("./skills-command-
|
|
3986
|
+
const skillsModule = await import("./skills-command-KEW7MOEW.js");
|
|
3928
3987
|
await skillsModule.runSkillsCommand(options);
|
|
3929
3988
|
}
|
|
3930
3989
|
function getSelectionOverrideFlags(parsed) {
|
|
@@ -3947,12 +4006,14 @@ function getSelectionOverrideFlags(parsed) {
|
|
|
3947
4006
|
if (parsed.noClaudeCode) {
|
|
3948
4007
|
flags.push("--no-claude-code");
|
|
3949
4008
|
}
|
|
4009
|
+
if (parsed.noGithubCopilot) flags.push("--no-github-copilot");
|
|
3950
4010
|
if (parsed.codexMethod !== void 0) {
|
|
3951
4011
|
flags.push("--codex-method");
|
|
3952
4012
|
}
|
|
3953
4013
|
if (parsed.claudeCodeMethod !== void 0) {
|
|
3954
4014
|
flags.push("--claude-code-method");
|
|
3955
4015
|
}
|
|
4016
|
+
if (parsed.githubCopilotMethod !== void 0) flags.push("--github-copilot-method");
|
|
3956
4017
|
if (parsed.genericMcpClient !== void 0) flags.push("--generic-mcp-client");
|
|
3957
4018
|
if (parsed.genericMcpAction !== void 0) flags.push("--generic-mcp-action");
|
|
3958
4019
|
if (parsed.noSkills) {
|
|
@@ -3985,6 +4046,7 @@ function parseArgs(argv) {
|
|
|
3985
4046
|
noWork: false,
|
|
3986
4047
|
noCodex: false,
|
|
3987
4048
|
noClaudeCode: false,
|
|
4049
|
+
noGithubCopilot: false,
|
|
3988
4050
|
json: false,
|
|
3989
4051
|
noSkills: false,
|
|
3990
4052
|
runArgs: []
|
|
@@ -4031,11 +4093,23 @@ function parseArgs(argv) {
|
|
|
4031
4093
|
return parsed;
|
|
4032
4094
|
}
|
|
4033
4095
|
if (parsed.command === "mcp") {
|
|
4034
|
-
|
|
4096
|
+
while (args.length > 0) {
|
|
4097
|
+
const arg = args.shift();
|
|
4035
4098
|
if (arg === "--help" || arg === "-h") {
|
|
4036
4099
|
parsed.help = true;
|
|
4037
4100
|
continue;
|
|
4038
4101
|
}
|
|
4102
|
+
if (arg === "--profile") {
|
|
4103
|
+
if (parsed.mcpProfile !== void 0) {
|
|
4104
|
+
throw new Error("--profile can be supplied only once.");
|
|
4105
|
+
}
|
|
4106
|
+
const profile = args.shift();
|
|
4107
|
+
if (profile === void 0 || profile.startsWith("-")) {
|
|
4108
|
+
throw new Error(`--profile requires a name. Allowed profiles: ${MCP_SERVER_PROFILES.join(", ")}.`);
|
|
4109
|
+
}
|
|
4110
|
+
parsed.mcpProfile = parseMcpServerProfile(profile);
|
|
4111
|
+
continue;
|
|
4112
|
+
}
|
|
4039
4113
|
throw new Error(`Unknown argument: ${arg}`);
|
|
4040
4114
|
}
|
|
4041
4115
|
return parsed;
|
|
@@ -4093,6 +4167,9 @@ function parseArgs(argv) {
|
|
|
4093
4167
|
case "--no-claude":
|
|
4094
4168
|
parsed.noClaudeCode = true;
|
|
4095
4169
|
break;
|
|
4170
|
+
case "--no-github-copilot":
|
|
4171
|
+
parsed.noGithubCopilot = true;
|
|
4172
|
+
break;
|
|
4096
4173
|
case "--codex-method": {
|
|
4097
4174
|
const value = args.shift();
|
|
4098
4175
|
if (value !== "none" && value !== "mcp" && value !== "command-rules") {
|
|
@@ -4109,6 +4186,12 @@ function parseArgs(argv) {
|
|
|
4109
4186
|
parsed.claudeCodeMethod = value;
|
|
4110
4187
|
break;
|
|
4111
4188
|
}
|
|
4189
|
+
case "--github-copilot-method": {
|
|
4190
|
+
const value = args.shift();
|
|
4191
|
+
if (value !== "none" && value !== "mcp") throw new Error("`--github-copilot-method` must be none or mcp.");
|
|
4192
|
+
parsed.githubCopilotMethod = value;
|
|
4193
|
+
break;
|
|
4194
|
+
}
|
|
4112
4195
|
case "--generic-mcp-client": {
|
|
4113
4196
|
const value = args.shift();
|
|
4114
4197
|
if (!value) throw new Error("`--generic-mcp-client` requires a stable local client label.");
|
|
@@ -4123,6 +4206,9 @@ function parseArgs(argv) {
|
|
|
4123
4206
|
parsed.genericMcpAction = value;
|
|
4124
4207
|
break;
|
|
4125
4208
|
}
|
|
4209
|
+
case "--rotate-mcp":
|
|
4210
|
+
parsed.rotateMcp = true;
|
|
4211
|
+
break;
|
|
4126
4212
|
case "--no-skills":
|
|
4127
4213
|
parsed.noSkills = true;
|
|
4128
4214
|
break;
|
|
@@ -4288,7 +4374,8 @@ function renderSystemSetupResult(result) {
|
|
|
4288
4374
|
const lines = [
|
|
4289
4375
|
`Machine setup: ${result.status}.`,
|
|
4290
4376
|
`Codex method: ${result.selections.codex}.`,
|
|
4291
|
-
`Claude Code method: ${result.selections["claude-code"]}
|
|
4377
|
+
`Claude Code method: ${result.selections["claude-code"]}.`,
|
|
4378
|
+
`GitHub Copilot method: ${result.selections["github-copilot"] ?? "none"}.`
|
|
4292
4379
|
];
|
|
4293
4380
|
for (const blocked of result.blocked) {
|
|
4294
4381
|
lines.push(`${blocked.harness}: ${blocked.reason}`);
|
|
@@ -4316,7 +4403,7 @@ function storePrerequisiteFailureAction(error) {
|
|
|
4316
4403
|
return "Correct the reported Store prerequisite, then run `make-docs setup` again to review a new exact bridge plan.";
|
|
4317
4404
|
}
|
|
4318
4405
|
function writeCanonicalSetupResult(input2) {
|
|
4319
|
-
const selections = input2.system?.selections ?? input2.prepared?.selections ?? { codex: "none", "claude-code": "none" };
|
|
4406
|
+
const selections = input2.system?.selections ?? input2.prepared?.selections ?? { codex: "none", "claude-code": "none", "github-copilot": "none" };
|
|
4320
4407
|
const plans = input2.prepared?.plans ?? [];
|
|
4321
4408
|
output.write(`${JSON.stringify({
|
|
4322
4409
|
schemaVersion: 2,
|
|
@@ -4326,16 +4413,31 @@ function writeCanonicalSetupResult(input2) {
|
|
|
4326
4413
|
targetRoot: input2.targetRoot,
|
|
4327
4414
|
machine: {
|
|
4328
4415
|
selections,
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
state: plan.status
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4416
|
+
projectMayProceed: input2.system?.projectMayProceed ?? null,
|
|
4417
|
+
states: plans.map((plan) => {
|
|
4418
|
+
const pending = input2.status === "partial" && input2.system?.projectMayProceed === true && !input2.system.recoveryAction && input2.system.blocked.some((item) => item.harness === plan.harness);
|
|
4419
|
+
const state = input2.system?.configured.includes(plan.harness) ? "current" : pending ? "pending" : plan.status;
|
|
4420
|
+
return {
|
|
4421
|
+
harness: plan.harness,
|
|
4422
|
+
method: plan.method,
|
|
4423
|
+
state,
|
|
4424
|
+
...plan.harness === "github-copilot" ? { clients: [
|
|
4425
|
+
{ client: "cli", state },
|
|
4426
|
+
{ client: "app", state: "blocked", nextAction: "Open a real app session and verify the effective Make Docs entry. App-installed entries are user-owned." }
|
|
4427
|
+
] } : {},
|
|
4428
|
+
attemptedWork: [...plan.operations],
|
|
4429
|
+
mutationState: input2.system ? input2.system.configured.includes(plan.harness) && plan.changed ? "applied" : input2.system.manualInstructions?.some((item) => item.harness === plan.harness) ? "partial" : input2.system.recoveryAction && plan.pendingOperation?.() ? "partial" : "none" : plan.changed ? input2.dryRun ? "planned" : "none" : "none",
|
|
4430
|
+
detail: plan.detail,
|
|
4431
|
+
...input2.system?.blocked.find((item) => item.harness === plan.harness) ? {
|
|
4432
|
+
nextAction: input2.system.blocked.find((item) => item.harness === plan.harness).nextAction
|
|
4433
|
+
} : {}
|
|
4434
|
+
};
|
|
4435
|
+
}),
|
|
4337
4436
|
configured: input2.system?.configured ?? [],
|
|
4338
|
-
...input2.genericMcp ? { genericMcp:
|
|
4437
|
+
...input2.genericMcp ? { genericMcp: {
|
|
4438
|
+
...input2.genericMcp,
|
|
4439
|
+
configuration: input2.genericMcp.configuration ? redactMcpNativeValue(input2.genericMcp.configuration) : null
|
|
4440
|
+
} } : {}
|
|
4339
4441
|
},
|
|
4340
4442
|
store: input2.storeBridge ? {
|
|
4341
4443
|
state: input2.storeBridge.storeState,
|
|
@@ -4349,6 +4451,7 @@ function writeCanonicalSetupResult(input2) {
|
|
|
4349
4451
|
} : null,
|
|
4350
4452
|
projectRecovery: input2.projectRecovery ?? null,
|
|
4351
4453
|
project: {
|
|
4454
|
+
state: input2.status === "complete" || input2.status === "partial" ? "ready" : input2.status,
|
|
4352
4455
|
changed: input2.projectChanged,
|
|
4353
4456
|
mutationState: input2.projectMutationState ?? (input2.projectChanged ? input2.dryRun ? "planned" : "applied" : "none"),
|
|
4354
4457
|
actions: [...input2.projectActions].sort((left, right) => left.relativePath.localeCompare(right.relativePath)).map((action) => ({ path: action.relativePath, action: action.type }))
|
|
@@ -4359,13 +4462,19 @@ function writeCanonicalSetupResult(input2) {
|
|
|
4359
4462
|
`);
|
|
4360
4463
|
}
|
|
4361
4464
|
function validateParsedArgs(parsed) {
|
|
4465
|
+
if (parsed.rotateMcp && (parsed.command !== "setup" || parsed.setupSubcommand !== "system")) {
|
|
4466
|
+
throw new Error("`--rotate-mcp` is valid only with `make-docs setup system`.");
|
|
4467
|
+
}
|
|
4362
4468
|
if (parsed.codexMethod !== void 0 && parsed.noCodex) {
|
|
4363
4469
|
throw new Error("`--codex-method` cannot be combined with `--no-codex`.");
|
|
4364
4470
|
}
|
|
4365
4471
|
if (parsed.claudeCodeMethod !== void 0 && parsed.noClaudeCode) {
|
|
4366
4472
|
throw new Error("`--claude-code-method` cannot be combined with `--no-claude-code`.");
|
|
4367
4473
|
}
|
|
4368
|
-
if (
|
|
4474
|
+
if (parsed.githubCopilotMethod !== void 0 && parsed.noGithubCopilot) {
|
|
4475
|
+
throw new Error("`--github-copilot-method` cannot be combined with `--no-github-copilot`.");
|
|
4476
|
+
}
|
|
4477
|
+
if ((parsed.codexMethod !== void 0 || parsed.claudeCodeMethod !== void 0 || parsed.githubCopilotMethod !== void 0 || parsed.genericMcpClient !== void 0 || parsed.genericMcpAction !== void 0) && (parsed.command !== "setup" || ["skills", "backup", "remove"].includes(parsed.setupSubcommand ?? ""))) {
|
|
4369
4478
|
throw new Error("Harness and generic MCP flags are valid only with setup, setup reconfigure, or setup system.");
|
|
4370
4479
|
}
|
|
4371
4480
|
if (parsed.json && (parsed.command !== "setup" || ["skills", "backup", "remove"].includes(parsed.setupSubcommand ?? ""))) {
|
|
@@ -4496,7 +4605,7 @@ function printPlan(options) {
|
|
|
4496
4605
|
const counts = countActions(actions);
|
|
4497
4606
|
const mode = describeApplyMode({ existingManifest, installIntent });
|
|
4498
4607
|
const labels = getConfigRenderingLabels(config);
|
|
4499
|
-
|
|
4608
|
+
note(
|
|
4500
4609
|
[
|
|
4501
4610
|
`Target: ${targetDir}`,
|
|
4502
4611
|
`Mode: ${mode}`,
|
|
@@ -4531,7 +4640,7 @@ function printPlan(options) {
|
|
|
4531
4640
|
renderNoopExplanation({ dryRun, existingManifest });
|
|
4532
4641
|
return;
|
|
4533
4642
|
}
|
|
4534
|
-
|
|
4643
|
+
note(renderedActions.map(formatActionLine).join("\n"), "Planned file operations");
|
|
4535
4644
|
}
|
|
4536
4645
|
function countActions(actions) {
|
|
4537
4646
|
return {
|
|
@@ -4604,7 +4713,7 @@ function guardCompatibilityDisposition(options) {
|
|
|
4604
4713
|
break;
|
|
4605
4714
|
case "migrate-with-review":
|
|
4606
4715
|
if (interactive) {
|
|
4607
|
-
|
|
4716
|
+
note(
|
|
4608
4717
|
buildCompatibilitySummaryLines(classification).join("\n"),
|
|
4609
4718
|
"Compatibility review required"
|
|
4610
4719
|
);
|
|
@@ -4692,7 +4801,7 @@ function renderNoopExplanation(options) {
|
|
|
4692
4801
|
"- Run `make-docs setup skills` to change managed skills.",
|
|
4693
4802
|
"- Run `make-docs --dry-run` after upgrading make-docs to preview future changes."
|
|
4694
4803
|
);
|
|
4695
|
-
|
|
4804
|
+
note(lines.join("\n"), "Results");
|
|
4696
4805
|
}
|
|
4697
4806
|
function getRenderedActions(actions) {
|
|
4698
4807
|
return actions.filter((action) => getRenderedActionKind(action) !== null).sort(compareRenderedActions);
|
|
@@ -4777,11 +4886,13 @@ var SETUP_SHARED_OPTIONS = `General options:
|
|
|
4777
4886
|
Harness options:
|
|
4778
4887
|
--codex-method <none|mcp|command-rules>
|
|
4779
4888
|
--claude-code-method <none|mcp|permission-rules>
|
|
4889
|
+
--github-copilot-method <none|mcp>
|
|
4780
4890
|
--generic-mcp-client <label> Add one bounded generic MCP client profile.
|
|
4781
4891
|
--generic-mcp-action <configure|rotate|repair|remove>
|
|
4782
4892
|
Choose its repeat-safe lifecycle action.
|
|
4783
4893
|
--no-codex Skip the Codex harness.
|
|
4784
4894
|
--no-claude-code Skip the Claude Code harness.
|
|
4895
|
+
--no-github-copilot Skip the GitHub Copilot CLI harness.
|
|
4785
4896
|
Deprecated aliases: --no-agents, --no-claude
|
|
4786
4897
|
|
|
4787
4898
|
Skill options:
|
|
@@ -4813,11 +4924,13 @@ Content options:
|
|
|
4813
4924
|
Harness options:
|
|
4814
4925
|
--codex-method <none|mcp|command-rules>
|
|
4815
4926
|
--claude-code-method <none|mcp|permission-rules>
|
|
4927
|
+
--github-copilot-method <none|mcp>
|
|
4816
4928
|
--generic-mcp-client <label> Add one bounded generic MCP client profile.
|
|
4817
4929
|
--generic-mcp-action <configure|rotate|repair|remove>
|
|
4818
4930
|
Choose its repeat-safe lifecycle action.
|
|
4819
4931
|
--no-codex Skip the Codex harness.
|
|
4820
4932
|
--no-claude-code Skip the Claude Code harness.
|
|
4933
|
+
--no-github-copilot Skip the GitHub Copilot CLI harness.
|
|
4821
4934
|
Deprecated aliases: --no-agents, --no-claude
|
|
4822
4935
|
|
|
4823
4936
|
Skill selections:
|
|
@@ -4833,7 +4946,7 @@ function printHelp(command, setupSubcommand) {
|
|
|
4833
4946
|
case "system":
|
|
4834
4947
|
output.write(`make-docs setup system
|
|
4835
4948
|
|
|
4836
|
-
Review and configure machine-level support for Codex and
|
|
4949
|
+
Review and configure machine-level support for Codex, Claude Code, and GitHub Copilot CLI.
|
|
4837
4950
|
Harness detection is a hint. It does not prove support and does not limit choice.
|
|
4838
4951
|
Each planned method names the operations it enables and the machine files it changes.
|
|
4839
4952
|
|
|
@@ -4847,15 +4960,19 @@ Options:
|
|
|
4847
4960
|
--json Emit only the canonical setup result JSON.
|
|
4848
4961
|
--codex-method <none|mcp|command-rules>
|
|
4849
4962
|
--claude-code-method <none|mcp|permission-rules>
|
|
4963
|
+
--github-copilot-method <none|mcp>
|
|
4850
4964
|
--generic-mcp-client <label> Print a bounded client-owned MCP configuration.
|
|
4851
4965
|
--generic-mcp-action <configure|rotate|repair|remove>
|
|
4852
4966
|
--no-codex Skip Codex support.
|
|
4853
4967
|
--no-claude-code Skip Claude Code support.
|
|
4968
|
+
--no-github-copilot Skip GitHub Copilot CLI support.
|
|
4969
|
+
--rotate-mcp Replace keys for selected first-party MCP methods.
|
|
4854
4970
|
--help, -h Show help for this command.
|
|
4855
4971
|
|
|
4856
4972
|
Examples:
|
|
4857
4973
|
make-docs setup system --codex-method mcp --claude-code-method none --dry-run
|
|
4858
4974
|
make-docs setup system --codex-method command-rules --no-claude-code --yes
|
|
4975
|
+
make-docs setup system --github-copilot-method mcp --no-codex --no-claude-code --dry-run
|
|
4859
4976
|
`);
|
|
4860
4977
|
return;
|
|
4861
4978
|
case "reconfigure":
|
|
@@ -5082,14 +5199,29 @@ Examples:
|
|
|
5082
5199
|
Run the TypeScript-owned make-docs MCP server over stdio.
|
|
5083
5200
|
|
|
5084
5201
|
Usage:
|
|
5085
|
-
make-docs mcp [--help]
|
|
5202
|
+
make-docs mcp [--profile <name>] [--help]
|
|
5203
|
+
|
|
5204
|
+
Options:
|
|
5205
|
+
--profile <name> Choose tools and native resources for one task. Default: all.
|
|
5206
|
+
--help, -h Show help for this command.
|
|
5207
|
+
|
|
5208
|
+
Profiles:
|
|
5209
|
+
core Installed state, config, common resource tools, and operation domains.
|
|
5210
|
+
setup Install plans, repair, compatibility, and layout.
|
|
5211
|
+
workflow Lifecycle, project context, and work evidence.
|
|
5212
|
+
quality Requirements, performance evidence, and user test checks.
|
|
5213
|
+
backlog Backlog snapshots and the review cache.
|
|
5214
|
+
all All ready tools and native resources.
|
|
5086
5215
|
|
|
5087
5216
|
Behavior:
|
|
5217
|
+
The default all profile keeps the existing single-server connection working.
|
|
5218
|
+
Native resource lists and reads use the selected profile.
|
|
5088
5219
|
The MCP server exposes read-first and plan-first tools for installed-state inspection, manifest/config reads, compatibility classification, dry-run install planning, and deterministic registry operations.
|
|
5089
5220
|
MCP tools delegate to the same operation registry and core used by \`make-docs run\`; write operations require allowWrite=true, enforced uniformly by the operation core.
|
|
5090
5221
|
|
|
5091
5222
|
Examples:
|
|
5092
5223
|
make-docs mcp
|
|
5224
|
+
make-docs mcp --profile backlog
|
|
5093
5225
|
`);
|
|
5094
5226
|
return;
|
|
5095
5227
|
case "update":
|