@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
@@ -5,10 +5,10 @@ import {
5
5
  prepareBackupExecution,
6
6
  resolveBackupDestinationPlan,
7
7
  runBackupCommand
8
- } from "./chunk-LV3CBXZB.js";
9
- import "./chunk-GERMRLJ2.js";
8
+ } from "./chunk-DNPFQB24.js";
9
+ import "./chunk-KFYUB4AX.js";
10
10
  import "./chunk-3EXHM5L2.js";
11
- import "./chunk-YVSASZMT.js";
11
+ import "./chunk-SFKYGFUV.js";
12
12
  import "./chunk-D4HDZEJT.js";
13
13
  export {
14
14
  compareBackupRelativePathDepth,
@@ -17,4 +17,4 @@ export {
17
17
  resolveBackupDestinationPlan,
18
18
  runBackupCommand
19
19
  };
20
- //# sourceMappingURL=backup-CM7RL2Q7.js.map
20
+ //# sourceMappingURL=backup-P5NUPAJL.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  assertManagedPathHasNoSymlinks,
4
4
  platform
5
- } from "./chunk-YVSASZMT.js";
5
+ } from "./chunk-SFKYGFUV.js";
6
6
 
7
7
  // src/harness-access/contract.ts
8
8
  import { createHash } from "crypto";
@@ -400,7 +400,7 @@ function assertHarnessCallerIdentityShape(value) {
400
400
  ])) {
401
401
  throw new Error("The harness caller identity has an invalid object shape.");
402
402
  }
403
- if (value.schemaVersion !== 1 || value.kind !== "make-docs-harness-caller" && value.kind !== "make-docs-generic-mcp-caller" || typeof value.adapterId !== "string" || !value.adapterId.trim() || !Number.isSafeInteger(value.adapterVersion) || value.adapterVersion < 1 || (generic ? typeof value.harnessId !== "string" || !/^generic-mcp-[a-z][a-z0-9-]*$/.test(value.harnessId) : value.harnessId !== "codex" && value.harnessId !== "claude-code") || !["mcp", "command-rules", "permission-rules"].includes(value.connectionMethod) || value.scope !== "machine" || typeof value.root !== "string" || !path.isAbsolute(value.root)) {
403
+ if (value.schemaVersion !== 1 || value.kind !== "make-docs-harness-caller" && value.kind !== "make-docs-generic-mcp-caller" || typeof value.adapterId !== "string" || !value.adapterId.trim() || !Number.isSafeInteger(value.adapterVersion) || value.adapterVersion < 1 || (generic ? typeof value.harnessId !== "string" || !/^generic-mcp-[a-z][a-z0-9-]*$/.test(value.harnessId) : value.harnessId !== "codex" && value.harnessId !== "claude-code" && value.harnessId !== "github-copilot") || !["mcp", "command-rules", "permission-rules"].includes(value.connectionMethod) || value.scope !== "machine" || typeof value.root !== "string" || !path.isAbsolute(value.root)) {
404
404
  throw new Error("The harness caller identity fields are invalid.");
405
405
  }
406
406
  if (generic && (value.adapterId !== "generic-mcp" || value.adapterVersion !== 1 || value.connectionMethod !== "mcp" || typeof value.proof !== "string" || !/^[A-Za-z0-9_-]{32,}$/.test(value.proof))) {
@@ -473,6 +473,61 @@ function sortJson(value) {
473
473
  return value;
474
474
  }
475
475
 
476
+ // src/mcp-connection.ts
477
+ import { createHash as createHash2, randomBytes, randomUUID, timingSafeEqual } from "crypto";
478
+ var MCP_CONNECTION_ID_ENV = "MAKE_DOCS_MCP_CONNECTION_ID";
479
+ var MCP_CONNECTION_KEY_ENV = "MAKE_DOCS_MCP_CONNECTION_KEY";
480
+ var REDACTED_MCP_CONNECTION_KEY = "<redacted-mcp-connection-key>";
481
+ function createMcpConnection(owner) {
482
+ const id = randomUUID();
483
+ const key = randomBytes(32).toString("base64url");
484
+ return {
485
+ id,
486
+ key,
487
+ record: { id, keySha256: hashMcpConnectionKey(key), active: true, method: "mcp", owner }
488
+ };
489
+ }
490
+ function hashMcpConnectionKey(key) {
491
+ return createHash2("sha256").update(key, "utf8").digest("hex");
492
+ }
493
+ function redactMcpNativeValue(value) {
494
+ if (typeof value === "string") {
495
+ return value.replace(
496
+ /(^MAKE_DOCS_MCP_CONNECTION_KEY\s*=\s*)"(?:[^"\\]|\\.)*"/m,
497
+ `$1${JSON.stringify(REDACTED_MCP_CONNECTION_KEY)}`
498
+ );
499
+ }
500
+ if (Array.isArray(value)) return value.map(redactMcpNativeValue);
501
+ if (value && typeof value === "object") {
502
+ return Object.fromEntries(Object.entries(value).map(([key, nested]) => [
503
+ key,
504
+ key === MCP_CONNECTION_KEY_ENV ? REDACTED_MCP_CONNECTION_KEY : redactMcpNativeValue(nested)
505
+ ]));
506
+ }
507
+ return value;
508
+ }
509
+ function isRedactedMcpNativeValue(value) {
510
+ if (typeof value === "string") {
511
+ return value.includes(`${MCP_CONNECTION_KEY_ENV} = ${JSON.stringify(REDACTED_MCP_CONNECTION_KEY)}`);
512
+ }
513
+ if (value && typeof value === "object" && !Array.isArray(value)) {
514
+ const env = value.env;
515
+ return !!env && typeof env === "object" && env[MCP_CONNECTION_KEY_ENV] === REDACTED_MCP_CONNECTION_KEY;
516
+ }
517
+ return false;
518
+ }
519
+ function matchMcpConnection(harnesses, id, key) {
520
+ if (!id || !key || !/^[0-9a-f-]{36}$/.test(id) || !/^[A-Za-z0-9_-]{43}$/.test(key)) return null;
521
+ for (const [owner, intent] of Object.entries(harnesses)) {
522
+ const record = intent.mcpConnection;
523
+ if (!record || !record.active || record.id !== id || record.owner !== owner || record.method !== "mcp") continue;
524
+ const actual = Buffer.from(hashMcpConnectionKey(key), "hex");
525
+ const expected = Buffer.from(record.keySha256, "hex");
526
+ if (expected.length === actual.length && timingSafeEqual(actual, expected)) return { owner, intent };
527
+ }
528
+ return null;
529
+ }
530
+
476
531
  // src/harness-access/native.ts
