@mulmoclaude/core 5.12.1 → 5.14.0

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 (186) hide show
  1. package/assets/helps/presenthtml.md +24 -0
  2. package/dist/artifacts/paths.cjs +1 -2
  3. package/dist/artifacts/paths.js +1 -2
  4. package/dist/collection/firestore.cjs +1 -2
  5. package/dist/collection/firestore.js +1 -2
  6. package/dist/collection/index.cjs +18 -30
  7. package/dist/collection/index.cjs.map +1 -1
  8. package/dist/collection/index.js +18 -30
  9. package/dist/collection/index.js.map +1 -1
  10. package/dist/collection/paths.cjs +1 -1
  11. package/dist/collection/paths.js +1 -1
  12. package/dist/collection/registry/index.cjs +1 -1
  13. package/dist/collection/registry/index.js +1 -1
  14. package/dist/collection/registry/server/index.cjs +17 -26
  15. package/dist/collection/registry/server/index.cjs.map +1 -1
  16. package/dist/collection/registry/server/index.js +16 -25
  17. package/dist/collection/registry/server/index.js.map +1 -1
  18. package/dist/collection/server/index.cjs +5 -5
  19. package/dist/collection/server/index.js +5 -5
  20. package/dist/collection-watchers/index.cjs +10 -14
  21. package/dist/collection-watchers/index.cjs.map +1 -1
  22. package/dist/collection-watchers/index.js +10 -14
  23. package/dist/collection-watchers/index.js.map +1 -1
  24. package/dist/{discovery-DgZRmO7F.cjs → discovery-CYIV1J5l.cjs} +25 -42
  25. package/dist/{discovery-DgZRmO7F.cjs.map → discovery-CYIV1J5l.cjs.map} +1 -1
  26. package/dist/{discovery-CbwHtcwk.js → discovery-duLlygnJ.js} +24 -41
  27. package/dist/{discovery-CbwHtcwk.js.map → discovery-duLlygnJ.js.map} +1 -1
  28. package/dist/{dist-BZ62pKuU.cjs → dist-734JaRYi.cjs} +2 -4
  29. package/dist/{dist-BZ62pKuU.cjs.map → dist-734JaRYi.cjs.map} +1 -1
  30. package/dist/{dist-MFUV9FYo.js → dist-BmO4oSQy.js} +2 -4
  31. package/dist/{dist-MFUV9FYo.js.map → dist-BmO4oSQy.js.map} +1 -1
  32. package/dist/errorMessage-D0kR547_.cjs +1 -0
  33. package/dist/errorMessage-TpKxrmeo.js +1 -0
  34. package/dist/{errors-zTAsW7dS.js → errors-0QwjDxsv.js} +3 -4
  35. package/dist/{errors-zTAsW7dS.js.map → errors-0QwjDxsv.js.map} +1 -1
  36. package/dist/{errors-B0xloJ3E.cjs → errors-B9mCEVG9.cjs} +3 -4
  37. package/dist/{errors-B0xloJ3E.cjs.map → errors-B9mCEVG9.cjs.map} +1 -1
  38. package/dist/feeds/index.cjs +2 -2
  39. package/dist/feeds/index.js +2 -2
  40. package/dist/feeds/paths.cjs +2 -3
  41. package/dist/feeds/paths.js +1 -2
  42. package/dist/feeds/server/index.cjs +23 -37
  43. package/dist/feeds/server/index.cjs.map +1 -1
  44. package/dist/feeds/server/index.js +22 -36
  45. package/dist/feeds/server/index.js.map +1 -1
  46. package/dist/file-change/index.cjs +2 -3
  47. package/dist/file-change/index.js +1 -2
  48. package/dist/files/index.cjs +159 -11
  49. package/dist/files/index.cjs.map +1 -1
  50. package/dist/files/index.d.ts +1 -0
  51. package/dist/files/index.js +154 -12
  52. package/dist/files/index.js.map +1 -1
  53. package/dist/files/verified.d.ts +33 -0
  54. package/dist/global-config/index.cjs +3 -5
  55. package/dist/global-config/index.cjs.map +1 -1
  56. package/dist/global-config/index.js +3 -5
  57. package/dist/global-config/index.js.map +1 -1
  58. package/dist/google/index.cjs +38 -67
  59. package/dist/google/index.cjs.map +1 -1
  60. package/dist/google/index.js +37 -66
  61. package/dist/google/index.js.map +1 -1
  62. package/dist/{graph-CURotEkH.cjs → graph-BvVMZfDV.cjs} +6 -11
  63. package/dist/{graph-CURotEkH.cjs.map → graph-BvVMZfDV.cjs.map} +1 -1
  64. package/dist/{graph-DBxSOx3v.js → graph-DBbzemby.js} +6 -11
  65. package/dist/{graph-DBxSOx3v.js.map → graph-DBbzemby.js.map} +1 -1
  66. package/dist/{iconGlyph-fSBp6k4J.cjs → iconGlyph-CFOiFsmq.cjs} +2 -3
  67. package/dist/{iconGlyph-fSBp6k4J.cjs.map → iconGlyph-CFOiFsmq.cjs.map} +1 -1
  68. package/dist/{iconGlyph-D8JeNg7R.js → iconGlyph-D9h__VaM.js} +2 -3
  69. package/dist/{iconGlyph-D8JeNg7R.js.map → iconGlyph-D9h__VaM.js.map} +1 -1
  70. package/dist/{ingestTypes-DS9HiR2I.cjs → ingestTypes-CLDvn7kw.cjs} +3 -4
  71. package/dist/{ingestTypes-DS9HiR2I.cjs.map → ingestTypes-CLDvn7kw.cjs.map} +1 -1
  72. package/dist/{ingestTypes-Bs31Xt5c.js → ingestTypes-DuXuSBSn.js} +3 -4
  73. package/dist/{ingestTypes-Bs31Xt5c.js.map → ingestTypes-DuXuSBSn.js.map} +1 -1
  74. package/dist/{itemId-CVrNibwT.cjs → itemId-D2XAQ8RU.cjs} +9 -17
  75. package/dist/{itemId-CVrNibwT.cjs.map → itemId-D2XAQ8RU.cjs.map} +1 -1
  76. package/dist/{itemId-C9s-Jd5s.js → itemId-D_pSpa3U.js} +9 -17
  77. package/dist/{itemId-C9s-Jd5s.js.map → itemId-D_pSpa3U.js.map} +1 -1
  78. package/dist/{listen-N_8XdKz_.cjs → listen-OmfLDX1l.cjs} +3 -4
  79. package/dist/{listen-N_8XdKz_.cjs.map → listen-OmfLDX1l.cjs.map} +1 -1
  80. package/dist/{listen-DUlzSOzX.js → listen-uiEnXcW9.js} +3 -4
  81. package/dist/{listen-DUlzSOzX.js.map → listen-uiEnXcW9.js.map} +1 -1
  82. package/dist/notifier/index.cjs +1 -1
  83. package/dist/notifier/index.js +1 -1
  84. package/dist/{notifier-CiemUClt.cjs → notifier-CRTk34EC.cjs} +6 -10
  85. package/dist/{notifier-CiemUClt.cjs.map → notifier-CRTk34EC.cjs.map} +1 -1
  86. package/dist/{notifier-dgkC-h80.js → notifier-htdf4ekH.js} +6 -10
  87. package/dist/{notifier-dgkC-h80.js.map → notifier-htdf4ekH.js.map} +1 -1
  88. package/dist/{paths-CkJxNZ7T.js → paths-BMQNHdaJ.js} +2 -3
  89. package/dist/{paths-CkJxNZ7T.js.map → paths-BMQNHdaJ.js.map} +1 -1
  90. package/dist/{paths-C8-jxR0s.cjs → paths-DUHAueEv.cjs} +2 -3
  91. package/dist/{paths-C8-jxR0s.cjs.map → paths-DUHAueEv.cjs.map} +1 -1
  92. package/dist/plugin-vue/i18n.cjs +1 -2
  93. package/dist/plugin-vue/i18n.js +1 -2
  94. package/dist/plugin-vue/index.cjs +9 -17
  95. package/dist/plugin-vue/index.cjs.map +1 -1
  96. package/dist/plugin-vue/index.js +9 -17
  97. package/dist/plugin-vue/index.js.map +1 -1
  98. package/dist/{project-C1ep9pvo.cjs → project-DDTIVEMU.cjs} +2 -3
  99. package/dist/{project-C1ep9pvo.cjs.map → project-DDTIVEMU.cjs.map} +1 -1
  100. package/dist/{project-B0j_Vf_Q.js → project-mU6-xLfy.js} +2 -3
  101. package/dist/{project-B0j_Vf_Q.js.map → project-mU6-xLfy.js.map} +1 -1
  102. package/dist/prompt-files/index.cjs +4 -6
  103. package/dist/prompt-files/index.cjs.map +1 -1
  104. package/dist/prompt-files/index.js +3 -5
  105. package/dist/prompt-files/index.js.map +1 -1
  106. package/dist/{promptSafety-DFaOnOWN.js → promptSafety-B8LECAkY.js} +14 -25
  107. package/dist/{promptSafety-DFaOnOWN.js.map → promptSafety-B8LECAkY.js.map} +1 -1
  108. package/dist/{promptSafety-yET9jLep.cjs → promptSafety-CjxafW2b.cjs} +14 -25
  109. package/dist/{promptSafety-yET9jLep.cjs.map → promptSafety-CjxafW2b.cjs.map} +1 -1
  110. package/dist/{relPath-DW8MC8VO.js → relPath-BkKmqiiF.js} +2 -3
  111. package/dist/{relPath-DW8MC8VO.js.map → relPath-BkKmqiiF.js.map} +1 -1
  112. package/dist/{relPath-CTAjGdCL.cjs → relPath-CZiP2S_a.cjs} +3 -4
  113. package/dist/{relPath-CTAjGdCL.cjs.map → relPath-CZiP2S_a.cjs.map} +1 -1
  114. package/dist/remote-host/index.cjs +1 -1
  115. package/dist/remote-host/index.js +1 -1
  116. package/dist/remote-host/server/index.cjs +14 -25
  117. package/dist/remote-host/server/index.cjs.map +1 -1
  118. package/dist/remote-host/server/index.js +14 -25
  119. package/dist/remote-host/server/index.js.map +1 -1
  120. package/dist/{remote-host-CR5W9uj4.cjs → remote-host-BW_eH-Nu.cjs} +4 -6
  121. package/dist/{remote-host-CR5W9uj4.cjs.map → remote-host-BW_eH-Nu.cjs.map} +1 -1
  122. package/dist/{remote-host-9NNAvUhU.js → remote-host-CSeDNbE6.js} +4 -6
  123. package/dist/{remote-host-9NNAvUhU.js.map → remote-host-CSeDNbE6.js.map} +1 -1
  124. package/dist/remote-view/index.cjs +3 -4
  125. package/dist/remote-view/index.js +3 -4
  126. package/dist/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-CmQyd0Gu.cjs} +1 -2
  127. package/dist/{root-BvwBUcol.cjs → root-9lRFeXbm.cjs} +10 -6
  128. package/dist/{root-BvwBUcol.cjs.map → root-9lRFeXbm.cjs.map} +1 -1
  129. package/dist/{root-BcS4-Kge.js → root-CqxPNSyK.js} +4 -6
  130. package/dist/{root-BcS4-Kge.js.map → root-CqxPNSyK.js.map} +1 -1
  131. package/dist/scheduler/index.cjs +6 -9
  132. package/dist/scheduler/index.cjs.map +1 -1
  133. package/dist/scheduler/index.js +5 -8
  134. package/dist/scheduler/index.js.map +1 -1
  135. package/dist/{server-CJek9Y3Q.cjs → server-ByKWGQn2.cjs} +25 -41
  136. package/dist/{server-CJek9Y3Q.cjs.map → server-ByKWGQn2.cjs.map} +1 -1
  137. package/dist/{server-BtbbQqBY.js → server-CA-alqqN.js} +24 -40
  138. package/dist/{server-BtbbQqBY.js.map → server-CA-alqqN.js.map} +1 -1
  139. package/dist/skill-bridge/index.cjs +3 -4
  140. package/dist/skill-bridge/index.js +2 -3
  141. package/dist/{slug-BpjumQfe.js → slug-D24AYqCZ.js} +2 -3
  142. package/dist/{slug-BpjumQfe.js.map → slug-D24AYqCZ.js.map} +1 -1
  143. package/dist/{slug-JxgB0ru9.cjs → slug-DVkuPjIv.cjs} +2 -3
  144. package/dist/{slug-JxgB0ru9.cjs.map → slug-DVkuPjIv.cjs.map} +1 -1
  145. package/dist/{templatePath-27vUZowm.cjs → templatePath-BIh7wqgS.cjs} +2 -3
  146. package/dist/{templatePath-27vUZowm.cjs.map → templatePath-BIh7wqgS.cjs.map} +1 -1
  147. package/dist/{templatePath-k_WNbL_Q.js → templatePath-CB3wtVpe.js} +2 -3
  148. package/dist/{templatePath-k_WNbL_Q.js.map → templatePath-CB3wtVpe.js.map} +1 -1
  149. package/dist/{text-CjDbP2O1.js → text-BQAuwKVj.js} +2 -3
  150. package/dist/{text-CjDbP2O1.js.map → text-BQAuwKVj.js.map} +1 -1
  151. package/dist/{text-CaAh9ZSO.cjs → text-BQiyo5R9.cjs} +2 -3
  152. package/dist/{text-CaAh9ZSO.cjs.map → text-BQiyo5R9.cjs.map} +1 -1
  153. package/dist/translation/client.cjs +1 -2
  154. package/dist/translation/client.js +1 -2
  155. package/dist/{types-BKVZrtyc.js → types-BLCZTGW2.js} +4 -7
  156. package/dist/{types-BKVZrtyc.js.map → types-BLCZTGW2.js.map} +1 -1
  157. package/dist/{types-CNqkLT4M.cjs → types-DPycxnDf.cjs} +4 -7
  158. package/dist/{types-CNqkLT4M.cjs.map → types-DPycxnDf.cjs.map} +1 -1
  159. package/dist/utils/fetch.cjs +0 -1
  160. package/dist/utils/fetch.js +0 -1
  161. package/dist/utils/index.cjs +3 -3
  162. package/dist/utils/index.js +3 -3
  163. package/dist/whisper/client.cjs +2 -4
  164. package/dist/whisper/client.cjs.map +1 -1
  165. package/dist/whisper/client.js +2 -4
  166. package/dist/whisper/client.js.map +1 -1
  167. package/dist/whisper/index.cjs +9 -15
  168. package/dist/whisper/index.cjs.map +1 -1
  169. package/dist/whisper/index.js +8 -14
  170. package/dist/whisper/index.js.map +1 -1
  171. package/dist/wiki/index.cjs +5 -7
  172. package/dist/wiki/index.cjs.map +1 -1
  173. package/dist/wiki/index.js +5 -7
  174. package/dist/wiki/index.js.map +1 -1
  175. package/dist/wiki/paths.cjs +3 -4
  176. package/dist/wiki/paths.js +2 -3
  177. package/dist/wiki/server/index.cjs +7 -11
  178. package/dist/wiki/server/index.cjs.map +1 -1
  179. package/dist/wiki/server/index.js +6 -10
  180. package/dist/wiki/server/index.js.map +1 -1
  181. package/dist/workspace-setup/index.js +4 -9
  182. package/dist/workspace-setup/index.js.map +1 -1
  183. package/dist/workspace-setup/slug.js +1 -2
  184. package/package.json +2 -2
  185. package/dist/errorMessage-OEQzRwsi.cjs +0 -1
  186. package/dist/errorMessage-VEiXHRnX.js +0 -1
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("../rolldown-runtime-VH7oDXx4.cjs");
3
- const require_templatePath = require("../templatePath-27vUZowm.cjs");
2
+ const require_rolldown_runtime = require("../rolldown-runtime-CmQyd0Gu.cjs");
3
+ const require_templatePath = require("../templatePath-BIh7wqgS.cjs");
4
4
  let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
