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

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 (502) hide show
  1. package/LICENSE +21 -0
  2. package/dist/adapters/ai.d.ts +7 -8
  3. package/dist/adapters/ai.d.ts.map +1 -0
  4. package/dist/adapters/factory.d.ts +20 -21
  5. package/dist/adapters/factory.d.ts.map +1 -0
  6. package/dist/adapters/fs.d.ts +6 -7
  7. package/dist/adapters/fs.d.ts.map +1 -0
  8. package/dist/adapters/git.d.ts +6 -7
  9. package/dist/adapters/git.d.ts.map +1 -0
  10. package/dist/adapters/index.d.ts +11 -0
  11. package/dist/adapters/index.d.ts.map +1 -0
  12. package/dist/adapters/logger.d.ts +9 -8
  13. package/dist/adapters/logger.d.ts.map +1 -0
  14. package/dist/adapters/watcher.d.ts +6 -7
  15. package/dist/adapters/watcher.d.ts.map +1 -0
  16. package/dist/adapters/workspace.d.ts +37 -39
  17. package/dist/adapters/workspace.d.ts.map +1 -0
  18. package/dist/ai/agents/claude-code-agent.d.ts +20 -20
  19. package/dist/ai/agents/claude-code-agent.d.ts.map +1 -0
  20. package/dist/ai/agents/cursor-agent.d.ts +66 -66
  21. package/dist/ai/agents/cursor-agent.d.ts.map +1 -0
  22. package/dist/ai/agents/index.d.ts +10 -0
  23. package/dist/ai/agents/index.d.ts.map +1 -0
  24. package/dist/ai/agents/openai-codex-agent.d.ts +20 -20
  25. package/dist/ai/agents/openai-codex-agent.d.ts.map +1 -0
  26. package/dist/ai/agents/orchestrator.d.ts +48 -48
  27. package/dist/ai/agents/orchestrator.d.ts.map +1 -0
  28. package/dist/ai/agents/simple-agent.d.ts +15 -15
  29. package/dist/ai/agents/simple-agent.d.ts.map +1 -0
  30. package/dist/ai/agents/types.d.ts +26 -28
  31. package/dist/ai/agents/types.d.ts.map +1 -0
  32. package/dist/ai/client.d.ts +74 -78
  33. package/dist/ai/client.d.ts.map +1 -0
  34. package/dist/ai/index.d.ts +8 -16
  35. package/dist/ai/index.d.ts.map +1 -0
  36. package/dist/ai/prompts/code-generation.d.ts +6 -10
  37. package/dist/ai/prompts/code-generation.d.ts.map +1 -0
  38. package/dist/ai/prompts/index.d.ts +6 -9
  39. package/dist/ai/prompts/index.d.ts.map +1 -0
  40. package/dist/ai/prompts/spec-creation.d.ts +7 -13
  41. package/dist/ai/prompts/spec-creation.d.ts.map +1 -0
  42. package/dist/ai/providers.d.ts +13 -12
  43. package/dist/ai/providers.d.ts.map +1 -0
  44. package/dist/formatters/index.d.ts +7 -10
  45. package/dist/formatters/index.d.ts.map +1 -0
  46. package/dist/formatters/json.d.ts +65 -63
  47. package/dist/formatters/json.d.ts.map +1 -0
  48. package/dist/formatters/sarif.d.ts +77 -72
  49. package/dist/formatters/sarif.d.ts.map +1 -0
  50. package/dist/formatters/text.d.ts +21 -19
  51. package/dist/formatters/text.d.ts.map +1 -0
  52. package/dist/index.d.ts +14 -66
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +4531 -81
  55. package/dist/ports/ai.d.ts +41 -38
  56. package/dist/ports/ai.d.ts.map +1 -0
  57. package/dist/ports/fs.d.ts +63 -65
  58. package/dist/ports/fs.d.ts.map +1 -0
  59. package/dist/ports/git.d.ts +19 -21
  60. package/dist/ports/git.d.ts.map +1 -0
  61. package/dist/ports/index.d.ts +10 -0
  62. package/dist/ports/index.d.ts.map +1 -0
  63. package/dist/ports/logger.d.ts +58 -65
  64. package/dist/ports/logger.d.ts.map +1 -0
  65. package/dist/ports/watcher.d.ts +24 -26
  66. package/dist/ports/watcher.d.ts.map +1 -0
  67. package/dist/services/agent-guide/adapters/claude-code.d.ts +30 -28
  68. package/dist/services/agent-guide/adapters/claude-code.d.ts.map +1 -0
  69. package/dist/services/agent-guide/adapters/cursor-cli.d.ts +34 -32
  70. package/dist/services/agent-guide/adapters/cursor-cli.d.ts.map +1 -0
  71. package/dist/services/agent-guide/adapters/generic-mcp.d.ts +47 -45
  72. package/dist/services/agent-guide/adapters/generic-mcp.d.ts.map +1 -0
  73. package/dist/services/agent-guide/adapters/index.d.ts +15 -13
  74. package/dist/services/agent-guide/adapters/index.d.ts.map +1 -0
  75. package/dist/services/agent-guide/agent-guide-service.d.ts +48 -45
  76. package/dist/services/agent-guide/agent-guide-service.d.ts.map +1 -0
  77. package/dist/services/agent-guide/index.d.ts +12 -0
  78. package/dist/services/agent-guide/index.d.ts.map +1 -0
  79. package/dist/services/agent-guide/types.d.ts +46 -47
  80. package/dist/services/agent-guide/types.d.ts.map +1 -0
  81. package/dist/services/build.d.ts +41 -39
  82. package/dist/services/build.d.ts.map +1 -0
  83. package/dist/services/ci-check/ci-check-service.d.ts +13 -11
  84. package/dist/services/ci-check/ci-check-service.d.ts.map +1 -0
  85. package/dist/services/ci-check/index.d.ts +6 -0
  86. package/dist/services/ci-check/index.d.ts.map +1 -0
  87. package/dist/services/ci-check/types.d.ts +100 -102
  88. package/dist/services/ci-check/types.d.ts.map +1 -0
  89. package/dist/services/clean.d.ts +38 -37
  90. package/dist/services/clean.d.ts.map +1 -0
  91. package/dist/services/config.d.ts +14 -15
  92. package/dist/services/config.d.ts.map +1 -0
  93. package/dist/services/deps.d.ts +29 -30
  94. package/dist/services/deps.d.ts.map +1 -0
  95. package/dist/services/diff.d.ts +20 -21
  96. package/dist/services/diff.d.ts.map +1 -0
  97. package/dist/services/doctor/checks/ai.d.ts +10 -0
  98. package/dist/services/doctor/checks/ai.d.ts.map +1 -0
  99. package/dist/services/doctor/checks/cli.d.ts +10 -0
  100. package/dist/services/doctor/checks/cli.d.ts.map +1 -0
  101. package/dist/services/doctor/checks/config.d.ts +10 -0
  102. package/dist/services/doctor/checks/config.d.ts.map +1 -0
  103. package/dist/services/doctor/checks/deps.d.ts +10 -0
  104. package/dist/services/doctor/checks/deps.d.ts.map +1 -0
  105. package/dist/services/doctor/checks/index.d.ts +10 -0
  106. package/dist/services/doctor/checks/index.d.ts.map +1 -0
  107. package/dist/services/doctor/checks/mcp.d.ts +10 -0
  108. package/dist/services/doctor/checks/mcp.d.ts.map +1 -0
  109. package/dist/services/doctor/checks/workspace.d.ts +12 -0
  110. package/dist/services/doctor/checks/workspace.d.ts.map +1 -0
  111. package/dist/services/doctor/doctor-service.d.ts +14 -13
  112. package/dist/services/doctor/doctor-service.d.ts.map +1 -0
  113. package/dist/services/doctor/index.d.ts +8 -0
  114. package/dist/services/doctor/index.d.ts.map +1 -0
  115. package/dist/services/doctor/types.d.ts +70 -72
  116. package/dist/services/doctor/types.d.ts.map +1 -0
  117. package/dist/services/implementation/discovery.d.ts +16 -14
  118. package/dist/services/implementation/discovery.d.ts.map +1 -0
  119. package/dist/services/implementation/index.d.ts +7 -0
  120. package/dist/services/implementation/index.d.ts.map +1 -0
  121. package/dist/services/implementation/resolver.d.ts +31 -27
  122. package/dist/services/implementation/resolver.d.ts.map +1 -0
  123. package/dist/services/implementation/types.d.ts +55 -56
  124. package/dist/services/implementation/types.d.ts.map +1 -0
  125. package/dist/services/index.d.ts +28 -0
  126. package/dist/services/index.d.ts.map +1 -0
  127. package/dist/services/integrity-diagram.d.ts +29 -25
  128. package/dist/services/integrity-diagram.d.ts.map +1 -0
  129. package/dist/services/integrity.d.ts +100 -96
  130. package/dist/services/integrity.d.ts.map +1 -0
  131. package/dist/services/list.d.ts +18 -19
  132. package/dist/services/list.d.ts.map +1 -0
  133. package/dist/services/openapi/export-service.d.ts +39 -40
  134. package/dist/services/openapi/export-service.d.ts.map +1 -0
  135. package/dist/services/openapi/import-service.d.ts +10 -11
  136. package/dist/services/openapi/import-service.d.ts.map +1 -0
  137. package/dist/services/openapi/index.d.ts +10 -0
  138. package/dist/services/openapi/index.d.ts.map +1 -0
  139. package/dist/services/openapi/sync-service.d.ts +12 -13
  140. package/dist/services/openapi/sync-service.d.ts.map +1 -0
  141. package/dist/services/openapi/types.d.ts +141 -143
  142. package/dist/services/openapi/types.d.ts.map +1 -0
  143. package/dist/services/openapi/validate-service.d.ts +10 -11
  144. package/dist/services/openapi/validate-service.d.ts.map +1 -0
  145. package/dist/services/regenerator.d.ts +18 -16
  146. package/dist/services/regenerator.d.ts.map +1 -0
  147. package/dist/services/registry.d.ts +25 -26
  148. package/dist/services/registry.d.ts.map +1 -0
  149. package/dist/services/setup/config-generators.d.ts +14 -13
  150. package/dist/services/setup/config-generators.d.ts.map +1 -0
  151. package/dist/services/setup/file-merger.d.ts +5 -7
  152. package/dist/services/setup/file-merger.d.ts.map +1 -0
  153. package/dist/services/setup/index.d.ts +10 -0
  154. package/dist/services/setup/index.d.ts.map +1 -0
  155. package/dist/services/setup/setup-service.d.ts +10 -8
  156. package/dist/services/setup/setup-service.d.ts.map +1 -0
  157. package/dist/services/setup/targets/agents-md.d.ts +12 -0
  158. package/dist/services/setup/targets/agents-md.d.ts.map +1 -0
  159. package/dist/services/setup/targets/cli-config.d.ts +12 -0
  160. package/dist/services/setup/targets/cli-config.d.ts.map +1 -0
  161. package/dist/services/setup/targets/cursor-rules.d.ts +10 -0
  162. package/dist/services/setup/targets/cursor-rules.d.ts.map +1 -0
  163. package/dist/services/setup/targets/index.d.ts +10 -0
  164. package/dist/services/setup/targets/index.d.ts.map +1 -0
  165. package/dist/services/setup/targets/mcp-claude.d.ts +11 -0
  166. package/dist/services/setup/targets/mcp-claude.d.ts.map +1 -0
  167. package/dist/services/setup/targets/mcp-cursor.d.ts +10 -0
  168. package/dist/services/setup/targets/mcp-cursor.d.ts.map +1 -0
  169. package/dist/services/setup/targets/vscode-settings.d.ts +13 -0
  170. package/dist/services/setup/targets/vscode-settings.d.ts.map +1 -0
  171. package/dist/services/setup/types.d.ts +51 -53
  172. package/dist/services/setup/types.d.ts.map +1 -0
  173. package/dist/services/sync.d.ts +37 -35
  174. package/dist/services/sync.d.ts.map +1 -0
  175. package/dist/services/test.d.ts +15 -13
  176. package/dist/services/test.d.ts.map +1 -0
  177. package/dist/services/validate-implementation.d.ts +30 -28
  178. package/dist/services/validate-implementation.d.ts.map +1 -0
  179. package/dist/services/validate.d.ts +23 -24
  180. package/dist/services/validate.d.ts.map +1 -0
  181. package/dist/services/verification-cache/adapters/filesystem.d.ts +40 -38
  182. package/dist/services/verification-cache/adapters/filesystem.d.ts.map +1 -0
  183. package/dist/services/verification-cache/adapters/in-memory.d.ts +21 -19
  184. package/dist/services/verification-cache/adapters/in-memory.d.ts.map +1 -0
  185. package/dist/services/verification-cache/adapters/index.d.ts +7 -0
  186. package/dist/services/verification-cache/adapters/index.d.ts.map +1 -0
  187. package/dist/services/verification-cache/adapters/workspace-state.d.ts +39 -37
  188. package/dist/services/verification-cache/adapters/workspace-state.d.ts.map +1 -0
  189. package/dist/services/verification-cache/cache-service.d.ts +55 -53
  190. package/dist/services/verification-cache/cache-service.d.ts.map +1 -0
  191. package/dist/services/verification-cache/index.d.ts +7 -0
  192. package/dist/services/verification-cache/index.d.ts.map +1 -0
  193. package/dist/services/verification-cache/types.d.ts +84 -85
  194. package/dist/services/verification-cache/types.d.ts.map +1 -0
  195. package/dist/services/verify/ai-verifier.d.ts +13 -11
  196. package/dist/services/verify/ai-verifier.d.ts.map +1 -0
  197. package/dist/services/verify/behavior-verifier.d.ts +10 -8
  198. package/dist/services/verify/behavior-verifier.d.ts.map +1 -0
  199. package/dist/services/verify/index.d.ts +18 -0
  200. package/dist/services/verify/index.d.ts.map +1 -0
  201. package/dist/services/verify/structure-verifier.d.ts +12 -8
  202. package/dist/services/verify/structure-verifier.d.ts.map +1 -0
  203. package/dist/services/verify/types.d.ts +114 -115
  204. package/dist/services/verify/types.d.ts.map +1 -0
  205. package/dist/services/verify/verify-service.d.ts +51 -49
  206. package/dist/services/verify/verify-service.d.ts.map +1 -0
  207. package/dist/services/watch.d.ts +22 -21
  208. package/dist/services/watch.d.ts.map +1 -0
  209. package/dist/services/workspace-info.d.ts +40 -37
  210. package/dist/services/workspace-info.d.ts.map +1 -0
  211. package/dist/templates/app-config.template.d.ts +3 -6
  212. package/dist/templates/app-config.template.d.ts.map +1 -0
  213. package/dist/templates/data-view.template.d.ts +3 -6
  214. package/dist/templates/data-view.template.d.ts.map +1 -0
  215. package/dist/templates/event.template.d.ts +3 -7
  216. package/dist/templates/event.template.d.ts.map +1 -0
  217. package/dist/templates/experiment.template.d.ts +3 -6
  218. package/dist/templates/experiment.template.d.ts.map +1 -0
  219. package/dist/templates/handler.template.d.ts +4 -6
  220. package/dist/templates/handler.template.d.ts.map +1 -0
  221. package/dist/templates/index.d.ts +17 -20
  222. package/dist/templates/index.d.ts.map +1 -0
  223. package/dist/templates/integration.template.d.ts +3 -6
  224. package/dist/templates/integration.template.d.ts.map +1 -0
  225. package/dist/templates/knowledge.template.d.ts +3 -6
  226. package/dist/templates/knowledge.template.d.ts.map +1 -0
  227. package/dist/templates/migration.template.d.ts +3 -6
  228. package/dist/templates/migration.template.d.ts.map +1 -0
  229. package/dist/templates/operation.template.d.ts +3 -7
  230. package/dist/templates/operation.template.d.ts.map +1 -0
  231. package/dist/templates/operation.template.test.d.ts +2 -0
  232. package/dist/templates/operation.template.test.d.ts.map +1 -0
  233. package/dist/templates/presentation.template.d.ts +3 -7
  234. package/dist/templates/presentation.template.d.ts.map +1 -0
  235. package/dist/templates/telemetry.template.d.ts +3 -6
  236. package/dist/templates/telemetry.template.d.ts.map +1 -0
  237. package/dist/templates/workflow-runner.template.d.ts +7 -13
  238. package/dist/templates/workflow-runner.template.d.ts.map +1 -0
  239. package/dist/templates/workflow.template.d.ts +3 -6
  240. package/dist/templates/workflow.template.d.ts.map +1 -0
  241. package/dist/types/config.d.ts +18 -20
  242. package/dist/types/config.d.ts.map +1 -0
  243. package/dist/types/index.d.ts +5 -0
  244. package/dist/types/index.d.ts.map +1 -0
  245. package/dist/types.d.ts +338 -311
  246. package/dist/types.d.ts.map +1 -0
  247. package/package.json +16 -15
  248. package/dist/_virtual/rolldown_runtime.js +0 -22
  249. package/dist/adapters/ai.js +0 -82
  250. package/dist/adapters/factory.js +0 -36
  251. package/dist/adapters/fs.js +0 -118
  252. package/dist/adapters/git.js +0 -54
  253. package/dist/adapters/index.js +0 -7
  254. package/dist/adapters/logger.js +0 -80
  255. package/dist/adapters/watcher.js +0 -69
  256. package/dist/adapters/workspace.js +0 -190
  257. package/dist/ai/agents/claude-code-agent.js +0 -181
  258. package/dist/ai/agents/cursor-agent.js +0 -437
  259. package/dist/ai/agents/index.js +0 -5
  260. package/dist/ai/agents/openai-codex-agent.js +0 -166
  261. package/dist/ai/agents/orchestrator.js +0 -142
  262. package/dist/ai/agents/simple-agent.js +0 -91
  263. package/dist/ai/client.js +0 -162
  264. package/dist/ai/index.js +0 -27
  265. package/dist/ai/prompts/code-generation.js +0 -142
  266. package/dist/ai/prompts/index.js +0 -12
  267. package/dist/ai/prompts/spec-creation.js +0 -110
  268. package/dist/ai/providers.js +0 -40
  269. package/dist/formatters/index.js +0 -18
  270. package/dist/formatters/json.js +0 -71
  271. package/dist/formatters/sarif.js +0 -163
  272. package/dist/formatters/text.js +0 -208
  273. package/dist/libs/ai-providers/dist/factory.js +0 -154
  274. package/dist/libs/ai-providers/dist/index.js +0 -4
  275. package/dist/libs/ai-providers/dist/legacy.js +0 -72
  276. package/dist/libs/ai-providers/dist/models.js +0 -287
  277. package/dist/libs/ai-providers/dist/validation.js +0 -1
  278. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
  279. package/dist/libs/contracts/dist/client/index.js +0 -5
  280. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
  281. package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
  282. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  283. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  284. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
  285. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  286. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  287. package/dist/libs/contracts/dist/docs/index.js +0 -29
  288. package/dist/libs/contracts/dist/docs/presentations.js +0 -71
  289. package/dist/libs/contracts/dist/docs/registry.js +0 -44
  290. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  291. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  292. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  293. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  294. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  295. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  296. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  297. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  298. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  299. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  300. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  301. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  302. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  303. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  304. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  305. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  306. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  307. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  308. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  309. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  310. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  311. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  312. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  313. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  314. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  315. package/dist/libs/contracts/dist/events.js +0 -8
  316. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  317. package/dist/libs/contracts/dist/index.js +0 -72
  318. package/dist/libs/contracts/dist/install.js +0 -2
  319. package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
  320. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  321. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  322. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  323. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  324. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  325. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
  326. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  327. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  328. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  329. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
  330. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
  331. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  332. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
  333. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
  334. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
  335. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
  336. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  337. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
  338. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  339. package/dist/libs/contracts/dist/jsonschema.js +0 -24
  340. package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
  341. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  342. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  343. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  344. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  345. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  346. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  347. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  348. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  349. package/dist/libs/contracts/dist/llm/exporters.js +0 -352
  350. package/dist/libs/contracts/dist/llm/index.js +0 -2
  351. package/dist/libs/contracts/dist/llm/prompts.js +0 -211
  352. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  353. package/dist/libs/contracts/dist/openapi.js +0 -75
  354. package/dist/libs/contracts/dist/ownership.js +0 -21
  355. package/dist/libs/contracts/dist/presentations.js +0 -1
  356. package/dist/libs/contracts/dist/presentations.v2.js +0 -11
  357. package/dist/libs/contracts/dist/prompt.js +0 -1
  358. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  359. package/dist/libs/contracts/dist/regenerator/index.js +0 -2
  360. package/dist/libs/contracts/dist/regenerator/service.js +0 -92
  361. package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
  362. package/dist/libs/contracts/dist/registry.js +0 -208
  363. package/dist/libs/contracts/dist/resources.js +0 -1
  364. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  365. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  366. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  367. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
  368. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  369. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  370. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  371. package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
  372. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  373. package/dist/libs/contracts/dist/server/index.js +0 -8
  374. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  375. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
  376. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  377. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  378. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  379. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  380. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  381. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  382. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  383. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  384. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  385. package/dist/libs/contracts/dist/spec.js +0 -35
  386. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  387. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  388. package/dist/libs/contracts/dist/tests/index.js +0 -1
  389. package/dist/libs/contracts/dist/tests/runner.js +0 -150
  390. package/dist/libs/contracts/dist/workflow/index.js +0 -1
  391. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  392. package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
  393. package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
  394. package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
  395. package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
  396. package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
  397. package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
  398. package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
  399. package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
  400. package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
  401. package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
  402. package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
  403. package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
  404. package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
  405. package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
  406. package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
  407. package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
  408. package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
  409. package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
  410. package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
  411. package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
  412. package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
  413. package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
  414. package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
  415. package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
  416. package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
  417. package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
  418. package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
  419. package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
  420. package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
  421. package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
  422. package/dist/services/agent-guide/adapters/claude-code.js +0 -144
  423. package/dist/services/agent-guide/adapters/cursor-cli.js +0 -135
  424. package/dist/services/agent-guide/adapters/generic-mcp.js +0 -159
  425. package/dist/services/agent-guide/adapters/index.js +0 -30
  426. package/dist/services/agent-guide/agent-guide-service.js +0 -148
  427. package/dist/services/agent-guide/index.js +0 -5
  428. package/dist/services/build.js +0 -140
  429. package/dist/services/ci-check/ci-check-service.js +0 -393
  430. package/dist/services/ci-check/index.js +0 -2
  431. package/dist/services/ci-check/types.js +0 -28
  432. package/dist/services/clean.js +0 -71
  433. package/dist/services/config.js +0 -76
  434. package/dist/services/deps.js +0 -62
  435. package/dist/services/diff.js +0 -33
  436. package/dist/services/doctor/checks/ai.js +0 -118
  437. package/dist/services/doctor/checks/cli.js +0 -146
  438. package/dist/services/doctor/checks/config.js +0 -170
  439. package/dist/services/doctor/checks/deps.js +0 -180
  440. package/dist/services/doctor/checks/index.js +0 -6
  441. package/dist/services/doctor/checks/mcp.js +0 -144
  442. package/dist/services/doctor/checks/workspace.js +0 -243
  443. package/dist/services/doctor/doctor-service.js +0 -115
  444. package/dist/services/doctor/index.js +0 -2
  445. package/dist/services/doctor/types.js +0 -26
  446. package/dist/services/implementation/discovery.js +0 -143
  447. package/dist/services/implementation/index.js +0 -2
  448. package/dist/services/implementation/resolver.js +0 -223
  449. package/dist/services/index.js +0 -53
  450. package/dist/services/integrity-diagram.js +0 -274
  451. package/dist/services/integrity.js +0 -272
  452. package/dist/services/list.js +0 -35
  453. package/dist/services/openapi/export-service.js +0 -51
  454. package/dist/services/openapi/import-service.js +0 -75
  455. package/dist/services/openapi/index.js +0 -4
  456. package/dist/services/openapi/sync-service.js +0 -121
  457. package/dist/services/openapi/validate-service.js +0 -130
  458. package/dist/services/regenerator.js +0 -23
  459. package/dist/services/registry.js +0 -73
  460. package/dist/services/setup/config-generators.js +0 -237
  461. package/dist/services/setup/file-merger.js +0 -60
  462. package/dist/services/setup/index.js +0 -4
  463. package/dist/services/setup/setup-service.js +0 -95
  464. package/dist/services/setup/targets/agents-md.js +0 -46
  465. package/dist/services/setup/targets/cli-config.js +0 -59
  466. package/dist/services/setup/targets/cursor-rules.js +0 -47
  467. package/dist/services/setup/targets/mcp-claude.js +0 -59
  468. package/dist/services/setup/targets/mcp-cursor.js +0 -58
  469. package/dist/services/setup/targets/vscode-settings.js +0 -62
  470. package/dist/services/setup/types.js +0 -26
  471. package/dist/services/sync.js +0 -62
  472. package/dist/services/test.js +0 -30
  473. package/dist/services/validate-implementation.js +0 -69
  474. package/dist/services/validate.js +0 -47
  475. package/dist/services/verification-cache/adapters/filesystem.js +0 -121
  476. package/dist/services/verification-cache/adapters/in-memory.js +0 -45
  477. package/dist/services/verification-cache/adapters/index.js +0 -3
  478. package/dist/services/verification-cache/adapters/workspace-state.js +0 -90
  479. package/dist/services/verification-cache/cache-service.js +0 -255
  480. package/dist/services/verification-cache/index.js +0 -6
  481. package/dist/services/verification-cache/types.js +0 -15
  482. package/dist/services/verify/ai-verifier.js +0 -403
  483. package/dist/services/verify/behavior-verifier.js +0 -185
  484. package/dist/services/verify/index.js +0 -4
  485. package/dist/services/verify/structure-verifier.js +0 -195
  486. package/dist/services/verify/verify-service.js +0 -203
  487. package/dist/services/watch.js +0 -31
  488. package/dist/services/workspace-info.js +0 -102
  489. package/dist/templates/app-config.template.js +0 -106
  490. package/dist/templates/data-view.template.js +0 -69
  491. package/dist/templates/event.template.js +0 -39
  492. package/dist/templates/experiment.template.js +0 -88
  493. package/dist/templates/handler.template.js +0 -99
  494. package/dist/templates/index.js +0 -36
  495. package/dist/templates/integration.template.js +0 -159
  496. package/dist/templates/knowledge.template.js +0 -74
  497. package/dist/templates/migration.template.js +0 -61
  498. package/dist/templates/operation.template.js +0 -104
  499. package/dist/templates/presentation.template.js +0 -79
  500. package/dist/templates/telemetry.template.js +0 -90
  501. package/dist/templates/workflow-runner.template.js +0 -49
  502. package/dist/templates/workflow.template.js +0 -68
@@ -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 };