@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217083314 → 0.0.0-canary-20251220002821

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 (510) hide show
  1. package/LICENSE +21 -0
  2. package/dist/adapters/ai.d.ts +7 -8
  3. package/dist/adapters/ai.d.ts.map +1 -0
  4. package/dist/adapters/factory.d.ts +20 -21
  5. package/dist/adapters/factory.d.ts.map +1 -0
  6. package/dist/adapters/fs.d.ts +6 -7
  7. package/dist/adapters/fs.d.ts.map +1 -0
  8. package/dist/adapters/git.d.ts +6 -7
  9. package/dist/adapters/git.d.ts.map +1 -0
  10. package/dist/adapters/index.d.ts +11 -0
  11. package/dist/adapters/index.d.ts.map +1 -0
  12. package/dist/adapters/logger.d.ts +9 -8
  13. package/dist/adapters/logger.d.ts.map +1 -0
  14. package/dist/adapters/watcher.d.ts +6 -7
  15. package/dist/adapters/watcher.d.ts.map +1 -0
  16. package/dist/adapters/workspace.d.ts +37 -39
  17. package/dist/adapters/workspace.d.ts.map +1 -0
  18. package/dist/ai/agents/claude-code-agent.d.ts +20 -20
  19. package/dist/ai/agents/claude-code-agent.d.ts.map +1 -0
  20. package/dist/ai/agents/cursor-agent.d.ts +66 -66
  21. package/dist/ai/agents/cursor-agent.d.ts.map +1 -0
  22. package/dist/ai/agents/index.d.ts +10 -0
  23. package/dist/ai/agents/index.d.ts.map +1 -0
  24. package/dist/ai/agents/openai-codex-agent.d.ts +20 -20
  25. package/dist/ai/agents/openai-codex-agent.d.ts.map +1 -0
  26. package/dist/ai/agents/orchestrator.d.ts +48 -48
  27. package/dist/ai/agents/orchestrator.d.ts.map +1 -0
  28. package/dist/ai/agents/simple-agent.d.ts +15 -15
  29. package/dist/ai/agents/simple-agent.d.ts.map +1 -0
  30. package/dist/ai/agents/types.d.ts +26 -28
  31. package/dist/ai/agents/types.d.ts.map +1 -0
  32. package/dist/ai/client.d.ts +74 -78
  33. package/dist/ai/client.d.ts.map +1 -0
  34. package/dist/ai/index.d.ts +8 -16
  35. package/dist/ai/index.d.ts.map +1 -0
  36. package/dist/ai/prompts/code-generation.d.ts +6 -10
  37. package/dist/ai/prompts/code-generation.d.ts.map +1 -0
  38. package/dist/ai/prompts/index.d.ts +6 -9
  39. package/dist/ai/prompts/index.d.ts.map +1 -0
  40. package/dist/ai/prompts/spec-creation.d.ts +7 -13
  41. package/dist/ai/prompts/spec-creation.d.ts.map +1 -0
  42. package/dist/ai/providers.d.ts +13 -12
  43. package/dist/ai/providers.d.ts.map +1 -0
  44. package/dist/formatters/index.d.ts +7 -10
  45. package/dist/formatters/index.d.ts.map +1 -0
  46. package/dist/formatters/json.d.ts +65 -63
  47. package/dist/formatters/json.d.ts.map +1 -0
  48. package/dist/formatters/sarif.d.ts +77 -72
  49. package/dist/formatters/sarif.d.ts.map +1 -0
  50. package/dist/formatters/text.d.ts +21 -19
  51. package/dist/formatters/text.d.ts.map +1 -0
  52. package/dist/index.d.ts +14 -66
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +4532 -81
  55. package/dist/ports/ai.d.ts +41 -38
  56. package/dist/ports/ai.d.ts.map +1 -0
  57. package/dist/ports/fs.d.ts +63 -65
  58. package/dist/ports/fs.d.ts.map +1 -0
  59. package/dist/ports/git.d.ts +19 -21
  60. package/dist/ports/git.d.ts.map +1 -0
  61. package/dist/ports/index.d.ts +10 -0
  62. package/dist/ports/index.d.ts.map +1 -0
  63. package/dist/ports/logger.d.ts +58 -65
  64. package/dist/ports/logger.d.ts.map +1 -0
  65. package/dist/ports/watcher.d.ts +24 -26
  66. package/dist/ports/watcher.d.ts.map +1 -0
  67. package/dist/services/agent-guide/adapters/claude-code.d.ts +30 -28
  68. package/dist/services/agent-guide/adapters/claude-code.d.ts.map +1 -0
  69. package/dist/services/agent-guide/adapters/cursor-cli.d.ts +34 -32
  70. package/dist/services/agent-guide/adapters/cursor-cli.d.ts.map +1 -0
  71. package/dist/services/agent-guide/adapters/generic-mcp.d.ts +47 -45
  72. package/dist/services/agent-guide/adapters/generic-mcp.d.ts.map +1 -0
  73. package/dist/services/agent-guide/adapters/index.d.ts +15 -13
  74. package/dist/services/agent-guide/adapters/index.d.ts.map +1 -0
  75. package/dist/services/agent-guide/agent-guide-service.d.ts +48 -45
  76. package/dist/services/agent-guide/agent-guide-service.d.ts.map +1 -0
  77. package/dist/services/agent-guide/index.d.ts +12 -0
  78. package/dist/services/agent-guide/index.d.ts.map +1 -0
  79. package/dist/services/agent-guide/types.d.ts +46 -47
  80. package/dist/services/agent-guide/types.d.ts.map +1 -0
  81. package/dist/services/build.d.ts +41 -39
  82. package/dist/services/build.d.ts.map +1 -0
  83. package/dist/services/ci-check/ci-check-service.d.ts +13 -11
  84. package/dist/services/ci-check/ci-check-service.d.ts.map +1 -0
  85. package/dist/services/ci-check/index.d.ts +6 -0
  86. package/dist/services/ci-check/index.d.ts.map +1 -0
  87. package/dist/services/ci-check/types.d.ts +100 -102
  88. package/dist/services/ci-check/types.d.ts.map +1 -0
  89. package/dist/services/clean.d.ts +38 -37
  90. package/dist/services/clean.d.ts.map +1 -0
  91. package/dist/services/config.d.ts +14 -15
  92. package/dist/services/config.d.ts.map +1 -0
  93. package/dist/services/deps.d.ts +29 -30
  94. package/dist/services/deps.d.ts.map +1 -0
  95. package/dist/services/diff.d.ts +20 -21
  96. package/dist/services/diff.d.ts.map +1 -0
  97. package/dist/services/doctor/checks/ai.d.ts +10 -0
  98. package/dist/services/doctor/checks/ai.d.ts.map +1 -0
  99. package/dist/services/doctor/checks/cli.d.ts +10 -0
  100. package/dist/services/doctor/checks/cli.d.ts.map +1 -0
  101. package/dist/services/doctor/checks/config.d.ts +10 -0
  102. package/dist/services/doctor/checks/config.d.ts.map +1 -0
  103. package/dist/services/doctor/checks/deps.d.ts +10 -0
  104. package/dist/services/doctor/checks/deps.d.ts.map +1 -0
  105. package/dist/services/doctor/checks/index.d.ts +10 -0
  106. package/dist/services/doctor/checks/index.d.ts.map +1 -0
  107. package/dist/services/doctor/checks/mcp.d.ts +10 -0
  108. package/dist/services/doctor/checks/mcp.d.ts.map +1 -0
  109. package/dist/services/doctor/checks/workspace.d.ts +12 -0
  110. package/dist/services/doctor/checks/workspace.d.ts.map +1 -0
  111. package/dist/services/doctor/doctor-service.d.ts +14 -13
  112. package/dist/services/doctor/doctor-service.d.ts.map +1 -0
  113. package/dist/services/doctor/index.d.ts +8 -0
  114. package/dist/services/doctor/index.d.ts.map +1 -0
  115. package/dist/services/doctor/types.d.ts +70 -72
  116. package/dist/services/doctor/types.d.ts.map +1 -0
  117. package/dist/services/implementation/discovery.d.ts +16 -14
  118. package/dist/services/implementation/discovery.d.ts.map +1 -0
  119. package/dist/services/implementation/index.d.ts +7 -0
  120. package/dist/services/implementation/index.d.ts.map +1 -0
  121. package/dist/services/implementation/resolver.d.ts +31 -27
  122. package/dist/services/implementation/resolver.d.ts.map +1 -0
  123. package/dist/services/implementation/types.d.ts +55 -56
  124. package/dist/services/implementation/types.d.ts.map +1 -0
  125. package/dist/services/index.d.ts +29 -0
  126. package/dist/services/index.d.ts.map +1 -0
  127. package/dist/services/integrity-diagram.d.ts +29 -25
  128. package/dist/services/integrity-diagram.d.ts.map +1 -0
  129. package/dist/services/integrity.d.ts +100 -96
  130. package/dist/services/integrity.d.ts.map +1 -0
  131. package/dist/services/list.d.ts +18 -19
  132. package/dist/services/list.d.ts.map +1 -0
  133. package/dist/services/openapi/export-service.d.ts +39 -40
  134. package/dist/services/openapi/export-service.d.ts.map +1 -0
  135. package/dist/services/openapi/import-service.d.ts +10 -11
  136. package/dist/services/openapi/import-service.d.ts.map +1 -0
  137. package/dist/services/openapi/index.d.ts +10 -0
  138. package/dist/services/openapi/index.d.ts.map +1 -0
  139. package/dist/services/openapi/sync-service.d.ts +12 -13
  140. package/dist/services/openapi/sync-service.d.ts.map +1 -0
  141. package/dist/services/openapi/types.d.ts +141 -143
  142. package/dist/services/openapi/types.d.ts.map +1 -0
  143. package/dist/services/openapi/validate-service.d.ts +10 -11
  144. package/dist/services/openapi/validate-service.d.ts.map +1 -0
  145. package/dist/services/quickstart/dependencies.d.ts +32 -0
  146. package/dist/services/quickstart/dependencies.d.ts.map +1 -0
  147. package/dist/services/quickstart/index.d.ts +10 -0
  148. package/dist/services/quickstart/index.d.ts.map +1 -0
  149. package/dist/services/quickstart/quickstart-service.d.ts +21 -0
  150. package/dist/services/quickstart/quickstart-service.d.ts.map +1 -0
  151. package/dist/services/quickstart/types.d.ts +78 -0
  152. package/dist/services/quickstart/types.d.ts.map +1 -0
  153. package/dist/services/regenerator.d.ts +18 -16
  154. package/dist/services/regenerator.d.ts.map +1 -0
  155. package/dist/services/registry.d.ts +25 -26
  156. package/dist/services/registry.d.ts.map +1 -0
  157. package/dist/services/setup/config-generators.d.ts +14 -13
  158. package/dist/services/setup/config-generators.d.ts.map +1 -0
  159. package/dist/services/setup/file-merger.d.ts +5 -7
  160. package/dist/services/setup/file-merger.d.ts.map +1 -0
  161. package/dist/services/setup/index.d.ts +10 -0
  162. package/dist/services/setup/index.d.ts.map +1 -0
  163. package/dist/services/setup/setup-service.d.ts +10 -8
  164. package/dist/services/setup/setup-service.d.ts.map +1 -0
  165. package/dist/services/setup/targets/agents-md.d.ts +12 -0
  166. package/dist/services/setup/targets/agents-md.d.ts.map +1 -0
  167. package/dist/services/setup/targets/cli-config.d.ts +12 -0
  168. package/dist/services/setup/targets/cli-config.d.ts.map +1 -0
  169. package/dist/services/setup/targets/cursor-rules.d.ts +10 -0
  170. package/dist/services/setup/targets/cursor-rules.d.ts.map +1 -0
  171. package/dist/services/setup/targets/index.d.ts +10 -0
  172. package/dist/services/setup/targets/index.d.ts.map +1 -0
  173. package/dist/services/setup/targets/mcp-claude.d.ts +11 -0
  174. package/dist/services/setup/targets/mcp-claude.d.ts.map +1 -0
  175. package/dist/services/setup/targets/mcp-cursor.d.ts +10 -0
  176. package/dist/services/setup/targets/mcp-cursor.d.ts.map +1 -0
  177. package/dist/services/setup/targets/vscode-settings.d.ts +13 -0
  178. package/dist/services/setup/targets/vscode-settings.d.ts.map +1 -0
  179. package/dist/services/setup/types.d.ts +51 -53
  180. package/dist/services/setup/types.d.ts.map +1 -0
  181. package/dist/services/sync.d.ts +37 -35
  182. package/dist/services/sync.d.ts.map +1 -0
  183. package/dist/services/test.d.ts +15 -13
  184. package/dist/services/test.d.ts.map +1 -0
  185. package/dist/services/validate-implementation.d.ts +30 -28
  186. package/dist/services/validate-implementation.d.ts.map +1 -0
  187. package/dist/services/validate.d.ts +23 -24
  188. package/dist/services/validate.d.ts.map +1 -0
  189. package/dist/services/verification-cache/adapters/filesystem.d.ts +40 -38
  190. package/dist/services/verification-cache/adapters/filesystem.d.ts.map +1 -0
  191. package/dist/services/verification-cache/adapters/in-memory.d.ts +21 -19
  192. package/dist/services/verification-cache/adapters/in-memory.d.ts.map +1 -0
  193. package/dist/services/verification-cache/adapters/index.d.ts +7 -0
  194. package/dist/services/verification-cache/adapters/index.d.ts.map +1 -0
  195. package/dist/services/verification-cache/adapters/workspace-state.d.ts +39 -37
  196. package/dist/services/verification-cache/adapters/workspace-state.d.ts.map +1 -0
  197. package/dist/services/verification-cache/cache-service.d.ts +55 -53
  198. package/dist/services/verification-cache/cache-service.d.ts.map +1 -0
  199. package/dist/services/verification-cache/index.d.ts +7 -0
  200. package/dist/services/verification-cache/index.d.ts.map +1 -0
  201. package/dist/services/verification-cache/types.d.ts +84 -85
  202. package/dist/services/verification-cache/types.d.ts.map +1 -0
  203. package/dist/services/verify/ai-verifier.d.ts +13 -11
  204. package/dist/services/verify/ai-verifier.d.ts.map +1 -0
  205. package/dist/services/verify/behavior-verifier.d.ts +10 -8
  206. package/dist/services/verify/behavior-verifier.d.ts.map +1 -0
  207. package/dist/services/verify/index.d.ts +18 -0
  208. package/dist/services/verify/index.d.ts.map +1 -0
  209. package/dist/services/verify/structure-verifier.d.ts +12 -8
  210. package/dist/services/verify/structure-verifier.d.ts.map +1 -0
  211. package/dist/services/verify/types.d.ts +114 -115
  212. package/dist/services/verify/types.d.ts.map +1 -0
  213. package/dist/services/verify/verify-service.d.ts +51 -49
  214. package/dist/services/verify/verify-service.d.ts.map +1 -0
  215. package/dist/services/watch.d.ts +22 -21
  216. package/dist/services/watch.d.ts.map +1 -0
  217. package/dist/services/workspace-info.d.ts +40 -37
  218. package/dist/services/workspace-info.d.ts.map +1 -0
  219. package/dist/templates/app-config.template.d.ts +3 -6
  220. package/dist/templates/app-config.template.d.ts.map +1 -0
  221. package/dist/templates/data-view.template.d.ts +3 -6
  222. package/dist/templates/data-view.template.d.ts.map +1 -0
  223. package/dist/templates/event.template.d.ts +3 -7
  224. package/dist/templates/event.template.d.ts.map +1 -0
  225. package/dist/templates/experiment.template.d.ts +3 -6
  226. package/dist/templates/experiment.template.d.ts.map +1 -0
  227. package/dist/templates/handler.template.d.ts +4 -6
  228. package/dist/templates/handler.template.d.ts.map +1 -0
  229. package/dist/templates/index.d.ts +17 -20
  230. package/dist/templates/index.d.ts.map +1 -0
  231. package/dist/templates/integration.template.d.ts +3 -6
  232. package/dist/templates/integration.template.d.ts.map +1 -0
  233. package/dist/templates/knowledge.template.d.ts +3 -6
  234. package/dist/templates/knowledge.template.d.ts.map +1 -0
  235. package/dist/templates/migration.template.d.ts +3 -6
  236. package/dist/templates/migration.template.d.ts.map +1 -0
  237. package/dist/templates/operation.template.d.ts +3 -7
  238. package/dist/templates/operation.template.d.ts.map +1 -0
  239. package/dist/templates/operation.template.test.d.ts +2 -0
  240. package/dist/templates/operation.template.test.d.ts.map +1 -0
  241. package/dist/templates/presentation.template.d.ts +3 -7
  242. package/dist/templates/presentation.template.d.ts.map +1 -0
  243. package/dist/templates/telemetry.template.d.ts +3 -6
  244. package/dist/templates/telemetry.template.d.ts.map +1 -0
  245. package/dist/templates/workflow-runner.template.d.ts +7 -13
  246. package/dist/templates/workflow-runner.template.d.ts.map +1 -0
  247. package/dist/templates/workflow.template.d.ts +3 -6
  248. package/dist/templates/workflow.template.d.ts.map +1 -0
  249. package/dist/types/config.d.ts +18 -20
  250. package/dist/types/config.d.ts.map +1 -0
  251. package/dist/types/index.d.ts +5 -0
  252. package/dist/types/index.d.ts.map +1 -0
  253. package/dist/types.d.ts +338 -311
  254. package/dist/types.d.ts.map +1 -0
  255. package/package.json +22 -15
  256. package/dist/_virtual/rolldown_runtime.js +0 -22
  257. package/dist/adapters/ai.js +0 -82
  258. package/dist/adapters/factory.js +0 -36
  259. package/dist/adapters/fs.js +0 -118
  260. package/dist/adapters/git.js +0 -54
  261. package/dist/adapters/index.js +0 -7
  262. package/dist/adapters/logger.js +0 -80
  263. package/dist/adapters/watcher.js +0 -69
  264. package/dist/adapters/workspace.js +0 -190
  265. package/dist/ai/agents/claude-code-agent.js +0 -181
  266. package/dist/ai/agents/cursor-agent.js +0 -437
  267. package/dist/ai/agents/index.js +0 -5
  268. package/dist/ai/agents/openai-codex-agent.js +0 -166
  269. package/dist/ai/agents/orchestrator.js +0 -142
  270. package/dist/ai/agents/simple-agent.js +0 -91
  271. package/dist/ai/client.js +0 -162
  272. package/dist/ai/index.js +0 -27
  273. package/dist/ai/prompts/code-generation.js +0 -142
  274. package/dist/ai/prompts/index.js +0 -12
  275. package/dist/ai/prompts/spec-creation.js +0 -110
  276. package/dist/ai/providers.js +0 -40
  277. package/dist/formatters/index.js +0 -18
  278. package/dist/formatters/json.js +0 -71
  279. package/dist/formatters/sarif.js +0 -163
  280. package/dist/formatters/text.js +0 -208
  281. package/dist/libs/ai-providers/dist/factory.js +0 -154
  282. package/dist/libs/ai-providers/dist/index.js +0 -4
  283. package/dist/libs/ai-providers/dist/legacy.js +0 -72
  284. package/dist/libs/ai-providers/dist/models.js +0 -287
  285. package/dist/libs/ai-providers/dist/validation.js +0 -1
  286. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
  287. package/dist/libs/contracts/dist/client/index.js +0 -5
  288. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
  289. package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
  290. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  291. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  292. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
  293. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  294. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  295. package/dist/libs/contracts/dist/docs/index.js +0 -29
  296. package/dist/libs/contracts/dist/docs/presentations.js +0 -71
  297. package/dist/libs/contracts/dist/docs/registry.js +0 -44
  298. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  299. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  300. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  301. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  302. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  303. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  304. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  305. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  306. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  307. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  308. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  309. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  310. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  311. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  312. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  313. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  314. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  315. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  316. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  317. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  318. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  319. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  320. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  321. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  322. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  323. package/dist/libs/contracts/dist/events.js +0 -8
  324. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  325. package/dist/libs/contracts/dist/index.js +0 -72
  326. package/dist/libs/contracts/dist/install.js +0 -2
  327. package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
  328. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  329. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  330. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  331. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  332. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  333. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
  334. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  335. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  336. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  337. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
  338. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
  339. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  340. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
  341. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
  342. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
  343. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
  344. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  345. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
  346. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  347. package/dist/libs/contracts/dist/jsonschema.js +0 -24
  348. package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
  349. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  350. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  351. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  352. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  353. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  354. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  355. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  356. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  357. package/dist/libs/contracts/dist/llm/exporters.js +0 -352
  358. package/dist/libs/contracts/dist/llm/index.js +0 -2
  359. package/dist/libs/contracts/dist/llm/prompts.js +0 -211
  360. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  361. package/dist/libs/contracts/dist/openapi.js +0 -75
  362. package/dist/libs/contracts/dist/ownership.js +0 -21
  363. package/dist/libs/contracts/dist/presentations.js +0 -1
  364. package/dist/libs/contracts/dist/presentations.v2.js +0 -11
  365. package/dist/libs/contracts/dist/prompt.js +0 -1
  366. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  367. package/dist/libs/contracts/dist/regenerator/index.js +0 -2
  368. package/dist/libs/contracts/dist/regenerator/service.js +0 -92
  369. package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
  370. package/dist/libs/contracts/dist/registry.js +0 -208
  371. package/dist/libs/contracts/dist/resources.js +0 -1
  372. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  373. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  374. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  375. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
  376. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  377. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  378. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  379. package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
  380. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  381. package/dist/libs/contracts/dist/server/index.js +0 -8
  382. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  383. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
  384. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  385. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  386. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  387. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  388. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  389. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  390. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  391. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  392. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  393. package/dist/libs/contracts/dist/spec.js +0 -35
  394. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  395. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  396. package/dist/libs/contracts/dist/tests/index.js +0 -1
  397. package/dist/libs/contracts/dist/tests/runner.js +0 -150
  398. package/dist/libs/contracts/dist/workflow/index.js +0 -1
  399. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  400. package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
  401. package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
  402. package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
  403. package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
  404. package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
  405. package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
  406. package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
  407. package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
  408. package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
  409. package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
  410. package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
  411. package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
  412. package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
  413. package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
  414. package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
  415. package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
  416. package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
  417. package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
  418. package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
  419. package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
  420. package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
  421. package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
  422. package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
  423. package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
  424. package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
  425. package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
  426. package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
  427. package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
  428. package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
  429. package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
  430. package/dist/services/agent-guide/adapters/claude-code.js +0 -144
  431. package/dist/services/agent-guide/adapters/cursor-cli.js +0 -135
  432. package/dist/services/agent-guide/adapters/generic-mcp.js +0 -159
  433. package/dist/services/agent-guide/adapters/index.js +0 -30
  434. package/dist/services/agent-guide/agent-guide-service.js +0 -148
  435. package/dist/services/agent-guide/index.js +0 -5
  436. package/dist/services/build.js +0 -140
  437. package/dist/services/ci-check/ci-check-service.js +0 -393
  438. package/dist/services/ci-check/index.js +0 -2
  439. package/dist/services/ci-check/types.js +0 -28
  440. package/dist/services/clean.js +0 -71
  441. package/dist/services/config.js +0 -76
  442. package/dist/services/deps.js +0 -62
  443. package/dist/services/diff.js +0 -33
  444. package/dist/services/doctor/checks/ai.js +0 -118
  445. package/dist/services/doctor/checks/cli.js +0 -146
  446. package/dist/services/doctor/checks/config.js +0 -170
  447. package/dist/services/doctor/checks/deps.js +0 -180
  448. package/dist/services/doctor/checks/index.js +0 -6
  449. package/dist/services/doctor/checks/mcp.js +0 -144
  450. package/dist/services/doctor/checks/workspace.js +0 -243
  451. package/dist/services/doctor/doctor-service.js +0 -115
  452. package/dist/services/doctor/index.js +0 -2
  453. package/dist/services/doctor/types.js +0 -26
  454. package/dist/services/implementation/discovery.js +0 -143
  455. package/dist/services/implementation/index.js +0 -2
  456. package/dist/services/implementation/resolver.js +0 -223
  457. package/dist/services/index.js +0 -53
  458. package/dist/services/integrity-diagram.js +0 -274
  459. package/dist/services/integrity.js +0 -272
  460. package/dist/services/list.js +0 -35
  461. package/dist/services/openapi/export-service.js +0 -51
  462. package/dist/services/openapi/import-service.js +0 -75
  463. package/dist/services/openapi/index.js +0 -4
  464. package/dist/services/openapi/sync-service.js +0 -121
  465. package/dist/services/openapi/validate-service.js +0 -130
  466. package/dist/services/regenerator.js +0 -23
  467. package/dist/services/registry.js +0 -73
  468. package/dist/services/setup/config-generators.js +0 -237
  469. package/dist/services/setup/file-merger.js +0 -60
  470. package/dist/services/setup/index.js +0 -4
  471. package/dist/services/setup/setup-service.js +0 -95
  472. package/dist/services/setup/targets/agents-md.js +0 -46
  473. package/dist/services/setup/targets/cli-config.js +0 -59
  474. package/dist/services/setup/targets/cursor-rules.js +0 -47
  475. package/dist/services/setup/targets/mcp-claude.js +0 -59
  476. package/dist/services/setup/targets/mcp-cursor.js +0 -58
  477. package/dist/services/setup/targets/vscode-settings.js +0 -62
  478. package/dist/services/setup/types.js +0 -26
  479. package/dist/services/sync.js +0 -62
  480. package/dist/services/test.js +0 -30
  481. package/dist/services/validate-implementation.js +0 -69
  482. package/dist/services/validate.js +0 -47
  483. package/dist/services/verification-cache/adapters/filesystem.js +0 -121
  484. package/dist/services/verification-cache/adapters/in-memory.js +0 -45
  485. package/dist/services/verification-cache/adapters/index.js +0 -3
  486. package/dist/services/verification-cache/adapters/workspace-state.js +0 -90
  487. package/dist/services/verification-cache/cache-service.js +0 -255
  488. package/dist/services/verification-cache/index.js +0 -6
  489. package/dist/services/verification-cache/types.js +0 -15
  490. package/dist/services/verify/ai-verifier.js +0 -403
  491. package/dist/services/verify/behavior-verifier.js +0 -185
  492. package/dist/services/verify/index.js +0 -4
  493. package/dist/services/verify/structure-verifier.js +0 -195
  494. package/dist/services/verify/verify-service.js +0 -203
  495. package/dist/services/watch.js +0 -31
  496. package/dist/services/workspace-info.js +0 -102
  497. package/dist/templates/app-config.template.js +0 -106
  498. package/dist/templates/data-view.template.js +0 -69
  499. package/dist/templates/event.template.js +0 -39
  500. package/dist/templates/experiment.template.js +0 -88
  501. package/dist/templates/handler.template.js +0 -99
  502. package/dist/templates/index.js +0 -36
  503. package/dist/templates/integration.template.js +0 -159
  504. package/dist/templates/knowledge.template.js +0 -74
  505. package/dist/templates/migration.template.js +0 -61
  506. package/dist/templates/operation.template.js +0 -104
  507. package/dist/templates/presentation.template.js +0 -79
  508. package/dist/templates/telemetry.template.js +0 -90
  509. package/dist/templates/workflow-runner.template.js +0 -49
  510. package/dist/templates/workflow.template.js +0 -68
