@brucewaynedecoy/make-docs 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/{backup-CM7RL2Q7.js → backup-P5NUPAJL.js} +4 -4
  2. package/dist/{chunk-M7DMFIKU.js → chunk-2WC74W66.js} +224 -20
  3. package/dist/chunk-2WC74W66.js.map +1 -0
  4. package/dist/{chunk-OR5ZVGLG.js → chunk-B7QF7XZT.js} +151 -5
  5. package/dist/chunk-B7QF7XZT.js.map +1 -0
  6. package/dist/{chunk-LV3CBXZB.js → chunk-DNPFQB24.js} +3 -3
  7. package/dist/{chunk-52FTNVXS.js → chunk-EF47XIIR.js} +8977 -2891
  8. package/dist/chunk-EF47XIIR.js.map +1 -0
  9. package/dist/{chunk-GERMRLJ2.js → chunk-KFYUB4AX.js} +6 -4
  10. package/dist/chunk-KFYUB4AX.js.map +1 -0
  11. package/dist/{chunk-ADVNSMA7.js → chunk-LK6BLVZA.js} +3 -3
  12. package/dist/{chunk-65QWMODG.js → chunk-PI7W5QDB.js} +3 -3
  13. package/dist/{chunk-65QWMODG.js.map → chunk-PI7W5QDB.js.map} +1 -1
  14. package/dist/{chunk-YVSASZMT.js → chunk-SFKYGFUV.js} +277 -79
  15. package/dist/chunk-SFKYGFUV.js.map +1 -0
  16. package/dist/{chunk-J5QDGRZ7.js → chunk-TDB6UW4M.js} +116 -37
  17. package/dist/chunk-TDB6UW4M.js.map +1 -0
  18. package/dist/{chunk-7R2PPKTB.js → chunk-XFFESINU.js} +2 -2
  19. package/dist/index.js +408 -86
  20. package/dist/index.js.map +1 -1
  21. package/dist/registry-44WLX4F5.js +50 -0
  22. package/dist/registry-44WLX4F5.js.map +1 -0
  23. package/dist/{self-36ULRIJ6.js → self-WRWI5XNE.js} +10 -10
  24. package/dist/server-FYRDPOBR.js +1117 -0
  25. package/dist/server-FYRDPOBR.js.map +1 -0
  26. package/dist/{setup-system-JI36YJ6D.js → setup-system-XX6NSVXZ.js} +263 -40
  27. package/dist/setup-system-XX6NSVXZ.js.map +1 -0
  28. package/dist/{skills-command-IGDVLNKY.js → skills-command-YAQP24JM.js} +17 -7
  29. package/dist/skills-command-YAQP24JM.js.map +1 -0
  30. package/dist/{uninstall-VBGMQQLA.js → uninstall-3YJKZ6UF.js} +9 -9
  31. package/dist/virtual_make-docs-first-party-skills-5TYTCD5U.js +11 -0
  32. package/dist/virtual_make-docs-first-party-skills-5TYTCD5U.js.map +1 -0
  33. package/package.json +5 -5
  34. package/skill-registry.json +24 -8
  35. package/skill-registry.schema.json +2 -1
  36. package/template/.make-docs/system/contracts/system-resource-contract.md +16 -0
  37. package/template/.make-docs/system-resources.catalog.json +415 -0
  38. package/template/.make-docs/system-resources.schema.json +25 -0
  39. package/dist/chunk-52FTNVXS.js.map +0 -1
  40. package/dist/chunk-GERMRLJ2.js.map +0 -1
  41. package/dist/chunk-J5QDGRZ7.js.map +0 -1
  42. package/dist/chunk-M7DMFIKU.js.map +0 -1
  43. package/dist/chunk-OR5ZVGLG.js.map +0 -1
  44. package/dist/chunk-YVSASZMT.js.map +0 -1
  45. package/dist/server-H754TA4Q.js +0 -512
  46. package/dist/server-H754TA4Q.js.map +0 -1
  47. package/dist/setup-system-JI36YJ6D.js.map +0 -1
  48. package/dist/skills-command-IGDVLNKY.js.map +0 -1
  49. package/dist/virtual_make-docs-first-party-skills-H3FC47C2.js +0 -11
  50. package/dist/virtual_make-docs-first-party-skills-H3FC47C2.js.map +0 -1
  51. /package/dist/{backup-CM7RL2Q7.js.map → backup-P5NUPAJL.js.map} +0 -0
  52. /package/dist/{chunk-LV3CBXZB.js.map → chunk-DNPFQB24.js.map} +0 -0
  53. /package/dist/{chunk-ADVNSMA7.js.map → chunk-LK6BLVZA.js.map} +0 -0
  54. /package/dist/{chunk-7R2PPKTB.js.map → chunk-XFFESINU.js.map} +0 -0
  55. /package/dist/{self-36ULRIJ6.js.map → self-WRWI5XNE.js.map} +0 -0
  56. /package/dist/{uninstall-VBGMQQLA.js.map → uninstall-3YJKZ6UF.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-PI7W5QDB.js";
2
7
  import {
3
8
  classifyCompatibilityState,
4
9
  formatCompatibilityClassification,
5
10
  importLegacyInstallationState,
6
11
  previewLegacyInstallationState,
7
12
  scopeCompatibilityToInstallPlan
8
- } from "./chunk-ADVNSMA7.js";
13
+ } from "./chunk-LK6BLVZA.js";
9
14
  import {
10
15
  Checkpoint9ReceiptProjectionError,
11
16
  MigrationSafetyError,
@@ -21,36 +26,25 @@ import {
21
26
  operationCliProjection,
22
27
  resolveCliOperationLaunch,
23
28
  serializeOperationError
24
- } from "./chunk-52FTNVXS.js";
25
- import {
26
- runBackupCommand
27
- } from "./chunk-LV3CBXZB.js";
28
- import "./chunk-GERMRLJ2.js";
29
- import {
30
- OperationError,
31
- listLifecycleRuns,
32
- loadGlobalConfig,
33
- previewStoreCompatibilityBridge,
34
- resolveProjectIdentity,
35
- writeGlobalConfig
36
- } from "./chunk-J5QDGRZ7.js";
37
- import {
38
- COMPLETE_PROJECT_CAPABILITIES,
39
- describeHarnessSupport,
40
- resolveUnifiedSetupState
41
- } from "./chunk-65QWMODG.js";
29
+ } from "./chunk-EF47XIIR.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-OR5ZVGLG.js";
53
- import "./chunk-7R2PPKTB.js";
42
+ } from "./chunk-B7QF7XZT.js";
43
+ import {
44
+ runBackupCommand
45
+ } from "./chunk-DNPFQB24.js";
46
+ import "./chunk-KFYUB4AX.js";
47
+ import "./chunk-XFFESINU.js";
54
48
  import {
55
49
  S_BAR,
56
50
  S_BAR_END,
@@ -67,23 +61,36 @@ import {
67
61
  symbol,
68
62
  wrapTextWithPrefix
69
63
  } from "./chunk-3EXHM5L2.js";
64
+ import {
65
+ OperationError,
66
+ listLifecycleRuns,
67
+ loadGlobalConfig,
68
+ previewStoreCompatibilityBridge,
69
+ resolveProjectIdentity,
70
+ writeGlobalConfig
71
+ } from "./chunk-TDB6UW4M.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-M7DMFIKU.js";
86
+ } from "./chunk-2WC74W66.js";
81
87
  import {
82
88
  CAPABILITIES,
83
89
  CAPABILITY_DEPENDENCIES,
84
90
  HARNESSES,
85
91
  PACKAGE_ROOT,
86
92
  PROJECT_RESOURCE_TYPES,
93
+ applyInstallationCheckoutMove,
87
94
  applySkillRegistrySelectionMetadata,
88
95
  classifyStoreCheckpoint9State,
89
96
  cloneSelections,
@@ -97,6 +104,7 @@ import {
97
104
  loadEffectiveSkillRegistry,
98
105
  loadManifest,
99
106
  loadSqliteDriver,
107
+ previewInstallationCheckoutMove,
100
108
  readInstallationStatus,
101
109
  readPackageMeta,
102
110
  recoverInstallationOperation,
@@ -106,7 +114,7 @@ import {
106
114
  validateAndMigrateManifest,
107
115
  withStoreDatabase,
108
116
  writeTextFile
109
- } from "./chunk-YVSASZMT.js";
117
+ } from "./chunk-SFKYGFUV.js";
110
118
  import "./chunk-D4HDZEJT.js";
111
119
 
112
120
  // src/cli.ts
@@ -309,10 +317,16 @@ function renderBacklogSnapshot(value) {
309
317
  return lines;
310
318
  }
311
319
  var TEXT_RENDERERS = {
320
+ "backlog.review.open": renderBacklogReview,
321
+ "backlog.review.refresh": renderBacklogReview,
312
322
  "prd.authority.validate": renderPrdAuthorityValidation,
313
323
  "performance.evidence.validate": renderPerformanceEvidenceValidation,
314
324
  "work.backlog.snapshot": renderBacklogSnapshot
315
325
  };
326
+ function renderBacklogReview(value) {
327
+ const content = recordEntries(asRecord(value)?.content);
328
+ return content.length === 1 && text(content[0], "type") === "text" ? [text(content[0], "text") ?? ""] : null;
329
+ }
316
330
  function genericRenderer(value) {
317
331
  const record = asRecord(value);
318
332
  const lines = stringList(record, "lines");
@@ -524,6 +538,14 @@ var RUN_CLI_ADAPTERS = {
524
538
  )
525
539
  }
526
540
  }),
