@inharness-ai/claude4spec 1.0.20 → 1.0.22

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 (274) hide show
  1. package/.claude/skills/c4s-brief-implementer/SKILL.md +117 -57
  2. package/CHANGELOG.md +26 -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-qrIe4IVl.js → arc-C9oTB3b1.js} +1 -1
  59. package/dist/client/assets/{architectureDiagram-3BPJPVTR-CF6sgG8n.js → architectureDiagram-3BPJPVTR-Bno5ViqK.js} +1 -1
  60. package/dist/client/assets/{blockDiagram-GPEHLZMM-Cf8Tx0VN.js → blockDiagram-GPEHLZMM-CJYBoeWQ.js} +1 -1
  61. package/dist/client/assets/{c4Diagram-AAUBKEIU-BDkuMEyf.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-ChycTonk.js → chunk-2J33WTMH-P_I0OPMy.js} +1 -1
  64. package/dist/client/assets/{chunk-4BX2VUAB-BpUgWjxx.js → chunk-4BX2VUAB-CCySMlh5.js} +1 -1
  65. package/dist/client/assets/{chunk-55IACEB6-CeHg_yjT.js → chunk-55IACEB6-CEUyqKGF.js} +1 -1
  66. package/dist/client/assets/{chunk-727SXJPM-BpxYq7ab.js → chunk-727SXJPM-CoTSYOVz.js} +1 -1
  67. package/dist/client/assets/{chunk-AQP2D5EJ-bghkOtr6.js → chunk-AQP2D5EJ-DB0nMxPr.js} +1 -1
  68. package/dist/client/assets/{chunk-FMBD7UC4-4sXokGgd.js → chunk-FMBD7UC4-PG3m6-_a.js} +1 -1
  69. package/dist/client/assets/{chunk-ND2GUHAM-DYQOCE5T.js → chunk-ND2GUHAM-CBNk6IaV.js} +1 -1
  70. package/dist/client/assets/{chunk-QZHKN3VN-NkVuDlFD.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-1l4P4WRI.js → cose-bilkent-S5V4N54A-BDwDDxHN.js} +1 -1
  74. package/dist/client/assets/{dagre-BM42HDAG-CSQie-gR.js → dagre-BM42HDAG-DR-1e8N5.js} +1 -1
  75. package/dist/client/assets/{diagram-2AECGRRQ-DME9ULoN.js → diagram-2AECGRRQ-C-tHgBWt.js} +1 -1
  76. package/dist/client/assets/{diagram-5GNKFQAL-Dn1Rw5k5.js → diagram-5GNKFQAL-uLmoKaJL.js} +1 -1
  77. package/dist/client/assets/{diagram-KO2AKTUF-Duh_PNWR.js → diagram-KO2AKTUF-8Fd-xuOy.js} +1 -1
  78. package/dist/client/assets/{diagram-LMA3HP47-B7Q5pV60.js → diagram-LMA3HP47-C1gniWsn.js} +1 -1
  79. package/dist/client/assets/{diagram-OG6HWLK6-C0KL_RDd.js → diagram-OG6HWLK6-BMWjZbeC.js} +1 -1
  80. package/dist/client/assets/{erDiagram-TEJ5UH35-D5elfwSC.js → erDiagram-TEJ5UH35-CIUO8hrR.js} +1 -1
  81. package/dist/client/assets/{flowDiagram-I6XJVG4X-BHmjX-WI.js → flowDiagram-I6XJVG4X-Ccw5YEf3.js} +1 -1
  82. package/dist/client/assets/{ganttDiagram-6RSMTGT7-KvoGFbS2.js → ganttDiagram-6RSMTGT7-BAvlf8cY.js} +1 -1
  83. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-DsZL8BfK.js → gitGraphDiagram-PVQCEYII-ChCkdYar.js} +1 -1
  84. package/dist/client/assets/{index-zzILqHQN.js → index-BotCWOKC.js} +1 -1
  85. package/dist/client/assets/index-CtdzGyqj.js +805 -0
  86. package/dist/client/assets/{index-ClaVbrEF.js → index-DtpKHGD1.js} +1 -1
  87. package/dist/client/assets/{infoDiagram-5YYISTIA-DoQ6iSpJ.js → infoDiagram-5YYISTIA-CZMGwNyB.js} +1 -1
  88. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-akftyN0J.js → ishikawaDiagram-YF4QCWOH-CubjZGk6.js} +1 -1
  89. package/dist/client/assets/{journeyDiagram-JHISSGLW-PPex4PiV.js → journeyDiagram-JHISSGLW-DzwOyVzB.js} +1 -1
  90. package/dist/client/assets/{kanban-definition-UN3LZRKU-D114i3s1.js → kanban-definition-UN3LZRKU-CXznoTY9.js} +1 -1
  91. package/dist/client/assets/{linear-BuwQPJom.js → linear-EDwTFRrU.js} +1 -1
  92. package/dist/client/assets/{mermaid.core-CMX3GAvM.js → mermaid.core-Lae2097R.js} +4 -4
  93. package/dist/client/assets/{mindmap-definition-RKZ34NQL-ClBxWJju.js → mindmap-definition-RKZ34NQL-DFjIW41g.js} +1 -1
  94. package/dist/client/assets/{pieDiagram-4H26LBE5-hj5zVPj5.js → pieDiagram-4H26LBE5-CZDLR1jd.js} +1 -1
  95. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-CRbR0G7M.js → quadrantDiagram-W4KKPZXB-CTGDzbqp.js} +1 -1
  96. package/dist/client/assets/{requirementDiagram-4Y6WPE33-Dto4B70I.js → requirementDiagram-4Y6WPE33-CeH0NbMv.js} +1 -1
  97. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-DyYP8rwY.js → sankeyDiagram-5OEKKPKP-B6ZTjurV.js} +1 -1
  98. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-C-mrSLrJ.js → sequenceDiagram-3UESZ5HK-DcTRztVx.js} +1 -1
  99. package/dist/client/assets/{stateDiagram-AJRCARHV-IoDlhAe6.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-DEXg3TEw.js → timeline-definition-PNZ67QCA-CXm5n4rV.js} +1 -1
  102. package/dist/client/assets/{vennDiagram-CIIHVFJN-CNu7LaT1.js → vennDiagram-CIIHVFJN-EmNJBYNd.js} +1 -1
  103. package/dist/client/assets/{wardley-L42UT6IY-0hGvREmD.js → wardley-L42UT6IY-MLrlp8H-.js} +1 -1
  104. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-CVLz-xFz.js → wardleyDiagram-YWT4CUSO-5QoES25n.js} +1 -1
  105. package/dist/client/assets/{xychartDiagram-2RQKCTM6-CFymKAcX.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/entities-router.d.ts +2 -1
  141. package/dist/server/core/plugin-host/entities-router.js +16 -1
  142. package/dist/server/core/plugin-host/entities-router.js.map +1 -1
  143. package/dist/server/core/plugin-host/frontend-assets.d.ts +100 -0
  144. package/dist/server/core/plugin-host/frontend-assets.js +262 -0
  145. package/dist/server/core/plugin-host/frontend-assets.js.map +1 -0
  146. package/dist/server/core/plugin-host/frontend-manifest.d.ts +33 -0
  147. package/dist/server/core/plugin-host/frontend-manifest.js +52 -0
  148. package/dist/server/core/plugin-host/frontend-manifest.js.map +1 -0
  149. package/dist/server/core/plugin-host/loader.d.ts +107 -0
  150. package/dist/server/core/plugin-host/loader.js +196 -0
  151. package/dist/server/core/plugin-host/loader.js.map +1 -0
  152. package/dist/server/core/plugin-host/manifest-adapter.d.ts +30 -0
  153. package/dist/server/core/plugin-host/manifest-adapter.js +119 -0
  154. package/dist/server/core/plugin-host/manifest-adapter.js.map +1 -0
  155. package/dist/server/core/plugin-host/overlay-loader.d.ts +60 -0
  156. package/dist/server/core/plugin-host/overlay-loader.js +243 -0
  157. package/dist/server/core/plugin-host/overlay-loader.js.map +1 -0
  158. package/dist/server/core/plugin-host/plugin-watcher.d.ts +41 -0
  159. package/dist/server/core/plugin-host/plugin-watcher.js +95 -0
  160. package/dist/server/core/plugin-host/plugin-watcher.js.map +1 -0
  161. package/dist/server/core/plugin-host/project-host.d.ts +8 -2
  162. package/dist/server/core/plugin-host/project-host.js +56 -6
  163. package/dist/server/core/plugin-host/project-host.js.map +1 -1
  164. package/dist/server/core/plugin-host/registry.d.ts +26 -2
  165. package/dist/server/core/plugin-host/registry.js +107 -2
  166. package/dist/server/core/plugin-host/registry.js.map +1 -1
  167. package/dist/server/core/plugin-host/runtime-shims.d.ts +26 -0
  168. package/dist/server/core/plugin-host/runtime-shims.js +96 -0
  169. package/dist/server/core/plugin-host/runtime-shims.js.map +1 -0
  170. package/dist/server/core/plugin-host/types.d.ts +105 -3
  171. package/dist/server/db/migrations/041_chat_thread_transagent.sql +22 -0
  172. package/dist/server/db/migrations/042_chat_thread_drop_context_type_check.sql +61 -0
  173. package/dist/server/external-skills/brief-implementer-template.d.ts +1 -1
  174. package/dist/server/external-skills/brief-implementer-template.js +5 -2
  175. package/dist/server/external-skills/brief-implementer-template.js.map +1 -1
  176. package/dist/server/external-skills/spec-reader-template.d.ts +1 -1
  177. package/dist/server/external-skills/spec-reader-template.js +14 -0
  178. package/dist/server/external-skills/spec-reader-template.js.map +1 -1
  179. package/dist/server/index.js +98 -1
  180. package/dist/server/index.js.map +1 -1
  181. package/dist/server/mcp/c4s-tools.d.ts +6 -1
  182. package/dist/server/mcp/c4s-tools.js +18 -13
  183. package/dist/server/mcp/c4s-tools.js.map +1 -1
  184. package/dist/server/mcp/release-tools/index.d.ts +11 -0
  185. package/dist/server/mcp/release-tools/index.js +68 -5
  186. package/dist/server/mcp/release-tools/index.js.map +1 -1
  187. package/dist/server/mcp/release-tools/projection.d.ts +11 -2
  188. package/dist/server/mcp/release-tools/projection.js +36 -7
  189. package/dist/server/mcp/release-tools/projection.js.map +1 -1
  190. package/dist/server/mcp/release-tools/types.d.ts +39 -2
  191. package/dist/server/mcp/transagent-tools.d.ts +26 -0
  192. package/dist/server/mcp/transagent-tools.js +75 -0
  193. package/dist/server/mcp/transagent-tools.js.map +1 -0
  194. package/dist/server/plugin-runtime/index.d.ts +17 -0
  195. package/dist/server/plugin-runtime/index.js +16 -0
  196. package/dist/server/plugin-runtime/index.js.map +1 -0
  197. package/dist/server/plugin-runtime/ui.d.ts +15 -0
  198. package/dist/server/plugin-runtime/ui.js +15 -0
  199. package/dist/server/plugin-runtime/ui.js.map +1 -0
  200. package/dist/server/routes/agent-turn.d.ts +17 -1
  201. package/dist/server/routes/agent-turn.js +121 -36
  202. package/dist/server/routes/agent-turn.js.map +1 -1
  203. package/dist/server/routes/briefs.js +12 -4
  204. package/dist/server/routes/briefs.js.map +1 -1
  205. package/dist/server/routes/chat.js +18 -0
  206. package/dist/server/routes/chat.js.map +1 -1
  207. package/dist/server/routes/config.d.ts +8 -0
  208. package/dist/server/routes/config.js +41 -3
  209. package/dist/server/routes/config.js.map +1 -1
  210. package/dist/server/routes/plans.js +13 -0
  211. package/dist/server/routes/plans.js.map +1 -1
  212. package/dist/server/routes/plugins.d.ts +43 -0
  213. package/dist/server/routes/plugins.js +93 -0
  214. package/dist/server/routes/plugins.js.map +1 -0
  215. package/dist/server/routes/threads.js +30 -5
  216. package/dist/server/routes/threads.js.map +1 -1
  217. package/dist/server/serialization/registerAll.d.ts +4 -0
  218. package/dist/server/serialization/registerAll.js +4 -2
  219. package/dist/server/serialization/registerAll.js.map +1 -1
  220. package/dist/server/services/brief.d.ts +30 -8
  221. package/dist/server/services/brief.js +58 -28
  222. package/dist/server/services/brief.js.map +1 -1
  223. package/dist/server/services/chat-context.d.ts +34 -0
  224. package/dist/server/services/chat-context.js +68 -21
  225. package/dist/server/services/chat-context.js.map +1 -1
  226. package/dist/server/services/chat.d.ts +18 -1
  227. package/dist/server/services/chat.js +74 -23
  228. package/dist/server/services/chat.js.map +1 -1
  229. package/dist/server/services/entity-indexer.js +21 -14
  230. package/dist/server/services/entity-indexer.js.map +1 -1
  231. package/dist/server/services/entity-writer.d.ts +2 -3
  232. package/dist/server/services/entity-writer.js.map +1 -1
  233. package/dist/server/services/plan.d.ts +7 -1
  234. package/dist/server/services/plan.js +17 -4
  235. package/dist/server/services/plan.js.map +1 -1
  236. package/dist/server/services/skill-registry.d.ts +31 -2
  237. package/dist/server/services/skill-registry.js +73 -1
  238. package/dist/server/services/skill-registry.js.map +1 -1
  239. package/dist/server/services/transagent-dispatcher.d.ts +60 -0
  240. package/dist/server/services/transagent-dispatcher.js +147 -0
  241. package/dist/server/services/transagent-dispatcher.js.map +1 -0
  242. package/dist/server/skills/brief-author/SKILL.md +26 -17
  243. package/dist/server/workspace/context-cache.d.ts +9 -0
  244. package/dist/server/workspace/context-cache.js +14 -0
  245. package/dist/server/workspace/context-cache.js.map +1 -1
  246. package/dist/server/workspace/project-context.d.ts +3 -0
  247. package/dist/server/workspace/project-context.js +108 -5
  248. package/dist/server/workspace/project-context.js.map +1 -1
  249. package/dist/server/workspace/registry.d.ts +28 -1
  250. package/dist/server/workspace/registry.js +57 -1
  251. package/dist/server/workspace/registry.js.map +1 -1
  252. package/dist/server/workspace/types.d.ts +15 -0
  253. package/dist/shared/entities.d.ts +50 -4
  254. package/dist/shared/entities.js +1 -0
  255. package/dist/shared/entities.js.map +1 -1
  256. package/dist/shared/plugin-host/frontend-manifest.d.ts +56 -0
  257. package/dist/shared/plugin-host/frontend-manifest.js +89 -0
  258. package/dist/shared/plugin-host/frontend-manifest.js.map +1 -0
  259. package/dist/shared/plugin-host/host-api.d.ts +60 -0
  260. package/dist/shared/plugin-host/host-api.js +67 -0
  261. package/dist/shared/plugin-host/host-api.js.map +1 -0
  262. package/dist/shared/plugin-host/manifest.d.ts +194 -0
  263. package/dist/shared/plugin-host/manifest.js +52 -0
  264. package/dist/shared/plugin-host/manifest.js.map +1 -0
  265. package/dist/shared/plugin-host/ui-kit-surface.d.ts +22 -0
  266. package/dist/shared/plugin-host/ui-kit-surface.js +25 -0
  267. package/dist/shared/plugin-host/ui-kit-surface.js.map +1 -0
  268. package/dist/shared/types.d.ts +5 -0
  269. package/package.json +18 -3
  270. package/dist/client/assets/channel-CTF_J4I4.js +0 -1
  271. package/dist/client/assets/classDiagram-4FO5ZUOK-Dt9RLC8r.js +0 -1
  272. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-Dt9RLC8r.js +0 -1
  273. package/dist/client/assets/index-DnLELaLA.js +0 -798
  274. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-BblFLijq.js +0 -1
@@ -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.20",
3
+ "version": "1.0.22",
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-CMX3GAvM.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-BpxYq7ab.js";import{_ as i}from"./mermaid.core-CMX3GAvM.js";import"./chunk-FMBD7UC4-4sXokGgd.js";import"./chunk-ND2GUHAM-DYQOCE5T.js";import"./chunk-55IACEB6-CeHg_yjT.js";import"./chunk-2J33WTMH-ChycTonk.js";import"./index-DnLELaLA.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-BpxYq7ab.js";import{_ as i}from"./mermaid.core-CMX3GAvM.js";import"./chunk-FMBD7UC4-4sXokGgd.js";import"./chunk-ND2GUHAM-DYQOCE5T.js";import"./chunk-55IACEB6-CeHg_yjT.js";import"./chunk-2J33WTMH-ChycTonk.js";import"./index-DnLELaLA.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};