@inharness-ai/claude4spec 1.0.21 → 1.0.23

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 (241) hide show
  1. package/.claude/skills/c4s-brief-implementer/SKILL.md +120 -53
  2. package/CHANGELOG.md +20 -0
  3. package/dist/bin/c4s/commands/agent.d.ts +18 -0
  4. package/dist/bin/c4s/commands/agent.js +102 -0
  5. package/dist/bin/c4s/commands/agent.js.map +1 -0
  6. package/dist/bin/c4s/commands/ask.d.ts +9 -8
  7. package/dist/bin/c4s/commands/ask.js +23 -31
  8. package/dist/bin/c4s/commands/ask.js.map +1 -1
  9. package/dist/bin/c4s/commands/catalog.d.ts +1 -1
  10. package/dist/bin/c4s/commands/catalog.js +2 -2
  11. package/dist/bin/c4s/commands/catalog.js.map +1 -1
  12. package/dist/bin/c4s/commands/describe.d.ts +1 -1
  13. package/dist/bin/c4s/commands/describe.js +2 -2
  14. package/dist/bin/c4s/commands/describe.js.map +1 -1
  15. package/dist/bin/c4s/commands/detail.d.ts +1 -1
  16. package/dist/bin/c4s/commands/detail.js +2 -2
  17. package/dist/bin/c4s/commands/detail.js.map +1 -1
  18. package/dist/bin/c4s/commands/element-list.d.ts +1 -1
  19. package/dist/bin/c4s/commands/element-list.js +2 -2
  20. package/dist/bin/c4s/commands/element-list.js.map +1 -1
  21. package/dist/bin/c4s/commands/find-references.js +1 -1
  22. package/dist/bin/c4s/commands/find-references.js.map +1 -1
  23. package/dist/bin/c4s/commands/inline-mention.d.ts +1 -1
  24. package/dist/bin/c4s/commands/inline-mention.js +2 -2
  25. package/dist/bin/c4s/commands/inline-mention.js.map +1 -1
  26. package/dist/bin/c4s/commands/list-slugs.d.ts +1 -1
  27. package/dist/bin/c4s/commands/list-slugs.js +2 -2
  28. package/dist/bin/c4s/commands/list-slugs.js.map +1 -1
  29. package/dist/bin/c4s/commands/list-tags.d.ts +1 -1
  30. package/dist/bin/c4s/commands/list-tags.js +2 -2
  31. package/dist/bin/c4s/commands/list-tags.js.map +1 -1
  32. package/dist/bin/c4s/commands/plugins.d.ts +9 -0
  33. package/dist/bin/c4s/commands/plugins.js +81 -0
  34. package/dist/bin/c4s/commands/plugins.js.map +1 -0
  35. package/dist/bin/c4s/commands/resolve.d.ts +1 -1
  36. package/dist/bin/c4s/commands/resolve.js +2 -2
  37. package/dist/bin/c4s/commands/resolve.js.map +1 -1
  38. package/dist/bin/c4s/commands/single-element.d.ts +1 -1
  39. package/dist/bin/c4s/commands/single-element.js +2 -2
  40. package/dist/bin/c4s/commands/single-element.js.map +1 -1
  41. package/dist/bin/c4s/commands/tagged-list-mixed.d.ts +1 -1
  42. package/dist/bin/c4s/commands/tagged-list-mixed.js +2 -2
  43. package/dist/bin/c4s/commands/tagged-list-mixed.js.map +1 -1
  44. package/dist/bin/c4s/commands/tagged-list.d.ts +1 -1
  45. package/dist/bin/c4s/commands/tagged-list.js +2 -2
  46. package/dist/bin/c4s/commands/tagged-list.js.map +1 -1
  47. package/dist/bin/c4s/context.d.ts +3 -3
  48. package/dist/bin/c4s/context.js +7 -4
  49. package/dist/bin/c4s/context.js.map +1 -1
  50. package/dist/bin/c4s/errors.d.ts +1 -1
  51. package/dist/bin/c4s/errors.js.map +1 -1
  52. package/dist/bin/c4s-mcp.js +6 -2
  53. package/dist/bin/c4s-mcp.js.map +1 -1
  54. package/dist/bin/c4s.js +19 -4
  55. package/dist/bin/c4s.js.map +1 -1
  56. package/dist/bin/gitignore.js +7 -11
  57. package/dist/bin/gitignore.js.map +1 -1
  58. package/dist/client/assets/{arc-Coa9fbDO.js → arc-C9oTB3b1.js} +1 -1
  59. package/dist/client/assets/{architectureDiagram-3BPJPVTR-VJZcRMEN.js → architectureDiagram-3BPJPVTR-Bno5ViqK.js} +1 -1
  60. package/dist/client/assets/{blockDiagram-GPEHLZMM-C7dU2lW1.js → blockDiagram-GPEHLZMM-CJYBoeWQ.js} +1 -1
  61. package/dist/client/assets/{c4Diagram-AAUBKEIU-CG_BBm_5.js → c4Diagram-AAUBKEIU-DaaqWE6s.js} +1 -1
  62. package/dist/client/assets/channel-Cei_E79M.js +1 -0
  63. package/dist/client/assets/{chunk-2J33WTMH-BnS95YpK.js → chunk-2J33WTMH-P_I0OPMy.js} +1 -1
  64. package/dist/client/assets/{chunk-4BX2VUAB-COr8w3X3.js → chunk-4BX2VUAB-CCySMlh5.js} +1 -1
  65. package/dist/client/assets/{chunk-55IACEB6-CxrIbZhB.js → chunk-55IACEB6-CEUyqKGF.js} +1 -1
  66. package/dist/client/assets/{chunk-727SXJPM-DRchPPRe.js → chunk-727SXJPM-CoTSYOVz.js} +1 -1
  67. package/dist/client/assets/{chunk-AQP2D5EJ-_SfN7mED.js → chunk-AQP2D5EJ-DB0nMxPr.js} +1 -1
  68. package/dist/client/assets/{chunk-FMBD7UC4-p2tIiP1D.js → chunk-FMBD7UC4-PG3m6-_a.js} +1 -1
  69. package/dist/client/assets/{chunk-ND2GUHAM-B1mbl2hP.js → chunk-ND2GUHAM-CBNk6IaV.js} +1 -1
  70. package/dist/client/assets/{chunk-QZHKN3VN-DBUpeqvS.js → chunk-QZHKN3VN-CLFa0WvN.js} +1 -1
  71. package/dist/client/assets/classDiagram-4FO5ZUOK-DUe_fAto.js +1 -0
  72. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DUe_fAto.js +1 -0
  73. package/dist/client/assets/{cose-bilkent-S5V4N54A-BBsY5aKD.js → cose-bilkent-S5V4N54A-BDwDDxHN.js} +1 -1
  74. package/dist/client/assets/{dagre-BM42HDAG-b-vu4RC9.js → dagre-BM42HDAG-DR-1e8N5.js} +1 -1
  75. package/dist/client/assets/{diagram-2AECGRRQ-j-DW9qSf.js → diagram-2AECGRRQ-C-tHgBWt.js} +1 -1
  76. package/dist/client/assets/{diagram-5GNKFQAL-DHX_WYWQ.js → diagram-5GNKFQAL-uLmoKaJL.js} +1 -1
  77. package/dist/client/assets/{diagram-KO2AKTUF-DxdQok_M.js → diagram-KO2AKTUF-8Fd-xuOy.js} +1 -1
  78. package/dist/client/assets/{diagram-LMA3HP47-BbTIX5c1.js → diagram-LMA3HP47-C1gniWsn.js} +1 -1
  79. package/dist/client/assets/{diagram-OG6HWLK6-BQ9ODAlH.js → diagram-OG6HWLK6-BMWjZbeC.js} +1 -1
  80. package/dist/client/assets/{erDiagram-TEJ5UH35-6lwAL1y9.js → erDiagram-TEJ5UH35-CIUO8hrR.js} +1 -1
  81. package/dist/client/assets/{flowDiagram-I6XJVG4X-ioSHb5-t.js → flowDiagram-I6XJVG4X-Ccw5YEf3.js} +1 -1
  82. package/dist/client/assets/{ganttDiagram-6RSMTGT7-CXFQp9Nj.js → ganttDiagram-6RSMTGT7-BAvlf8cY.js} +1 -1
  83. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-C1pVD_NQ.js → gitGraphDiagram-PVQCEYII-ChCkdYar.js} +1 -1
  84. package/dist/client/assets/{index-JaAxQJXh.js → index-BotCWOKC.js} +1 -1
  85. package/dist/client/assets/index-CtdzGyqj.js +805 -0
  86. package/dist/client/assets/{index-hz5T_W2e.js → index-DtpKHGD1.js} +1 -1
  87. package/dist/client/assets/{infoDiagram-5YYISTIA-C2Guev-g.js → infoDiagram-5YYISTIA-CZMGwNyB.js} +1 -1
  88. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-D3v8VBb2.js → ishikawaDiagram-YF4QCWOH-CubjZGk6.js} +1 -1
  89. package/dist/client/assets/{journeyDiagram-JHISSGLW-DX1AW_Ap.js → journeyDiagram-JHISSGLW-DzwOyVzB.js} +1 -1
  90. package/dist/client/assets/{kanban-definition-UN3LZRKU-CzXThvq2.js → kanban-definition-UN3LZRKU-CXznoTY9.js} +1 -1
  91. package/dist/client/assets/{linear-CVw4gl5i.js → linear-EDwTFRrU.js} +1 -1
  92. package/dist/client/assets/{mermaid.core-C29eoXRj.js → mermaid.core-Lae2097R.js} +4 -4
  93. package/dist/client/assets/{mindmap-definition-RKZ34NQL-DEEGVQVA.js → mindmap-definition-RKZ34NQL-DFjIW41g.js} +1 -1
  94. package/dist/client/assets/{pieDiagram-4H26LBE5-Dme-VM6m.js → pieDiagram-4H26LBE5-CZDLR1jd.js} +1 -1
  95. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-CURFNo24.js → quadrantDiagram-W4KKPZXB-CTGDzbqp.js} +1 -1
  96. package/dist/client/assets/{requirementDiagram-4Y6WPE33-DxMZWXME.js → requirementDiagram-4Y6WPE33-CeH0NbMv.js} +1 -1
  97. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-BW64D4_P.js → sankeyDiagram-5OEKKPKP-B6ZTjurV.js} +1 -1
  98. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-BATRPm8Q.js → sequenceDiagram-3UESZ5HK-DcTRztVx.js} +1 -1
  99. package/dist/client/assets/{stateDiagram-AJRCARHV-pgHVMnO3.js → stateDiagram-AJRCARHV-nUgRVZSA.js} +1 -1
  100. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-D9pJuQbI.js +1 -0
  101. package/dist/client/assets/{timeline-definition-PNZ67QCA-qBxJZPWd.js → timeline-definition-PNZ67QCA-CXm5n4rV.js} +1 -1
  102. package/dist/client/assets/{vennDiagram-CIIHVFJN-BZJK9hqJ.js → vennDiagram-CIIHVFJN-EmNJBYNd.js} +1 -1
  103. package/dist/client/assets/{wardley-L42UT6IY-BobtgEXg.js → wardley-L42UT6IY-MLrlp8H-.js} +1 -1
  104. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-DuWfX_-P.js → wardleyDiagram-YWT4CUSO-5QoES25n.js} +1 -1
  105. package/dist/client/assets/{xychartDiagram-2RQKCTM6-DCw1iURo.js → xychartDiagram-2RQKCTM6-CbDEQbY0.js} +1 -1
  106. package/dist/client/index.html +1 -1
  107. package/dist/core/agent/run-agent.d.ts +61 -0
  108. package/dist/core/agent/run-agent.js +212 -0
  109. package/dist/core/agent/run-agent.js.map +1 -0
  110. package/dist/core/ask/run-ask.d.ts +1 -1
  111. package/dist/core/ask/run-ask.js +14 -5
  112. package/dist/core/ask/run-ask.js.map +1 -1
  113. package/dist/core/workspace/resolve.d.ts +2 -0
  114. package/dist/core/workspace/resolve.js +2 -1
  115. package/dist/core/workspace/resolve.js.map +1 -1
  116. package/dist/plugin-types/ambient.d.ts +30 -0
  117. package/dist/plugin-types/plugin-runtime.d.ts +172 -0
  118. package/dist/plugin-types/ui.d.ts +154 -0
  119. package/dist/server/config.d.ts +12 -0
  120. package/dist/server/config.js +26 -0
  121. package/dist/server/config.js.map +1 -1
  122. package/dist/server/core/plugin-host/__fixtures__/plugins.d.ts +14 -0
  123. package/dist/server/core/plugin-host/__fixtures__/plugins.js +56 -0
  124. package/dist/server/core/plugin-host/__fixtures__/plugins.js.map +1 -0
  125. package/dist/server/core/plugin-host/base-packages.d.ts +14 -0
  126. package/dist/server/core/plugin-host/base-packages.js +26 -0
  127. package/dist/server/core/plugin-host/base-packages.js.map +1 -0
  128. package/dist/server/core/plugin-host/cache-bust.d.ts +10 -0
  129. package/dist/server/core/plugin-host/cache-bust.js +21 -0
  130. package/dist/server/core/plugin-host/cache-bust.js.map +1 -0
  131. package/dist/server/core/plugin-host/cli-engine.d.ts +7 -2
  132. package/dist/server/core/plugin-host/cli-engine.js +11 -3
  133. package/dist/server/core/plugin-host/cli-engine.js.map +1 -1
  134. package/dist/server/core/plugin-host/cli-plugins.d.ts +23 -0
  135. package/dist/server/core/plugin-host/cli-plugins.js +49 -0
  136. package/dist/server/core/plugin-host/cli-plugins.js.map +1 -0
  137. package/dist/server/core/plugin-host/cross-cutting.d.ts +41 -4
  138. package/dist/server/core/plugin-host/cross-cutting.js +52 -4
  139. package/dist/server/core/plugin-host/cross-cutting.js.map +1 -1
  140. package/dist/server/core/plugin-host/frontend-assets.d.ts +100 -0
  141. package/dist/server/core/plugin-host/frontend-assets.js +262 -0
  142. package/dist/server/core/plugin-host/frontend-assets.js.map +1 -0
  143. package/dist/server/core/plugin-host/frontend-manifest.d.ts +33 -0
  144. package/dist/server/core/plugin-host/frontend-manifest.js +60 -0
  145. package/dist/server/core/plugin-host/frontend-manifest.js.map +1 -0
  146. package/dist/server/core/plugin-host/loader.d.ts +107 -0
  147. package/dist/server/core/plugin-host/loader.js +196 -0
  148. package/dist/server/core/plugin-host/loader.js.map +1 -0
  149. package/dist/server/core/plugin-host/manifest-adapter.d.ts +30 -0
  150. package/dist/server/core/plugin-host/manifest-adapter.js +119 -0
  151. package/dist/server/core/plugin-host/manifest-adapter.js.map +1 -0
  152. package/dist/server/core/plugin-host/overlay-loader.d.ts +60 -0
  153. package/dist/server/core/plugin-host/overlay-loader.js +243 -0
  154. package/dist/server/core/plugin-host/overlay-loader.js.map +1 -0
  155. package/dist/server/core/plugin-host/plugin-watcher.d.ts +41 -0
  156. package/dist/server/core/plugin-host/plugin-watcher.js +95 -0
  157. package/dist/server/core/plugin-host/plugin-watcher.js.map +1 -0
  158. package/dist/server/core/plugin-host/project-host.d.ts +8 -2
  159. package/dist/server/core/plugin-host/project-host.js +56 -6
  160. package/dist/server/core/plugin-host/project-host.js.map +1 -1
  161. package/dist/server/core/plugin-host/registry.d.ts +26 -2
  162. package/dist/server/core/plugin-host/registry.js +107 -2
  163. package/dist/server/core/plugin-host/registry.js.map +1 -1
  164. package/dist/server/core/plugin-host/runtime-shims.d.ts +26 -0
  165. package/dist/server/core/plugin-host/runtime-shims.js +96 -0
  166. package/dist/server/core/plugin-host/runtime-shims.js.map +1 -0
  167. package/dist/server/core/plugin-host/types.d.ts +105 -3
  168. package/dist/server/db/migrations/042_chat_thread_drop_context_type_check.sql +61 -0
  169. package/dist/server/external-skills/brief-implementer-template.d.ts +1 -1
  170. package/dist/server/external-skills/brief-implementer-template.js +5 -2
  171. package/dist/server/external-skills/brief-implementer-template.js.map +1 -1
  172. package/dist/server/external-skills/spec-reader-template.d.ts +1 -1
  173. package/dist/server/external-skills/spec-reader-template.js +14 -0
  174. package/dist/server/external-skills/spec-reader-template.js.map +1 -1
  175. package/dist/server/index.js +82 -1
  176. package/dist/server/index.js.map +1 -1
  177. package/dist/server/mcp/c4s-tools.d.ts +6 -1
  178. package/dist/server/mcp/c4s-tools.js +18 -13
  179. package/dist/server/mcp/c4s-tools.js.map +1 -1
  180. package/dist/server/plugin-runtime/index.d.ts +17 -0
  181. package/dist/server/plugin-runtime/index.js +16 -0
  182. package/dist/server/plugin-runtime/index.js.map +1 -0
  183. package/dist/server/plugin-runtime/ui.d.ts +15 -0
  184. package/dist/server/plugin-runtime/ui.js +15 -0
  185. package/dist/server/plugin-runtime/ui.js.map +1 -0
  186. package/dist/server/routes/agent-turn.d.ts +8 -1
  187. package/dist/server/routes/agent-turn.js +67 -39
  188. package/dist/server/routes/agent-turn.js.map +1 -1
  189. package/dist/server/routes/config.d.ts +8 -0
  190. package/dist/server/routes/config.js +41 -3
  191. package/dist/server/routes/config.js.map +1 -1
  192. package/dist/server/routes/plugins.d.ts +43 -0
  193. package/dist/server/routes/plugins.js +93 -0
  194. package/dist/server/routes/plugins.js.map +1 -0
  195. package/dist/server/routes/threads.js +21 -3
  196. package/dist/server/routes/threads.js.map +1 -1
  197. package/dist/server/serialization/registerAll.d.ts +4 -0
  198. package/dist/server/serialization/registerAll.js +4 -2
  199. package/dist/server/serialization/registerAll.js.map +1 -1
  200. package/dist/server/services/chat-context.d.ts +34 -0
  201. package/dist/server/services/chat-context.js +58 -15
  202. package/dist/server/services/chat-context.js.map +1 -1
  203. package/dist/server/services/chat.d.ts +6 -0
  204. package/dist/server/services/chat.js +18 -2
  205. package/dist/server/services/chat.js.map +1 -1
  206. package/dist/server/services/entity-writer.d.ts +2 -3
  207. package/dist/server/services/entity-writer.js.map +1 -1
  208. package/dist/server/services/skill-registry.d.ts +31 -2
  209. package/dist/server/services/skill-registry.js +73 -1
  210. package/dist/server/services/skill-registry.js.map +1 -1
  211. package/dist/server/workspace/context-cache.d.ts +9 -0
  212. package/dist/server/workspace/context-cache.js +14 -0
  213. package/dist/server/workspace/context-cache.js.map +1 -1
  214. package/dist/server/workspace/project-context.d.ts +3 -0
  215. package/dist/server/workspace/project-context.js +106 -4
  216. package/dist/server/workspace/project-context.js.map +1 -1
  217. package/dist/server/workspace/registry.d.ts +28 -1
  218. package/dist/server/workspace/registry.js +57 -1
  219. package/dist/server/workspace/registry.js.map +1 -1
  220. package/dist/server/workspace/types.d.ts +15 -0
  221. package/dist/shared/entities.d.ts +4 -1
  222. package/dist/shared/entities.js.map +1 -1
  223. package/dist/shared/plugin-host/frontend-manifest.d.ts +56 -0
  224. package/dist/shared/plugin-host/frontend-manifest.js +89 -0
  225. package/dist/shared/plugin-host/frontend-manifest.js.map +1 -0
  226. package/dist/shared/plugin-host/host-api.d.ts +60 -0
  227. package/dist/shared/plugin-host/host-api.js +67 -0
  228. package/dist/shared/plugin-host/host-api.js.map +1 -0
  229. package/dist/shared/plugin-host/manifest.d.ts +194 -0
  230. package/dist/shared/plugin-host/manifest.js +52 -0
  231. package/dist/shared/plugin-host/manifest.js.map +1 -0
  232. package/dist/shared/plugin-host/ui-kit-surface.d.ts +22 -0
  233. package/dist/shared/plugin-host/ui-kit-surface.js +25 -0
  234. package/dist/shared/plugin-host/ui-kit-surface.js.map +1 -0
  235. package/dist/shared/types.d.ts +5 -0
  236. package/package.json +18 -3
  237. package/dist/client/assets/channel-D5gzBvo7.js +0 -1
  238. package/dist/client/assets/classDiagram-4FO5ZUOK-CT-amIxa.js +0 -1
  239. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CT-amIxa.js +0 -1
  240. package/dist/client/assets/index-DyAnw7YN.js +0 -798
  241. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-szm_LIuD.js +0 -1
