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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/dist/_virtual/rolldown_runtime.js +1 -22
  2. package/dist/adapters/ai.js +1 -82
  3. package/dist/adapters/factory.js +1 -36
  4. package/dist/adapters/fs.js +1 -118
  5. package/dist/adapters/git.js +1 -54
  6. package/dist/adapters/index.js +1 -7
  7. package/dist/adapters/logger.js +1 -80
  8. package/dist/adapters/watcher.js +1 -69
  9. package/dist/adapters/workspace.js +2 -190
  10. package/dist/ai/agents/claude-code-agent.js +9 -146
  11. package/dist/ai/agents/cursor-agent.js +17 -286
  12. package/dist/ai/agents/index.js +1 -5
  13. package/dist/ai/agents/openai-codex-agent.js +8 -140
  14. package/dist/ai/agents/orchestrator.js +1 -142
  15. package/dist/ai/agents/simple-agent.js +4 -80
  16. package/dist/ai/client.js +1 -162
  17. package/dist/ai/index.js +1 -27
  18. package/dist/ai/prompts/code-generation.js +13 -55
  19. package/dist/ai/prompts/index.js +1 -12
  20. package/dist/ai/prompts/spec-creation.js +20 -61
  21. package/dist/ai/providers.js +1 -40
  22. package/dist/formatters/index.js +1 -18
  23. package/dist/formatters/json.js +1 -71
  24. package/dist/formatters/sarif.js +1 -163
  25. package/dist/formatters/text.js +2 -208
  26. package/dist/index.js +1 -81
  27. package/dist/services/agent-guide/adapters/claude-code.js +3 -144
  28. package/dist/services/agent-guide/adapters/cursor-cli.js +3 -135
  29. package/dist/services/agent-guide/adapters/generic-mcp.js +3 -159
  30. package/dist/services/agent-guide/adapters/index.js +1 -30
  31. package/dist/services/agent-guide/agent-guide-service.js +1 -148
  32. package/dist/services/agent-guide/index.js +1 -5
  33. package/dist/services/build.js +1 -140
  34. package/dist/services/ci-check/ci-check-service.js +1 -393
  35. package/dist/services/ci-check/index.js +1 -2
  36. package/dist/services/ci-check/types.js +1 -28
  37. package/dist/services/clean.js +1 -71
  38. package/dist/services/config.js +1 -76
  39. package/dist/services/deps.js +1 -62
  40. package/dist/services/diff.js +1 -33
  41. package/dist/services/doctor/checks/ai.js +2 -118
  42. package/dist/services/doctor/checks/cli.js +1 -146
  43. package/dist/services/doctor/checks/config.js +1 -170
  44. package/dist/services/doctor/checks/deps.js +1 -180
  45. package/dist/services/doctor/checks/index.js +1 -6
  46. package/dist/services/doctor/checks/mcp.js +1 -144
  47. package/dist/services/doctor/checks/workspace.js +1 -243
  48. package/dist/services/doctor/doctor-service.js +2 -115
  49. package/dist/services/doctor/index.js +1 -2
  50. package/dist/services/doctor/types.js +1 -26
  51. package/dist/services/implementation/discovery.js +2 -143
  52. package/dist/services/implementation/index.js +1 -2
  53. package/dist/services/implementation/resolver.js +1 -223
  54. package/dist/services/index.js +1 -53
  55. package/dist/services/integrity-diagram.js +6 -274
  56. package/dist/services/integrity.js +1 -272
  57. package/dist/services/list.js +1 -35
  58. package/dist/services/openapi/export-service.js +2 -51
  59. package/dist/services/openapi/import-service.js +1 -75
  60. package/dist/services/openapi/index.js +1 -4
  61. package/dist/services/openapi/sync-service.js +1 -121
  62. package/dist/services/openapi/validate-service.js +1 -130
  63. package/dist/services/regenerator.js +1 -23
  64. package/dist/services/registry.js +1 -73
  65. package/dist/services/setup/config-generators.js +26 -113
  66. package/dist/services/setup/file-merger.js +2 -60
  67. package/dist/services/setup/index.js +1 -4
  68. package/dist/services/setup/setup-service.js +1 -95
  69. package/dist/services/setup/targets/agents-md.js +1 -46
  70. package/dist/services/setup/targets/cli-config.js +1 -59
  71. package/dist/services/setup/targets/cursor-rules.js +1 -47
  72. package/dist/services/setup/targets/mcp-claude.js +1 -59
  73. package/dist/services/setup/targets/mcp-cursor.js +1 -58
  74. package/dist/services/setup/targets/vscode-settings.js +1 -62
  75. package/dist/services/setup/types.js +1 -26
  76. package/dist/services/sync.js +1 -62
  77. package/dist/services/test.js +1 -30
  78. package/dist/services/validate-implementation.js +1 -69
  79. package/dist/services/validate.js +1 -47
  80. package/dist/services/verification-cache/adapters/filesystem.js +1 -121
  81. package/dist/services/verification-cache/adapters/in-memory.js +1 -45
  82. package/dist/services/verification-cache/adapters/index.js +1 -3
  83. package/dist/services/verification-cache/adapters/workspace-state.js +1 -90
  84. package/dist/services/verification-cache/cache-service.js +1 -255
  85. package/dist/services/verification-cache/index.js +1 -6
  86. package/dist/services/verification-cache/types.js +1 -15
  87. package/dist/services/verify/ai-verifier.js +9 -336
  88. package/dist/services/verify/behavior-verifier.js +1 -185
  89. package/dist/services/verify/index.js +1 -4
  90. package/dist/services/verify/structure-verifier.js +2 -195
  91. package/dist/services/verify/verify-service.js +3 -203
  92. package/dist/services/watch.js +1 -31
  93. package/dist/services/workspace-info.js +2 -102
  94. package/dist/templates/app-config.template.js +28 -101
  95. package/dist/templates/data-view.template.js +27 -42
  96. package/dist/templates/event.template.js +14 -29
  97. package/dist/templates/experiment.template.js +51 -77
  98. package/dist/templates/handler.template.js +17 -53
  99. package/dist/templates/index.js +1 -36
  100. package/dist/templates/integration.template.js +50 -134
  101. package/dist/templates/knowledge.template.js +21 -62
  102. package/dist/templates/migration.template.js +26 -50
  103. package/dist/templates/operation.template.js +28 -44
  104. package/dist/templates/presentation.template.js +20 -46
  105. package/dist/templates/telemetry.template.js +53 -74
  106. package/dist/templates/workflow-runner.template.js +6 -12
  107. package/dist/templates/workflow.template.js +24 -51
  108. package/package.json +10 -15
  109. package/dist/adapters/ai.d.ts +0 -11
  110. package/dist/adapters/factory.d.ts +0 -28
  111. package/dist/adapters/fs.d.ts +0 -10
  112. package/dist/adapters/git.d.ts +0 -10
  113. package/dist/adapters/logger.d.ts +0 -17
  114. package/dist/adapters/watcher.d.ts +0 -10
  115. package/dist/adapters/workspace.d.ts +0 -93
  116. package/dist/ai/agents/claude-code-agent.d.ts +0 -21
  117. package/dist/ai/agents/cursor-agent.d.ts +0 -67
  118. package/dist/ai/agents/openai-codex-agent.d.ts +0 -21
  119. package/dist/ai/agents/orchestrator.d.ts +0 -49
  120. package/dist/ai/agents/simple-agent.d.ts +0 -16
  121. package/dist/ai/agents/types.d.ts +0 -35
  122. package/dist/ai/client.d.ts +0 -82
  123. package/dist/ai/index.d.ts +0 -16
  124. package/dist/ai/prompts/code-generation.d.ts +0 -25
  125. package/dist/ai/prompts/index.d.ts +0 -9
  126. package/dist/ai/prompts/spec-creation.d.ts +0 -28
  127. package/dist/ai/providers.d.ts +0 -28
  128. package/dist/formatters/index.d.ts +0 -10
  129. package/dist/formatters/json.d.ts +0 -88
  130. package/dist/formatters/sarif.d.ts +0 -100
  131. package/dist/formatters/text.d.ts +0 -34
  132. package/dist/index.d.ts +0 -66
  133. package/dist/libs/ai-providers/dist/factory.js +0 -154
  134. package/dist/libs/ai-providers/dist/index.js +0 -4
  135. package/dist/libs/ai-providers/dist/legacy.js +0 -72
  136. package/dist/libs/ai-providers/dist/models.js +0 -287
  137. package/dist/libs/ai-providers/dist/validation.js +0 -1
  138. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
  139. package/dist/libs/contracts/dist/client/index.js +0 -5
  140. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
  141. package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
  142. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  143. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  144. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
  145. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  146. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  147. package/dist/libs/contracts/dist/docs/index.js +0 -29
  148. package/dist/libs/contracts/dist/docs/presentations.js +0 -71
  149. package/dist/libs/contracts/dist/docs/registry.js +0 -44
  150. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  151. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  152. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  153. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  154. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  155. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  156. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  157. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  158. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  159. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  160. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  161. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  162. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  163. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  164. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  165. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  166. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  167. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  168. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  169. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  170. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  171. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  172. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  173. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  174. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  175. package/dist/libs/contracts/dist/events.js +0 -8
  176. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  177. package/dist/libs/contracts/dist/index.js +0 -72
  178. package/dist/libs/contracts/dist/install.js +0 -2
  179. package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
  180. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  181. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  182. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  183. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  184. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  185. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
  186. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  187. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  188. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  189. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
  190. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
  191. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  192. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
  193. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
  194. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
  195. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
  196. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  197. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
  198. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  199. package/dist/libs/contracts/dist/jsonschema.js +0 -24
  200. package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
  201. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  202. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  203. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  204. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  205. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  206. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  207. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  208. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  209. package/dist/libs/contracts/dist/llm/exporters.js +0 -352
  210. package/dist/libs/contracts/dist/llm/index.js +0 -2
  211. package/dist/libs/contracts/dist/llm/prompts.js +0 -211
  212. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  213. package/dist/libs/contracts/dist/openapi.js +0 -75
  214. package/dist/libs/contracts/dist/ownership.js +0 -21
  215. package/dist/libs/contracts/dist/presentations.js +0 -1
  216. package/dist/libs/contracts/dist/presentations.v2.js +0 -11
  217. package/dist/libs/contracts/dist/prompt.js +0 -1
  218. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  219. package/dist/libs/contracts/dist/regenerator/index.js +0 -2
  220. package/dist/libs/contracts/dist/regenerator/service.js +0 -92
  221. package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
  222. package/dist/libs/contracts/dist/registry.js +0 -208
  223. package/dist/libs/contracts/dist/resources.js +0 -1
  224. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  225. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  226. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  227. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
  228. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  229. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  230. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  231. package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
  232. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  233. package/dist/libs/contracts/dist/server/index.js +0 -8
  234. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  235. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
  236. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  237. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  238. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  239. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  240. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  241. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  242. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  243. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  244. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  245. package/dist/libs/contracts/dist/spec.js +0 -35
  246. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  247. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  248. package/dist/libs/contracts/dist/tests/index.js +0 -1
  249. package/dist/libs/contracts/dist/tests/runner.js +0 -150
  250. package/dist/libs/contracts/dist/workflow/index.js +0 -1
  251. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  252. package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
  253. package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
  254. package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
  255. package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
  256. package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
  257. package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
  258. package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
  259. package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
  260. package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
  261. package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
  262. package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
  263. package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
  264. package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
  265. package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
  266. package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
  267. package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
  268. package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
  269. package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
  270. package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
  271. package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
  272. package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
  273. package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
  274. package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
  275. package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
  276. package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
  277. package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
  278. package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
  279. package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
  280. package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
  281. package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
  282. package/dist/ports/ai.d.ts +0 -58
  283. package/dist/ports/fs.d.ts +0 -80
  284. package/dist/ports/git.d.ts +0 -32
  285. package/dist/ports/logger.d.ts +0 -87
  286. package/dist/ports/watcher.d.ts +0 -51
  287. package/dist/services/agent-guide/adapters/claude-code.d.ts +0 -34
  288. package/dist/services/agent-guide/adapters/cursor-cli.d.ts +0 -38
  289. package/dist/services/agent-guide/adapters/generic-mcp.d.ts +0 -52
  290. package/dist/services/agent-guide/adapters/index.d.ts +0 -22
  291. package/dist/services/agent-guide/agent-guide-service.d.ts +0 -55
  292. package/dist/services/agent-guide/types.d.ts +0 -57
  293. package/dist/services/build.d.ts +0 -58
  294. package/dist/services/ci-check/ci-check-service.d.ts +0 -15
  295. package/dist/services/ci-check/types.d.ts +0 -142
  296. package/dist/services/clean.d.ts +0 -40
  297. package/dist/services/config.d.ts +0 -25
  298. package/dist/services/deps.d.ts +0 -52
  299. package/dist/services/diff.d.ts +0 -33
  300. package/dist/services/doctor/doctor-service.d.ts +0 -23
  301. package/dist/services/doctor/types.d.ts +0 -117
  302. package/dist/services/implementation/discovery.d.ts +0 -29
  303. package/dist/services/implementation/resolver.d.ts +0 -43
  304. package/dist/services/implementation/types.d.ts +0 -78
  305. package/dist/services/integrity-diagram.d.ts +0 -35
  306. package/dist/services/integrity.d.ts +0 -133
  307. package/dist/services/list.d.ts +0 -30
  308. package/dist/services/openapi/export-service.d.ts +0 -52
  309. package/dist/services/openapi/import-service.d.ts +0 -15
  310. package/dist/services/openapi/sync-service.d.ts +0 -18
  311. package/dist/services/openapi/types.d.ts +0 -184
  312. package/dist/services/openapi/validate-service.d.ts +0 -15
  313. package/dist/services/regenerator.d.ts +0 -17
  314. package/dist/services/registry.d.ts +0 -52
  315. package/dist/services/setup/config-generators.d.ts +0 -41
  316. package/dist/services/setup/file-merger.d.ts +0 -26
  317. package/dist/services/setup/setup-service.d.ts +0 -11
  318. package/dist/services/setup/types.d.ts +0 -84
  319. package/dist/services/sync.d.ts +0 -40
  320. package/dist/services/test.d.ts +0 -14
  321. package/dist/services/validate-implementation.d.ts +0 -31
  322. package/dist/services/validate.d.ts +0 -40
  323. package/dist/services/verification-cache/adapters/filesystem.d.ts +0 -45
  324. package/dist/services/verification-cache/adapters/in-memory.d.ts +0 -26
  325. package/dist/services/verification-cache/adapters/workspace-state.d.ts +0 -48
  326. package/dist/services/verification-cache/cache-service.d.ts +0 -69
  327. package/dist/services/verification-cache/types.d.ts +0 -123
  328. package/dist/services/verify/ai-verifier.d.ts +0 -24
  329. package/dist/services/verify/behavior-verifier.d.ts +0 -11
  330. package/dist/services/verify/structure-verifier.d.ts +0 -11
  331. package/dist/services/verify/types.d.ts +0 -136
  332. package/dist/services/verify/verify-service.d.ts +0 -59
  333. package/dist/services/watch.d.ts +0 -24
  334. package/dist/services/workspace-info.d.ts +0 -61
  335. package/dist/templates/app-config.template.d.ts +0 -6
  336. package/dist/templates/data-view.template.d.ts +0 -6
  337. package/dist/templates/event.template.d.ts +0 -10
  338. package/dist/templates/experiment.template.d.ts +0 -6
  339. package/dist/templates/handler.template.d.ts +0 -15
  340. package/dist/templates/index.d.ts +0 -20
  341. package/dist/templates/integration.template.d.ts +0 -6
  342. package/dist/templates/knowledge.template.d.ts +0 -6
  343. package/dist/templates/migration.template.d.ts +0 -6
  344. package/dist/templates/operation.template.d.ts +0 -10
  345. package/dist/templates/presentation.template.d.ts +0 -10
  346. package/dist/templates/telemetry.template.d.ts +0 -6
  347. package/dist/templates/workflow-runner.template.d.ts +0 -15
  348. package/dist/templates/workflow.template.d.ts +0 -6
  349. package/dist/types/config.d.ts +0 -33
  350. package/dist/types.d.ts +0 -323
