@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217080011 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) 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/node_modules/@ai-sdk/anthropic/dist/index.js +1 -0
  28. package/dist/node_modules/@ai-sdk/openai/dist/index.js +11 -0
  29. package/dist/node_modules/@ai-sdk/provider/dist/index.js +3 -0
  30. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +5 -0
  31. package/dist/node_modules/chalk/source/index.js +2 -0
  32. package/dist/node_modules/chalk/source/utilities.js +4 -0
  33. package/dist/node_modules/chalk/source/vendor/ansi-styles/index.js +1 -0
  34. package/dist/node_modules/chalk/source/vendor/supports-color/browser.js +1 -0
  35. package/dist/node_modules/cli-cursor/index.js +1 -0
  36. package/dist/node_modules/cli-spinners/index.js +1 -0
  37. package/dist/node_modules/cli-spinners/spinners.js +1 -0
  38. package/dist/node_modules/eventsource-parser/dist/index.js +5 -0
  39. package/dist/node_modules/eventsource-parser/dist/stream.js +1 -0
  40. package/dist/node_modules/get-east-asian-width/index.js +1 -0
  41. package/dist/node_modules/get-east-asian-width/lookup.js +1 -0
  42. package/dist/node_modules/is-interactive/index.js +1 -0
  43. package/dist/node_modules/is-unicode-supported/index.js +1 -0
  44. package/dist/node_modules/log-symbols/browser-symbols.js +1 -0
  45. package/dist/node_modules/mimic-function/index.js +1 -0
  46. package/dist/node_modules/onetime/index.js +1 -0
  47. package/dist/node_modules/ora/index.js +6 -0
  48. package/dist/node_modules/restore-cursor/index.js +1 -0
  49. package/dist/node_modules/signal-exit/dist/mjs/index.js +1 -0
  50. package/dist/node_modules/signal-exit/dist/mjs/signals.js +1 -0
  51. package/dist/node_modules/stdin-discarder/index.js +1 -0
  52. package/dist/node_modules/string-width/index.js +1 -0
  53. package/dist/node_modules/strip-ansi/index.js +1 -0
  54. package/dist/node_modules/strip-ansi/node_modules/ansi-regex/index.js +1 -0
  55. package/dist/services/agent-guide/adapters/claude-code.js +3 -144
  56. package/dist/services/agent-guide/adapters/cursor-cli.js +3 -135
  57. package/dist/services/agent-guide/adapters/generic-mcp.js +3 -159
  58. package/dist/services/agent-guide/adapters/index.js +1 -30
  59. package/dist/services/agent-guide/agent-guide-service.js +1 -148
  60. package/dist/services/agent-guide/index.js +1 -5
  61. package/dist/services/build.js +1 -140
  62. package/dist/services/ci-check/ci-check-service.js +1 -393
  63. package/dist/services/ci-check/index.js +1 -2
  64. package/dist/services/ci-check/types.js +1 -28
  65. package/dist/services/clean.js +1 -71
  66. package/dist/services/config.js +1 -76
  67. package/dist/services/deps.js +1 -62
  68. package/dist/services/diff.js +1 -33
  69. package/dist/services/doctor/checks/ai.js +2 -118
  70. package/dist/services/doctor/checks/cli.js +1 -146
  71. package/dist/services/doctor/checks/config.js +1 -170
  72. package/dist/services/doctor/checks/deps.js +1 -180
  73. package/dist/services/doctor/checks/index.js +1 -6
  74. package/dist/services/doctor/checks/mcp.js +1 -144
  75. package/dist/services/doctor/checks/workspace.js +1 -243
  76. package/dist/services/doctor/doctor-service.js +2 -115
  77. package/dist/services/doctor/index.js +1 -2
  78. package/dist/services/doctor/types.js +1 -26
  79. package/dist/services/implementation/discovery.js +2 -143
  80. package/dist/services/implementation/index.js +1 -2
  81. package/dist/services/implementation/resolver.js +1 -223
  82. package/dist/services/index.js +1 -53
  83. package/dist/services/integrity-diagram.js +6 -274
  84. package/dist/services/integrity.js +1 -272
  85. package/dist/services/list.js +1 -35
  86. package/dist/services/openapi/export-service.js +2 -51
  87. package/dist/services/openapi/import-service.js +1 -75
  88. package/dist/services/openapi/index.js +1 -4
  89. package/dist/services/openapi/sync-service.js +1 -121
  90. package/dist/services/openapi/validate-service.js +1 -130
  91. package/dist/services/regenerator.js +1 -23
  92. package/dist/services/registry.js +1 -73
  93. package/dist/services/setup/config-generators.js +26 -113
  94. package/dist/services/setup/file-merger.js +2 -60
  95. package/dist/services/setup/index.js +1 -4
  96. package/dist/services/setup/setup-service.js +1 -95
  97. package/dist/services/setup/targets/agents-md.js +1 -46
  98. package/dist/services/setup/targets/cli-config.js +1 -59
  99. package/dist/services/setup/targets/cursor-rules.js +1 -47
  100. package/dist/services/setup/targets/mcp-claude.js +1 -59
  101. package/dist/services/setup/targets/mcp-cursor.js +1 -58
  102. package/dist/services/setup/targets/vscode-settings.js +1 -62
  103. package/dist/services/setup/types.js +1 -26
  104. package/dist/services/sync.js +1 -62
  105. package/dist/services/test.js +1 -30
  106. package/dist/services/validate-implementation.js +1 -69
  107. package/dist/services/validate.js +1 -47
  108. package/dist/services/verification-cache/adapters/filesystem.js +1 -121
  109. package/dist/services/verification-cache/adapters/in-memory.js +1 -45
  110. package/dist/services/verification-cache/adapters/index.js +1 -3
  111. package/dist/services/verification-cache/adapters/workspace-state.js +1 -90
  112. package/dist/services/verification-cache/cache-service.js +1 -255
  113. package/dist/services/verification-cache/index.js +1 -6
  114. package/dist/services/verification-cache/types.js +1 -15
  115. package/dist/services/verify/ai-verifier.js +9 -336
  116. package/dist/services/verify/behavior-verifier.js +1 -185
  117. package/dist/services/verify/index.js +1 -4
  118. package/dist/services/verify/structure-verifier.js +2 -195
  119. package/dist/services/verify/verify-service.js +3 -203
  120. package/dist/services/watch.js +1 -31
  121. package/dist/services/workspace-info.js +2 -102
  122. package/dist/templates/app-config.template.js +28 -101
  123. package/dist/templates/data-view.template.js +27 -42
  124. package/dist/templates/event.template.js +14 -29
  125. package/dist/templates/experiment.template.js +51 -77
  126. package/dist/templates/handler.template.js +17 -53
  127. package/dist/templates/index.js +1 -36
  128. package/dist/templates/integration.template.js +50 -134
  129. package/dist/templates/knowledge.template.js +21 -62
  130. package/dist/templates/migration.template.js +26 -50
  131. package/dist/templates/operation.template.js +28 -44
  132. package/dist/templates/presentation.template.js +20 -46
  133. package/dist/templates/telemetry.template.js +53 -74
  134. package/dist/templates/workflow-runner.template.js +6 -12
  135. package/dist/templates/workflow.template.js +24 -51
  136. package/package.json +10 -16
  137. package/dist/adapters/ai.d.ts +0 -11
  138. package/dist/adapters/factory.d.ts +0 -28
  139. package/dist/adapters/fs.d.ts +0 -10
  140. package/dist/adapters/git.d.ts +0 -10
  141. package/dist/adapters/logger.d.ts +0 -17
  142. package/dist/adapters/watcher.d.ts +0 -10
  143. package/dist/adapters/workspace.d.ts +0 -93
  144. package/dist/ai/agents/claude-code-agent.d.ts +0 -21
  145. package/dist/ai/agents/cursor-agent.d.ts +0 -67
  146. package/dist/ai/agents/openai-codex-agent.d.ts +0 -21
  147. package/dist/ai/agents/orchestrator.d.ts +0 -49
  148. package/dist/ai/agents/simple-agent.d.ts +0 -16
  149. package/dist/ai/agents/types.d.ts +0 -35
  150. package/dist/ai/client.d.ts +0 -82
  151. package/dist/ai/index.d.ts +0 -16
  152. package/dist/ai/prompts/code-generation.d.ts +0 -25
  153. package/dist/ai/prompts/index.d.ts +0 -9
  154. package/dist/ai/prompts/spec-creation.d.ts +0 -28
  155. package/dist/ai/providers.d.ts +0 -28
  156. package/dist/formatters/index.d.ts +0 -10
  157. package/dist/formatters/json.d.ts +0 -88
  158. package/dist/formatters/sarif.d.ts +0 -100
  159. package/dist/formatters/text.d.ts +0 -34
  160. package/dist/index.d.ts +0 -66
  161. package/dist/libs/ai-providers/dist/factory.js +0 -154
  162. package/dist/libs/ai-providers/dist/index.js +0 -4
  163. package/dist/libs/ai-providers/dist/legacy.js +0 -72
  164. package/dist/libs/ai-providers/dist/models.js +0 -287
  165. package/dist/libs/ai-providers/dist/validation.js +0 -1
  166. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
  167. package/dist/libs/contracts/dist/client/index.js +0 -5
  168. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
  169. package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
  170. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  171. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  172. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
  173. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  174. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  175. package/dist/libs/contracts/dist/docs/index.js +0 -29
  176. package/dist/libs/contracts/dist/docs/presentations.js +0 -71
  177. package/dist/libs/contracts/dist/docs/registry.js +0 -44
  178. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  179. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  180. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  181. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  182. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  183. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  184. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  185. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  186. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  187. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  188. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  189. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  190. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  191. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  192. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  193. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  194. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  195. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  196. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  197. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  198. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  199. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  200. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  201. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  202. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  203. package/dist/libs/contracts/dist/events.js +0 -8
  204. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  205. package/dist/libs/contracts/dist/index.js +0 -72
  206. package/dist/libs/contracts/dist/install.js +0 -2
  207. package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
  208. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  209. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  210. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  211. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  212. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  213. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
  214. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  215. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  216. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  217. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
  218. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
  219. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  220. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
  221. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
  222. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
  223. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
  224. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  225. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
  226. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  227. package/dist/libs/contracts/dist/jsonschema.js +0 -24
  228. package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
  229. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  230. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  231. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  232. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  233. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  234. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  235. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  236. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  237. package/dist/libs/contracts/dist/llm/exporters.js +0 -352
  238. package/dist/libs/contracts/dist/llm/index.js +0 -2
  239. package/dist/libs/contracts/dist/llm/prompts.js +0 -211
  240. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  241. package/dist/libs/contracts/dist/openapi.js +0 -75
  242. package/dist/libs/contracts/dist/ownership.js +0 -21
  243. package/dist/libs/contracts/dist/presentations.js +0 -1
  244. package/dist/libs/contracts/dist/presentations.v2.js +0 -11
  245. package/dist/libs/contracts/dist/prompt.js +0 -1
  246. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  247. package/dist/libs/contracts/dist/regenerator/index.js +0 -2
  248. package/dist/libs/contracts/dist/regenerator/service.js +0 -92
  249. package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
  250. package/dist/libs/contracts/dist/registry.js +0 -208
  251. package/dist/libs/contracts/dist/resources.js +0 -1
  252. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  253. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  254. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  255. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
  256. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  257. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  258. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  259. package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
  260. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  261. package/dist/libs/contracts/dist/server/index.js +0 -8
  262. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  263. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
  264. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  265. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  266. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  267. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  268. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  269. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  270. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  271. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  272. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  273. package/dist/libs/contracts/dist/spec.js +0 -35
  274. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  275. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  276. package/dist/libs/contracts/dist/tests/index.js +0 -1
  277. package/dist/libs/contracts/dist/tests/runner.js +0 -150
  278. package/dist/libs/contracts/dist/workflow/index.js +0 -1
  279. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  280. package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
  281. package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
  282. package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
  283. package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
  284. package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
  285. package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
  286. package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
  287. package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
  288. package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
  289. package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
  290. package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
  291. package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
  292. package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
  293. package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
  294. package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
  295. package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
  296. package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
  297. package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
  298. package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
  299. package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
  300. package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
  301. package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
  302. package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
  303. package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
  304. package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
  305. package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
  306. package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
  307. package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
  308. package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
  309. package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
  310. package/dist/ports/ai.d.ts +0 -58
  311. package/dist/ports/fs.d.ts +0 -80
  312. package/dist/ports/git.d.ts +0 -32
  313. package/dist/ports/logger.d.ts +0 -87
  314. package/dist/ports/watcher.d.ts +0 -51
  315. package/dist/services/agent-guide/adapters/claude-code.d.ts +0 -34
  316. package/dist/services/agent-guide/adapters/cursor-cli.d.ts +0 -38
  317. package/dist/services/agent-guide/adapters/generic-mcp.d.ts +0 -52
  318. package/dist/services/agent-guide/adapters/index.d.ts +0 -22
  319. package/dist/services/agent-guide/agent-guide-service.d.ts +0 -55
  320. package/dist/services/agent-guide/types.d.ts +0 -57
  321. package/dist/services/build.d.ts +0 -58
  322. package/dist/services/ci-check/ci-check-service.d.ts +0 -15
  323. package/dist/services/ci-check/types.d.ts +0 -142
  324. package/dist/services/clean.d.ts +0 -40
  325. package/dist/services/config.d.ts +0 -25
  326. package/dist/services/deps.d.ts +0 -52
  327. package/dist/services/diff.d.ts +0 -33
  328. package/dist/services/doctor/doctor-service.d.ts +0 -23
  329. package/dist/services/doctor/types.d.ts +0 -117
  330. package/dist/services/implementation/discovery.d.ts +0 -29
  331. package/dist/services/implementation/resolver.d.ts +0 -43
  332. package/dist/services/implementation/types.d.ts +0 -78
  333. package/dist/services/integrity-diagram.d.ts +0 -35
  334. package/dist/services/integrity.d.ts +0 -133
  335. package/dist/services/list.d.ts +0 -30
  336. package/dist/services/openapi/export-service.d.ts +0 -52
  337. package/dist/services/openapi/import-service.d.ts +0 -15
  338. package/dist/services/openapi/sync-service.d.ts +0 -18
  339. package/dist/services/openapi/types.d.ts +0 -184
  340. package/dist/services/openapi/validate-service.d.ts +0 -15
  341. package/dist/services/regenerator.d.ts +0 -17
  342. package/dist/services/registry.d.ts +0 -52
  343. package/dist/services/setup/config-generators.d.ts +0 -41
  344. package/dist/services/setup/file-merger.d.ts +0 -26
  345. package/dist/services/setup/setup-service.d.ts +0 -11
  346. package/dist/services/setup/types.d.ts +0 -84
  347. package/dist/services/sync.d.ts +0 -40
  348. package/dist/services/test.d.ts +0 -14
  349. package/dist/services/validate-implementation.d.ts +0 -31
  350. package/dist/services/validate.d.ts +0 -40
  351. package/dist/services/verification-cache/adapters/filesystem.d.ts +0 -45
  352. package/dist/services/verification-cache/adapters/in-memory.d.ts +0 -26
  353. package/dist/services/verification-cache/adapters/workspace-state.d.ts +0 -48
  354. package/dist/services/verification-cache/cache-service.d.ts +0 -69
  355. package/dist/services/verification-cache/types.d.ts +0 -123
  356. package/dist/services/verify/ai-verifier.d.ts +0 -24
  357. package/dist/services/verify/behavior-verifier.d.ts +0 -11
  358. package/dist/services/verify/structure-verifier.d.ts +0 -11
  359. package/dist/services/verify/types.d.ts +0 -136
  360. package/dist/services/verify/verify-service.d.ts +0 -59
  361. package/dist/services/watch.d.ts +0 -24
  362. package/dist/services/workspace-info.d.ts +0 -61
  363. package/dist/templates/app-config.template.d.ts +0 -6
  364. package/dist/templates/data-view.template.d.ts +0 -6
  365. package/dist/templates/event.template.d.ts +0 -10
  366. package/dist/templates/experiment.template.d.ts +0 -6
  367. package/dist/templates/handler.template.d.ts +0 -15
  368. package/dist/templates/index.d.ts +0 -20
  369. package/dist/templates/integration.template.d.ts +0 -6
  370. package/dist/templates/knowledge.template.d.ts +0 -6
  371. package/dist/templates/migration.template.d.ts +0 -6
  372. package/dist/templates/operation.template.d.ts +0 -10
  373. package/dist/templates/presentation.template.d.ts +0 -10
  374. package/dist/templates/telemetry.template.d.ts +0 -6
  375. package/dist/templates/workflow-runner.template.d.ts +0 -15
  376. package/dist/templates/workflow.template.d.ts +0 -6
  377. package/dist/types/config.d.ts +0 -33
  378. package/dist/types.d.ts +0 -323
