@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,195 +1,2 @@
1
- import { isEmitDeclRef } from "../../libs/contracts/dist/spec.js";
2
-
3
- //#region src/services/verify/structure-verifier.ts
4
- /**
5
- * Check if code exports a handler function.
6
- */
7
- function checkHandlerExport(code) {
8
- const hasExport = /export\s+(async\s+)?function\s+\w+/.test(code) || /export\s+const\s+\w+\s*=\s*(async\s*)?\(/.test(code) || /export\s+default\s+(async\s+)?function/.test(code) || /export\s+\{\s*\w+/.test(code);
9
- return {
10
- name: "handler_export",
11
- passed: hasExport,
12
- details: hasExport ? void 0 : "No exported handler function found",
13
- suggestion: "Export a function that handles the operation: export async function handle(...) { }"
14
- };
15
- }
16
- /**
17
- * Check if code imports from @lssm/lib.contracts.
18
- */
19
- function checkContractsImport(code) {
20
- const hasImport = code.includes("from '@lssm/lib.contracts'") || code.includes("from \"@lssm/lib.contracts\"");
21
- return {
22
- name: "contracts_import",
23
- passed: hasImport,
24
- details: hasImport ? void 0 : "Missing import from @lssm/lib.contracts",
25
- suggestion: "Add: import { ... } from '@lssm/lib.contracts';"
26
- };
27
- }
28
- /**
29
- * Check if code imports from @lssm/lib.schema.
30
- */
31
- function checkSchemaImport(code, spec) {
32
- if (!(spec.io.input !== null || spec.io.output !== null)) return {
33
- name: "schema_import",
34
- passed: true
35
- };
36
- const hasImport = code.includes("from '@lssm/lib.schema'") || code.includes("from \"@lssm/lib.schema\"");
37
- return {
38
- name: "schema_import",
39
- passed: hasImport,
40
- details: hasImport ? void 0 : "Missing import from @lssm/lib.schema",
41
- suggestion: "Add: import { ... } from '@lssm/lib.schema';"
42
- };
43
- }
44
- /**
45
- * Check for TypeScript any usage.
46
- */
47
- function checkNoAnyType(code) {
48
- const anyPattern = /:\s*any\b|as\s+any\b|<any>/;
49
- const lines = code.split("\n");
50
- const anyUsages = [];
51
- for (let i = 0; i < lines.length; i++) {
52
- const line = lines[i] ?? "";
53
- if (line.trim().startsWith("//") || line.trim().startsWith("*")) continue;
54
- if (anyPattern.test(line)) anyUsages.push(i + 1);
55
- }
56
- return {
57
- name: "no_any_type",
58
- passed: anyUsages.length === 0,
59
- details: anyUsages.length > 0 ? `Found 'any' type on lines: ${anyUsages.slice(0, 5).join(", ")}${anyUsages.length > 5 ? "..." : ""}` : void 0,
60
- suggestion: "Replace any with proper types from the spec schema"
61
- };
62
- }
63
- /**
64
- * Check if error codes from spec are handled.
65
- */
66
- function checkErrorHandling(code, spec) {
67
- const errors = spec.io.errors;
68
- if (!errors || Object.keys(errors).length === 0) return {
69
- name: "error_handling",
70
- passed: true
71
- };
72
- const errorCodes = Object.keys(errors);
73
- const missingErrors = [];
74
- for (const errorCode of errorCodes) if (!code.includes(errorCode)) missingErrors.push(errorCode);
75
- return {
76
- name: "error_handling",
77
- passed: missingErrors.length === 0,
78
- details: missingErrors.length > 0 ? `Missing error handling for: ${missingErrors.join(", ")}` : void 0,
79
- suggestion: "Implement handlers for all error cases defined in the spec"
80
- };
81
- }
82
- /**
83
- * Check if events are emitted.
84
- */
85
- function checkEventEmission(code, spec) {
86
- const events = spec.sideEffects?.emits;
87
- if (!events || events.length === 0) return {
88
- name: "event_emission",
89
- passed: true
90
- };
91
- const hasEmitPattern = code.includes("emit(") || code.includes(".emit(") || code.includes("publish(") || code.includes(".publish(") || code.includes("dispatchEvent") || code.includes("eventBus");
92
- const eventNames = events.map((e) => {
93
- if (isEmitDeclRef(e)) return e.ref.name;
94
- return e.name;
95
- });
96
- const mentionedEvents = eventNames.filter((name) => code.includes(name));
97
- return {
98
- name: "event_emission",
99
- passed: hasEmitPattern && mentionedEvents.length > 0,
100
- details: !hasEmitPattern ? "No event emission pattern found" : mentionedEvents.length === 0 ? `Events not referenced: ${eventNames.join(", ")}` : void 0,
101
- suggestion: "Emit events as specified in sideEffects.emits"
102
- };
103
- }
104
- /**
105
- * Check for validation of input.
106
- */
107
- function checkInputValidation(code, spec) {
108
- if (!spec.io.input) return {
109
- name: "input_validation",
110
- passed: true
111
- };
112
- const hasValidation = code.includes(".parse(") || code.includes(".safeParse(") || code.includes("validate(") || code.includes(".validate(") || code.includes("schema.") || code.includes("zodSchema") || code.includes(".getZod()");
113
- return {
114
- name: "input_validation",
115
- passed: hasValidation,
116
- details: hasValidation ? void 0 : "No input validation pattern found",
117
- suggestion: "Validate input using the schema: schema.parse(input) or schema.safeParse(input)"
118
- };
119
- }
120
- /**
121
- * Check for async/await usage on async operations.
122
- */
123
- function checkAsyncPatterns(code, spec) {
124
- const isAsync = /export\s+(const\s+\w+\s*=\s*)?async/.test(code) || /async\s+function/.test(code);
125
- if (!(spec.meta.kind === "command")) return {
126
- name: "async_patterns",
127
- passed: true
128
- };
129
- return {
130
- name: "async_patterns",
131
- passed: isAsync,
132
- details: isAsync ? void 0 : "Handler should be async for command operations",
133
- suggestion: "Make the handler function async: export async function handle(...)"
134
- };
135
- }
136
- /**
137
- * Run all structure checks and produce a verification report.
138
- */
139
- function verifyStructure(input) {
140
- const { spec, implementationCode, implementationPath } = input;
141
- const startTime = Date.now();
142
- const checks = [
143
- checkHandlerExport(implementationCode),
144
- checkContractsImport(implementationCode),
145
- checkSchemaImport(implementationCode, spec),
146
- checkNoAnyType(implementationCode),
147
- checkErrorHandling(implementationCode, spec),
148
- checkEventEmission(implementationCode, spec),
149
- checkInputValidation(implementationCode, spec),
150
- checkAsyncPatterns(implementationCode, spec)
151
- ];
152
- const issues = checks.filter((c) => !c.passed).map((c) => ({
153
- severity: c.name === "no_any_type" ? "warning" : "error",
154
- category: c.name.includes("import") ? "import" : c.name.includes("export") ? "export" : "type",
155
- message: c.details ?? `Check failed: ${c.name}`,
156
- location: implementationPath ? { file: implementationPath } : void 0,
157
- suggestion: c.suggestion
158
- }));
159
- const passedCount = checks.filter((c) => c.passed).length;
160
- const score = Math.round(passedCount / checks.length * 100);
161
- const passed = issues.filter((i) => i.severity === "error").length === 0;
162
- const suggestions = checks.filter((c) => !c.passed && c.suggestion).map((c) => c.suggestion);
163
- const errorCount = Object.keys(spec.io.errors ?? {}).length;
164
- return {
165
- tier: "structure",
166
- passed,
167
- score,
168
- issues,
169
- suggestions,
170
- coverage: {
171
- scenarios: {
172
- total: 0,
173
- covered: 0
174
- },
175
- errors: {
176
- total: errorCount,
177
- handled: checks.find((c) => c.name === "error_handling")?.passed ? errorCount : 0
178
- },
179
- fields: {
180
- total: checks.length,
181
- implemented: passedCount
182
- }
183
- },
184
- meta: {
185
- specName: spec.meta.name,
186
- specVersion: spec.meta.version,
187
- implementationPath: implementationPath ?? "unknown",
188
- verifiedAt: (/* @__PURE__ */ new Date()).toISOString(),
189
- duration: Date.now() - startTime
190
- }
191
- };
192
- }
193
-
194
- //#endregion
195
- export { verifyStructure };
1
+ import{isEmitDeclRef as e}from"@lssm/lib.contracts/spec";function t(e){let t=/export\s+(async\s+)?function\s+\w+/.test(e)||/export\s+const\s+\w+\s*=\s*(async\s*)?\(/.test(e)||/export\s+default\s+(async\s+)?function/.test(e)||/export\s+\{\s*\w+/.test(e);return{name:`handler_export`,passed:t,details:t?void 0:`No exported handler function found`,suggestion:`Export a function that handles the operation: export async function handle(...) { }`}}function n(e){let t=e.includes(`from '@lssm/lib.contracts'`)||e.includes(`from "@lssm/lib.contracts"`);return{name:`contracts_import`,passed:t,details:t?void 0:`Missing import from @lssm/lib.contracts`,suggestion:`Add: import { ... } from '@lssm/lib.contracts';`}}function r(e,t){if(!(t.io.input!==null||t.io.output!==null))return{name:`schema_import`,passed:!0};let n=e.includes(`from '@lssm/lib.schema'`)||e.includes(`from "@lssm/lib.schema"`);return{name:`schema_import`,passed:n,details:n?void 0:`Missing import from @lssm/lib.schema`,suggestion:`Add: import { ... } from '@lssm/lib.schema';`}}function i(e){let t=/:\s*any\b|as\s+any\b|<any>/,n=e.split(`
2
+ `),r=[];for(let e=0;e<n.length;e++){let i=n[e]??``;i.trim().startsWith(`//`)||i.trim().startsWith(`*`)||t.test(i)&&r.push(e+1)}return{name:`no_any_type`,passed:r.length===0,details:r.length>0?`Found 'any' type on lines: ${r.slice(0,5).join(`, `)}${r.length>5?`...`:``}`:void 0,suggestion:`Replace any with proper types from the spec schema`}}function a(e,t){let n=t.io.errors;if(!n||Object.keys(n).length===0)return{name:`error_handling`,passed:!0};let r=Object.keys(n),i=[];for(let t of r)e.includes(t)||i.push(t);return{name:`error_handling`,passed:i.length===0,details:i.length>0?`Missing error handling for: ${i.join(`, `)}`:void 0,suggestion:`Implement handlers for all error cases defined in the spec`}}function o(t,n){let r=n.sideEffects?.emits;if(!r||r.length===0)return{name:`event_emission`,passed:!0};let i=t.includes(`emit(`)||t.includes(`.emit(`)||t.includes(`publish(`)||t.includes(`.publish(`)||t.includes(`dispatchEvent`)||t.includes(`eventBus`),a=r.map(t=>e(t)?t.ref.name:t.name),o=a.filter(e=>t.includes(e));return{name:`event_emission`,passed:i&&o.length>0,details:i?o.length===0?`Events not referenced: ${a.join(`, `)}`:void 0:`No event emission pattern found`,suggestion:`Emit events as specified in sideEffects.emits`}}function s(e,t){if(!t.io.input)return{name:`input_validation`,passed:!0};let n=e.includes(`.parse(`)||e.includes(`.safeParse(`)||e.includes(`validate(`)||e.includes(`.validate(`)||e.includes(`schema.`)||e.includes(`zodSchema`)||e.includes(`.getZod()`);return{name:`input_validation`,passed:n,details:n?void 0:`No input validation pattern found`,suggestion:`Validate input using the schema: schema.parse(input) or schema.safeParse(input)`}}function c(e,t){let n=/export\s+(const\s+\w+\s*=\s*)?async/.test(e)||/async\s+function/.test(e);return t.meta.kind===`command`?{name:`async_patterns`,passed:n,details:n?void 0:`Handler should be async for command operations`,suggestion:`Make the handler function async: export async function handle(...)`}:{name:`async_patterns`,passed:!0}}function l(e){let{spec:l,implementationCode:u,implementationPath:d}=e,f=Date.now(),p=[t(u),n(u),r(u,l),i(u),a(u,l),o(u,l),s(u,l),c(u,l)],m=p.filter(e=>!e.passed).map(e=>({severity:e.name===`no_any_type`?`warning`:`error`,category:e.name.includes(`import`)?`import`:e.name.includes(`export`)?`export`:`type`,message:e.details??`Check failed: ${e.name}`,location:d?{file:d}:void 0,suggestion:e.suggestion})),h=p.filter(e=>e.passed).length,g=Math.round(h/p.length*100),_=m.filter(e=>e.severity===`error`).length===0,v=p.filter(e=>!e.passed&&e.suggestion).map(e=>e.suggestion),y=Object.keys(l.io.errors??{}).length;return{tier:`structure`,passed:_,score:g,issues:m,suggestions:v,coverage:{scenarios:{total:0,covered:0},errors:{total:y,handled:p.find(e=>e.name===`error_handling`)?.passed?y:0},fields:{total:p.length,implemented:h}},meta:{specName:l.meta.name,specVersion:l.meta.version,implementationPath:d??`unknown`,verifiedAt:new Date().toISOString(),duration:Date.now()-f}}}export{l as verifyStructure};
@@ -1,203 +1,3 @@
1
- import { verifyStructure } from "./structure-verifier.js";
2
- import { verifyBehavior } from "./behavior-verifier.js";
3
- import { createQuickAIReview, verifyWithAI } from "./ai-verifier.js";
4
-
5
- //#region src/services/verify/verify-service.ts
6
- const DEFAULT_CONFIG = { verbose: false };
7
- const TIER_ORDER = [
8
- "structure",
9
- "behavior",
10
- "ai_review"
11
- ];
12
- /**
13
- * Verification Service
14
- *
15
- * Main service for verifying implementations against specs.
16
- */
17
- var VerifyService = class {
18
- config;
19
- constructor(config = {}) {
20
- this.config = {
21
- ...DEFAULT_CONFIG,
22
- ...config
23
- };
24
- }
25
- /**
26
- * Run verification on an implementation.
27
- */
28
- async verify(spec, implementationCode, options = {}) {
29
- const startTime = Date.now();
30
- const reports = /* @__PURE__ */ new Map();
31
- const allIssues = [];
32
- const input = {
33
- spec,
34
- implementationCode
35
- };
36
- const tiersToRun = options.tiers ?? ["structure", "behavior"];
37
- for (const tier of TIER_ORDER) {
38
- if (!tiersToRun.includes(tier)) continue;
39
- let report;
40
- switch (tier) {
41
- case "structure":
42
- report = verifyStructure(input);
43
- break;
44
- case "behavior":
45
- report = verifyBehavior(input);
46
- break;
47
- case "ai_review":
48
- if (this.config.aiApiKey) report = await verifyWithAI(input, this.config);
49
- else report = createQuickAIReview(input);
50
- break;
51
- default: continue;
52
- }
53
- reports.set(tier, report);
54
- allIssues.push(...report.issues);
55
- if (options.failFast && !report.passed) break;
56
- }
57
- const reportsArray = Array.from(reports.values());
58
- return {
59
- passed: reportsArray.every((r) => r.passed),
60
- score: reportsArray.length > 0 ? Math.round(reportsArray.reduce((sum, r) => sum + r.score, 0) / reportsArray.length) : 100,
61
- reports,
62
- allIssues,
63
- summary: this.generateSummary(reportsArray, allIssues),
64
- duration: Date.now() - startTime
65
- };
66
- }
67
- /**
68
- * Run only structure verification (Tier 1).
69
- */
70
- verifyStructure(spec, implementationCode, implementationPath) {
71
- return verifyStructure({
72
- spec,
73
- implementationCode,
74
- implementationPath
75
- });
76
- }
77
- /**
78
- * Run only behavior verification (Tier 2).
79
- */
80
- verifyBehavior(spec, implementationCode, implementationPath) {
81
- return verifyBehavior({
82
- spec,
83
- implementationCode,
84
- implementationPath
85
- });
86
- }
87
- /**
88
- * Run only AI verification (Tier 3).
89
- */
90
- async verifyAI(spec, implementationCode, implementationPath) {
91
- const input = {
92
- spec,
93
- implementationCode,
94
- implementationPath
95
- };
96
- if (this.config.aiApiKey) return verifyWithAI(input, this.config);
97
- return createQuickAIReview(input);
98
- }
99
- /**
100
- * Quick verification (structure only, fast).
101
- */
102
- quickVerify(spec, implementationCode) {
103
- return verifyStructure({
104
- spec,
105
- implementationCode
106
- });
107
- }
108
- /**
109
- * Generate a human-readable summary of verification results.
110
- */
111
- generateSummary(reports, allIssues) {
112
- const parts = [];
113
- const passed = reports.every((r) => r.passed);
114
- const avgScore = reports.length > 0 ? Math.round(reports.reduce((sum, r) => sum + r.score, 0) / reports.length) : 100;
115
- parts.push(passed ? "✓ Verification passed" : "✗ Verification failed");
116
- parts.push(`Score: ${avgScore}/100`);
117
- parts.push("");
118
- for (const report of reports) {
119
- const icon = report.passed ? "✓" : "✗";
120
- parts.push(`${icon} ${report.tier}: ${report.score}/100`);
121
- }
122
- parts.push("");
123
- const errors = allIssues.filter((i) => i.severity === "error");
124
- const warnings = allIssues.filter((i) => i.severity === "warning");
125
- const infos = allIssues.filter((i) => i.severity === "info");
126
- if (errors.length > 0) parts.push(`Errors: ${errors.length}`);
127
- if (warnings.length > 0) parts.push(`Warnings: ${warnings.length}`);
128
- if (infos.length > 0) parts.push(`Info: ${infos.length}`);
129
- return parts.join("\n");
130
- }
131
- /**
132
- * Format verification result as markdown.
133
- */
134
- formatAsMarkdown(result) {
135
- const lines = [];
136
- lines.push(`# Verification Report`);
137
- lines.push("");
138
- lines.push(`**Status:** ${result.passed ? "✓ Passed" : "✗ Failed"}`);
139
- lines.push(`**Score:** ${result.score}/100`);
140
- lines.push(`**Duration:** ${result.duration}ms`);
141
- lines.push("");
142
- for (const [tier, report] of result.reports) {
143
- lines.push(`## ${this.formatTierName(tier)}`);
144
- lines.push("");
145
- lines.push(`**Status:** ${report.passed ? "✓ Passed" : "✗ Failed"}`);
146
- lines.push(`**Score:** ${report.score}/100`);
147
- lines.push("");
148
- if (report.issues.length > 0) {
149
- lines.push("### Issues");
150
- lines.push("");
151
- for (const issue of report.issues) {
152
- const icon = issue.severity === "error" ? "❌" : issue.severity === "warning" ? "⚠️" : "ℹ️";
153
- lines.push(`${icon} **${issue.category}**: ${issue.message}`);
154
- if (issue.suggestion) lines.push(` - Suggestion: ${issue.suggestion}`);
155
- }
156
- lines.push("");
157
- }
158
- if (report.coverage.scenarios.total > 0) lines.push(`**Scenarios:** ${report.coverage.scenarios.covered}/${report.coverage.scenarios.total}`);
159
- if (report.coverage.errors.total > 0) lines.push(`**Errors handled:** ${report.coverage.errors.handled}/${report.coverage.errors.total}`);
160
- lines.push("");
161
- }
162
- const allSuggestions = Array.from(result.reports.values()).flatMap((r) => r.suggestions);
163
- if (allSuggestions.length > 0) {
164
- lines.push("## Suggestions");
165
- lines.push("");
166
- for (const suggestion of allSuggestions.slice(0, 10)) lines.push(`- ${suggestion}`);
167
- if (allSuggestions.length > 10) lines.push(`- ... and ${allSuggestions.length - 10} more`);
168
- lines.push("");
169
- }
170
- return lines.join("\n");
171
- }
172
- /**
173
- * Format tier name for display.
174
- */
175
- formatTierName(tier) {
176
- switch (tier) {
177
- case "structure": return "Tier 1: Structure";
178
- case "behavior": return "Tier 2: Behavior";
179
- case "ai_review": return "Tier 3: AI Review";
180
- default: return tier;
181
- }
182
- }
183
- /**
184
- * Update configuration.
185
- */
186
- configure(config) {
187
- this.config = {
188
- ...this.config,
189
- ...config
190
- };
191
- }
192
- };
193
- /**
194
- * Create a new VerifyService instance.
195
- */
196
- function createVerifyService(config) {
197
- return new VerifyService(config);
198
- }
199
- /** Default singleton instance */
200
- const verifyService = new VerifyService();
201
-
202
- //#endregion
203
- export { VerifyService, createVerifyService, verifyService };
1
+ import{verifyStructure as e}from"./structure-verifier.js";import{verifyBehavior as t}from"./behavior-verifier.js";import{createQuickAIReview as n,verifyWithAI as r}from"./ai-verifier.js";const i={verbose:!1},a=[`structure`,`behavior`,`ai_review`];var o=class{config;constructor(e={}){this.config={...i,...e}}async verify(i,o,s={}){let c=Date.now(),l=new Map,u=[],d={spec:i,implementationCode:o},f=s.tiers??[`structure`,`behavior`];for(let i of a){if(!f.includes(i))continue;let a;switch(i){case`structure`:a=e(d);break;case`behavior`:a=t(d);break;case`ai_review`:a=this.config.aiApiKey?await r(d,this.config):n(d);break;default:continue}if(l.set(i,a),u.push(...a.issues),s.failFast&&!a.passed)break}let p=Array.from(l.values());return{passed:p.every(e=>e.passed),score:p.length>0?Math.round(p.reduce((e,t)=>e+t.score,0)/p.length):100,reports:l,allIssues:u,summary:this.generateSummary(p,u),duration:Date.now()-c}}verifyStructure(t,n,r){return e({spec:t,implementationCode:n,implementationPath:r})}verifyBehavior(e,n,r){return t({spec:e,implementationCode:n,implementationPath:r})}async verifyAI(e,t,i){let a={spec:e,implementationCode:t,implementationPath:i};return this.config.aiApiKey?r(a,this.config):n(a)}quickVerify(t,n){return e({spec:t,implementationCode:n})}generateSummary(e,t){let n=[],r=e.every(e=>e.passed),i=e.length>0?Math.round(e.reduce((e,t)=>e+t.score,0)/e.length):100;n.push(r?`✓ Verification passed`:`✗ Verification failed`),n.push(`Score: ${i}/100`),n.push(``);for(let t of e){let e=t.passed?`✓`:`✗`;n.push(`${e} ${t.tier}: ${t.score}/100`)}n.push(``);let a=t.filter(e=>e.severity===`error`),o=t.filter(e=>e.severity===`warning`),s=t.filter(e=>e.severity===`info`);return a.length>0&&n.push(`Errors: ${a.length}`),o.length>0&&n.push(`Warnings: ${o.length}`),s.length>0&&n.push(`Info: ${s.length}`),n.join(`
2
+ `)}formatAsMarkdown(e){let t=[];t.push(`# Verification Report`),t.push(``),t.push(`**Status:** ${e.passed?`✓ Passed`:`✗ Failed`}`),t.push(`**Score:** ${e.score}/100`),t.push(`**Duration:** ${e.duration}ms`),t.push(``);for(let[n,r]of e.reports){if(t.push(`## ${this.formatTierName(n)}`),t.push(``),t.push(`**Status:** ${r.passed?`✓ Passed`:`✗ Failed`}`),t.push(`**Score:** ${r.score}/100`),t.push(``),r.issues.length>0){t.push(`### Issues`),t.push(``);for(let e of r.issues){let n=e.severity===`error`?`❌`:e.severity===`warning`?`⚠️`:`ℹ️`;t.push(`${n} **${e.category}**: ${e.message}`),e.suggestion&&t.push(` - Suggestion: ${e.suggestion}`)}t.push(``)}r.coverage.scenarios.total>0&&t.push(`**Scenarios:** ${r.coverage.scenarios.covered}/${r.coverage.scenarios.total}`),r.coverage.errors.total>0&&t.push(`**Errors handled:** ${r.coverage.errors.handled}/${r.coverage.errors.total}`),t.push(``)}let n=Array.from(e.reports.values()).flatMap(e=>e.suggestions);if(n.length>0){t.push(`## Suggestions`),t.push(``);for(let e of n.slice(0,10))t.push(`- ${e}`);n.length>10&&t.push(`- ... and ${n.length-10} more`),t.push(``)}return t.join(`
3
+ `)}formatTierName(e){switch(e){case`structure`:return`Tier 1: Structure`;case`behavior`:return`Tier 2: Behavior`;case`ai_review`:return`Tier 3: AI Review`;default:return e}}configure(e){this.config={...this.config,...e}}};function s(e){return new o(e)}const c=new o;export{o as VerifyService,s as createVerifyService,c as verifyService};
@@ -1,31 +1 @@
1
- import { validateSpec } from "./validate.js";
2
- import { buildSpec } from "./build.js";
3
-
4
- //#region src/services/watch.ts
5
- function watchSpecs(adapters, config, options, overrides) {
6
- const { watcher, fs, logger } = adapters;
7
- const w = watcher.watch(options);
8
- const validateFn = overrides?.validate ?? (async (specPath) => {
9
- await validateSpec(specPath, {
10
- fs,
11
- logger
12
- });
13
- });
14
- const buildFn = overrides?.build ?? (async (specPath) => {
15
- await buildSpec(specPath, {
16
- fs,
17
- logger
18
- }, config);
19
- });
20
- w.on(async (event) => {
21
- if (event.type !== "change") return;
22
- logger.info("watchSpecs.changed", { path: event.path });
23
- if (options.runValidate) await validateFn(event.path);
24
- if (options.runBuild) if (options.dryRun) logger.info("[dry-run] watchSpecs skipped build", { path: event.path });
25
- else await buildFn(event.path);
26
- });
27
- return w;
28
- }
29
-
30
- //#endregion
31
- export { watchSpecs };
1
+ import{validateSpec as e}from"./validate.js";import{buildSpec as t}from"./build.js";function n(n,r,i,a){let{watcher:o,fs:s,logger:c}=n,l=o.watch(i),u=a?.validate??(async t=>{await e(t,{fs:s,logger:c})}),d=a?.build??(async e=>{await t(e,{fs:s,logger:c},r)});return l.on(async e=>{e.type===`change`&&(c.info(`watchSpecs.changed`,{path:e.path}),i.runValidate&&await u(e.path),i.runBuild&&(i.dryRun?c.info(`[dry-run] watchSpecs skipped build`,{path:e.path}):await d(e.path)))}),l}export{n as watchSpecs};
@@ -1,102 +1,2 @@
1
- import { detectPackageManager, findPackageRoot, findWorkspaceRoot, getWorkspaceInfo } from "../adapters/workspace.js";
2
-
3
- //#region src/services/workspace-info.ts
4
- /**
5
- * Workspace info service.
6
- *
7
- * Provides workspace detection and configuration loading
8
- * with support for monorepos.
9
- */
10
- /**
11
- * Get extended workspace information including config paths.
12
- */
13
- async function getExtendedWorkspaceInfo(fs, startDir) {
14
- const baseInfo = getWorkspaceInfo(startDir);
15
- const workspaceConfigPath = fs.join(baseInfo.workspaceRoot, ".contractsrc.json");
16
- const packageConfigPath = fs.join(baseInfo.packageRoot, ".contractsrc.json");
17
- const hasWorkspaceConfig = await fs.exists(workspaceConfigPath);
18
- const hasPackageConfig = baseInfo.workspaceRoot !== baseInfo.packageRoot ? await fs.exists(packageConfigPath) : false;
19
- let monorepoConfig;
20
- if (hasWorkspaceConfig) try {
21
- const content = await fs.readFile(workspaceConfigPath);
22
- const config = JSON.parse(content);
23
- if (config.packages || config.excludePackages || config.recursive) monorepoConfig = {
24
- packages: config.packages,
25
- excludePackages: config.excludePackages,
26
- recursive: config.recursive
27
- };
28
- } catch {}
29
- return {
30
- ...baseInfo,
31
- monorepoConfig,
32
- workspaceConfigPath: hasWorkspaceConfig ? workspaceConfigPath : void 0,
33
- packageConfigPath: hasPackageConfig ? packageConfigPath : void 0
34
- };
35
- }
36
- /**
37
- * Find all .contractsrc.json files in a monorepo.
38
- *
39
- * Returns paths in order of priority (workspace first, then packages).
40
- */
41
- async function findAllConfigFiles(fs, workspaceRoot) {
42
- const configFiles = [];
43
- const rootConfig = fs.join(workspaceRoot, ".contractsrc.json");
44
- if (await fs.exists(rootConfig)) configFiles.push(rootConfig);
45
- const packageConfigs = await fs.glob({
46
- pattern: "**/.contractsrc.json",
47
- ignore: ["node_modules/**", ".git/**"]
48
- });
49
- for (const config of packageConfigs) if (config !== rootConfig) configFiles.push(config);
50
- return configFiles;
51
- }
52
- /**
53
- * Merge workspace and package configurations.
54
- *
55
- * Package config overrides workspace config.
56
- */
57
- async function mergeMonorepoConfigs(fs, workspaceConfigPath, packageConfigPath) {
58
- let merged = {};
59
- if (workspaceConfigPath && await fs.exists(workspaceConfigPath)) try {
60
- const content = await fs.readFile(workspaceConfigPath);
61
- merged = JSON.parse(content);
62
- } catch {}
63
- if (packageConfigPath && await fs.exists(packageConfigPath)) try {
64
- const content = await fs.readFile(packageConfigPath);
65
- const packageConfig = JSON.parse(content);
66
- merged = deepMerge(merged, packageConfig);
67
- } catch {}
68
- return merged;
69
- }
70
- /**
71
- * Deep merge two objects.
72
- */
73
- function deepMerge(base, override) {
74
- const result = { ...base };
75
- for (const key of Object.keys(override)) {
76
- const baseValue = base[key];
77
- const overrideValue = override[key];
78
- if (typeof baseValue === "object" && baseValue !== null && !Array.isArray(baseValue) && typeof overrideValue === "object" && overrideValue !== null && !Array.isArray(overrideValue)) result[key] = deepMerge(baseValue, overrideValue);
79
- else result[key] = overrideValue;
80
- }
81
- return result;
82
- }
83
- /**
84
- * Format workspace info for display.
85
- */
86
- function formatWorkspaceInfo(info) {
87
- const lines = [];
88
- lines.push(`Package Manager: ${info.packageManager}`);
89
- lines.push(`Workspace Root: ${info.workspaceRoot}`);
90
- if (info.isMonorepo) {
91
- lines.push(`Monorepo: Yes`);
92
- lines.push(`Package Root: ${info.packageRoot}`);
93
- if (info.packageName) lines.push(`Current Package: ${info.packageName}`);
94
- if (info.packages && info.packages.length > 0) lines.push(`Package Patterns: ${info.packages.join(", ")}`);
95
- } else lines.push(`Monorepo: No`);
96
- if (info.workspaceConfigPath) lines.push(`Workspace Config: ${info.workspaceConfigPath}`);
97
- if (info.packageConfigPath) lines.push(`Package Config: ${info.packageConfigPath}`);
98
- return lines.join("\n");
99
- }
100
-
101
- //#endregion
102
- export { findAllConfigFiles, formatWorkspaceInfo, getExtendedWorkspaceInfo, mergeMonorepoConfigs };
1
+ import{detectPackageManager as e,findPackageRoot as t,findWorkspaceRoot as n,getWorkspaceInfo as r}from"../adapters/workspace.js";async function i(e,t){let n=r(t),i=e.join(n.workspaceRoot,`.contractsrc.json`),a=e.join(n.packageRoot,`.contractsrc.json`),o=await e.exists(i),s=n.workspaceRoot===n.packageRoot?!1:await e.exists(a),c;if(o)try{let t=await e.readFile(i),n=JSON.parse(t);(n.packages||n.excludePackages||n.recursive)&&(c={packages:n.packages,excludePackages:n.excludePackages,recursive:n.recursive})}catch{}return{...n,monorepoConfig:c,workspaceConfigPath:o?i:void 0,packageConfigPath:s?a:void 0}}async function a(e,t){let n=[],r=e.join(t,`.contractsrc.json`);await e.exists(r)&&n.push(r);let i=await e.glob({pattern:`**/.contractsrc.json`,ignore:[`node_modules/**`,`.git/**`]});for(let e of i)e!==r&&n.push(e);return n}async function o(e,t,n){let r={};if(t&&await e.exists(t))try{let n=await e.readFile(t);r=JSON.parse(n)}catch{}if(n&&await e.exists(n))try{let t=await e.readFile(n),i=JSON.parse(t);r=s(r,i)}catch{}return r}function s(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];typeof i==`object`&&i&&!Array.isArray(i)&&typeof a==`object`&&a&&!Array.isArray(a)?n[r]=s(i,a):n[r]=a}return n}function c(e){let t=[];return t.push(`Package Manager: ${e.packageManager}`),t.push(`Workspace Root: ${e.workspaceRoot}`),e.isMonorepo?(t.push(`Monorepo: Yes`),t.push(`Package Root: ${e.packageRoot}`),e.packageName&&t.push(`Current Package: ${e.packageName}`),e.packages&&e.packages.length>0&&t.push(`Package Patterns: ${e.packages.join(`, `)}`)):t.push(`Monorepo: No`),e.workspaceConfigPath&&t.push(`Workspace Config: ${e.workspaceConfigPath}`),e.packageConfigPath&&t.push(`Package Config: ${e.packageConfigPath}`),t.join(`
2
+ `)}export{a as findAllConfigFiles,c as formatWorkspaceInfo,i as getExtendedWorkspaceInfo,o as mergeMonorepoConfigs};