@@ -1,344 +0,0 @@
1
- //#region ../../modules/contractspec-workspace/dist/analysis/spec-scan.js
2
- /**
3
- * Infer spec type from file path based on naming conventions.
4
- * Supports all contract types from @lssm/lib.contracts.
5
- */
6
- function inferSpecTypeFromFilePath(filePath) {
7
- if (filePath.includes(".contracts.") || filePath.includes("/contracts/")) return "operation";
8
- if (filePath.includes(".event.") || filePath.includes("/events/") || filePath.endsWith("/events.ts")) return "event";
9
- if (filePath.includes(".presentation.") || filePath.includes("/presentations/") || filePath.endsWith("/presentations.ts")) return "presentation";
10
- if (filePath.includes(".feature.")) return "feature";
11
- if (filePath.includes(".capability.")) return "capability";
12
- if (filePath.includes(".data-view.")) return "data-view";
13
- if (filePath.includes(".form.")) return "form";
14
- if (filePath.includes(".migration.")) return "migration";
15
- if (filePath.includes(".workflow.")) return "workflow";
16
- if (filePath.includes(".experiment.")) return "experiment";
17
- if (filePath.includes(".integration.")) return "integration";
18
- if (filePath.includes(".knowledge.")) return "knowledge";
19
- if (filePath.includes(".telemetry.")) return "telemetry";
20
- if (filePath.includes(".app-config.")) return "app-config";
21
- if (filePath.includes(".policy.")) return "policy";
22
- if (filePath.includes(".test-spec.")) return "test-spec";
23
- return "unknown";
24
- }
25
- /**
26
- * Scan spec source code to extract metadata without executing it.
27
- */
28
- function scanSpecSource(code, filePath) {
29
- const specType = inferSpecTypeFromFilePath(filePath);
30
- const name = matchStringField(code, "name");
31
- const description = matchStringField(code, "description");
32
- const stabilityRaw = matchStringField(code, "stability");
33
- const stability = isStability(stabilityRaw) ? stabilityRaw : void 0;
34
- const owners = matchStringArrayField(code, "owners");
35
- const tags = matchStringArrayField(code, "tags");
36
- const version = matchNumberField(code, "version");
37
- const kind = inferOperationKind(code);
38
- const hasMeta = /meta\s*:\s*{/.test(code);
39
- const hasIo = /\bio\s*:\s*{/.test(code);
40
- const hasPolicy = /\bpolicy\s*:\s*{/.test(code);
41
- const hasPayload = /\bpayload\s*:\s*{/.test(code);
42
- const hasContent = /\bcontent\s*:\s*{/.test(code);
43
- const hasDefinition = /\bdefinition\s*:\s*{/.test(code);
44
- const emittedEvents = specType === "operation" ? extractEmittedEvents(code) : void 0;
45
- const policyRefs = specType === "operation" ? extractPolicyRefs(code) : void 0;
46
- const testRefs = extractTestRefs(code);
47
- return {
48
- filePath,
49
- specType,
50
- name: name ?? void 0,
51
- description: description ?? void 0,
52
- stability,
53
- owners,
54
- tags,
55
- version: version ?? void 0,
56
- kind,
57
- hasMeta,
58
- hasIo,
59
- hasPolicy,
60
- hasPayload,
61
- hasContent,
62
- hasDefinition,
63
- emittedEvents,
64
- policyRefs,
65
- testRefs
66
- };
67
- }
68
- /**
69
- * Extract emitted event refs from operation spec source.
70
- * Looks for sideEffects.emits array entries.
71
- */
72
- function extractEmittedEvents(code) {
73
- const events = [];
74
- const inlinePattern = /\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g;
75
- let match;
76
- while ((match = inlinePattern.exec(code)) !== null) if (match[1] && match[2]) events.push({
77
- name: match[1],
78
- version: Number(match[2])
79
- });
80
- const refPattern = /\{\s*ref:\s*(\w+)/g;
81
- while ((match = refPattern.exec(code)) !== null) if (match[1] && !match[1].startsWith("when")) {}
82
- return events.length > 0 ? events : void 0;
83
- }
84
- /**
85
- * Extract policy refs from operation spec source.
86
- */
87
- function extractPolicyRefs(code) {
88
- const policies = [];
89
- const policyPattern = /\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g;
90
- const policySectionMatch = code.match(/policies\s*:\s*\[([\s\S]*?)\]/);
91
- if (policySectionMatch?.[1]) {
92
- let match;
93
- while ((match = policyPattern.exec(policySectionMatch[1])) !== null) if (match[1] && match[2]) policies.push({
94
- name: match[1],
95
- version: Number(match[2])
96
- });
97
- }
98
- return policies.length > 0 ? policies : void 0;
99
- }
100
- /**
101
- * Extract test spec refs.
102
- */
103
- function extractTestRefs(code) {
104
- const tests = [];
105
- const testsSectionMatch = code.match(/tests\s*:\s*\[([\s\S]*?)\]/);
106
- if (testsSectionMatch?.[1]) {
107
- const refPattern = /\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g;
108
- let match;
109
- while ((match = refPattern.exec(testsSectionMatch[1])) !== null) if (match[1] && match[2]) tests.push({
110
- name: match[1],
111
- version: Number(match[2])
112
- });
113
- }
114
- return tests.length > 0 ? tests : void 0;
115
- }
116
- function matchStringField(code, field) {
117
- const regex = /* @__PURE__ */ new RegExp(`${escapeRegex(field)}\\s*:\\s*['"]([^'"]+)['"]`);
118
- return code.match(regex)?.[1] ?? null;
119
- }
120
- function matchNumberField(code, field) {
121
- const regex = /* @__PURE__ */ new RegExp(`${escapeRegex(field)}\\s*:\\s*(\\d+)`);
122
- const match = code.match(regex);
123
- if (!match?.[1]) return null;
124
- const parsed = Number(match[1]);
125
- return Number.isFinite(parsed) ? parsed : null;
126
- }
127
- function matchStringArrayField(code, field) {
128
- const regex = /* @__PURE__ */ new RegExp(`${escapeRegex(field)}\\s*:\\s*\\[([\\s\\S]*?)\\]`);
129
- const match = code.match(regex);
130
- if (!match?.[1]) return void 0;
131
- const inner = match[1];
132
- const items = Array.from(inner.matchAll(/['"]([^'"]+)['"]/g)).map((m) => m[1]).filter((value) => typeof value === "string" && value.length > 0);
133
- return items.length > 0 ? items : void 0;
134
- }
135
- function isStability(value) {
136
- return value === "experimental" || value === "beta" || value === "stable" || value === "deprecated";
137
- }
138
- function escapeRegex(value) {
139
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
140
- }
141
- /**
142
- * Infer operation kind from source code.
143
- * First checks for defineCommand/defineQuery usage (which set kind automatically),
144
- * then falls back to explicit kind field.
145
- */
146
- function inferOperationKind(code) {
147
- if (/defineCommand\s*\(/.test(code)) return "command";
148
- if (/defineQuery\s*\(/.test(code)) return "query";
149
- const kindRaw = matchStringField(code, "kind");
150
- return kindRaw === "command" || kindRaw === "query" ? kindRaw : "unknown";
151
- }
152
- /**
153
- * Infer operation kind from a specific code block.
154
- */
155
- function inferOperationKindFromBlock(block) {
156
- if (/defineCommand\s*\(/.test(block)) return "command";
157
- if (/defineQuery\s*\(/.test(block)) return "query";
158
- const kindRaw = matchStringField(block, "kind");
159
- return kindRaw === "command" || kindRaw === "query" ? kindRaw : "unknown";
160
- }
161
- /**
162
- * Extract name and version from a meta block.
163
- */
164
- function extractMetaFromBlock(block) {
165
- const name = matchStringField(block, "name");
166
- const version = matchNumberField(block, "version");
167
- if (name && version !== null) return {
168
- name,
169
- version
170
- };
171
- return null;
172
- }
173
- /**
174
- * Define function patterns for all spec types.
175
- */
176
- const DEFINE_FUNCTION_PATTERNS = [
177
- {
178
- pattern: /defineCommand\s*\(\s*\{/g,
179
- type: "operation"
180
- },
181
- {
182
- pattern: /defineQuery\s*\(\s*\{/g,
183
- type: "operation"
184
- },
185
- {
186
- pattern: /defineEvent\s*\(\s*\{/g,
187
- type: "event"
188
- },
189
- {
190
- pattern: /:\s*PresentationDescriptorV2\s*=\s*\{/g,
191
- type: "presentation"
192
- },
193
- {
194
- pattern: /:\s*PresentationDescriptor\s*=\s*\{/g,
195
- type: "presentation"
196
- },
197
- {
198
- pattern: /definePresentation\s*\(\s*\{/g,
199
- type: "presentation"
200
- },
201
- {
202
- pattern: /defineCapability\s*\(\s*\{/g,
203
- type: "capability"
204
- },
205
- {
206
- pattern: /defineWorkflow\s*\(\s*\{/g,
207
- type: "workflow"
208
- },
209
- {
210
- pattern: /defineExperiment\s*\(\s*\{/g,
211
- type: "experiment"
212
- },
213
- {
214
- pattern: /defineIntegration\s*\(\s*\{/g,
215
- type: "integration"
216
- },
217
- {
218
- pattern: /defineKnowledge\s*\(\s*\{/g,
219
- type: "knowledge"
220
- },
221
- {
222
- pattern: /defineTelemetry\s*\(\s*\{/g,
223
- type: "telemetry"
224
- },
225
- {
226
- pattern: /defineAppConfig\s*\(\s*\{/g,
227
- type: "app-config"
228
- },
229
- {
230
- pattern: /definePolicy\s*\(\s*\{/g,
231
- type: "policy"
232
- },
233
- {
234
- pattern: /defineTestSpec\s*\(\s*\{/g,
235
- type: "test-spec"
236
- },
237
- {
238
- pattern: /defineDataView\s*\(\s*\{/g,
239
- type: "data-view"
240
- },
241
- {
242
- pattern: /defineForm\s*\(\s*\{/g,
243
- type: "form"
244
- },
245
- {
246
- pattern: /defineMigration\s*\(\s*\{/g,
247
- type: "migration"
248
- }
249
- ];
250
- /**
251
- * Find matching closing brace for an opening brace.
252
- * Returns the index of the closing brace or -1 if not found.
253
- */
254
- function findMatchingBrace(code, startIndex) {
255
- let depth = 0;
256
- let inString = false;
257
- let stringChar = "";
258
- for (let i = startIndex; i < code.length; i++) {
259
- const char = code[i];
260
- const prevChar = i > 0 ? code[i - 1] : "";
261
- if ((char === "\"" || char === "'" || char === "`") && prevChar !== "\\") {
262
- if (!inString) {
263
- inString = true;
264
- stringChar = char;
265
- } else if (char === stringChar) inString = false;
266
- continue;
267
- }
268
- if (inString) continue;
269
- if (char === "{") depth++;
270
- else if (char === "}") {
271
- depth--;
272
- if (depth === 0) return i;
273
- }
274
- }
275
- return -1;
276
- }
277
- /**
278
- * Scan spec source code to extract ALL specs from a file.
279
- * This function finds multiple spec definitions in a single file.
280
- */
281
- function scanAllSpecsFromSource(code, filePath) {
282
- const results = [];
283
- const baseSpecType = inferSpecTypeFromFilePath(filePath);
284
- const processedPositions = /* @__PURE__ */ new Set();
285
- for (const { pattern, type } of DEFINE_FUNCTION_PATTERNS) {
286
- pattern.lastIndex = 0;
287
- let match;
288
- while ((match = pattern.exec(code)) !== null) {
289
- const startPos = match.index;
290
- if (processedPositions.has(startPos)) continue;
291
- processedPositions.add(startPos);
292
- const openBracePos = code.indexOf("{", startPos);
293
- if (openBracePos === -1) continue;
294
- const closeBracePos = findMatchingBrace(code, openBracePos);
295
- if (closeBracePos === -1) continue;
296
- const block = code.slice(openBracePos, closeBracePos + 1);
297
- const meta = extractMetaFromBlock(block);
298
- if (!meta) continue;
299
- const description = matchStringField(block, "description");
300
- const stabilityRaw = matchStringField(block, "stability");
301
- const stability = isStability(stabilityRaw) ? stabilityRaw : void 0;
302
- const owners = matchStringArrayField(block, "owners");
303
- const tags = matchStringArrayField(block, "tags");
304
- const hasMeta = /meta\s*:\s*{/.test(block);
305
- const hasIo = /\bio\s*:\s*{/.test(block);
306
- const hasPolicy = /\bpolicy\s*:\s*{/.test(block);
307
- const hasPayload = /\bpayload\s*:\s*{/.test(block);
308
- const hasContent = /\bcontent\s*:\s*{/.test(block);
309
- const hasDefinition = /\bdefinition\s*:\s*{/.test(block);
310
- const kind = type === "operation" ? inferOperationKindFromBlock(block) : "unknown";
311
- const emittedEvents = type === "operation" ? extractEmittedEvents(block) : void 0;
312
- const policyRefs = type === "operation" ? extractPolicyRefs(block) : void 0;
313
- const testRefs = extractTestRefs(block);
314
- results.push({
315
- filePath,
316
- specType: type,
317
- name: meta.name,
318
- version: meta.version,
319
- description: description ?? void 0,
320
- stability,
321
- owners,
322
- tags,
323
- kind,
324
- hasMeta,
325
- hasIo,
326
- hasPolicy,
327
- hasPayload,
328
- hasContent,
329
- hasDefinition,
330
- emittedEvents,
331
- policyRefs,
332
- testRefs
333
- });
334
- }
335
- }
336
- if (results.length === 0 && baseSpecType !== "unknown") {
337
- const fallback = scanSpecSource(code, filePath);
338
- if (fallback.name && fallback.version !== void 0) results.push(fallback);
339
- }
340
- return results;
341
- }
342
-
343
- //#endregion
344
- export { extractEmittedEvents, extractPolicyRefs, extractTestRefs, inferSpecTypeFromFilePath, scanAllSpecsFromSource, scanSpecSource };
@@ -1,122 +0,0 @@
1
- //#region ../../modules/contractspec-workspace/dist/analysis/validate/spec-structure.js
2
- /**
3
- * Validate spec structure based on source code and filename.
4
- */
5
- function validateSpecStructure(code, fileName) {
6
- const errors = [];
7
- const warnings = [];
8
- if (!/export\s+(const|let)\s+\w+/.test(code)) errors.push("No exported spec found");
9
- if (fileName.includes(".contracts.")) validateOperationSpec(code, errors, warnings);
10
- if (fileName.includes(".event.")) validateEventSpec(code, errors, warnings);
11
- if (fileName.includes(".presentation.")) validatePresentationSpec(code, errors, warnings);
12
- if (fileName.includes(".workflow.")) validateWorkflowSpec(code, errors, warnings);
13
- if (fileName.includes(".data-view.")) validateDataViewSpec(code, errors, warnings);
14
- if (fileName.includes(".migration.")) validateMigrationSpec(code, errors, warnings);
15
- if (fileName.includes(".telemetry.")) validateTelemetrySpec(code, errors, warnings);
16
- if (fileName.includes(".experiment.")) validateExperimentSpec(code, errors, warnings);
17
- if (fileName.includes(".app-config.")) validateAppConfigSpec(code, errors, warnings);
18
- validateCommonFields(code, errors, warnings);
19
- return {
20
- valid: errors.length === 0,
21
- errors,
22
- warnings
23
- };
24
- }
25
- /**
26
- * Validate operation spec
27
- */
28
- function validateOperationSpec(code, errors, warnings) {
29
- if (!/define(Command|Query)/.test(code)) errors.push("Missing defineCommand or defineQuery call");
30
- if (!code.includes("meta:")) errors.push("Missing meta section");
31
- if (!code.includes("io:")) errors.push("Missing io section");
32
- if (!code.includes("policy:")) errors.push("Missing policy section");
33
- if (!code.match(/name:\s*['"][^'"]+['"]/)) errors.push("Missing or invalid name field");
34
- if (!code.match(/version:\s*\d+/)) errors.push("Missing or invalid version field");
35
- const hasDefineCommand = /defineCommand\s*\(/.test(code);
36
- const hasDefineQuery = /defineQuery\s*\(/.test(code);
37
- const hasExplicitKind = /kind:\s*['"](?:command|query)['"]/.test(code);
38
- if (!hasDefineCommand && !hasDefineQuery && !hasExplicitKind) errors.push("Missing kind: use defineCommand(), defineQuery(), or explicit kind field");
39
- if (!code.includes("acceptance:")) warnings.push("No acceptance scenarios defined");
40
- if (!code.includes("examples:")) warnings.push("No examples provided");
41
- if (code.includes("TODO")) warnings.push("Contains TODO items that need completion");
42
- }
43
- function validateTelemetrySpec(code, errors, warnings) {
44
- if (!code.match(/:\s*TelemetrySpec\s*=/)) errors.push("Missing TelemetrySpec type annotation");
45
- if (!code.match(/meta:\s*{[\s\S]*name:/)) errors.push("TelemetrySpec.meta is required");
46
- if (!code.includes("events:")) errors.push("TelemetrySpec must declare events");
47
- if (!code.match(/privacy:\s*'(public|internal|pii|sensitive)'/)) warnings.push("No explicit privacy classification found");
48
- }
49
- function validateExperimentSpec(code, errors, warnings) {
50
- if (!code.match(/:\s*ExperimentSpec\s*=/)) errors.push("Missing ExperimentSpec type annotation");
51
- if (!code.includes("controlVariant")) errors.push("ExperimentSpec must declare controlVariant");
52
- if (!code.includes("variants:")) errors.push("ExperimentSpec must declare variants");
53
- if (!code.match(/allocation:\s*{/)) warnings.push("ExperimentSpec missing allocation configuration");
54
- }
55
- function validateAppConfigSpec(code, errors, warnings) {
56
- if (!code.match(/:\s*AppBlueprintSpec\s*=/)) errors.push("Missing AppBlueprintSpec type annotation");
57
- if (!code.includes("meta:")) errors.push("AppBlueprintSpec must define meta");
58
- if (!code.includes("appId")) warnings.push("AppBlueprint meta missing appId assignment");
59
- if (!code.includes("capabilities")) warnings.push("App blueprint spec does not declare capabilities");
60
- }
61
- /**
62
- * Validate event spec
63
- */
64
- function validateEventSpec(code, errors, warnings) {
65
- if (!code.includes("defineEvent")) errors.push("Missing defineEvent call");
66
- if (!code.match(/name:\s*['"][^'"]+['"]/)) errors.push("Missing or invalid name field");
67
- if (!code.match(/version:\s*\d+/)) errors.push("Missing or invalid version field");
68
- if (!code.includes("payload:")) errors.push("Missing payload field");
69
- const nameMatch = code.match(/name:\s*['"]([^'"]+)['"]/);
70
- if (nameMatch?.[1]) {
71
- if (!(nameMatch[1].split(".").pop() ?? "").match(/(ed|created|updated|deleted|completed)$/i)) warnings.push("Event name should use past tense (e.g., \"created\", \"updated\")");
72
- }
73
- }
74
- /**
75
- * Validate presentation spec
76
- */
77
- function validatePresentationSpec(code, errors, _warnings) {
78
- if (!code.match(/:\s*PresentationSpec\s*=/)) errors.push("Missing PresentationSpec type annotation");
79
- if (!code.includes("meta:")) errors.push("Missing meta section");
80
- if (!code.includes("content:")) errors.push("Missing content section");
81
- if (!code.match(/kind:\s*['"](?:web_component|markdown|data)['"]/)) errors.push("Missing or invalid kind field");
82
- }
83
- function validateWorkflowSpec(code, errors, warnings) {
84
- if (!code.match(/:\s*WorkflowSpec\s*=/)) errors.push("Missing WorkflowSpec type annotation");
85
- if (!code.includes("definition:")) errors.push("Missing definition section");
86
- if (!code.includes("steps:")) errors.push("Workflow must declare steps");
87
- if (!code.includes("transitions:")) warnings.push("No transitions declared; workflow will complete after first step.");
88
- if (!code.match(/title:\s*['"][^'"]+['"]/)) warnings.push("Missing workflow title");
89
- if (!code.match(/domain:\s*['"][^'"]+['"]/)) warnings.push("Missing domain field");
90
- if (code.includes("TODO")) warnings.push("Contains TODO items that need completion");
91
- }
92
- function validateMigrationSpec(code, errors, warnings) {
93
- if (!code.match(/:\s*MigrationSpec\s*=/)) errors.push("Missing MigrationSpec type annotation");
94
- if (!code.includes("plan:")) errors.push("Missing plan section");
95
- else if (!code.includes("up:")) errors.push("Migration must define at least one up step");
96
- if (!code.match(/name:\s*['"][^'"]+['"]/)) errors.push("Missing or invalid migration name");
97
- if (!code.match(/version:\s*\d+/)) errors.push("Missing or invalid migration version");
98
- if (code.includes("TODO")) warnings.push("Contains TODO items that need completion");
99
- }
100
- /**
101
- * Validate common fields across all spec types
102
- */
103
- function validateCommonFields(code, errors, warnings) {
104
- if (code.includes("SchemaModel") && !code.includes("from '@lssm/lib.schema'")) errors.push("Missing import for SchemaModel from @lssm/lib.schema");
105
- if (!code.includes("from '@lssm/lib.contracts'")) errors.push("Missing import from @lssm/lib.contracts");
106
- const ownersMatch = code.match(/owners:\s*\[(.*?)\]/s);
107
- if (ownersMatch?.[1]) {
108
- if (!ownersMatch[1].includes("@")) warnings.push("Owners should start with @ (e.g., \"@team\")");
109
- }
110
- if (!code.match(/stability:\s*['"](?:experimental|beta|stable|deprecated)['"]/)) warnings.push("Missing or invalid stability field");
111
- }
112
- function validateDataViewSpec(code, errors, _warnings) {
113
- if (!code.match(/:\s*DataViewSpec\s*=/)) errors.push("Missing DataViewSpec type annotation");
114
- if (!code.includes("meta:")) errors.push("Missing meta section");
115
- if (!code.includes("source:")) errors.push("Missing source section");
116
- if (!code.includes("view:")) errors.push("Missing view section");
117
- if (!code.match(/kind:\s*['"](list|table|detail|grid)['"]/)) errors.push("Missing or invalid view.kind (list/table/detail/grid)");
118
- if (!code.match(/fields:\s*\[/)) errors.push("No fields defined for data view");
119
- }
120
-
121
- //#endregion
122
- export { validateSpecStructure };
@@ -1,105 +0,0 @@
1
- import { toPascalCase } from "./utils.js";
2
-
3
- //#region ../../modules/contractspec-workspace/dist/templates/app-config.js
4
- function generateAppBlueprintSpec(data) {
5
- const exportName = toPascalCase(data.name.split(".").pop() ?? "App") + "AppConfig";
6
- const capabilitiesSection = buildCapabilitiesSection(data);
7
- const featuresSection = buildFeaturesSection(data);
8
- const dataViewsSection = buildMappingSection("dataViews", data.dataViews);
9
- const workflowsSection = buildMappingSection("workflows", data.workflows);
10
- const policiesSection = buildPolicySection(data);
11
- const themeSection = buildThemeSection(data);
12
- const telemetrySection = buildTelemetrySection(data);
13
- const experimentsSection = buildExperimentsSection(data);
14
- const flagsSection = buildFeatureFlagsSection(data);
15
- const routesSection = buildRoutesSection(data);
16
- const notesSection = data.notes ? ` notes: '${escapeString(data.notes)}',\n` : "";
17
- return `import type { AppBlueprintSpec } from '@lssm/lib.contracts/app-config';
18
-
19
- export const ${exportName}: AppBlueprintSpec = {
20
- meta: {
21
- name: '${escapeString(data.name)}',
22
- version: ${data.version},
23
- title: '${escapeString(data.title)}',
24
- description: '${escapeString(data.description)}',
25
- domain: '${escapeString(data.domain)}',
26
- owners: [${data.owners.map((owner) => `'${escapeString(owner)}'`).join(", ")}],
27
- tags: [${data.tags.map((tag) => `'${escapeString(tag)}'`).join(", ")}],
28
- stability: '${data.stability}',
29
- appId: '${escapeString(data.appId)}',
30
- },
31
- ${capabilitiesSection}${featuresSection}${dataViewsSection}${workflowsSection}${policiesSection}${themeSection}${telemetrySection}${experimentsSection}${flagsSection}${routesSection}${notesSection}};\n`;
32
- }
33
- function buildCapabilitiesSection(data) {
34
- if (data.capabilitiesEnabled.length === 0 && data.capabilitiesDisabled.length === 0) return "";
35
- return ` capabilities: {\n${data.capabilitiesEnabled.length > 0 ? ` enabled: [${data.capabilitiesEnabled.map((key) => formatCapabilityRef(key)).join(", ")}],\n` : ""}${data.capabilitiesDisabled.length > 0 ? ` disabled: [${data.capabilitiesDisabled.map((key) => formatCapabilityRef(key)).join(", ")}],\n` : ""} },\n`;
36
- }
37
- function buildFeaturesSection(data) {
38
- if (data.featureIncludes.length === 0 && data.featureExcludes.length === 0) return "";
39
- return ` features: {\n${data.featureIncludes.length > 0 ? ` include: [${data.featureIncludes.map((key) => `{ key: '${escapeString(key)}' }`).join(", ")}],\n` : ""}${data.featureExcludes.length > 0 ? ` exclude: [${data.featureExcludes.map((key) => `{ key: '${escapeString(key)}' }`).join(", ")}],\n` : ""} },\n`;
40
- }
41
- function buildMappingSection(prop, mappings) {
42
- if (mappings.length === 0) return "";
43
- return ` ${prop}: {\n${mappings.map((mapping) => ` ${mapping.slot}: {
44
- name: '${escapeString(mapping.name)}',
45
- ${typeof mapping.version === "number" ? `version: ${mapping.version},` : ""}
46
- }`).join(",\n")}\n },\n`;
47
- }
48
- function buildPolicySection(data) {
49
- if (data.policyRefs.length === 0) return "";
50
- return ` policies: [\n${data.policyRefs.map((policy) => ` {
51
- name: '${escapeString(policy.name)}'${typeof policy.version === "number" ? `,\n version: ${policy.version}` : ""}
52
- }`).join(",\n")}\n ],\n`;
53
- }
54
- function buildThemeSection(data) {
55
- if (!data.theme) return "";
56
- return ` theme: {\n${` primary: { name: '${escapeString(data.theme.name)}', version: ${data.theme.version} },\n`}${data.themeFallbacks.length > 0 ? ` fallbacks: [${data.themeFallbacks.map((theme) => `{ name: '${escapeString(theme.name)}', version: ${theme.version} }`).join(", ")}],\n` : ""} },\n`;
57
- }
58
- function buildTelemetrySection(data) {
59
- if (!data.telemetry) return "";
60
- return ` telemetry: {
61
- spec: {
62
- name: '${escapeString(data.telemetry.name)}'${typeof data.telemetry.version === "number" ? `,\n version: ${data.telemetry.version}` : ""}
63
- },
64
- },\n`;
65
- }
66
- function buildExperimentsSection(data) {
67
- if (data.activeExperiments.length === 0 && data.pausedExperiments.length === 0) return "";
68
- return ` experiments: {\n${data.activeExperiments.length > 0 ? ` active: [${data.activeExperiments.map((exp) => formatExperimentRef(exp)).join(", ")}],\n` : ""}${data.pausedExperiments.length > 0 ? ` paused: [${data.pausedExperiments.map((exp) => formatExperimentRef(exp)).join(", ")}],\n` : ""} },\n`;
69
- }
70
- function buildFeatureFlagsSection(data) {
71
- if (data.featureFlags.length === 0) return "";
72
- return ` featureFlags: [\n${data.featureFlags.map((flag) => ` {
73
- key: '${escapeString(flag.key)}',
74
- enabled: ${flag.enabled},
75
- ${flag.variant ? `variant: '${escapeString(flag.variant)}',` : ""}
76
- ${flag.description ? `description: '${escapeString(flag.description)}',` : ""}
77
- }`).join(",\n")}\n ],\n`;
78
- }
79
- function buildRoutesSection(data) {
80
- if (data.routes.length === 0) return "";
81
- return ` routes: [\n${data.routes.map((route) => {
82
- return ` { ${[
83
- `path: '${escapeString(route.path)}'`,
84
- route.label ? `label: '${escapeString(route.label)}'` : null,
85
- route.dataView ? `dataView: '${escapeString(route.dataView)}'` : null,
86
- route.workflow ? `workflow: '${escapeString(route.workflow)}'` : null,
87
- route.guardName ? `guard: { name: '${escapeString(route.guardName)}'${typeof route.guardVersion === "number" ? `, version: ${route.guardVersion}` : ""} }` : null,
88
- route.featureFlag ? `featureFlag: '${escapeString(route.featureFlag)}'` : null,
89
- route.experimentName ? `experiment: { name: '${escapeString(route.experimentName)}'${typeof route.experimentVersion === "number" ? `, version: ${route.experimentVersion}` : ""} }` : null
90
- ].filter(Boolean).join(", ")} }`;
91
- }).join(",\n")}\n ],\n`;
92
- }
93
- function formatCapabilityRef(key) {
94
- return `{ key: '${escapeString(key)}' }`;
95
- }
96
- function formatExperimentRef(exp) {
97
- const version = typeof exp.version === "number" ? `, version: ${exp.version}` : "";
98
- return `{ name: '${escapeString(exp.name)}'${version} }`;
99
- }
100
- function escapeString(value) {
101
- return value.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
102
- }
103
-
104
- //#endregion
105
- export { generateAppBlueprintSpec };
@@ -1,68 +0,0 @@
1
- import { escapeString, toPascalCase } from "./utils.js";
2
-
3
- //#region ../../modules/contractspec-workspace/dist/templates/data-view.js
4
- function generateDataViewSpec(data) {
5
- const viewVarName = toPascalCase(data.name.split(".").pop() ?? "DataView") + "DataView";
6
- const fields = data.fields.map((field) => ` {
7
- key: '${escapeString(field.key)}',
8
- label: '${escape(field.label)}',
9
- dataPath: '${escapeString(field.dataPath)}',
10
- ${field.format ? `format: '${escapeString(field.format)}',` : ""}
11
- ${field.sortable ? "sortable: true," : ""}
12
- ${field.filterable ? "filterable: true," : ""}
13
- }`).join(",\n");
14
- const secondaryFields = data.secondaryFields?.length ? `secondaryFields: [${data.secondaryFields.map((key) => `'${escapeString(key)}'`).join(", ")}],` : "";
15
- const itemOperation = data.itemOperation ? `item: { name: '${escapeString(data.itemOperation.name)}', version: ${data.itemOperation.version} },` : "";
16
- return `import type { DataViewSpec } from '@lssm/lib.contracts/data-views';
17
-
18
- export const ${viewVarName}: DataViewSpec = {
19
- meta: {
20
- name: '${escapeString(data.name)}',
21
- version: ${data.version},
22
- entity: '${escapeString(data.entity)}',
23
- title: '${escape(data.title)}',
24
- description: '${escape(data.description || "Describe the purpose of this data view.")}',
25
- domain: '${escape(data.domain || data.entity)}',
26
- owners: [${data.owners.map((owner) => `'${escapeString(owner)}'`).join(", ")}],
27
- tags: [${data.tags.map((tag) => `'${escapeString(tag)}'`).join(", ")}],
28
- stability: '${data.stability}',
29
- },
30
- source: {
31
- primary: {
32
- name: '${escapeString(data.primaryOperation.name)}',
33
- version: ${data.primaryOperation.version},
34
- },
35
- ${itemOperation}
36
- refreshEvents: [
37
- // { name: 'entity.updated', version: 1 },
38
- ],
39
- },
40
- view: {
41
- kind: '${data.kind}',
42
- fields: [
43
- ${fields}
44
- ],
45
- ${data.primaryField ? `primaryField: '${escapeString(data.primaryField)}',` : ""}
46
- ${secondaryFields}
47
- filters: [
48
- // Example filter:
49
- // { key: 'search', label: 'Search', field: 'fullName', type: 'search' },
50
- ],
51
- actions: [
52
- // Example action:
53
- // { key: 'open', label: 'Open', kind: 'navigation' },
54
- ],
55
- },
56
- states: {
57
- // empty: { name: 'app.data.empty', version: 1 },
58
- // error: { name: 'app.data.error', version: 1 },
59
- },
60
- };
61
- `;
62
- }
63
- function escape(value) {
64
- return value.replace(/'/g, "\\'");
65
- }
66
-
67
- //#endregion
68
- export { generateDataViewSpec };
@@ -1,38 +0,0 @@
1
- import { toPascalCase } from "./utils.js";
2
-
3
- //#region ../../modules/contractspec-workspace/dist/templates/event.js
4
- /**
5
- * Generate event spec TypeScript code.
6
- */
7
- function generateEventSpec(data) {
8
- const { name, version, description, stability, owners, tags, piiFields } = data;
9
- const eventVarName = toPascalCase(name.replace(/\./g, "_")) + "V" + version;
10
- const payloadSchemaName = eventVarName + "Payload";
11
- return `import { defineEvent } from '@lssm/lib.contracts';
12
- import { ScalarTypeEnum, SchemaModel } from '@lssm/lib.schema';
13
-
14
- // TODO: Define event payload schema
15
- export const ${payloadSchemaName} = new SchemaModel({
16
- name: '${payloadSchemaName}',
17
- description: 'Payload for ${name}',
18
- fields: {
19
- // Add your payload fields here
20
- // example: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
21
- },
22
- });
23
-
24
- export const ${eventVarName} = defineEvent({
25
- name: '${name}',
26
- version: ${version},
27
- description: '${description}',
28
- stability: '${stability}',
29
- owners: [${owners.map((o) => `'${o}'`).join(", ")}],
30
- tags: [${tags.map((t) => `'${t}'`).join(", ")}],
31
- ${piiFields.length > 0 ? `pii: [${piiFields.map((f) => `'${f}'`).join(", ")}],` : "// pii: [],"}
32
- payload: ${payloadSchemaName},
33
- });
34
- `;
35
- }
36
-
37
- //#endregion
38
- export { generateEventSpec };