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

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 (350) hide show
  1. package/dist/_virtual/rolldown_runtime.js +1 -22
  2. package/dist/adapters/ai.js +1 -82
  3. package/dist/adapters/factory.js +1 -36
  4. package/dist/adapters/fs.js +1 -118
  5. package/dist/adapters/git.js +1 -54
  6. package/dist/adapters/index.js +1 -7
  7. package/dist/adapters/logger.js +1 -80
  8. package/dist/adapters/watcher.js +1 -69
  9. package/dist/adapters/workspace.js +2 -190
  10. package/dist/ai/agents/claude-code-agent.js +9 -146
  11. package/dist/ai/agents/cursor-agent.js +17 -286
  12. package/dist/ai/agents/index.js +1 -5
  13. package/dist/ai/agents/openai-codex-agent.js +8 -140
  14. package/dist/ai/agents/orchestrator.js +1 -142
  15. package/dist/ai/agents/simple-agent.js +4 -80
  16. package/dist/ai/client.js +1 -162
  17. package/dist/ai/index.js +1 -27
  18. package/dist/ai/prompts/code-generation.js +13 -55
  19. package/dist/ai/prompts/index.js +1 -12
  20. package/dist/ai/prompts/spec-creation.js +20 -61
  21. package/dist/ai/providers.js +1 -40
  22. package/dist/formatters/index.js +1 -18
  23. package/dist/formatters/json.js +1 -71
  24. package/dist/formatters/sarif.js +1 -163
  25. package/dist/formatters/text.js +2 -208
  26. package/dist/index.js +1 -81
  27. package/dist/services/agent-guide/adapters/claude-code.js +3 -144
  28. package/dist/services/agent-guide/adapters/cursor-cli.js +3 -135
  29. package/dist/services/agent-guide/adapters/generic-mcp.js +3 -159
  30. package/dist/services/agent-guide/adapters/index.js +1 -30
  31. package/dist/services/agent-guide/agent-guide-service.js +1 -148
  32. package/dist/services/agent-guide/index.js +1 -5
  33. package/dist/services/build.js +1 -140
  34. package/dist/services/ci-check/ci-check-service.js +1 -393
  35. package/dist/services/ci-check/index.js +1 -2
  36. package/dist/services/ci-check/types.js +1 -28
  37. package/dist/services/clean.js +1 -71
  38. package/dist/services/config.js +1 -76
  39. package/dist/services/deps.js +1 -62
  40. package/dist/services/diff.js +1 -33
  41. package/dist/services/doctor/checks/ai.js +2 -118
  42. package/dist/services/doctor/checks/cli.js +1 -146
  43. package/dist/services/doctor/checks/config.js +1 -170
  44. package/dist/services/doctor/checks/deps.js +1 -180
  45. package/dist/services/doctor/checks/index.js +1 -6
  46. package/dist/services/doctor/checks/mcp.js +1 -144
  47. package/dist/services/doctor/checks/workspace.js +1 -243
  48. package/dist/services/doctor/doctor-service.js +2 -115
  49. package/dist/services/doctor/index.js +1 -2
  50. package/dist/services/doctor/types.js +1 -26
  51. package/dist/services/implementation/discovery.js +2 -143
  52. package/dist/services/implementation/index.js +1 -2
  53. package/dist/services/implementation/resolver.js +1 -223
  54. package/dist/services/index.js +1 -53
  55. package/dist/services/integrity-diagram.js +6 -274
  56. package/dist/services/integrity.js +1 -272
  57. package/dist/services/list.js +1 -35
  58. package/dist/services/openapi/export-service.js +2 -51
  59. package/dist/services/openapi/import-service.js +1 -75
  60. package/dist/services/openapi/index.js +1 -4
  61. package/dist/services/openapi/sync-service.js +1 -121
  62. package/dist/services/openapi/validate-service.js +1 -130
  63. package/dist/services/regenerator.js +1 -23
  64. package/dist/services/registry.js +1 -73
  65. package/dist/services/setup/config-generators.js +26 -113
  66. package/dist/services/setup/file-merger.js +2 -60
  67. package/dist/services/setup/index.js +1 -4
  68. package/dist/services/setup/setup-service.js +1 -95
  69. package/dist/services/setup/targets/agents-md.js +1 -46
  70. package/dist/services/setup/targets/cli-config.js +1 -59
  71. package/dist/services/setup/targets/cursor-rules.js +1 -47
  72. package/dist/services/setup/targets/mcp-claude.js +1 -59
  73. package/dist/services/setup/targets/mcp-cursor.js +1 -58
  74. package/dist/services/setup/targets/vscode-settings.js +1 -62
  75. package/dist/services/setup/types.js +1 -26
  76. package/dist/services/sync.js +1 -62
  77. package/dist/services/test.js +1 -30
  78. package/dist/services/validate-implementation.js +1 -69
  79. package/dist/services/validate.js +1 -47
  80. package/dist/services/verification-cache/adapters/filesystem.js +1 -121
  81. package/dist/services/verification-cache/adapters/in-memory.js +1 -45
  82. package/dist/services/verification-cache/adapters/index.js +1 -3
  83. package/dist/services/verification-cache/adapters/workspace-state.js +1 -90
  84. package/dist/services/verification-cache/cache-service.js +1 -255
  85. package/dist/services/verification-cache/index.js +1 -6
  86. package/dist/services/verification-cache/types.js +1 -15
  87. package/dist/services/verify/ai-verifier.js +9 -336
  88. package/dist/services/verify/behavior-verifier.js +1 -185
  89. package/dist/services/verify/index.js +1 -4
  90. package/dist/services/verify/structure-verifier.js +2 -195
  91. package/dist/services/verify/verify-service.js +3 -203
  92. package/dist/services/watch.js +1 -31
  93. package/dist/services/workspace-info.js +2 -102
  94. package/dist/templates/app-config.template.js +28 -101
  95. package/dist/templates/data-view.template.js +27 -42
  96. package/dist/templates/event.template.js +14 -29
  97. package/dist/templates/experiment.template.js +51 -77
  98. package/dist/templates/handler.template.js +17 -53
  99. package/dist/templates/index.js +1 -36
  100. package/dist/templates/integration.template.js +50 -134
  101. package/dist/templates/knowledge.template.js +21 -62
  102. package/dist/templates/migration.template.js +26 -50
  103. package/dist/templates/operation.template.js +28 -44
  104. package/dist/templates/presentation.template.js +20 -46
  105. package/dist/templates/telemetry.template.js +53 -74
  106. package/dist/templates/workflow-runner.template.js +6 -12
  107. package/dist/templates/workflow.template.js +24 -51
  108. package/package.json +10 -15
  109. package/dist/adapters/ai.d.ts +0 -11
  110. package/dist/adapters/factory.d.ts +0 -28
  111. package/dist/adapters/fs.d.ts +0 -10
  112. package/dist/adapters/git.d.ts +0 -10
  113. package/dist/adapters/logger.d.ts +0 -17
  114. package/dist/adapters/watcher.d.ts +0 -10
  115. package/dist/adapters/workspace.d.ts +0 -93
  116. package/dist/ai/agents/claude-code-agent.d.ts +0 -21
  117. package/dist/ai/agents/cursor-agent.d.ts +0 -67
  118. package/dist/ai/agents/openai-codex-agent.d.ts +0 -21
  119. package/dist/ai/agents/orchestrator.d.ts +0 -49
  120. package/dist/ai/agents/simple-agent.d.ts +0 -16
  121. package/dist/ai/agents/types.d.ts +0 -35
  122. package/dist/ai/client.d.ts +0 -82
  123. package/dist/ai/index.d.ts +0 -16
  124. package/dist/ai/prompts/code-generation.d.ts +0 -25
  125. package/dist/ai/prompts/index.d.ts +0 -9
  126. package/dist/ai/prompts/spec-creation.d.ts +0 -28
  127. package/dist/ai/providers.d.ts +0 -28
  128. package/dist/formatters/index.d.ts +0 -10
  129. package/dist/formatters/json.d.ts +0 -88
  130. package/dist/formatters/sarif.d.ts +0 -100
  131. package/dist/formatters/text.d.ts +0 -34
  132. package/dist/index.d.ts +0 -66
  133. package/dist/libs/ai-providers/dist/factory.js +0 -154
  134. package/dist/libs/ai-providers/dist/index.js +0 -4
  135. package/dist/libs/ai-providers/dist/legacy.js +0 -72
  136. package/dist/libs/ai-providers/dist/models.js +0 -287
  137. package/dist/libs/ai-providers/dist/validation.js +0 -1
  138. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
  139. package/dist/libs/contracts/dist/client/index.js +0 -5
  140. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
  141. package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
  142. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  143. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  144. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
  145. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  146. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  147. package/dist/libs/contracts/dist/docs/index.js +0 -29
  148. package/dist/libs/contracts/dist/docs/presentations.js +0 -71
  149. package/dist/libs/contracts/dist/docs/registry.js +0 -44
  150. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  151. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  152. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  153. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  154. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  155. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  156. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  157. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  158. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  159. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  160. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  161. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  162. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  163. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  164. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  165. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  166. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  167. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  168. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  169. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  170. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  171. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  172. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  173. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  174. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  175. package/dist/libs/contracts/dist/events.js +0 -8
  176. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  177. package/dist/libs/contracts/dist/index.js +0 -72
  178. package/dist/libs/contracts/dist/install.js +0 -2
  179. package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
  180. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  181. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  182. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  183. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  184. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  185. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
  186. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  187. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  188. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  189. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
  190. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
  191. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  192. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
  193. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
  194. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
  195. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
  196. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  197. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
  198. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  199. package/dist/libs/contracts/dist/jsonschema.js +0 -24
  200. package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
  201. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  202. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  203. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  204. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  205. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  206. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  207. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  208. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  209. package/dist/libs/contracts/dist/llm/exporters.js +0 -352
  210. package/dist/libs/contracts/dist/llm/index.js +0 -2
  211. package/dist/libs/contracts/dist/llm/prompts.js +0 -211
  212. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  213. package/dist/libs/contracts/dist/openapi.js +0 -75
  214. package/dist/libs/contracts/dist/ownership.js +0 -21
  215. package/dist/libs/contracts/dist/presentations.js +0 -1
  216. package/dist/libs/contracts/dist/presentations.v2.js +0 -11
  217. package/dist/libs/contracts/dist/prompt.js +0 -1
  218. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  219. package/dist/libs/contracts/dist/regenerator/index.js +0 -2
  220. package/dist/libs/contracts/dist/regenerator/service.js +0 -92
  221. package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
  222. package/dist/libs/contracts/dist/registry.js +0 -208
  223. package/dist/libs/contracts/dist/resources.js +0 -1
  224. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  225. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  226. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  227. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
  228. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  229. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  230. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  231. package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
  232. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  233. package/dist/libs/contracts/dist/server/index.js +0 -8
  234. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  235. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
  236. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  237. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  238. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  239. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  240. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  241. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  242. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  243. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  244. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  245. package/dist/libs/contracts/dist/spec.js +0 -35
  246. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  247. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  248. package/dist/libs/contracts/dist/tests/index.js +0 -1
  249. package/dist/libs/contracts/dist/tests/runner.js +0 -150
  250. package/dist/libs/contracts/dist/workflow/index.js +0 -1
  251. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  252. package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
  253. package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
  254. package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
  255. package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
  256. package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
  257. package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
  258. package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
  259. package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
  260. package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
  261. package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
  262. package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
  263. package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
  264. package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
  265. package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
  266. package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
  267. package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
  268. package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
  269. package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
  270. package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
  271. package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
  272. package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
  273. package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
  274. package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
  275. package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
  276. package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
  277. package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
  278. package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
  279. package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
  280. package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
  281. package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
  282. package/dist/ports/ai.d.ts +0 -58
  283. package/dist/ports/fs.d.ts +0 -80
  284. package/dist/ports/git.d.ts +0 -32
  285. package/dist/ports/logger.d.ts +0 -87
  286. package/dist/ports/watcher.d.ts +0 -51
  287. package/dist/services/agent-guide/adapters/claude-code.d.ts +0 -34
  288. package/dist/services/agent-guide/adapters/cursor-cli.d.ts +0 -38
  289. package/dist/services/agent-guide/adapters/generic-mcp.d.ts +0 -52
  290. package/dist/services/agent-guide/adapters/index.d.ts +0 -22
  291. package/dist/services/agent-guide/agent-guide-service.d.ts +0 -55
  292. package/dist/services/agent-guide/types.d.ts +0 -57
  293. package/dist/services/build.d.ts +0 -58
  294. package/dist/services/ci-check/ci-check-service.d.ts +0 -15
  295. package/dist/services/ci-check/types.d.ts +0 -142
  296. package/dist/services/clean.d.ts +0 -40
  297. package/dist/services/config.d.ts +0 -25
  298. package/dist/services/deps.d.ts +0 -52
  299. package/dist/services/diff.d.ts +0 -33
  300. package/dist/services/doctor/doctor-service.d.ts +0 -23
  301. package/dist/services/doctor/types.d.ts +0 -117
  302. package/dist/services/implementation/discovery.d.ts +0 -29
  303. package/dist/services/implementation/resolver.d.ts +0 -43
  304. package/dist/services/implementation/types.d.ts +0 -78
  305. package/dist/services/integrity-diagram.d.ts +0 -35
  306. package/dist/services/integrity.d.ts +0 -133
  307. package/dist/services/list.d.ts +0 -30
  308. package/dist/services/openapi/export-service.d.ts +0 -52
  309. package/dist/services/openapi/import-service.d.ts +0 -15
  310. package/dist/services/openapi/sync-service.d.ts +0 -18
  311. package/dist/services/openapi/types.d.ts +0 -184
  312. package/dist/services/openapi/validate-service.d.ts +0 -15
  313. package/dist/services/regenerator.d.ts +0 -17
  314. package/dist/services/registry.d.ts +0 -52
  315. package/dist/services/setup/config-generators.d.ts +0 -41
  316. package/dist/services/setup/file-merger.d.ts +0 -26
  317. package/dist/services/setup/setup-service.d.ts +0 -11
  318. package/dist/services/setup/types.d.ts +0 -84
  319. package/dist/services/sync.d.ts +0 -40
  320. package/dist/services/test.d.ts +0 -14
  321. package/dist/services/validate-implementation.d.ts +0 -31
  322. package/dist/services/validate.d.ts +0 -40
  323. package/dist/services/verification-cache/adapters/filesystem.d.ts +0 -45
  324. package/dist/services/verification-cache/adapters/in-memory.d.ts +0 -26
  325. package/dist/services/verification-cache/adapters/workspace-state.d.ts +0 -48
  326. package/dist/services/verification-cache/cache-service.d.ts +0 -69
  327. package/dist/services/verification-cache/types.d.ts +0 -123
  328. package/dist/services/verify/ai-verifier.d.ts +0 -24
  329. package/dist/services/verify/behavior-verifier.d.ts +0 -11
  330. package/dist/services/verify/structure-verifier.d.ts +0 -11
  331. package/dist/services/verify/types.d.ts +0 -136
  332. package/dist/services/verify/verify-service.d.ts +0 -59
  333. package/dist/services/watch.d.ts +0 -24
  334. package/dist/services/workspace-info.d.ts +0 -61
  335. package/dist/templates/app-config.template.d.ts +0 -6
  336. package/dist/templates/data-view.template.d.ts +0 -6
  337. package/dist/templates/event.template.d.ts +0 -10
  338. package/dist/templates/experiment.template.d.ts +0 -6
  339. package/dist/templates/handler.template.d.ts +0 -15
  340. package/dist/templates/index.d.ts +0 -20
  341. package/dist/templates/integration.template.d.ts +0 -6
  342. package/dist/templates/knowledge.template.d.ts +0 -6
  343. package/dist/templates/migration.template.d.ts +0 -6
  344. package/dist/templates/operation.template.d.ts +0 -10
  345. package/dist/templates/presentation.template.d.ts +0 -10
  346. package/dist/templates/telemetry.template.d.ts +0 -6
  347. package/dist/templates/workflow-runner.template.d.ts +0 -15
  348. package/dist/templates/workflow.template.d.ts +0 -6
  349. package/dist/types/config.d.ts +0 -33
  350. package/dist/types.d.ts +0 -323