@@ -0,0 +1,89 @@
1
+ /**
2
+ * M33 — frontend plugin loading contract ("Option B": import map + native ESM).
3
+ *
4
+ * The client fetches {@link FrontendManifestResponse} at boot, injects an
5
+ * import map (so plugin `import "react"` resolves to the host's singleton),
6
+ * injects each plugin's CSS, then `await import(entry)` per active plugin.
7
+ *
8
+ * Shared so the server builder and the client boot loader agree on the shape.
9
+ */
10
+ /**
11
+ * Bare specifiers the import map externalizes to host-served shim ESM modules.
12
+ * Each resolves to `/api/plugins/runtime/<peer>.js`, which re-exports the host's
13
+ * live singleton from `window.__c4s_shared`. Keeping the list here lets the
14
+ * server builder and the client publisher stay in lockstep.
15
+ */
16
+ export const SHARED_PEER_SPECIFIERS = [
17
+ 'react',
18
+ // The automatic JSX runtime subpaths a plugin's `dist/frontend.js` emits when
19
+ // compiled with `jsx: 'react-jsx'` (`import { jsx, jsxs } from "react/jsx-runtime"`,
20
+ // dev builds also `jsxDEV` from `react/jsx-dev-runtime`). These are SEPARATE bare
21
+ // subpaths not covered by the `react` entry, so they need their own import-map
22
+ // entries — otherwise the browser can't resolve them and the whole plugin module
23
+ // fails to load. Sharing them keeps the plugin on the host's single React
24
+ // reconciler (L11 invariant) instead of bundling a second copy.
25
+ 'react/jsx-runtime',
26
+ 'react/jsx-dev-runtime',
27
+ 'react-dom',
28
+ 'react-dom/client',
29
+ '@tiptap/core',
30
+ '@tanstack/react-query',
31
+ // M33 phase 3: the router is a SHARED library peer (one instance via the import
32
+ // map) so a plugin's `createRoute({ getParentRoute })` and the host's single
33
+ // TanStack Router operate on the SAME route-tree types — NOT a live singleton
34
+ // re-exported through `@c4s/plugin-runtime`.
35
+ '@tanstack/react-router',
36
+ '@c4s/plugin-runtime',
37
+ '@c4s/plugin-runtime/ui',
38
+ ];
39
+ /**
40
+ * The value exports of `@c4s/plugin-runtime` (frontend facade), the one peer the
41
+ * server can't introspect by importing (it's a browser module). The runtime
42
+ * shim generator emits these names; a parity test asserts they match the actual
43
+ * module so this list can't silently drift. Keep in sync with
44
+ * `src/client/runtime/plugin-runtime.ts` value exports.
45
+ */
46
+ export const PLUGIN_RUNTIME_EXPORT_NAMES = [
47
+ 'clientPluginHost',
48
+ 'registerFrontendModule',
49
+ 'queryClient',
50
+ 'editorBridge',
51
+ 'registerExtensionReferenceType',
52
+ 'HOST_API_VERSION',
53
+ ];
54
+ /**
55
+ * The VALUE exports of `@c4s/plugin-runtime/ui` (Host UI Kit catalog, M34/L12) —
56
+ * a browser module the server can't introspect, same as the main facade above.
57
+ * The runtime shim emits these names; a parity test asserts they match the
58
+ * actual module so this list can't silently drift. Keep in sync with
59
+ * `src/client/runtime/plugin-runtime-ui.ts` (→ `client/host-ui-kit/index.ts`)
60
+ * value exports. Type-only exports are erased at runtime and excluded here.
61
+ */
62
+ export const PLUGIN_RUNTIME_UI_EXPORT_NAMES = [
63
+ // Core (stable)
64
+ 'EntityListHeader',
65
+ 'DetailPanelShell',
66
+ 'FieldRow',
67
+ 'FieldGrid',
68
+ // List (experimental)
69
+ 'EntityListLayout',
70
+ 'Pagination',
71
+ 'EmptyState',
72
+ 'TagFilterBar',
73
+ 'EntityListRow',
74
+ // Actions & states (experimental)
75
+ 'ActionButton',
76
+ 'Badge',
77
+ 'LoadingState',
78
+ // Form (experimental)
79
+ 'FormField',
80
+ 'InlineEditField',
81
+ // Token bridge
82
+ 'useHostTokens',
83
+ 'HOST_TOKEN_NAMES',
84
+ 'readHostTokens',
85
+ // Stability metadata
86
+ 'UI_KIT_CATALOG',
87
+ 'STABLE_UI_KIT_COMPONENTS',
88
+ ];
89
+ //# sourceMappingURL=frontend-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend-manifest.js","sourceRoot":"","sources":["../../../src/shared/plugin-host/frontend-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA0BH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,OAAO;IACP,8EAA8E;IAC9E,qFAAqF;IACrF,kFAAkF;IAClF,+EAA+E;IAC/E,iFAAiF;IACjF,0EAA0E;IAC1E,gEAAgE;IAChE,mBAAmB;IACnB,uBAAuB;IACvB,WAAW;IACX,kBAAkB;IAClB,cAAc;IACd,uBAAuB;IACvB,gFAAgF;IAChF,6EAA6E;IAC7E,8EAA8E;IAC9E,6CAA6C;IAC7C,wBAAwB;IACxB,qBAAqB;IACrB,wBAAwB;CAChB,CAAC;AAIX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,kBAAkB;IAClB,wBAAwB;IACxB,aAAa;IACb,cAAc;IACd,gCAAgC;IAChC,kBAAkB;CACV,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,gBAAgB;IAChB,kBAAkB;IAClB,kBAAkB;IAClB,UAAU;IACV,WAAW;IACX,sBAAsB;IACtB,kBAAkB;IAClB,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,eAAe;IACf,kCAAkC;IAClC,cAAc;IACd,OAAO;IACP,cAAc;IACd,sBAAsB;IACtB,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,qBAAqB;IACrB,gBAAgB;IAChB,0BAA0B;CAClB,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * M33 — Host API versioning surface: the per-major changelog and the
3
+ * migration descriptors a plugin author needs when their package was built
4
+ * against an incompatible major.
5
+ *
6
+ * Versioning rule (mirrored in the manifest doc): additive same-major slots =
7
+ * minor bump; a breaking slot-shape change = major bump WITH a descriptor here
8
+ * and a deprecation window (a slot deprecated in major N may be removed only in
9
+ * N+1). `incompatible` (major mismatch) is distinct from `skipped` (an `engines`
10
+ * miss — an environment problem with no migration path).
11
+ *
12
+ * The surface now also covers the `stable` Host UI Kit components (M34/L12); a
13
+ * breaking prop-shape change there is a major bump with a `ui-prop-reshape`
14
+ * descriptor (see {@link VERSIONED_UI_KIT_COMPONENTS}).
15
+ */
16
+ /**
17
+ * The component prop contracts counted into the versioned `hostApiVersion`
18
+ * surface from the Host UI Kit (M34/L12): the `stable` (Core) tier ONLY. A
19
+ * breaking prop-shape change to one of these is a major bump carrying a
20
+ * `ui-prop-reshape` descriptor below (AC3). `experimental` kit components are
21
+ * exposed by `@c4s/plugin-runtime/ui` but excluded here — their props may change
22
+ * without a major and they are NOT gated at plugin load (AC4). Promoting an
23
+ * `experimental` component to `stable` adds it to {@link UI_KIT_STABLE_COMPONENTS}
24
+ * and thereby to this surface (AC5).
25
+ */
26
+ export declare const VERSIONED_UI_KIT_COMPONENTS: readonly ["EntityListHeader", "DetailPanelShell", "FieldRow", "FieldGrid"];
27
+ /** One versioned change to the Host API contract between two adjacent majors. */
28
+ export interface HostApiMigration {
29
+ fromMajor: number;
30
+ toMajor: number;
31
+ /** The affected slot / surface, e.g. "onUnregister" or a `stable` kit component. */
32
+ slot: string;
33
+ /**
34
+ * `ui-prop-reshape` — a breaking prop-shape change to a `stable` Host UI Kit
35
+ * component (M34/L12). The others cover the manifest/contributes/editor
36
+ * surfaces.
37
+ */
38
+ kind: 'slot-required' | 'field-rename' | 'contributes-reshape' | 'ui-prop-reshape';
39
+ /** Human-readable migration instruction. */
40
+ summary: string;
41
+ }
42
+ /** Migration path attached to an `incompatible` package record. */
43
+ export interface PluginMigrationInfo {
44
+ /** The Host API version to target after migrating. */
45
+ targetHostApiVersion: string;
46
+ /** Versioned descriptors of the shape changes between the plugin's major and the host's. */
47
+ migrations: HostApiMigration[];
48
+ /** Whether a compat-shim exists for the deprecated slot(s). */
49
+ shimAvailable: boolean;
50
+ }
51
+ /** First numeric component of a semver RANGE (e.g. "^1.4.0" → 1, ">=2.5.0" → 2). */
52
+ export declare function rangeMajor(range: string): number | null;
53
+ /** Changelog entries spanning the majors between (inclusive of the boundary crossings). */
54
+ export declare function migrationsBetween(fromMajor: number, toMajor: number): HostApiMigration[];
55
+ /**
56
+ * Build the migration info for a plugin whose `hostApiVersion` RANGE targets a
57
+ * different major than the running host. Returns `null` when the majors match
58
+ * (no migration needed) or the range major is unparseable.
59
+ */
60
+ export declare function buildMigrationInfo(pluginRange: string): PluginMigrationInfo | null;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * M33 — Host API versioning surface: the per-major changelog and the
3
+ * migration descriptors a plugin author needs when their package was built
4
+ * against an incompatible major.
5
+ *
6
+ * Versioning rule (mirrored in the manifest doc): additive same-major slots =
7
+ * minor bump; a breaking slot-shape change = major bump WITH a descriptor here
8
+ * and a deprecation window (a slot deprecated in major N may be removed only in
9
+ * N+1). `incompatible` (major mismatch) is distinct from `skipped` (an `engines`
10
+ * miss — an environment problem with no migration path).
11
+ *
12
+ * The surface now also covers the `stable` Host UI Kit components (M34/L12); a
13
+ * breaking prop-shape change there is a major bump with a `ui-prop-reshape`
14
+ * descriptor (see {@link VERSIONED_UI_KIT_COMPONENTS}).
15
+ */
16
+ import { HOST_API_VERSION, parseMajor } from './manifest.js';
17
+ import { UI_KIT_STABLE_COMPONENTS } from './ui-kit-surface.js';
18
+ /**
19
+ * The component prop contracts counted into the versioned `hostApiVersion`
20
+ * surface from the Host UI Kit (M34/L12): the `stable` (Core) tier ONLY. A
21
+ * breaking prop-shape change to one of these is a major bump carrying a
22
+ * `ui-prop-reshape` descriptor below (AC3). `experimental` kit components are
23
+ * exposed by `@c4s/plugin-runtime/ui` but excluded here — their props may change
24
+ * without a major and they are NOT gated at plugin load (AC4). Promoting an
25
+ * `experimental` component to `stable` adds it to {@link UI_KIT_STABLE_COMPONENTS}
26
+ * and thereby to this surface (AC5).
27
+ */
28
+ export const VERSIONED_UI_KIT_COMPONENTS = UI_KIT_STABLE_COMPONENTS;
29
+ /**
30
+ * The Host API changelog, one entry per breaking change at a major boundary.
31
+ * Empty at the `1.0.0` baseline — no major has been crossed yet. The first
32
+ * breaking slot-shape change will add an entry here (and bump the major).
33
+ */
34
+ const HOST_API_CHANGELOG = [];
35
+ /** First numeric component of a semver RANGE (e.g. "^1.4.0" → 1, ">=2.5.0" → 2). */
36
+ export function rangeMajor(range) {
37
+ const m = /(\d+)/.exec(range);
38
+ if (!m)
39
+ return null;
40
+ const n = Number(m[1]);
41
+ return Number.isFinite(n) ? n : null;
42
+ }
43
+ /** Changelog entries spanning the majors between (inclusive of the boundary crossings). */
44
+ export function migrationsBetween(fromMajor, toMajor) {
45
+ const [lo, hi] = fromMajor <= toMajor ? [fromMajor, toMajor] : [toMajor, fromMajor];
46
+ return HOST_API_CHANGELOG.filter((m) => m.fromMajor >= lo && m.toMajor <= hi);
47
+ }
48
+ /**
49
+ * Build the migration info for a plugin whose `hostApiVersion` RANGE targets a
50
+ * different major than the running host. Returns `null` when the majors match
51
+ * (no migration needed) or the range major is unparseable.
52
+ */
53
+ export function buildMigrationInfo(pluginRange) {
54
+ const pluginMajor = rangeMajor(pluginRange);
55
+ const hostMajor = parseMajor(HOST_API_VERSION);
56
+ if (pluginMajor == null || hostMajor == null || pluginMajor === hostMajor)
57
+ return null;
58
+ const migrations = migrationsBetween(pluginMajor, hostMajor);
59
+ return {
60
+ targetHostApiVersion: HOST_API_VERSION,
61
+ migrations,
62
+ // No shim without descriptors, and a slot becoming required can never be
63
+ // shimmed (the author must implement it). Empty changelog ⇒ false.
64
+ shimAvailable: migrations.length > 0 && migrations.every((m) => m.kind !== 'slot-required'),
65
+ };
66
+ }
67
+ //# sourceMappingURL=host-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-api.js","sourceRoot":"","sources":["../../../src/shared/plugin-host/host-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,wBAAwB,CAAC;AA4BpE;;;;GAIG;AACH,MAAM,kBAAkB,GAAuB,EAAE,CAAC;AAElD,oFAAoF;AACpF,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,iBAAiB,CAAC,SAAiB,EAAE,OAAe;IAClE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACpF,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC/C,IAAI,WAAW,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvF,MAAM,UAAU,GAAG,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC7D,OAAO;QACL,oBAAoB,EAAE,gBAAgB;QACtC,UAAU;QACV,yEAAyE;QACzE,mEAAmE;QACnE,aAAa,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC;KAC5F,CAAC;AACJ,CAAC"}
@@ -0,0 +1,194 @@
1
+ /**
2
+ * M33 — runtime plugin manifest contract.
3
+ *
4
+ * A plugin is an npm package that default-exports (or named-exports as
5
+ * `manifest`) a {@link PluginManifest}. The host loader (`loadWorkspacePlugins`)
6
+ * dynamic-imports each workspace-declared package, validates `hostApiVersion`
7
+ * / `engines`, then fans `contributes.entities` out to `registerEntityModule`.
8
+ *
9
+ * This lives in `shared/` (not `server/`) because the external `c4s-reader`
10
+ * and plugin authors need the contract without pulling in express /
11
+ * better-sqlite3. Server-only payloads (the express Router, the L9 serializer)
12
+ * are typed `unknown` here and narrowed server-side.
13
+ */
14
+ import type { EntityModuleManifest, SystemPromptContribution } from './types.js';
15
+ /**
16
+ * The Host API version this build advertises. Bumped on a breaking change to
17
+ * any surface counted into the contract: the manifest / EntityModule
18
+ * signatures, the `mountBackend(app, mcpHost, db, cwd)` mount-context shape,
19
+ * the chip/card/row prop shapes, the L8 editor registration contract, and the
20
+ * prop contracts of the `stable` Host UI Kit components (M34/L12;
21
+ * `@c4s/plugin-runtime/ui`). See `UI_KIT_STABLE_COMPONENTS` in
22
+ * `ui-kit-surface.ts`; `experimental` kit components are deliberately NOT part
23
+ * of this surface.
24
+ *
25
+ * A plugin whose `hostApiVersion` range does not satisfy this version is
26
+ * skipped with a warning (never crashed over) — on the backend during load and
27
+ * independently on the frontend during manifest consumption.
28
+ *
29
+ * Versioning rule — only a breaking slot-shape change bumps the version, and it
30
+ * bumps the MAJOR (with a descriptor in the changelog — see `host-api.ts`); the
31
+ * loader gate compares majors only. A plugin built against a different major is
32
+ * reported `incompatible` with a migration descriptor (vs the environment-level
33
+ * `skipped` for an `engines` miss).
34
+ *
35
+ * `1.0.0` baseline — the Host UI Kit catalog + `stable` prop contracts
36
+ * (`@c4s/plugin-runtime/ui`, M34/L12) shipped WITHIN this major, so they are
37
+ * folded into the `1.0.0` versioned surface rather than bumping it; no major has
38
+ * been crossed, so the changelog stays empty.
39
+ */
40
+ export declare const HOST_API_VERSION = "1.0.0";
41
+ /** Node/host engine constraints — checked by the loader before registration. */
42
+ export interface PluginEngines {
43
+ /** semver range matched against `process.versions.node`. */
44
+ node?: string;
45
+ [key: string]: string | undefined;
46
+ }
47
+ /**
48
+ * Authoring shape for one contributed entity type. A superset of the shared
49
+ * {@link EntityModuleManifest} carrying the slots the host needs to lower it
50
+ * into a server `BackendModule`. The express Router (`backend.routes`) and the
51
+ * L9 serializer are typed `unknown` here so the shared bundle stays dep-free;
52
+ * the registry narrows them at registration time.
53
+ */
54
+ export interface EntityContribution extends EntityModuleManifest {
55
+ /** L9 — JSON serializer (server `EntitySerializer<unknown>`; narrowed server-side). */
56
+ serializer: unknown;
57
+ /** M05 — system prompt contribution composed by buildSystemPrompt. */
58
+ systemPrompt: SystemPromptContribution;
59
+ backend?: {
60
+ /** Per-plugin idempotent SQL migrations (server `SqlMigration[]`). */
61
+ migrations?: unknown[];
62
+ /**
63
+ * Full-power imperative mount hook (server `PluginMountFn`). Receives the
64
+ * MountContext; owns service construction, route mounting, MCP + service
65
+ * registration. Takes precedence over `routes`.
66
+ */
67
+ mount?: unknown;
68
+ /**
69
+ * Sugar: a pre-built express Router mounted at `pathPrefix`. When supplied
70
+ * without `mount`, the registry synthesizes
71
+ * `mount = (ctx) => ctx.app.use(pathPrefix, routes)` — no MCP server, no
72
+ * entity service, no migrations.
73
+ */
74
+ routes?: unknown;
75
+ };
76
+ /** L8 — client editor extensions + render slots (narrowed client-side). */
77
+ frontend?: unknown;
78
+ }
79
+ /**
80
+ * Authoring shape for one contributed writing style (M15). A plugin carries the
81
+ * style inline (body + optional attached files) rather than dropping a SKILL.md
82
+ * dir on disk — discovery is by push at load time (the loader fans these into
83
+ * the per-project SkillRegistry as `source: "plugin"`), not by FS scan.
84
+ */
85
+ export interface WritingStyleContribution {
86
+ /** Stable identifier; also the dedup key against bundled/user styles. */
87
+ slug: string;
88
+ title: string;
89
+ description: string;
90
+ /** Positive integer; mirrors SKILL.md frontmatter `version`. */
91
+ version: number;
92
+ language: 'en' | 'pl';
93
+ /** The skill body markdown (the SKILL.md content without frontmatter). */
94
+ content: string;
95
+ /** Optional attached files (templates/examples/workflows), keyed by rel path. */
96
+ files?: Record<string, string>;
97
+ }
98
+ /**
99
+ * M33 — one settings field a plugin renders in its own Settings section
100
+ * (panel M26), values stored under `config.plugins[<manifest.name>][key]`.
101
+ * `kind` drives the reload classification on write:
102
+ * - `hot-reload` → only `invalidateQueries(['config'])`, no context rebuild
103
+ * (parity with `writingStyle` / `language`; takes effect next turn/thread).
104
+ * - `executive` → invalidates the `ProjectContext` (rebuild, no banner, no
105
+ * restart).
106
+ */
107
+ export interface PluginSettingField {
108
+ /** Stable field key inside the plugin's config namespace. */
109
+ key: string;
110
+ /** Human label shown in the Settings panel. */
111
+ label: string;
112
+ control: 'toggle' | 'text' | 'select' | 'multiselect';
113
+ kind: 'hot-reload' | 'executive';
114
+ /** Default applied when `config.plugins[<name>][key]` is absent. */
115
+ default: unknown;
116
+ /** Choices for `select` / `multiselect` controls. */
117
+ options?: {
118
+ value: string;
119
+ label: string;
120
+ }[];
121
+ /** Optional help/description text. */
122
+ help?: string;
123
+ }
124
+ /** A plugin's settings module = an ordered list of fields. */
125
+ export type PluginSettingsModule = PluginSettingField[];
126
+ /**
127
+ * M33 — declarative editor slash-command contributed by a plugin
128
+ * (typically an entity-less one). The loader normalizes each entry into an
129
+ * `EditorExtensionRegistration.slashCommand` and routes it through
130
+ * `registerEditorExtension(...)` — the SAME path as entity-borne extensions.
131
+ * Declarative, not imperative: the plugin declares the trigger + popover to
132
+ * open; execution is the editor framework's popover dispatch, not plugin code.
133
+ * Kept as a dep-free subset here (the full `EditorExtensionRegistration` lives
134
+ * client-side); `popoverKind` is narrowed against the client `PopoverMap`.
135
+ */
136
+ export interface PluginCommandContribution {
137
+ /** Stable registration name (unique within the editor extension registry). */
138
+ name: string;
139
+ /** Slash trigger token, e.g. "mychart". */
140
+ trigger: string;
141
+ /** Menu label shown in the slash palette. */
142
+ label: string;
143
+ /** Popover kind dispatched on invoke (client `PopoverKind`). */
144
+ popoverKind: string;
145
+ /** Editor contexts the command is available in. Omitted = all contexts. */
146
+ availableIn?: string[];
147
+ }
148
+ /**
149
+ * The default export of a plugin package. `contributes` is the capability
150
+ * bundle: `contributes.entities`, `contributes.writingStyles` (pushed into the
151
+ * SkillRegistry as `source: "plugin"`), and
152
+ * `contributes.settings` / `contributes.commands`.
153
+ */
154
+ export interface PluginManifest {
155
+ /** npm package name. */
156
+ name: string;
157
+ /** plugin semver. */
158
+ version: string;
159
+ /** semver range — which Host API the plugin targets, e.g. "^1.0.0". */
160
+ hostApiVersion: string;
161
+ /** node/host engine constraints. */
162
+ engines?: PluginEngines;
163
+ /**
164
+ * REQUIRED teardown hook, symmetric to backend mount — a required slot from
165
+ * the `1.0.0` baseline. The hot-reload pipeline calls it on the OLD version
166
+ * before registering the new one; without it a reload would leave duplicated
167
+ * slots (MCP server, Express routes, editor extensions, zustand slice). Must
168
+ * be idempotent and non-throwing — a thrown error is logged as a warning and
169
+ * never blocks the reload.
170
+ */
171
+ onUnregister(): void;
172
+ contributes: {
173
+ entities?: EntityContribution[];
174
+ /** M15 — writing styles contributed by this plugin. */
175
+ writingStyles?: WritingStyleContribution[];
176
+ /** M33 — settings fields rendered per-plugin in Settings (M26). */
177
+ settings?: PluginSettingsModule;
178
+ /** M33 — declarative editor slash-commands (entity-less plugins). */
179
+ commands?: PluginCommandContribution[];
180
+ };
181
+ }
182
+ /** One plugin's Settings section, as returned by `ProjectPluginHost.listSettings()`. */
183
+ export interface PluginSettingsSection {
184
+ /** Plugin package name — also the `config.plugins` namespace key. */
185
+ name: string;
186
+ version: string;
187
+ fields: PluginSettingsModule;
188
+ }
189
+ /**
190
+ * Parse the major component of a clean semver string (e.g. "1.4.0" -> 1).
191
+ * Used for the cheap major-mismatch gate on the frontend, mirroring the
192
+ * backend's `semver.satisfies` check. Returns `null` for unparseable input.
193
+ */
194
+ export declare function parseMajor(version: string): number | null;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * M33 — runtime plugin manifest contract.
3
+ *
4
+ * A plugin is an npm package that default-exports (or named-exports as
5
+ * `manifest`) a {@link PluginManifest}. The host loader (`loadWorkspacePlugins`)
6
+ * dynamic-imports each workspace-declared package, validates `hostApiVersion`
7
+ * / `engines`, then fans `contributes.entities` out to `registerEntityModule`.
8
+ *
9
+ * This lives in `shared/` (not `server/`) because the external `c4s-reader`
10
+ * and plugin authors need the contract without pulling in express /
11
+ * better-sqlite3. Server-only payloads (the express Router, the L9 serializer)
12
+ * are typed `unknown` here and narrowed server-side.
13
+ */
14
+ /**
15
+ * The Host API version this build advertises. Bumped on a breaking change to
16
+ * any surface counted into the contract: the manifest / EntityModule
17
+ * signatures, the `mountBackend(app, mcpHost, db, cwd)` mount-context shape,
18
+ * the chip/card/row prop shapes, the L8 editor registration contract, and the
19
+ * prop contracts of the `stable` Host UI Kit components (M34/L12;
20
+ * `@c4s/plugin-runtime/ui`). See `UI_KIT_STABLE_COMPONENTS` in
21
+ * `ui-kit-surface.ts`; `experimental` kit components are deliberately NOT part
22
+ * of this surface.
23
+ *
24
+ * A plugin whose `hostApiVersion` range does not satisfy this version is
25
+ * skipped with a warning (never crashed over) — on the backend during load and
26
+ * independently on the frontend during manifest consumption.
27
+ *
28
+ * Versioning rule — only a breaking slot-shape change bumps the version, and it
29
+ * bumps the MAJOR (with a descriptor in the changelog — see `host-api.ts`); the
30
+ * loader gate compares majors only. A plugin built against a different major is
31
+ * reported `incompatible` with a migration descriptor (vs the environment-level
32
+ * `skipped` for an `engines` miss).
33
+ *
34
+ * `1.0.0` baseline — the Host UI Kit catalog + `stable` prop contracts
35
+ * (`@c4s/plugin-runtime/ui`, M34/L12) shipped WITHIN this major, so they are
36
+ * folded into the `1.0.0` versioned surface rather than bumping it; no major has
37
+ * been crossed, so the changelog stays empty.
38
+ */
39
+ export const HOST_API_VERSION = '1.0.0';
40
+ /**
41
+ * Parse the major component of a clean semver string (e.g. "1.4.0" -> 1).
42
+ * Used for the cheap major-mismatch gate on the frontend, mirroring the
43
+ * backend's `semver.satisfies` check. Returns `null` for unparseable input.
44
+ */
45
+ export function parseMajor(version) {
46
+ const match = /^\s*v?(\d+)\./.exec(version);
47
+ if (!match)
48
+ return null;
49
+ const major = Number(match[1]);
50
+ return Number.isFinite(major) ? major : null;
51
+ }
52
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/shared/plugin-host/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AA8JxC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * M34 / L12 ↔ L11 — the versioned slice of the Host UI Kit.
3
+ *
4
+ * React-free so both the server (`server/plugin-runtime/ui.ts`) and the version
5
+ * surface (`host-api.ts`) can reference it without importing the client catalog
6
+ * (which pulls in React). The client catalog (`client/host-ui-kit/registry.ts`)
7
+ * derives the SAME stable set from the components' field-level `stability`
8
+ * constants; a test asserts the two agree, so this list can't silently drift
9
+ * from the actual components.
10
+ */
11
+ /** Per-component stability tier. */
12
+ export type Stability = 'stable' | 'experimental';
13
+ /**
14
+ * The catalog components whose prop contracts are part of the versioned
15
+ * `hostApiVersion` surface — the `stable` (Core) tier only. A breaking
16
+ * prop-shape change to any of these requires a major `hostApiVersion` bump + a
17
+ * `migrations[]` descriptor (see {@link file://./host-api.ts}). `experimental`
18
+ * components are exposed by `/ui` but excluded from the surface; promoting one
19
+ * to `stable` adds it here.
20
+ */
21
+ export declare const UI_KIT_STABLE_COMPONENTS: readonly ["EntityListHeader", "DetailPanelShell", "FieldRow", "FieldGrid"];
22
+ export type StableUiKitComponent = (typeof UI_KIT_STABLE_COMPONENTS)[number];
@@ -0,0 +1,25 @@
1
+ /**
2
+ * M34 / L12 ↔ L11 — the versioned slice of the Host UI Kit.
3
+ *
4
+ * React-free so both the server (`server/plugin-runtime/ui.ts`) and the version
5
+ * surface (`host-api.ts`) can reference it without importing the client catalog
6
+ * (which pulls in React). The client catalog (`client/host-ui-kit/registry.ts`)
7
+ * derives the SAME stable set from the components' field-level `stability`
8
+ * constants; a test asserts the two agree, so this list can't silently drift
9
+ * from the actual components.
10
+ */
11
+ /**
12
+ * The catalog components whose prop contracts are part of the versioned
13
+ * `hostApiVersion` surface — the `stable` (Core) tier only. A breaking
14
+ * prop-shape change to any of these requires a major `hostApiVersion` bump + a
15
+ * `migrations[]` descriptor (see {@link file://./host-api.ts}). `experimental`
16
+ * components are exposed by `/ui` but excluded from the surface; promoting one
17
+ * to `stable` adds it here.
18
+ */
19
+ export const UI_KIT_STABLE_COMPONENTS = [
20
+ 'EntityListHeader',
21
+ 'DetailPanelShell',
22
+ 'FieldRow',
23
+ 'FieldGrid',
24
+ ];
25
+ //# sourceMappingURL=ui-kit-surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-kit-surface.js","sourceRoot":"","sources":["../../../src/shared/plugin-host/ui-kit-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,kBAAkB;IAClB,kBAAkB;IAClB,UAAU;IACV,WAAW;CACH,CAAC"}
@@ -85,6 +85,11 @@ export type WsEvent = {
85
85
  ts: number;
86
86
  } | {
87
87
  kind: 'project:disposed';
88
+ } | {
89
+ kind: 'plugin:reloaded';
90
+ name: string;
91
+ version: string;
92
+ tier: 'base' | 'overlay';
88
93
  };
