@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
@@ -7,12 +7,12 @@ import {
7
7
  prepareInstallationRemoval,
8
8
  pruneInstallationParents,
9
9
  removeInstallationPath
10
- } from "./chunk-7R2PPKTB.js";
10
+ } from "./chunk-XFFESINU.js";
11
11
  import {
12
12
  NO_ACCESS,
13
13
  getFirstPartyHarnessAdapter,
14
14
  validateHarnessMethodSelection
15
- } from "./chunk-M7DMFIKU.js";
15
+ } from "./chunk-2WC74W66.js";
16
16
  import {
17
17
  CONFLICTS_RELATIVE_DIR,
18
18
  DEFAULT_SYSTEM_ASSET_MATERIALIZATION_MODE,
@@ -75,7 +75,7 @@ import {
75
75
  withInstallationOperation,
76
76
  writeContentFile,
77
77
  writeManifest
78
- } from "./chunk-YVSASZMT.js";
78
+ } from "./chunk-SFKYGFUV.js";
79
79
 
80
80
  // src/config.ts
81
81
  import { existsSync, readFileSync } from "fs";
@@ -965,6 +965,49 @@ function formatLabelEntries(labels) {
965
965
  return Object.entries(labels).map(([key, value]) => `${key}=${value}`).join(", ");
966
966
  }
967
967
 
968
+ // src/operations/mcp-metadata.ts
969
+ var MCP_PROFILES = ["core", "setup", "workflow", "quality", "backlog"];
970
+ var MCP_SERVER_PROFILES = [...MCP_PROFILES, "all"];
971
+ function parseMcpServerProfile(value = "all") {
972
+ if (MCP_SERVER_PROFILES.some((profile) => profile === value)) {
973
+ return value;
974
+ }
975
+ throw new Error(
976
+ `Unknown make-docs MCP profile: ${String(value)}. Allowed profiles: ${MCP_SERVER_PROFILES.join(", ")}.`
977
+ );
978
+ }
979
+ function assertMcpToolMetadata(owner, metadata) {
980
+ if (typeof metadata !== "object" || metadata === null || Array.isArray(metadata)) {
981
+ throw new Error(`MCP tool ${owner} must declare profile metadata.`);
982
+ }
983
+ const { profiles, defaultExposure } = metadata;
984
+ if (!Array.isArray(profiles) || profiles.length === 0) {
985
+ throw new Error(`MCP tool ${owner} must declare a nonempty profile set.`);
986
+ }
987
+ for (const profile of profiles) {
988
+ if (!MCP_PROFILES.some((known) => known === profile)) {
989
+ throw new Error(`MCP tool ${owner} declares unknown profile: ${String(profile)}.`);
990
+ }
991
+ }
992
+ if (new Set(profiles).size !== profiles.length) {
993
+ throw new Error(`MCP tool ${owner} declares duplicate profiles.`);
994
+ }
995
+ if (defaultExposure !== "eager" && defaultExposure !== "deferred") {
996
+ throw new Error(`MCP tool ${owner} must declare eager or deferred default exposure.`);
997
+ }
998
+ const uri = metadata.uiResourceUri;
999
+ if (uri !== void 0 && (typeof uri !== "string" || !/^ui:\/\/[a-z0-9][a-z0-9.-]*(?:\/[a-z0-9][a-z0-9-]*)*\/v[1-9][0-9]*\.html$/.test(uri))) {
1000
+ throw new Error(`MCP tool ${owner} must reference a versioned UI resource URI.`);
1001
+ }
1002
+ }
1003
+ function cloneMcpToolMetadata(metadata) {
1004
+ return {
1005
+ profiles: [...metadata.profiles],
1006
+ defaultExposure: metadata.defaultExposure,
1007
+ ...metadata.uiResourceUri ? { uiResourceUri: metadata.uiResourceUri } : {}
1008
+ };
1009
+ }
1010
+
968
1011
  // src/install.ts
969
1012
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "util";
970
1013
  import { existsSync as existsSync5, mkdirSync, readFileSync as readFileSync5, symlinkSync } from "fs";
@@ -1183,6 +1226,93 @@ function invalidUri(value, message) {
1183
1226
  };
1184
1227
  }
1185
1228
 