@@ -1,352 +0,0 @@
1
- import { jsonSchemaForSpec } from "../jsonschema.js";
2
- import { isEmitDeclRef } from "../spec.js";
3
-
4
- //#region ../../libs/contracts/dist/llm/exporters.js
5
- const DEFAULT_SPEC_OPTIONS = {
6
- format: "full",
7
- includeSchemas: true,
8
- includeScenarios: true,
9
- includeExamples: true,
10
- includePolicy: true,
11
- includeSideEffects: true
12
- };
13
- const DEFAULT_FEATURE_OPTIONS = {
14
- ...DEFAULT_SPEC_OPTIONS,
15
- includeRelatedSpecs: true,
16
- includeRelatedEvents: true,
17
- includeRelatedPresentations: true
18
- };
19
- /**
20
- * Export a single spec to full markdown with all details.
21
- * Includes: all fields, I/O schemas, policy, events, examples.
22
- * Best for: Complete documentation, implementation reference.
23
- */
24
- function specToFullMarkdown(spec, options = {}) {
25
- const opts = {
26
- ...DEFAULT_SPEC_OPTIONS,
27
- ...options
28
- };
29
- const m = spec.meta;
30
- const lines = [];
31
- lines.push(`# ${m.name}.v${m.version}`);
32
- lines.push("");
33
- lines.push(`> ${m.description}`);
34
- lines.push("");
35
- lines.push("## Metadata");
36
- lines.push("");
37
- lines.push("| Field | Value |");
38
- lines.push("|-------|-------|");
39
- lines.push(`| Kind | ${m.kind} |`);
40
- lines.push(`| Stability | ${m.stability} |`);
41
- lines.push(`| Owners | ${m.owners.join(", ")} |`);
42
- lines.push(`| Tags | ${m.tags.join(", ")} |`);
43
- lines.push("");
44
- lines.push("## Goal");
45
- lines.push("");
46
- lines.push(m.goal);
47
- lines.push("");
48
- lines.push("## Context");
49
- lines.push("");
50
- lines.push(m.context);
51
- lines.push("");
52
- if (opts.includeSchemas) {
53
- lines.push("## Input/Output");
54
- lines.push("");
55
- if (spec.io.input) {
56
- lines.push("### Input Schema");
57
- lines.push("");
58
- lines.push("```json");
59
- try {
60
- const schema = jsonSchemaForSpec(spec);
61
- lines.push(JSON.stringify(schema.input ?? {}, null, 2));
62
- } catch {
63
- lines.push("// Schema generation not available");
64
- }
65
- lines.push("```");
66
- lines.push("");
67
- }
68
- lines.push("### Output Schema");
69
- lines.push("");
70
- lines.push("```json");
71
- try {
72
- const schema = jsonSchemaForSpec(spec);
73
- lines.push(JSON.stringify(schema.output ?? {}, null, 2));
74
- } catch {
75
- lines.push("// Schema generation not available");
76
- }
77
- lines.push("```");
78
- lines.push("");
79
- if (spec.io.errors && Object.keys(spec.io.errors).length) {
80
- lines.push("### Error Codes");
81
- lines.push("");
82
- lines.push("| Code | HTTP | Description | When |");
83
- lines.push("|------|------|-------------|------|");
84
- for (const [code, err] of Object.entries(spec.io.errors)) lines.push(`| \`${code}\` | ${err.http ?? 400} | ${err.description} | ${err.when} |`);
85
- lines.push("");
86
- }
87
- }
88
- if (opts.includePolicy) {
89
- lines.push("## Policy");
90
- lines.push("");
91
- lines.push(`- **Auth Required:** ${spec.policy.auth}`);
92
- lines.push(`- **Idempotent:** ${spec.policy.idempotent ?? m.kind === "query"}`);
93
- if (spec.policy.rateLimit) lines.push(`- **Rate Limit:** ${spec.policy.rateLimit.rpm} rpm per ${spec.policy.rateLimit.key}`);
94
- if (spec.policy.flags?.length) lines.push(`- **Feature Flags:** ${spec.policy.flags.join(", ")}`);
95
- if (spec.policy.pii?.length) lines.push(`- **PII Fields:** ${spec.policy.pii.join(", ")}`);
96
- if (spec.policy.escalate) lines.push(`- **Escalation:** ${spec.policy.escalate}`);
97
- lines.push("");
98
- }
99
- if (opts.includeSideEffects && spec.sideEffects) {
100
- if (spec.sideEffects.emits?.length) {
101
- lines.push("## Events Emitted");
102
- lines.push("");
103
- for (const e of spec.sideEffects.emits) if (isEmitDeclRef(e)) lines.push(`- \`${e.ref.name}.v${e.ref.version}\` — ${e.when}`);
104
- else lines.push(`- \`${e.name}.v${e.version}\` — ${e.when}`);
105
- lines.push("");
106
- }
107
- if (spec.sideEffects.analytics?.length) {
108
- lines.push("## Analytics Events");
109
- lines.push("");
110
- for (const a of spec.sideEffects.analytics) lines.push(`- ${a}`);
111
- lines.push("");
112
- }
113
- }
114
- if (opts.includeScenarios && spec.acceptance?.scenarios?.length) {
115
- lines.push("## Acceptance Scenarios");
116
- lines.push("");
117
- for (const s of spec.acceptance.scenarios) {
118
- lines.push(`### ${s.name}`);
119
- lines.push("");
120
- lines.push("**Given:**");
121
- for (const g of s.given) lines.push(`- ${g}`);
122
- lines.push("");
123
- lines.push("**When:**");
124
- for (const w of s.when) lines.push(`- ${w}`);
125
- lines.push("");
126
- lines.push("**Then:**");
127
- for (const t of s.then) lines.push(`- ${t}`);
128
- lines.push("");
129
- }
130
- }
131
- if (opts.includeExamples && spec.acceptance?.examples?.length) {
132
- lines.push("## Examples");
133
- lines.push("");
134
- for (const ex of spec.acceptance.examples) {
135
- lines.push(`### ${ex.name}`);
136
- lines.push("");
137
- lines.push("**Input:**");
138
- lines.push("```json");
139
- lines.push(JSON.stringify(ex.input, null, 2));
140
- lines.push("```");
141
- lines.push("");
142
- lines.push("**Output:**");
143
- lines.push("```json");
144
- lines.push(JSON.stringify(ex.output, null, 2));
145
- lines.push("```");
146
- lines.push("");
147
- }
148
- }
149
- if (spec.transport) {
150
- lines.push("## Transport Configuration");
151
- lines.push("");
152
- if (spec.transport.rest) lines.push(`- **REST:** ${spec.transport.rest.method ?? "POST"} ${spec.transport.rest.path ?? "auto"}`);
153
- if (spec.transport.gql) lines.push(`- **GraphQL:** ${spec.transport.gql.field ?? "auto"}`);
154
- if (spec.transport.mcp) lines.push(`- **MCP Tool:** ${spec.transport.mcp.toolName ?? "auto"}`);
155
- lines.push("");
156
- }
157
- return lines.join("\n");
158
- }
159
- /**
160
- * Export a single spec as an actionable agent prompt.
161
- * Includes: instructions, full spec, expected output format.
162
- * Best for: Directly feeding to coding agents for implementation.
163
- */
164
- function specToAgentPrompt(spec, options) {
165
- const taskType = options?.taskType ?? "implement";
166
- const m = spec.meta;
167
- const lines = [];
168
- const taskVerb = {
169
- implement: "Implement",
170
- test: "Write tests for",
171
- refactor: "Refactor",
172
- review: "Review"
173
- }[taskType];
174
- lines.push(`# Task: ${taskVerb} ${m.name}.v${m.version}`);
175
- lines.push("");
176
- lines.push("## Context");
177
- lines.push("");
178
- lines.push(`You are working on a ContractSpec-driven codebase. This spec defines a ${m.kind} operation.`);
179
- lines.push("");
180
- lines.push(`**Goal:** ${m.goal}`);
181
- lines.push("");
182
- lines.push(`**Background:** ${m.context}`);
183
- lines.push("");
184
- lines.push("## Specification");
185
- lines.push("");
186
- lines.push(specToFullMarkdown(spec));
187
- lines.push("");
188
- lines.push("## Instructions");
189
- lines.push("");
190
- if (taskType === "implement") {
191
- lines.push("Implement this specification following these requirements:");
192
- lines.push("");
193
- lines.push("1. **Type Safety**: Use TypeScript with strict typing. No `any` types.");
194
- lines.push("2. **Input Validation**: Validate input against the schema before processing.");
195
- lines.push("3. **Error Handling**: Implement all error cases defined in the spec.");
196
- lines.push("4. **Events**: Emit events as specified in sideEffects.emits.");
197
- lines.push("5. **Policy**: Respect auth, rate limits, and feature flags.");
198
- lines.push("6. **Idempotency**: " + (spec.policy.idempotent ? "This operation MUST be idempotent." : "This operation may have side effects."));
199
- lines.push("");
200
- if (spec.policy.pii?.length) {
201
- lines.push("**PII Handling**: The following fields contain PII and must be handled carefully:");
202
- for (const field of spec.policy.pii) lines.push(`- ${field}`);
203
- lines.push("");
204
- }
205
- } else if (taskType === "test") {
206
- lines.push("Write comprehensive tests for this specification:");
207
- lines.push("");
208
- lines.push("1. Test all acceptance scenarios defined in the spec.");
209
- lines.push("2. Test all error cases with appropriate assertions.");
210
- lines.push("3. Test edge cases and boundary conditions.");
211
- lines.push("4. Verify events are emitted correctly.");
212
- lines.push("5. Use descriptive test names following the pattern: \"should [behavior] when [condition]\"");
213
- lines.push("");
214
- } else if (taskType === "refactor") {
215
- lines.push("Refactor this implementation while preserving all behavior:");
216
- lines.push("");
217
- lines.push("1. Maintain compliance with the specification.");
218
- lines.push("2. Improve code clarity and maintainability.");
219
- lines.push("3. Reduce complexity where possible.");
220
- lines.push("4. Ensure all existing tests still pass.");
221
- lines.push("");
222
- } else if (taskType === "review") {
223
- lines.push("Review this implementation against the specification:");
224
- lines.push("");
225
- lines.push("1. Verify input/output types match the schema.");
226
- lines.push("2. Check all error cases are handled.");
227
- lines.push("3. Verify events are emitted as specified.");
228
- lines.push("4. Check policy compliance (auth, rate limits).");
229
- lines.push("5. Report any deviations from the spec.");
230
- lines.push("");
231
- }
232
- if (options?.existingCode) {
233
- lines.push("## Existing Code");
234
- lines.push("");
235
- lines.push("```typescript");
236
- lines.push(options.existingCode);
237
- lines.push("```");
238
- lines.push("");
239
- }
240
- lines.push("## Expected Output");
241
- lines.push("");
242
- if (taskType === "implement" || taskType === "refactor") {
243
- lines.push("Provide a complete TypeScript implementation. Include:");
244
- lines.push("- Type definitions for input/output");
245
- lines.push("- Handler function with proper error handling");
246
- lines.push("- JSDoc comments explaining the implementation");
247
- } else if (taskType === "test") lines.push("Provide a complete test file using the testing framework available (prefer Vitest).");
248
- else if (taskType === "review") {
249
- lines.push("Provide a structured review with:");
250
- lines.push("- Compliance status (pass/fail for each requirement)");
251
- lines.push("- Issues found with severity (error/warning/info)");
252
- lines.push("- Suggestions for improvement");
253
- }
254
- lines.push("");
255
- return lines.join("\n");
256
- }
257
- /**
258
- * Export a feature module to markdown.
259
- * Includes all related specs, events, and presentations.
260
- */
261
- function featureToMarkdown(feature, deps, options = {}) {
262
- const opts = {
263
- ...DEFAULT_FEATURE_OPTIONS,
264
- ...options
265
- };
266
- const m = feature.meta;
267
- const lines = [];
268
- lines.push(`# Feature: ${m.title ?? m.key}`);
269
- lines.push("");
270
- if (m.description) {
271
- lines.push(`> ${m.description}`);
272
- lines.push("");
273
- }
274
- lines.push("## Overview");
275
- lines.push("");
276
- lines.push(`- **Key:** \`${m.key}\``);
277
- lines.push(`- **Stability:** ${m.stability}`);
278
- lines.push(`- **Owners:** ${m.owners.join(", ")}`);
279
- if (m.tags?.length) lines.push(`- **Tags:** ${m.tags.join(", ")}`);
280
- lines.push("");
281
- if (feature.operations?.length) {
282
- lines.push("## Operations");
283
- lines.push("");
284
- lines.push("| Name | Version | Type |");
285
- lines.push("|------|---------|------|");
286
- for (const op of feature.operations) {
287
- const kind = (deps?.specs?.getSpec(op.name, op.version))?.meta.kind ?? "unknown";
288
- lines.push(`| ${op.name} | v${op.version} | ${kind} |`);
289
- }
290
- lines.push("");
291
- if (opts.includeRelatedSpecs && deps?.specs) {
292
- lines.push("### Operation Details");
293
- lines.push("");
294
- for (const op of feature.operations) {
295
- const spec = deps.specs.getSpec(op.name, op.version);
296
- if (spec) {
297
- lines.push(`---`);
298
- lines.push("");
299
- lines.push(specToFullMarkdown(spec, opts));
300
- }
301
- }
302
- }
303
- }
304
- if (feature.events?.length) {
305
- lines.push("## Events");
306
- lines.push("");
307
- lines.push("| Name | Version |");
308
- lines.push("|------|---------|");
309
- for (const evt of feature.events) lines.push(`| ${evt.name} | v${evt.version} |`);
310
- lines.push("");
311
- }
312
- if (feature.presentations?.length) {
313
- lines.push("## Presentations");
314
- lines.push("");
315
- lines.push("| Name | Version |");
316
- lines.push("|------|---------|");
317
- for (const pres of feature.presentations) lines.push(`| ${pres.name} | v${pres.version} |`);
318
- lines.push("");
319
- if (opts.includeRelatedPresentations && deps?.presentations) {
320
- lines.push("### Presentation Details");
321
- lines.push("");
322
- for (const pres of feature.presentations) {
323
- const p = deps.presentations.get(pres.name, pres.version);
324
- if (p) {
325
- lines.push(`#### ${pres.name}.v${pres.version}`);
326
- lines.push("");
327
- lines.push(`- **Kind:** ${p.content.kind ?? "unknown"}`);
328
- if ("componentKey" in p.content) lines.push(`- **Component:** ${p.content.componentKey}`);
329
- lines.push("");
330
- }
331
- }
332
- }
333
- }
334
- if (feature.capabilities) {
335
- if (feature.capabilities.provides?.length) {
336
- lines.push("## Capabilities Provided");
337
- lines.push("");
338
- for (const cap of feature.capabilities.provides) lines.push(`- \`${cap.key}.v${cap.version}\``);
339
- lines.push("");
340
- }
341
- if (feature.capabilities.requires?.length) {
342
- lines.push("## Capabilities Required");
343
- lines.push("");
344
- for (const cap of feature.capabilities.requires) lines.push(`- \`${cap.key}\`${cap.version ? `.v${cap.version}` : ""} (${cap.optional ? "optional" : "required"})`);
345
- lines.push("");
346
- }
347
- }
348
- return lines.join("\n");
349
- }
350
-
351
- //#endregion
352
- export { featureToMarkdown, specToAgentPrompt, specToFullMarkdown };
@@ -1,2 +0,0 @@
1
- import { featureToMarkdown, specToAgentPrompt, specToFullMarkdown } from "./exporters.js";
2
- import { AGENT_SYSTEM_PROMPTS, generateImplementationPlan, generateVerificationPrompt } from "./prompts.js";
@@ -1,211 +0,0 @@
1
- import { specToFullMarkdown } from "./exporters.js";
2
-
3
- //#region ../../libs/contracts/dist/llm/prompts.js
4
- /**
5
- * System prompts for different agent types.
6
- */
7
- const AGENT_SYSTEM_PROMPTS = {
8
- "claude-code": `You are an expert TypeScript developer working with ContractSpec, a spec-first development framework.
9
-
10
- Your code follows these principles:
11
- - Type-safe with comprehensive TypeScript types (no \`any\`)
12
- - Well-documented with JSDoc comments
13
- - Production-ready with proper error handling
14
- - Following SOLID principles and clean code practices
15
- - Modular and testable
16
-
17
- When implementing specs:
18
- 1. Validate input against the schema before processing
19
- 2. Handle all error cases defined in the spec
20
- 3. Emit events as specified in sideEffects
21
- 4. Respect policy constraints (auth, rate limits, PII handling)
22
- 5. Follow the acceptance scenarios as your implementation guide
23
-
24
- Generate clean, idiomatic TypeScript that exactly matches the specification.`,
25
- "cursor-cli": `You are implementing features for a ContractSpec-driven codebase.
26
-
27
- ContractSpec is a spec-first framework where specifications define:
28
- - Operations (commands and queries) with typed I/O
29
- - Events that operations emit
30
- - Presentations for UI components
31
- - Features that group related specs
32
-
33
- When working with specs:
34
- - Read the spec carefully before implementing
35
- - Match the input/output types exactly
36
- - Implement all error cases
37
- - Follow the acceptance scenarios
38
- - Respect policy constraints
39
-
40
- Use the project's existing patterns and conventions.`,
41
- "generic-mcp": `You are a code generation assistant working with ContractSpec specifications.
42
-
43
- ContractSpec specs define:
44
- - meta: name, version, kind (command/query), description, goal, context
45
- - io: input schema, output schema, error definitions
46
- - policy: auth level, rate limits, feature flags, PII handling
47
- - sideEffects: events to emit, analytics, audit
48
- - acceptance: scenarios and examples
49
-
50
- Your task is to generate or modify code that complies with the given specification.
51
- Follow the spec exactly and handle all defined cases.`
52
- };
53
- /**
54
- * Generate a verification prompt for AI-powered semantic review.
55
- */
56
- function generateVerificationPrompt(spec, implementationCode) {
57
- return {
58
- agent: "generic-mcp",
59
- taskPrompt: `## Semantic Verification Task
60
-
61
- Verify that this implementation fulfills the specification's intent.
62
-
63
- **Specification:**
64
- ${specToFullMarkdown(spec)}
65
-
66
- **Implementation:**
67
- \`\`\`typescript
68
- ${implementationCode}
69
- \`\`\`
70
-
71
- Analyze and respond with JSON:
72
-
73
- \`\`\`json
74
- {
75
- "passed": true/false,
76
- "score": 0-100,
77
- "compliance": {
78
- "inputTypes": { "match": true/false, "issues": [] },
79
- "outputTypes": { "match": true/false, "issues": [] },
80
- "errorHandling": { "coverage": "full/partial/none", "missing": [] },
81
- "eventEmission": { "correct": true/false, "issues": [] },
82
- "policyCompliance": { "auth": true/false, "rateLimit": true/false, "pii": true/false }
83
- },
84
- "scenarios": [
85
- { "name": "scenario name", "covered": true/false, "notes": "" }
86
- ],
87
- "issues": [
88
- { "severity": "error/warning/info", "category": "type/export/import/scenario/error_handling/semantic", "message": "", "suggestion": "" }
89
- ],
90
- "summary": "Brief summary of verification results"
91
- }
92
- \`\`\``
93
- };
94
- }
95
- /**
96
- * Generate a feature implementation plan.
97
- */
98
- function generateImplementationPlan(spec, options) {
99
- const m = spec.meta;
100
- const fileStructure = [];
101
- const basePath = options?.projectRoot ?? "src";
102
- const specPath = m.name.replace(/\./g, "/");
103
- if (m.kind === "command" || m.kind === "query") fileStructure.push({
104
- path: `${basePath}/${specPath}/handler.ts`,
105
- purpose: "Main handler implementation",
106
- type: "create"
107
- }, {
108
- path: `${basePath}/${specPath}/types.ts`,
109
- purpose: "Type definitions",
110
- type: "create"
111
- }, {
112
- path: `${basePath}/${specPath}/handler.test.ts`,
113
- purpose: "Handler tests",
114
- type: "create"
115
- });
116
- const steps = [];
117
- let order = 1;
118
- steps.push({
119
- order: order++,
120
- title: "Define Types",
121
- description: "Create TypeScript types for input, output, and internal data structures",
122
- acceptanceCriteria: [
123
- "Input type matches spec schema exactly",
124
- "Output type matches spec schema exactly",
125
- "Error types defined for all error cases"
126
- ]
127
- });
128
- steps.push({
129
- order: order++,
130
- title: "Implement Input Validation",
131
- description: "Add validation logic for the input payload",
132
- acceptanceCriteria: [
133
- "All required fields are validated",
134
- "Type constraints are enforced",
135
- "Validation errors return appropriate error codes"
136
- ]
137
- });
138
- steps.push({
139
- order: order++,
140
- title: "Implement Core Logic",
141
- description: "Implement the main business logic of the operation",
142
- acceptanceCriteria: spec.acceptance?.scenarios?.map((s) => s.name) ?? ["Operation completes successfully for valid input"]
143
- });
144
- if (spec.io.errors && Object.keys(spec.io.errors).length > 0) steps.push({
145
- order: order++,
146
- title: "Implement Error Handling",
147
- description: "Handle all defined error cases",
148
- acceptanceCriteria: Object.entries(spec.io.errors).map(([code, err]) => `Handle ${code}: ${err.when}`)
149
- });
150
- if (spec.sideEffects?.emits?.length) steps.push({
151
- order: order++,
152
- title: "Implement Event Emission",
153
- description: "Emit events as specified",
154
- acceptanceCriteria: spec.sideEffects.emits.map((e) => {
155
- if ("ref" in e) return `Emit ${e.ref.name}.v${e.ref.version} when ${e.when}`;
156
- return `Emit ${e.name}.v${e.version} when ${e.when}`;
157
- })
158
- });
159
- steps.push({
160
- order: order++,
161
- title: "Write Tests",
162
- description: "Create comprehensive test suite",
163
- acceptanceCriteria: [
164
- "All acceptance scenarios covered",
165
- "All error cases tested",
166
- "Edge cases handled",
167
- "Events verified"
168
- ]
169
- });
170
- const constraints = {
171
- policy: [],
172
- security: [],
173
- pii: []
174
- };
175
- constraints.policy.push(`Auth level: ${spec.policy.auth}`);
176
- if (spec.policy.idempotent !== void 0) constraints.policy.push(`Idempotent: ${spec.policy.idempotent}`);
177
- if (spec.policy.rateLimit) constraints.policy.push(`Rate limit: ${spec.policy.rateLimit.rpm} rpm per ${spec.policy.rateLimit.key}`);
178
- if (spec.policy.flags?.length) constraints.policy.push(`Feature flags required: ${spec.policy.flags.join(", ")}`);
179
- if (spec.policy.escalate) constraints.security.push(`Escalation required: ${spec.policy.escalate}`);
180
- if (spec.policy.pii?.length) constraints.pii = spec.policy.pii;
181
- return {
182
- target: {
183
- type: "spec",
184
- name: m.name,
185
- version: m.version
186
- },
187
- context: {
188
- goal: m.goal,
189
- description: m.description,
190
- background: m.context
191
- },
192
- specMarkdown: specToFullMarkdown(spec),
193
- fileStructure,
194
- steps,
195
- constraints,
196
- verificationChecklist: [
197
- "Input validation works for all cases",
198
- "Output matches expected schema",
199
- "All error cases return correct codes",
200
- "Events are emitted with correct payloads",
201
- "Auth requirements are enforced",
202
- "Rate limiting is applied (if applicable)",
203
- "PII fields are handled correctly",
204
- "All acceptance scenarios pass",
205
- "Tests provide adequate coverage"
206
- ]
207
- };
208
- }
209
-
210
- //#endregion
211
- export { AGENT_SYSTEM_PROMPTS, generateImplementationPlan, generateVerificationPrompt };