6
6
  node_path = require_rolldown_runtime.__toESM(node_path, 1);
7
- //#region src/skill-bridge/index.ts
7
+ // src/skill-bridge/index.ts
8
8
  var DATA_SKILLS_DIR = node_path.default.join("data", "skills");
9
9
  var CLAUDE_SKILLS_DIR = node_path.default.join(".claude", "skills");
10
10
  var SKILL_FILENAME = "SKILL.md";
@@ -76,7 +76,6 @@ function mirrorSkillDelete(workspaceRoot, slug) {
76
76
  });
77
77
  return { dest };
78
78
  }
79
- //#endregion
80
79
  exports.bridgeTargetFromDataPath = bridgeTargetFromDataPath;
81
80
  exports.claudeSkillDir = claudeSkillDir;
82
81
  exports.dataSkillDir = dataSkillDir;
@@ -1,7 +1,7 @@
1
- import { t as isSafeActionTemplatePath } from "../templatePath-k_WNbL_Q.js";
1
+ import { t as isSafeActionTemplatePath } from "../templatePath-CB3wtVpe.js";
2
2
  import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
3
3
  import path from "node:path";
4
- //#region src/skill-bridge/index.ts
4
+ // src/skill-bridge/index.ts
5
5
  var DATA_SKILLS_DIR = path.join("data", "skills");
6
6
  var CLAUDE_SKILLS_DIR = path.join(".claude", "skills");
7
7
  var SKILL_FILENAME = "SKILL.md";
@@ -73,7 +73,6 @@ function mirrorSkillDelete(workspaceRoot, slug) {
73
73
  });
74
74
  return { dest };
75
75
  }
76
- //#endregion
77
76
  export { bridgeTargetFromDataPath, claudeSkillDir, dataSkillDir, mirrorSkillDelete, mirrorSkillWrite, slugFromRmCommand };
78
77
 