1229
+ // src/operations/resource/mcp-profiles.ts
1230
+ function getSystemResourceMcpProfiles(provider) {
1231
+ if (!provider || !Array.isArray(provider.resources)) {
1232
+ return invalidProfiles("The native MCP provider inventory is invalid.");
1233
+ }
1234
+ const uris = [];
1235
+ for (const resource of provider.resources) {
1236
+ if (!resource || typeof resource.identity?.uri !== "string") {
1237
+ return invalidProfiles("Each native MCP provider resource must have a canonical URI.");
1238
+ }
1239
+ uris.push(resource.identity.uri);
1240
+ }
1241
+ const assignments = validateSystemResourceMcpAssignments(provider.mcpResources, uris);
1242
+ if (!assignments.ok) return assignments;
1243
+ const profiles = {};
1244
+ for (const assignment of assignments.value) profiles[assignment.uri] = assignment.profiles;
1245
+ return { ok: true, value: Object.freeze(profiles) };
1246
+ }
1247
+ function validateSystemResourceMcpAssignments(value, resourceUris) {
1248
+ const inventory = /* @__PURE__ */ new Set();
1249
+ for (const uri of resourceUris) {
1250
+ if (typeof uri !== "string" || !parseSystemResourceUri(uri).ok) {
1251
+ return invalidProfiles("The native MCP provider inventory contains an invalid URI.");
1252
+ }
1253
+ if (inventory.has(uri)) {
1254
+ return invalidProfiles(`The native MCP provider inventory repeats URI ${uri}.`, uri);
1255
+ }
1256
+ inventory.add(uri);
1257
+ }
1258
+ if (!Array.isArray(value)) {
1259
+ return invalidProfiles("The system-resource catalog must declare native MCP profile assignments.");
1260
+ }
1261
+ const assignments = [];
1262
+ const assigned = /* @__PURE__ */ new Set();
1263
+ for (const entry of value) {
1264
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
1265
+ return invalidProfiles("Each native MCP resource assignment must be an object.");
1266
+ }
1267
+ if (Object.keys(entry).some((key) => key !== "uri" && key !== "profiles")) {
1268
+ return invalidProfiles("Native MCP resource assignments accept only uri and profiles fields.");
1269
+ }
1270
+ const { uri, profiles } = entry;
1271
+ if (typeof uri !== "string" || !parseSystemResourceUri(uri).ok) {
1272
+ return invalidProfiles("Each native MCP resource assignment must name a canonical system URI.");
1273
+ }
1274
+ if (assigned.has(uri)) {
1275
+ return invalidProfiles(`The system-resource catalog repeats native MCP URI ${uri}.`, uri);
1276
+ }
1277
+ if (!inventory.has(uri)) {
1278
+ return invalidProfiles(`Native MCP URI ${uri} is outside the provider inventory.`, uri);
1279
+ }
1280
+ if (!Array.isArray(profiles) || profiles.length === 0) {
1281
+ return invalidProfiles(`Native MCP resource ${uri} must declare a nonempty profile set.`, uri);
1282
+ }
1283
+ for (const profile of profiles) {
1284
+ if (!MCP_PROFILES.some((known) => known === profile)) {
1285
+ return invalidProfiles(`Native MCP resource ${uri} declares unknown profile: ${String(profile)}.`, uri);
1286
+ }
1287
+ }
1288
+ if (new Set(profiles).size !== profiles.length) {
1289
+ return invalidProfiles(`Native MCP resource ${uri} declares duplicate profiles.`, uri);
1290
+ }
1291
+ assigned.add(uri);
1292
+ assignments.push(Object.freeze({
1293
+ uri,
1294
+ profiles: Object.freeze([...profiles])
1295
+ }));
1296
+ }
1297
+ const missing2 = [...inventory].find((uri) => !assigned.has(uri));
1298
+ if (missing2) {
1299
+ return invalidProfiles(`Native MCP resource ${missing2} has no profile assignment.`, missing2);
1300
+ }
1301
+ assignments.sort((left, right) => left.uri < right.uri ? -1 : left.uri > right.uri ? 1 : 0);
1302
+ return { ok: true, value: Object.freeze(assignments) };
1303
+ }
1304
+ function invalidProfiles(message, uri) {
1305
+ return {
1306
+ ok: false,
1307
+ error: {
1308
+ code: "provider-catalog-invalid",
1309
+ message,
1310
+ recovery: "Restore the shipped catalog with one nonempty intent profile set for each provider URI.",
1311
+ ...uri ? { uri } : {}
1312
+ }
1313
+ };
1314
+ }
1315
+
1186
1316
  // src/operations/resource/provider.ts