@@ -1,208 +1,2 @@
1
- //#region src/formatters/text.ts
2
- /**
3
- * Format CI check results as text lines.
4
- * Returns structured lines that can be styled by the CLI.
5
- */
6
- function formatAsTextLines(result, options = {}) {
7
- const lines = [];
8
- const { verbose = false, showTiming = true, groupByFile = false } = options;
9
- lines.push({
10
- text: "",
11
- style: "normal"
12
- });
13
- lines.push({
14
- text: "📋 ContractSpec CI Check Results",
15
- style: "bold"
16
- });
17
- lines.push({
18
- text: "",
19
- style: "normal"
20
- });
21
- if (result.commitSha || result.branch) {
22
- const gitInfo = [result.branch ? `branch: ${result.branch}` : null, result.commitSha ? `commit: ${result.commitSha.slice(0, 7)}` : null].filter(Boolean).join(", ");
23
- lines.push({
24
- text: `Git: ${gitInfo}`,
25
- style: "muted"
26
- });
27
- }
28
- lines.push({
29
- text: "",
30
- style: "normal"
31
- });
32
- lines.push({
33
- text: "Check Results:",
34
- style: "bold"
35
- });
36
- for (const category of result.categories) {
37
- const icon = category.passed ? "✓" : "✗";
38
- const style = category.passed ? "success" : "error";
39
- const stats = formatCategoryStats(category);
40
- const timing = showTiming ? ` (${category.durationMs}ms)` : "";
41
- lines.push({
42
- text: ` ${icon} ${category.label}: ${stats}${timing}`,
43
- style
44
- });
45
- }
46
- if (result.issues.length > 0) {
47
- lines.push({
48
- text: "",
49
- style: "normal"
50
- });
51
- lines.push({
52
- text: "Issues:",
53
- style: "bold"
54
- });
55
- if (groupByFile) {
56
- const byFile = groupIssuesByFile(result.issues);
57
- for (const [file, issues] of byFile) {
58
- lines.push({
59
- text: "",
60
- style: "normal"
61
- });
62
- lines.push({
63
- text: ` ${file || "(no file)"}`,
64
- style: "bold",
65
- indent: 1
66
- });
67
- for (const issue of issues) lines.push(...formatIssueLines(issue, verbose, 2));
68
- }
69
- } else {
70
- const errors = result.issues.filter((i) => i.severity === "error");
71
- const warnings = result.issues.filter((i) => i.severity === "warning");
72
- const notes = result.issues.filter((i) => i.severity === "note");
73
- if (errors.length > 0) {
74
- lines.push({
75
- text: "",
76
- style: "normal"
77
- });
78
- lines.push({
79
- text: " Errors:",
80
- style: "error",
81
- indent: 1
82
- });
83
- for (const issue of errors) lines.push(...formatIssueLines(issue, verbose, 2));
84
- }
85
- if (warnings.length > 0) {
86
- lines.push({
87
- text: "",
88
- style: "normal"
89
- });
90
- lines.push({
91
- text: " Warnings:",
92
- style: "warning",
93
- indent: 1
94
- });
95
- for (const issue of warnings) lines.push(...formatIssueLines(issue, verbose, 2));
96
- }
97
- if (notes.length > 0 && verbose) {
98
- lines.push({
99
- text: "",
100
- style: "normal"
101
- });
102
- lines.push({
103
- text: " Notes:",
104
- style: "muted",
105
- indent: 1
106
- });
107
- for (const issue of notes) lines.push(...formatIssueLines(issue, verbose, 2));
108
- }
109
- }
110
- }
111
- lines.push({
112
- text: "",
113
- style: "normal"
114
- });
115
- lines.push({
116
- text: "─".repeat(50),
117
- style: "muted"
118
- });
119
- const summaryParts = [
120
- result.totalErrors > 0 ? `${result.totalErrors} error(s)` : null,
121
- result.totalWarnings > 0 ? `${result.totalWarnings} warning(s)` : null,
122
- result.totalNotes > 0 && verbose ? `${result.totalNotes} note(s)` : null
123
- ].filter(Boolean);
124
- if (summaryParts.length > 0) lines.push({
125
- text: `Found: ${summaryParts.join(", ")}`,
126
- style: result.success ? "warning" : "error"
127
- });
128
- if (showTiming) lines.push({
129
- text: `Duration: ${result.durationMs}ms`,
130
- style: "muted"
131
- });
132
- lines.push({
133
- text: "",
134
- style: "normal"
135
- });
136
- if (result.success) lines.push({
137
- text: "✅ All CI checks passed!",
138
- style: "success"
139
- });
140
- else lines.push({
141
- text: "❌ CI checks failed",
142
- style: "error"
143
- });
144
- lines.push({
145
- text: "",
146
- style: "normal"
147
- });
148
- return lines;
149
- }
150
- /**
151
- * Format CI check results as plain text string.
152
- */
153
- function formatAsText(result, options = {}) {
154
- return formatAsTextLines(result, options).map((line) => " ".repeat(line.indent ?? 0) + line.text).join("\n");
155
- }
156
- /**
157
- * Format category stats.
158
- */
159
- function formatCategoryStats(category) {
160
- const parts = [];
161
- if (category.errors > 0) parts.push(`${category.errors} error(s)`);
162
- if (category.warnings > 0) parts.push(`${category.warnings} warning(s)`);
163
- if (parts.length === 0) return "passed";
164
- return parts.join(", ");
165
- }
166
- /**
167
- * Format a single issue as text lines.
168
- */
169
- function formatIssueLines(issue, verbose, baseIndent) {
170
- const lines = [];
171
- const icon = issue.severity === "error" ? "✗" : issue.severity === "warning" ? "⚠" : "○";
172
- const style = issue.severity === "error" ? "error" : issue.severity === "warning" ? "warning" : "muted";
173
- let mainLine = `${icon} ${issue.message}`;
174
- if (issue.file) {
175
- const location = issue.line ? `:${issue.line}` : "";
176
- mainLine += ` (${issue.file}${location})`;
177
- }
178
- lines.push({
179
- text: mainLine,
180
- style,
181
- indent: baseIndent
182
- });
183
- if (verbose && issue.context) {
184
- const contextStr = JSON.stringify(issue.context);
185
- if (contextStr !== "{}") lines.push({
186
- text: `Context: ${contextStr}`,
187
- style: "muted",
188
- indent: baseIndent + 1
189
- });
190
- }
191
- return lines;
192
- }
193
- /**
194
- * Group issues by file.
195
- */
196
- function groupIssuesByFile(issues) {
197
- const byFile = /* @__PURE__ */ new Map();
198
- for (const issue of issues) {
199
- const file = issue.file ?? "";
200
- if (!byFile.has(file)) byFile.set(file, []);
201
- const fileIssues = byFile.get(file);
202
- if (fileIssues) fileIssues.push(issue);
203
- }
204
- return new Map([...byFile.entries()].sort(([a], [b]) => a.localeCompare(b)));
205
- }
206
-
207
- //#endregion
208
- export { formatAsText, formatAsTextLines };
1
+ function e(e,t={}){let a=[],{verbose:o=!1,showTiming:s=!0,groupByFile:c=!1}=t;if(a.push({text:``,style:`normal`}),a.push({text:`📋 ContractSpec CI Check Results`,style:`bold`}),a.push({text:``,style:`normal`}),e.commitSha||e.branch){let t=[e.branch?`branch: ${e.branch}`:null,e.commitSha?`commit: ${e.commitSha.slice(0,7)}`:null].filter(Boolean).join(`, `);a.push({text:`Git: ${t}`,style:`muted`})}a.push({text:``,style:`normal`}),a.push({text:`Check Results:`,style:`bold`});for(let t of e.categories){let e=t.passed?`✓`:`✗`,r=t.passed?`success`:`error`,i=n(t),o=s?` (${t.durationMs}ms)`:``;a.push({text:` ${e} ${t.label}: ${i}${o}`,style:r})}if(e.issues.length>0)if(a.push({text:``,style:`normal`}),a.push({text:`Issues:`,style:`bold`}),c){let t=i(e.issues);for(let[e,n]of t){a.push({text:``,style:`normal`}),a.push({text:` ${e||`(no file)`}`,style:`bold`,indent:1});for(let e of n)a.push(...r(e,o,2))}}else{let t=e.issues.filter(e=>e.severity===`error`),n=e.issues.filter(e=>e.severity===`warning`),i=e.issues.filter(e=>e.severity===`note`);if(t.length>0){a.push({text:``,style:`normal`}),a.push({text:` Errors:`,style:`error`,indent:1});for(let e of t)a.push(...r(e,o,2))}if(n.length>0){a.push({text:``,style:`normal`}),a.push({text:` Warnings:`,style:`warning`,indent:1});for(let e of n)a.push(...r(e,o,2))}if(i.length>0&&o){a.push({text:``,style:`normal`}),a.push({text:` Notes:`,style:`muted`,indent:1});for(let e of i)a.push(...r(e,o,2))}}a.push({text:``,style:`normal`}),a.push({text:`─`.repeat(50),style:`muted`});let l=[e.totalErrors>0?`${e.totalErrors} error(s)`:null,e.totalWarnings>0?`${e.totalWarnings} warning(s)`:null,e.totalNotes>0&&o?`${e.totalNotes} note(s)`:null].filter(Boolean);return l.length>0&&a.push({text:`Found: ${l.join(`, `)}`,style:e.success?`warning`:`error`}),s&&a.push({text:`Duration: ${e.durationMs}ms`,style:`muted`}),a.push({text:``,style:`normal`}),e.success?a.push({text:`✅ All CI checks passed!`,style:`success`}):a.push({text:`❌ CI checks failed`,style:`error`}),a.push({text:``,style:`normal`}),a}function t(t,n={}){return e(t,n).map(e=>` `.repeat(e.indent??0)+e.text).join(`
2
+ `)}function n(e){let t=[];return e.errors>0&&t.push(`${e.errors} error(s)`),e.warnings>0&&t.push(`${e.warnings} warning(s)`),t.length===0?`passed`:t.join(`, `)}function r(e,t,n){let r=[],i=e.severity===`error`?`✗`:e.severity===`warning`?`⚠`:`○`,a=e.severity===`error`?`error`:e.severity===`warning`?`warning`:`muted`,o=`${i} ${e.message}`;if(e.file){let t=e.line?`:${e.line}`:``;o+=` (${e.file}${t})`}if(r.push({text:o,style:a,indent:n}),t&&e.context){let t=JSON.stringify(e.context);t!==`{}`&&r.push({text:`Context: ${t}`,style:`muted`,indent:n+1})}return r}function i(e){let t=new Map;for(let n of e){let e=n.file??``;t.has(e)||t.set(e,[]);let r=t.get(e);r&&r.push(n)}return new Map([...t.entries()].sort(([e],[t])=>e.localeCompare(t)))}export{t as formatAsText,e as formatAsTextLines};
package/dist/index.js CHANGED
@@ -1,81 +1 @@
1
- import { DEFAULT_WORKSPACE_CONFIG } from "./modules/contractspec-workspace/dist/types/generation-types.js";
2
- import { extractEmittedEvents, extractPolicyRefs, extractTestRefs, inferSpecTypeFromFilePath, scanAllSpecsFromSource, scanSpecSource } from "./modules/contractspec-workspace/dist/analysis/spec-scan.js";
3
- import { isFeatureFile, scanFeatureSource } from "./modules/contractspec-workspace/dist/analysis/feature-scan.js";
4
- import { computeSemanticDiff } from "./modules/contractspec-workspace/dist/analysis/diff/semantic.js";
5
- import { addContractNode, buildReverseEdges, createContractGraph, detectCycles, findMissingDependencies, toDot } from "./modules/contractspec-workspace/dist/analysis/deps/graph.js";
6
- import { parseImportedSpecNames } from "./modules/contractspec-workspace/dist/analysis/deps/parse-imports.js";
7
- import { validateSpecStructure } from "./modules/contractspec-workspace/dist/analysis/validate/spec-structure.js";
8
- import { capitalize, escapeString, toCamelCase, toKebabCase, toPascalCase } from "./modules/contractspec-workspace/dist/templates/utils.js";
9
- import { generateOperationSpec } from "./modules/contractspec-workspace/dist/templates/operation.js";
10
- import { generateEventSpec } from "./modules/contractspec-workspace/dist/templates/event.js";
11
- import { generatePresentationSpec } from "./modules/contractspec-workspace/dist/templates/presentation.js";
12
- import { generateWorkflowSpec } from "./modules/contractspec-workspace/dist/templates/workflow.js";
13
- import { generateWorkflowRunnerTemplate } from "./modules/contractspec-workspace/dist/templates/workflow-runner.js";
14
- import { generateDataViewSpec } from "./modules/contractspec-workspace/dist/templates/data-view.js";
15
- import { generateTelemetrySpec } from "./modules/contractspec-workspace/dist/templates/telemetry.js";
16
- import { generateExperimentSpec } from "./modules/contractspec-workspace/dist/templates/experiment.js";
17
- import { generateAppBlueprintSpec } from "./modules/contractspec-workspace/dist/templates/app-config.js";
18
- import { generateMigrationSpec } from "./modules/contractspec-workspace/dist/templates/migration.js";
19
- import { generateIntegrationSpec } from "./modules/contractspec-workspace/dist/templates/integration.js";
20
- import { generateKnowledgeSpaceSpec } from "./modules/contractspec-workspace/dist/templates/knowledge.js";
21
- import { generateComponentTemplate, generateHandlerTemplate, generateTestTemplate } from "./modules/contractspec-workspace/dist/templates/handler.js";
22
- import { addExampleContext, buildEventSpecPrompt, buildOperationSpecPrompt, buildPresentationSpecPrompt, getSystemPrompt } from "./modules/contractspec-workspace/dist/ai/spec-creation.js";
23
- import { buildComponentPrompt, buildFormPrompt, buildHandlerPrompt, buildTestPrompt, getCodeGenSystemPrompt } from "./modules/contractspec-workspace/dist/ai/code-generation.js";
24
- import { createNodeFsAdapter } from "./adapters/fs.js";
25
- import { createNodeGitAdapter } from "./adapters/git.js";
26
- import { createNodeWatcherAdapter } from "./adapters/watcher.js";
27
- import { createNodeAiAdapter } from "./adapters/ai.js";
28
- import { createConsoleLoggerAdapter, createNoopLoggerAdapter } from "./adapters/logger.js";
29
- import { createNodeAdapters } from "./adapters/factory.js";
30
- import { detectPackageManager, findPackageRoot, findWorkspaceRoot, getExecCommand, getInstallCommand, getPackageName, getRunCommand, getWorkspaceInfo, getWorkspacePackages, isMonorepo } from "./adapters/workspace.js";
31
- import "./adapters/index.js";
32
- import { validateSpec, validateSpecs } from "./services/validate.js";
33
- import { validateImplementationFiles } from "./services/validate-implementation.js";
34
- import { compareSpecs } from "./services/diff.js";
35
- import { analyzeDeps, exportGraphAsDot, getContractNode, getGraphStats } from "./services/deps.js";
36
- import { groupSpecsByType, listSpecs } from "./services/list.js";
37
- import { getApiKey, loadWorkspaceConfig, mergeWorkspaceConfig } from "./services/config.js";
38
- import { buildSpec } from "./services/build.js";
39
- import { importFromOpenApiService } from "./services/openapi/import-service.js";
40
- import { syncWithOpenApiService } from "./services/openapi/sync-service.js";
41
- import { validateAgainstOpenApiService } from "./services/openapi/validate-service.js";
42
- import { exportOpenApi } from "./services/openapi/export-service.js";
43
- import { RegistryClient, addToRegistry, listFromRegistry, resolveRegistryUrl, searchRegistry } from "./services/registry.js";
44
- import { syncSpecs } from "./services/sync.js";
45
- import { watchSpecs } from "./services/watch.js";
46
- import { cleanArtifacts } from "./services/clean.js";
47
- import { runTests } from "./services/test.js";
48
- import { createRegeneratorService } from "./services/regenerator.js";
49
- import { findAllConfigFiles, formatWorkspaceInfo, getExtendedWorkspaceInfo, mergeMonorepoConfigs } from "./services/workspace-info.js";
50
- import { analyzeIntegrity, filterIssuesBySeverity, filterIssuesByType, getAllSpecs } from "./services/integrity.js";
51
- import { generateMermaidDiagram } from "./services/integrity-diagram.js";
52
- import { ALL_SETUP_TARGETS, SETUP_TARGET_LABELS } from "./services/setup/types.js";
53
- import { generateAgentsMd, generateClaudeMcpConfig, generateContractsrcConfig, generateCursorMcpConfig, generateCursorRules, generateVscodeSettings, getClaudeDesktopConfigPath } from "./services/setup/config-generators.js";
54
- import { deepMergeOverwrite, deepMergePreserve, formatJson, safeParseJson } from "./services/setup/file-merger.js";
55
- import { runSetup } from "./services/setup/setup-service.js";
56
- import { ALL_CHECK_CATEGORIES, CHECK_CATEGORY_LABELS } from "./services/doctor/types.js";
57
- import { formatCheckResult, formatDoctorSummary, runDoctor } from "./services/doctor/doctor-service.js";
58
- import { ALL_CI_CHECK_CATEGORIES, CI_CHECK_CATEGORY_LABELS } from "./services/ci-check/types.js";
59
- import { discoverAllImplementations, discoverImplementationsForSpec, extractSpecReferences, inferImplementationType } from "./services/implementation/discovery.js";
60
- import { getImplementationSummary, resolveAllImplementations, resolveImplementations } from "./services/implementation/resolver.js";
61
- import { DEFAULT_CACHE_CONFIG } from "./services/verification-cache/types.js";
62
- import { VerificationCacheService, cacheKeyToString, computeContentHash, createVerificationCacheService, stringToCacheKey } from "./services/verification-cache/cache-service.js";
63
- import { InMemoryCacheStorage, createInMemoryCacheStorage } from "./services/verification-cache/adapters/in-memory.js";
64
- import { FileSystemCacheStorage, createFileSystemCacheStorage } from "./services/verification-cache/adapters/filesystem.js";
65
- import { WorkspaceStateCacheStorage, createWorkspaceStateCacheStorage } from "./services/verification-cache/adapters/workspace-state.js";
66
- import { runCIChecks } from "./services/ci-check/ci-check-service.js";
67
- import { ClaudeCodeAdapter, claudeCodeAdapter } from "./services/agent-guide/adapters/claude-code.js";
68
- import { CursorCLIAdapter, cursorCLIAdapter } from "./services/agent-guide/adapters/cursor-cli.js";
69
- import { GenericMCPAdapter, genericMCPAdapter } from "./services/agent-guide/adapters/generic-mcp.js";
70
- import { agentAdapters, getAgentAdapter, listAgentTypes } from "./services/agent-guide/adapters/index.js";
71
- import { AgentGuideService, agentGuideService, createAgentGuideService } from "./services/agent-guide/agent-guide-service.js";
72
- import { verifyStructure } from "./services/verify/structure-verifier.js";
73
- import { verifyBehavior } from "./services/verify/behavior-verifier.js";
74
- import { createQuickAIReview, verifySemanticFields, verifyWithAI, verifyWithAIEnhanced } from "./services/verify/ai-verifier.js";
75
- import { VerifyService, createVerifyService, verifyService } from "./services/verify/verify-service.js";
76
- import "./services/index.js";
77
- import { formatters_exports } from "./formatters/index.js";
78
- import { templates_exports } from "./templates/index.js";
79
- import { ai_exports } from "./ai/index.js";
80
-
81
- export { ALL_CHECK_CATEGORIES, ALL_CI_CHECK_CATEGORIES, ALL_SETUP_TARGETS, AgentGuideService, CHECK_CATEGORY_LABELS, CI_CHECK_CATEGORY_LABELS, ClaudeCodeAdapter, CursorCLIAdapter, DEFAULT_CACHE_CONFIG, DEFAULT_WORKSPACE_CONFIG, FileSystemCacheStorage, GenericMCPAdapter, InMemoryCacheStorage, RegistryClient, SETUP_TARGET_LABELS, VerificationCacheService, VerifyService, WorkspaceStateCacheStorage, addContractNode, addExampleContext, addToRegistry, agentAdapters, agentGuideService, ai_exports as ai, analyzeDeps, analyzeIntegrity, buildComponentPrompt, buildEventSpecPrompt, buildFormPrompt, buildHandlerPrompt, buildOperationSpecPrompt, buildPresentationSpecPrompt, buildReverseEdges, buildSpec, buildTestPrompt, cacheKeyToString, capitalize, claudeCodeAdapter, cleanArtifacts, compareSpecs, computeContentHash, computeSemanticDiff, createAgentGuideService, createConsoleLoggerAdapter, createContractGraph, createFileSystemCacheStorage, createInMemoryCacheStorage, createNodeAdapters, createNodeAiAdapter, createNodeFsAdapter, createNodeGitAdapter, createNodeWatcherAdapter, createNoopLoggerAdapter, createQuickAIReview, createRegeneratorService, createVerificationCacheService, createVerifyService, createWorkspaceStateCacheStorage, cursorCLIAdapter, deepMergeOverwrite, deepMergePreserve, detectCycles, detectPackageManager, discoverAllImplementations, discoverImplementationsForSpec, escapeString, exportGraphAsDot, exportOpenApi, extractEmittedEvents, extractPolicyRefs, extractSpecReferences, extractTestRefs, filterIssuesBySeverity, filterIssuesByType, findAllConfigFiles, findMissingDependencies, findPackageRoot, findWorkspaceRoot, formatCheckResult, formatDoctorSummary, formatJson, formatWorkspaceInfo, formatters_exports as formatters, generateAgentsMd, generateAppBlueprintSpec, generateClaudeMcpConfig, generateComponentTemplate, generateContractsrcConfig, generateCursorMcpConfig, generateCursorRules, generateDataViewSpec, generateEventSpec, generateExperimentSpec, generateHandlerTemplate, generateIntegrationSpec, generateKnowledgeSpaceSpec, generateMermaidDiagram, generateMigrationSpec, generateOperationSpec, generatePresentationSpec, generateTelemetrySpec, generateTestTemplate, generateVscodeSettings, generateWorkflowRunnerTemplate, generateWorkflowSpec, genericMCPAdapter, getAgentAdapter, getAllSpecs, getApiKey, getClaudeDesktopConfigPath, getCodeGenSystemPrompt, getContractNode, getExecCommand, getExtendedWorkspaceInfo, getGraphStats, getImplementationSummary, getInstallCommand, getPackageName, getRunCommand, getSystemPrompt, getWorkspaceInfo, getWorkspacePackages, groupSpecsByType, importFromOpenApiService, inferImplementationType, inferSpecTypeFromFilePath, isFeatureFile, isMonorepo, listAgentTypes, listFromRegistry, listSpecs, loadWorkspaceConfig, mergeMonorepoConfigs, mergeWorkspaceConfig, parseImportedSpecNames, resolveAllImplementations, resolveImplementations, resolveRegistryUrl, runCIChecks, runDoctor, runSetup, runTests, safeParseJson, scanAllSpecsFromSource, scanFeatureSource, scanSpecSource, searchRegistry, stringToCacheKey, syncSpecs, syncWithOpenApiService, templates_exports as templates, toCamelCase, toDot, toKebabCase, toPascalCase, validateAgainstOpenApiService, validateImplementationFiles, validateSpec, validateSpecStructure, validateSpecs, verifyBehavior, verifySemanticFields, verifyService, verifyStructure, verifyWithAI, verifyWithAIEnhanced, watchSpecs };
1
+ import{createNodeFsAdapter as e}from"./adapters/fs.js";import{createNodeGitAdapter as t}from"./adapters/git.js";import{createNodeWatcherAdapter as n}from"./adapters/watcher.js";import{createNodeAiAdapter as r}from"./adapters/ai.js";import{createConsoleLoggerAdapter as i,createNoopLoggerAdapter as a}from"./adapters/logger.js";import{createNodeAdapters as o}from"./adapters/factory.js";import{detectPackageManager as s,findPackageRoot as c,findWorkspaceRoot as l,getExecCommand as u,getInstallCommand as d,getPackageName as f,getRunCommand as p,getWorkspaceInfo as m,getWorkspacePackages as h,isMonorepo as g}from"./adapters/workspace.js";import"./adapters/index.js";import{validateSpec as _,validateSpecs as v}from"./services/validate.js";import{validateImplementationFiles as y}from"./services/validate-implementation.js";import{compareSpecs as b}from"./services/diff.js";import{analyzeDeps as x,exportGraphAsDot as S,getContractNode as C,getGraphStats as w}from"./services/deps.js";import{groupSpecsByType as T,listSpecs as E}from"./services/list.js";import{getApiKey as D,loadWorkspaceConfig as O,mergeWorkspaceConfig as k}from"./services/config.js";import{buildSpec as A}from"./services/build.js";import{importFromOpenApiService as j}from"./services/openapi/import-service.js";import{syncWithOpenApiService as M}from"./services/openapi/sync-service.js";import{validateAgainstOpenApiService as N}from"./services/openapi/validate-service.js";import{exportOpenApi as P}from"./services/openapi/export-service.js";import{RegistryClient as F,addToRegistry as I,listFromRegistry as L,resolveRegistryUrl as R,searchRegistry as z}from"./services/registry.js";import{syncSpecs as B}from"./services/sync.js";import{watchSpecs as V}from"./services/watch.js";import{cleanArtifacts as H}from"./services/clean.js";import{runTests as U}from"./services/test.js";import{createRegeneratorService as W}from"./services/regenerator.js";import{findAllConfigFiles as G,formatWorkspaceInfo as K,getExtendedWorkspaceInfo as q,mergeMonorepoConfigs as J}from"./services/workspace-info.js";import{analyzeIntegrity as Y,filterIssuesBySeverity as X,filterIssuesByType as Z,getAllSpecs as Q}from"./services/integrity.js";import{generateMermaidDiagram as $}from"./services/integrity-diagram.js";import{ALL_SETUP_TARGETS as ee,SETUP_TARGET_LABELS as te}from"./services/setup/types.js";import{generateAgentsMd as ne,generateClaudeMcpConfig as re,generateContractsrcConfig as ie,generateCursorMcpConfig as ae,generateCursorRules as oe,generateVscodeSettings as se,getClaudeDesktopConfigPath as ce}from"./services/setup/config-generators.js";import{deepMergeOverwrite as le,deepMergePreserve as ue,formatJson as de,safeParseJson as fe}from"./services/setup/file-merger.js";import{runSetup as pe}from"./services/setup/setup-service.js";import{ALL_CHECK_CATEGORIES as me,CHECK_CATEGORY_LABELS as he}from"./services/doctor/types.js";import{formatCheckResult as ge,formatDoctorSummary as _e,runDoctor as ve}from"./services/doctor/doctor-service.js";import{ALL_CI_CHECK_CATEGORIES as ye,CI_CHECK_CATEGORY_LABELS as be}from"./services/ci-check/types.js";import{discoverAllImplementations as xe,discoverImplementationsForSpec as Se,extractSpecReferences as Ce,inferImplementationType as we}from"./services/implementation/discovery.js";import{getImplementationSummary as Te,resolveAllImplementations as Ee,resolveImplementations as De}from"./services/implementation/resolver.js";import{DEFAULT_CACHE_CONFIG as Oe}from"./services/verification-cache/types.js";import{VerificationCacheService as ke,cacheKeyToString as Ae,computeContentHash as je,createVerificationCacheService as Me,stringToCacheKey as Ne}from"./services/verification-cache/cache-service.js";import{InMemoryCacheStorage as Pe,createInMemoryCacheStorage as Fe}from"./services/verification-cache/adapters/in-memory.js";import{FileSystemCacheStorage as Ie,createFileSystemCacheStorage as Le}from"./services/verification-cache/adapters/filesystem.js";import{WorkspaceStateCacheStorage as Re,createWorkspaceStateCacheStorage as ze}from"./services/verification-cache/adapters/workspace-state.js";import{runCIChecks as Be}from"./services/ci-check/ci-check-service.js";import{ClaudeCodeAdapter as Ve,claudeCodeAdapter as He}from"./services/agent-guide/adapters/claude-code.js";import{CursorCLIAdapter as Ue,cursorCLIAdapter as We}from"./services/agent-guide/adapters/cursor-cli.js";import{GenericMCPAdapter as Ge,genericMCPAdapter as Ke}from"./services/agent-guide/adapters/generic-mcp.js";import{agentAdapters as qe,getAgentAdapter as Je,listAgentTypes as Ye}from"./services/agent-guide/adapters/index.js";import{AgentGuideService as Xe,agentGuideService as Ze,createAgentGuideService as Qe}from"./services/agent-guide/agent-guide-service.js";import{verifyStructure as $e}from"./services/verify/structure-verifier.js";import{verifyBehavior as et}from"./services/verify/behavior-verifier.js";import{createQuickAIReview as tt,verifySemanticFields as nt,verifyWithAI as rt,verifyWithAIEnhanced as it}from"./services/verify/ai-verifier.js";import{VerifyService as at,createVerifyService as ot,verifyService as st}from"./services/verify/verify-service.js";import"./services/index.js";import{formatters_exports as ct}from"./formatters/index.js";import{templates_exports as lt}from"./templates/index.js";import{ai_exports as ut}from"./ai/index.js";export*from"@lssm/module.contractspec-workspace";export{me as ALL_CHECK_CATEGORIES,ye as ALL_CI_CHECK_CATEGORIES,ee as ALL_SETUP_TARGETS,Xe as AgentGuideService,he as CHECK_CATEGORY_LABELS,be as CI_CHECK_CATEGORY_LABELS,Ve as ClaudeCodeAdapter,Ue as CursorCLIAdapter,Oe as DEFAULT_CACHE_CONFIG,Ie as FileSystemCacheStorage,Ge as GenericMCPAdapter,Pe as InMemoryCacheStorage,F as RegistryClient,te as SETUP_TARGET_LABELS,ke as VerificationCacheService,at as VerifyService,Re as WorkspaceStateCacheStorage,I as addToRegistry,qe as agentAdapters,Ze as agentGuideService,ut as ai,x as analyzeDeps,Y as analyzeIntegrity,A as buildSpec,Ae as cacheKeyToString,He as claudeCodeAdapter,H as cleanArtifacts,b as compareSpecs,je as computeContentHash,Qe as createAgentGuideService,i as createConsoleLoggerAdapter,Le as createFileSystemCacheStorage,Fe as createInMemoryCacheStorage,o as createNodeAdapters,r as createNodeAiAdapter,e as createNodeFsAdapter,t as createNodeGitAdapter,n as createNodeWatcherAdapter,a as createNoopLoggerAdapter,tt as createQuickAIReview,W as createRegeneratorService,Me as createVerificationCacheService,ot as createVerifyService,ze as createWorkspaceStateCacheStorage,We as cursorCLIAdapter,le as deepMergeOverwrite,ue as deepMergePreserve,s as detectPackageManager,xe as discoverAllImplementations,Se as discoverImplementationsForSpec,S as exportGraphAsDot,P as exportOpenApi,Ce as extractSpecReferences,X as filterIssuesBySeverity,Z as filterIssuesByType,G as findAllConfigFiles,c as findPackageRoot,l as findWorkspaceRoot,ge as formatCheckResult,_e as formatDoctorSummary,de as formatJson,K as formatWorkspaceInfo,ct as formatters,ne as generateAgentsMd,re as generateClaudeMcpConfig,ie as generateContractsrcConfig,ae as generateCursorMcpConfig,oe as generateCursorRules,$ as generateMermaidDiagram,se as generateVscodeSettings,Ke as genericMCPAdapter,Je as getAgentAdapter,Q as getAllSpecs,D as getApiKey,ce as getClaudeDesktopConfigPath,C as getContractNode,u as getExecCommand,q as getExtendedWorkspaceInfo,w as getGraphStats,Te as getImplementationSummary,d as getInstallCommand,f as getPackageName,p as getRunCommand,m as getWorkspaceInfo,h as getWorkspacePackages,T as groupSpecsByType,j as importFromOpenApiService,we as inferImplementationType,g as isMonorepo,Ye as listAgentTypes,L as listFromRegistry,E as listSpecs,O as loadWorkspaceConfig,J as mergeMonorepoConfigs,k as mergeWorkspaceConfig,Ee as resolveAllImplementations,De as resolveImplementations,R as resolveRegistryUrl,Be as runCIChecks,ve as runDoctor,pe as runSetup,U as runTests,fe as safeParseJson,z as searchRegistry,Ne as stringToCacheKey,B as syncSpecs,M as syncWithOpenApiService,lt as templates,N as validateAgainstOpenApiService,y as validateImplementationFiles,_ as validateSpec,v as validateSpecs,et as verifyBehavior,nt as verifySemanticFields,st as verifyService,$e as verifyStructure,rt as verifyWithAI,it as verifyWithAIEnhanced,V as watchSpecs};
@@ -1,144 +1,3 @@
1
- import { AGENT_SYSTEM_PROMPTS } from "../../../libs/contracts/dist/llm/prompts.js";
2
- import "../../../libs/contracts/dist/llm/index.js";
3
-
4
- //#region src/services/agent-guide/adapters/claude-code.ts
5
- /**
6
- * Claude Code adapter implementation.
7
- * Optimized for Claude's extended thinking and code generation capabilities.
8
- */
9
- var ClaudeCodeAdapter = class {
10
- agentType = "claude-code";
11
- /**
12
- * Format an implementation plan for Claude Code.
13
- * Uses structured markdown with clear sections and checklists.
14
- */
15
- formatPlan(plan) {
16
- const lines = [];
17
- lines.push(`# Implement: ${plan.target.name}.v${plan.target.version}`);
18
- lines.push("");
19
- lines.push("## Context");
20
- lines.push("");
21
- lines.push(`**Goal:** ${plan.context.goal}`);
22
- lines.push("");
23
- lines.push(`**Description:** ${plan.context.description}`);
24
- lines.push("");
25
- if (plan.context.background) {
26
- lines.push(`**Background:**`);
27
- lines.push(plan.context.background);
28
- lines.push("");
29
- }
30
- lines.push("## Specification");
31
- lines.push("");
32
- lines.push(plan.specMarkdown);
33
- lines.push("");
34
- if (plan.fileStructure.length > 0) {
35
- lines.push("## Files to Create/Modify");
36
- lines.push("");
37
- for (const file of plan.fileStructure) {
38
- const icon = file.type === "create" ? "📝" : "✏️";
39
- lines.push(`${icon} \`${file.path}\``);
40
- lines.push(` ${file.purpose}`);
41
- lines.push("");
42
- }
43
- }
44
- lines.push("## Implementation Steps");
45
- lines.push("");
46
- for (const step of plan.steps) {
47
- lines.push(`### ${step.order}. ${step.title}`);
48
- lines.push("");
49
- lines.push(step.description);
50
- lines.push("");
51
- lines.push("**Acceptance Criteria:**");
52
- for (const criteria of step.acceptanceCriteria) lines.push(`- [ ] ${criteria}`);
53
- lines.push("");
54
- }
55
- if (plan.constraints.policy.length > 0 || plan.constraints.security.length > 0 || plan.constraints.pii.length > 0) {
56
- lines.push("## Constraints");
57
- lines.push("");
58
- if (plan.constraints.policy.length > 0) {
59
- lines.push("### Policy");
60
- for (const p of plan.constraints.policy) lines.push(`- ${p}`);
61
- lines.push("");
62
- }
63
- if (plan.constraints.security.length > 0) {
64
- lines.push("### Security");
65
- for (const s of plan.constraints.security) lines.push(`- ⚠️ ${s}`);
66
- lines.push("");
67
- }
68
- if (plan.constraints.pii.length > 0) {
69
- lines.push("### PII Handling");
70
- lines.push("The following fields contain personally identifiable information:");
71
- for (const pii of plan.constraints.pii) lines.push(`- \`${pii}\``);
72
- lines.push("");
73
- }
74
- }
75
- lines.push("## Verification Checklist");
76
- lines.push("");
77
- lines.push("Before submitting, verify:");
78
- for (const check of plan.verificationChecklist) lines.push(`- [ ] ${check}`);
79
- lines.push("");
80
- lines.push("## Instructions");
81
- lines.push("");
82
- lines.push("1. Implement each step in order");
83
- lines.push("2. Use TypeScript with strict typing (no `any`)");
84
- lines.push("3. Include JSDoc comments for public APIs");
85
- lines.push("4. Handle all error cases defined in the spec");
86
- lines.push("5. Emit events as specified");
87
- lines.push("6. Mark checklist items as you complete them");
88
- lines.push("");
89
- return {
90
- agent: "claude-code",
91
- systemPrompt: AGENT_SYSTEM_PROMPTS["claude-code"],
92
- taskPrompt: lines.join("\n")
93
- };
94
- }
95
- /**
96
- * Generate agent-specific configuration.
97
- * For Claude Code, this generates a prompt that can be used as context.
98
- */
99
- generateConfig(spec) {
100
- const lines = [];
101
- lines.push("# ContractSpec Implementation Context");
102
- lines.push("");
103
- lines.push("This codebase uses ContractSpec for spec-first development.");
104
- lines.push("");
105
- lines.push("## Spec Details");
106
- lines.push("");
107
- lines.push(`- **Name:** ${spec.meta.name}`);
108
- lines.push(`- **Version:** ${spec.meta.version}`);
109
- lines.push(`- **Kind:** ${spec.meta.kind}`);
110
- lines.push(`- **Stability:** ${spec.meta.stability}`);
111
- lines.push("");
112
- lines.push("## Implementation Requirements");
113
- lines.push("");
114
- lines.push("1. Match input/output types exactly");
115
- lines.push("2. Handle all defined error cases");
116
- lines.push("3. Emit events as specified");
117
- lines.push("4. Respect policy constraints");
118
- lines.push("");
119
- return lines.join("\n");
120
- }
121
- /**
122
- * Parse Claude Code output to extract generated code.
123
- */
124
- parseOutput(output) {
125
- const codeBlockMatch = output.match(/```(?:typescript|ts|tsx)?\n([\s\S]*?)\n```/);
126
- if (codeBlockMatch?.[1]) return { code: codeBlockMatch[1] };
127
- const errors = [];
128
- for (const pattern of [
129
- /error:\s*(.+)/gi,
130
- /failed:\s*(.+)/gi,
131
- /cannot\s+(.+)/gi
132
- ]) {
133
- const matches = output.matchAll(pattern);
134
- for (const match of matches) if (match[1]) errors.push(match[1]);
135
- }
136
- if (errors.length > 0) return { errors };
137
- return { code: output };
138
- }
139
- };
140
- /** Singleton instance */
141
- const claudeCodeAdapter = new ClaudeCodeAdapter();
142
-
143
- //#endregion
144
- export { ClaudeCodeAdapter, claudeCodeAdapter };
1
+ import{AGENT_SYSTEM_PROMPTS as e}from"@lssm/lib.contracts/llm";var t=class{agentType=`claude-code`;formatPlan(t){let n=[];if(n.push(`# Implement: ${t.target.name}.v${t.target.version}`),n.push(``),n.push(`## Context`),n.push(``),n.push(`**Goal:** ${t.context.goal}`),n.push(``),n.push(`**Description:** ${t.context.description}`),n.push(``),t.context.background&&(n.push(`**Background:**`),n.push(t.context.background),n.push(``)),n.push(`## Specification`),n.push(``),n.push(t.specMarkdown),n.push(``),t.fileStructure.length>0){n.push(`## Files to Create/Modify`),n.push(``);for(let e of t.fileStructure){let t=e.type===`create`?`📝`:`✏️`;n.push(`${t} \`${e.path}\``),n.push(` ${e.purpose}`),n.push(``)}}n.push(`## Implementation Steps`),n.push(``);for(let e of t.steps){n.push(`### ${e.order}. ${e.title}`),n.push(``),n.push(e.description),n.push(``),n.push(`**Acceptance Criteria:**`);for(let t of e.acceptanceCriteria)n.push(`- [ ] ${t}`);n.push(``)}if(t.constraints.policy.length>0||t.constraints.security.length>0||t.constraints.pii.length>0){if(n.push(`## Constraints`),n.push(``),t.constraints.policy.length>0){n.push(`### Policy`);for(let e of t.constraints.policy)n.push(`- ${e}`);n.push(``)}if(t.constraints.security.length>0){n.push(`### Security`);for(let e of t.constraints.security)n.push(`- ⚠️ ${e}`);n.push(``)}if(t.constraints.pii.length>0){n.push(`### PII Handling`),n.push(`The following fields contain personally identifiable information:`);for(let e of t.constraints.pii)n.push(`- \`${e}\``);n.push(``)}}n.push(`## Verification Checklist`),n.push(``),n.push(`Before submitting, verify:`);for(let e of t.verificationChecklist)n.push(`- [ ] ${e}`);return n.push(``),n.push(`## Instructions`),n.push(``),n.push(`1. Implement each step in order`),n.push("2. Use TypeScript with strict typing (no `any`)"),n.push(`3. Include JSDoc comments for public APIs`),n.push(`4. Handle all error cases defined in the spec`),n.push(`5. Emit events as specified`),n.push(`6. Mark checklist items as you complete them`),n.push(``),{agent:`claude-code`,systemPrompt:e[`claude-code`],taskPrompt:n.join(`
2
+ `)}}generateConfig(e){let t=[];return t.push(`# ContractSpec Implementation Context`),t.push(``),t.push(`This codebase uses ContractSpec for spec-first development.`),t.push(``),t.push(`## Spec Details`),t.push(``),t.push(`- **Name:** ${e.meta.name}`),t.push(`- **Version:** ${e.meta.version}`),t.push(`- **Kind:** ${e.meta.kind}`),t.push(`- **Stability:** ${e.meta.stability}`),t.push(``),t.push(`## Implementation Requirements`),t.push(``),t.push(`1. Match input/output types exactly`),t.push(`2. Handle all defined error cases`),t.push(`3. Emit events as specified`),t.push(`4. Respect policy constraints`),t.push(``),t.join(`
3
+ `)}parseOutput(e){let t=e.match(/```(?:typescript|ts|tsx)?\n([\s\S]*?)\n```/);if(t?.[1])return{code:t[1]};let n=[];for(let t of[/error:\s*(.+)/gi,/failed:\s*(.+)/gi,/cannot\s+(.+)/gi]){let r=e.matchAll(t);for(let e of r)e[1]&&n.push(e[1])}return n.length>0?{errors:n}:{code:e}}};const n=new t;export{t as ClaudeCodeAdapter,n as claudeCodeAdapter};
@@ -1,135 +1,3 @@
1
- import { AGENT_SYSTEM_PROMPTS } from "../../../libs/contracts/dist/llm/prompts.js";
2
- import "../../../libs/contracts/dist/llm/index.js";
3
-
4
- //#region src/services/agent-guide/adapters/cursor-cli.ts
5
- /**
6
- * Cursor CLI adapter implementation.
7
- * Optimized for Cursor's background/composer mode.
8
- */
9
- var CursorCLIAdapter = class {
10
- agentType = "cursor-cli";
11
- /**
12
- * Format an implementation plan for Cursor CLI.
13
- * Uses concise format optimized for Cursor's context window.
14
- */
15
- formatPlan(plan) {
16
- const lines = [];
17
- lines.push(`# ${plan.target.name}.v${plan.target.version}`);
18
- lines.push("");
19
- lines.push(`> ${plan.context.goal}`);
20
- lines.push("");
21
- if (plan.fileStructure.length > 0) {
22
- lines.push("## Files");
23
- lines.push("");
24
- for (const file of plan.fileStructure) lines.push(`- ${file.type}: \`${file.path}\` - ${file.purpose}`);
25
- lines.push("");
26
- }
27
- lines.push("## Spec");
28
- lines.push("");
29
- lines.push(plan.specMarkdown);
30
- lines.push("");
31
- lines.push("## Steps");
32
- lines.push("");
33
- for (const step of plan.steps) lines.push(`${step.order}. **${step.title}**: ${step.description}`);
34
- lines.push("");
35
- const constraints = [...plan.constraints.policy, ...plan.constraints.security.map((s) => `⚠️ ${s}`)];
36
- if (constraints.length > 0) {
37
- lines.push("## Constraints");
38
- lines.push("");
39
- for (const c of constraints) lines.push(`- ${c}`);
40
- lines.push("");
41
- }
42
- if (plan.constraints.pii.length > 0) {
43
- lines.push("## PII Fields");
44
- lines.push("");
45
- lines.push(`Handle carefully: ${plan.constraints.pii.map((p) => `\`${p}\``).join(", ")}`);
46
- lines.push("");
47
- }
48
- return {
49
- agent: "cursor-cli",
50
- systemPrompt: AGENT_SYSTEM_PROMPTS["cursor-cli"],
51
- taskPrompt: lines.join("\n")
52
- };
53
- }
54
- /**
55
- * Generate Cursor rules (.mdc format) for a spec.
56
- * Can be saved to .cursor/rules/ to provide persistent context.
57
- */
58
- generateConfig(spec) {
59
- const m = spec.meta;
60
- const lines = [];
61
- lines.push("---");
62
- lines.push(`description: Implementation rules for ${m.name}.v${m.version}`);
63
- lines.push(`globs: ["**/${m.name.replace(/\./g, "/")}/**"]`);
64
- lines.push("alwaysApply: false");
65
- lines.push("---");
66
- lines.push("");
67
- lines.push(`# ${m.name} Implementation Rules`);
68
- lines.push("");
69
- lines.push(`This ${m.kind} operation must follow the ContractSpec specification.`);
70
- lines.push("");
71
- lines.push("## Goal");
72
- lines.push("");
73
- lines.push(m.goal);
74
- lines.push("");
75
- lines.push("## Requirements");
76
- lines.push("");
77
- lines.push("1. Input/output types MUST match the spec schema exactly");
78
- lines.push("2. All error cases MUST be handled");
79
- if (spec.sideEffects?.emits?.length) lines.push("3. Events MUST be emitted as specified");
80
- lines.push(`4. Auth level: ${spec.policy.auth}`);
81
- if (spec.policy.idempotent !== void 0) lines.push(`5. Idempotency: ${spec.policy.idempotent}`);
82
- lines.push("");
83
- if (spec.io.errors && Object.keys(spec.io.errors).length > 0) {
84
- lines.push("## Error Cases");
85
- lines.push("");
86
- for (const [code, err] of Object.entries(spec.io.errors)) lines.push(`- \`${code}\` (HTTP ${err.http ?? 400}): ${err.when}`);
87
- lines.push("");
88
- }
89
- if (spec.sideEffects?.emits?.length) {
90
- lines.push("## Events to Emit");
91
- lines.push("");
92
- for (const e of spec.sideEffects.emits) if ("ref" in e) lines.push(`- \`${e.ref.name}.v${e.ref.version}\`: ${e.when}`);
93
- else lines.push(`- \`${e.name}.v${e.version}\`: ${e.when}`);
94
- lines.push("");
95
- }
96
- if (spec.policy.pii?.length) {
97
- lines.push("## PII Handling");
98
- lines.push("");
99
- lines.push("These fields contain PII and must be handled with care:");
100
- for (const field of spec.policy.pii) lines.push(`- \`${field}\``);
101
- lines.push("");
102
- }
103
- if (spec.acceptance?.scenarios?.length) {
104
- lines.push("## Acceptance Scenarios");
105
- lines.push("");
106
- for (const s of spec.acceptance.scenarios) {
107
- lines.push(`### ${s.name}`);
108
- lines.push(`- Given: ${s.given.join("; ")}`);
109
- lines.push(`- When: ${s.when.join("; ")}`);
110
- lines.push(`- Then: ${s.then.join("; ")}`);
111
- lines.push("");
112
- }
113
- }
114
- return lines.join("\n");
115
- }
116
- /**
117
- * Generate a cursor rules file path for a spec.
118
- */
119
- getCursorRulesPath(spec) {
120
- return `.cursor/rules/${spec.meta.name.replace(/\./g, "-")}.mdc`;
121
- }
122
- /**
123
- * Parse Cursor output to extract generated code.
124
- */
125
- parseOutput(output) {
126
- const codeBlockMatch = output.match(/```(?:typescript|ts|tsx|javascript|js)?\n([\s\S]*?)\n```/);
127
- if (codeBlockMatch?.[1]) return { code: codeBlockMatch[1] };
128
- return { code: output };
129
- }
130
- };
131
- /** Singleton instance */
132
- const cursorCLIAdapter = new CursorCLIAdapter();
133
-
134
- //#endregion
135
- export { CursorCLIAdapter, cursorCLIAdapter };
1
+ import{AGENT_SYSTEM_PROMPTS as e,specToFullMarkdown as t}from"@lssm/lib.contracts/llm";var n=class{agentType=`cursor-cli`;formatPlan(t){let n=[];if(n.push(`# ${t.target.name}.v${t.target.version}`),n.push(``),n.push(`> ${t.context.goal}`),n.push(``),t.fileStructure.length>0){n.push(`## Files`),n.push(``);for(let e of t.fileStructure)n.push(`- ${e.type}: \`${e.path}\` - ${e.purpose}`);n.push(``)}n.push(`## Spec`),n.push(``),n.push(t.specMarkdown),n.push(``),n.push(`## Steps`),n.push(``);for(let e of t.steps)n.push(`${e.order}. **${e.title}**: ${e.description}`);n.push(``);let r=[...t.constraints.policy,...t.constraints.security.map(e=>`⚠️ ${e}`)];if(r.length>0){n.push(`## Constraints`),n.push(``);for(let e of r)n.push(`- ${e}`);n.push(``)}return t.constraints.pii.length>0&&(n.push(`## PII Fields`),n.push(``),n.push(`Handle carefully: ${t.constraints.pii.map(e=>`\`${e}\``).join(`, `)}`),n.push(``)),{agent:`cursor-cli`,systemPrompt:e[`cursor-cli`],taskPrompt:n.join(`
2
+ `)}}generateConfig(e){let t=e.meta,n=[];if(n.push(`---`),n.push(`description: Implementation rules for ${t.name}.v${t.version}`),n.push(`globs: ["**/${t.name.replace(/\./g,`/`)}/**"]`),n.push(`alwaysApply: false`),n.push(`---`),n.push(``),n.push(`# ${t.name} Implementation Rules`),n.push(``),n.push(`This ${t.kind} operation must follow the ContractSpec specification.`),n.push(``),n.push(`## Goal`),n.push(``),n.push(t.goal),n.push(``),n.push(`## Requirements`),n.push(``),n.push(`1. Input/output types MUST match the spec schema exactly`),n.push(`2. All error cases MUST be handled`),e.sideEffects?.emits?.length&&n.push(`3. Events MUST be emitted as specified`),n.push(`4. Auth level: ${e.policy.auth}`),e.policy.idempotent!==void 0&&n.push(`5. Idempotency: ${e.policy.idempotent}`),n.push(``),e.io.errors&&Object.keys(e.io.errors).length>0){n.push(`## Error Cases`),n.push(``);for(let[t,r]of Object.entries(e.io.errors))n.push(`- \`${t}\` (HTTP ${r.http??400}): ${r.when}`);n.push(``)}if(e.sideEffects?.emits?.length){n.push(`## Events to Emit`),n.push(``);for(let t of e.sideEffects.emits)`ref`in t?n.push(`- \`${t.ref.name}.v${t.ref.version}\`: ${t.when}`):n.push(`- \`${t.name}.v${t.version}\`: ${t.when}`);n.push(``)}if(e.policy.pii?.length){n.push(`## PII Handling`),n.push(``),n.push(`These fields contain PII and must be handled with care:`);for(let t of e.policy.pii)n.push(`- \`${t}\``);n.push(``)}if(e.acceptance?.scenarios?.length){n.push(`## Acceptance Scenarios`),n.push(``);for(let t of e.acceptance.scenarios)n.push(`### ${t.name}`),n.push(`- Given: ${t.given.join(`; `)}`),n.push(`- When: ${t.when.join(`; `)}`),n.push(`- Then: ${t.then.join(`; `)}`),n.push(``)}return n.join(`
3
+ `)}getCursorRulesPath(e){return`.cursor/rules/${e.meta.name.replace(/\./g,`-`)}.mdc`}parseOutput(e){let t=e.match(/```(?:typescript|ts|tsx|javascript|js)?\n([\s\S]*?)\n```/);return t?.[1]?{code:t[1]}:{code:e}}};const r=new n;export{n as CursorCLIAdapter,r as cursorCLIAdapter};