@@ -1,115 +1,2 @@
1
- import { findPackageRoot, findWorkspaceRoot, getPackageName, isMonorepo } from "../../adapters/workspace.js";
2
- import { ALL_CHECK_CATEGORIES, CHECK_CATEGORY_LABELS } from "./types.js";
3
- import { runCliChecks } from "./checks/cli.js";
4
- import { runConfigChecks } from "./checks/config.js";
5
- import { runMcpChecks } from "./checks/mcp.js";
6
- import { runDepsChecks } from "./checks/deps.js";
7
- import { runWorkspaceChecks } from "./checks/workspace.js";
8
- import { runAiChecks } from "./checks/ai.js";
9
- import "./checks/index.js";
10
-
11
- //#region src/services/doctor/doctor-service.ts
12
- /**
13
- * Default prompt callbacks that always decline fixes.
14
- */
15
- const defaultPrompts = {
16
- confirm: async () => false,
17
- input: async () => ""
18
- };
19
- /**
20
- * Run all health checks and optionally apply fixes.
21
- */
22
- async function runDoctor(adapters, options, prompts = defaultPrompts) {
23
- const { fs, logger } = adapters;
24
- const categories = options.categories ?? ALL_CHECK_CATEGORIES;
25
- const workspaceRoot = findWorkspaceRoot(options.workspaceRoot);
26
- const packageRoot = findPackageRoot(options.workspaceRoot);
27
- const monorepo = isMonorepo(workspaceRoot);
28
- const packageName = monorepo ? getPackageName(packageRoot) : void 0;
29
- const ctx = {
30
- workspaceRoot,
31
- packageRoot,
32
- isMonorepo: monorepo,
33
- packageName,
34
- verbose: options.verbose ?? false
35
- };
36
- if (monorepo) {
37
- const pkgInfo = packageName ? ` (package: ${packageName})` : "";
38
- logger.info(`Detected monorepo${pkgInfo}`);
39
- }
40
- const allResults = [];
41
- for (const category of categories) {
42
- if (options.skipAi && category === "ai") continue;
43
- logger.info(`Checking ${CHECK_CATEGORY_LABELS[category]}...`);
44
- const categoryResults = await runCategoryChecks(category, fs, ctx, prompts);
45
- for (const result of categoryResults) {
46
- if (result.fix && (result.status === "fail" || result.status === "warn")) {
47
- if (options.autoFix ? true : await prompts.confirm(`Fix "${result.name}"? ${result.fix.description}`)) {
48
- logger.info(`Applying fix: ${result.fix.description}`);
49
- const fixResult = await result.fix.apply();
50
- if (fixResult.success) {
51
- logger.info(`✓ ${fixResult.message}`);
52
- result.status = "pass";
53
- result.message = `Fixed: ${fixResult.message}`;
54
- result.fix = void 0;
55
- } else logger.warn(`✗ ${fixResult.message}`);
56
- }
57
- }
58
- allResults.push(result);
59
- }
60
- }
61
- const passed = allResults.filter((r) => r.status === "pass").length;
62
- const warnings = allResults.filter((r) => r.status === "warn").length;
63
- const failures = allResults.filter((r) => r.status === "fail").length;
64
- return {
65
- checks: allResults,
66
- passed,
67
- warnings,
68
- failures,
69
- skipped: allResults.filter((r) => r.status === "skip").length,
70
- healthy: failures === 0
71
- };
72
- }
73
- /**
74
- * Run checks for a specific category.
75
- */
76
- async function runCategoryChecks(category, fs, ctx, prompts) {
77
- switch (category) {
78
- case "cli": return runCliChecks(fs, ctx);
79
- case "config": return runConfigChecks(fs, ctx);
80
- case "mcp": return runMcpChecks(fs, ctx);
81
- case "deps": return runDepsChecks(fs, ctx);
82
- case "workspace": return runWorkspaceChecks(fs, ctx);
83
- case "ai": return runAiChecks(fs, ctx, prompts);
84
- default: return [];
85
- }
86
- }
87
- /**
88
- * Get a summary string for the doctor result.
89
- */
90
- function formatDoctorSummary(result) {
91
- const lines = [];
92
- lines.push("");
93
- lines.push("=== Health Check Summary ===");
94
- lines.push("");
95
- if (result.healthy) lines.push("✓ All checks passed!");
96
- else lines.push("✗ Some issues found");
97
- lines.push("");
98
- lines.push(` Passed: ${result.passed}`);
99
- lines.push(` Warnings: ${result.warnings}`);
100
- lines.push(` Failures: ${result.failures}`);
101
- lines.push(` Skipped: ${result.skipped}`);
102
- return lines.join("\n");
103
- }
104
- /**
105
- * Format a single check result for display.
106
- */
107
- function formatCheckResult(result) {
108
- let line = `${result.status === "pass" ? "✓" : result.status === "warn" ? "⚠" : result.status === "fail" ? "✗" : "○"} ${result.name}: ${result.message}`;
109
- if (result.details) line += `\n ${result.details}`;
110
- if (result.fix) line += `\n Fix available: ${result.fix.description}`;
111
- return line;
112
- }
113
-
114
- //#endregion
115
- export { formatCheckResult, formatDoctorSummary, runDoctor };
1
+ import{findPackageRoot as e,findWorkspaceRoot as t,getPackageName as n,isMonorepo as r}from"../../adapters/workspace.js";import{ALL_CHECK_CATEGORIES as i,CHECK_CATEGORY_LABELS as a}from"./types.js";import{runCliChecks as o}from"./checks/cli.js";import{runConfigChecks as s}from"./checks/config.js";import{runMcpChecks as c}from"./checks/mcp.js";import{runDepsChecks as l}from"./checks/deps.js";import{runWorkspaceChecks as u}from"./checks/workspace.js";import{runAiChecks as d}from"./checks/ai.js";import"./checks/index.js";const f={confirm:async()=>!1,input:async()=>``};async function p(o,s,c=f){let{fs:l,logger:u}=o,d=s.categories??i,p=t(s.workspaceRoot),h=e(s.workspaceRoot),g=r(p),_=g?n(h):void 0,v={workspaceRoot:p,packageRoot:h,isMonorepo:g,packageName:_,verbose:s.verbose??!1};if(g){let e=_?` (package: ${_})`:``;u.info(`Detected monorepo${e}`)}let y=[];for(let e of d){if(s.skipAi&&e===`ai`)continue;u.info(`Checking ${a[e]}...`);let t=await m(e,l,v,c);for(let e of t){if(e.fix&&(e.status===`fail`||e.status===`warn`)&&(s.autoFix||await c.confirm(`Fix "${e.name}"? ${e.fix.description}`))){u.info(`Applying fix: ${e.fix.description}`);let t=await e.fix.apply();t.success?(u.info(`✓ ${t.message}`),e.status=`pass`,e.message=`Fixed: ${t.message}`,e.fix=void 0):u.warn(`✗ ${t.message}`)}y.push(e)}}let b=y.filter(e=>e.status===`pass`).length,x=y.filter(e=>e.status===`warn`).length,S=y.filter(e=>e.status===`fail`).length;return{checks:y,passed:b,warnings:x,failures:S,skipped:y.filter(e=>e.status===`skip`).length,healthy:S===0}}async function m(e,t,n,r){switch(e){case`cli`:return o(t,n);case`config`:return s(t,n);case`mcp`:return c(t,n);case`deps`:return l(t,n);case`workspace`:return u(t,n);case`ai`:return d(t,n,r);default:return[]}}function h(e){let t=[];return t.push(``),t.push(`=== Health Check Summary ===`),t.push(``),e.healthy?t.push(`✓ All checks passed!`):t.push(`✗ Some issues found`),t.push(``),t.push(` Passed: ${e.passed}`),t.push(` Warnings: ${e.warnings}`),t.push(` Failures: ${e.failures}`),t.push(` Skipped: ${e.skipped}`),t.join(`
2
+ `)}function g(e){let t=`${e.status===`pass`?`✓`:e.status===`warn`?`⚠`:e.status===`fail`?`✗`:`○`} ${e.name}: ${e.message}`;return e.details&&(t+=`\n ${e.details}`),e.fix&&(t+=`\n Fix available: ${e.fix.description}`),t}export{g as formatCheckResult,h as formatDoctorSummary,p as runDoctor};
@@ -1,2 +1 @@
1
- import { ALL_CHECK_CATEGORIES, CHECK_CATEGORY_LABELS } from "./types.js";
2
- import { formatCheckResult, formatDoctorSummary, runDoctor } from "./doctor-service.js";
1
+ import{ALL_CHECK_CATEGORIES as e,CHECK_CATEGORY_LABELS as t}from"./types.js";import{formatCheckResult as n,formatDoctorSummary as r,runDoctor as i}from"./doctor-service.js";
@@ -1,26 +1 @@
1
- //#region src/services/doctor/types.ts
2
- /**
3
- * All available check categories.
4
- */
5
- const ALL_CHECK_CATEGORIES = [
6
- "cli",
7
- "config",
8
- "mcp",
9
- "deps",
10
- "workspace",
11
- "ai"
12
- ];
13
- /**
14
- * Human-readable labels for check categories.
15
- */
16
- const CHECK_CATEGORY_LABELS = {
17
- cli: "CLI Installation",
18
- config: "Configuration Files",
19
- mcp: "MCP Server",
20
- deps: "Dependencies",
21
- workspace: "Workspace Structure",
22
- ai: "AI Provider"
23
- };
24
-
25
- //#endregion
26
- export { ALL_CHECK_CATEGORIES, CHECK_CATEGORY_LABELS };
1
+ const e=[`cli`,`config`,`mcp`,`deps`,`workspace`,`ai`],t={cli:`CLI Installation`,config:`Configuration Files`,mcp:`MCP Server`,deps:`Dependencies`,workspace:`Workspace Structure`,ai:`AI Provider`};export{e as ALL_CHECK_CATEGORIES,t as CHECK_CATEGORY_LABELS};
@@ -1,143 +1,2 @@
1
- //#region src/services/implementation/discovery.ts
2
- /**
3
- * Patterns for detecting spec references in source code.
4
- */
5
- const SPEC_REFERENCE_PATTERNS = {
6
- namedImport: /import\s*\{[^}]*\b(\w+(?:Spec|Contract|Command|Query))\b[^}]*\}\s*from/g,
7
- defaultImport: /import\s+(\w+(?:Spec|Contract|Command|Query))\s+from/g,
8
- contractHandler: /ContractHandler\s*<\s*typeof\s+(\w+)\s*>/g,
9
- typeofSpec: /typeof\s+(\w+(?:Spec|Contract|Command|Query))\b/g,
10
- specAssignment: /(?:spec|contract)\s*[:=]\s*(\w+(?:Spec|Contract|Command|Query))\b/gi
11
- };
12
- /**
13
- * File patterns that indicate implementation types.
14
- */
15
- const IMPLEMENTATION_TYPE_PATTERNS = {
16
- ".handler.ts": "handler",
17
- ".handler.tsx": "handler",
18
- ".service.ts": "service",
19
- ".service.tsx": "service",
20
- ".test.ts": "test",
21
- ".test.tsx": "test",
22
- ".spec.ts": "test",
23
- ".spec.tsx": "test",
24
- ".component.tsx": "component",
25
- ".tsx": "component",
26
- ".form.tsx": "form",
27
- ".hook.ts": "hook",
28
- ".hook.tsx": "hook"
29
- };
30
- /**
31
- * Infer implementation type from file path.
32
- */
33
- function inferImplementationType(filePath) {
34
- const lowerPath = filePath.toLowerCase();
35
- for (const [pattern, type] of Object.entries(IMPLEMENTATION_TYPE_PATTERNS)) if (lowerPath.endsWith(pattern)) return type;
36
- if (lowerPath.includes("/handlers/")) return "handler";
37
- if (lowerPath.includes("/services/")) return "service";
38
- if (lowerPath.includes("/components/")) return "component";
39
- if (lowerPath.includes("/forms/")) return "form";
40
- if (lowerPath.includes("/hooks/")) return "hook";
41
- if (lowerPath.includes("/__tests__/")) return "test";
42
- return "other";
43
- }
44
- /**
45
- * Extract spec references from source code.
46
- */
47
- function extractSpecReferences(code, filePath) {
48
- const matches = [];
49
- const seenSpecs = /* @__PURE__ */ new Set();
50
- const addMatch = (specName, referenceType, lineNumber) => {
51
- const key = `${specName}:${referenceType}`;
52
- if (seenSpecs.has(key)) return;
53
- seenSpecs.add(key);
54
- matches.push({
55
- filePath,
56
- specName,
57
- referenceType,
58
- lineNumber,
59
- inferredType: inferImplementationType(filePath)
60
- });
61
- };
62
- const getLineNumber = (position) => {
63
- return code.substring(0, position).split("\n").length;
64
- };
65
- let match;
66
- const handlerPattern = new RegExp(SPEC_REFERENCE_PATTERNS.contractHandler);
67
- while ((match = handlerPattern.exec(code)) !== null) addMatch(match[1], "handler", getLineNumber(match.index));
68
- const typeofPattern = new RegExp(SPEC_REFERENCE_PATTERNS.typeofSpec);
69
- while ((match = typeofPattern.exec(code)) !== null) addMatch(match[1], "typeof", getLineNumber(match.index));
70
- const namedPattern = new RegExp(SPEC_REFERENCE_PATTERNS.namedImport);
71
- while ((match = namedPattern.exec(code)) !== null) {
72
- const specNames = match[0].match(/\b(\w+(?:Spec|Contract|Command|Query))\b/g);
73
- if (specNames) for (const name of specNames) addMatch(name, "import", getLineNumber(match.index));
74
- }
75
- const defaultPattern = new RegExp(SPEC_REFERENCE_PATTERNS.defaultImport);
76
- while ((match = defaultPattern.exec(code)) !== null) addMatch(match[1], "import", getLineNumber(match.index));
77
- const assignPattern = new RegExp(SPEC_REFERENCE_PATTERNS.specAssignment);
78
- while ((match = assignPattern.exec(code)) !== null) addMatch(match[1], "unknown", getLineNumber(match.index));
79
- return matches;
80
- }
81
- /**
82
- * Default glob patterns for implementation files.
83
- */
84
- const DEFAULT_INCLUDE_PATTERNS = ["**/*.ts", "**/*.tsx"];
85
- const DEFAULT_EXCLUDE_PATTERNS = [
86
- "**/node_modules/**",
87
- "**/dist/**",
88
- "**/.git/**",
89
- "**/*.d.ts",
90
- "**/*.contracts.ts",
91
- "**/*.spec.ts",
92
- "**/*.feature.ts",
93
- "**/*.event.ts",
94
- "**/*.presentation.ts"
95
- ];
96
- /**
97
- * Discover implementations that reference a specific spec.
98
- */
99
- async function discoverImplementationsForSpec(specName, adapters, options = {}) {
100
- const { fs } = adapters;
101
- const includePatterns = options.includePatterns ?? DEFAULT_INCLUDE_PATTERNS;
102
- const excludePatterns = options.excludePatterns ?? DEFAULT_EXCLUDE_PATTERNS;
103
- const allMatches = [];
104
- for (const pattern of includePatterns) {
105
- const files = await fs.glob({
106
- pattern,
107
- ignore: excludePatterns
108
- });
109
- for (const filePath of files) try {
110
- const matchingRefs = extractSpecReferences(await fs.readFile(filePath), filePath).filter((ref) => ref.specName === specName);
111
- allMatches.push(...matchingRefs);
112
- } catch {}
113
- }
114
- return allMatches;
115
- }
116
- /**
117
- * Discover all spec references in the workspace.
118
- * Returns a map of spec name to implementation references.
119
- */
120
- async function discoverAllImplementations(adapters, options = {}) {
121
- const { fs } = adapters;
122
- const includePatterns = options.includePatterns ?? DEFAULT_INCLUDE_PATTERNS;
123
- const excludePatterns = options.excludePatterns ?? DEFAULT_EXCLUDE_PATTERNS;
124
- const specToImplementations = /* @__PURE__ */ new Map();
125
- for (const pattern of includePatterns) {
126
- const files = await fs.glob({
127
- pattern,
128
- ignore: excludePatterns
129
- });
130
- for (const filePath of files) try {
131
- const references = extractSpecReferences(await fs.readFile(filePath), filePath);
132
- for (const ref of references) {
133
- const existing = specToImplementations.get(ref.specName) ?? [];
134
- existing.push(ref);
135
- specToImplementations.set(ref.specName, existing);
136
- }
137
- } catch {}
138
- }
139
- return specToImplementations;
140
- }
141
-
142
- //#endregion
143
- export { discoverAllImplementations, discoverImplementationsForSpec, extractSpecReferences, inferImplementationType };
1
+ const e={namedImport:/import\s*\{[^}]*\b(\w+(?:Spec|Contract|Command|Query))\b[^}]*\}\s*from/g,defaultImport:/import\s+(\w+(?:Spec|Contract|Command|Query))\s+from/g,contractHandler:/ContractHandler\s*<\s*typeof\s+(\w+)\s*>/g,typeofSpec:/typeof\s+(\w+(?:Spec|Contract|Command|Query))\b/g,specAssignment:/(?:spec|contract)\s*[:=]\s*(\w+(?:Spec|Contract|Command|Query))\b/gi},t={".handler.ts":`handler`,".handler.tsx":`handler`,".service.ts":`service`,".service.tsx":`service`,".test.ts":`test`,".test.tsx":`test`,".spec.ts":`test`,".spec.tsx":`test`,".component.tsx":`component`,".tsx":`component`,".form.tsx":`form`,".hook.ts":`hook`,".hook.tsx":`hook`};function n(e){let n=e.toLowerCase();for(let[e,r]of Object.entries(t))if(n.endsWith(e))return r;return n.includes(`/handlers/`)?`handler`:n.includes(`/services/`)?`service`:n.includes(`/components/`)?`component`:n.includes(`/forms/`)?`form`:n.includes(`/hooks/`)?`hook`:n.includes(`/__tests__/`)?`test`:`other`}function r(t,r){let i=[],a=new Set,o=(e,t,o)=>{let s=`${e}:${t}`;a.has(s)||(a.add(s),i.push({filePath:r,specName:e,referenceType:t,lineNumber:o,inferredType:n(r)}))},s=e=>t.substring(0,e).split(`
2
+ `).length,c,l=new RegExp(e.contractHandler);for(;(c=l.exec(t))!==null;)o(c[1],`handler`,s(c.index));let u=new RegExp(e.typeofSpec);for(;(c=u.exec(t))!==null;)o(c[1],`typeof`,s(c.index));let d=new RegExp(e.namedImport);for(;(c=d.exec(t))!==null;){let e=c[0].match(/\b(\w+(?:Spec|Contract|Command|Query))\b/g);if(e)for(let t of e)o(t,`import`,s(c.index))}let f=new RegExp(e.defaultImport);for(;(c=f.exec(t))!==null;)o(c[1],`import`,s(c.index));let p=new RegExp(e.specAssignment);for(;(c=p.exec(t))!==null;)o(c[1],`unknown`,s(c.index));return i}const i=[`**/*.ts`,`**/*.tsx`],a=[`**/node_modules/**`,`**/dist/**`,`**/.git/**`,`**/*.d.ts`,`**/*.contracts.ts`,`**/*.spec.ts`,`**/*.feature.ts`,`**/*.event.ts`,`**/*.presentation.ts`];async function o(e,t,n={}){let{fs:o}=t,s=n.includePatterns??i,c=n.excludePatterns??a,l=[];for(let t of s){let n=await o.glob({pattern:t,ignore:c});for(let t of n)try{let n=r(await o.readFile(t),t).filter(t=>t.specName===e);l.push(...n)}catch{}}return l}async function s(e,t={}){let{fs:n}=e,o=t.includePatterns??i,s=t.excludePatterns??a,c=new Map;for(let e of o){let t=await n.glob({pattern:e,ignore:s});for(let e of t)try{let t=r(await n.readFile(e),e);for(let e of t){let t=c.get(e.specName)??[];t.push(e),c.set(e.specName,t)}}catch{}}return c}export{s as discoverAllImplementations,o as discoverImplementationsForSpec,r as extractSpecReferences,n as inferImplementationType};
@@ -1,2 +1 @@
1
- import { discoverAllImplementations, discoverImplementationsForSpec, extractSpecReferences, inferImplementationType } from "./discovery.js";
2
- import { getImplementationSummary, resolveAllImplementations, resolveImplementations } from "./resolver.js";
1
+ import{discoverAllImplementations as e,discoverImplementationsForSpec as t,extractSpecReferences as n,inferImplementationType as r}from"./discovery.js";import{getImplementationSummary as i,resolveAllImplementations as a,resolveImplementations as o}from"./resolver.js";
@@ -1,223 +1 @@
1
- import { scanSpecSource } from "../../modules/contractspec-workspace/dist/analysis/spec-scan.js";
2
- import { discoverImplementationsForSpec } from "./discovery.js";
3
- import { createHash } from "crypto";
4
-
5
- //#region src/services/implementation/resolver.ts
6
- /**
7
- * Implementation resolver service.
8
- *
9
- * Resolves all implementations for a spec by merging:
10
- * 1. Explicit mappings from spec.implementations
11
- * 2. Auto-discovered references from workspace scanning
12
- * 3. Convention-based paths (naming conventions)
13
- */
14
- const DEFAULT_OPTIONS = {
15
- includeExplicit: true,
16
- includeDiscovered: true,
17
- includeConvention: true,
18
- computeHashes: true
19
- };
20
- /**
21
- * Convert string to kebab-case.
22
- */
23
- function toKebabCase(value) {
24
- return value.replace(/\./g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
25
- }
26
- /**
27
- * Compute SHA256 hash of content.
28
- */
29
- function computeHash(content) {
30
- return createHash("sha256").update(content).digest("hex");
31
- }
32
- /**
33
- * Get convention-based implementation paths for a spec.
34
- */
35
- function getConventionPaths(specType, specName, outputDir) {
36
- const kebab = toKebabCase(specName);
37
- const paths = [];
38
- if (specType === "operation") {
39
- paths.push({
40
- path: `${outputDir}/handlers/${kebab}.handler.ts`,
41
- type: "handler"
42
- });
43
- paths.push({
44
- path: `${outputDir}/handlers/${kebab}.handler.test.ts`,
45
- type: "test"
46
- });
47
- }
48
- if (specType === "presentation") {
49
- paths.push({
50
- path: `${outputDir}/components/${kebab}.tsx`,
51
- type: "component"
52
- });
53
- paths.push({
54
- path: `${outputDir}/components/${kebab}.test.tsx`,
55
- type: "test"
56
- });
57
- }
58
- if (specType === "form") {
59
- paths.push({
60
- path: `${outputDir}/forms/${kebab}.form.tsx`,
61
- type: "form"
62
- });
63
- paths.push({
64
- path: `${outputDir}/forms/${kebab}.form.test.tsx`,
65
- type: "test"
66
- });
67
- }
68
- if (specType === "event") {
69
- paths.push({
70
- path: `${outputDir}/handlers/${kebab}.handler.ts`,
71
- type: "handler"
72
- });
73
- paths.push({
74
- path: `${outputDir}/handlers/${kebab}.handler.test.ts`,
75
- type: "test"
76
- });
77
- }
78
- return paths;
79
- }
80
- /**
81
- * Determine overall implementation status.
82
- */
83
- function determineStatus(implementations) {
84
- if (implementations.length === 0) return "missing";
85
- const existingImpls = implementations.filter((i) => i.exists);
86
- implementations.filter((i) => i.type !== "test");
87
- if (existingImpls.filter((i) => i.type !== "test").length === 0) return "missing";
88
- if (implementations.every((i) => i.exists)) return "implemented";
89
- return "partial";
90
- }
91
- /**
92
- * Resolve all implementations for a spec file.
93
- */
94
- async function resolveImplementations(specFile, adapters, config, options = {}) {
95
- const opts = {
96
- ...DEFAULT_OPTIONS,
97
- ...options
98
- };
99
- const { fs } = adapters;
100
- if (!await fs.exists(specFile)) throw new Error(`Spec file not found: ${specFile}`);
101
- const specContent = await fs.readFile(specFile);
102
- const specHash = opts.computeHashes ? computeHash(specContent) : void 0;
103
- const scan = scanSpecSource(specContent, specFile);
104
- const specName = scan.name ?? fs.basename(specFile).replace(/\.[jt]s$/, "");
105
- const specVersion = scan.version ?? 1;
106
- const specType = scan.specType ?? "operation";
107
- const implementations = [];
108
- const seenPaths = /* @__PURE__ */ new Set();
109
- const addImpl = async (path, type, source, description) => {
110
- if (seenPaths.has(path)) return;
111
- seenPaths.add(path);
112
- const exists = await fs.exists(path);
113
- let contentHash;
114
- if (exists && opts.computeHashes) try {
115
- contentHash = computeHash(await fs.readFile(path));
116
- } catch {}
117
- implementations.push({
118
- path,
119
- type,
120
- source,
121
- exists,
122
- contentHash,
123
- description
124
- });
125
- };
126
- if (opts.includeExplicit) {
127
- const explicitImpls = parseExplicitImplementations(specContent);
128
- for (const impl of explicitImpls) await addImpl(impl.path, impl.type, "explicit", impl.description);
129
- }
130
- if (opts.includeDiscovered) {
131
- const discovered = await discoverImplementationsForSpec(specName, adapters, opts);
132
- const specNameVariants = getSpecNameVariants(specName);
133
- for (const variant of specNameVariants) {
134
- const variantDiscovered = await discoverImplementationsForSpec(variant, adapters, opts);
135
- discovered.push(...variantDiscovered);
136
- }
137
- for (const ref of discovered) {
138
- if (ref.filePath === specFile) continue;
139
- await addImpl(ref.filePath, ref.inferredType, "discovered");
140
- }
141
- }
142
- if (opts.includeConvention) {
143
- const conventionPaths = getConventionPaths(specType, specName, opts.outputDir ?? config.outputDir ?? "./src");
144
- for (const { path, type } of conventionPaths) await addImpl(path, type, "convention");
145
- }
146
- return {
147
- specName,
148
- specVersion,
149
- specPath: specFile,
150
- specType,
151
- implementations,
152
- status: determineStatus(implementations),
153
- specHash
154
- };
155
- }
156
- /**
157
- * Parse explicit implementations from spec source code.
158
- * Looks for: implementations: [{ path: '...', type: '...' }]
159
- */
160
- function parseExplicitImplementations(code) {
161
- const implementations = [];
162
- const implMatch = code.match(/implementations\s*:\s*\[([\s\S]*?)\]/);
163
- if (!implMatch) return implementations;
164
- const implBlock = implMatch[1];
165
- if (!implBlock) return implementations;
166
- const objRegex = /\{\s*path\s*:\s*['"`]([^'"`]+)['"`]\s*,\s*type\s*:\s*['"`]([^'"`]+)['"`](?:\s*,\s*description\s*:\s*['"`]([^'"`]+)['"`])?\s*\}/g;
167
- let match;
168
- while ((match = objRegex.exec(implBlock)) !== null) implementations.push({
169
- path: match[1],
170
- type: match[2],
171
- description: match[3]
172
- });
173
- return implementations;
174
- }
175
- /**
176
- * Get common variants of a spec name for discovery.
177
- */
178
- function getSpecNameVariants(specName) {
179
- const variants = [];
180
- const base = specName.replace(/Spec$/, "").replace(/Contract$/, "").replace(/Command$/, "").replace(/Query$/, "");
181
- if (base !== specName) {
182
- variants.push(base);
183
- variants.push(`${base}Spec`);
184
- variants.push(`${base}Contract`);
185
- }
186
- const parts = specName.split(".");
187
- if (parts.length > 1) {
188
- const pascalName = parts.map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join("");
189
- variants.push(pascalName);
190
- }
191
- return variants;
192
- }
193
- /**
194
- * Resolve implementations for multiple spec files.
195
- */
196
- async function resolveAllImplementations(specFiles, adapters, config, options = {}) {
197
- const results = [];
198
- for (const specFile of specFiles) try {
199
- const result = await resolveImplementations(specFile, adapters, config, options);
200
- results.push(result);
201
- } catch (error) {
202
- console.error(`Failed to resolve implementations for ${specFile}:`, error);
203
- }
204
- return results;
205
- }
206
- /**
207
- * Get implementation summary statistics.
208
- */
209
- function getImplementationSummary(results) {
210
- const implemented = results.filter((r) => r.status === "implemented").length;
211
- const partial = results.filter((r) => r.status === "partial").length;
212
- const missing = results.filter((r) => r.status === "missing").length;
213
- return {
214
- total: results.length,
215
- implemented,
216
- partial,
217
- missing,
218
- coverage: results.length > 0 ? Math.round(implemented / results.length * 100) : 100
219
- };
220
- }
221
-
222
- //#endregion
223
- export { getImplementationSummary, resolveAllImplementations, resolveImplementations };
1
+ import{discoverImplementationsForSpec as e}from"./discovery.js";import{scanSpecSource as t}from"@lssm/module.contractspec-workspace";import{createHash as n}from"crypto";const r={includeExplicit:!0,includeDiscovered:!0,includeConvention:!0,computeHashes:!0};function i(e){return e.replace(/\./g,`-`).replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function a(e){return n(`sha256`).update(e).digest(`hex`)}function o(e,t,n){let r=i(t),a=[];return e===`operation`&&(a.push({path:`${n}/handlers/${r}.handler.ts`,type:`handler`}),a.push({path:`${n}/handlers/${r}.handler.test.ts`,type:`test`})),e===`presentation`&&(a.push({path:`${n}/components/${r}.tsx`,type:`component`}),a.push({path:`${n}/components/${r}.test.tsx`,type:`test`})),e===`form`&&(a.push({path:`${n}/forms/${r}.form.tsx`,type:`form`}),a.push({path:`${n}/forms/${r}.form.test.tsx`,type:`test`})),e===`event`&&(a.push({path:`${n}/handlers/${r}.handler.ts`,type:`handler`}),a.push({path:`${n}/handlers/${r}.handler.test.ts`,type:`test`})),a}function s(e){if(e.length===0)return`missing`;let t=e.filter(e=>e.exists);return e.filter(e=>e.type!==`test`),t.filter(e=>e.type!==`test`).length===0?`missing`:e.every(e=>e.exists)?`implemented`:`partial`}async function c(n,i,c,d={}){let f={...r,...d},{fs:p}=i;if(!await p.exists(n))throw Error(`Spec file not found: ${n}`);let m=await p.readFile(n),h=f.computeHashes?a(m):void 0,g=t(m,n),_=g.name??p.basename(n).replace(/\.[jt]s$/,``),v=g.version??1,y=g.specType??`operation`,b=[],x=new Set,S=async(e,t,n,r)=>{if(x.has(e))return;x.add(e);let i=await p.exists(e),o;if(i&&f.computeHashes)try{o=a(await p.readFile(e))}catch{}b.push({path:e,type:t,source:n,exists:i,contentHash:o,description:r})};if(f.includeExplicit){let e=l(m);for(let t of e)await S(t.path,t.type,`explicit`,t.description)}if(f.includeDiscovered){let t=await e(_,i,f),r=u(_);for(let n of r){let r=await e(n,i,f);t.push(...r)}for(let e of t)e.filePath!==n&&await S(e.filePath,e.inferredType,`discovered`)}if(f.includeConvention){let e=o(y,_,f.outputDir??c.outputDir??`./src`);for(let{path:t,type:n}of e)await S(t,n,`convention`)}return{specName:_,specVersion:v,specPath:n,specType:y,implementations:b,status:s(b),specHash:h}}function l(e){let t=[],n=e.match(/implementations\s*:\s*\[([\s\S]*?)\]/);if(!n)return t;let r=n[1];if(!r)return t;let i=/\{\s*path\s*:\s*['"`]([^'"`]+)['"`]\s*,\s*type\s*:\s*['"`]([^'"`]+)['"`](?:\s*,\s*description\s*:\s*['"`]([^'"`]+)['"`])?\s*\}/g,a;for(;(a=i.exec(r))!==null;)t.push({path:a[1],type:a[2],description:a[3]});return t}function u(e){let t=[],n=e.replace(/Spec$/,``).replace(/Contract$/,``).replace(/Command$/,``).replace(/Query$/,``);n!==e&&(t.push(n),t.push(`${n}Spec`),t.push(`${n}Contract`));let r=e.split(`.`);if(r.length>1){let e=r.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``);t.push(e)}return t}async function d(e,t,n,r={}){let i=[];for(let a of e)try{let e=await c(a,t,n,r);i.push(e)}catch(e){console.error(`Failed to resolve implementations for ${a}:`,e)}return i}function f(e){let t=e.filter(e=>e.status===`implemented`).length,n=e.filter(e=>e.status===`partial`).length,r=e.filter(e=>e.status===`missing`).length;return{total:e.length,implemented:t,partial:n,missing:r,coverage:e.length>0?Math.round(t/e.length*100):100}}export{f as getImplementationSummary,d as resolveAllImplementations,c as resolveImplementations};
@@ -1,53 +1 @@
1
- import { detectPackageManager, findPackageRoot, findWorkspaceRoot, getWorkspaceInfo } from "../adapters/workspace.js";
2
- import { validateSpec, validateSpecs } from "./validate.js";
3
- import { validateImplementationFiles } from "./validate-implementation.js";
4
- import { compareSpecs } from "./diff.js";
5
- import { analyzeDeps, exportGraphAsDot, getContractNode, getGraphStats } from "./deps.js";
6
- import { groupSpecsByType, listSpecs } from "./list.js";
7
- import { getApiKey, loadWorkspaceConfig, mergeWorkspaceConfig } from "./config.js";
8
- import { buildSpec } from "./build.js";
9
- import { importFromOpenApiService } from "./openapi/import-service.js";
10
- import { syncWithOpenApiService } from "./openapi/sync-service.js";
11
- import { validateAgainstOpenApiService } from "./openapi/validate-service.js";
12
- import { exportOpenApi } from "./openapi/export-service.js";
13
- import "./openapi/index.js";
14
- import { RegistryClient, addToRegistry, listFromRegistry, resolveRegistryUrl, searchRegistry } from "./registry.js";
15
- import { syncSpecs } from "./sync.js";
16
- import { watchSpecs } from "./watch.js";
17
- import { cleanArtifacts } from "./clean.js";
18
- import { runTests } from "./test.js";
19
- import { createRegeneratorService } from "./regenerator.js";
20
- import { findAllConfigFiles, formatWorkspaceInfo, getExtendedWorkspaceInfo, mergeMonorepoConfigs } from "./workspace-info.js";
21
- import { analyzeIntegrity, filterIssuesBySeverity, filterIssuesByType, getAllSpecs } from "./integrity.js";
22
- import { generateMermaidDiagram } from "./integrity-diagram.js";
23
- import { ALL_SETUP_TARGETS, SETUP_TARGET_LABELS } from "./setup/types.js";
24
- import { generateAgentsMd, generateClaudeMcpConfig, generateContractsrcConfig, generateCursorMcpConfig, generateCursorRules, generateVscodeSettings, getClaudeDesktopConfigPath } from "./setup/config-generators.js";
25
- import { deepMergeOverwrite, deepMergePreserve, formatJson, safeParseJson } from "./setup/file-merger.js";
26
- import { runSetup } from "./setup/setup-service.js";
27
- import "./setup/index.js";
28
- import { ALL_CHECK_CATEGORIES, CHECK_CATEGORY_LABELS } from "./doctor/types.js";
29
- import { formatCheckResult, formatDoctorSummary, runDoctor } from "./doctor/doctor-service.js";
30
- import "./doctor/index.js";
31
- import { ALL_CI_CHECK_CATEGORIES, CI_CHECK_CATEGORY_LABELS } from "./ci-check/types.js";
32
- import { discoverAllImplementations, discoverImplementationsForSpec, extractSpecReferences, inferImplementationType } from "./implementation/discovery.js";
33
- import { getImplementationSummary, resolveAllImplementations, resolveImplementations } from "./implementation/resolver.js";
34
- import { DEFAULT_CACHE_CONFIG } from "./verification-cache/types.js";
35
- import { VerificationCacheService, cacheKeyToString, computeContentHash, createVerificationCacheService, stringToCacheKey } from "./verification-cache/cache-service.js";
36
- import { InMemoryCacheStorage, createInMemoryCacheStorage } from "./verification-cache/adapters/in-memory.js";
37
- import { FileSystemCacheStorage, createFileSystemCacheStorage } from "./verification-cache/adapters/filesystem.js";
38
- import { WorkspaceStateCacheStorage, createWorkspaceStateCacheStorage } from "./verification-cache/adapters/workspace-state.js";
39
- import "./verification-cache/index.js";
40
- import { runCIChecks } from "./ci-check/ci-check-service.js";
41
- import "./ci-check/index.js";
42
- import { ClaudeCodeAdapter, claudeCodeAdapter } from "./agent-guide/adapters/claude-code.js";
43
- import { CursorCLIAdapter, cursorCLIAdapter } from "./agent-guide/adapters/cursor-cli.js";
44
- import { GenericMCPAdapter, genericMCPAdapter } from "./agent-guide/adapters/generic-mcp.js";
45
- import { agentAdapters, getAgentAdapter, listAgentTypes } from "./agent-guide/adapters/index.js";
46
- import { AgentGuideService, agentGuideService, createAgentGuideService } from "./agent-guide/agent-guide-service.js";
47
- import "./agent-guide/index.js";
48
- import { verifyStructure } from "./verify/structure-verifier.js";
49
- import { verifyBehavior } from "./verify/behavior-verifier.js";
50
- import { createQuickAIReview, verifySemanticFields, verifyWithAI, verifyWithAIEnhanced } from "./verify/ai-verifier.js";
51
- import { VerifyService, createVerifyService, verifyService } from "./verify/verify-service.js";
52
- import "./verify/index.js";
53
- import "./implementation/index.js";
1
+ import{detectPackageManager as e,findPackageRoot as t,findWorkspaceRoot as n,getWorkspaceInfo as r}from"../adapters/workspace.js";import{validateSpec as i,validateSpecs as a}from"./validate.js";import{validateImplementationFiles as o}from"./validate-implementation.js";import{compareSpecs as s}from"./diff.js";import{analyzeDeps as c,exportGraphAsDot as l,getContractNode as u,getGraphStats as d}from"./deps.js";import{groupSpecsByType as f,listSpecs as p}from"./list.js";import{getApiKey as m,loadWorkspaceConfig as h,mergeWorkspaceConfig as g}from"./config.js";import{buildSpec as _}from"./build.js";import{importFromOpenApiService as v}from"./openapi/import-service.js";import{syncWithOpenApiService as y}from"./openapi/sync-service.js";import{validateAgainstOpenApiService as b}from"./openapi/validate-service.js";import{exportOpenApi as x}from"./openapi/export-service.js";import"./openapi/index.js";import{RegistryClient as S,addToRegistry as C,listFromRegistry as w,resolveRegistryUrl as T,searchRegistry as E}from"./registry.js";import{syncSpecs as D}from"./sync.js";import{watchSpecs as O}from"./watch.js";import{cleanArtifacts as k}from"./clean.js";import{runTests as A}from"./test.js";import{createRegeneratorService as j}from"./regenerator.js";import{findAllConfigFiles as M,formatWorkspaceInfo as N,getExtendedWorkspaceInfo as P,mergeMonorepoConfigs as F}from"./workspace-info.js";import{analyzeIntegrity as I,filterIssuesBySeverity as L,filterIssuesByType as R,getAllSpecs as z}from"./integrity.js";import{generateMermaidDiagram as B}from"./integrity-diagram.js";import{ALL_SETUP_TARGETS as V,SETUP_TARGET_LABELS as H}from"./setup/types.js";import{generateAgentsMd as U,generateClaudeMcpConfig as W,generateContractsrcConfig as G,generateCursorMcpConfig as K,generateCursorRules as q,generateVscodeSettings as J,getClaudeDesktopConfigPath as Y}from"./setup/config-generators.js";import{deepMergeOverwrite as X,deepMergePreserve as Z,formatJson as Q,safeParseJson as $}from"./setup/file-merger.js";import{runSetup as ee}from"./setup/setup-service.js";import"./setup/index.js";import{ALL_CHECK_CATEGORIES as te,CHECK_CATEGORY_LABELS as ne}from"./doctor/types.js";import{formatCheckResult as re,formatDoctorSummary as ie,runDoctor as ae}from"./doctor/doctor-service.js";import"./doctor/index.js";import{ALL_CI_CHECK_CATEGORIES as oe,CI_CHECK_CATEGORY_LABELS as se}from"./ci-check/types.js";import{discoverAllImplementations as ce,discoverImplementationsForSpec as le,extractSpecReferences as ue,inferImplementationType as de}from"./implementation/discovery.js";import{getImplementationSummary as fe,resolveAllImplementations as pe,resolveImplementations as me}from"./implementation/resolver.js";import{DEFAULT_CACHE_CONFIG as he}from"./verification-cache/types.js";import{VerificationCacheService as ge,cacheKeyToString as _e,computeContentHash as ve,createVerificationCacheService as ye,stringToCacheKey as be}from"./verification-cache/cache-service.js";import{InMemoryCacheStorage as xe,createInMemoryCacheStorage as Se}from"./verification-cache/adapters/in-memory.js";import{FileSystemCacheStorage as Ce,createFileSystemCacheStorage as we}from"./verification-cache/adapters/filesystem.js";import{WorkspaceStateCacheStorage as Te,createWorkspaceStateCacheStorage as Ee}from"./verification-cache/adapters/workspace-state.js";import"./verification-cache/index.js";import{runCIChecks as De}from"./ci-check/ci-check-service.js";import"./ci-check/index.js";import{ClaudeCodeAdapter as Oe,claudeCodeAdapter as ke}from"./agent-guide/adapters/claude-code.js";import{CursorCLIAdapter as Ae,cursorCLIAdapter as je}from"./agent-guide/adapters/cursor-cli.js";import{GenericMCPAdapter as Me,genericMCPAdapter as Ne}from"./agent-guide/adapters/generic-mcp.js";import{agentAdapters as Pe,getAgentAdapter as Fe,listAgentTypes as Ie}from"./agent-guide/adapters/index.js";import{AgentGuideService as Le,agentGuideService as Re,createAgentGuideService as ze}from"./agent-guide/agent-guide-service.js";import"./agent-guide/index.js";import{verifyStructure as Be}from"./verify/structure-verifier.js";import{verifyBehavior as Ve}from"./verify/behavior-verifier.js";import{createQuickAIReview as He,verifySemanticFields as Ue,verifyWithAI as We,verifyWithAIEnhanced as Ge}from"./verify/ai-verifier.js";import{VerifyService as Ke,createVerifyService as qe,verifyService as Je}from"./verify/verify-service.js";import"./verify/index.js";import"./implementation/index.js";