541
+ "backlog.review.open": (options) => ({ input: { report: parseJsonPayload(
542
+ requiredValue(options, "report-json", operationPath("backlog.review.open")),
543
+ "report-json"
544
+ ) } }),
545
+ "backlog.review.refresh": (options) => ({ input: { envelope: parseJsonPayload(
546
+ requiredValue(options, "envelope-json", operationPath("backlog.review.refresh")),
547
+ "envelope-json"
548
+ ) } }),
527
549
  "work.backlog-cache.lookup": (options) => ({
528
550
  input: {
529
551
  targetRoot: path.resolve(
@@ -877,6 +899,14 @@ async function runResourceCommand(argv, launch = resolveCliOperationLaunch()) {
877
899
  printJson2(invocation.value);
878
900
  }
879
901
  async function runProjectCommand(argv, launch = resolveCliOperationLaunch()) {
902
+ if (argv[0] === "checkout-move") {
903
+ await runProjectCheckoutMoveCommand(argv.slice(1), launch);
904
+ return;
905
+ }
906
+ if (argv[0] === "checkout-register") {
907
+ await runProjectCheckoutRegisterCommand(argv.slice(1), launch);
908
+ return;
909
+ }
880
910
  if (argv[0] === "layout" || argv[0] === "persona") {
881
911
  await runProjectLayoutCommand(argv, launch);
882
912
  return;
@@ -895,6 +925,9 @@ async function runProjectCommand(argv, launch = resolveCliOperationLaunch()) {
895
925
  " make-docs project layout apply|verify <operation-id> [--target-root <path>] [--json]",
896
926
  " make-docs project state status [--target-root <path>] [--json]",
897
927
  " make-docs project state recover <operation-id> --resume|--rollback [--dry-run] [--target-root <path>] [--json]",
928
+ " make-docs project checkout-move preview [--source-checkout <id>] [--target-root <path>] [--json]",
929
+ " make-docs project checkout-move apply --source-checkout <id> --source-root <path> --review <digest> [--target-root <path>] [--json]",
930
+ " make-docs project checkout-register preview|apply [--review <digest>] [--target-root <path>] [--json]",
898
931
  "",
899
932
  "Installation state belongs to the global Make Docs Store.",
900
933
  "The ensure command checks Store installation evidence and configured routers",
@@ -971,6 +1004,122 @@ async function runProjectCommand(argv, launch = resolveCliOperationLaunch()) {
971
1004
  ].join("\n")
972
1005
  );
973
1006
  }
1007
+ async function runProjectCheckoutRegisterCommand(argv, launch) {
1008
+ const [verb, ...args] = argv;
1009
+ if (!verb || verb === "--help" || verb === "-h") {
1010
+ 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");
1011
+ return;
1012
+ }
1013
+ if (verb !== "preview" && verb !== "apply") throw new OperationError(`Unknown checkout-register action: ${verb}.`);
1014
+ let targetRoot, reviewDigest, json = false;
1015
+ const seen = /* @__PURE__ */ new Set();
1016
+ while (args.length) {
1017
+ const flag = args.shift();
1018
+ if (seen.has(flag)) throw new OperationError(`Option ${flag} can be given only once.`);
1019
+ seen.add(flag);
1020
+ if (flag === "--target-root" || flag === "--review") {
1021
+ const value = args.shift();
1022
+ if (!value || value.startsWith("--")) throw new OperationError(`${flag} requires a value.`);
1023
+ if (flag === "--target-root") targetRoot = path2.resolve(value);
1024
+ else if (verb === "apply") reviewDigest = value;
1025
+ else throw new OperationError("--review is valid only with checkout-register apply.");
1026
+ } else if (flag === "--json") json = true;
1027
+ else throw new OperationError(`Unexpected checkout-register option: ${flag}.`);
1028
+ }
1029
+ if (verb === "apply" && !reviewDigest) throw new OperationError("Checkout registration requires --review from one preview.");
1030
+ const invocation = await invokeOperation(`project.checkout-register.${verb}`, {
1031
+ ...targetRoot ? { targetRoot } : {},
1032
+ ...reviewDigest ? { reviewDigest } : {}
1033
+ }, createExecutionContext({
1034
+ surface: "cli",
1035
+ route: launch.route,
1036
+ callerIdentityRaw: launch.callerIdentityRaw,
1037
+ callerReference: launch.callerReference,
1038
+ cwd: targetRoot,
1039
+ writesAllowed: verb === "apply"
1040
+ }));
1041
+ const result = invocation.value;
1042
+ if (json) {
1043
+ printJson2(result);
1044
+ return;
1045
+ }
1046
+ process.stdout.write([
1047
+ `Checkout registration: ${result.status}`,
1048
+ `Target: ${result.targetRoot}`,
1049
+ ...result.projectId ? [`Project ID: ${result.projectId}`] : [],
1050
+ ...result.checkoutId ? [`New checkout ID: ${result.checkoutId}`] : [],
1051
+ ...result.effect ? [`Effect: ${result.effect}`] : [],
1052
+ ...result.projectFilesChanged === false ? ["Project files: unchanged"] : [],
1053
+ ...result.separateReviewDigest ? [`Review: ${result.separateReviewDigest}`] : [],
1054
+ ...result.nextAction ? [`Next: ${result.nextAction}`] : [],
1055
+ ""
1056
+ ].join("\n"));
1057
+ }
1058
+ async function runProjectCheckoutMoveCommand(argv, launch) {
1059
+ const [verb, ...args] = argv;
1060
+ if (!verb || verb === "--help" || verb === "-h") {
1061
+ 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");
1062
+ return;
1063
+ }
1064
+ if (verb !== "preview" && verb !== "apply") throw new OperationError(`Unknown checkout-move action: ${verb}.`);
1065
+ let targetRoot, sourceCheckoutId, sourceRoot, reviewDigest;
1066
+ let json = false, dryRun = false;
1067
+ const seen = /* @__PURE__ */ new Set();
1068
+ while (args.length) {
1069
+ const flag = args.shift();
1070
+ if (seen.has(flag)) throw new OperationError(`Option ${flag} can be given only once.`);
1071
+ seen.add(flag);
1072
+ const value = () => {
1073
+ const next = args.shift();
1074
+ if (!next || next.startsWith("--")) throw new OperationError(`${flag} requires a value.`);
1075
+ return next;
1076
+ };
1077
+ if (flag === "--target-root") targetRoot = path2.resolve(value());
1078
+ else if (flag === "--source-checkout") sourceCheckoutId = value();
1079
+ else if (flag === "--source-root" && verb === "apply") sourceRoot = path2.resolve(value());
1080
+ else if (flag === "--review" && verb === "apply") reviewDigest = value();
1081
+ else if (flag === "--json") json = true;
1082
+ else if (flag === "--dry-run" && verb === "apply") dryRun = true;
1083
+ else throw new OperationError(`Unexpected checkout-move option: ${flag}.`);
1084
+ }
1085
+ if (verb === "apply" && (!sourceCheckoutId || !sourceRoot || !reviewDigest)) throw new OperationError("Apply requires --source-checkout, --source-root, and --review from one preview.");
1086
+ const invocation = await invokeOperation(`project.checkout-move.${verb}`, {
1087
+ ...targetRoot ? { targetRoot } : {},
1088
+ ...sourceCheckoutId ? { sourceCheckoutId } : {},
1089
+ ...sourceRoot ? { sourceRoot } : {},
1090
+ ...reviewDigest ? { reviewDigest } : {}
1091
+ }, createExecutionContext({
1092
+ surface: "cli",
1093
+ route: launch.route,
1094
+ callerIdentityRaw: launch.callerIdentityRaw,
1095
+ callerReference: launch.callerReference,
1096
+ cwd: targetRoot,
1097
+ writesAllowed: verb === "apply",
1098
+ dryRun
1099
+ }));
1100
+ const result = invocation.value;
1101
+ if (json) {
1102
+ printJson2(result);
1103
+ return;
1104
+ }
1105
+ process.stdout.write([
1106
+ `Checkout move: ${result.status}`,
1107
+ `Target: ${result.targetRoot}`,
1108
+ ...result.projectId ? [`Project ID: ${result.projectId}`] : [],
1109
+ ...result.checkoutId ? [`Checkout ID: ${result.checkoutId}`] : [],
1110
+ ...result.sourceRoot ? [`Source: ${result.sourceRoot}`] : [],
1111
+ ...result.effect ? [`Effect: ${result.effect}`] : [],
1112
+ ...result.projectFilesChanged === false ? ["Project files: unchanged"] : [],
1113
+ ...(result.candidates ?? []).flatMap((candidate) => [
1114
+ `Source: ${candidate.sourceRoot} (${candidate.checkoutId})`,
1115
+ `Available: ${candidate.available ? "yes" : "no"}`,
1116
+ ...candidate.reviewDigest ? [`Review: ${candidate.reviewDigest}`] : [],
1117
+ ...candidate.blockers.map((blocker) => `Blocker: ${blocker}`)
1118
+ ]),
1119
+ ...result.nextAction ? [`Next: ${result.nextAction}`] : [],
1120
+ ""
1121
+ ].join("\n"));
1122
+ }
974
1123
  async function runProjectLayoutCommand(argv, launch) {
975
1124
  const [noun, verb, ...args] = argv;
976
1125
  if (!verb || verb === "--help" || verb === "-h") {
@@ -1186,6 +1335,10 @@ var HARNESS_METADATA = {
1186
1335
  codex: {
1187
1336
  label: "Codex",
1188
1337
  hint: "AGENTS.md + .agents/"
1338
+ },
1339
+ "github-copilot": {
1340
+ label: "GitHub Copilot CLI",
1341
+ hint: "AGENTS.md + .agents/"
1189
1342
  }
1190
1343
  };
1191
1344
  var MANAGED_FILE_CONFLICT_GROUP_ORDER = [
@@ -1650,7 +1803,7 @@ function createClackWizardRenderer() {
1650
1803
  intro(title);
1651
1804
  },
1652
1805
  showProjectState(state) {
1653
- note(`Project state: ${state}.`, "Project state");
1806
+ note(`${state}.`, "Project state");
1654
1807
  },
1655
1808
  async editCapabilities(state) {
1656
1809
  return promptForCapabilities(state.selections, state.config);
@@ -2240,7 +2393,6 @@ function renderSetupProjectRecovery(review) {
2240
2393
  }
2241
2394
 
2242
2395
  // src/generic-mcp-setup.ts
2243
- import { randomBytes } from "crypto";
2244
2396
  import os from "os";
2245
2397
  import path3 from "path";
2246
2398
  function validateGenericMcpClientLabel(label) {
@@ -2257,17 +2409,18 @@ function prepareGenericMcpSetup(options) {
2257
2409
  const storeRoot = options.storeRoot ?? resolveStoreRoot();
2258
2410
  const existing = loadGlobalConfig(storeRoot).config.settings.harnesses[harnessId];
2259
2411
  const active = isCurrentGenericIntent(existing, clientLabel);
2260
- const accessCeiling = { store: "write", project: "write", hostConfig: "none" };
2412
+ const accessCeiling = existing?.accessCeiling ? { ...existing.accessCeiling } : { store: "write", project: "write", hostConfig: "none" };
2261
2413
  if (action === "remove") {
2414
+ const enabled = Boolean(existing?.selected || existing?.mcpConnection?.active);
2262
2415
  return {
2263
2416
  schemaVersion: 1,
2264
2417
  clientLabel,
2265
2418
  harnessId,
2266
2419
  action,
2267
- changed: Boolean(existing),
2268
- state: existing ? "planned" : "missing",
2420
+ changed: enabled,
2421
+ state: enabled ? "planned" : "missing",
2269
2422
  accessCeiling,
2270
- review: existing ? `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.`,
2423
+ 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.`,
2271
2424
  nextAction: null,
2272
2425
  configuration: null,
2273
2426
  configurationDigest: null,
@@ -2295,40 +2448,30 @@ function prepareGenericMcpSetup(options) {
2295
2448
  const executable = options.executable ?? verifyMakeDocsExecutable({
2296
2449
  executablePath: path3.resolve(process.argv[1] ?? "")
2297
2450
  });
2298
- const proof = randomBytes(32).toString("base64url");
2299
2451
  const machineRoot = path3.resolve(options.machineRoot ?? os.homedir());
2300
- const identity = {
2301
- schemaVersion: 1,
2302
- kind: "make-docs-generic-mcp-caller",
2303
- adapterId: "generic-mcp",
2304
- adapterVersion: 1,
2305
- harnessId,
2306
- connectionMethod: "mcp",
2307
- scope: "machine",
2308
- root: machineRoot,
2309
- executable,
2310
- proof
2311
- };
2452
+ const connection = createMcpConnection(harnessId);
2312
2453
  const configuration = {
2313
2454
  mcpServers: {
2314
2455
  "make-docs": {
2315
2456
  command: executable.path,
2316
2457
  args: ["mcp"],
2317
- env: { MAKE_DOCS_HARNESS_CALLER_IDENTITY: encodeHarnessCallerIdentity(identity) }
2458
+ env: {
2459
+ [MCP_CONNECTION_ID_ENV]: connection.id,
2460
+ [MCP_CONNECTION_KEY_ENV]: connection.key
2461
+ }
2318
2462
  }
2319
2463
  }
2320
2464
  };
2321
2465
  const configurationDigest = sha256(JSON.stringify(configuration));
2322
- const priorRevision = typeof existing?.identityRevision === "number" ? existing.identityRevision : 0;
2323
2466
  const intent = {
2467
+ ...existing,
2324
2468
  selected: true,
2325
2469
  maximumMethod: "mcp",
2326
2470
  accessCeiling: { ...accessCeiling },
2327
2471
  profileKind: "generic-mcp",
2328
2472
  clientLabel,
2329
2473
  machineRoot,
2330
- proofSha256: sha256(proof),
2331
- identityRevision: priorRevision + 1,
2474
+ mcpConnection: connection.record,
2332
2475
  configurationDigest,
2333
2476
  lifecycleState: "active"
2334
2477
  };
@@ -2352,7 +2495,16 @@ function applyGenericMcpSetup(plan) {
2352
2495
  if (!plan.changed) return { ...plan, state: plan.state === "missing" ? "missing" : "current" };
2353
2496
  const loaded = loadGlobalConfig(plan.storeRoot);
2354
2497
  if (plan.action === "remove") {
2355
- delete loaded.config.settings.harnesses[plan.harnessId];
2498
+ const prior = loaded.config.settings.harnesses[plan.harnessId];
2499
+ if (prior) {
2500
+ loaded.config.settings.harnesses[plan.harnessId] = {
2501
+ ...prior,
2502
+ selected: false,
2503
+ maximumMethod: null,
2504
+ mcpConnection: prior.mcpConnection ? { ...prior.mcpConnection, active: false } : void 0,
2505
+ lifecycleState: "disabled"
2506
+ };
2507
+ }
2356
2508
  } else if (plan.intent) {
2357
2509
  loaded.config.settings.harnesses[plan.harnessId] = {
2358
2510
  ...plan.intent,
@@ -2377,7 +2529,8 @@ function renderGenericMcpSetupResult(plan) {
2377
2529
  plan.review
2378
2530
  ];
2379
2531
  if (plan.configuration) {
2380
- lines.push("Client-owned configuration object:", JSON.stringify(plan.configuration, null, 2));
2532
+ const configuration = plan.state === "planned" ? redactMcpNativeValue(plan.configuration) : plan.configuration;
2533
+ lines.push("Client-owned configuration object:", JSON.stringify(configuration, null, 2));
2381
2534
  }
2382
2535
  if (plan.nextAction) lines.push(`Next: ${plan.nextAction}`);
2383
2536
  return `${lines.join("\n")}
@@ -2385,7 +2538,7 @@ function renderGenericMcpSetupResult(plan) {
2385
2538
  }
2386
2539
  function isCurrentGenericIntent(value, clientLabel) {
2387
2540
  return Boolean(
2388
- value?.selected === true && value.maximumMethod === "mcp" && value.profileKind === "generic-mcp" && value.clientLabel === clientLabel && value.lifecycleState === "active" && typeof value.proofSha256 === "string" && /^[a-f0-9]{64}$/.test(value.proofSha256) && typeof value.configurationDigest === "string" && /^[a-f0-9]{64}$/.test(value.configurationDigest)
2541
+ 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)
2389
2542
  );
2390
2543
  }
2391
2544
 
@@ -2538,12 +2691,12 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
2538
2691
  return;
2539
2692
  }
2540
2693
  if (parsed.command === "mcp") {
2541
- const { runMcpServer } = await import("./server-H754TA4Q.js");
2542
- await runMcpServer();
2694
+ const { runMcpServer } = await import("./server-FYRDPOBR.js");
2695
+ await runMcpServer({ profile: parsed.mcpProfile ?? "all" });
2543
2696
  return;
2544
2697
  }
2545
2698
  if (parsed.command === "update") {
2546
- const { runToolUpdateCommand } = await import("./self-36ULRIJ6.js");
2699
+ const { runToolUpdateCommand } = await import("./self-WRWI5XNE.js");
2547
2700
  await runToolUpdateCommand({
2548
2701
  yes: parsed.yes,
2549
2702
  ...parsed.targetDir ? { targetDir: path4.resolve(parsed.targetDir) } : {}
@@ -2551,25 +2704,28 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
2551
2704
  return;
2552
2705
  }
2553
2706
  if (parsed.command === "uninstall") {
2554
- const { runToolUninstallCommand } = await import("./self-36ULRIJ6.js");
2707
+ const { runToolUninstallCommand } = await import("./self-WRWI5XNE.js");
2555
2708
  await runToolUninstallCommand({ yes: parsed.yes, removeStore: parsed.removeStore });
2556
2709
  return;
2557
2710
  }
2558
2711
  validateParsedArgs(parsed);
2559
2712
  if (parsed.setupSubcommand === "system") {
2560
- const { runSystemSetupCommand } = await import("./setup-system-JI36YJ6D.js");
2713
+ const { runSystemSetupCommand } = await import("./setup-system-XX6NSVXZ.js");
2561
2714
  const result = await runSystemSetupCommand({
2562
2715
  dryRun: parsed.dryRun,
2563
2716
  yes: parsed.yes,
2717
+ rotateMcp: parsed.rotateMcp,
2564
2718
  promptForMethods: !parsed.yes && !parsed.dryRun && !parsed.json && Boolean(input.isTTY && output.isTTY),
2565
2719
  targetRoot: path4.resolve(parsed.targetDir ?? process.cwd()),
2566
2720
  methods: {
2567
2721
  ...parsed.codexMethod !== void 0 ? { codex: parsed.codexMethod } : {},
2568
- ...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {}
2722
+ ...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {},
2723
+ ...parsed.githubCopilotMethod !== void 0 ? { "github-copilot": parsed.githubCopilotMethod } : {}
2569
2724
  },
2570
2725
  harnesses: {
2571
2726
  "claude-code": parsed.claudeCodeMethod !== void 0 || !parsed.noClaudeCode,
2572
- codex: parsed.codexMethod !== void 0 || !parsed.noCodex
2727
+ codex: parsed.codexMethod !== void 0 || !parsed.noCodex,
2728
+ "github-copilot": parsed.githubCopilotMethod !== void 0 && !parsed.noGithubCopilot
2573
2729
  },
2574
2730
  ...!parsed.json && output.isTTY ? { onReview: (review) => note(review, "This computer") } : {}
2575
2731
  });
@@ -2634,6 +2790,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
2634
2790
  remove: parsed.remove,
2635
2791
  noCodex: parsed.noCodex,
2636
2792
  noClaudeCode: parsed.noClaudeCode,
2793
+ ...parsed.noGithubCopilot ? { noGithubCopilot: true } : {},
2637
2794
  skillScope: parsed.skillScope,
2638
2795
  selectedSkills: parsed.selectedSkills === void 0 ? void 0 : [...parsed.selectedSkills],
2639
2796
  skillsManifest: parsed.skillsManifest,
@@ -2675,6 +2832,74 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
2675
2832
  `Store compatibility preview stopped setup: ${storeBridgePreview.blockers.join("; ")} ${storeBridgePreview.nextAction}`
2676
2833
  );
2677
2834
  }
2835
+ const checkoutMove = previewInstallationCheckoutMove(targetDir, void 0, storeRoot);
2836
+ if (checkoutMove.candidates.length) {
2837
+ if (!jsonOutput) {
2838
+ output.write(`Project ID: ${checkoutMove.projectId}
2839
+ Current path: ${checkoutMove.targetRoot}
2840
+ `);
2841
+ for (const candidate2 of checkoutMove.candidates) {
2842
+ output.write(`Saved checkout: ${candidate2.sourceRoot} (${candidate2.checkoutId})
2843
+ `);
2844
+ for (const blocker of candidate2.blockers) output.write(`- ${blocker}
2845
+ `);
2846
+ }
2847
+ output.write("Choose Move this checkout, Register a separate checkout, or Cancel.\n");
2848
+ }
2849
+ if (!interactive || parsed.dryRun) {
2850
+ 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.";
2851
+ 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 });
2852
+ else output.write(`Next: ${nextAction}
2853
+ `);
2854
+ return;
2855
+ }
2856
+ const selected = await select({
2857
+ message: "How should setup treat this path?",
2858
+ options: [
2859
+ ...checkoutMove.candidates.map((candidate2) => ({ value: `move:${candidate2.checkoutId}`, label: `Move this checkout from ${candidate2.sourceRoot}`, hint: candidate2.blockers[0], disabled: !candidate2.available })),
2860
+ { value: "separate", label: "Register a separate checkout", hint: "Create a new checkout ID for this project." },
2861
+ { value: "cancel", label: "Cancel", hint: "Keep all paths and Store rows as they are." }
2862
+ ]
2863
+ });
2864
+ if (isCancel(selected) || selected === "cancel") {
2865
+ output.write("Setup cancelled. No checkout path changed.\n");
2866
+ return;
2867
+ }
2868
+ if (selected === "separate") {
2869
+ const approved2 = await confirm({ message: `Register ${targetDir} as a separate checkout for project ${checkoutMove.projectId}?`, initialValue: false, active: "Yes", inactive: "No", withGuide: true });
2870
+ if (isCancel(approved2) || !approved2) {
2871
+ output.write("Setup cancelled. No checkout was registered.\n");
2872
+ return;
2873
+ }
2874
+ const digest = checkoutMove.separateReviewDigest;
2875
+ if (!digest) throw new Error("Separate checkout registration is blocked. Preview again.");
2876
+ const registration = await invokeOperation("project.checkout-register.apply", { targetRoot: targetDir, reviewDigest: digest }, createExecutionContext({
2877
+ surface: "cli",
2878
+ route: resolvedLaunch.launch.route,
2879
+ callerIdentityRaw: resolvedLaunch.launch.callerIdentityRaw,
2880
+ callerReference: resolvedLaunch.launch.callerReference,
2881
+ cwd: targetDir,
2882
+ writesAllowed: true,
2883
+ storeRoot
2884
+ }));
2885
+ const result2 = registration.value;
2886
+ output.write(`Separate checkout registered: ${result2.checkoutId}. Project files have not changed.
2887
+ `);
2888
+ return runCli(argv, priorProjectRecovery, priorProjectMutationApplied);
2889
+ }
2890
+ const sourceCheckoutId = String(selected).slice("move:".length);
2891
+ const candidate = checkoutMove.candidates.find((item) => item.checkoutId === sourceCheckoutId);
2892
+ if (!candidate?.available || !candidate.reviewDigest) throw new Error("The selected checkout move is blocked. Preview again.");
2893
+ const approved = await confirm({ message: `Move checkout ${sourceCheckoutId} from ${candidate.sourceRoot} to ${targetDir}? Review: ${candidate.reviewDigest}`, initialValue: false, active: "Yes", inactive: "No", withGuide: true });
2894
+ if (isCancel(approved) || !approved) {
2895
+ output.write("Setup cancelled. No checkout path changed.\n");
2896
+ return;
2897
+ }
2898
+ const result = applyInstallationCheckoutMove(targetDir, sourceCheckoutId, candidate.sourceRoot, candidate.reviewDigest, storeRoot);
2899
+ output.write(`Checkout move completed: ${result.checkoutId}. Project files have not changed.
2900
+ `);
2901
+ return runCli(argv, priorProjectRecovery, priorProjectMutationApplied);
2902
+ }
2678
2903
  const projectRecoveryReview = prepareSetupProjectRecoveryReview(targetDir, storeRoot);
2679
2904
  if (projectRecoveryReview) {
2680
2905
  if (!jsonOutput) output.write(renderSetupProjectRecovery(projectRecoveryReview));
@@ -2833,7 +3058,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
2833
3058
  });
2834
3059
  }
2835
3060
  if (!freshInstallTarget) {
2836
- const { detectPreV2Install, promptPreV2Choice } = await import("./self-36ULRIJ6.js");
3061
+ const { detectPreV2Install, promptPreV2Choice } = await import("./self-WRWI5XNE.js");
2837
3062
  const preV2 = detectPreV2Install({
2838
3063
  targetDir,
2839
3064
  classification: compatibilityClassification
@@ -2885,7 +3110,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
2885
3110
  }
2886
3111
  let interactiveMethodSelections = {};
2887
3112
  if (interactive) {
2888
- const { inspectSystemHarnesses, promptForSystemSetupMethods } = await import("./setup-system-JI36YJ6D.js");
3113
+ const { inspectSystemHarnesses, promptForSystemSetupMethods } = await import("./setup-system-XX6NSVXZ.js");
2889
3114
  const harnessSupport = inspectSystemHarnesses();
2890
3115
  const afterHarnessSelection = async (wizardSelections) => {
2891
3116
  interactiveMethodSelections = await promptForSystemSetupMethods({
@@ -2894,11 +3119,13 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
2894
3119
  promptForMethods: true,
2895
3120
  methods: {
2896
3121
  ...parsed.codexMethod !== void 0 ? { codex: parsed.codexMethod } : {},
2897
- ...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {}
3122
+ ...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {},
3123
+ ...parsed.githubCopilotMethod !== void 0 ? { "github-copilot": parsed.githubCopilotMethod } : {}
2898
3124
  },
2899
3125
  harnesses: {
2900
3126
  codex: wizardSelections.harnesses.codex,
2901
- "claude-code": wizardSelections.harnesses["claude-code"]
3127
+ "claude-code": wizardSelections.harnesses["claude-code"],
3128
+ "github-copilot": wizardSelections.harnesses["github-copilot"]
2902
3129
  },
2903
3130
  projectHarnessIntegrations: makeDocsConfig.harnessIntegrations,
2904
3131
  targetRoot: targetDir,
@@ -2961,7 +3188,7 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
2961
3188
  applyPreparedSystemSetup,
2962
3189
  prepareSystemSetupCommand,
2963
3190
  resumePendingSystemSetupCommand
2964
- } = await import("./setup-system-JI36YJ6D.js");
3191
+ } = await import("./setup-system-XX6NSVXZ.js");
2965
3192
  const systemOptions = {
2966
3193
  dryRun: parsed.dryRun,
2967
3194
  yes: parsed.yes,
@@ -2969,13 +3196,16 @@ async function runCli(argv = process.argv.slice(2), priorProjectRecovery = null,
2969
3196
  methods: {
2970
3197
  ...interactiveMethodSelections,
2971
3198
  ...parsed.codexMethod !== void 0 ? { codex: parsed.codexMethod } : {},
2972
- ...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {}
3199
+ ...parsed.claudeCodeMethod !== void 0 ? { "claude-code": parsed.claudeCodeMethod } : {},
3200
+ ...parsed.githubCopilotMethod !== void 0 ? { "github-copilot": parsed.githubCopilotMethod } : {}
2973
3201
  },
2974
3202
  harnesses: {
2975
3203
  "claude-code": selections.harnesses["claude-code"],
2976
- codex: selections.harnesses.codex
3204
+ codex: selections.harnesses.codex,
3205
+ "github-copilot": selections.harnesses["github-copilot"]
2977
3206
  },
2978
3207
  projectHarnessIntegrations: makeDocsConfig.harnessIntegrations,
3208
+ manualMcpOutput: !jsonOutput,
2979
3209
  targetRoot: targetDir,
2980
3210
  persistIntent: true
2981
3211
  };
@@ -3479,9 +3709,9 @@ Next: ${nextAction}
3479
3709
  if (!jsonOutput && appliedGenericMcpPlan?.configuration) {
3480
3710
  output.write(renderGenericMcpSetupResult(appliedGenericMcpPlan));
3481
3711
  }
3482
- if (["blocked", "failed", "recovery"].includes(systemSetup.status)) {
3483
- 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.recoveryAction });
3484
- else output.write(`Setup stopped at machine scope. ${systemSetup.recoveryAction ?? "Review the machine state."}
3712
+ if (systemSetup.projectMayProceed === false || systemSetup.projectMayProceed === void 0 && ["blocked", "failed", "recovery"].includes(systemSetup.status)) {
3713
+ 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 });
3714
+ else output.write(`Setup stopped at machine scope. ${systemSetup.nextAction ?? "Review the machine state."}
3485
3715
  `);
3486
3716
  return;
3487
3717
  }
@@ -3644,7 +3874,7 @@ Next: ${nextAction}
3644
3874
  }
3645
3875
  if (jsonOutput) {
3646
3876
  writeCanonicalSetupResult({
3647
- status: "complete",
3877
+ status: systemSetup.status === "partial" ? "partial" : "complete",
3648
3878
  dryRun: false,
3649
3879
  targetRoot: targetDir,
3650
3880
  system: systemSetup,
@@ -3656,8 +3886,24 @@ Next: ${nextAction}
3656
3886
  projectMutationState: projectPrerequisiteChanged || applied.mutationApplied ? "applied" : "none",
3657
3887
  projectActions: applied.appliedActions,
3658
3888
  failedCondition: null,
3659
- nextAction: null
3889
+ nextAction: systemSetup.blocked[0]?.nextAction ?? null
3660
3890
  });
3891
+ } else if (systemSetup.status === "partial") {
3892
+ output.write("Project setup: ready. MCP setup still needs manual work for these platforms:\n");
3893
+ for (const item of systemSetup.blocked) {
3894
+ output.write(`- ${item.harness}: pending. ${item.reason}
3895
+ `);
3896
+ output.write(` Next: ${item.nextAction}
3897
+ `);
3898
+ const manual = systemSetup.manualInstructions?.find((entry) => entry.harness === item.harness);
3899
+ if (manual) {
3900
+ output.write(` Add this one-time MCP entry in ${manual.path} (${manual.entryId}):
3901
+ `);
3902
+ output.write(`${manual.text}
3903
+ `);
3904
+ output.write(" The client may still block this entry by policy. Run setup again after you add it.\n");
3905
+ }
3906
+ }
3661
3907
  }
3662
3908
  }
3663
3909
  async function runProjectPathHygieneCommand(argv, repair = false, launch = resolveCliOperationLaunch()) {
@@ -3833,12 +4079,14 @@ function resolveSelections(options) {
3833
4079
  if (parsed.noClaudeCode) {
3834
4080
  selections.harnesses["claude-code"] = false;
3835
4081
  }
4082
+ if (parsed.noGithubCopilot) selections.harnesses["github-copilot"] = false;
3836
4083
  if (parsed.codexMethod !== void 0) {
3837
4084
  selections.harnesses.codex = true;
3838
4085
  }
3839
4086
  if (parsed.claudeCodeMethod !== void 0) {
3840
4087
  selections.harnesses["claude-code"] = true;
3841
4088
  }
4089
+ if (parsed.githubCopilotMethod !== void 0) selections.harnesses["github-copilot"] = true;
3842
4090
  if (parsed.noSkills) {
3843
4091
  selections.skills = false;
3844
4092
  selections.selectedSkills = [];
@@ -3909,7 +4157,7 @@ function reconcileExistingInstallSkillSelection(options) {
3909
4157
  }
3910
4158
  function hasSelectionOverrides(parsed) {
3911
4159
  return Boolean(
3912
- 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
4160
+ 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
3913
4161
  );
3914
4162
  }
3915
4163
  function isLifecycleCommand(parsed) {
@@ -3919,7 +4167,7 @@ async function loadUninstallCommand() {
3919
4167
  if (uninstallCommandLoaderOverride) {
3920
4168
  return uninstallCommandLoaderOverride();
3921
4169
  }
3922
- const uninstallModule = await import("./uninstall-VBGMQQLA.js");
4170
+ const uninstallModule = await import("./uninstall-3YJKZ6UF.js");
3923
4171
  if (typeof uninstallModule.runUninstallCommand !== "function") {
3924
4172
  throw new Error(
3925
4173
  "The `uninstall` command module must export `runUninstallCommand(options)`."
@@ -3932,7 +4180,7 @@ async function runSkillsCommand(options) {
3932
4180
  await skillsCommandRunnerOverride(options);
3933
4181
  return;
3934
4182
  }
3935
- const skillsModule = await import("./skills-command-IGDVLNKY.js");
4183
+ const skillsModule = await import("./skills-command-YAQP24JM.js");
3936
4184
  await skillsModule.runSkillsCommand(options);
3937
4185
  }
3938
4186
  function getSelectionOverrideFlags(parsed) {
@@ -3955,12 +4203,14 @@ function getSelectionOverrideFlags(parsed) {
3955
4203
  if (parsed.noClaudeCode) {
3956
4204
  flags.push("--no-claude-code");
3957
4205
  }
4206
+ if (parsed.noGithubCopilot) flags.push("--no-github-copilot");
3958
4207
  if (parsed.codexMethod !== void 0) {
3959
4208
  flags.push("--codex-method");
3960
4209
  }
3961
4210
  if (parsed.claudeCodeMethod !== void 0) {
3962
4211
  flags.push("--claude-code-method");
3963
4212
  }
4213
+ if (parsed.githubCopilotMethod !== void 0) flags.push("--github-copilot-method");
3964
4214
  if (parsed.genericMcpClient !== void 0) flags.push("--generic-mcp-client");
3965
4215
  if (parsed.genericMcpAction !== void 0) flags.push("--generic-mcp-action");
3966
4216
  if (parsed.noSkills) {
@@ -3993,6 +4243,7 @@ function parseArgs(argv) {
3993
4243
  noWork: false,
3994
4244
  noCodex: false,
3995
4245
  noClaudeCode: false,
4246
+ noGithubCopilot: false,
3996
4247
  json: false,
3997
4248
  noSkills: false,
3998
4249
  runArgs: []
@@ -4039,11 +4290,23 @@ function parseArgs(argv) {
4039
4290
  return parsed;
4040
4291
  }
4041
4292
  if (parsed.command === "mcp") {
4042
- for (const arg of args) {
4293
+ while (args.length > 0) {
4294
+ const arg = args.shift();
4043
4295
  if (arg === "--help" || arg === "-h") {
4044
4296
  parsed.help = true;
4045
4297
  continue;
4046
4298
  }
4299
+ if (arg === "--profile") {
4300
+ if (parsed.mcpProfile !== void 0) {
4301
+ throw new Error("--profile can be supplied only once.");
4302
+ }
4303
+ const profile = args.shift();
4304
+ if (profile === void 0 || profile.startsWith("-")) {
4305
+ throw new Error(`--profile requires a name. Allowed profiles: ${MCP_SERVER_PROFILES.join(", ")}.`);
4306
+ }
4307
+ parsed.mcpProfile = parseMcpServerProfile(profile);
4308
+ continue;
4309
+ }
4047
4310
  throw new Error(`Unknown argument: ${arg}`);
4048
4311
  }
4049
4312
  return parsed;
@@ -4101,6 +4364,9 @@ function parseArgs(argv) {
4101
4364
  case "--no-claude":
4102
4365
  parsed.noClaudeCode = true;
4103
4366
  break;
4367
+ case "--no-github-copilot":
4368
+ parsed.noGithubCopilot = true;
4369
+ break;
4104
4370
  case "--codex-method": {
4105
4371
  const value = args.shift();
4106
4372
  if (value !== "none" && value !== "mcp" && value !== "command-rules") {
@@ -4117,6 +4383,12 @@ function parseArgs(argv) {
4117
4383
  parsed.claudeCodeMethod = value;
4118
4384
  break;
4119
4385
  }
4386
+ case "--github-copilot-method": {
4387
+ const value = args.shift();
4388
+ if (value !== "none" && value !== "mcp") throw new Error("`--github-copilot-method` must be none or mcp.");
4389
+ parsed.githubCopilotMethod = value;
4390
+ break;
4391
+ }
4120
4392
  case "--generic-mcp-client": {
4121
4393
  const value = args.shift();
4122
4394
  if (!value) throw new Error("`--generic-mcp-client` requires a stable local client label.");
@@ -4131,6 +4403,9 @@ function parseArgs(argv) {
4131
4403
  parsed.genericMcpAction = value;
4132
4404
  break;
4133
4405
  }
4406
+ case "--rotate-mcp":
4407
+ parsed.rotateMcp = true;
4408
+ break;
4134
4409
  case "--no-skills":
4135
4410
  parsed.noSkills = true;
4136
4411
  break;
@@ -4296,7 +4571,8 @@ function renderSystemSetupResult(result) {
4296
4571
  const lines = [
4297
4572
  `Machine setup: ${result.status}.`,
4298
4573
  `Codex method: ${result.selections.codex}.`,
4299
- `Claude Code method: ${result.selections["claude-code"]}.`
4574
+ `Claude Code method: ${result.selections["claude-code"]}.`,
4575
+ `GitHub Copilot method: ${result.selections["github-copilot"] ?? "none"}.`
4300
4576
  ];
4301
4577
  for (const blocked of result.blocked) {
4302
4578
  lines.push(`${blocked.harness}: ${blocked.reason}`);
@@ -4324,7 +4600,7 @@ function storePrerequisiteFailureAction(error) {
4324
4600
  return "Correct the reported Store prerequisite, then run `make-docs setup` again to review a new exact bridge plan.";
4325
4601
  }
4326
4602
  function writeCanonicalSetupResult(input2) {
4327
- const selections = input2.system?.selections ?? input2.prepared?.selections ?? { codex: "none", "claude-code": "none" };
4603
+ const selections = input2.system?.selections ?? input2.prepared?.selections ?? { codex: "none", "claude-code": "none", "github-copilot": "none" };
4328
4604
  const plans = input2.prepared?.plans ?? [];
4329
4605
  output.write(`${JSON.stringify({
4330
4606
  schemaVersion: 2,
@@ -4334,16 +4610,31 @@ function writeCanonicalSetupResult(input2) {
4334
4610
  targetRoot: input2.targetRoot,
4335
4611
  machine: {
4336
4612
  selections,
4337
- states: plans.map((plan) => ({
4338
- harness: plan.harness,
4339
- method: plan.method,
4340
- state: plan.status,
4341
- attemptedWork: [...plan.operations],
4342
- mutationState: input2.system ? input2.system.mutationState === "partial" ? "partial" : input2.system.mutationState === "verified" && plan.changed && input2.system.configured.includes(plan.harness) ? "applied" : "none" : plan.changed ? input2.dryRun ? "planned" : "none" : "none",
4343
- detail: plan.detail
4344
- })),
4613
+ projectMayProceed: input2.system?.projectMayProceed ?? null,
4614
+ states: plans.map((plan) => {
4615
+ const pending = input2.status === "partial" && input2.system?.projectMayProceed === true && !input2.system.recoveryAction && input2.system.blocked.some((item) => item.harness === plan.harness);
4616
+ const state = input2.system?.configured.includes(plan.harness) ? "current" : pending ? "pending" : plan.status;
4617
+ return {
4618
+ harness: plan.harness,
4619
+ method: plan.method,
4620
+ state,
4621
+ ...plan.harness === "github-copilot" ? { clients: [
4622
+ { client: "cli", state },
4623
+ { client: "app", state: "blocked", nextAction: "Open a real app session and verify the effective Make Docs entry. App-installed entries are user-owned." }
4624
+ ] } : {},
4625
+ attemptedWork: [...plan.operations],
4626
+ 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",
4627
+ detail: plan.detail,
4628
+ ...input2.system?.blocked.find((item) => item.harness === plan.harness) ? {
4629
+ nextAction: input2.system.blocked.find((item) => item.harness === plan.harness).nextAction
4630
+ } : {}
4631
+ };
4632
+ }),
4345
4633
  configured: input2.system?.configured ?? [],
4346
- ...input2.genericMcp ? { genericMcp: input2.genericMcp } : {}
4634
+ ...input2.genericMcp ? { genericMcp: {
4635
+ ...input2.genericMcp,
4636
+ configuration: input2.genericMcp.configuration ? redactMcpNativeValue(input2.genericMcp.configuration) : null
4637
+ } } : {}
4347
4638
  },
4348
4639
  store: input2.storeBridge ? {
4349
4640
  state: input2.storeBridge.storeState,
@@ -4356,7 +4647,9 @@ function writeCanonicalSetupResult(input2) {
4356
4647
  nextAction: input2.storeBridge.nextAction
4357
4648
  } : null,
4358
4649
  projectRecovery: input2.projectRecovery ?? null,
4650
+ checkoutMove: input2.checkoutMove ?? null,
4359
4651
  project: {
4652
+ state: input2.status === "complete" || input2.status === "partial" ? "ready" : input2.status,
4360
4653
  changed: input2.projectChanged,
4361
4654
  mutationState: input2.projectMutationState ?? (input2.projectChanged ? input2.dryRun ? "planned" : "applied" : "none"),
4362
4655
  actions: [...input2.projectActions].sort((left, right) => left.relativePath.localeCompare(right.relativePath)).map((action) => ({ path: action.relativePath, action: action.type }))
@@ -4367,13 +4660,19 @@ function writeCanonicalSetupResult(input2) {
4367
4660
  `);
4368
4661
  }
4369
4662
  function validateParsedArgs(parsed) {
4663
+ if (parsed.rotateMcp && (parsed.command !== "setup" || parsed.setupSubcommand !== "system")) {
4664
+ throw new Error("`--rotate-mcp` is valid only with `make-docs setup system`.");
4665
+ }
4370
4666
  if (parsed.codexMethod !== void 0 && parsed.noCodex) {
4371
4667
  throw new Error("`--codex-method` cannot be combined with `--no-codex`.");
4372
4668
  }
4373
4669
  if (parsed.claudeCodeMethod !== void 0 && parsed.noClaudeCode) {
4374
4670
  throw new Error("`--claude-code-method` cannot be combined with `--no-claude-code`.");
4375
4671
  }
4376
- if ((parsed.codexMethod !== void 0 || parsed.claudeCodeMethod !== void 0 || parsed.genericMcpClient !== void 0 || parsed.genericMcpAction !== void 0) && (parsed.command !== "setup" || ["skills", "backup", "remove"].includes(parsed.setupSubcommand ?? ""))) {
4672
+ if (parsed.githubCopilotMethod !== void 0 && parsed.noGithubCopilot) {
4673
+ throw new Error("`--github-copilot-method` cannot be combined with `--no-github-copilot`.");
4674
+ }
4675
+ 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 ?? ""))) {
4377
4676
  throw new Error("Harness and generic MCP flags are valid only with setup, setup reconfigure, or setup system.");
4378
4677
  }
4379
4678
  if (parsed.json && (parsed.command !== "setup" || ["skills", "backup", "remove"].includes(parsed.setupSubcommand ?? ""))) {
@@ -4785,11 +5084,13 @@ var SETUP_SHARED_OPTIONS = `General options:
4785
5084
  Harness options:
4786
5085
  --codex-method <none|mcp|command-rules>
4787
5086
  --claude-code-method <none|mcp|permission-rules>
5087
+ --github-copilot-method <none|mcp>
4788
5088
  --generic-mcp-client <label> Add one bounded generic MCP client profile.
4789
5089
  --generic-mcp-action <configure|rotate|repair|remove>
4790
5090
  Choose its repeat-safe lifecycle action.
4791
5091
  --no-codex Skip the Codex harness.
4792
5092
  --no-claude-code Skip the Claude Code harness.
5093
+ --no-github-copilot Skip the GitHub Copilot CLI harness.
4793
5094
  Deprecated aliases: --no-agents, --no-claude
4794
5095
 
4795
5096
  Skill options:
@@ -4821,11 +5122,13 @@ Content options:
4821
5122
  Harness options:
4822
5123
  --codex-method <none|mcp|command-rules>
4823
5124
  --claude-code-method <none|mcp|permission-rules>
5125
+ --github-copilot-method <none|mcp>
4824
5126
  --generic-mcp-client <label> Add one bounded generic MCP client profile.
4825
5127
  --generic-mcp-action <configure|rotate|repair|remove>
4826
5128
  Choose its repeat-safe lifecycle action.
4827
5129
  --no-codex Skip the Codex harness.
4828
5130
  --no-claude-code Skip the Claude Code harness.
5131
+ --no-github-copilot Skip the GitHub Copilot CLI harness.
4829
5132
  Deprecated aliases: --no-agents, --no-claude
4830
5133
 
4831
5134
  Skill selections:
@@ -4841,7 +5144,7 @@ function printHelp(command, setupSubcommand) {
4841
5144
  case "system":
4842
5145
  output.write(`make-docs setup system
4843
5146
 
4844
- Review and configure machine-level support for Codex and Claude Code.
5147
+ Review and configure machine-level support for Codex, Claude Code, and GitHub Copilot CLI.
4845
5148
  Harness detection is a hint. It does not prove support and does not limit choice.
4846
5149
  Each planned method names the operations it enables and the machine files it changes.
4847
5150
 
@@ -4855,15 +5158,19 @@ Options:
4855
5158
  --json Emit only the canonical setup result JSON.
4856
5159
  --codex-method <none|mcp|command-rules>
4857
5160
  --claude-code-method <none|mcp|permission-rules>
5161
+ --github-copilot-method <none|mcp>
4858
5162
  --generic-mcp-client <label> Print a bounded client-owned MCP configuration.
4859
5163
  --generic-mcp-action <configure|rotate|repair|remove>
4860
5164
  --no-codex Skip Codex support.
4861
5165
  --no-claude-code Skip Claude Code support.
5166
+ --no-github-copilot Skip GitHub Copilot CLI support.
5167
+ --rotate-mcp Replace keys for selected first-party MCP methods.
4862
5168
  --help, -h Show help for this command.
4863
5169
 
4864
5170
  Examples:
4865
5171
  make-docs setup system --codex-method mcp --claude-code-method none --dry-run
4866
5172
  make-docs setup system --codex-method command-rules --no-claude-code --yes
5173
+ make-docs setup system --github-copilot-method mcp --no-codex --no-claude-code --dry-run
4867
5174
  `);
4868
5175
  return;
4869
5176
  case "reconfigure":
@@ -5090,14 +5397,29 @@ Examples:
5090
5397
  Run the TypeScript-owned make-docs MCP server over stdio.
5091
5398
 
5092
5399
  Usage:
5093
- make-docs mcp [--help]
5400
+ make-docs mcp [--profile <name>] [--help]
5401
+
5402
+ Options:
5403
+ --profile <name> Choose tools and native resources for one task. Default: all.
5404
+ --help, -h Show help for this command.
5405
+
5406
+ Profiles:
5407
+ core Installed state, config, common resource tools, and operation domains.
5408
+ setup Install plans, repair, compatibility, and layout.
5409
+ workflow Lifecycle, project context, and work evidence.
5410
+ quality Requirements, performance evidence, and user test checks.
5411
+ backlog Backlog snapshots and the review cache.
5412
+ all All ready tools and native resources.
5094
5413
 
5095
5414
  Behavior:
5415
+ The default all profile keeps the existing single-server connection working.
5416
+ Native resource lists and reads use the selected profile.
5096
5417
  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.
5097
5418
  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.
5098
5419
 
5099
5420
  Examples:
5100
5421
  make-docs mcp
5422
+ make-docs mcp --profile backlog
5101
5423
  `);
5102
5424
  return;
5103
5425
  case "update":