477
532
  import {
478
533
  closeSync,
@@ -487,7 +542,7 @@ import {
487
542
  writeFileSync
488
543
  } from "fs";
489
544
  import path2 from "path";
490
- import { randomUUID } from "crypto";
545
+ import { randomUUID as randomUUID2 } from "crypto";
491
546
  var harnessNativeMutationHookForTests = null;
492
547
  var CODEX_MCP_BEGIN = "# make-docs:begin harness-access codex mcp";
493
548
  var CODEX_MCP_END = "# make-docs:end harness-access codex mcp";
@@ -551,6 +606,9 @@ function planHarnessAccess(adapter, input) {
551
606
  const method2 = requireMethod(adapter, input.method, input.scope);
552
607
  validateExecutableIdentity(input.executable);
553
608
  assertSafeRoot(input.root);
609
+ const nativePath = method2.nativeFile(input.scope);
610
+ const beforeContent = readNativeContent(input.root, nativePath);
611
+ const mcpConnection = method2.id === "mcp" ? input.mcpConnection ?? parseNativeMcpConnection(method2.nativeFormat, beforeContent) ?? createMcpConnection(adapter.harnessId) : void 0;
554
612
  const desired = desiredEntry(
555
613
  adapter,
556
614
  method2,
@@ -558,10 +616,10 @@ function planHarnessAccess(adapter, input) {
558
616
  input.root,
559
617
  input.executable,
560
618
  input.commandRules,
561
- input.commandRuleAuthority
619
+ input.commandRuleAuthority,
620
+ mcpConnection
562
621
  );
563
622
  assertNativePath(input.root, desired.path);
564
- const beforeContent = readNativeContent(input.root, desired.path);
565
623
  const receiptEntry = receiptEntryFor(adapter, input, desired.path, desired.entryId);
566
624
  let change;
567
625
  let state;
@@ -707,6 +765,23 @@ function verifyHarnessAccess(adapter, input) {
707
765
  const method2 = requireMethod(adapter, input.method, input.scope);
708
766
  validateExecutableIdentity(input.executable);
709
767
  assertSafeRoot(input.root);
768
+ const nativeContent = method2.id === "mcp" ? readNativeContent(input.root, method2.nativeFile(input.scope)) : null;
769
+ const mcpConnection = method2.id === "mcp" ? parseNativeMcpConnection(method2.nativeFormat, nativeContent) : null;
770
+ if (method2.id === "mcp" && !mcpConnection) {
771
+ try {
772
+ const inspected = inspectEntry(method2.nativeFormat, nativeContent, "");
773
+ return verification(
774
+ adapter,
775
+ method2.id,
776
+ input.scope,
777
+ inspected.exists ? "blocked" : "missing",
778
+ [],
779
+ inspected.exists ? "The native MCP entry has no valid connection key." : "The native entry is absent."
780
+ );
781
+ } catch (error) {
782
+ return verification(adapter, method2.id, input.scope, "blocked", [], toMessage2(error));
783
+ }
784
+ }
710
785
  const desired = desiredEntry(
711
786
  adapter,
712
787
  method2,
@@ -714,10 +789,11 @@ function verifyHarnessAccess(adapter, input) {
714
789
  input.root,
715
790
  input.executable,
716
791
  input.commandRules,
717
- input.commandRuleAuthority
792
+ input.commandRuleAuthority,
793
+ mcpConnection ?? void 0
718
794
  );
719
795
  const receiptEntry = receiptEntryFor(adapter, input, desired.path, desired.entryId);
720
- const content = readNativeContent(input.root, desired.path);
796
+ const content = method2.id === "mcp" ? nativeContent : readNativeContent(input.root, desired.path);
721
797
  try {
722
798
  const inspected = inspectEntry(method2.nativeFormat, content, desired.value);
723
799
  if (!inspected.exists || inspected.value === null) {
@@ -799,7 +875,7 @@ function planHarnessAccessRemoval(adapter, input) {
799
875
  );
800
876
  state = "drifted";
801
877
  } else {
802
- const afterContent = removeEntry(method2.nativeFormat, beforeContent, receiptEntry.value);
878
+ const afterContent = removeEntry(method2.nativeFormat, beforeContent, inspected.value);
803
879
  change = {
804
880
  path: receiptEntry.path,
805
881
  entryId: receiptEntry.entryId,
@@ -905,12 +981,11 @@ function verifyRemovalPlan(adapter, plan) {
905
981
  return verification(adapter, plan.connectionMethod, plan.scope, "blocked", [], toMessage2(error));
906
982
  }
907
983
  }
908
- function desiredEntry(adapter, method2, scope, root, executable, commandRules, commandRuleAuthority) {
984
+ function desiredEntry(adapter, method2, scope, root, executable, commandRules, commandRuleAuthority, mcpConnection) {
909
985
  const nativePath = method2.nativeFile(scope);
910
- const callerIdentity = makeHarnessCallerIdentity(adapter, method2.id, root, executable);
911
- const encodedCallerIdentity = encodeHarnessCallerIdentity(callerIdentity);
912
986
  switch (method2.nativeFormat) {
913
987
  case "codex-mcp-toml": {
988
+ if (!mcpConnection) throw new Error("MCP setup needs a connection key.");
914
989
  const command = tomlString(executable.path);
915
990
  const value = [
916
991
  CODEX_MCP_BEGIN,
@@ -918,22 +993,44 @@ function desiredEntry(adapter, method2, scope, root, executable, commandRules, c
918
993
  `command = ${command}`,
919
994
  `args = [${tomlString("mcp")}]`,
920
995
  "[mcp_servers.make_docs.env]",
921
- `${HARNESS_CALLER_IDENTITY_ENV} = ${tomlString(encodedCallerIdentity)}`,
996
+ `${MCP_CONNECTION_ID_ENV} = ${tomlString(mcpConnection.id)}`,
997
+ `${MCP_CONNECTION_KEY_ENV} = ${tomlString(mcpConnection.key)}`,
922
998
  CODEX_MCP_END
923
999
  ].join("\n");
924
1000
  return { path: nativePath, entryId: "mcp_servers.make_docs", value };
925
1001
  }
1002
+ case "copilot-mcp-json":
1003
+ if (!mcpConnection) throw new Error("MCP setup needs a connection key.");
1004
+ return {
1005
+ path: nativePath,
1006
+ entryId: "mcpServers.make-docs",
1007
+ value: {
1008
+ type: "local",
1009
+ command: executable.path,
1010
+ args: ["mcp"],
1011
+ env: {
1012
+ [MCP_CONNECTION_ID_ENV]: mcpConnection.id,
1013
+ [MCP_CONNECTION_KEY_ENV]: mcpConnection.key
1014
+ },
1015
+ tools: ["*"]
1016
+ }
1017
+ };
926
1018
  case "claude-mcp-json":
1019
+ if (!mcpConnection) throw new Error("MCP setup needs a connection key.");
927
1020
  return {
928
1021
  path: nativePath,
929
1022
  entryId: "mcpServers.make-docs",
930
1023
  value: {
931
1024
  command: executable.path,
932
1025
  args: ["mcp"],
933
- env: { [HARNESS_CALLER_IDENTITY_ENV]: encodedCallerIdentity }
1026
+ env: {
1027
+ [MCP_CONNECTION_ID_ENV]: mcpConnection.id,
1028
+ [MCP_CONNECTION_KEY_ENV]: mcpConnection.key
1029
+ }
934
1030
  }
935
1031
  };
936
1032
  case "codex-command-rules": {
1033
+ const callerIdentity = makeHarnessCallerIdentity(adapter, method2.id, root, executable);
937
1034
  if (/\s/.test(executable.path)) {
938
1035
  throw new Error("Codex command rules need an executable path with no whitespace.");
939
1036
  }
@@ -952,6 +1049,7 @@ function desiredEntry(adapter, method2, scope, root, executable, commandRules, c
952
1049
  return { path: nativePath, entryId: "make-docs.command-rules", value: lines.join("\n") };
953
1050
  }
954
1051
  case "claude-permission-json": {
1052
+ const callerIdentity = makeHarnessCallerIdentity(adapter, method2.id, root, executable);
955
1053
  if (/\s/.test(executable.path)) {
956
1054
  throw new Error("Claude Code permission rules need an executable path with no whitespace.");
957
1055
  }
@@ -965,6 +1063,83 @@ function desiredEntry(adapter, method2, scope, root, executable, commandRules, c
965
1063
  }
966
1064
  }
967
1065
  }
1066
+ function readNativeMcpConnection(adapter, root) {
1067
+ const method2 = adapter.methods.find((candidate) => candidate.id === "mcp");
1068
+ if (!method2) return null;
1069
+ assertSafeRoot(root);
1070
+ const nativePath = method2.nativeFile("machine");
1071
+ assertNativePath(root, nativePath);
1072
+ return parseNativeMcpConnection(method2.nativeFormat, readNativeContent(root, nativePath));
1073
+ }
1074
+ function renderManualMcpEntry(adapter, root, executable, connection) {
1075
+ const method2 = requireMethod(adapter, "mcp", "machine");
1076
+ const desired = desiredEntry(adapter, method2, "machine", root, executable, void 0, void 0, connection);
1077
+ const value = method2.nativeFormat === "codex-mcp-toml" ? String(desired.value) : JSON.stringify({ mcpServers: { "make-docs": desired.value } }, null, 2);
1078
+ return { path: path2.resolve(root, desired.path), entryId: desired.entryId, text: value };
1079
+ }
1080
+ function verifyManualMcpEntry(adapter, root, executable, connection) {
1081
+ const method2 = requireMethod(adapter, "mcp", "machine");
1082
+ assertSafeRoot(root);
1083
+ const desired = desiredEntry(adapter, method2, "machine", root, executable, void 0, void 0, connection);
1084
+ assertNativePath(root, desired.path);
1085
+ try {
1086
+ const content = readNativeContent(root, desired.path);
1087
+ const actual = inspectEntry(method2.nativeFormat, content, desired.value);
1088
+ return actual.exists && actual.value !== null && fingerprintEntry(actual.value) === fingerprintEntry(desired.value);
1089
+ } catch {
1090
+ return false;
1091
+ }
1092
+ }
1093
+ function classifyPendingNativeMcpChange(adapter, plan) {
1094
+ if (plan.connectionMethod !== "mcp" || plan.changes.length !== 1) return "unknown";
1095
+ const method2 = requireMethod(adapter, "mcp", plan.scope);
1096
+ const change = plan.changes[0];
1097
+ assertSafeRoot(plan.root);
1098
+ assertNativePath(plan.root, change.path);
1099
+ const content = readNativeContent(plan.root, change.path);
1100
+ if (fingerprintFile(content) === change.beforeFileFingerprint) return "before";
1101
+ if (fingerprintFile(content) !== change.afterFileFingerprint) return "unknown";
1102
+ try {
1103
+ const inspected = inspectEntry(method2.nativeFormat, content, change.afterEntryValue);
1104
+ return inspected.exists && inspected.value !== null && fingerprintEntry(inspected.value) === change.afterEntryFingerprint && parseNativeMcpConnection(method2.nativeFormat, content) !== null ? "after" : "unknown";
1105
+ } catch {
1106
+ return "unknown";
1107
+ }
1108
+ }
1109
+ function parseNativeMcpConnection(format, content) {
1110
+ if (!content) return null;
1111
+ let env = null;
1112
+ if (format === "codex-mcp-toml") {
1113
+ const start = content.indexOf(CODEX_MCP_BEGIN);
1114
+ const end = content.indexOf(CODEX_MCP_END, start + CODEX_MCP_BEGIN.length);
1115
+ if (start < 0 || end < 0) return null;
1116
+ const block = content.slice(start, end);
1117
+ const values = {};
1118
+ for (const line of block.split("\n")) {
1119
+ const match = line.match(/^([A-Z_]+)\s*=\s*("(?:[^"\\]|\\.)*")\s*$/);
1120
+ if (!match) continue;
1121
+ try {
1122
+ values[match[1]] = JSON.parse(match[2]);
1123
+ } catch {
1124
+ return null;
1125
+ }
1126
+ }
1127
+ env = values;
1128
+ } else if (format === "claude-mcp-json" || format === "copilot-mcp-json") {
1129
+ try {
1130
+ const parsed = JSON.parse(content);
1131
+ const servers = parsed.mcpServers;
1132
+ const server = servers?.["make-docs"];
1133
+ const value = server?.env;
1134
+ if (value && typeof value === "object" && !Array.isArray(value)) env = value;
1135
+ } catch {
1136
+ return null;
1137
+ }
1138
+ }
1139
+ const id = env?.[MCP_CONNECTION_ID_ENV];
1140
+ const key = env?.[MCP_CONNECTION_KEY_ENV];
1141
+ return typeof id === "string" && typeof key === "string" ? { id, key } : null;
1142
+ }
968
1143
  function codexRuleLaunchPrefix(encodedCallerIdentity, executablePath) {
969
1144
  return Object.freeze([
970
1145
  executablePath,
@@ -1156,7 +1331,8 @@ function inspectEntry(format, content, expectedValue) {
1156
1331
  }
1157
1332
  case "codex-command-rules":
1158
1333
  return { exists: content.length > 0, value: content.length > 0 ? content : null };
1159
- case "claude-mcp-json": {
1334
+ case "claude-mcp-json":
1335
+ case "copilot-mcp-json": {
1160
1336
  const root = parseJsonObject(content);
1161
1337
  const servers = root.mcpServers;
1162
1338
  if (servers === void 0) return { exists: false, value: null };
@@ -1198,7 +1374,8 @@ ${value}
1198
1374
  case "codex-command-rules":
1199
1375
  if (typeof value !== "string") throw new Error("The Codex command-rule entry is malformed.");
1200
1376
  return value;
1201
- case "claude-mcp-json": {
1377
+ case "claude-mcp-json":
1378
+ case "copilot-mcp-json": {
1202
1379
  const root = content === null ? {} : parseJsonObject(content);
1203
1380
  const servers = root.mcpServers === void 0 ? {} : root.mcpServers;
1204
1381
  if (!isRecord(servers)) throw new Error("The native mcpServers value is not an object.");
@@ -1236,7 +1413,8 @@ function removeEntry(format, content, receiptValue) {
1236
1413
  }
1237
1414
  case "codex-command-rules":
1238
1415
  return null;
1239
- case "claude-mcp-json": {
1416
+ case "claude-mcp-json":
1417
+ case "copilot-mcp-json": {
1240
1418
  const root = parseJsonObject(content);
1241
1419
  if (!isRecord(root.mcpServers)) throw new Error("The native mcpServers value is not an object.");
1242
1420
  const servers = { ...root.mcpServers };
@@ -1725,7 +1903,7 @@ function receiptEntryFor(adapter, input, nativePath, entryId) {
1725
1903
  }
1726
1904
  function validateReceiptIdentity(adapter, input, receipt) {
1727
1905
  if (receipt.schemaVersion !== 1 && receipt.schemaVersion !== 2 || receipt.adapterId !== adapter.id || receipt.adapterVersion !== adapter.version || receipt.harnessId !== adapter.harnessId || receipt.connectionMethod !== input.method || receipt.scope !== input.scope || receipt.result !== "verified" || receipt.verificationResult !== "passed" || receipt.driftState !== "current" || receipt.recoveryStatus !== "complete" || !receipt.appliedVersion.trim() || !Number.isFinite(Date.parse(receipt.verifiedAt)) || receipt.entries.some(
1728
- (entry) => entry.ownership !== "make-docs" || fingerprintEntry(entry.value) !== entry.entryFingerprint || !/^[0-9a-f]{64}$/.test(entry.fileFingerprint)
1906
+ (entry) => entry.ownership !== "make-docs" || fingerprintEntry(entry.value) !== entry.entryFingerprint && !(receipt.connectionMethod === "mcp" && isRedactedMcpNativeValue(entry.value)) || !/^[0-9a-f]{64}$/.test(entry.fileFingerprint)
1729
1907
  )) {
1730
1908
  throw new Error("The harness receipt does not match this exact adapter, method, scope, and managed entry.");
1731
1909
  }
@@ -1864,7 +2042,7 @@ function writeNativeContent(root, relativePath, content, expectedBeforeFingerpri
1864
2042
  }
1865
2043
  const temporary = path2.join(
1866
2044
  parent,
1867
- `.${path2.basename(relativePath)}.${randomUUID()}.tmp`
2045
+ `.${path2.basename(relativePath)}.${randomUUID2()}.tmp`
1868
2046
  );
1869
2047
  writeFileSync(temporary, content, { encoding: "utf8", flag: "wx", mode: 384 });
1870
2048
  try {
@@ -2208,9 +2386,24 @@ var CLAUDE_CODE_HARNESS_ADAPTER = createHarnessAdapter({
2208
2386
  )
2209
2387
  ])
2210
2388
  });
2389
+ var GITHUB_COPILOT_HARNESS_ADAPTER = createHarnessAdapter({
2390
+ id: "make-docs.github-copilot",
2391
+ version: 1,
2392
+ harnessId: "github-copilot",
2393
+ displayName: "GitHub Copilot CLI",
2394
+ executableNames: Object.freeze(["copilot"]),
2395
+ projectRouterFiles: Object.freeze(["AGENTS.md"]),
2396
+ skillRoots: Object.freeze([".agents/skills"]),
2397
+ methods: Object.freeze([
2398
+ method("mcp", "copilot-mcp-json", () => ".copilot/mcp-config.json", {
2399
+ ownedEntry: "mcpServers.make-docs"
2400
+ })
2401
+ ])
2402
+ });
2211
2403
  var FIRST_PARTY_HARNESS_ADAPTERS = Object.freeze([
2212
2404
  CODEX_HARNESS_ADAPTER,
2213
- CLAUDE_CODE_HARNESS_ADAPTER
2405
+ CLAUDE_CODE_HARNESS_ADAPTER,
2406
+ GITHUB_COPILOT_HARNESS_ADAPTER
2214
2407
  ]);
2215
2408
  var PI_HARNESS_SUPPORT = Object.freeze({
2216
2409
  harnessId: "pi",
@@ -2324,6 +2517,17 @@ export {
2324
2517
  parseHarnessCallerIdentityValue,
2325
2518
  parseHarnessCallerIdentity,
2326
2519
  resolveHarnessMethodSupport,
2520
+ MCP_CONNECTION_ID_ENV,
2521
+ MCP_CONNECTION_KEY_ENV,
2522
+ createMcpConnection,
2523
+ hashMcpConnectionKey,
2524
+ redactMcpNativeValue,
2525
+ isRedactedMcpNativeValue,
2526
+ matchMcpConnection,
2527
+ readNativeMcpConnection,
2528
+ renderManualMcpEntry,
2529
+ verifyManualMcpEntry,
2530
+ classifyPendingNativeMcpChange,
2327
2531
  FIRST_PARTY_HARNESS_ADAPTERS,
2328
2532
  getFirstPartyHarnessAdapter,
2329
2533
  requireFirstPartyHarnessAdapter,
@@ -2337,4 +2541,4 @@ export {
2337
2541
  cloneOperationAccess,
2338
2542
  assertOperationAccess
2339
2543
  };
2340
- //# sourceMappingURL=chunk-M7DMFIKU.js.map
2544
+ //# sourceMappingURL=chunk-2WC74W66.js.map