@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217083314 → 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,23 +1,9 @@
1
- import { __export } from "../../_virtual/rolldown_runtime.js";
2
-
3
- //#region src/ai/prompts/code-generation.ts
4
- var code_generation_exports = /* @__PURE__ */ __export({
5
- buildComponentPrompt: () => buildComponentPrompt,
6
- buildFormPrompt: () => buildFormPrompt,
7
- buildHandlerPrompt: () => buildHandlerPrompt,
8
- buildTestPrompt: () => buildTestPrompt,
9
- getCodeGenSystemPrompt: () => getCodeGenSystemPrompt
10
- });
11
- /**
12
- * Build prompt for generating handler implementation
13
- */
14
- function buildHandlerPrompt(specCode) {
15
- return `You are a senior TypeScript developer implementing a handler for a contract specification.
1
+ import{__export as e}from"../../_virtual/rolldown_runtime.js";var t=e({buildComponentPrompt:()=>r,buildFormPrompt:()=>i,buildHandlerPrompt:()=>n,buildTestPrompt:()=>a,getCodeGenSystemPrompt:()=>o});function n(e){return`You are a senior TypeScript developer implementing a handler for a contract specification.
16
2
 
17
3
  Here is the contract spec:
18
4
 
19
5
  \`\`\`typescript
20
- ${specCode}
6
+ ${e}
21
7
  \`\`\`
22
8
 
23
9
  Generate a complete handler implementation that:
@@ -31,18 +17,12 @@ Generate a complete handler implementation that:
31
17
 
32
18
  The handler should be production-ready with proper error handling, logging points, and clear structure.
33
19
 
34
- Return only the TypeScript code for the handler function.`;
35
- }
36
- /**
37
- * Build prompt for generating React component from presentation spec
38
- */
39
- function buildComponentPrompt(specCode) {
40
- return `You are a senior React developer creating a component for a presentation specification.
20
+ Return only the TypeScript code for the handler function.`}function r(e){return`You are a senior React developer creating a component for a presentation specification.
41
21
 
42
22
  Here is the presentation spec:
43
23
 
44
24
  \`\`\`typescript
45
- ${specCode}
25
+ ${e}
46
26
  \`\`\`
47
27
 
48
28
  Generate a complete React component that:
@@ -56,18 +36,12 @@ Generate a complete React component that:
56
36
 
57
37
  The component should follow Atomic Design principles and be reusable.
58
38
 
59
- Return only the TypeScript/TSX code for the component.`;
60
- }
61
- /**
62
- * Build prompt for generating form component
63
- */
64
- function buildFormPrompt(specCode) {
65
- return `You are a senior React developer creating a form component from a form specification.
39
+ Return only the TypeScript/TSX code for the component.`}function i(e){return`You are a senior React developer creating a form component from a form specification.
66
40
 
67
41
  Here is the form spec:
68
42
 
69
43
  \`\`\`typescript
70
- ${specCode}
44
+ ${e}
71
45
  \`\`\`
72
46
 
73
47
  Generate a complete form component using react-hook-form that:
@@ -82,31 +56,25 @@ Generate a complete form component using react-hook-form that:
82
56
 
83
57
  The form should provide excellent UX with real-time validation and helpful feedback.
84
58
 
85
- Return only the TypeScript/TSX code for the form component.`;
86
- }
87
- /**
88
- * Build prompt for generating tests
89
- */
90
- function buildTestPrompt(specCode, implementationCode, testType) {
91
- return `You are a senior developer writing comprehensive tests.
59
+ Return only the TypeScript/TSX code for the form component.`}function a(e,t,n){return`You are a senior developer writing comprehensive tests.
92
60
 
93
61
  Spec:
94
62
  \`\`\`typescript
95
- ${specCode}
63
+ ${e}
96
64
  \`\`\`
97
65
 
98
66
  Implementation:
99
67
  \`\`\`typescript
100
- ${implementationCode}
68
+ ${t}
101
69
  \`\`\`
102
70
 
103
71
  Generate complete test suite using Vitest that:
104
- ${testType === "handler" ? `
72
+ ${n===`handler`?`
105
73
  - Test all acceptance scenarios from the spec
106
74
  - Test error cases defined in spec.io.errors
107
75
  - Verify events are emitted correctly
108
76
  - Test input validation
109
- - Test happy path and edge cases` : `
77
+ - Test happy path and edge cases`:`
110
78
  - Test rendering with various props
111
79
  - Test user interactions
112
80
  - Test accessibility (a11y)
@@ -115,13 +83,7 @@ ${testType === "handler" ? `
115
83
 
116
84
  Use clear test descriptions and follow AAA pattern (Arrange, Act, Assert).
117
85
 
118
- Return only the TypeScript test code.`;
119
- }
120
- /**
121
- * System prompt for code generation
122
- */
123
- function getCodeGenSystemPrompt() {
124
- return `You are an expert TypeScript developer with deep knowledge of:
86
+ Return only the TypeScript test code.`}function o(){return`You are an expert TypeScript developer with deep knowledge of:
125
87
  - Type-safe API design
126
88
  - React and modern hooks
127
89
  - Test-driven development
@@ -135,8 +97,4 @@ Generate production-ready code that is:
135
97
  - Defensive and error-safe
136
98
  - Easy to maintain and extend
137
99
 
138
- Always prioritize code quality, safety, and user experience.`;
139
- }
140
-
141
- //#endregion
142
- export { buildComponentPrompt, buildFormPrompt, buildHandlerPrompt, buildTestPrompt, code_generation_exports, getCodeGenSystemPrompt };
100
+ Always prioritize code quality, safety, and user experience.`}export{r as buildComponentPrompt,i as buildFormPrompt,n as buildHandlerPrompt,a as buildTestPrompt,t as code_generation_exports,o as getCodeGenSystemPrompt};
@@ -1,12 +1 @@
1
- import { __export } from "../../_virtual/rolldown_runtime.js";
2
- import { spec_creation_exports } from "./spec-creation.js";
3
- import { code_generation_exports } from "./code-generation.js";
4
-
5
- //#region src/ai/prompts/index.ts
6
- var prompts_exports = /* @__PURE__ */ __export({
7
- codeGeneration: () => code_generation_exports,
8
- specCreation: () => spec_creation_exports
9
- });
10
-
11
- //#endregion
12
- export { prompts_exports };
1
+ import{__export as e}from"../../_virtual/rolldown_runtime.js";import{spec_creation_exports as t}from"./spec-creation.js";import{code_generation_exports as n}from"./code-generation.js";var r=e({codeGeneration:()=>n,specCreation:()=>t});export{r as prompts_exports};
@@ -1,22 +1,8 @@
1
- import { __export } from "../../_virtual/rolldown_runtime.js";
2
-
3
- //#region src/ai/prompts/spec-creation.ts
4
- var spec_creation_exports = /* @__PURE__ */ __export({
5
- addExampleContext: () => addExampleContext,
6
- buildEventSpecPrompt: () => buildEventSpecPrompt,
7
- buildOperationSpecPrompt: () => buildOperationSpecPrompt,
8
- buildPresentationSpecPrompt: () => buildPresentationSpecPrompt,
9
- getSystemPrompt: () => getSystemPrompt
10
- });
11
- /**
12
- * Build prompt for creating operation spec from description
13
- */
14
- function buildOperationSpecPrompt(description, kind) {
15
- return `You are a senior software architect creating a contract specification for an operation.
16
-
17
- The operation is a ${kind} (${kind === "command" ? "changes state, has side effects" : "read-only, idempotent"}).
18
-
19
- User description: ${description}
1
+ import{__export as e}from"../../_virtual/rolldown_runtime.js";var t=e({addExampleContext:()=>o,buildEventSpecPrompt:()=>r,buildOperationSpecPrompt:()=>n,buildPresentationSpecPrompt:()=>i,getSystemPrompt:()=>a});function n(e,t){return`You are a senior software architect creating a contract specification for an operation.
2
+
3
+ The operation is a ${t} (${t===`command`?`changes state, has side effects`:`read-only, idempotent`}).
4
+
5
+ User description: ${e}
20
6
 
21
7
  Create a complete contract specification following these guidelines:
22
8
 
@@ -30,15 +16,9 @@ Create a complete contract specification following these guidelines:
30
16
  8. **Feature Flags**: Any flags that gate this operation
31
17
  9. **Side Effects**: What events might be emitted, analytics to track
32
18
 
33
- Respond with a structured spec.`;
34
- }
35
- /**
36
- * Build prompt for creating event spec from description
37
- */
38
- function buildEventSpecPrompt(description) {
39
- return `You are a senior software architect creating an event specification.
19
+ Respond with a structured spec.`}function r(e){return`You are a senior software architect creating an event specification.
40
20
 
41
- User description: ${description}
21
+ User description: ${e}
42
22
 
43
23
  Create a complete event specification following these guidelines:
44
24
 
@@ -50,21 +30,11 @@ Create a complete event specification following these guidelines:
50
30
 
51
31
  Events represent things that have already happened and should use past tense.
52
32
 
53
- Respond with a structured spec.`;
54
- }
55
- /**
56
- * Build prompt for creating presentation spec from description
57
- */
58
- function buildPresentationSpecPrompt(description, kind) {
59
- return `You are a senior software architect creating a presentation specification.
33
+ Respond with a structured spec.`}function i(e,t){return`You are a senior software architect creating a presentation specification.
60
34
 
61
- This is a ${kind} presentation - ${{
62
- web_component: "a React component with props schema",
63
- markdown: "markdown/MDX documentation or guide",
64
- data: "structured data export (JSON/XML)"
65
- }[kind]}.
35
+ This is a ${t} presentation - ${{web_component:`a React component with props schema`,markdown:`markdown/MDX documentation or guide`,data:`structured data export (JSON/XML)`}[t]}.
66
36
 
67
- User description: ${description}
37
+ User description: ${e}
68
38
 
69
39
  Create a complete presentation specification following these guidelines:
70
40
 
@@ -72,15 +42,13 @@ Create a complete presentation specification following these guidelines:
72
42
  2. **Version**: Start at 1
73
43
  3. **Description**: What this presentation shows/provides
74
44
  4. **Kind-specific details**:
75
- ${kind === "web_component" ? "- Component key (symbolic, resolved by host app)\n - Props structure\n - Analytics events to track" : kind === "markdown" ? "- Content or resource URI\n - Target audience" : "- MIME type (e.g., application/json)\n - Data structure description"}
45
+ ${t===`web_component`?`- Component key (symbolic, resolved by host app)
46
+ - Props structure
47
+ - Analytics events to track`:t===`markdown`?`- Content or resource URI
48
+ - Target audience`:`- MIME type (e.g., application/json)
49
+ - Data structure description`}
76
50
 
77
- Respond with a structured spec.`;
78
- }
79
- /**
80
- * Build system prompt for all spec generation
81
- */
82
- function getSystemPrompt() {
83
- return `You are an expert software architect specializing in API design and contract-driven development.
51
+ Respond with a structured spec.`}function a(){return`You are an expert software architect specializing in API design and contract-driven development.
84
52
 
85
53
  You create clear, well-documented specifications that serve as the single source of truth for operations, events, and presentations.
86
54
 
@@ -90,21 +58,12 @@ Your specs are:
90
58
  - Business-oriented (capturing the "why" not just "what")
91
59
  - Designed for both humans and AI agents to understand
92
60
 
93
- Always use proper dot notation for names and ensure all metadata is meaningful and accurate.`;
94
- }
95
- /**
96
- * Create example-based prompt for better results
97
- */
98
- function addExampleContext(basePrompt, examples) {
99
- if (examples.length === 0) return basePrompt;
100
- return `${basePrompt}
61
+ Always use proper dot notation for names and ensure all metadata is meaningful and accurate.`}function o(e,t){return t.length===0?e:`${e}
101
62
 
102
63
  Here are some good examples for reference:
103
64
 
104
- ${examples.join("\n\n")}
65
+ ${t.join(`
105
66
 
106
- Follow this structure and quality level.`;
107
- }
67
+ `)}
108
68
 
109
- //#endregion
110
- export { buildEventSpecPrompt, buildOperationSpecPrompt, buildPresentationSpecPrompt, getSystemPrompt, spec_creation_exports };
69
+ Follow this structure and quality level.`}export{r as buildEventSpecPrompt,n as buildOperationSpecPrompt,i as buildPresentationSpecPrompt,a as getSystemPrompt,t as spec_creation_exports};
@@ -1,40 +1 @@
1
- import { getRecommendedModels } from "../libs/ai-providers/dist/models.js";
2
- import { getAIProvider, validateProvider } from "../libs/ai-providers/dist/legacy.js";
3
- import "../libs/ai-providers/dist/index.js";
4
-
5
- //#region src/ai/providers.ts
6
- /**
7
- * Initialize AI provider based on configuration
8
- *
9
- * @deprecated Use createProvider() from @lssm/lib.ai-providers instead
10
- */
11
- function getAIProvider$1(config) {
12
- return getAIProvider({
13
- aiProvider: config.aiProvider,
14
- aiModel: config.aiModel || void 0,
15
- customEndpoint: config.customEndpoint || void 0
16
- });
17
- }
18
- /**
19
- * Validate that the provider is accessible and working
20
- *
21
- * @deprecated Use validateProvider() from @lssm/lib.ai-providers instead
22
- */
23
- async function validateProvider$1(config) {
24
- return await validateProvider({
25
- aiProvider: config.aiProvider,
26
- aiModel: config.aiModel || void 0,
27
- customEndpoint: config.customEndpoint || void 0
28
- });
29
- }
30
- /**
31
- * Get recommended models for each provider
32
- *
33
- * @deprecated Use getModelsForProvider() from @lssm/lib.ai-providers instead
34
- */
35
- function getRecommendedModels$1(provider) {
36
- return getRecommendedModels(provider);
37
- }
38
-
39
- //#endregion
40
- export { getAIProvider$1 as getAIProvider, getRecommendedModels$1 as getRecommendedModels, validateProvider$1 as validateProvider };
1
+ import{getAIProvider as e,getRecommendedModels as t,validateLegacyProvider as n}from"@lssm/lib.ai-providers";function r(t){return e({aiProvider:t.aiProvider,aiModel:t.aiModel||void 0,customEndpoint:t.customEndpoint||void 0})}async function i(e){return await n({aiProvider:e.aiProvider,aiModel:e.aiModel||void 0,customEndpoint:e.customEndpoint||void 0})}function a(e){return t(e)}export{r as getAIProvider,a as getRecommendedModels,i as validateProvider};
@@ -1,18 +1 @@
1
- import { __export } from "../_virtual/rolldown_runtime.js";
2
- import { formatAsSarif, sarifToJson } from "./sarif.js";
3
- import { formatAsJson, formatAsJsonCompact, formatAsJsonFull } from "./json.js";
4
- import { formatAsText, formatAsTextLines } from "./text.js";
5
-
6
- //#region src/formatters/index.ts
7
- var formatters_exports = /* @__PURE__ */ __export({
8
- formatAsJson: () => formatAsJson,
9
- formatAsJsonCompact: () => formatAsJsonCompact,
10
- formatAsJsonFull: () => formatAsJsonFull,
11
- formatAsSarif: () => formatAsSarif,
12
- formatAsText: () => formatAsText,
13
- formatAsTextLines: () => formatAsTextLines,
14
- sarifToJson: () => sarifToJson
15
- });
16
-
17
- //#endregion
18
- export { formatters_exports };
1
+ import{__export as e}from"../_virtual/rolldown_runtime.js";import{formatAsSarif as t,sarifToJson as n}from"./sarif.js";import{formatAsJson as r,formatAsJsonCompact as i,formatAsJsonFull as a}from"./json.js";import{formatAsText as o,formatAsTextLines as s}from"./text.js";var c=e({formatAsJson:()=>r,formatAsJsonCompact:()=>i,formatAsJsonFull:()=>a,formatAsSarif:()=>t,formatAsText:()=>o,formatAsTextLines:()=>s,sarifToJson:()=>n});export{c as formatters_exports};
@@ -1,71 +1 @@
1
- //#region src/formatters/json.ts
2
- /**
3
- * Format CI check results as compact JSON.
4
- */
5
- function formatAsJsonCompact(result) {
6
- return {
7
- success: result.success,
8
- errors: result.totalErrors,
9
- warnings: result.totalWarnings,
10
- duration: result.durationMs,
11
- timestamp: result.timestamp,
12
- commit: result.commitSha,
13
- branch: result.branch,
14
- issues: result.issues.map((issue) => ({
15
- rule: issue.ruleId,
16
- severity: issue.severity,
17
- message: issue.message,
18
- file: issue.file,
19
- line: issue.line
20
- }))
21
- };
22
- }
23
- /**
24
- * Format CI check results as full JSON with all details.
25
- */
26
- function formatAsJsonFull(result) {
27
- return {
28
- success: result.success,
29
- summary: {
30
- totalErrors: result.totalErrors,
31
- totalWarnings: result.totalWarnings,
32
- totalNotes: result.totalNotes,
33
- durationMs: result.durationMs,
34
- timestamp: result.timestamp,
35
- commitSha: result.commitSha,
36
- branch: result.branch
37
- },
38
- categories: result.categories.map((cat) => ({
39
- category: cat.category,
40
- label: cat.label,
41
- passed: cat.passed,
42
- errors: cat.errors,
43
- warnings: cat.warnings,
44
- notes: cat.notes,
45
- durationMs: cat.durationMs
46
- })),
47
- issues: result.issues.map((issue) => ({
48
- ruleId: issue.ruleId,
49
- severity: issue.severity,
50
- message: issue.message,
51
- category: issue.category,
52
- file: issue.file,
53
- line: issue.line,
54
- column: issue.column,
55
- endLine: issue.endLine,
56
- endColumn: issue.endColumn,
57
- context: issue.context
58
- }))
59
- };
60
- }
61
- /**
62
- * Format CI check results as JSON.
63
- */
64
- function formatAsJson(result, options = {}) {
65
- const { pretty = true, includeDetails = true } = options;
66
- const output = includeDetails ? formatAsJsonFull(result) : formatAsJsonCompact(result);
67
- return pretty ? JSON.stringify(output, null, 2) : JSON.stringify(output);
68
- }
69
-
70
- //#endregion
71
- export { formatAsJson, formatAsJsonCompact, formatAsJsonFull };
1
+ function e(e){return{success:e.success,errors:e.totalErrors,warnings:e.totalWarnings,duration:e.durationMs,timestamp:e.timestamp,commit:e.commitSha,branch:e.branch,issues:e.issues.map(e=>({rule:e.ruleId,severity:e.severity,message:e.message,file:e.file,line:e.line}))}}function t(e){return{success:e.success,summary:{totalErrors:e.totalErrors,totalWarnings:e.totalWarnings,totalNotes:e.totalNotes,durationMs:e.durationMs,timestamp:e.timestamp,commitSha:e.commitSha,branch:e.branch},categories:e.categories.map(e=>({category:e.category,label:e.label,passed:e.passed,errors:e.errors,warnings:e.warnings,notes:e.notes,durationMs:e.durationMs})),issues:e.issues.map(e=>({ruleId:e.ruleId,severity:e.severity,message:e.message,category:e.category,file:e.file,line:e.line,column:e.column,endLine:e.endLine,endColumn:e.endColumn,context:e.context}))}}function n(n,r={}){let{pretty:i=!0,includeDetails:a=!0}=r,o=a?t(n):e(n);return i?JSON.stringify(o,null,2):JSON.stringify(o)}export{n as formatAsJson,e as formatAsJsonCompact,t as formatAsJsonFull};
@@ -1,163 +1 @@
1
- //#region src/formatters/sarif.ts
2
- /**
3
- * Map of rule IDs to their metadata.
4
- */
5
- const RULE_METADATA = {
6
- "spec-structure-error": {
7
- name: "Spec Structure Error",
8
- description: "Contract specification is missing required structure elements"
9
- },
10
- "spec-structure-warning": {
11
- name: "Spec Structure Warning",
12
- description: "Contract specification has recommended but missing elements"
13
- },
14
- "integrity-orphaned": {
15
- name: "Orphaned Spec",
16
- description: "Contract specification is not linked to any feature"
17
- },
18
- "integrity-unresolved-ref": {
19
- name: "Unresolved Reference",
20
- description: "Contract specification references a non-existent spec"
21
- },
22
- "integrity-missing-feature": {
23
- name: "Missing Feature",
24
- description: "Feature referenced by spec does not exist"
25
- },
26
- "integrity-broken-link": {
27
- name: "Broken Link",
28
- description: "Link between specs is broken"
29
- },
30
- "deps-circular": {
31
- name: "Circular Dependency",
32
- description: "Circular dependency detected between contracts"
33
- },
34
- "deps-missing": {
35
- name: "Missing Dependency",
36
- description: "Contract depends on a non-existent contract"
37
- },
38
- "handler-missing": {
39
- name: "Missing Handler",
40
- description: "Handler implementation file does not exist for this contract"
41
- },
42
- "handler-warning": {
43
- name: "Handler Warning",
44
- description: "Handler implementation has potential issues"
45
- },
46
- "test-missing": {
47
- name: "Missing Test",
48
- description: "Test file does not exist for this contract"
49
- },
50
- "test-warning": {
51
- name: "Test Warning",
52
- description: "Test implementation has potential issues"
53
- }
54
- };
55
- /**
56
- * Format CI check results as SARIF.
57
- */
58
- function formatAsSarif(result, options = {}) {
59
- const { toolName = "ContractSpec", toolVersion = "1.0.0", toolUri = "https://contractspec.dev", repositoryUri, workingDirectory } = options;
60
- const ruleMap = /* @__PURE__ */ new Map();
61
- const ruleIndexMap = /* @__PURE__ */ new Map();
62
- for (const issue of result.issues) if (!ruleMap.has(issue.ruleId)) {
63
- const metadata = RULE_METADATA[issue.ruleId] ?? {
64
- name: issue.ruleId,
65
- description: `Rule: ${issue.ruleId}`
66
- };
67
- const rule = {
68
- id: issue.ruleId,
69
- name: metadata.name,
70
- shortDescription: { text: metadata.description },
71
- defaultConfiguration: { level: mapSeverityToLevel(issue.severity) }
72
- };
73
- if (metadata.helpUri) rule.helpUri = metadata.helpUri;
74
- ruleIndexMap.set(issue.ruleId, ruleMap.size);
75
- ruleMap.set(issue.ruleId, rule);
76
- }
77
- const results = result.issues.map((issue) => {
78
- const sarifResult = {
79
- ruleId: issue.ruleId,
80
- ruleIndex: ruleIndexMap.get(issue.ruleId) ?? 0,
81
- level: mapSeverityToLevel(issue.severity),
82
- message: { text: issue.message }
83
- };
84
- if (issue.file) {
85
- const location = { physicalLocation: { artifactLocation: {
86
- uri: normalizeUri(issue.file),
87
- uriBaseId: "%SRCROOT%"
88
- } } };
89
- if (issue.line !== void 0) location.physicalLocation.region = {
90
- startLine: issue.line,
91
- startColumn: issue.column ?? 1,
92
- endLine: issue.endLine ?? issue.line,
93
- endColumn: issue.endColumn
94
- };
95
- sarifResult.locations = [location];
96
- }
97
- sarifResult.partialFingerprints = { primaryLocationLineHash: createFingerprint(issue) };
98
- return sarifResult;
99
- });
100
- const versionControlProvenance = [];
101
- if (repositoryUri || result.commitSha || result.branch) versionControlProvenance.push({
102
- repositoryUri,
103
- revisionId: result.commitSha,
104
- branch: result.branch
105
- });
106
- const run = {
107
- tool: { driver: {
108
- name: toolName,
109
- version: toolVersion,
110
- informationUri: toolUri,
111
- rules: Array.from(ruleMap.values())
112
- } },
113
- results,
114
- invocations: [{
115
- executionSuccessful: result.success,
116
- endTimeUtc: result.timestamp,
117
- ...workingDirectory && { workingDirectory: { uri: workingDirectory } }
118
- }]
119
- };
120
- if (versionControlProvenance.length > 0) run.versionControlProvenance = versionControlProvenance;
121
- return {
122
- $schema: "https://json.schemastore.org/sarif-2.1.0.json",
123
- version: "2.1.0",
124
- runs: [run]
125
- };
126
- }
127
- /**
128
- * Map CI severity to SARIF level.
129
- */
130
- function mapSeverityToLevel(severity) {
131
- switch (severity) {
132
- case "error": return "error";
133
- case "warning": return "warning";
134
- case "note": return "note";
135
- default: return "warning";
136
- }
137
- }
138
- /**
139
- * Normalize file path to SARIF URI format.
140
- */
141
- function normalizeUri(filePath) {
142
- return filePath.replace(/^\.\//, "").replace(/\\/g, "/");
143
- }
144
- /**
145
- * Create a fingerprint for issue deduplication.
146
- */
147
- function createFingerprint(issue) {
148
- const parts = [
149
- issue.ruleId,
150
- issue.file ?? "",
151
- issue.message
152
- ];
153
- return Buffer.from(parts.join("|")).toString("base64").slice(0, 16);
154
- }
155
- /**
156
- * Serialize SARIF output to JSON string.
157
- */
158
- function sarifToJson(sarif) {
159
- return JSON.stringify(sarif, null, 2);
160
- }
161
-
162
- //#endregion
163
- export { formatAsSarif, sarifToJson };
1
+ const e={"spec-structure-error":{name:`Spec Structure Error`,description:`Contract specification is missing required structure elements`},"spec-structure-warning":{name:`Spec Structure Warning`,description:`Contract specification has recommended but missing elements`},"integrity-orphaned":{name:`Orphaned Spec`,description:`Contract specification is not linked to any feature`},"integrity-unresolved-ref":{name:`Unresolved Reference`,description:`Contract specification references a non-existent spec`},"integrity-missing-feature":{name:`Missing Feature`,description:`Feature referenced by spec does not exist`},"integrity-broken-link":{name:`Broken Link`,description:`Link between specs is broken`},"deps-circular":{name:`Circular Dependency`,description:`Circular dependency detected between contracts`},"deps-missing":{name:`Missing Dependency`,description:`Contract depends on a non-existent contract`},"handler-missing":{name:`Missing Handler`,description:`Handler implementation file does not exist for this contract`},"handler-warning":{name:`Handler Warning`,description:`Handler implementation has potential issues`},"test-missing":{name:`Missing Test`,description:`Test file does not exist for this contract`},"test-warning":{name:`Test Warning`,description:`Test implementation has potential issues`}};function t(t,a={}){let{toolName:o=`ContractSpec`,toolVersion:s=`1.0.0`,toolUri:c=`https://contractspec.dev`,repositoryUri:l,workingDirectory:u}=a,d=new Map,f=new Map;for(let r of t.issues)if(!d.has(r.ruleId)){let t=e[r.ruleId]??{name:r.ruleId,description:`Rule: ${r.ruleId}`},i={id:r.ruleId,name:t.name,shortDescription:{text:t.description},defaultConfiguration:{level:n(r.severity)}};t.helpUri&&(i.helpUri=t.helpUri),f.set(r.ruleId,d.size),d.set(r.ruleId,i)}let p=t.issues.map(e=>{let t={ruleId:e.ruleId,ruleIndex:f.get(e.ruleId)??0,level:n(e.severity),message:{text:e.message}};if(e.file){let n={physicalLocation:{artifactLocation:{uri:r(e.file),uriBaseId:`%SRCROOT%`}}};e.line!==void 0&&(n.physicalLocation.region={startLine:e.line,startColumn:e.column??1,endLine:e.endLine??e.line,endColumn:e.endColumn}),t.locations=[n]}return t.partialFingerprints={primaryLocationLineHash:i(e)},t}),m=[];(l||t.commitSha||t.branch)&&m.push({repositoryUri:l,revisionId:t.commitSha,branch:t.branch});let h={tool:{driver:{name:o,version:s,informationUri:c,rules:Array.from(d.values())}},results:p,invocations:[{executionSuccessful:t.success,endTimeUtc:t.timestamp,...u&&{workingDirectory:{uri:u}}}]};return m.length>0&&(h.versionControlProvenance=m),{$schema:`https://json.schemastore.org/sarif-2.1.0.json`,version:`2.1.0`,runs:[h]}}function n(e){switch(e){case`error`:return`error`;case`warning`:return`warning`;case`note`:return`note`;default:return`warning`}}function r(e){return e.replace(/^\.\//,``).replace(/\\/g,`/`)}function i(e){let t=[e.ruleId,e.file??``,e.message];return Buffer.from(t.join(`|`)).toString(`base64`).slice(0,16)}function a(e){return JSON.stringify(e,null,2)}export{t as formatAsSarif,a as sarifToJson};