79
78
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- //#region src/wiki/slug.ts
1
+ // src/wiki/slug.ts
2
2
  /** Reject slugs that would escape `data/wiki/pages/` once
3
3
  * joined back into a path, or that are otherwise invalid as
4
4
  * page filenames. The chokepoint must defend itself even when
@@ -52,7 +52,6 @@ function wikiPageStem(name) {
52
52
  const slug = wikiSlugify(trimmed);
53
53
  return slug.length > 0 ? slug : null;
54
54
  }
55
- //#endregion
56
55
  export { wikiPageStem as n, wikiSlugify as r, isSafeSlug as t };
57
56
 
58
- //# sourceMappingURL=slug-BpjumQfe.js.map
57
+ //# sourceMappingURL=slug-D24AYqCZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slug-BpjumQfe.js","names":[],"sources":["../src/wiki/slug.ts"],"sourcesContent":["// Pure wiki-page slug helpers — string-only, no Node / browser\n// dependencies, importable from any bundle.\n//\n// Used by:\n// - server/workspace/wiki-pages/io.ts (the write chokepoint)\n// - server/workspace/hooks/handlers/wikiSnapshot.ts (the\n// PostToolUse handler that fires on Write/Edit of a wiki page)\n// - server/api/routes/wiki.ts (page resolver + lint)\n// - server/api/routes/wiki/history.ts (history slug guard)\n// - src/plugins/wiki/route.ts (router slug guard — replaces the\n// local `isSafeWikiSlug` duplicate that existed before the\n// pure-lib refactor)\n// - src/plugins/wiki/helpers.ts (renderer slugify for [[…]] links)\n//\n// Any helper that needs `node:path` lives in `./paths.ts` so that\n// importing this file from frontend code never pulls in Node\n// builtins.\n\n/** Reject slugs that would escape `data/wiki/pages/` once\n * joined back into a path, or that are otherwise invalid as\n * page filenames. The chokepoint must defend itself even when\n * callers derive the slug from a trusted source — a typo or\n * future caller mistake should fail loud, not silently write\n * outside the wiki tree.\n *\n * The rule is intentionally narrow — separators / `..` / NUL /\n * empty — so it only rejects unambiguous violations. Aesthetic\n * concerns (e.g. dot-prefixed filenames) are out of scope: a\n * pre-existing `data/wiki/pages/.foo.md` should remain writable\n * through the chokepoint (codex review iter-2 #883). */\nexport function isSafeSlug(slug: string): boolean {\n if (slug.length === 0) return false;\n if (slug === \".\" || slug === \"..\") return false;\n if (slug.includes(\"/\") || slug.includes(\"\\\\\")) return false;\n if (slug.includes(\"\\0\")) return false;\n return true;\n}\n\n/** Slug rules for `[[wiki link]]` text → slug derivation:\n * lowercase, spaces collapsed to hyphens, every non-ASCII /\n * non-alphanumeric / non-hyphen character stripped.\n *\n * Pure: no normalisation, no transliteration — this is the\n * same shape the index parser, page resolver, and frontend\n * renderer all need to agree on. Non-ASCII titles (e.g.\n * Japanese) collapse to an ASCII remnant here, so a caller\n * matching against real page files must go through\n * `matchWikiSlug`, which tries the untouched name first. */\nexport function wikiSlugify(text: string): string {\n return text\n .toLowerCase()\n .replace(/\\s+/g, \"-\")\n .replace(/[^a-z0-9-]/g, \"\");\n}\n\n// Code point above which `wikiSlugify` strips a character outright.\nconst MAX_ASCII_CODE_POINT = 127;\n\nfunction hasNonAscii(text: string): boolean {\n return [...text].some((char) => (char.codePointAt(0) ?? 0) > MAX_ASCII_CODE_POINT);\n}\n\n/** Filename stem to suggest when a page has to be created for `name`,\n * or null when `name` cannot yield one.\n *\n * ASCII names keep the hyphenated slug convention. A non-ASCII name is\n * suggested verbatim — the write chokepoint accepts any `isSafeSlug`\n * filename, and slugifying it would propose a stripped remnant like\n * `-4.md` (#2940). Null rather than a salvaged stem for a name the\n * write guard would reject anyway: suggesting `wiki/pages/.md`, or\n * `secrets.md` for `../secrets`, sends the caller to a file it did\n * not ask for. */\nexport function wikiPageStem(name: string): string | null {\n const trimmed = name.trim();\n if (!isSafeSlug(trimmed)) return null;\n if (hasNonAscii(trimmed)) return trimmed;\n const slug = wikiSlugify(trimmed);\n return slug.length > 0 ? slug : null;\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,WAAW,MAAuB;CAChD,IAAI,KAAK,WAAW,GAAG,OAAO;CAC9B,IAAI,SAAS,OAAO,SAAS,MAAM,OAAO;CAC1C,IAAI,KAAK,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,GAAG,OAAO;CACtD,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,YAAY,MAAsB;CAChD,OAAO,KACJ,YAAY,CAAC,CACb,QAAQ,QAAQ,GAAG,CAAC,CACpB,QAAQ,eAAe,EAAE;AAC9B;AAGA,IAAM,uBAAuB;AAE7B,SAAS,YAAY,MAAuB;CAC1C,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,UAAU,KAAK,YAAY,CAAC,KAAK,KAAK,oBAAoB;AACnF;;;;;;;;;;;AAYA,SAAgB,aAAa,MAA6B;CACxD,MAAM,UAAU,KAAK,KAAK;CAC1B,IAAI,CAAC,WAAW,OAAO,GAAG,OAAO;CACjC,IAAI,YAAY,OAAO,GAAG,OAAO;CACjC,MAAM,OAAO,YAAY,OAAO;CAChC,OAAO,KAAK,SAAS,IAAI,OAAO;AAClC"}
1
+ {"version":3,"file":"slug-D24AYqCZ.js","names":[],"sources":["../src/wiki/slug.ts"],"sourcesContent":["// Pure wiki-page slug helpers — string-only, no Node / browser\n// dependencies, importable from any bundle.\n//\n// Used by:\n// - server/workspace/wiki-pages/io.ts (the write chokepoint)\n// - server/workspace/hooks/handlers/wikiSnapshot.ts (the\n// PostToolUse handler that fires on Write/Edit of a wiki page)\n// - server/api/routes/wiki.ts (page resolver + lint)\n// - server/api/routes/wiki/history.ts (history slug guard)\n// - src/plugins/wiki/route.ts (router slug guard — replaces the\n// local `isSafeWikiSlug` duplicate that existed before the\n// pure-lib refactor)\n// - src/plugins/wiki/helpers.ts (renderer slugify for [[…]] links)\n//\n// Any helper that needs `node:path` lives in `./paths.ts` so that\n// importing this file from frontend code never pulls in Node\n// builtins.\n\n/** Reject slugs that would escape `data/wiki/pages/` once\n * joined back into a path, or that are otherwise invalid as\n * page filenames. The chokepoint must defend itself even when\n * callers derive the slug from a trusted source — a typo or\n * future caller mistake should fail loud, not silently write\n * outside the wiki tree.\n *\n * The rule is intentionally narrow — separators / `..` / NUL /\n * empty — so it only rejects unambiguous violations. Aesthetic\n * concerns (e.g. dot-prefixed filenames) are out of scope: a\n * pre-existing `data/wiki/pages/.foo.md` should remain writable\n * through the chokepoint (codex review iter-2 #883). */\nexport function isSafeSlug(slug: string): boolean {\n if (slug.length === 0) return false;\n if (slug === \".\" || slug === \"..\") return false;\n if (slug.includes(\"/\") || slug.includes(\"\\\\\")) return false;\n if (slug.includes(\"\\0\")) return false;\n return true;\n}\n\n/** Slug rules for `[[wiki link]]` text → slug derivation:\n * lowercase, spaces collapsed to hyphens, every non-ASCII /\n * non-alphanumeric / non-hyphen character stripped.\n *\n * Pure: no normalisation, no transliteration — this is the\n * same shape the index parser, page resolver, and frontend\n * renderer all need to agree on. Non-ASCII titles (e.g.\n * Japanese) collapse to an ASCII remnant here, so a caller\n * matching against real page files must go through\n * `matchWikiSlug`, which tries the untouched name first. */\nexport function wikiSlugify(text: string): string {\n return text\n .toLowerCase()\n .replace(/\\s+/g, \"-\")\n .replace(/[^a-z0-9-]/g, \"\");\n}\n\n// Code point above which `wikiSlugify` strips a character outright.\nconst MAX_ASCII_CODE_POINT = 127;\n\nfunction hasNonAscii(text: string): boolean {\n return [...text].some((char) => (char.codePointAt(0) ?? 0) > MAX_ASCII_CODE_POINT);\n}\n\n/** Filename stem to suggest when a page has to be created for `name`,\n * or null when `name` cannot yield one.\n *\n * ASCII names keep the hyphenated slug convention. A non-ASCII name is\n * suggested verbatim — the write chokepoint accepts any `isSafeSlug`\n * filename, and slugifying it would propose a stripped remnant like\n * `-4.md` (#2940). Null rather than a salvaged stem for a name the\n * write guard would reject anyway: suggesting `wiki/pages/.md`, or\n * `secrets.md` for `../secrets`, sends the caller to a file it did\n * not ask for. */\nexport function wikiPageStem(name: string): string | null {\n const trimmed = name.trim();\n if (!isSafeSlug(trimmed)) return null;\n if (hasNonAscii(trimmed)) return trimmed;\n const slug = wikiSlugify(trimmed);\n return slug.length > 0 ? slug : null;\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,WAAW,MAAuB;CAChD,IAAI,KAAK,WAAW,GAAG,OAAO;CAC9B,IAAI,SAAS,OAAO,SAAS,MAAM,OAAO;CAC1C,IAAI,KAAK,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,GAAG,OAAO;CACtD,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,YAAY,MAAsB;CAChD,OAAO,KACJ,YAAY,CAAC,CACb,QAAQ,QAAQ,GAAG,CAAC,CACpB,QAAQ,eAAe,EAAE;AAC9B;AAGA,IAAM,uBAAuB;AAE7B,SAAS,YAAY,MAAuB;CAC1C,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,UAAU,KAAK,YAAY,CAAC,KAAK,KAAK,oBAAoB;AACnF;;;;;;;;;;;AAYA,SAAgB,aAAa,MAA6B;CACxD,MAAM,UAAU,KAAK,KAAK;CAC1B,IAAI,CAAC,WAAW,OAAO,GAAG,OAAO;CACjC,IAAI,YAAY,OAAO,GAAG,OAAO;CACjC,MAAM,OAAO,YAAY,OAAO;CAChC,OAAO,KAAK,SAAS,IAAI,OAAO;AAClC"}
@@ -1,4 +1,4 @@
1
- //#region src/wiki/slug.ts
1
+ // src/wiki/slug.ts
2
2
  /** Reject slugs that would escape `data/wiki/pages/` once
3
3
  * joined back into a path, or that are otherwise invalid as
4
4
  * page filenames. The chokepoint must defend itself even when
@@ -52,7 +52,6 @@ function wikiPageStem(name) {
52
52
  const slug = wikiSlugify(trimmed);
53
53
  return slug.length > 0 ? slug : null;
54
54
  }
55
- //#endregion
56
55
  Object.defineProperty(exports, "isSafeSlug", {
57
56
  enumerable: true,
58
57
  get: function() {
@@ -72,4 +71,4 @@ Object.defineProperty(exports, "wikiSlugify", {
72
71
  }
73
72
  });
74
73
 
75
- //# sourceMappingURL=slug-JxgB0ru9.cjs.map
74
+ //# sourceMappingURL=slug-DVkuPjIv.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"slug-JxgB0ru9.cjs","names":[],"sources":["../src/wiki/slug.ts"],"sourcesContent":["// Pure wiki-page slug helpers — string-only, no Node / browser\n// dependencies, importable from any bundle.\n//\n// Used by:\n// - server/workspace/wiki-pages/io.ts (the write chokepoint)\n// - server/workspace/hooks/handlers/wikiSnapshot.ts (the\n// PostToolUse handler that fires on Write/Edit of a wiki page)\n// - server/api/routes/wiki.ts (page resolver + lint)\n// - server/api/routes/wiki/history.ts (history slug guard)\n// - src/plugins/wiki/route.ts (router slug guard — replaces the\n// local `isSafeWikiSlug` duplicate that existed before the\n// pure-lib refactor)\n// - src/plugins/wiki/helpers.ts (renderer slugify for [[…]] links)\n//\n// Any helper that needs `node:path` lives in `./paths.ts` so that\n// importing this file from frontend code never pulls in Node\n// builtins.\n\n/** Reject slugs that would escape `data/wiki/pages/` once\n * joined back into a path, or that are otherwise invalid as\n * page filenames. The chokepoint must defend itself even when\n * callers derive the slug from a trusted source — a typo or\n * future caller mistake should fail loud, not silently write\n * outside the wiki tree.\n *\n * The rule is intentionally narrow — separators / `..` / NUL /\n * empty — so it only rejects unambiguous violations. Aesthetic\n * concerns (e.g. dot-prefixed filenames) are out of scope: a\n * pre-existing `data/wiki/pages/.foo.md` should remain writable\n * through the chokepoint (codex review iter-2 #883). */\nexport function isSafeSlug(slug: string): boolean {\n if (slug.length === 0) return false;\n if (slug === \".\" || slug === \"..\") return false;\n if (slug.includes(\"/\") || slug.includes(\"\\\\\")) return false;\n if (slug.includes(\"\\0\")) return false;\n return true;\n}\n\n/** Slug rules for `[[wiki link]]` text → slug derivation:\n * lowercase, spaces collapsed to hyphens, every non-ASCII /\n * non-alphanumeric / non-hyphen character stripped.\n *\n * Pure: no normalisation, no transliteration — this is the\n * same shape the index parser, page resolver, and frontend\n * renderer all need to agree on. Non-ASCII titles (e.g.\n * Japanese) collapse to an ASCII remnant here, so a caller\n * matching against real page files must go through\n * `matchWikiSlug`, which tries the untouched name first. */\nexport function wikiSlugify(text: string): string {\n return text\n .toLowerCase()\n .replace(/\\s+/g, \"-\")\n .replace(/[^a-z0-9-]/g, \"\");\n}\n\n// Code point above which `wikiSlugify` strips a character outright.\nconst MAX_ASCII_CODE_POINT = 127;\n\nfunction hasNonAscii(text: string): boolean {\n return [...text].some((char) => (char.codePointAt(0) ?? 0) > MAX_ASCII_CODE_POINT);\n}\n\n/** Filename stem to suggest when a page has to be created for `name`,\n * or null when `name` cannot yield one.\n *\n * ASCII names keep the hyphenated slug convention. A non-ASCII name is\n * suggested verbatim — the write chokepoint accepts any `isSafeSlug`\n * filename, and slugifying it would propose a stripped remnant like\n * `-4.md` (#2940). Null rather than a salvaged stem for a name the\n * write guard would reject anyway: suggesting `wiki/pages/.md`, or\n * `secrets.md` for `../secrets`, sends the caller to a file it did\n * not ask for. */\nexport function wikiPageStem(name: string): string | null {\n const trimmed = name.trim();\n if (!isSafeSlug(trimmed)) return null;\n if (hasNonAscii(trimmed)) return trimmed;\n const slug = wikiSlugify(trimmed);\n return slug.length > 0 ? slug : null;\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,WAAW,MAAuB;CAChD,IAAI,KAAK,WAAW,GAAG,OAAO;CAC9B,IAAI,SAAS,OAAO,SAAS,MAAM,OAAO;CAC1C,IAAI,KAAK,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,GAAG,OAAO;CACtD,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,YAAY,MAAsB;CAChD,OAAO,KACJ,YAAY,CAAC,CACb,QAAQ,QAAQ,GAAG,CAAC,CACpB,QAAQ,eAAe,EAAE;AAC9B;AAGA,IAAM,uBAAuB;AAE7B,SAAS,YAAY,MAAuB;CAC1C,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,UAAU,KAAK,YAAY,CAAC,KAAK,KAAK,oBAAoB;AACnF;;;;;;;;;;;AAYA,SAAgB,aAAa,MAA6B;CACxD,MAAM,UAAU,KAAK,KAAK;CAC1B,IAAI,CAAC,WAAW,OAAO,GAAG,OAAO;CACjC,IAAI,YAAY,OAAO,GAAG,OAAO;CACjC,MAAM,OAAO,YAAY,OAAO;CAChC,OAAO,KAAK,SAAS,IAAI,OAAO;AAClC"}
1
+ {"version":3,"file":"slug-DVkuPjIv.cjs","names":[],"sources":["../src/wiki/slug.ts"],"sourcesContent":["// Pure wiki-page slug helpers — string-only, no Node / browser\n// dependencies, importable from any bundle.\n//\n// Used by:\n// - server/workspace/wiki-pages/io.ts (the write chokepoint)\n// - server/workspace/hooks/handlers/wikiSnapshot.ts (the\n// PostToolUse handler that fires on Write/Edit of a wiki page)\n// - server/api/routes/wiki.ts (page resolver + lint)\n// - server/api/routes/wiki/history.ts (history slug guard)\n// - src/plugins/wiki/route.ts (router slug guard — replaces the\n// local `isSafeWikiSlug` duplicate that existed before the\n// pure-lib refactor)\n// - src/plugins/wiki/helpers.ts (renderer slugify for [[…]] links)\n//\n// Any helper that needs `node:path` lives in `./paths.ts` so that\n// importing this file from frontend code never pulls in Node\n// builtins.\n\n/** Reject slugs that would escape `data/wiki/pages/` once\n * joined back into a path, or that are otherwise invalid as\n * page filenames. The chokepoint must defend itself even when\n * callers derive the slug from a trusted source — a typo or\n * future caller mistake should fail loud, not silently write\n * outside the wiki tree.\n *\n * The rule is intentionally narrow — separators / `..` / NUL /\n * empty — so it only rejects unambiguous violations. Aesthetic\n * concerns (e.g. dot-prefixed filenames) are out of scope: a\n * pre-existing `data/wiki/pages/.foo.md` should remain writable\n * through the chokepoint (codex review iter-2 #883). */\nexport function isSafeSlug(slug: string): boolean {\n if (slug.length === 0) return false;\n if (slug === \".\" || slug === \"..\") return false;\n if (slug.includes(\"/\") || slug.includes(\"\\\\\")) return false;\n if (slug.includes(\"\\0\")) return false;\n return true;\n}\n\n/** Slug rules for `[[wiki link]]` text → slug derivation:\n * lowercase, spaces collapsed to hyphens, every non-ASCII /\n * non-alphanumeric / non-hyphen character stripped.\n *\n * Pure: no normalisation, no transliteration — this is the\n * same shape the index parser, page resolver, and frontend\n * renderer all need to agree on. Non-ASCII titles (e.g.\n * Japanese) collapse to an ASCII remnant here, so a caller\n * matching against real page files must go through\n * `matchWikiSlug`, which tries the untouched name first. */\nexport function wikiSlugify(text: string): string {\n return text\n .toLowerCase()\n .replace(/\\s+/g, \"-\")\n .replace(/[^a-z0-9-]/g, \"\");\n}\n\n// Code point above which `wikiSlugify` strips a character outright.\nconst MAX_ASCII_CODE_POINT = 127;\n\nfunction hasNonAscii(text: string): boolean {\n return [...text].some((char) => (char.codePointAt(0) ?? 0) > MAX_ASCII_CODE_POINT);\n}\n\n/** Filename stem to suggest when a page has to be created for `name`,\n * or null when `name` cannot yield one.\n *\n * ASCII names keep the hyphenated slug convention. A non-ASCII name is\n * suggested verbatim — the write chokepoint accepts any `isSafeSlug`\n * filename, and slugifying it would propose a stripped remnant like\n * `-4.md` (#2940). Null rather than a salvaged stem for a name the\n * write guard would reject anyway: suggesting `wiki/pages/.md`, or\n * `secrets.md` for `../secrets`, sends the caller to a file it did\n * not ask for. */\nexport function wikiPageStem(name: string): string | null {\n const trimmed = name.trim();\n if (!isSafeSlug(trimmed)) return null;\n if (hasNonAscii(trimmed)) return trimmed;\n const slug = wikiSlugify(trimmed);\n return slug.length > 0 ? slug : null;\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,WAAW,MAAuB;CAChD,IAAI,KAAK,WAAW,GAAG,OAAO;CAC9B,IAAI,SAAS,OAAO,SAAS,MAAM,OAAO;CAC1C,IAAI,KAAK,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,GAAG,OAAO;CACtD,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,YAAY,MAAsB;CAChD,OAAO,KACJ,YAAY,CAAC,CACb,QAAQ,QAAQ,GAAG,CAAC,CACpB,QAAQ,eAAe,EAAE;AAC9B;AAGA,IAAM,uBAAuB;AAE7B,SAAS,YAAY,MAAuB;CAC1C,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,UAAU,KAAK,YAAY,CAAC,KAAK,KAAK,oBAAoB;AACnF;;;;;;;;;;;AAYA,SAAgB,aAAa,MAA6B;CACxD,MAAM,UAAU,KAAK,KAAK;CAC1B,IAAI,CAAC,WAAW,OAAO,GAAG,OAAO;CACjC,IAAI,YAAY,OAAO,GAAG,OAAO;CACjC,MAAM,OAAO,YAAY,OAAO;CAChC,OAAO,KAAK,SAAS,IAAI,OAAO;AAClC"}
@@ -1,4 +1,4 @@
1
- //#region src/collection/core/templatePath.ts
1
+ // src/collection/core/templatePath.ts
2
2
  /** `templates/` — the subdir an action template must live under. */
3
3
  var TEMPLATES_PREFIX = "templates/";
4
4
  /**
@@ -46,7 +46,6 @@ function isSafeCustomViewPath(value) {
46
46
  function isSafeCustomViewI18nPath(value) {
47
47
  return value.startsWith(VIEWS_PREFIX) && /\.i18n\.json$/.test(value) && isSafeTemplatePath(value);
48
48
  }
49
- //#endregion
50
49
  Object.defineProperty(exports, "isSafeActionTemplatePath", {
51
50
  enumerable: true,
52
51
  get: function() {
@@ -72,4 +71,4 @@ Object.defineProperty(exports, "isSafeTemplatePath", {
72
71
  }
73
72
  });
74
73
 
75
- //# sourceMappingURL=templatePath-27vUZowm.cjs.map
74
+ //# sourceMappingURL=templatePath-BIh7wqgS.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"templatePath-27vUZowm.cjs","names":[],"sources":["../src/collection/core/templatePath.ts"],"sourcesContent":["// Shared template-path safety, used by BOTH the collection schema\n// validator (`./schemaZ` `ActionSpecZ`) and the skill-bridge\n// hook (`hooks/handlers/skillBridge.ts`). Centralised so the set of\n// action `template` paths a schema may declare is *exactly* the set\n// the bridge mirrors into `.claude/skills/<slug>/` — if the two\n// diverge, a schema can validate yet reference a template the bridge\n// silently drops (runtime \"template could not be read\").\n//\n// Keep this module dependency-free: the bridge is bundled into a lean\n// esbuild dispatcher, so it must not drag in workspace/path machinery.\n\n/** `templates/` — the subdir an action template must live under. */\nconst TEMPLATES_PREFIX = \"templates/\";\n\n/**\n * A safe skill-relative path: non-empty, no backslash, not absolute,\n * and every `/`-separated segment is a plain `[A-Za-z0-9._-]+` token\n * that isn't `.` / `..` (no traversal). Multi-segment (nested) paths\n * are allowed. The reader's realpath containment is the hard\n * guarantee; this fails a bad path fast.\n */\nexport function isSafeTemplatePath(value: string): boolean {\n if (value.length === 0 || value.includes(\"\\\\\") || value.startsWith(\"/\")) return false;\n return value.split(\"/\").every((seg) => seg.length > 0 && seg !== \".\" && seg !== \"..\" && /^[A-Za-z0-9._-]+$/.test(seg));\n}\n\n/**\n * An action `template` value: a safe path that lives under the skill's\n * `templates/` subdir. This is the canonical contract — the schema\n * validator rejects anything else up front, and the bridge mirrors\n * exactly these. Nested paths (`templates/mail/welcome.md`) and any\n * extension are allowed as long as the path is otherwise safe.\n */\nexport function isSafeActionTemplatePath(value: string): boolean {\n return value.startsWith(TEMPLATES_PREFIX) && isSafeTemplatePath(value);\n}\n\n/** `views/` — the subdir a custom-view HTML file must live under. */\nconst VIEWS_PREFIX = \"views/\";\n\n/**\n * A custom-view `file` value: a safe path under the skill's `views/`\n * subdir that ends in `.html`. Custom views are LLM-authored HTML the\n * host renders in a sandboxed iframe; constraining them to `views/*.html`\n * keeps the data folder and the schema/template files off-limits to the\n * view-file reader. Same per-segment safety as templates; the reader's\n * realpath containment is the hard guarantee.\n */\nexport function isSafeCustomViewPath(value: string): boolean {\n return value.startsWith(VIEWS_PREFIX) && /\\.html$/.test(value) && isSafeTemplatePath(value);\n}\n\n/**\n * A custom-view `i18n` value: the JSON dictionary file authors ship next to\n * their `views/<id>.html`. Constrained to `views/<name>.i18n.json` so the\n * field can only point at a translation file co-located with the view it\n * translates — the same `views/` containment the HTML reader uses. The\n * `.i18n.json` suffix (vs plain `.json`) makes the file's purpose grep-able\n * for both authors and tooling.\n */\nexport function isSafeCustomViewI18nPath(value: string): boolean {\n return value.startsWith(VIEWS_PREFIX) && /\\.i18n\\.json$/.test(value) && isSafeTemplatePath(value);\n}\n"],"mappings":";;AAYA,IAAM,mBAAmB;;;;;;;;AASzB,SAAgB,mBAAmB,OAAwB;CACzD,IAAI,MAAM,WAAW,KAAK,MAAM,SAAS,IAAI,KAAK,MAAM,WAAW,GAAG,GAAG,OAAO;CAChF,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,QAAQ,IAAI,SAAS,KAAK,QAAQ,OAAO,QAAQ,QAAQ,oBAAoB,KAAK,GAAG,CAAC;AACvH;;;;;;;;AASA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,MAAM,WAAW,gBAAgB,KAAK,mBAAmB,KAAK;AACvE;;AAGA,IAAM,eAAe;;;;;;;;;AAUrB,SAAgB,qBAAqB,OAAwB;CAC3D,OAAO,MAAM,WAAW,YAAY,KAAK,UAAU,KAAK,KAAK,KAAK,mBAAmB,KAAK;AAC5F;;;;;;;;;AAUA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,MAAM,WAAW,YAAY,KAAK,gBAAgB,KAAK,KAAK,KAAK,mBAAmB,KAAK;AAClG"}
1
+ {"version":3,"file":"templatePath-BIh7wqgS.cjs","names":[],"sources":["../src/collection/core/templatePath.ts"],"sourcesContent":["// Shared template-path safety, used by BOTH the collection schema\n// validator (`./schemaZ` `ActionSpecZ`) and the skill-bridge\n// hook (`hooks/handlers/skillBridge.ts`). Centralised so the set of\n// action `template` paths a schema may declare is *exactly* the set\n// the bridge mirrors into `.claude/skills/<slug>/` — if the two\n// diverge, a schema can validate yet reference a template the bridge\n// silently drops (runtime \"template could not be read\").\n//\n// Keep this module dependency-free: the bridge is bundled into a lean\n// esbuild dispatcher, so it must not drag in workspace/path machinery.\n\n/** `templates/` — the subdir an action template must live under. */\nconst TEMPLATES_PREFIX = \"templates/\";\n\n/**\n * A safe skill-relative path: non-empty, no backslash, not absolute,\n * and every `/`-separated segment is a plain `[A-Za-z0-9._-]+` token\n * that isn't `.` / `..` (no traversal). Multi-segment (nested) paths\n * are allowed. The reader's realpath containment is the hard\n * guarantee; this fails a bad path fast.\n */\nexport function isSafeTemplatePath(value: string): boolean {\n if (value.length === 0 || value.includes(\"\\\\\") || value.startsWith(\"/\")) return false;\n return value.split(\"/\").every((seg) => seg.length > 0 && seg !== \".\" && seg !== \"..\" && /^[A-Za-z0-9._-]+$/.test(seg));\n}\n\n/**\n * An action `template` value: a safe path that lives under the skill's\n * `templates/` subdir. This is the canonical contract — the schema\n * validator rejects anything else up front, and the bridge mirrors\n * exactly these. Nested paths (`templates/mail/welcome.md`) and any\n * extension are allowed as long as the path is otherwise safe.\n */\nexport function isSafeActionTemplatePath(value: string): boolean {\n return value.startsWith(TEMPLATES_PREFIX) && isSafeTemplatePath(value);\n}\n\n/** `views/` — the subdir a custom-view HTML file must live under. */\nconst VIEWS_PREFIX = \"views/\";\n\n/**\n * A custom-view `file` value: a safe path under the skill's `views/`\n * subdir that ends in `.html`. Custom views are LLM-authored HTML the\n * host renders in a sandboxed iframe; constraining them to `views/*.html`\n * keeps the data folder and the schema/template files off-limits to the\n * view-file reader. Same per-segment safety as templates; the reader's\n * realpath containment is the hard guarantee.\n */\nexport function isSafeCustomViewPath(value: string): boolean {\n return value.startsWith(VIEWS_PREFIX) && /\\.html$/.test(value) && isSafeTemplatePath(value);\n}\n\n/**\n * A custom-view `i18n` value: the JSON dictionary file authors ship next to\n * their `views/<id>.html`. Constrained to `views/<name>.i18n.json` so the\n * field can only point at a translation file co-located with the view it\n * translates — the same `views/` containment the HTML reader uses. The\n * `.i18n.json` suffix (vs plain `.json`) makes the file's purpose grep-able\n * for both authors and tooling.\n */\nexport function isSafeCustomViewI18nPath(value: string): boolean {\n return value.startsWith(VIEWS_PREFIX) && /\\.i18n\\.json$/.test(value) && isSafeTemplatePath(value);\n}\n"],"mappings":";;AAYA,IAAM,mBAAmB;;;;;;;;AASzB,SAAgB,mBAAmB,OAAwB;CACzD,IAAI,MAAM,WAAW,KAAK,MAAM,SAAS,IAAI,KAAK,MAAM,WAAW,GAAG,GAAG,OAAO;CAChF,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,QAAQ,IAAI,SAAS,KAAK,QAAQ,OAAO,QAAQ,QAAQ,oBAAoB,KAAK,GAAG,CAAC;AACvH;;;;;;;;AASA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,MAAM,WAAW,gBAAgB,KAAK,mBAAmB,KAAK;AACvE;;AAGA,IAAM,eAAe;;;;;;;;;AAUrB,SAAgB,qBAAqB,OAAwB;CAC3D,OAAO,MAAM,WAAW,YAAY,KAAK,UAAU,KAAK,KAAK,KAAK,mBAAmB,KAAK;AAC5F;;;;;;;;;AAUA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,MAAM,WAAW,YAAY,KAAK,gBAAgB,KAAK,KAAK,KAAK,mBAAmB,KAAK;AAClG"}
@@ -1,4 +1,4 @@
1
- //#region src/collection/core/templatePath.ts
1
+ // src/collection/core/templatePath.ts
2
2
  /** `templates/` — the subdir an action template must live under. */
3
3
  var TEMPLATES_PREFIX = "templates/";
4
4
  /**
@@ -46,7 +46,6 @@ function isSafeCustomViewPath(value) {
46
46
  function isSafeCustomViewI18nPath(value) {
47
47
  return value.startsWith(VIEWS_PREFIX) && /\.i18n\.json$/.test(value) && isSafeTemplatePath(value);
48
48
  }
49
- //#endregion
50
49
  export { isSafeTemplatePath as i, isSafeCustomViewI18nPath as n, isSafeCustomViewPath as r, isSafeActionTemplatePath as t };
51
50
 
52
- //# sourceMappingURL=templatePath-k_WNbL_Q.js.map
51
+ //# sourceMappingURL=templatePath-CB3wtVpe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templatePath-k_WNbL_Q.js","names":[],"sources":["../src/collection/core/templatePath.ts"],"sourcesContent":["// Shared template-path safety, used by BOTH the collection schema\n// validator (`./schemaZ` `ActionSpecZ`) and the skill-bridge\n// hook (`hooks/handlers/skillBridge.ts`). Centralised so the set of\n// action `template` paths a schema may declare is *exactly* the set\n// the bridge mirrors into `.claude/skills/<slug>/` — if the two\n// diverge, a schema can validate yet reference a template the bridge\n// silently drops (runtime \"template could not be read\").\n//\n// Keep this module dependency-free: the bridge is bundled into a lean\n// esbuild dispatcher, so it must not drag in workspace/path machinery.\n\n/** `templates/` — the subdir an action template must live under. */\nconst TEMPLATES_PREFIX = \"templates/\";\n\n/**\n * A safe skill-relative path: non-empty, no backslash, not absolute,\n * and every `/`-separated segment is a plain `[A-Za-z0-9._-]+` token\n * that isn't `.` / `..` (no traversal). Multi-segment (nested) paths\n * are allowed. The reader's realpath containment is the hard\n * guarantee; this fails a bad path fast.\n */\nexport function isSafeTemplatePath(value: string): boolean {\n if (value.length === 0 || value.includes(\"\\\\\") || value.startsWith(\"/\")) return false;\n return value.split(\"/\").every((seg) => seg.length > 0 && seg !== \".\" && seg !== \"..\" && /^[A-Za-z0-9._-]+$/.test(seg));\n}\n\n/**\n * An action `template` value: a safe path that lives under the skill's\n * `templates/` subdir. This is the canonical contract — the schema\n * validator rejects anything else up front, and the bridge mirrors\n * exactly these. Nested paths (`templates/mail/welcome.md`) and any\n * extension are allowed as long as the path is otherwise safe.\n */\nexport function isSafeActionTemplatePath(value: string): boolean {\n return value.startsWith(TEMPLATES_PREFIX) && isSafeTemplatePath(value);\n}\n\n/** `views/` — the subdir a custom-view HTML file must live under. */\nconst VIEWS_PREFIX = \"views/\";\n\n/**\n * A custom-view `file` value: a safe path under the skill's `views/`\n * subdir that ends in `.html`. Custom views are LLM-authored HTML the\n * host renders in a sandboxed iframe; constraining them to `views/*.html`\n * keeps the data folder and the schema/template files off-limits to the\n * view-file reader. Same per-segment safety as templates; the reader's\n * realpath containment is the hard guarantee.\n */\nexport function isSafeCustomViewPath(value: string): boolean {\n return value.startsWith(VIEWS_PREFIX) && /\\.html$/.test(value) && isSafeTemplatePath(value);\n}\n\n/**\n * A custom-view `i18n` value: the JSON dictionary file authors ship next to\n * their `views/<id>.html`. Constrained to `views/<name>.i18n.json` so the\n * field can only point at a translation file co-located with the view it\n * translates — the same `views/` containment the HTML reader uses. The\n * `.i18n.json` suffix (vs plain `.json`) makes the file's purpose grep-able\n * for both authors and tooling.\n */\nexport function isSafeCustomViewI18nPath(value: string): boolean {\n return value.startsWith(VIEWS_PREFIX) && /\\.i18n\\.json$/.test(value) && isSafeTemplatePath(value);\n}\n"],"mappings":";;AAYA,IAAM,mBAAmB;;;;;;;;AASzB,SAAgB,mBAAmB,OAAwB;CACzD,IAAI,MAAM,WAAW,KAAK,MAAM,SAAS,IAAI,KAAK,MAAM,WAAW,GAAG,GAAG,OAAO;CAChF,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,QAAQ,IAAI,SAAS,KAAK,QAAQ,OAAO,QAAQ,QAAQ,oBAAoB,KAAK,GAAG,CAAC;AACvH;;;;;;;;AASA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,MAAM,WAAW,gBAAgB,KAAK,mBAAmB,KAAK;AACvE;;AAGA,IAAM,eAAe;;;;;;;;;AAUrB,SAAgB,qBAAqB,OAAwB;CAC3D,OAAO,MAAM,WAAW,YAAY,KAAK,UAAU,KAAK,KAAK,KAAK,mBAAmB,KAAK;AAC5F;;;;;;;;;AAUA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,MAAM,WAAW,YAAY,KAAK,gBAAgB,KAAK,KAAK,KAAK,mBAAmB,KAAK;AAClG"}
1
+ {"version":3,"file":"templatePath-CB3wtVpe.js","names":[],"sources":["../src/collection/core/templatePath.ts"],"sourcesContent":["// Shared template-path safety, used by BOTH the collection schema\n// validator (`./schemaZ` `ActionSpecZ`) and the skill-bridge\n// hook (`hooks/handlers/skillBridge.ts`). Centralised so the set of\n// action `template` paths a schema may declare is *exactly* the set\n// the bridge mirrors into `.claude/skills/<slug>/` — if the two\n// diverge, a schema can validate yet reference a template the bridge\n// silently drops (runtime \"template could not be read\").\n//\n// Keep this module dependency-free: the bridge is bundled into a lean\n// esbuild dispatcher, so it must not drag in workspace/path machinery.\n\n/** `templates/` — the subdir an action template must live under. */\nconst TEMPLATES_PREFIX = \"templates/\";\n\n/**\n * A safe skill-relative path: non-empty, no backslash, not absolute,\n * and every `/`-separated segment is a plain `[A-Za-z0-9._-]+` token\n * that isn't `.` / `..` (no traversal). Multi-segment (nested) paths\n * are allowed. The reader's realpath containment is the hard\n * guarantee; this fails a bad path fast.\n */\nexport function isSafeTemplatePath(value: string): boolean {\n if (value.length === 0 || value.includes(\"\\\\\") || value.startsWith(\"/\")) return false;\n return value.split(\"/\").every((seg) => seg.length > 0 && seg !== \".\" && seg !== \"..\" && /^[A-Za-z0-9._-]+$/.test(seg));\n}\n\n/**\n * An action `template` value: a safe path that lives under the skill's\n * `templates/` subdir. This is the canonical contract — the schema\n * validator rejects anything else up front, and the bridge mirrors\n * exactly these. Nested paths (`templates/mail/welcome.md`) and any\n * extension are allowed as long as the path is otherwise safe.\n */\nexport function isSafeActionTemplatePath(value: string): boolean {\n return value.startsWith(TEMPLATES_PREFIX) && isSafeTemplatePath(value);\n}\n\n/** `views/` — the subdir a custom-view HTML file must live under. */\nconst VIEWS_PREFIX = \"views/\";\n\n/**\n * A custom-view `file` value: a safe path under the skill's `views/`\n * subdir that ends in `.html`. Custom views are LLM-authored HTML the\n * host renders in a sandboxed iframe; constraining them to `views/*.html`\n * keeps the data folder and the schema/template files off-limits to the\n * view-file reader. Same per-segment safety as templates; the reader's\n * realpath containment is the hard guarantee.\n */\nexport function isSafeCustomViewPath(value: string): boolean {\n return value.startsWith(VIEWS_PREFIX) && /\\.html$/.test(value) && isSafeTemplatePath(value);\n}\n\n/**\n * A custom-view `i18n` value: the JSON dictionary file authors ship next to\n * their `views/<id>.html`. Constrained to `views/<name>.i18n.json` so the\n * field can only point at a translation file co-located with the view it\n * translates — the same `views/` containment the HTML reader uses. The\n * `.i18n.json` suffix (vs plain `.json`) makes the file's purpose grep-able\n * for both authors and tooling.\n */\nexport function isSafeCustomViewI18nPath(value: string): boolean {\n return value.startsWith(VIEWS_PREFIX) && /\\.i18n\\.json$/.test(value) && isSafeTemplatePath(value);\n}\n"],"mappings":";;AAYA,IAAM,mBAAmB;;;;;;;;AASzB,SAAgB,mBAAmB,OAAwB;CACzD,IAAI,MAAM,WAAW,KAAK,MAAM,SAAS,IAAI,KAAK,MAAM,WAAW,GAAG,GAAG,OAAO;CAChF,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,QAAQ,IAAI,SAAS,KAAK,QAAQ,OAAO,QAAQ,QAAQ,oBAAoB,KAAK,GAAG,CAAC;AACvH;;;;;;;;AASA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,MAAM,WAAW,gBAAgB,KAAK,mBAAmB,KAAK;AACvE;;AAGA,IAAM,eAAe;;;;;;;;;AAUrB,SAAgB,qBAAqB,OAAwB;CAC3D,OAAO,MAAM,WAAW,YAAY,KAAK,UAAU,KAAK,KAAK,KAAK,mBAAmB,KAAK;AAC5F;;;;;;;;;AAUA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,MAAM,WAAW,YAAY,KAAK,gBAAgB,KAAK,KAAK,KAAK,mBAAmB,KAAK;AAClG"}
@@ -1,4 +1,4 @@
1
- //#region src/utils/text.ts
1
+ // src/utils/text.ts
2
2
  /** Clip a string to at most `max` chars. The ellipsis is part of the budget,
3
3
  * so the result never exceeds `max`.
4
4
  *
@@ -16,7 +16,6 @@ function truncate(text, max, ellipsis = "…") {
16
16
  if (ellipsis.length >= max) return ellipsis.slice(0, max);
17
17
  return text.slice(0, max - ellipsis.length) + ellipsis;
18
18
  }
19
- //#endregion
20
19
  export { truncate as t };
21
20
 
22
- //# sourceMappingURL=text-CjDbP2O1.js.map
21
+ //# sourceMappingURL=text-BQAuwKVj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-CjDbP2O1.js","names":[],"sources":["../src/utils/text.ts"],"sourcesContent":["// Canonical text helpers. Browser-safe: pure string work, no node imports.\n\n/** Clip a string to at most `max` chars. The ellipsis is part of the budget,\n * so the result never exceeds `max`.\n *\n * Edge cases:\n * - `text.length <= max` → `text` unchanged.\n * - `max <= 0` → empty string (callers asking for \"no output\" should get no\n * output, not a stray ellipsis).\n * - `ellipsis.length >= max` → the ellipsis itself is clipped to `max` rather\n * than throwing. Dropping this guard is what let the pre-#2217 core copy\n * return 3 chars for `truncate(\"hello\", 2, \"...\")` while promising in its\n * own docblock that output never exceeds `max`. */\nexport function truncate(text: string, max: number, ellipsis = \"…\"): string {\n if (max <= 0) return \"\";\n if (text.length <= max) return text;\n if (ellipsis.length >= max) return ellipsis.slice(0, max);\n return text.slice(0, max - ellipsis.length) + ellipsis;\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,SAAS,MAAc,KAAa,WAAW,KAAa;CAC1E,IAAI,OAAO,GAAG,OAAO;CACrB,IAAI,KAAK,UAAU,KAAK,OAAO;CAC/B,IAAI,SAAS,UAAU,KAAK,OAAO,SAAS,MAAM,GAAG,GAAG;CACxD,OAAO,KAAK,MAAM,GAAG,MAAM,SAAS,MAAM,IAAI;AAChD"}
1
+ {"version":3,"file":"text-BQAuwKVj.js","names":[],"sources":["../src/utils/text.ts"],"sourcesContent":["// Canonical text helpers. Browser-safe: pure string work, no node imports.\n\n/** Clip a string to at most `max` chars. The ellipsis is part of the budget,\n * so the result never exceeds `max`.\n *\n * Edge cases:\n * - `text.length <= max` → `text` unchanged.\n * - `max <= 0` → empty string (callers asking for \"no output\" should get no\n * output, not a stray ellipsis).\n * - `ellipsis.length >= max` → the ellipsis itself is clipped to `max` rather\n * than throwing. Dropping this guard is what let the pre-#2217 core copy\n * return 3 chars for `truncate(\"hello\", 2, \"...\")` while promising in its\n * own docblock that output never exceeds `max`. */\nexport function truncate(text: string, max: number, ellipsis = \"…\"): string {\n if (max <= 0) return \"\";\n if (text.length <= max) return text;\n if (ellipsis.length >= max) return ellipsis.slice(0, max);\n return text.slice(0, max - ellipsis.length) + ellipsis;\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,SAAS,MAAc,KAAa,WAAW,KAAa;CAC1E,IAAI,OAAO,GAAG,OAAO;CACrB,IAAI,KAAK,UAAU,KAAK,OAAO;CAC/B,IAAI,SAAS,UAAU,KAAK,OAAO,SAAS,MAAM,GAAG,GAAG;CACxD,OAAO,KAAK,MAAM,GAAG,MAAM,SAAS,MAAM,IAAI;AAChD"}
@@ -1,4 +1,4 @@
1
- //#region src/utils/text.ts
1
+ // src/utils/text.ts
2
2
  /** Clip a string to at most `max` chars. The ellipsis is part of the budget,
3
3
  * so the result never exceeds `max`.
4
4
  *
@@ -16,7 +16,6 @@ function truncate(text, max, ellipsis = "…") {
16
16
  if (ellipsis.length >= max) return ellipsis.slice(0, max);
17
17
  return text.slice(0, max - ellipsis.length) + ellipsis;
18
18
  }
19
- //#endregion
20
19
  Object.defineProperty(exports, "truncate", {
21
20
  enumerable: true,
22
21
  get: function() {
@@ -24,4 +23,4 @@ Object.defineProperty(exports, "truncate", {
24
23
  }
25
24
  });
26
25
 
27
- //# sourceMappingURL=text-CaAh9ZSO.cjs.map
26
+ //# sourceMappingURL=text-BQiyo5R9.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-CaAh9ZSO.cjs","names":[],"sources":["../src/utils/text.ts"],"sourcesContent":["// Canonical text helpers. Browser-safe: pure string work, no node imports.\n\n/** Clip a string to at most `max` chars. The ellipsis is part of the budget,\n * so the result never exceeds `max`.\n *\n * Edge cases:\n * - `text.length <= max` → `text` unchanged.\n * - `max <= 0` → empty string (callers asking for \"no output\" should get no\n * output, not a stray ellipsis).\n * - `ellipsis.length >= max` → the ellipsis itself is clipped to `max` rather\n * than throwing. Dropping this guard is what let the pre-#2217 core copy\n * return 3 chars for `truncate(\"hello\", 2, \"...\")` while promising in its\n * own docblock that output never exceeds `max`. */\nexport function truncate(text: string, max: number, ellipsis = \"…\"): string {\n if (max <= 0) return \"\";\n if (text.length <= max) return text;\n if (ellipsis.length >= max) return ellipsis.slice(0, max);\n return text.slice(0, max - ellipsis.length) + ellipsis;\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,SAAS,MAAc,KAAa,WAAW,KAAa;CAC1E,IAAI,OAAO,GAAG,OAAO;CACrB,IAAI,KAAK,UAAU,KAAK,OAAO;CAC/B,IAAI,SAAS,UAAU,KAAK,OAAO,SAAS,MAAM,GAAG,GAAG;CACxD,OAAO,KAAK,MAAM,GAAG,MAAM,SAAS,MAAM,IAAI;AAChD"}
1
+ {"version":3,"file":"text-BQiyo5R9.cjs","names":[],"sources":["../src/utils/text.ts"],"sourcesContent":["// Canonical text helpers. Browser-safe: pure string work, no node imports.\n\n/** Clip a string to at most `max` chars. The ellipsis is part of the budget,\n * so the result never exceeds `max`.\n *\n * Edge cases:\n * - `text.length <= max` → `text` unchanged.\n * - `max <= 0` → empty string (callers asking for \"no output\" should get no\n * output, not a stray ellipsis).\n * - `ellipsis.length >= max` → the ellipsis itself is clipped to `max` rather\n * than throwing. Dropping this guard is what let the pre-#2217 core copy\n * return 3 chars for `truncate(\"hello\", 2, \"...\")` while promising in its\n * own docblock that output never exceeds `max`. */\nexport function truncate(text: string, max: number, ellipsis = \"…\"): string {\n if (max <= 0) return \"\";\n if (text.length <= max) return text;\n if (ellipsis.length >= max) return ellipsis.slice(0, max);\n return text.slice(0, max - ellipsis.length) + ellipsis;\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,SAAS,MAAc,KAAa,WAAW,KAAa;CAC1E,IAAI,OAAO,GAAG,OAAO;CACrB,IAAI,KAAK,UAAU,KAAK,OAAO;CAC/B,IAAI,SAAS,UAAU,KAAK,OAAO,SAAS,MAAM,GAAG,GAAG;CACxD,OAAO,KAAK,MAAM,GAAG,MAAM,SAAS,MAAM,IAAI;AAChD"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/translation/client.ts
2
+ // src/translation/client.ts
3
3
  function cacheKey(req) {
4
4
  return [
5
5
  req.namespace,
@@ -54,7 +54,6 @@ function createTranslationCache(transport) {
54
54
  }
55
55
  };
56
56
  }
57
- //#endregion
58
57
  exports.createTranslationCache = createTranslationCache;
59
58
  exports.loadTranslated = loadTranslated;
60
59
 
@@ -1,4 +1,4 @@
1
- //#region src/translation/client.ts
1
+ // src/translation/client.ts
2
2
  function cacheKey(req) {
3
3
  return [
4
4
  req.namespace,
@@ -53,7 +53,6 @@ function createTranslationCache(transport) {
53
53
  }
54
54
  };
55
55
  }
56
- //#endregion
57
56
  export { createTranslationCache, loadTranslated };
58
57
 
59
58
  //# sourceMappingURL=client.js.map
@@ -1,10 +1,9 @@
1
- //#region src/collection/registry/guards.ts
1
+ // src/collection/registry/guards.ts
2
2
  /** Narrow `unknown` to a plain object (not null, not array). */
3
3
  function isRecord(value) {
4
4
  return typeof value === "object" && value !== null && !Array.isArray(value);
5
5
  }
6
- //#endregion
7
- //#region src/collection/registry/registryIndex.ts
6
+ // src/collection/registry/registryIndex.ts
8
7
  var SUPPORTED_SCHEMA_VERSION = 1;
9
8
  var pickString = (rec, key) => {
10
9
  const value = rec[key];
@@ -112,12 +111,10 @@ function parseRegistryIndex(value, registryName) {
112
111
  }
113
112
  };
114
113
  }
115
- //#endregion
116
- //#region src/collection/registry/types.ts
114
+ // src/collection/registry/types.ts
117
115
  /** Reserved name for the official registry. The client always synthesizes one
118
116
  * entry under this name; user config that re-uses it is rejected. */
119
117
  var OFFICIAL_REGISTRY_NAME = "official";
120
- //#endregion
121
118
  export { parseRegistryIndex as n, isRecord as r, OFFICIAL_REGISTRY_NAME as t };
122
119
 
123
- //# sourceMappingURL=types-BKVZrtyc.js.map
120
+ //# sourceMappingURL=types-BLCZTGW2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-BKVZrtyc.js","names":[],"sources":["../src/collection/registry/guards.ts","../src/collection/registry/registryIndex.ts","../src/collection/registry/types.ts"],"sourcesContent":["/** Narrow `unknown` to a plain object (not null, not array). */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","// Parse + validate the curated collection registry's published index.json.\n// Pure — no I/O. The caller fetches the JSON and hands the parsed value here.\n// Mirrors the registry repo's schema/index.schema.json contract (schemaVersion 1):\n// receptron/mulmoclaude-collections.\n//\n// The index is host-fetched convenience data for the Discover catalog, not a\n// trust boundary: a collection's actual files are re-validated on import.\n\nimport { isRecord } from \"./guards.js\";\n\nexport interface RegistryEntry {\n /** `<author>/<slug>` — identity inside its source registry. NOT globally\n * unique when multiple registries are configured — pair with `registryName`\n * for a global key. */\n id: string;\n author: string;\n slug: string;\n title: string;\n icon: string;\n description: string;\n version: string;\n tags: string[];\n license: string;\n fieldCount: number;\n /** Custom view labels. */\n views: string[];\n hasSeed: boolean;\n seedCount: number;\n /** repo-relative path, omitted when absent. */\n screenshot?: string | undefined;\n /** repo-relative collection dir. */\n path: string;\n /** Stable bundle hash for update detection. */\n contentSha: string;\n /** Label of the source registry. Set by the client (not by the parser) when\n * the index is fetched, so the import / preview path can resolve the right\n * rawBase. `\"official\"` for receptron/mulmoclaude-collections; otherwise\n * the user's config entry name. */\n registryName: string;\n}\n\nexport interface RegistryIndex {\n schemaVersion: number;\n generatedAt: string;\n registry: string;\n collections: RegistryEntry[];\n}\n\nexport type ParseResult = { ok: true; index: RegistryIndex } | { ok: false; error: string };\n\nconst SUPPORTED_SCHEMA_VERSION = 1;\n\nconst pickString = (rec: Record<string, unknown>, key: string): string | undefined => {\n const value = rec[key];\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n};\n\n// Count fields (fieldCount/seedCount) must be non-negative integers. A present\n// but negative/fractional value is rejected rather than served to the UI; an\n// absent value defaults to 0.\nfunction validatedCount(rec: Record<string, unknown>, key: string): number | \"invalid\" {\n const value = rec[key];\n if (value === undefined) return 0;\n return typeof value === \"number\" && Number.isInteger(value) && value >= 0 ? value : \"invalid\";\n}\n\nconst pickBoolean = (rec: Record<string, unknown>, key: string): boolean | undefined => {\n const value = rec[key];\n return typeof value === \"boolean\" ? value : undefined;\n};\n\nconst asStringArray = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === \"string\") : []);\n\n// Identifier allowlists (mirror the registry's meta.schema.json). Crucially these\n// exclude `.`, `/`, `\\`, and `..`, so a poisoned author/slug can never make\n// collectionFileUrl() escape the collections/<author>/<slug> subtree — even if the\n// entry is internally consistent. Bounded quantifiers (no ReDoS).\nconst AUTHOR_RE = /^[A-Za-z0-9][A-Za-z0-9-]{0,38}$/;\nconst SLUG_RE = /^[a-z0-9][a-z0-9-]{0,62}$/;\n\n// author/slug must be allowlisted identifiers, and id/path must agree with them, so a\n// lookup by author+slug can never fetch files from a different (or out-of-tree)\n// directory than requested (defense against a poisoned index).\nfunction identityError(entryId: string, author: string, slug: string, dirPath: string, index: number): string | null {\n if (!AUTHOR_RE.test(author)) return `collections[${index}].author has an invalid format`;\n if (!SLUG_RE.test(slug)) return `collections[${index}].slug has an invalid format`;\n if (entryId !== `${author}/${slug}`) return `collections[${index}].id must equal \"${author}/${slug}\"`;\n if (dirPath !== `collections/${author}/${slug}`) return `collections[${index}].path must equal \"collections/${author}/${slug}\"`;\n return null;\n}\n\nfunction validatedCounts(value: Record<string, unknown>, index: number): { fieldCount: number; seedCount: number } | string {\n const fieldCount = validatedCount(value, \"fieldCount\");\n const seedCount = validatedCount(value, \"seedCount\");\n if (fieldCount === \"invalid\") return `collections[${index}].fieldCount must be a non-negative integer`;\n if (seedCount === \"invalid\") return `collections[${index}].seedCount must be a non-negative integer`;\n return { fieldCount, seedCount };\n}\n\nfunction parseEntry(value: unknown, index: number, registryName: string): RegistryEntry | string {\n if (!isRecord(value)) return `collections[${index}] is not an object`;\n const entryId = pickString(value, \"id\");\n const author = pickString(value, \"author\");\n const slug = pickString(value, \"slug\");\n const title = pickString(value, \"title\");\n const version = pickString(value, \"version\");\n const path = pickString(value, \"path\");\n const contentSha = pickString(value, \"contentSha\");\n if (!entryId || !author || !slug || !title || !version || !path || !contentSha) {\n return `collections[${index}] is missing a required string field (id/author/slug/title/version/path/contentSha)`;\n }\n const mismatch = identityError(entryId, author, slug, path, index);\n if (mismatch) return mismatch;\n const counts = validatedCounts(value, index);\n if (typeof counts === \"string\") return counts;\n return {\n id: entryId,\n author,\n slug,\n title,\n version,\n path,\n contentSha,\n icon: pickString(value, \"icon\") ?? \"\",\n description: pickString(value, \"description\") ?? \"\",\n license: pickString(value, \"license\") ?? \"\",\n tags: asStringArray(value.tags),\n views: asStringArray(value.views),\n fieldCount: counts.fieldCount,\n seedCount: counts.seedCount,\n hasSeed: pickBoolean(value, \"hasSeed\") ?? false,\n screenshot: pickString(value, \"screenshot\"),\n registryName,\n };\n}\n\n/** Parse an index payload. `registryName` labels every entry produced — the\n * caller passes \"official\" for the canonical registry or the user's config\n * entry name. The label is needed downstream so import / preview can pick the\n * right rawBase for per-collection files. */\nexport function parseRegistryIndex(value: unknown, registryName: string): ParseResult {\n if (!isRecord(value)) return { ok: false, error: \"index is not an object\" };\n if (value.schemaVersion !== SUPPORTED_SCHEMA_VERSION) {\n return { ok: false, error: `unsupported schemaVersion (expected ${SUPPORTED_SCHEMA_VERSION})` };\n }\n const registry = pickString(value, \"registry\");\n const generatedAt = pickString(value, \"generatedAt\");\n if (!registry || !generatedAt) return { ok: false, error: \"index missing registry/generatedAt\" };\n if (!Array.isArray(value.collections)) return { ok: false, error: \"index.collections must be an array\" };\n\n const parsed = value.collections.map((entry, idx) => parseEntry(entry, idx, registryName));\n const firstError = parsed.find((entry): entry is string => typeof entry === \"string\");\n if (firstError !== undefined) return { ok: false, error: firstError };\n const collections = parsed.filter((entry): entry is RegistryEntry => typeof entry !== \"string\");\n return { ok: true, index: { schemaVersion: SUPPORTED_SCHEMA_VERSION, registry, generatedAt, collections } };\n}\n","// Isomorphic contract shared by the registry engine, the host routes, and the\n// collection plugin's Discover UI. No I/O — types + a reserved-name constant.\n\nimport type { RegistryEntry } from \"./registryIndex.js\";\n\nexport interface RegistryConfigEntry {\n /** Short label shown on Discover cards + used as the routing key. */\n name: string;\n /** Absolute HTTPS URL of the registry's index.json. */\n indexUrl: string;\n /** Absolute HTTPS base for per-collection files (no trailing slash). */\n rawBaseUrl: string;\n}\n\n/** Reserved name for the official registry. The client always synthesizes one\n * entry under this name; user config that re-uses it is rejected. */\nexport const OFFICIAL_REGISTRY_NAME = \"official\";\n\n/** Per-registry summary in the merged Discover response. */\nexport interface RegistrySummary {\n name: string;\n /** `ok` = fresh, `stale` = served from cache because the upstream failed,\n * `failed` = no cache to fall back to (the entries contribution is 0). */\n status: \"ok\" | \"stale\" | \"failed\";\n generatedAt: string | null;\n error: string | null;\n entryCount: number;\n}\n\n/** `GET …collectionsRegistry.list` — the Discover catalog merged across every\n * configured registry. */\nexport interface RegistryListResponse {\n registries: RegistrySummary[];\n /** Convenience flag: true iff any single registry's contribution was stale. */\n stale: boolean;\n collections: RegistryEntry[];\n}\n\n/** `POST …collectionsRegistry.import` — install result. */\nexport interface RegistryImportResponse {\n localSlug: string;\n updated: boolean;\n seedWritten: number;\n seedSkipped: boolean;\n}\n"],"mappings":";;AACA,SAAgB,SAAS,OAAkD;CACzE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;;;AC+CA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AAO,OAAO;CAAqC;CAC/F,IAAI,CAAC,MAAM,QAAQ,MAAM,WAAW,GAAG,OAAO;EAAE,IAAI;EAAO,OAAO;CAAqC;CAEvG,MAAM,SAAS,MAAM,YAAY,KAAK,OAAO,QAAQ,WAAW,OAAO,KAAK,YAAY,CAAC;CACzF,MAAM,aAAa,OAAO,MAAM,UAA2B,OAAO,UAAU,QAAQ;CACpF,IAAI,eAAe,KAAA,GAAW,OAAO;EAAE,IAAI;EAAO,OAAO;CAAW;CAEpE,OAAO;EAAE,IAAI;EAAM,OAAO;GAAE,eAAe;GAA0B;GAAU;GAAa,aADxE,OAAO,QAAQ,UAAkC,OAAO,UAAU,QACM;EAAY;CAAE;AAC5G;;;;;AC3IA,IAAa,yBAAyB"}
1
+ {"version":3,"file":"types-BLCZTGW2.js","names":[],"sources":["../src/collection/registry/guards.ts","../src/collection/registry/registryIndex.ts","../src/collection/registry/types.ts"],"sourcesContent":["/** Narrow `unknown` to a plain object (not null, not array). */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","// Parse + validate the curated collection registry's published index.json.\n// Pure — no I/O. The caller fetches the JSON and hands the parsed value here.\n// Mirrors the registry repo's schema/index.schema.json contract (schemaVersion 1):\n// receptron/mulmoclaude-collections.\n//\n// The index is host-fetched convenience data for the Discover catalog, not a\n// trust boundary: a collection's actual files are re-validated on import.\n\nimport { isRecord } from \"./guards.js\";\n\nexport interface RegistryEntry {\n /** `<author>/<slug>` — identity inside its source registry. NOT globally\n * unique when multiple registries are configured — pair with `registryName`\n * for a global key. */\n id: string;\n author: string;\n slug: string;\n title: string;\n icon: string;\n description: string;\n version: string;\n tags: string[];\n license: string;\n fieldCount: number;\n /** Custom view labels. */\n views: string[];\n hasSeed: boolean;\n seedCount: number;\n /** repo-relative path, omitted when absent. */\n screenshot?: string | undefined;\n /** repo-relative collection dir. */\n path: string;\n /** Stable bundle hash for update detection. */\n contentSha: string;\n /** Label of the source registry. Set by the client (not by the parser) when\n * the index is fetched, so the import / preview path can resolve the right\n * rawBase. `\"official\"` for receptron/mulmoclaude-collections; otherwise\n * the user's config entry name. */\n registryName: string;\n}\n\nexport interface RegistryIndex {\n schemaVersion: number;\n generatedAt: string;\n registry: string;\n collections: RegistryEntry[];\n}\n\nexport type ParseResult = { ok: true; index: RegistryIndex } | { ok: false; error: string };\n\nconst SUPPORTED_SCHEMA_VERSION = 1;\n\nconst pickString = (rec: Record<string, unknown>, key: string): string | undefined => {\n const value = rec[key];\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n};\n\n// Count fields (fieldCount/seedCount) must be non-negative integers. A present\n// but negative/fractional value is rejected rather than served to the UI; an\n// absent value defaults to 0.\nfunction validatedCount(rec: Record<string, unknown>, key: string): number | \"invalid\" {\n const value = rec[key];\n if (value === undefined) return 0;\n return typeof value === \"number\" && Number.isInteger(value) && value >= 0 ? value : \"invalid\";\n}\n\nconst pickBoolean = (rec: Record<string, unknown>, key: string): boolean | undefined => {\n const value = rec[key];\n return typeof value === \"boolean\" ? value : undefined;\n};\n\nconst asStringArray = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === \"string\") : []);\n\n// Identifier allowlists (mirror the registry's meta.schema.json). Crucially these\n// exclude `.`, `/`, `\\`, and `..`, so a poisoned author/slug can never make\n// collectionFileUrl() escape the collections/<author>/<slug> subtree — even if the\n// entry is internally consistent. Bounded quantifiers (no ReDoS).\nconst AUTHOR_RE = /^[A-Za-z0-9][A-Za-z0-9-]{0,38}$/;\nconst SLUG_RE = /^[a-z0-9][a-z0-9-]{0,62}$/;\n\n// author/slug must be allowlisted identifiers, and id/path must agree with them, so a\n// lookup by author+slug can never fetch files from a different (or out-of-tree)\n// directory than requested (defense against a poisoned index).\nfunction identityError(entryId: string, author: string, slug: string, dirPath: string, index: number): string | null {\n if (!AUTHOR_RE.test(author)) return `collections[${index}].author has an invalid format`;\n if (!SLUG_RE.test(slug)) return `collections[${index}].slug has an invalid format`;\n if (entryId !== `${author}/${slug}`) return `collections[${index}].id must equal \"${author}/${slug}\"`;\n if (dirPath !== `collections/${author}/${slug}`) return `collections[${index}].path must equal \"collections/${author}/${slug}\"`;\n return null;\n}\n\nfunction validatedCounts(value: Record<string, unknown>, index: number): { fieldCount: number; seedCount: number } | string {\n const fieldCount = validatedCount(value, \"fieldCount\");\n const seedCount = validatedCount(value, \"seedCount\");\n if (fieldCount === \"invalid\") return `collections[${index}].fieldCount must be a non-negative integer`;\n if (seedCount === \"invalid\") return `collections[${index}].seedCount must be a non-negative integer`;\n return { fieldCount, seedCount };\n}\n\nfunction parseEntry(value: unknown, index: number, registryName: string): RegistryEntry | string {\n if (!isRecord(value)) return `collections[${index}] is not an object`;\n const entryId = pickString(value, \"id\");\n const author = pickString(value, \"author\");\n const slug = pickString(value, \"slug\");\n const title = pickString(value, \"title\");\n const version = pickString(value, \"version\");\n const path = pickString(value, \"path\");\n const contentSha = pickString(value, \"contentSha\");\n if (!entryId || !author || !slug || !title || !version || !path || !contentSha) {\n return `collections[${index}] is missing a required string field (id/author/slug/title/version/path/contentSha)`;\n }\n const mismatch = identityError(entryId, author, slug, path, index);\n if (mismatch) return mismatch;\n const counts = validatedCounts(value, index);\n if (typeof counts === \"string\") return counts;\n return {\n id: entryId,\n author,\n slug,\n title,\n version,\n path,\n contentSha,\n icon: pickString(value, \"icon\") ?? \"\",\n description: pickString(value, \"description\") ?? \"\",\n license: pickString(value, \"license\") ?? \"\",\n tags: asStringArray(value.tags),\n views: asStringArray(value.views),\n fieldCount: counts.fieldCount,\n seedCount: counts.seedCount,\n hasSeed: pickBoolean(value, \"hasSeed\") ?? false,\n screenshot: pickString(value, \"screenshot\"),\n registryName,\n };\n}\n\n/** Parse an index payload. `registryName` labels every entry produced — the\n * caller passes \"official\" for the canonical registry or the user's config\n * entry name. The label is needed downstream so import / preview can pick the\n * right rawBase for per-collection files. */\nexport function parseRegistryIndex(value: unknown, registryName: string): ParseResult {\n if (!isRecord(value)) return { ok: false, error: \"index is not an object\" };\n if (value.schemaVersion !== SUPPORTED_SCHEMA_VERSION) {\n return { ok: false, error: `unsupported schemaVersion (expected ${SUPPORTED_SCHEMA_VERSION})` };\n }\n const registry = pickString(value, \"registry\");\n const generatedAt = pickString(value, \"generatedAt\");\n if (!registry || !generatedAt) return { ok: false, error: \"index missing registry/generatedAt\" };\n if (!Array.isArray(value.collections)) return { ok: false, error: \"index.collections must be an array\" };\n\n const parsed = value.collections.map((entry, idx) => parseEntry(entry, idx, registryName));\n const firstError = parsed.find((entry): entry is string => typeof entry === \"string\");\n if (firstError !== undefined) return { ok: false, error: firstError };\n const collections = parsed.filter((entry): entry is RegistryEntry => typeof entry !== \"string\");\n return { ok: true, index: { schemaVersion: SUPPORTED_SCHEMA_VERSION, registry, generatedAt, collections } };\n}\n","// Isomorphic contract shared by the registry engine, the host routes, and the\n// collection plugin's Discover UI. No I/O — types + a reserved-name constant.\n\nimport type { RegistryEntry } from \"./registryIndex.js\";\n\nexport interface RegistryConfigEntry {\n /** Short label shown on Discover cards + used as the routing key. */\n name: string;\n /** Absolute HTTPS URL of the registry's index.json. */\n indexUrl: string;\n /** Absolute HTTPS base for per-collection files (no trailing slash). */\n rawBaseUrl: string;\n}\n\n/** Reserved name for the official registry. The client always synthesizes one\n * entry under this name; user config that re-uses it is rejected. */\nexport const OFFICIAL_REGISTRY_NAME = \"official\";\n\n/** Per-registry summary in the merged Discover response. */\nexport interface RegistrySummary {\n name: string;\n /** `ok` = fresh, `stale` = served from cache because the upstream failed,\n * `failed` = no cache to fall back to (the entries contribution is 0). */\n status: \"ok\" | \"stale\" | \"failed\";\n generatedAt: string | null;\n error: string | null;\n entryCount: number;\n}\n\n/** `GET …collectionsRegistry.list` — the Discover catalog merged across every\n * configured registry. */\nexport interface RegistryListResponse {\n registries: RegistrySummary[];\n /** Convenience flag: true iff any single registry's contribution was stale. */\n stale: boolean;\n collections: RegistryEntry[];\n}\n\n/** `POST …collectionsRegistry.import` — install result. */\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,0BAC1B,OAAO;EAAE,IAAI;EAAO,OAAO,uCAAuC,yBAAyB;CAAG;CAEhG,MAAM,WAAW,WAAW,OAAO,UAAU;CAC7C,MAAM,cAAc,WAAW,OAAO,aAAa;CACnD,IAAI,CAAC,YAAY,CAAC,aAAa,OAAO;EAAE,IAAI;EAAO,OAAO;CAAqC;CAC/F,IAAI,CAAC,MAAM,QAAQ,MAAM,WAAW,GAAG,OAAO;EAAE,IAAI;EAAO,OAAO;CAAqC;CAEvG,MAAM,SAAS,MAAM,YAAY,KAAK,OAAO,QAAQ,WAAW,OAAO,KAAK,YAAY,CAAC;CACzF,MAAM,aAAa,OAAO,MAAM,UAA2B,OAAO,UAAU,QAAQ;CACpF,IAAI,eAAe,KAAA,GAAW,OAAO;EAAE,IAAI;EAAO,OAAO;CAAW;CAEpE,OAAO;EAAE,IAAI;EAAM,OAAO;GAAE,eAAe;GAA0B;GAAU;GAAa,aADxE,OAAO,QAAQ,UAAkC,OAAO,UAAU,QACM;EAAY;CAAE;AAC5G;;;;AC3IA,IAAa,yBAAyB"}
@@ -1,10 +1,9 @@
1
- //#region src/collection/registry/guards.ts
1
+ // src/collection/registry/guards.ts
2
2
  /** Narrow `unknown` to a plain object (not null, not array). */
3
3
  function isRecord(value) {
4
4
  return typeof value === "object" && value !== null && !Array.isArray(value);
5
5
  }
6
- //#endregion
7
- //#region src/collection/registry/registryIndex.ts
6
+ // src/collection/registry/registryIndex.ts
8
7
  var SUPPORTED_SCHEMA_VERSION = 1;
9
8
  var pickString = (rec, key) => {
10
9
  const value = rec[key];
@@ -112,12 +111,10 @@ function parseRegistryIndex(value, registryName) {
112
111
  }
113
112
  };
114
113
  }
115
- //#endregion
116
- //#region src/collection/registry/types.ts
114
+ // src/collection/registry/types.ts
117
115
  /** Reserved name for the official registry. The client always synthesizes one
118
116
  * entry under this name; user config that re-uses it is rejected. */
119
117
  var OFFICIAL_REGISTRY_NAME = "official";
120
- //#endregion
121
118
  Object.defineProperty(exports, "OFFICIAL_REGISTRY_NAME", {
122
119
  enumerable: true,
123
120
  get: function() {
@@ -137,4 +134,4 @@ Object.defineProperty(exports, "parseRegistryIndex", {
137
134
  }
138
135
  });
139
136
 
140
- //# sourceMappingURL=types-CNqkLT4M.cjs.map
137
+ //# sourceMappingURL=types-DPycxnDf.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-CNqkLT4M.cjs","names":[],"sources":["../src/collection/registry/guards.ts","../src/collection/registry/registryIndex.ts","../src/collection/registry/types.ts"],"sourcesContent":["/** Narrow `unknown` to a plain object (not null, not array). */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","// Parse + validate the curated collection registry's published index.json.\n// Pure — no I/O. The caller fetches the JSON and hands the parsed value here.\n// Mirrors the registry repo's schema/index.schema.json contract (schemaVersion 1):\n// receptron/mulmoclaude-collections.\n//\n// The index is host-fetched convenience data for the Discover catalog, not a\n// trust boundary: a collection's actual files are re-validated on import.\n\nimport { isRecord } from \"./guards.js\";\n\nexport interface RegistryEntry {\n /** `<author>/<slug>` — identity inside its source registry. NOT globally\n * unique when multiple registries are configured — pair with `registryName`\n * for a global key. */\n id: string;\n author: string;\n slug: string;\n title: string;\n icon: string;\n description: string;\n version: string;\n tags: string[];\n license: string;\n fieldCount: number;\n /** Custom view labels. */\n views: string[];\n hasSeed: boolean;\n seedCount: number;\n /** repo-relative path, omitted when absent. */\n screenshot?: string | undefined;\n /** repo-relative collection dir. */\n path: string;\n /** Stable bundle hash for update detection. */\n contentSha: string;\n /** Label of the source registry. Set by the client (not by the parser) when\n * the index is fetched, so the import / preview path can resolve the right\n * rawBase. `\"official\"` for receptron/mulmoclaude-collections; otherwise\n * the user's config entry name. */\n registryName: string;\n}\n\nexport interface RegistryIndex {\n schemaVersion: number;\n generatedAt: string;\n registry: string;\n collections: RegistryEntry[];\n}\n\nexport type ParseResult = { ok: true; index: RegistryIndex } | { ok: false; error: string };\n\nconst SUPPORTED_SCHEMA_VERSION = 1;\n\nconst pickString = (rec: Record<string, unknown>, key: string): string | undefined => {\n const value = rec[key];\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n};\n\n// Count fields (fieldCount/seedCount) must be non-negative integers. A present\n// but negative/fractional value is rejected rather than served to the UI; an\n// absent value defaults to 0.\nfunction validatedCount(rec: Record<string, unknown>, key: string): number | \"invalid\" {\n const value = rec[key];\n if (value === undefined) return 0;\n return typeof value === \"number\" && Number.isInteger(value) && value >= 0 ? value : \"invalid\";\n}\n\nconst pickBoolean = (rec: Record<string, unknown>, key: string): boolean | undefined => {\n const value = rec[key];\n return typeof value === \"boolean\" ? value : undefined;\n};\n\nconst asStringArray = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === \"string\") : []);\n\n// Identifier allowlists (mirror the registry's meta.schema.json). Crucially these\n// exclude `.`, `/`, `\\`, and `..`, so a poisoned author/slug can never make\n// collectionFileUrl() escape the collections/<author>/<slug> subtree — even if the\n// entry is internally consistent. Bounded quantifiers (no ReDoS).\nconst AUTHOR_RE = /^[A-Za-z0-9][A-Za-z0-9-]{0,38}$/;\nconst SLUG_RE = /^[a-z0-9][a-z0-9-]{0,62}$/;\n\n// author/slug must be allowlisted identifiers, and id/path must agree with them, so a\n// lookup by author+slug can never fetch files from a different (or out-of-tree)\n// directory than requested (defense against a poisoned index).\nfunction identityError(entryId: string, author: string, slug: string, dirPath: string, index: number): string | null {\n if (!AUTHOR_RE.test(author)) return `collections[${index}].author has an invalid format`;\n if (!SLUG_RE.test(slug)) return `collections[${index}].slug has an invalid format`;\n if (entryId !== `${author}/${slug}`) return `collections[${index}].id must equal \"${author}/${slug}\"`;\n if (dirPath !== `collections/${author}/${slug}`) return `collections[${index}].path must equal \"collections/${author}/${slug}\"`;\n return null;\n}\n\nfunction validatedCounts(value: Record<string, unknown>, index: number): { fieldCount: number; seedCount: number } | string {\n const fieldCount = validatedCount(value, \"fieldCount\");\n const seedCount = validatedCount(value, \"seedCount\");\n if (fieldCount === \"invalid\") return `collections[${index}].fieldCount must be a non-negative integer`;\n if (seedCount === \"invalid\") return `collections[${index}].seedCount must be a non-negative integer`;\n return { fieldCount, seedCount };\n}\n\nfunction parseEntry(value: unknown, index: number, registryName: string): RegistryEntry | string {\n if (!isRecord(value)) return `collections[${index}] is not an object`;\n const entryId = pickString(value, \"id\");\n const author = pickString(value, \"author\");\n const slug = pickString(value, \"slug\");\n const title = pickString(value, \"title\");\n const version = pickString(value, \"version\");\n const path = pickString(value, \"path\");\n const contentSha = pickString(value, \"contentSha\");\n if (!entryId || !author || !slug || !title || !version || !path || !contentSha) {\n return `collections[${index}] is missing a required string field (id/author/slug/title/version/path/contentSha)`;\n }\n const mismatch = identityError(entryId, author, slug, path, index);\n if (mismatch) return mismatch;\n const counts = validatedCounts(value, index);\n if (typeof counts === \"string\") return counts;\n return {\n id: entryId,\n author,\n slug,\n title,\n version,\n path,\n contentSha,\n icon: pickString(value, \"icon\") ?? \"\",\n description: pickString(value, \"description\") ?? \"\",\n license: pickString(value, \"license\") ?? \"\",\n tags: asStringArray(value.tags),\n views: asStringArray(value.views),\n fieldCount: counts.fieldCount,\n seedCount: counts.seedCount,\n hasSeed: pickBoolean(value, \"hasSeed\") ?? false,\n screenshot: pickString(value, \"screenshot\"),\n registryName,\n };\n}\n\n/** Parse an index payload. `registryName` labels every entry produced — the\n * caller passes \"official\" for the canonical registry or the user's config\n * entry name. The label is needed downstream so import / preview can pick the\n * right rawBase for per-collection files. */\nexport function parseRegistryIndex(value: unknown, registryName: string): ParseResult {\n if (!isRecord(value)) return { ok: false, error: \"index is not an object\" };\n if (value.schemaVersion !== SUPPORTED_SCHEMA_VERSION) {\n return { ok: false, error: `unsupported schemaVersion (expected ${SUPPORTED_SCHEMA_VERSION})` };\n }\n const registry = pickString(value, \"registry\");\n const generatedAt = pickString(value, \"generatedAt\");\n if (!registry || !generatedAt) return { ok: false, error: \"index missing registry/generatedAt\" };\n if (!Array.isArray(value.collections)) return { ok: false, error: \"index.collections must be an array\" };\n\n const parsed = value.collections.map((entry, idx) => parseEntry(entry, idx, registryName));\n const firstError = parsed.find((entry): entry is string => typeof entry === \"string\");\n if (firstError !== undefined) return { ok: false, error: firstError };\n const collections = parsed.filter((entry): entry is RegistryEntry => typeof entry !== \"string\");\n return { ok: true, index: { schemaVersion: SUPPORTED_SCHEMA_VERSION, registry, generatedAt, collections } };\n}\n","// Isomorphic contract shared by the registry engine, the host routes, and the\n// collection plugin's Discover UI. No I/O — types + a reserved-name constant.\n\nimport type { RegistryEntry } from \"./registryIndex.js\";\n\nexport interface RegistryConfigEntry {\n /** Short label shown on Discover cards + used as the routing key. */\n name: string;\n /** Absolute HTTPS URL of the registry's index.json. */\n indexUrl: string;\n /** Absolute HTTPS base for per-collection files (no trailing slash). */\n rawBaseUrl: string;\n}\n\n/** Reserved name for the official registry. The client always synthesizes one\n * entry under this name; user config that re-uses it is rejected. */\nexport const OFFICIAL_REGISTRY_NAME = \"official\";\n\n/** Per-registry summary in the merged Discover response. */\nexport interface RegistrySummary {\n name: string;\n /** `ok` = fresh, `stale` = served from cache because the upstream failed,\n * `failed` = no cache to fall back to (the entries contribution is 0). */\n status: \"ok\" | \"stale\" | \"failed\";\n generatedAt: string | null;\n error: string | null;\n entryCount: number;\n}\n\n/** `GET …collectionsRegistry.list` — the Discover catalog merged across every\n * configured registry. */\nexport interface RegistryListResponse {\n registries: RegistrySummary[];\n /** Convenience flag: true iff any single registry's contribution was stale. */\n stale: boolean;\n collections: RegistryEntry[];\n}\n\n/** `POST …collectionsRegistry.import` — install result. */\nexport interface RegistryImportResponse {\n localSlug: string;\n updated: boolean;\n seedWritten: number;\n seedSkipped: boolean;\n}\n"],"mappings":";;AACA,SAAgB,SAAS,OAAkD;CACzE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;;;AC+CA,IAAM,2BAA2B;AAEjC,IAAM,cAAc,KAA8B,QAAoC;CACpF,MAAM,QAAQ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G,OAAO;EAAE,IAAI;EAAO,OAAO;CAAqC;CAEvG,MAAM,SAAS,MAAM,YAAY,KAAK,OAAO,QAAQ,WAAW,OAAO,KAAK,YAAY,CAAC;CACzF,MAAM,aAAa,OAAO,MAAM,UAA2B,OAAO,UAAU,QAAQ;CACpF,IAAI,eAAe,KAAA,GAAW,OAAO;EAAE,IAAI;EAAO,OAAO;CAAW;CAEpE,OAAO;EAAE,IAAI;EAAM,OAAO;GAAE,eAAe;GAA0B;GAAU;GAAa,aADxE,OAAO,QAAQ,UAAkC,OAAO,UAAU,QACM;EAAY;CAAE;AAC5G;;;;;AC3IA,IAAa,yBAAyB"}
1
+ {"version":3,"file":"types-DPycxnDf.cjs","names":[],"sources":["../src/collection/registry/guards.ts","../src/collection/registry/registryIndex.ts","../src/collection/registry/types.ts"],"sourcesContent":["/** Narrow `unknown` to a plain object (not null, not array). */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","// Parse + validate the curated collection registry's published index.json.\n// Pure — no I/O. The caller fetches the JSON and hands the parsed value here.\n// Mirrors the registry repo's schema/index.schema.json contract (schemaVersion 1):\n// receptron/mulmoclaude-collections.\n//\n// The index is host-fetched convenience data for the Discover catalog, not a\n// trust boundary: a collection's actual files are re-validated on import.\n\nimport { isRecord } from \"./guards.js\";\n\nexport interface RegistryEntry {\n /** `<author>/<slug>` — identity inside its source registry. NOT globally\n * unique when multiple registries are configured — pair with `registryName`\n * for a global key. */\n id: string;\n author: string;\n slug: string;\n title: string;\n icon: string;\n description: string;\n version: string;\n tags: string[];\n license: string;\n fieldCount: number;\n /** Custom view labels. */\n views: string[];\n hasSeed: boolean;\n seedCount: number;\n /** repo-relative path, omitted when absent. */\n screenshot?: string | undefined;\n /** repo-relative collection dir. */\n path: string;\n /** Stable bundle hash for update detection. */\n contentSha: string;\n /** Label of the source registry. Set by the client (not by the parser) when\n * the index is fetched, so the import / preview path can resolve the right\n * rawBase. `\"official\"` for receptron/mulmoclaude-collections; otherwise\n * the user's config entry name. */\n registryName: string;\n}\n\nexport interface RegistryIndex {\n schemaVersion: number;\n generatedAt: string;\n registry: string;\n collections: RegistryEntry[];\n}\n\nexport type ParseResult = { ok: true; index: RegistryIndex } | { ok: false; error: string };\n\nconst SUPPORTED_SCHEMA_VERSION = 1;\n\nconst pickString = (rec: Record<string, unknown>, key: string): string | undefined => {\n const value = rec[key];\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n};\n\n// Count fields (fieldCount/seedCount) must be non-negative integers. A present\n// but negative/fractional value is rejected rather than served to the UI; an\n// absent value defaults to 0.\nfunction validatedCount(rec: Record<string, unknown>, key: string): number | \"invalid\" {\n const value = rec[key];\n if (value === undefined) return 0;\n return typeof value === \"number\" && Number.isInteger(value) && value >= 0 ? value : \"invalid\";\n}\n\nconst pickBoolean = (rec: Record<string, unknown>, key: string): boolean | undefined => {\n const value = rec[key];\n return typeof value === \"boolean\" ? value : undefined;\n};\n\nconst asStringArray = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === \"string\") : []);\n\n// Identifier allowlists (mirror the registry's meta.schema.json). Crucially these\n// exclude `.`, `/`, `\\`, and `..`, so a poisoned author/slug can never make\n// collectionFileUrl() escape the collections/<author>/<slug> subtree — even if the\n// entry is internally consistent. Bounded quantifiers (no ReDoS).\nconst AUTHOR_RE = /^[A-Za-z0-9][A-Za-z0-9-]{0,38}$/;\nconst SLUG_RE = /^[a-z0-9][a-z0-9-]{0,62}$/;\n\n// author/slug must be allowlisted identifiers, and id/path must agree with them, so a\n// lookup by author+slug can never fetch files from a different (or out-of-tree)\n// directory than requested (defense against a poisoned index).\nfunction identityError(entryId: string, author: string, slug: string, dirPath: string, index: number): string | null {\n if (!AUTHOR_RE.test(author)) return `collections[${index}].author has an invalid format`;\n if (!SLUG_RE.test(slug)) return `collections[${index}].slug has an invalid format`;\n if (entryId !== `${author}/${slug}`) return `collections[${index}].id must equal \"${author}/${slug}\"`;\n if (dirPath !== `collections/${author}/${slug}`) return `collections[${index}].path must equal \"collections/${author}/${slug}\"`;\n return null;\n}\n\nfunction validatedCounts(value: Record<string, unknown>, index: number): { fieldCount: number; seedCount: number } | string {\n const fieldCount = validatedCount(value, \"fieldCount\");\n const seedCount = validatedCount(value, \"seedCount\");\n if (fieldCount === \"invalid\") return `collections[${index}].fieldCount must be a non-negative integer`;\n if (seedCount === \"invalid\") return `collections[${index}].seedCount must be a non-negative integer`;\n return { fieldCount, seedCount };\n}\n\nfunction parseEntry(value: unknown, index: number, registryName: string): RegistryEntry | string {\n if (!isRecord(value)) return `collections[${index}] is not an object`;\n const entryId = pickString(value, \"id\");\n const author = pickString(value, \"author\");\n const slug = pickString(value, \"slug\");\n const title = pickString(value, \"title\");\n const version = pickString(value, \"version\");\n const path = pickString(value, \"path\");\n const contentSha = pickString(value, \"contentSha\");\n if (!entryId || !author || !slug || !title || !version || !path || !contentSha) {\n return `collections[${index}] is missing a required string field (id/author/slug/title/version/path/contentSha)`;\n }\n const mismatch = identityError(entryId, author, slug, path, index);\n if (mismatch) return mismatch;\n const counts = validatedCounts(value, index);\n if (typeof counts === \"string\") return counts;\n return {\n id: entryId,\n author,\n slug,\n title,\n version,\n path,\n contentSha,\n icon: pickString(value, \"icon\") ?? \"\",\n description: pickString(value, \"description\") ?? \"\",\n license: pickString(value, \"license\") ?? \"\",\n tags: asStringArray(value.tags),\n views: asStringArray(value.views),\n fieldCount: counts.fieldCount,\n seedCount: counts.seedCount,\n hasSeed: pickBoolean(value, \"hasSeed\") ?? false,\n screenshot: pickString(value, \"screenshot\"),\n registryName,\n };\n}\n\n/** Parse an index payload. `registryName` labels every entry produced — the\n * caller passes \"official\" for the canonical registry or the user's config\n * entry name. The label is needed downstream so import / preview can pick the\n * right rawBase for per-collection files. */\nexport function parseRegistryIndex(value: unknown, registryName: string): ParseResult {\n if (!isRecord(value)) return { ok: false, error: \"index is not an object\" };\n if (value.schemaVersion !== SUPPORTED_SCHEMA_VERSION) {\n return { ok: false, error: `unsupported schemaVersion (expected ${SUPPORTED_SCHEMA_VERSION})` };\n }\n const registry = pickString(value, \"registry\");\n const generatedAt = pickString(value, \"generatedAt\");\n if (!registry || !generatedAt) return { ok: false, error: \"index missing registry/generatedAt\" };\n if (!Array.isArray(value.collections)) return { ok: false, error: \"index.collections must be an array\" };\n\n const parsed = value.collections.map((entry, idx) => parseEntry(entry, idx, registryName));\n const firstError = parsed.find((entry): entry is string => typeof entry === \"string\");\n if (firstError !== undefined) return { ok: false, error: firstError };\n const collections = parsed.filter((entry): entry is RegistryEntry => typeof entry !== \"string\");\n return { ok: true, index: { schemaVersion: SUPPORTED_SCHEMA_VERSION, registry, generatedAt, collections } };\n}\n","// Isomorphic contract shared by the registry engine, the host routes, and the\n// collection plugin's Discover UI. No I/O — types + a reserved-name constant.\n\nimport type { RegistryEntry } from \"./registryIndex.js\";\n\nexport interface RegistryConfigEntry {\n /** Short label shown on Discover cards + used as the routing key. */\n name: string;\n /** Absolute HTTPS URL of the registry's index.json. */\n indexUrl: string;\n /** Absolute HTTPS base for per-collection files (no trailing slash). */\n rawBaseUrl: string;\n}\n\n/** Reserved name for the official registry. The client always synthesizes one\n * entry under this name; user config that re-uses it is rejected. */\nexport const OFFICIAL_REGISTRY_NAME = \"official\";\n\n/** Per-registry summary in the merged Discover response. */\nexport interface RegistrySummary {\n name: string;\n /** `ok` = fresh, `stale` = served from cache because the upstream failed,\n * `failed` = no cache to fall back to (the entries contribution is 0). */\n status: \"ok\" | \"stale\" | \"failed\";\n generatedAt: string | null;\n error: string | null;\n entryCount: number;\n}\n\n/** `GET …collectionsRegistry.list` — the Discover catalog merged across every\n * configured registry. */\nexport interface RegistryListResponse {\n registries: RegistrySummary[];\n /** Convenience flag: true iff any single registry's contribution was stale. */\n stale: boolean;\n collections: RegistryEntry[];\n}\n\n/** `POST …collectionsRegistry.import` — install result. */\nexport interface RegistryImportResponse {\n localSlug: string;\n updated: boolean;\n seedWritten: number;\n seedSkipped: bool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EhG,MAAM,WAAW,WAAW,OAAO,UAAU;CAC7C,MAAM,cAAc,WAAW,OAAO,aAAa;CACnD,IAAI,CAAC,YAAY,CAAC,aAAa,OAAO;EAAE,IAAI;EAAO,OAAO;CAAqC;CAC/F,IAAI,CAAC,MAAM,QAAQ,MAAM,WAAW,GAAG,OAAO;EAAE,IAAI;EAAO,OAAO;CAAqC;CAEvG,MAAM,SAAS,MAAM,YAAY,KAAK,OAAO,QAAQ,WAAW,OAAO,KAAK,YAAY,CAAC;CACzF,MAAM,aAAa,OAAO,MAAM,UAA2B,OAAO,UAAU,QAAQ;CACpF,IAAI,eAAe,KAAA,GAAW,OAAO;EAAE,IAAI;EAAO,OAAO;CAAW;CAEpE,OAAO;EAAE,IAAI;EAAM,OAAO;GAAE,eAAe;GAA0B;GAAU;GAAa,aADxE,OAAO,QAAQ,UAAkC,OAAO,UAAU,QACM;EAAY;CAAE;AAC5G;;;;AC3IA,IAAa,yBAAyB"}
@@ -29,7 +29,6 @@ function bridgeExternalSignal(external, controller) {
29
29
  external.addEventListener("abort", onAbort, { once: true });
30
30
  return () => external.removeEventListener("abort", onAbort);
31
31
  }
32
- //#endregion
33
32
  exports.DEFAULT_FETCH_TIMEOUT_MS = DEFAULT_FETCH_TIMEOUT_MS;
34
33
  exports.fetchWithTimeout = fetchWithTimeout;
35
34
 
@@ -28,7 +28,6 @@ function bridgeExternalSignal(external, controller) {
28
28
  external.addEventListener("abort", onAbort, { once: true });
29
29
  return () => external.removeEventListener("abort", onAbort);
30
30
  }
31
- //#endregion
32
31
  export { DEFAULT_FETCH_TIMEOUT_MS, fetchWithTimeout };
33
32
 
34
33
  //# sourceMappingURL=fetch.js.map
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("../dist-BZ62pKuU.cjs");
3
- const require_errors = require("../errors-B0xloJ3E.cjs");
4
- const require_text = require("../text-CaAh9ZSO.cjs");
2
+ const require_dist = require("../dist-734JaRYi.cjs");
3
+ const require_errors = require("../errors-B9mCEVG9.cjs");
4
+ const require_text = require("../text-BQiyo5R9.cjs");
5
5
  exports.errorMessage = require_dist.errorMessage;
6
6
  exports.toError = require_errors.toError;
7
7
  exports.truncate = require_text.truncate;
@@ -1,4 +1,4 @@
1
- import { t as errorMessage } from "../dist-MFUV9FYo.js";
2
- import { t as toError } from "../errors-zTAsW7dS.js";
3
- import { t as truncate } from "../text-CjDbP2O1.js";
1
+ import { t as errorMessage } from "../dist-BmO4oSQy.js";
2
+ import { t as toError } from "../errors-0QwjDxsv.js";
3
+ import { t as truncate } from "../text-BQAuwKVj.js";
4
4
  export { errorMessage, toError, truncate };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/whisper/client-helpers.ts
2
+ // src/whisper/client-helpers.ts
3
3
  function computeRms(buffer) {
4
4
  let sum = 0;
5
5
  for (const sample of buffer) sum += sample * sample;
@@ -35,8 +35,7 @@ function evaluateVad(state, segmentStartMs, rms, nowMs, config) {
35
35
  cut: silenceExceeded(state, rms, nowMs, config) || maxCut
36
36
  };
37
37
  }
38
- //#endregion
39
- //#region src/whisper/client.ts
38
+ // src/whisper/client.ts
40
39
  var LOCALE_TO_WHISPER = {
41
40
  en: "en",
42
41
  ja: "ja",
@@ -354,7 +353,6 @@ function createVoiceCapture(transport, language, callbacks) {
354
353
  dispose
355
354
  };
356
355
  }
357
- //#endregion
358
356
  exports.createAvailabilityPoller = createAvailabilityPoller;
359
357
  exports.createCaptureState = createCaptureState;
360
358
  exports.createSegmentQueue = createSegmentQueue;