@brucewaynedecoy/make-docs 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{backup-2OT4A6LR.js → backup-M5RBOM6F.js} +4 -4
- package/dist/{chunk-VMKG3H4B.js → chunk-3ZFX5456.js} +2 -2
- package/dist/{chunk-46MGH32G.js → chunk-5WR4D6HH.js} +2 -2
- package/dist/{chunk-UNR4CYVX.js → chunk-65TAUWTC.js} +3 -3
- package/dist/{chunk-I4FADOUK.js → chunk-7AVGITZK.js} +2 -2
- package/dist/{chunk-CLSOY7NV.js → chunk-B6HJRHWL.js} +179 -103
- package/dist/chunk-B6HJRHWL.js.map +1 -0
- package/dist/{chunk-HXWD2EUD.js → chunk-C67WJWVP.js} +278 -74
- package/dist/chunk-C67WJWVP.js.map +1 -0
- package/dist/{chunk-CCYP5NU2.js → chunk-O27AYYF3.js} +3 -3
- package/dist/{chunk-XDSWX4Y4.js → chunk-OSS4NT6N.js} +88 -8
- package/dist/chunk-OSS4NT6N.js.map +1 -0
- package/dist/{chunk-CMNKQM7L.js → chunk-YJLVHT4J.js} +3 -3
- package/dist/{chunk-ISSMVKIA.js → chunk-Z4KZ4JTE.js} +2 -2
- package/dist/index.js +397 -36
- package/dist/index.js.map +1 -1
- package/dist/{registry-PC5GKAKM.js → registry-7L26WFZP.js} +7 -7
- package/dist/{self-WYVXO23B.js → self-4HOKEXBV.js} +7 -7
- package/dist/{server-BQOG6FTA.js → server-VXVGDWRY.js} +13 -9
- package/dist/server-VXVGDWRY.js.map +1 -0
- package/dist/{setup-system-KN7FTTLT.js → setup-system-CJESBAQ5.js} +7 -7
- package/dist/{skills-command-KEW7MOEW.js → skills-command-YXPOHXI2.js} +6 -6
- package/dist/{uninstall-45XF4CHD.js → uninstall-R2QK7XPK.js} +7 -7
- package/dist/{virtual_make-docs-first-party-skills-ECJESFL2.js → virtual_make-docs-first-party-skills-POWW3OI3.js} +2 -2
- package/dist/{virtual_make-docs-first-party-skills-ECJESFL2.js.map → virtual_make-docs-first-party-skills-POWW3OI3.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-CLSOY7NV.js.map +0 -1
- package/dist/chunk-HXWD2EUD.js.map +0 -1
- package/dist/chunk-XDSWX4Y4.js.map +0 -1
- package/dist/server-BQOG6FTA.js.map +0 -1
- /package/dist/{backup-2OT4A6LR.js.map → backup-M5RBOM6F.js.map} +0 -0
- /package/dist/{chunk-VMKG3H4B.js.map → chunk-3ZFX5456.js.map} +0 -0
- /package/dist/{chunk-46MGH32G.js.map → chunk-5WR4D6HH.js.map} +0 -0
- /package/dist/{chunk-UNR4CYVX.js.map → chunk-65TAUWTC.js.map} +0 -0
- /package/dist/{chunk-I4FADOUK.js.map → chunk-7AVGITZK.js.map} +0 -0
- /package/dist/{chunk-CCYP5NU2.js.map → chunk-O27AYYF3.js.map} +0 -0
- /package/dist/{chunk-CMNKQM7L.js.map → chunk-YJLVHT4J.js.map} +0 -0
- /package/dist/{chunk-ISSMVKIA.js.map → chunk-Z4KZ4JTE.js.map} +0 -0
- /package/dist/{registry-PC5GKAKM.js.map → registry-7L26WFZP.js.map} +0 -0
- /package/dist/{self-WYVXO23B.js.map → self-4HOKEXBV.js.map} +0 -0
- /package/dist/{setup-system-KN7FTTLT.js.map → setup-system-CJESBAQ5.js.map} +0 -0
- /package/dist/{skills-command-KEW7MOEW.js.map → skills-command-YXPOHXI2.js.map} +0 -0
- /package/dist/{uninstall-45XF4CHD.js.map → uninstall-R2QK7XPK.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
COMPLETE_PROJECT_CAPABILITIES,
|
|
4
4
|
describeHarnessSupport,
|
|
5
5
|
resolveUnifiedSetupState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7AVGITZK.js";
|
|
7
7
|
import {
|
|
8
8
|
classifyCompatibilityState,
|
|
9
9
|
formatCompatibilityClassification,
|
|
10
10
|
importLegacyInstallationState,
|
|
11
11
|
previewLegacyInstallationState,
|
|
12
12
|
scopeCompatibilityToInstallPlan
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YJLVHT4J.js";
|
|
14
14
|
import {
|
|
15
15
|
Checkpoint9ReceiptProjectionError,
|
|
16
16
|
MigrationSafetyError,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
operationCliProjection,
|
|
27
27
|
resolveCliOperationLaunch,
|
|
28
28
|
serializeOperationError
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-OSS4NT6N.js";
|
|
30
30
|
import {
|
|
31
31
|
MCP_SERVER_PROFILES,
|
|
32
32
|
applyInstallPlan,
|
|
@@ -34,17 +34,18 @@ import {
|
|
|
34
34
|
findReviewableManagedFileConflicts,
|
|
35
35
|
getConfigRenderingLabels,
|
|
36
36
|
getDocumentKindLabel,
|
|
37
|
+
inferLocalResourceProjection,
|
|
37
38
|
loadMakeDocsConfigOrThrow,
|
|
38
39
|
parseMcpServerProfile,
|
|
39
40
|
planInstall,
|
|
40
41
|
planProjectHarnessIntegrationWrite,
|
|
41
42
|
registerSkillAdoptionRecovery
|
|
42
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-B6HJRHWL.js";
|
|
43
44
|
import {
|
|
44
45
|
runBackupCommand
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
46
|
+
} from "./chunk-O27AYYF3.js";
|
|
47
|
+
import "./chunk-5WR4D6HH.js";
|
|
48
|
+
import "./chunk-3ZFX5456.js";
|
|
48
49
|
import {
|
|
49
50
|
S_BAR,
|
|
50
51
|
S_BAR_END,
|
|
@@ -68,7 +69,7 @@ import {
|
|
|
68
69
|
previewStoreCompatibilityBridge,
|
|
69
70
|
resolveProjectIdentity,
|
|
70
71
|
writeGlobalConfig
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-65TAUWTC.js";
|
|
72
73
|
import {
|
|
73
74
|
HARNESS_CALLER_IDENTITY_ARG,
|
|
74
75
|
HARNESS_CALLER_IDENTITY_ENV,
|
|
@@ -83,13 +84,14 @@ import {
|
|
|
83
84
|
redactMcpNativeValue,
|
|
84
85
|
sha256,
|
|
85
86
|
verifyMakeDocsExecutable
|
|
86
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-Z4KZ4JTE.js";
|
|
87
88
|
import {
|
|
88
89
|
CAPABILITIES,
|
|
89
90
|
CAPABILITY_DEPENDENCIES,
|
|
90
91
|
HARNESSES,
|
|
91
92
|
PACKAGE_ROOT,
|
|
92
93
|
PROJECT_RESOURCE_TYPES,
|
|
94
|
+
applyInstallationCheckoutMove,
|
|
93
95
|
applySkillRegistrySelectionMetadata,
|
|
94
96
|
classifyStoreCheckpoint9State,
|
|
95
97
|
cloneSelections,
|
|
@@ -103,6 +105,8 @@ import {
|
|
|
103
105
|
loadEffectiveSkillRegistry,
|
|
104
106
|
loadManifest,
|
|
105
107
|
loadSqliteDriver,
|
|
108
|
+
previewInstallationCheckoutMove,
|
|
109
|
+
readDeclarativeProjectId,
|
|
106
110
|
readInstallationStatus,
|
|
107
111
|
readPackageMeta,
|
|
108
112
|
recoverInstallationOperation,
|
|
@@ -112,7 +116,7 @@ import {
|
|
|
112
116
|
validateAndMigrateManifest,
|
|
113
117
|
withStoreDatabase,
|
|
114
118
|
writeTextFile
|
|
115
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-C67WJWVP.js";
|
|
116
120
|
import "./chunk-D4HDZEJT.js";
|
|
117
121
|
|
|
118
122
|
// src/cli.ts
|
|
@@ -897,6 +901,14 @@ async function runResourceCommand(argv, launch = resolveCliOperationLaunch()) {
|
|
|
897
901
|
printJson2(invocation.value);
|
|
898
902
|
}
|
|
899
903
|
async function runProjectCommand(argv, launch = resolveCliOperationLaunch()) {
|
|
904
|
+
if (argv[0] === "checkout-move") {
|
|
905
|
+
await runProjectCheckoutMoveCommand(argv.slice(1), launch);
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
if (argv[0] === "checkout-register") {
|
|
909
|
+
await runProjectCheckoutRegisterCommand(argv.slice(1), launch);
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
900
912
|
if (argv[0] === "layout" || argv[0] === "persona") {
|
|
901
913
|
await runProjectLayoutCommand(argv, launch);
|
|
902
914
|
return;
|
|
@@ -915,6 +927,9 @@ async function runProjectCommand(argv, launch = resolveCliOperationLaunch()) {
|
|
|
915
927
|
" make-docs project layout apply|verify <operation-id> [--target-root <path>] [--json]",
|
|
916
928
|
" make-docs project state status [--target-root <path>] [--json]",
|
|
917
929
|
" make-docs project state recover <operation-id> --resume|--rollback [--dry-run] [--target-root <path>] [--json]",
|
|
930
|
+
" make-docs project checkout-move preview [--source-checkout <id>] [--target-root <path>] [--json]",
|
|
931
|
+
" make-docs project checkout-move apply --source-checkout <id> --source-root <path> --review <digest> [--target-root <path>] [--json]",
|
|
932
|
+
" make-docs project checkout-register preview|apply [--review <digest>] [--target-root <path>] [--json]",
|
|
918
933
|
"",
|
|
919
934
|
"Installation state belongs to the global Make Docs Store.",
|
|
920
935
|
"The ensure command checks Store installation evidence and configured routers",
|
|
@@ -991,6 +1006,122 @@ async function runProjectCommand(argv, launch = resolveCliOperationLaunch()) {
|
|
|
991
1006
|
].join("\n")
|
|
992
1007
|
);
|
|
993
1008
|
}
|
|
1009
|
+
async function runProjectCheckoutRegisterCommand(argv, launch) {
|
|
1010
|
+
const [verb, ...args] = argv;
|
|
1011
|
+
if (!verb || verb === "--help" || verb === "-h") {
|
|
1012
|
+
process.stdout.write("Usage: make-docs project checkout-register preview [--target-root <path>] [--json]\n make-docs project checkout-register apply --review <digest> [--target-root <path>] [--json]\nThis makes a new checkout ID. It leaves other checkout IDs and pending work in place.\n");
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
if (verb !== "preview" && verb !== "apply") throw new OperationError(`Unknown checkout-register action: ${verb}.`);
|
|
1016
|
+
let targetRoot, reviewDigest, json = false;
|
|
1017
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1018
|
+
while (args.length) {
|
|
1019
|
+
const flag = args.shift();
|
|
1020
|
+
if (seen.has(flag)) throw new OperationError(`Option ${flag} can be given only once.`);
|
|
1021
|
+
seen.add(flag);
|
|
1022
|
+
if (flag === "--target-root" || flag === "--review") {
|
|
1023
|
+
const value = args.shift();
|
|
1024
|
+
if (!value || value.startsWith("--")) throw new OperationError(`${flag} requires a value.`);
|
|
1025
|
+
if (flag === "--target-root") targetRoot = path2.resolve(value);
|
|
1026
|
+
else if (verb === "apply") reviewDigest = value;
|
|
1027
|
+
else throw new OperationError("--review is valid only with checkout-register apply.");
|
|
1028
|
+
} else if (flag === "--json") json = true;
|
|
1029
|
+
else throw new OperationError(`Unexpected checkout-register option: ${flag}.`);
|
|
1030
|
+
}
|
|
1031
|
+
if (verb === "apply" && !reviewDigest) throw new OperationError("Checkout registration requires --review from one preview.");
|
|
1032
|
+
const invocation = await invokeOperation(`project.checkout-register.${verb}`, {
|
|
1033
|
+
...targetRoot ? { targetRoot } : {},
|
|
1034
|
+
...reviewDigest ? { reviewDigest } : {}
|
|
1035
|
+
}, createExecutionContext({
|
|
1036
|
+
surface: "cli",
|
|
1037
|
+
route: launch.route,
|
|
1038
|
+
callerIdentityRaw: launch.callerIdentityRaw,
|
|
1039
|
+
callerReference: launch.callerReference,
|
|
1040
|
+
cwd: targetRoot,
|
|
1041
|
+
writesAllowed: verb === "apply"
|
|
1042
|
+
}));
|
|
1043
|
+
const result = invocation.value;
|
|
1044
|
+
if (json) {
|
|
1045
|
+
printJson2(result);
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
process.stdout.write([
|
|
1049
|
+
`Checkout registration: ${result.status}`,
|
|
1050
|
+
`Target: ${result.targetRoot}`,
|
|
1051
|
+
...result.projectId ? [`Project ID: ${result.projectId}`] : [],
|
|
1052
|
+
...result.checkoutId ? [`New checkout ID: ${result.checkoutId}`] : [],
|
|
1053
|
+
...result.effect ? [`Effect: ${result.effect}`] : [],
|
|
1054
|
+
...result.projectFilesChanged === false ? ["Project files: unchanged"] : [],
|
|
1055
|
+
...result.separateReviewDigest ? [`Review: ${result.separateReviewDigest}`] : [],
|
|
1056
|
+
...result.nextAction ? [`Next: ${result.nextAction}`] : [],
|
|
1057
|
+
""
|
|
1058
|
+
].join("\n"));
|
|
1059
|
+
}
|
|
1060
|
+
async function runProjectCheckoutMoveCommand(argv, launch) {
|
|
1061
|
+
const [verb, ...args] = argv;
|
|
1062
|
+
if (!verb || verb === "--help" || verb === "-h") {
|
|
1063
|
+
process.stdout.write("Usage: make-docs project checkout-move preview [--source-checkout <id>] [--target-root <path>] [--json]\n make-docs project checkout-move apply --source-checkout <id> --source-root <path> --review <digest> [--target-root <path>] [--json]\nPreview is read only. Apply changes one Store checkout path after exact review.\n");
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
if (verb !== "preview" && verb !== "apply") throw new OperationError(`Unknown checkout-move action: ${verb}.`);
|
|
1067
|
+
let targetRoot, sourceCheckoutId, sourceRoot, reviewDigest;
|
|
1068
|
+
let json = false, dryRun = false;
|
|
1069
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1070
|
+
while (args.length) {
|
|
1071
|
+
const flag = args.shift();
|
|
1072
|
+
if (seen.has(flag)) throw new OperationError(`Option ${flag} can be given only once.`);
|
|
1073
|
+
seen.add(flag);
|
|
1074
|
+
const value = () => {
|
|
1075
|
+
const next = args.shift();
|
|
1076
|
+
if (!next || next.startsWith("--")) throw new OperationError(`${flag} requires a value.`);
|
|
1077
|
+
return next;
|
|
1078
|
+
};
|
|
1079
|
+
if (flag === "--target-root") targetRoot = path2.resolve(value());
|
|
1080
|
+
else if (flag === "--source-checkout") sourceCheckoutId = value();
|
|
1081
|
+
else if (flag === "--source-root" && verb === "apply") sourceRoot = path2.resolve(value());
|
|
1082
|
+
else if (flag === "--review" && verb === "apply") reviewDigest = value();
|
|
1083
|
+
else if (flag === "--json") json = true;
|
|
1084
|
+
else if (flag === "--dry-run" && verb === "apply") dryRun = true;
|
|
1085
|
+
else throw new OperationError(`Unexpected checkout-move option: ${flag}.`);
|
|
1086
|
+
}
|
|
1087
|
+
if (verb === "apply" && (!sourceCheckoutId || !sourceRoot || !reviewDigest)) throw new OperationError("Apply requires --source-checkout, --source-root, and --review from one preview.");
|
|
1088
|
+
const invocation = await invokeOperation(`project.checkout-move.${verb}`, {
|
|
1089
|
+
...targetRoot ? { targetRoot } : {},
|
|
1090
|
+
...sourceCheckoutId ? { sourceCheckoutId } : {},
|
|
1091
|
+
...sourceRoot ? { sourceRoot } : {},
|
|
1092
|
+
...reviewDigest ? { reviewDigest } : {}
|
|
1093
|
+
}, createExecutionContext({
|
|
1094
|
+
surface: "cli",
|
|
1095
|
+
route: launch.route,
|
|
1096
|
+
callerIdentityRaw: launch.callerIdentityRaw,
|
|
1097
|
+
callerReference: launch.callerReference,
|
|
1098
|
+
cwd: targetRoot,
|
|
1099
|
+
writesAllowed: verb === "apply",
|
|
1100
|
+
dryRun
|
|
1101
|
+
}));
|
|
1102
|
+
const result = invocation.value;
|
|
1103
|
+
if (json) {
|
|
1104
|
+
printJson2(result);
|
|
1105
|
+
return;
|
|
1106
|
+
}
|
|
1107
|
+
process.stdout.write([
|
|
1108
|
+
`Checkout move: ${result.status}`,
|
|
1109
|
+
`Target: ${result.targetRoot}`,
|
|
1110
|
+
...result.projectId ? [`Project ID: ${result.projectId}`] : [],
|
|
1111
|
+
...result.checkoutId ? [`Checkout ID: ${result.checkoutId}`] : [],
|
|
1112
|
+
...result.sourceRoot ? [`Source: ${result.sourceRoot}`] : [],
|
|
1113
|
+
...result.effect ? [`Effect: ${result.effect}`] : [],
|
|
1114
|
+
...result.projectFilesChanged === false ? ["Project files: unchanged"] : [],
|
|
1115
|
+
...(result.candidates ?? []).flatMap((candidate) => [
|
|
1116
|
+
`Source: ${candidate.sourceRoot} (${candidate.checkoutId})`,
|
|
1117
|
+
`Available: ${candidate.available ? "yes" : "no"}`,
|
|
1118
|
+
...candidate.reviewDigest ? [`Review: ${candidate.reviewDigest}`] : [],
|
|
1119
|
+
...candidate.blockers.map((blocker) => `Blocker: ${blocker}`)
|
|
1120
|
+
]),
|
|
1121
|
+
...result.nextAction ? [`Next: ${result.nextAction}`] : [],
|
|
1122
|
+
""
|
|
1123
|
+
].join("\n"));
|
|
1124
|
+
}
|
|
994
1125
|
async function runProjectLayoutCommand(argv, launch) {
|
|
995
1126
|
const [noun, verb, ...args] = argv;
|
|
996
1127
|
if (!verb || verb === "--help" || verb === "-h") {
|
|
@@ -2562,12 +2693,12 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2562
2693
|
return;
|
|
2563
2694
|
}
|
|
2564
2695
|
if (parsed.command === "mcp") {
|
|
2565
|
-
const { runMcpServer } = await import("./server-
|
|
2696
|
+
const { runMcpServer } = await import("./server-VXVGDWRY.js");
|
|
2566
2697
|
await runMcpServer({ profile: parsed.mcpProfile ?? "all" });
|
|
2567
2698
|
return;
|
|
2568
2699
|
}
|
|
2569
2700
|
if (parsed.command === "update") {
|
|
2570
|
-
const { runToolUpdateCommand } = await import("./self-
|
|
2701
|
+
const { runToolUpdateCommand } = await import("./self-4HOKEXBV.js");
|
|
2571
2702
|
await runToolUpdateCommand({
|
|
2572
2703
|
yes: parsed.yes,
|
|
2573
2704
|
...parsed.targetDir ? { targetDir: path4.resolve(parsed.targetDir) } : {}
|
|
@@ -2575,13 +2706,13 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2575
2706
|
return;
|
|
2576
2707
|
}
|
|
2577
2708
|
if (parsed.command === "uninstall") {
|
|
2578
|
-
const { runToolUninstallCommand } = await import("./self-
|
|
2709
|
+
const { runToolUninstallCommand } = await import("./self-4HOKEXBV.js");
|
|
2579
2710
|
await runToolUninstallCommand({ yes: parsed.yes, removeStore: parsed.removeStore });
|
|
2580
2711
|
return;
|
|
2581
2712
|
}
|
|
2582
2713
|
validateParsedArgs(parsed);
|
|
2583
2714
|
if (parsed.setupSubcommand === "system") {
|
|
2584
|
-
const { runSystemSetupCommand } = await import("./setup-system-
|
|
2715
|
+
const { runSystemSetupCommand } = await import("./setup-system-CJESBAQ5.js");
|
|
2585
2716
|
const result = await runSystemSetupCommand({
|
|
2586
2717
|
dryRun: parsed.dryRun,
|
|
2587
2718
|
yes: parsed.yes,
|
|
@@ -2671,7 +2802,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2671
2802
|
return;
|
|
2672
2803
|
}
|
|
2673
2804
|
const jsonOutput = parsed.json || !output.isTTY;
|
|
2674
|
-
const interactive = !parsed.yes && !parsed.
|
|
2805
|
+
const interactive = !parsed.yes && !parsed.json && Boolean(input.isTTY && output.isTTY);
|
|
2675
2806
|
const recoveredProjectChanged = priorProjectMutationApplied || priorProjectRecovery !== null;
|
|
2676
2807
|
if (parsed.command === void 0) {
|
|
2677
2808
|
const bareClassification = await classifyCompatibilityState({ targetDir });
|
|
@@ -2703,6 +2834,114 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2703
2834
|
`Store compatibility preview stopped setup: ${storeBridgePreview.blockers.join("; ")} ${storeBridgePreview.nextAction}`
|
|
2704
2835
|
);
|
|
2705
2836
|
}
|
|
2837
|
+
const checkoutMove = previewInstallationCheckoutMove(targetDir, void 0, storeRoot);
|
|
2838
|
+
if (parsed.command === "setup" && parsed.setupSubcommand === void 0 && !parsed.adopt && checkoutMove.status === "portable-unregistered" && !existsSync2(path4.join(targetDir, ".make-docs/manifest.json"))) {
|
|
2839
|
+
const nextAction = "Run `make-docs setup --adopt --yes` to register this checkout, or run interactive `make-docs setup` to choose a path.";
|
|
2840
|
+
if (!interactive) {
|
|
2841
|
+
if (jsonOutput) writeCanonicalSetupResult({
|
|
2842
|
+
status: "blocked",
|
|
2843
|
+
dryRun: parsed.dryRun,
|
|
2844
|
+
targetRoot: targetDir,
|
|
2845
|
+
storeBridge: storeBridgePreview,
|
|
2846
|
+
checkoutMove,
|
|
2847
|
+
storeMutationState: "none",
|
|
2848
|
+
projectChanged: false,
|
|
2849
|
+
projectMutationState: "none",
|
|
2850
|
+
projectActions: [],
|
|
2851
|
+
failedCondition: "This checkout has a project ID but no installed record in this Store. Choose adoption or normal setup before any write.",
|
|
2852
|
+
nextAction
|
|
2853
|
+
});
|
|
2854
|
+
else output.write(`Setup stopped before any write. ${nextAction}
|
|
2855
|
+
`);
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2858
|
+
const choice = await select({
|
|
2859
|
+
message: "This checkout has a project ID but no installed record in this Store. How should setup continue?",
|
|
2860
|
+
options: [
|
|
2861
|
+
{ value: "adopt", label: "Adopt this checkout", hint: "Keep its project ID and review file ownership." },
|
|
2862
|
+
{ value: "normal", label: "Continue with normal setup", hint: "Review the normal setup plan before any write." },
|
|
2863
|
+
{ value: "cancel", label: "Cancel", hint: "Keep project files and Store unchanged." }
|
|
2864
|
+
]
|
|
2865
|
+
});
|
|
2866
|
+
if (isCancel(choice) || choice === "cancel") {
|
|
2867
|
+
output.write("Setup cancelled. No project or Store file changed.\n");
|
|
2868
|
+
return;
|
|
2869
|
+
}
|
|
2870
|
+
if (choice === "adopt") parsed.adopt = true;
|
|
2871
|
+
}
|
|
2872
|
+
if (parsed.adopt && checkoutMove.candidates.length > 0) {
|
|
2873
|
+
throw new Error("This Store already has this project ID. Review checkout move or separate checkout registration before setup.");
|
|
2874
|
+
}
|
|
2875
|
+
if (parsed.adopt && checkoutMove.status !== "portable-unregistered") {
|
|
2876
|
+
throw new Error(`This checkout cannot be adopted yet. ${checkoutMove.nextAction}`);
|
|
2877
|
+
}
|
|
2878
|
+
if (checkoutMove.candidates.length && !parsed.adopt) {
|
|
2879
|
+
if (!jsonOutput) {
|
|
2880
|
+
output.write(`Project ID: ${checkoutMove.projectId}
|
|
2881
|
+
Current path: ${checkoutMove.targetRoot}
|
|
2882
|
+
`);
|
|
2883
|
+
for (const candidate2 of checkoutMove.candidates) {
|
|
2884
|
+
output.write(`Saved checkout: ${candidate2.sourceRoot} (${candidate2.checkoutId})
|
|
2885
|
+
`);
|
|
2886
|
+
for (const blocker of candidate2.blockers) output.write(`- ${blocker}
|
|
2887
|
+
`);
|
|
2888
|
+
}
|
|
2889
|
+
output.write("Choose Move this checkout, Register a separate checkout, or Cancel.\n");
|
|
2890
|
+
}
|
|
2891
|
+
if (!interactive || parsed.dryRun) {
|
|
2892
|
+
const nextAction = "Review the saved paths. Use an interactive setup to choose Move or Register separate, or use project checkout-move preview/apply with its exact digest.";
|
|
2893
|
+
if (jsonOutput) writeCanonicalSetupResult({ status: "blocked", dryRun: parsed.dryRun, targetRoot: targetDir, storeBridge: storeBridgePreview, checkoutMove, storeMutationState: "none", projectChanged: false, projectMutationState: "none", projectActions: [], failedCondition: "Checkout identity needs a path choice.", nextAction });
|
|
2894
|
+
else output.write(`Next: ${nextAction}
|
|
2895
|
+
`);
|
|
2896
|
+
return;
|
|
2897
|
+
}
|
|
2898
|
+
const selected = await select({
|
|
2899
|
+
message: "How should setup treat this path?",
|
|
2900
|
+
options: [
|
|
2901
|
+
...checkoutMove.candidates.map((candidate2) => ({ value: `move:${candidate2.checkoutId}`, label: `Move this checkout from ${candidate2.sourceRoot}`, hint: candidate2.blockers[0], disabled: !candidate2.available })),
|
|
2902
|
+
{ value: "separate", label: "Register a separate checkout", hint: "Create a new checkout ID for this project." },
|
|
2903
|
+
{ value: "cancel", label: "Cancel", hint: "Keep all paths and Store rows as they are." }
|
|
2904
|
+
]
|
|
2905
|
+
});
|
|
2906
|
+
if (isCancel(selected) || selected === "cancel") {
|
|
2907
|
+
output.write("Setup cancelled. No checkout path changed.\n");
|
|
2908
|
+
return;
|
|
2909
|
+
}
|
|
2910
|
+
if (selected === "separate") {
|
|
2911
|
+
const approved2 = await confirm({ message: `Register ${targetDir} as a separate checkout for project ${checkoutMove.projectId}?`, initialValue: false, active: "Yes", inactive: "No", withGuide: true });
|
|
2912
|
+
if (isCancel(approved2) || !approved2) {
|
|
2913
|
+
output.write("Setup cancelled. No checkout was registered.\n");
|
|
2914
|
+
return;
|
|
2915
|
+
}
|
|
2916
|
+
const digest = checkoutMove.separateReviewDigest;
|
|
2917
|
+
if (!digest) throw new Error("Separate checkout registration is blocked. Preview again.");
|
|
2918
|
+
const registration = await invokeOperation("project.checkout-register.apply", { targetRoot: targetDir, reviewDigest: digest }, createExecutionContext({
|
|
2919
|
+
surface: "cli",
|
|
2920
|
+
route: resolvedLaunch.launch.route,
|
|
2921
|
+
callerIdentityRaw: resolvedLaunch.launch.callerIdentityRaw,
|
|
2922
|
+
callerReference: resolvedLaunch.launch.callerReference,
|
|
2923
|
+
cwd: targetDir,
|
|
2924
|
+
writesAllowed: true,
|
|
2925
|
+
storeRoot
|
|
2926
|
+
}));
|
|
2927
|
+
const result2 = registration.value;
|
|
2928
|
+
output.write(`Separate checkout registered: ${result2.checkoutId}. Project files have not changed.
|
|
2929
|
+
`);
|
|
2930
|
+
return runCli(argv, priorProjectRecovery, priorProjectMutationApplied);
|
|
2931
|
+
}
|
|
2932
|
+
const sourceCheckoutId = String(selected).slice("move:".length);
|
|
2933
|
+
const candidate = checkoutMove.candidates.find((item) => item.checkoutId === sourceCheckoutId);
|
|
2934
|
+
if (!candidate?.available || !candidate.reviewDigest) throw new Error("The selected checkout move is blocked. Preview again.");
|
|
2935
|
+
const approved = await confirm({ message: `Move checkout ${sourceCheckoutId} from ${candidate.sourceRoot} to ${targetDir}? Review: ${candidate.reviewDigest}`, initialValue: false, active: "Yes", inactive: "No", withGuide: true });
|
|
2936
|
+
if (isCancel(approved) || !approved) {
|
|
2937
|
+
output.write("Setup cancelled. No checkout path changed.\n");
|
|
2938
|
+
return;
|
|
2939
|
+
}
|
|
2940
|
+
const result = applyInstallationCheckoutMove(targetDir, sourceCheckoutId, candidate.sourceRoot, candidate.reviewDigest, storeRoot);
|
|
2941
|
+
output.write(`Checkout move completed: ${result.checkoutId}. Project files have not changed.
|
|
2942
|
+
`);
|
|
2943
|
+
return runCli(argv, priorProjectRecovery, priorProjectMutationApplied);
|
|
2944
|
+
}
|
|
2706
2945
|
const projectRecoveryReview = prepareSetupProjectRecoveryReview(targetDir, storeRoot);
|
|
2707
2946
|
if (projectRecoveryReview) {
|
|
2708
2947
|
if (!jsonOutput) output.write(renderSetupProjectRecovery(projectRecoveryReview));
|
|
@@ -2861,7 +3100,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2861
3100
|
});
|
|
2862
3101
|
}
|
|
2863
3102
|
if (!freshInstallTarget) {
|
|
2864
|
-
const { detectPreV2Install, promptPreV2Choice } = await import("./self-
|
|
3103
|
+
const { detectPreV2Install, promptPreV2Choice } = await import("./self-4HOKEXBV.js");
|
|
2865
3104
|
const preV2 = detectPreV2Install({
|
|
2866
3105
|
targetDir,
|
|
2867
3106
|
classification: compatibilityClassification
|
|
@@ -2888,11 +3127,28 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2888
3127
|
"The completed removal does not contain enough evidence to recover the prior local resource selection. Run `make-docs setup` interactively, or rerun with `--project-resources <csv|all|none>`."
|
|
2889
3128
|
);
|
|
2890
3129
|
}
|
|
2891
|
-
const resolvedSelections = resolveSelections({ parsed, existingManifest: planningManifest });
|
|
3130
|
+
const resolvedSelections = resolveSelections({ parsed, existingManifest: planningManifest, config: makeDocsConfig });
|
|
3131
|
+
if (parsed.adopt && parsed.projectResources === void 0 && makeDocsConfig.resourceProjection === void 0) {
|
|
3132
|
+
const localProjection = inferLocalResourceProjection(targetDir);
|
|
3133
|
+
if (localProjection.status === "partial" && !interactive) {
|
|
3134
|
+
throw new Error("Local resource copies are incomplete. Supply `--project-resources <csv|all|none>` or review setup interactively.");
|
|
3135
|
+
}
|
|
3136
|
+
if (localProjection.status === "complete") {
|
|
3137
|
+
resolvedSelections.resourceProjection = [...localProjection.types];
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
2892
3140
|
if (parsed.projectResources === void 0 && completedRemovalResourceProjection !== void 0 && completedRemovalResourceProjection !== null) {
|
|
2893
3141
|
resolvedSelections.resourceProjection = [...completedRemovalResourceProjection];
|
|
2894
3142
|
}
|
|
2895
3143
|
let installationStatus = readInstallationStatus(targetDir, storeRoot);
|
|
3144
|
+
if (parsed.adopt) {
|
|
3145
|
+
if (!readDeclarativeProjectId(targetDir)) {
|
|
3146
|
+
throw new Error("`setup --adopt` requires a valid projectId in .make-docs/config.yaml.");
|
|
3147
|
+
}
|
|
3148
|
+
if (installationStatus.status === "ready") {
|
|
3149
|
+
throw new Error("This checkout already has a verified installation. Run `make-docs setup` without `--adopt`.");
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
2896
3152
|
let projectState = freshInstallTarget ? "fresh" : installationStatus.status === "recovery-required" ? "recoverable" : compatibilityClassification.state === "modified-v1" ? "drifted" : completedRemovalResourceProjection === null || compatibilityClassification.state === "partial-install" || planningManifest?.effectiveCapabilities.length !== CAPABILITIES.length ? "partial" : "current";
|
|
2897
3153
|
let selections = applySkillRegistrySelectionMetadata(
|
|
2898
3154
|
resolveUnifiedSetupState({
|
|
@@ -2913,11 +3169,11 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2913
3169
|
}
|
|
2914
3170
|
let interactiveMethodSelections = {};
|
|
2915
3171
|
if (interactive) {
|
|
2916
|
-
const { inspectSystemHarnesses, promptForSystemSetupMethods } = await import("./setup-system-
|
|
3172
|
+
const { inspectSystemHarnesses, promptForSystemSetupMethods } = await import("./setup-system-CJESBAQ5.js");
|
|
2917
3173
|
const harnessSupport = inspectSystemHarnesses();
|
|
2918
3174
|
const afterHarnessSelection = async (wizardSelections) => {
|
|
2919
3175
|
interactiveMethodSelections = await promptForSystemSetupMethods({
|
|
2920
|
-
dryRun:
|
|
3176
|
+
dryRun: parsed.dryRun,
|
|
2921
3177
|
yes: false,
|
|
2922
3178
|
promptForMethods: true,
|
|
2923
3179
|
methods: {
|
|
@@ -2940,7 +3196,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2940
3196
|
const wizardSelections = await runSelectionWizard({
|
|
2941
3197
|
initialSelections: selections,
|
|
2942
3198
|
introTitle: "Let's configure your make-docs install",
|
|
2943
|
-
projectState: "fresh",
|
|
3199
|
+
projectState: parsed.adopt ? "partial" : "fresh",
|
|
2944
3200
|
harnessSupport,
|
|
2945
3201
|
afterHarnessSelection,
|
|
2946
3202
|
config: makeDocsConfig,
|
|
@@ -2991,12 +3247,16 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
2991
3247
|
applyPreparedSystemSetup,
|
|
2992
3248
|
prepareSystemSetupCommand,
|
|
2993
3249
|
resumePendingSystemSetupCommand
|
|
2994
|
-
} = await import("./setup-system-
|
|
3250
|
+
} = await import("./setup-system-CJESBAQ5.js");
|
|
3251
|
+
const savedMethods = Object.fromEntries(
|
|
3252
|
+
makeDocsConfig.harnessIntegrations.filter((record) => record.mode === "narrow" && record.method && (record.harness === "codex" || record.harness === "claude-code" || record.harness === "github-copilot")).map((record) => [record.harness, record.method])
|
|
3253
|
+
);
|
|
2995
3254
|
const systemOptions = {
|
|
2996
3255
|
dryRun: parsed.dryRun,
|
|
2997
3256
|
yes: parsed.yes,
|
|
2998
3257
|
promptForMethods: interactive && Object.keys(interactiveMethodSelections).length === 0,
|
|
2999
3258
|
methods: {
|
|
3259
|
+
...savedMethods,
|
|
3000
3260
|
...interactiveMethodSelections,
|
|
3001
3261
|
...parsed.codexMethod !== void 0 ? { codex: parsed.codexMethod } : {},
|
|
3002
3262
|
...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {},
|
|
@@ -3036,9 +3296,47 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
3036
3296
|
packageMeta,
|
|
3037
3297
|
skillRegistry: effectiveSkillRegistry.registry,
|
|
3038
3298
|
preserveExistingSkills: skillReconciliation.routed,
|
|
3039
|
-
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup"
|
|
3299
|
+
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup",
|
|
3300
|
+
adopt: parsed.adopt
|
|
3040
3301
|
});
|
|
3302
|
+
if (parsed.adopt && parsed.conflicts === "overwrite" && findReviewableManagedFileConflicts(plan).length > 0) {
|
|
3303
|
+
const failedCondition = "Adoption cannot batch-overwrite files without prior local managed ownership proof.";
|
|
3304
|
+
const nextAction = "Run `make-docs setup --adopt --yes --conflicts keep` to preserve changed files, or review each file before replacing it.";
|
|
3305
|
+
if (jsonOutput) writeCanonicalSetupResult({
|
|
3306
|
+
status: "blocked",
|
|
3307
|
+
dryRun: parsed.dryRun,
|
|
3308
|
+
targetRoot: targetDir,
|
|
3309
|
+
storeBridge: storeBridgePreview,
|
|
3310
|
+
checkoutMove,
|
|
3311
|
+
storeMutationState: "none",
|
|
3312
|
+
projectChanged: false,
|
|
3313
|
+
projectMutationState: "none",
|
|
3314
|
+
projectActions: plan.actions,
|
|
3315
|
+
failedCondition,
|
|
3316
|
+
nextAction
|
|
3317
|
+
});
|
|
3318
|
+
else output.write(`${failedCondition}
|
|
3319
|
+
${nextAction}
|
|
3320
|
+
`);
|
|
3321
|
+
return;
|
|
3322
|
+
}
|
|
3323
|
+
const conflictPolicy = parsed.conflicts ?? (parsed.adopt ? "keep" : void 0);
|
|
3041
3324
|
let managedFileConflictResolutions;
|
|
3325
|
+
if (conflictPolicy) {
|
|
3326
|
+
managedFileConflictResolutions = resolveManagedFileConflictPolicy(plan, conflictPolicy);
|
|
3327
|
+
plan = await planInstall({
|
|
3328
|
+
targetDir,
|
|
3329
|
+
selections,
|
|
3330
|
+
existingManifest: planningManifest,
|
|
3331
|
+
completedRemovalHandoff: completedRemovalHandoff.status === "ready",
|
|
3332
|
+
packageMeta,
|
|
3333
|
+
managedFileConflictResolutions,
|
|
3334
|
+
skillRegistry: effectiveSkillRegistry.registry,
|
|
3335
|
+
preserveExistingSkills: skillReconciliation.routed,
|
|
3336
|
+
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup",
|
|
3337
|
+
adopt: parsed.adopt
|
|
3338
|
+
});
|
|
3339
|
+
}
|
|
3042
3340
|
if (interactive) {
|
|
3043
3341
|
const managedFileConflicts = findReviewableManagedFileConflicts(plan);
|
|
3044
3342
|
if (managedFileConflicts.length > 0) {
|
|
@@ -3056,7 +3354,8 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
3056
3354
|
managedFileConflictResolutions,
|
|
3057
3355
|
skillRegistry: effectiveSkillRegistry.registry,
|
|
3058
3356
|
preserveExistingSkills: skillReconciliation.routed,
|
|
3059
|
-
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup"
|
|
3357
|
+
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup",
|
|
3358
|
+
adopt: parsed.adopt
|
|
3060
3359
|
});
|
|
3061
3360
|
}
|
|
3062
3361
|
}
|
|
@@ -3103,11 +3402,12 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
3103
3402
|
let projectHarnessConfig = planProjectHarnessIntegrationWrite({
|
|
3104
3403
|
targetDir,
|
|
3105
3404
|
reviewed: reviewedHarnessIntegrations,
|
|
3405
|
+
reviewedResourceProjection: freshInstallTarget || makeDocsConfig.resourceProjection !== void 0 ? selections.resourceProjection : void 0,
|
|
3106
3406
|
contentWhenMissing: plannedConfigContent
|
|
3107
3407
|
});
|
|
3108
3408
|
let hasPlannedChanges = plan.actions.some((action) => action.type !== "noop") || projectHarnessConfig.changed;
|
|
3109
3409
|
let requiresProjectIdMigration = Boolean(existingManifest && !existingManifest.projectId);
|
|
3110
|
-
let hasInstallMutation = hasPlannedChanges || requiresProjectIdMigration;
|
|
3410
|
+
let hasInstallMutation = hasPlannedChanges || requiresProjectIdMigration || Boolean(parsed.adopt);
|
|
3111
3411
|
let reviewedProjectFingerprint = setupProjectReviewFingerprint(
|
|
3112
3412
|
plan,
|
|
3113
3413
|
projectHarnessConfig
|
|
@@ -3149,8 +3449,27 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
3149
3449
|
...managedFileConflictResolutions ? { managedFileConflictResolutions } : {},
|
|
3150
3450
|
skillRegistry: effectiveSkillRegistry.registry,
|
|
3151
3451
|
preserveExistingSkills: skillReconciliation.routed,
|
|
3152
|
-
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup"
|
|
3452
|
+
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup",
|
|
3453
|
+
adopt: parsed.adopt
|
|
3153
3454
|
});
|
|
3455
|
+
if (conflictPolicy) {
|
|
3456
|
+
managedFileConflictResolutions = {
|
|
3457
|
+
...managedFileConflictResolutions,
|
|
3458
|
+
...resolveManagedFileConflictPolicy(plan, conflictPolicy)
|
|
3459
|
+
};
|
|
3460
|
+
plan = await planInstall({
|
|
3461
|
+
targetDir,
|
|
3462
|
+
selections,
|
|
3463
|
+
existingManifest: planningManifest,
|
|
3464
|
+
completedRemovalHandoff: completedRemovalHandoff.status === "ready",
|
|
3465
|
+
packageMeta,
|
|
3466
|
+
managedFileConflictResolutions,
|
|
3467
|
+
skillRegistry: effectiveSkillRegistry.registry,
|
|
3468
|
+
preserveExistingSkills: skillReconciliation.routed,
|
|
3469
|
+
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup",
|
|
3470
|
+
adopt: parsed.adopt
|
|
3471
|
+
});
|
|
3472
|
+
}
|
|
3154
3473
|
if (interactive) {
|
|
3155
3474
|
const refreshedConflicts = findReviewableManagedFileConflicts(plan);
|
|
3156
3475
|
if (refreshedConflicts.length > 0) {
|
|
@@ -3172,7 +3491,8 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
3172
3491
|
managedFileConflictResolutions,
|
|
3173
3492
|
skillRegistry: effectiveSkillRegistry.registry,
|
|
3174
3493
|
preserveExistingSkills: skillReconciliation.routed,
|
|
3175
|
-
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup"
|
|
3494
|
+
operation: installIntent === "reconfigure" ? "setup.reconfigure" : "setup",
|
|
3495
|
+
adopt: parsed.adopt
|
|
3176
3496
|
});
|
|
3177
3497
|
}
|
|
3178
3498
|
}
|
|
@@ -3202,11 +3522,12 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
3202
3522
|
projectHarnessConfig = planProjectHarnessIntegrationWrite({
|
|
3203
3523
|
targetDir,
|
|
3204
3524
|
reviewed: reviewedHarnessIntegrations,
|
|
3525
|
+
reviewedResourceProjection: freshInstallTarget || makeDocsConfig.resourceProjection !== void 0 ? selections.resourceProjection : void 0,
|
|
3205
3526
|
contentWhenMissing: plannedConfigContent
|
|
3206
3527
|
});
|
|
3207
3528
|
hasPlannedChanges = plan.actions.some((action) => action.type !== "noop") || projectHarnessConfig.changed;
|
|
3208
3529
|
requiresProjectIdMigration = Boolean(existingManifest && !existingManifest.projectId);
|
|
3209
|
-
hasInstallMutation = hasPlannedChanges || requiresProjectIdMigration;
|
|
3530
|
+
hasInstallMutation = hasPlannedChanges || requiresProjectIdMigration || Boolean(parsed.adopt);
|
|
3210
3531
|
reviewedProjectFingerprint = setupProjectReviewFingerprint(
|
|
3211
3532
|
plan,
|
|
3212
3533
|
projectHarnessConfig
|
|
@@ -3242,13 +3563,13 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
3242
3563
|
if (!jsonOutput && projectHarnessConfig.changed) {
|
|
3243
3564
|
output.write("Project harness intent: update .make-docs/config.yaml after machine verification.\n");
|
|
3244
3565
|
}
|
|
3245
|
-
|
|
3566
|
+
const unresolvedManagedFileConflicts = findReviewableManagedFileConflicts(plan);
|
|
3567
|
+
if (parsed.dryRun && unresolvedManagedFileConflicts.length === 0) {
|
|
3246
3568
|
if (jsonOutput) writeCanonicalSetupResult({ status: "planned", dryRun: true, targetRoot: targetDir, prepared: preparedSystemSetup, genericMcp: genericMcpPlan, storeBridge: storeBridgePreview, projectRecovery: priorProjectRecovery, projectChanged: hasInstallMutation, projectActions: plan.actions, failedCondition: null, nextAction: hasInstallMutation || hasMachineMutation ? "Run setup with the same choices and --yes to apply this plan." : null });
|
|
3247
3569
|
else output.write("\nDry run complete.\n");
|
|
3248
3570
|
return;
|
|
3249
3571
|
}
|
|
3250
|
-
|
|
3251
|
-
if (!interactive && unresolvedManagedFileConflicts.length > 0) {
|
|
3572
|
+
if (unresolvedManagedFileConflicts.length > 0) {
|
|
3252
3573
|
const migrationReviewBlock = getInstallPlanMigrationReviewBlock(plan);
|
|
3253
3574
|
const failedCondition = [
|
|
3254
3575
|
"Non-interactive make-docs runs cannot apply unresolved managed-file diffs.",
|
|
@@ -3262,11 +3583,11 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
|
|
|
3262
3583
|
)
|
|
3263
3584
|
].join("\n")
|
|
3264
3585
|
].join("\n");
|
|
3265
|
-
const nextAction = migrationReviewBlock?.nextAction ?? "Run
|
|
3586
|
+
const nextAction = migrationReviewBlock?.nextAction ?? "Run setup with `--conflicts keep` to preserve changed files, or review the conflicts interactively.";
|
|
3266
3587
|
if (jsonOutput) {
|
|
3267
3588
|
writeCanonicalSetupResult({
|
|
3268
3589
|
status: "blocked",
|
|
3269
|
-
dryRun:
|
|
3590
|
+
dryRun: parsed.dryRun,
|
|
3270
3591
|
targetRoot: targetDir,
|
|
3271
3592
|
prepared: preparedSystemSetup,
|
|
3272
3593
|
genericMcp: genericMcpPlan,
|
|
@@ -3612,7 +3933,7 @@ Next: ${nextAction}
|
|
|
3612
3933
|
}
|
|
3613
3934
|
let applied;
|
|
3614
3935
|
try {
|
|
3615
|
-
applied = !freshInstallTarget && hasInstallMutation && completedRemovalHandoff.status !== "ready" ? executeInstallPlanMigration({
|
|
3936
|
+
applied = !parsed.adopt && !freshInstallTarget && hasInstallMutation && completedRemovalHandoff.status !== "ready" ? executeInstallPlanMigration({
|
|
3616
3937
|
projectRoot: targetDir,
|
|
3617
3938
|
storeRoot,
|
|
3618
3939
|
compatibility: compatibilityClassification,
|
|
@@ -3858,9 +4179,19 @@ function describeSelectionSource(options) {
|
|
|
3858
4179
|
return hasSelectionOverrides(parsed) ? "default selections plus command-line flags" : "default selections";
|
|
3859
4180
|
}
|
|
3860
4181
|
function resolveSelections(options) {
|
|
3861
|
-
const { parsed, existingManifest } = options;
|
|
4182
|
+
const { parsed, existingManifest, config } = options;
|
|
3862
4183
|
const baseSelections = existingManifest ? existingManifest.selections : defaultSelections();
|
|
3863
4184
|
const selections = cloneSelections(baseSelections);
|
|
4185
|
+
if (!existingManifest && parsed.adopt) {
|
|
4186
|
+
for (const record of config.harnessIntegrations) {
|
|
4187
|
+
if (record.harness === "codex" || record.harness === "claude-code" || record.harness === "github-copilot") {
|
|
4188
|
+
selections.harnesses[record.harness] = record.mode !== "disable";
|
|
4189
|
+
}
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
if (parsed.projectResources === void 0 && config.resourceProjection !== void 0) {
|
|
4193
|
+
selections.resourceProjection = [...config.resourceProjection];
|
|
4194
|
+
}
|
|
3864
4195
|
if (selections.resourceProjection === void 0 && (!existingManifest || parsed.setupSubcommand === "reconfigure")) {
|
|
3865
4196
|
selections.resourceProjection = [];
|
|
3866
4197
|
}
|
|
@@ -3909,6 +4240,14 @@ function resolveSelections(options) {
|
|
|
3909
4240
|
}
|
|
3910
4241
|
return selections;
|
|
3911
4242
|
}
|
|
4243
|
+
function resolveManagedFileConflictPolicy(plan, policy) {
|
|
4244
|
+
return Object.fromEntries(
|
|
4245
|
+
findReviewableManagedFileConflicts(plan).map((conflict) => [
|
|
4246
|
+
conflict.relativePath,
|
|
4247
|
+
policy === "keep" ? "skip" : "overwrite"
|
|
4248
|
+
])
|
|
4249
|
+
);
|
|
4250
|
+
}
|
|
3912
4251
|
function inferCompletedRemovalResourceProjection(manifest) {
|
|
3913
4252
|
const resourceUris = /* @__PURE__ */ new Set([
|
|
3914
4253
|
...Object.keys(manifest.resourceProjection?.resources ?? {}),
|
|
@@ -3970,7 +4309,7 @@ async function loadUninstallCommand() {
|
|
|
3970
4309
|
if (uninstallCommandLoaderOverride) {
|
|
3971
4310
|
return uninstallCommandLoaderOverride();
|
|
3972
4311
|
}
|
|
3973
|
-
const uninstallModule = await import("./uninstall-
|
|
4312
|
+
const uninstallModule = await import("./uninstall-R2QK7XPK.js");
|
|
3974
4313
|
if (typeof uninstallModule.runUninstallCommand !== "function") {
|
|
3975
4314
|
throw new Error(
|
|
3976
4315
|
"The `uninstall` command module must export `runUninstallCommand(options)`."
|
|
@@ -3983,7 +4322,7 @@ async function runSkillsCommand(options) {
|
|
|
3983
4322
|
await skillsCommandRunnerOverride(options);
|
|
3984
4323
|
return;
|
|
3985
4324
|
}
|
|
3986
|
-
const skillsModule = await import("./skills-command-
|
|
4325
|
+
const skillsModule = await import("./skills-command-YXPOHXI2.js");
|
|
3987
4326
|
await skillsModule.runSkillsCommand(options);
|
|
3988
4327
|
}
|
|
3989
4328
|
function getSelectionOverrideFlags(parsed) {
|
|
@@ -4126,6 +4465,17 @@ function parseArgs(argv) {
|
|
|
4126
4465
|
case "--yes":
|
|
4127
4466
|
parsed.yes = true;
|
|
4128
4467
|
break;
|
|
4468
|
+
case "--adopt":
|
|
4469
|
+
parsed.adopt = true;
|
|
4470
|
+
break;
|
|
4471
|
+
case "--conflicts": {
|
|
4472
|
+
const value = args.shift();
|
|
4473
|
+
if (value !== "keep" && value !== "overwrite") {
|
|
4474
|
+
throw new Error("`--conflicts` must be keep or overwrite.");
|
|
4475
|
+
}
|
|
4476
|
+
parsed.conflicts = value;
|
|
4477
|
+
break;
|
|
4478
|
+
}
|
|
4129
4479
|
case "--json":
|
|
4130
4480
|
parsed.json = true;
|
|
4131
4481
|
break;
|
|
@@ -4450,6 +4800,7 @@ function writeCanonicalSetupResult(input2) {
|
|
|
4450
4800
|
nextAction: input2.storeBridge.nextAction
|
|
4451
4801
|
} : null,
|
|
4452
4802
|
projectRecovery: input2.projectRecovery ?? null,
|
|
4803
|
+
checkoutMove: input2.checkoutMove ?? null,
|
|
4453
4804
|
project: {
|
|
4454
4805
|
state: input2.status === "complete" || input2.status === "partial" ? "ready" : input2.status,
|
|
4455
4806
|
changed: input2.projectChanged,
|
|
@@ -4462,6 +4813,12 @@ function writeCanonicalSetupResult(input2) {
|
|
|
4462
4813
|
`);
|
|
4463
4814
|
}
|
|
4464
4815
|
function validateParsedArgs(parsed) {
|
|
4816
|
+
if (parsed.adopt && (parsed.command !== "setup" || parsed.setupSubcommand !== void 0)) {
|
|
4817
|
+
throw new Error("`--adopt` is valid only with plain `make-docs setup`.");
|
|
4818
|
+
}
|
|
4819
|
+
if (parsed.conflicts && (parsed.command !== "setup" || parsed.setupSubcommand === "system" || parsed.setupSubcommand === "skills" || parsed.setupSubcommand === "backup" || parsed.setupSubcommand === "remove")) {
|
|
4820
|
+
throw new Error("`--conflicts` is valid only with project setup or reconfigure.");
|
|
4821
|
+
}
|
|
4465
4822
|
if (parsed.rotateMcp && (parsed.command !== "setup" || parsed.setupSubcommand !== "system")) {
|
|
4466
4823
|
throw new Error("`--rotate-mcp` is valid only with `make-docs setup system`.");
|
|
4467
4824
|
}
|
|
@@ -4879,6 +5236,8 @@ var SETUP_SHARED_OPTIONS = `General options:
|
|
|
4879
5236
|
--target <dir> Operate on a different make-docs install directory.
|
|
4880
5237
|
--dry-run Show planned changes without writing files.
|
|
4881
5238
|
--yes Approve a fully specified non-interactive plan.
|
|
5239
|
+
--adopt Register a checkout with a saved projectId in this Store.
|
|
5240
|
+
--conflicts <keep|overwrite> Resolve changed managed files in this setup plan.
|
|
4882
5241
|
--recover <resume|restore> Choose recovery for unfinished project work.
|
|
4883
5242
|
--json Emit only the canonical setup result JSON.
|
|
4884
5243
|
--help, -h Show help for this command.
|
|
@@ -5132,6 +5491,8 @@ ${SETUP_SHARED_OPTIONS}
|
|
|
5132
5491
|
Examples:
|
|
5133
5492
|
make-docs setup
|
|
5134
5493
|
make-docs setup --yes
|
|
5494
|
+
make-docs setup --adopt --yes
|
|
5495
|
+
make-docs setup --adopt --yes --conflicts keep
|
|
5135
5496
|
make-docs setup --target ~/Projects/example --dry-run
|
|
5136
5497
|
make-docs setup reconfigure --yes --no-work
|
|
5137
5498
|
make-docs setup remove --backup
|