89
94
  /** M02 multidir: discriminator dla source-of-truth (pagesDir / briefsDir / patchesDir). */
90
95
  export type PagesRootDir = 'pages' | 'briefs' | 'patches';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inharness-ai/claude4spec",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Plan the whole system before your agent writes a line of code. Local-first planning layer with structured entities and typed relations.",
5
5
  "license": "MIT",
6
6
  "author": "Mike Tomala <mike@inharness.ai>",
@@ -38,15 +38,28 @@
38
38
  "c4s": "dist/bin/c4s.js",
39
39
  "c4s-mcp": "dist/bin/c4s-mcp.js"
40
40
  },
41
+ "exports": {
42
+ "./package.json": "./package.json",
43
+ "./plugin-runtime": {
44
+ "types": "./dist/plugin-types/plugin-runtime.d.ts"
45
+ },
46
+ "./plugin-runtime/ui": {
47
+ "types": "./dist/plugin-types/ui.d.ts"
48
+ },
49
+ "./plugin-runtime/ambient": {
50
+ "types": "./dist/plugin-types/ambient.d.ts"
51
+ }
52
+ },
41
53
  "scripts": {
42
54
  "dev": "tsx watch src/bin/claude4spec.ts --mode dev",
43
55
  "dev:sandbox": "tsx watch src/bin/claude4spec.ts --mode dev --cwd .claude/skills/specyfikacja --pages .",
44
56
  "c4s": "tsx src/bin/c4s.ts",
45
57
  "build:server": "tsc -p tsconfig.server.json && rm -rf dist/server/db/migrations && cp -R src/server/db/migrations dist/server/db/migrations && rm -rf dist/server/skills && cp -R src/server/skills dist/server/skills && chmod +x dist/bin/claude4spec.js dist/bin/c4s.js dist/bin/c4s-mcp.js",
46
58
  "build:client": "vite build",
47
- "build": "npm run build:client && npm run build:server",
59
+ "build:types": "tsc -p tsconfig.types.json && cp src/plugin-types/ambient.d.ts dist/plugin-types/ambient.d.ts",
60
+ "build": "npm run build:client && npm run build:server && npm run build:types",
48
61
  "start": "node dist/bin/claude4spec.js",
49
- "typecheck": "tsc -p tsconfig.server.json --noEmit && tsc -p tsconfig.client.json --noEmit",
62
+ "typecheck": "tsc -p tsconfig.server.json --noEmit && tsc -p tsconfig.client.json --noEmit && tsc -p tsconfig.types.json --noEmit",
50
63
  "typecheck:test": "tsc -p tsconfig.test.json --noEmit",
51
64
  "test": "vitest run",
52
65
  "test:watch": "vitest",
@@ -78,6 +91,7 @@
78
91
  "@tiptap/suggestion": "^2.27.2",
79
92
  "@types/diff": "^7.0.2",
80
93
  "better-sqlite3": "^11.7.0",
94
+ "@inharness-ai/c4s-plugin-simple-database-tables": "^0.1.0",
81
95
  "chokidar": "^4.0.3",
82
96
  "diff": "^9.0.0",
83
97
  "express": "^4.21.2",
@@ -91,6 +105,7 @@
91
105
  "react-markdown": "^9.1.0",
92
106
  "rehype-highlight": "^7.0.2",
93
107
  "remark-gfm": "^4.0.1",
108
+ "semver": "^6.3.1",
94
109
  "tar": "^7.5.15",
95
110
  "tiptap-markdown": "^0.8.10",
96
111
  "ws": "^8.18.0",
@@ -1 +0,0 @@
1
- import{ai as o,aj as n}from"./mermaid.core-C29eoXRj.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-DRchPPRe.js";import{_ as i}from"./mermaid.core-C29eoXRj.js";import"./chunk-FMBD7UC4-p2tIiP1D.js";import"./chunk-ND2GUHAM-B1mbl2hP.js";import"./chunk-55IACEB6-CxrIbZhB.js";import"./chunk-2J33WTMH-BnS95YpK.js";import"./index-DyAnw7YN.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-DRchPPRe.js";import{_ as i}from"./mermaid.core-C29eoXRj.js";import"./chunk-FMBD7UC4-p2tIiP1D.js";import"./chunk-ND2GUHAM-B1mbl2hP.js";import"./chunk-55IACEB6-CxrIbZhB.js";import"./chunk-2J33WTMH-BnS95YpK.js";import"./index-DyAnw7YN.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};