@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,137 +0,0 @@
1
- //#region ../../modules/contractspec-workspace/dist/ai/code-generation.js
2
- /**
3
- * AI prompts for code generation.
4
- * Extracted from cli-contracts/src/ai/prompts/code-generation.ts
5
- */
6
- /**
7
- * Build prompt for generating handler implementation.
8
- */
9
- function buildHandlerPrompt(specCode) {
10
- return `You are a senior TypeScript developer implementing a handler for a contract specification.
11
-
12
- Here is the contract spec:
13
-
14
- \`\`\`typescript
15
- ${specCode}
16
- \`\`\`
17
-
18
- Generate a complete handler implementation that:
19
-
20
- 1. **Matches the spec signature**: Input/output types from the spec
21
- 2. **Handles errors**: Implement error cases defined in spec.io.errors
22
- 3. **Emits events**: Use the events declared in spec.sideEffects.emits
23
- 4. **Validates input**: Use zod validation from the schema
24
- 5. **Follows best practices**: Clean, type-safe TypeScript
25
- 6. **Includes comments**: Explain business logic
26
-
27
- The handler should be production-ready with proper error handling, logging points, and clear structure.
28
-
29
- Return only the TypeScript code for the handler function.`;
30
- }
31
- /**
32
- * Build prompt for generating React component from presentation spec.
33
- */
34
- function buildComponentPrompt(specCode) {
35
- return `You are a senior React developer creating a component for a presentation specification.
36
-
37
- Here is the presentation spec:
38
-
39
- \`\`\`typescript
40
- ${specCode}
41
- \`\`\`
42
-
43
- Generate a complete React component that:
44
-
45
- 1. **Props interface**: Typed props from the spec
46
- 2. **Accessibility**: Proper ARIA labels, roles, keyboard navigation
47
- 3. **Mobile-first**: Optimized for small screens and touch
48
- 4. **Clean UI**: Simple, intuitive interface
49
- 5. **Type-safe**: Full TypeScript with no 'any' types
50
- 6. **Best practices**: React hooks, proper state management
51
-
52
- The component should follow Atomic Design principles and be reusable.
53
-
54
- Return only the TypeScript/TSX code for the component.`;
55
- }
56
- /**
57
- * Build prompt for generating form component.
58
- */
59
- function buildFormPrompt(specCode) {
60
- return `You are a senior React developer creating a form component from a form specification.
61
-
62
- Here is the form spec:
63
-
64
- \`\`\`typescript
65
- ${specCode}
66
- \`\`\`
67
-
68
- Generate a complete form component using react-hook-form that:
69
-
70
- 1. **Form validation**: Use zod schema for validation
71
- 2. **Field types**: Proper inputs for each field type
72
- 3. **Conditional logic**: Support visibleWhen, enabledWhen, requiredWhen predicates
73
- 4. **Error handling**: Clear, user-friendly error messages
74
- 5. **Accessibility**: Labels, hints, ARIA attributes
75
- 6. **Mobile-optimized**: Touch-friendly, appropriate input types
76
- 7. **Type-safe**: Full TypeScript
77
-
78
- The form should provide excellent UX with real-time validation and helpful feedback.
79
-
80
- Return only the TypeScript/TSX code for the form component.`;
81
- }
82
- /**
83
- * Build prompt for generating tests.
84
- */
85
- function buildTestPrompt(specCode, implementationCode, testType) {
86
- return `You are a senior developer writing comprehensive tests.
87
-
88
- Spec:
89
- \`\`\`typescript
90
- ${specCode}
91
- \`\`\`
92
-
93
- Implementation:
94
- \`\`\`typescript
95
- ${implementationCode}
96
- \`\`\`
97
-
98
- Generate complete test suite using Vitest that:
99
- ${testType === "handler" ? `
100
- - Test all acceptance scenarios from the spec
101
- - Test error cases defined in spec.io.errors
102
- - Verify events are emitted correctly
103
- - Test input validation
104
- - Test happy path and edge cases` : `
105
- - Test rendering with various props
106
- - Test user interactions
107
- - Test accessibility (a11y)
108
- - Test responsive behavior
109
- - Test error states`}
110
-
111
- Use clear test descriptions and follow AAA pattern (Arrange, Act, Assert).
112
-
113
- Return only the TypeScript test code.`;
114
- }
115
- /**
116
- * System prompt for code generation.
117
- */
118
- function getCodeGenSystemPrompt() {
119
- return `You are an expert TypeScript developer with deep knowledge of:
120
- - Type-safe API design
121
- - React and modern hooks
122
- - Test-driven development
123
- - Accessibility best practices
124
- - Clean code principles
125
-
126
- Generate production-ready code that is:
127
- - Fully typed (no 'any' or type assertions unless absolutely necessary)
128
- - Well-documented with TSDoc comments
129
- - Following project conventions
130
- - Defensive and error-safe
131
- - Easy to maintain and extend
132
-
133
- Always prioritize code quality, safety, and user experience.`;
134
- }
135
-
136
- //#endregion
137
- export { buildComponentPrompt, buildFormPrompt, buildHandlerPrompt, buildTestPrompt, getCodeGenSystemPrompt };
@@ -1,101 +0,0 @@
1
- //#region ../../modules/contractspec-workspace/dist/ai/spec-creation.js
2
- /**
3
- * Build prompt for creating operation spec from description.
4
- */
5
- function buildOperationSpecPrompt(description, kind) {
6
- return `You are a senior software architect creating a contract specification for an operation.
7
-
8
- The operation is a ${kind} (${kind === "command" ? "changes state, has side effects" : "read-only, idempotent"}).
9
-
10
- User description: ${description}
11
-
12
- Create a complete contract specification following these guidelines:
13
-
14
- 1. **Name**: Use dot notation like "domain.operationName" (e.g., "user.signup", "payment.charge")
15
- 2. **Version**: Start at 1
16
- 3. **Description**: Clear, concise summary (1-2 sentences)
17
- 4. **Goal**: Business purpose - why this operation exists
18
- 5. **Context**: Background, constraints, scope (what it does and doesn't do)
19
- 6. **Input/Output**: Describe the shape (we'll create schemas separately)
20
- 7. **Auth**: Who can call this - anonymous, user, or admin
21
- 8. **Feature Flags**: Any flags that gate this operation
22
- 9. **Side Effects**: What events might be emitted, analytics to track
23
-
24
- Respond with a structured spec.`;
25
- }
26
- /**
27
- * Build prompt for creating event spec from description.
28
- */
29
- function buildEventSpecPrompt(description) {
30
- return `You are a senior software architect creating an event specification.
31
-
32
- User description: ${description}
33
-
34
- Create a complete event specification following these guidelines:
35
-
36
- 1. **Name**: Use dot notation like "domain.event_name" (e.g., "user.signup_completed", "payment.charged")
37
- 2. **Version**: Start at 1
38
- 3. **Description**: Clear description of when this event is emitted
39
- 4. **Payload**: Describe what data the event carries
40
- 5. **PII Fields**: List any personally identifiable information fields (e.g., ["email", "name"])
41
-
42
- Events represent things that have already happened and should use past tense.
43
-
44
- Respond with a structured spec.`;
45
- }
46
- /**
47
- * Build prompt for creating presentation spec from description.
48
- */
49
- function buildPresentationSpecPrompt(description, kind) {
50
- return `You are a senior software architect creating a presentation specification.
51
-
52
- This is a ${kind} presentation - ${{
53
- web_component: "a React component with props schema",
54
- markdown: "markdown/MDX documentation or guide",
55
- data: "structured data export (JSON/XML)"
56
- }[kind]}.
57
-
58
- User description: ${description}
59
-
60
- Create a complete presentation specification following these guidelines:
61
-
62
- 1. **Name**: Use dot notation like "domain.presentation_name" (e.g., "user.profile_card", "docs.api_guide")
63
- 2. **Version**: Start at 1
64
- 3. **Description**: What this presentation shows/provides
65
- 4. **Kind-specific details**:
66
- ${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"}
67
-
68
- Respond with a structured spec.`;
69
- }
70
- /**
71
- * Build system prompt for all spec generation.
72
- */
73
- function getSystemPrompt() {
74
- return `You are an expert software architect specializing in API design and contract-driven development.
75
-
76
- You create clear, well-documented specifications that serve as the single source of truth for operations, events, and presentations.
77
-
78
- Your specs are:
79
- - Precise and unambiguous
80
- - Following TypeScript conventions
81
- - Business-oriented (capturing the "why" not just "what")
82
- - Designed for both humans and AI agents to understand
83
-
84
- Always use proper dot notation for names and ensure all metadata is meaningful and accurate.`;
85
- }
86
- /**
87
- * Create example-based prompt for better results.
88
- */
89
- function addExampleContext(basePrompt, examples) {
90
- if (examples.length === 0) return basePrompt;
91
- return `${basePrompt}
92
-
93
- Here are some good examples for reference:
94
-
95
- ${examples.join("\n\n")}
96
-
97
- Follow this structure and quality level.`;
98
- }
99
-
100
- //#endregion
101
- export { addExampleContext, buildEventSpecPrompt, buildOperationSpecPrompt, buildPresentationSpecPrompt, getSystemPrompt };
@@ -1,84 +0,0 @@
1
- //#region ../../modules/contractspec-workspace/dist/analysis/deps/graph.js
2
- /**
3
- * Build reverse edges (dependents) for all nodes in the graph.
4
- */
5
- function buildReverseEdges(graph) {
6
- for (const node of graph.values()) node.dependents = [];
7
- for (const [name, node] of graph) for (const dep of node.dependencies) {
8
- const depNode = graph.get(dep);
9
- if (depNode) depNode.dependents.push(name);
10
- }
11
- for (const node of graph.values()) node.dependents.sort((a, b) => a.localeCompare(b));
12
- }
13
- /**
14
- * Detect circular dependencies in the graph.
15
- */
16
- function detectCycles(graph) {
17
- const visited = /* @__PURE__ */ new Set();
18
- const stack = /* @__PURE__ */ new Set();
19
- const cycles = [];
20
- function dfs(name, path) {
21
- if (stack.has(name)) {
22
- const start = path.indexOf(name);
23
- if (start >= 0) cycles.push([...path.slice(start), name]);
24
- return;
25
- }
26
- if (visited.has(name)) return;
27
- visited.add(name);
28
- stack.add(name);
29
- const node = graph.get(name);
30
- if (node) for (const dep of node.dependencies) dfs(dep, [...path, name]);
31
- stack.delete(name);
32
- }
33
- for (const name of graph.keys()) if (!visited.has(name)) dfs(name, []);
34
- return cycles;
35
- }
36
- /**
37
- * Find missing dependencies (referenced but not defined).
38
- */
39
- function findMissingDependencies(graph) {
40
- const missing = [];
41
- for (const [name, node] of graph) {
42
- const absent = node.dependencies.filter((dep) => !graph.has(dep));
43
- if (absent.length > 0) missing.push({
44
- contract: name,
45
- missing: absent
46
- });
47
- }
48
- return missing;
49
- }
50
- /**
51
- * Generate DOT format output for visualization.
52
- */
53
- function toDot(graph) {
54
- const lines = [];
55
- lines.push("digraph ContractDependencies {");
56
- lines.push(" rankdir=LR;");
57
- lines.push(" node [shape=box];");
58
- for (const [name, node] of graph) {
59
- for (const dep of node.dependencies) lines.push(` "${name}" -> "${dep}";`);
60
- if (node.dependencies.length === 0) lines.push(` "${name}";`);
61
- }
62
- lines.push("}");
63
- return lines.join("\n");
64
- }
65
- /**
66
- * Create an empty contract graph.
67
- */
68
- function createContractGraph() {
69
- return /* @__PURE__ */ new Map();
70
- }
71
- /**
72
- * Add a node to the contract graph.
73
- */
74
- function addContractNode(graph, name, file, dependencies) {
75
- graph.set(name, {
76
- name,
77
- file,
78
- dependencies,
79
- dependents: []
80
- });
81
- }
82
-
83
- //#endregion
84
- export { addContractNode, buildReverseEdges, createContractGraph, detectCycles, findMissingDependencies, toDot };
@@ -1,30 +0,0 @@
1
- //#region ../../modules/contractspec-workspace/dist/analysis/deps/parse-imports.js
2
- /**
3
- * Import parsing utilities for dependency analysis.
4
- * Extracted from cli-contracts/src/commands/deps/parse-imports.ts
5
- */
6
- /**
7
- * Parse spec imports from source code.
8
- * Returns the names of imported specs based on file naming conventions.
9
- *
10
- * @param sourceCode - The source code to parse
11
- * @param fromFilePath - The path of the file being parsed (for relative resolution)
12
- * @returns Array of imported spec names
13
- */
14
- function parseImportedSpecNames(sourceCode, _fromFilePath) {
15
- const imports = [];
16
- const importRegex = /import\s+.*?\s+from\s+['"]([^'"]+\.(?:contracts|event|presentation|workflow|data-view|migration|telemetry|experiment|app-config|integration|knowledge)(?:\.[jt]s)?)['"]/g;
17
- let match;
18
- while ((match = importRegex.exec(sourceCode)) !== null) {
19
- const importPath = match[1];
20
- if (!importPath) continue;
21
- if (!importPath.startsWith(".") && !importPath.startsWith("/")) continue;
22
- const pathParts = importPath.split("/");
23
- const name = (pathParts[pathParts.length - 1] ?? "").replace(/\.(ts|js)$/, "").replace(/\.(contracts|event|presentation|workflow|data-view|migration|telemetry|experiment|app-config|integration|knowledge)$/, "");
24
- if (name.length > 0) imports.push(name);
25
- }
26
- return Array.from(new Set(imports)).sort((a, b) => a.localeCompare(b));
27
- }
28
-
29
- //#endregion
30
- export { parseImportedSpecNames };
@@ -1,96 +0,0 @@
1
- import { scanSpecSource } from "../spec-scan.js";
2
-
3
- //#region ../../modules/contractspec-workspace/dist/analysis/diff/semantic.js
4
- /**
5
- * Compute semantic differences between two spec sources.
6
- */
7
- function computeSemanticDiff(aCode, aPath, bCode, bPath, options = {}) {
8
- const a = scanSpecSource(aCode, aPath);
9
- const b = scanSpecSource(bCode, bPath);
10
- const diffs = [];
11
- compareScalar(diffs, "specType", a.specType, b.specType, {
12
- breaking: true,
13
- label: "Spec type"
14
- });
15
- compareScalar(diffs, "name", a.name, b.name, {
16
- breaking: true,
17
- label: "Name"
18
- });
19
- compareScalar(diffs, "version", a.version, b.version, {
20
- breaking: true,
21
- label: "Version"
22
- });
23
- compareScalar(diffs, "kind", a.kind, b.kind, {
24
- breaking: true,
25
- label: "Kind"
26
- });
27
- compareScalar(diffs, "stability", a.stability, b.stability, {
28
- breaking: isStabilityDowngrade(a, b),
29
- label: "Stability"
30
- });
31
- compareArray(diffs, "owners", a.owners ?? [], b.owners ?? [], { label: "Owners" });
32
- compareArray(diffs, "tags", a.tags ?? [], b.tags ?? [], { label: "Tags" });
33
- compareStructuralHints(diffs, a, b);
34
- return options.breakingOnly ? diffs.filter((d) => d.type === "breaking") : diffs;
35
- }
36
- function compareScalar(diffs, path, a, b, config) {
37
- if (a === b) return;
38
- diffs.push({
39
- type: config.breaking ? "breaking" : "changed",
40
- path,
41
- oldValue: a,
42
- newValue: b,
43
- description: `${config.label} changed`
44
- });
45
- }
46
- function compareArray(diffs, path, a, b, config) {
47
- const aSorted = [...a].sort();
48
- const bSorted = [...b].sort();
49
- if (JSON.stringify(aSorted) === JSON.stringify(bSorted)) return;
50
- diffs.push({
51
- type: "changed",
52
- path,
53
- oldValue: aSorted,
54
- newValue: bSorted,
55
- description: `${config.label} changed`
56
- });
57
- }
58
- function isStabilityDowngrade(a, b) {
59
- const order = {
60
- experimental: 0,
61
- beta: 1,
62
- stable: 2,
63
- deprecated: 3
64
- };
65
- const aValue = a.stability ? order[a.stability] ?? 0 : 0;
66
- return (b.stability ? order[b.stability] ?? 0 : 0) > aValue;
67
- }
68
- function compareStructuralHints(diffs, a, b) {
69
- compareScalar(diffs, "hasMeta", a.hasMeta, b.hasMeta, {
70
- breaking: a.specType === "operation" || b.specType === "operation",
71
- label: "meta section presence"
72
- });
73
- compareScalar(diffs, "hasIo", a.hasIo, b.hasIo, {
74
- breaking: a.specType === "operation" || b.specType === "operation",
75
- label: "io section presence"
76
- });
77
- compareScalar(diffs, "hasPolicy", a.hasPolicy, b.hasPolicy, {
78
- breaking: a.specType === "operation" || b.specType === "operation",
79
- label: "policy section presence"
80
- });
81
- compareScalar(diffs, "hasPayload", a.hasPayload, b.hasPayload, {
82
- breaking: a.specType === "event" || b.specType === "event",
83
- label: "payload section presence"
84
- });
85
- compareScalar(diffs, "hasContent", a.hasContent, b.hasContent, {
86
- breaking: a.specType === "presentation" || b.specType === "presentation",
87
- label: "content section presence"
88
- });
89
- compareScalar(diffs, "hasDefinition", a.hasDefinition, b.hasDefinition, {
90
- breaking: a.specType === "workflow" || b.specType === "workflow",
91
- label: "definition section presence"
92
- });
93
- }
94
-
95
- //#endregion
96
- export { computeSemanticDiff };
@@ -1,151 +0,0 @@
1
- //#region ../../modules/contractspec-workspace/dist/analysis/feature-scan.js
2
- /**
3
- * Check if a file is a feature file based on naming conventions.
4
- */
5
- function isFeatureFile(filePath) {
6
- return filePath.includes(".feature.");
7
- }
8
- /**
9
- * Scan a feature source file to extract metadata.
10
- */
11
- function scanFeatureSource(code, filePath) {
12
- const key = matchStringField(code, "key") ?? extractKeyFromFilePath(filePath);
13
- const title = matchStringField(code, "title") ?? void 0;
14
- const description = matchStringField(code, "description") ?? void 0;
15
- const domain = matchStringField(code, "domain") ?? void 0;
16
- const stabilityRaw = matchStringField(code, "stability");
17
- return {
18
- filePath,
19
- key,
20
- title,
21
- description,
22
- domain,
23
- stability: isStability(stabilityRaw) ? stabilityRaw : void 0,
24
- owners: matchStringArrayField(code, "owners"),
25
- tags: matchStringArrayField(code, "tags"),
26
- operations: extractRefsFromArray(code, "operations"),
27
- events: extractRefsFromArray(code, "events"),
28
- presentations: extractRefsFromArray(code, "presentations"),
29
- experiments: extractRefsFromArray(code, "experiments"),
30
- capabilities: extractCapabilities(code),
31
- opToPresentationLinks: extractOpToPresentationLinks(code)
32
- };
33
- }
34
- /**
35
- * Extract refs from a named array (e.g., operations, events, presentations).
36
- */
37
- function extractRefsFromArray(code, fieldName) {
38
- const refs = [];
39
- const arrayPattern = new RegExp(`${escapeRegex(fieldName)}\\s*:\\s*\\[([\\s\\S]*?)\\]`, "m");
40
- const arrayMatch = code.match(arrayPattern);
41
- if (!arrayMatch?.[1]) return refs;
42
- const refPattern = /\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g;
43
- let match;
44
- while ((match = refPattern.exec(arrayMatch[1])) !== null) if (match[1] && match[2]) refs.push({
45
- name: match[1],
46
- version: Number(match[2])
47
- });
48
- return refs;
49
- }
50
- /**
51
- * Extract capability bindings (provides and requires).
52
- */
53
- function extractCapabilities(code) {
54
- const provides = [];
55
- const requires = [];
56
- const capabilitiesMatch = code.match(/capabilities\s*:\s*\{([\s\S]*?)\}/);
57
- if (!capabilitiesMatch?.[1]) return {
58
- provides,
59
- requires
60
- };
61
- const capabilitiesContent = capabilitiesMatch[1];
62
- const providesMatch = capabilitiesContent.match(/provides\s*:\s*\[([\s\S]*?)\]/);
63
- if (providesMatch?.[1]) {
64
- const refPattern = /\{\s*key:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g;
65
- let match;
66
- while ((match = refPattern.exec(providesMatch[1])) !== null) if (match[1] && match[2]) provides.push({
67
- name: match[1],
68
- version: Number(match[2])
69
- });
70
- }
71
- const requiresMatch = capabilitiesContent.match(/requires\s*:\s*\[([\s\S]*?)\]/);
72
- if (requiresMatch?.[1]) {
73
- const refPatternWithVersion = /\{\s*key:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g;
74
- const refPatternKeyOnly = /\{\s*key:\s*['"]([^'"]+)['"]\s*\}/g;
75
- let match = null;
76
- while ((match = refPatternWithVersion.exec(requiresMatch[1])) !== null) if (match[1] && match[2]) requires.push({
77
- name: match[1],
78
- version: Number(match[2])
79
- });
80
- while ((match = refPatternKeyOnly.exec(requiresMatch[1])) !== null) if (match && match[1]) {
81
- if (!requires.some((r) => r.name === match[1])) requires.push({
82
- name: match[1],
83
- version: 1
84
- });
85
- }
86
- }
87
- return {
88
- provides,
89
- requires
90
- };
91
- }
92
- /**
93
- * Extract opToPresentation links.
94
- */
95
- function extractOpToPresentationLinks(code) {
96
- const links = [];
97
- const arrayMatch = code.match(/opToPresentation\s*:\s*\[([\s\S]*?)\]/);
98
- if (!arrayMatch?.[1]) return links;
99
- const linkPattern = /\{\s*op:\s*\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)\s*\}\s*,\s*pres:\s*\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)\s*\}/g;
100
- let match;
101
- while ((match = linkPattern.exec(arrayMatch[1])) !== null) if (match[1] && match[2] && match[3] && match[4]) links.push({
102
- op: {
103
- name: match[1],
104
- version: Number(match[2])
105
- },
106
- pres: {
107
- name: match[3],
108
- version: Number(match[4])
109
- }
110
- });
111
- return links;
112
- }
113
- /**
114
- * Extract key from file path as fallback.
115
- */
116
- function extractKeyFromFilePath(filePath) {
117
- return (filePath.split("/").pop() ?? filePath).replace(/\.feature\.[jt]s$/, "").replace(/[^a-zA-Z0-9-]/g, "-");
118
- }
119
- /**
120
- * Match a string field in source code.
121
- */
122
- function matchStringField(code, field) {
123
- const regex = /* @__PURE__ */ new RegExp(`${escapeRegex(field)}\\s*:\\s*['"]([^'"]+)['"]`);
124
- return code.match(regex)?.[1] ?? null;
125
- }
126
- /**
127
- * Match a string array field in source code.
128
- */
129
- function matchStringArrayField(code, field) {
130
- const regex = /* @__PURE__ */ new RegExp(`${escapeRegex(field)}\\s*:\\s*\\[([\\s\\S]*?)\\]`);
131
- const match = code.match(regex);
132
- if (!match?.[1]) return void 0;
133
- const inner = match[1];
134
- const items = Array.from(inner.matchAll(/['"]([^'"]+)['"]/g)).map((m) => m[1]).filter((value) => typeof value === "string" && value.length > 0);
135
- return items.length > 0 ? items : void 0;
136
- }
137
- /**
138
- * Check if a value is a valid stability.
139
- */
140
- function isStability(value) {
141
- return value === "experimental" || value === "beta" || value === "stable" || value === "deprecated";
142
- }
143
- /**
144
- * Escape regex special characters.
145
- */
146
- function escapeRegex(value) {
147
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
148
- }
149
-
150
- //#endregion
151
- export { isFeatureFile, scanFeatureSource };