1187
1317
  var DEFAULT_CATALOG_PATH = ".make-docs/system-resources.catalog.json";
1188
1318
  function loadSystemResourceProvider(input) {
@@ -1265,6 +1395,8 @@ function loadSystemResourceProvider(input) {
1265
1395
  }
1266
1396
  }
1267
1397
  resources.sort((left, right) => compareCodeUnits(left.identity.uri, right.identity.uri));
1398
+ const mcpResources = Object.hasOwn(catalog, "mcpResources") ? validateSystemResourceMcpAssignments(catalog.mcpResources, resources.map((entry) => entry.identity.uri)) : void 0;
1399
+ if (mcpResources && !mcpResources.ok) return mcpResources;
1268
1400
  const inventoryDigest = sha256(
1269
1401
  Buffer.from(resources.map((entry) => `${entry.identity.uri}\0${entry.digest}`).join("\n"))
1270
1402
  );
@@ -1288,7 +1420,8 @@ function loadSystemResourceProvider(input) {
1288
1420
  });
1289
1421
  const inventory = Object.freeze({
1290
1422
  provider: providerMetadata,
1291
- resources: Object.freeze([...resources])
1423
+ resources: Object.freeze([...resources]),
1424
+ ...mcpResources?.ok ? { mcpResources: mcpResources.value } : {}
1292
1425
  });
1293
1426
  return {
1294
1427
  ok: true,
@@ -1663,11 +1796,14 @@ function buildSelectedResourceProjection(options) {
1663
1796
  }
1664
1797
  function createThinRouterAssets(profile) {
1665
1798
  const assets = [];
1799
+ const added = /* @__PURE__ */ new Set();
1666
1800
  for (const [harness, instructionKind] of Object.entries(HARNESS_TO_INSTRUCTION)) {
1667
1801
  if (!profile.selections.harnesses[harness]) {
1668
1802
  continue;
1669
1803
  }
1670
1804
  for (const relativePath of getConfiguredRouterPaths(profile, instructionKind)) {
1805
+ if (added.has(relativePath)) continue;
1806
+ added.add(relativePath);
1671
1807
  assets.push({
1672
1808
  relativePath,
1673
1809
  assetClass: "scoped-static",
@@ -1749,6 +1885,7 @@ function createProjectSurfaceRouterAssets(profile, surface) {
1749
1885
  artifacts: "docs/assets",
1750
1886
  assets: "docs/assets"
1751
1887
  }[surface];
1888
+ const added = /* @__PURE__ */ new Set();
1752
1889
  return Object.entries(HARNESS_TO_INSTRUCTION).filter(([harness]) => profile.selections.harnesses[harness]).map(([harness, instructionKind]) => {
1753
1890
  const relativePath = `${directory}/${instructionKind}`;
1754
1891
  return {
@@ -1757,6 +1894,10 @@ function createProjectSurfaceRouterAssets(profile, surface) {
1757
1894
  sourceId: `router:${harness}:${relativePath}`,
1758
1895
  content: readThinRouterContent(relativePath, profile)
1759
1896
  };
1897
+ }).filter((asset) => {
1898
+ if (added.has(asset.relativePath)) return false;
1899
+ added.add(asset.relativePath);
1900
+ return true;
1760
1901
  }).sort((left, right) => compareCodeUnits2(left.relativePath, right.relativePath));
1761
1902
  }
1762
1903
  function applyP4ManifestOwnership(relativePath, entry) {
@@ -4119,6 +4260,11 @@ export {
4119
4260
  createSystemResourceIdentity,
4120
4261
  parseSystemResourceUri,
4121
4262
  canonicalSystemResourcePath,
4263
+ MCP_SERVER_PROFILES,
4264
+ parseMcpServerProfile,
4265
+ assertMcpToolMetadata,
4266
+ cloneMcpToolMetadata,
4267
+ getSystemResourceMcpProfiles,
4122
4268
  loadInstalledSystemResourceProvider,
4123
4269
  matchesSystemResourceCatalogPath,
4124
4270
  createRouterOwnershipManifestEntry,
@@ -4134,4 +4280,4 @@ export {
4134
4280
  registerSkillAdoptionRecovery,
4135
4281
  applySkillAdoptionReview
4136
4282
  };
4137
- //# sourceMappingURL=chunk-OR5ZVGLG.js.map
4283
+ //# sourceMappingURL=chunk-B7QF7XZT.js.map