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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/dist/_virtual/rolldown_runtime.js +1 -22
  2. package/dist/adapters/ai.js +1 -82
  3. package/dist/adapters/factory.js +1 -36
  4. package/dist/adapters/fs.js +1 -118
  5. package/dist/adapters/git.js +1 -54
  6. package/dist/adapters/index.js +1 -7
  7. package/dist/adapters/logger.js +1 -80
  8. package/dist/adapters/watcher.js +1 -69
  9. package/dist/adapters/workspace.js +2 -190
  10. package/dist/ai/agents/claude-code-agent.js +9 -146
  11. package/dist/ai/agents/cursor-agent.js +17 -286
  12. package/dist/ai/agents/index.js +1 -5
  13. package/dist/ai/agents/openai-codex-agent.js +8 -140
  14. package/dist/ai/agents/orchestrator.js +1 -142
  15. package/dist/ai/agents/simple-agent.js +4 -80
  16. package/dist/ai/client.js +1 -162
  17. package/dist/ai/index.js +1 -27
  18. package/dist/ai/prompts/code-generation.js +13 -55
  19. package/dist/ai/prompts/index.js +1 -12
  20. package/dist/ai/prompts/spec-creation.js +20 -61
  21. package/dist/ai/providers.js +1 -40
  22. package/dist/formatters/index.js +1 -18
  23. package/dist/formatters/json.js +1 -71
  24. package/dist/formatters/sarif.js +1 -163
  25. package/dist/formatters/text.js +2 -208
  26. package/dist/index.js +1 -81
  27. package/dist/node_modules/@ai-sdk/anthropic/dist/index.js +1 -0
  28. package/dist/node_modules/@ai-sdk/openai/dist/index.js +11 -0
  29. package/dist/node_modules/@ai-sdk/provider/dist/index.js +3 -0
  30. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +5 -0
  31. package/dist/node_modules/chalk/source/index.js +2 -0
  32. package/dist/node_modules/chalk/source/utilities.js +4 -0
  33. package/dist/node_modules/chalk/source/vendor/ansi-styles/index.js +1 -0
  34. package/dist/node_modules/chalk/source/vendor/supports-color/browser.js +1 -0
  35. package/dist/node_modules/cli-cursor/index.js +1 -0
  36. package/dist/node_modules/cli-spinners/index.js +1 -0
  37. package/dist/node_modules/cli-spinners/spinners.js +1 -0
  38. package/dist/node_modules/eventsource-parser/dist/index.js +5 -0
  39. package/dist/node_modules/eventsource-parser/dist/stream.js +1 -0
  40. package/dist/node_modules/get-east-asian-width/index.js +1 -0
  41. package/dist/node_modules/get-east-asian-width/lookup.js +1 -0
  42. package/dist/node_modules/is-interactive/index.js +1 -0
  43. package/dist/node_modules/is-unicode-supported/index.js +1 -0
  44. package/dist/node_modules/log-symbols/browser-symbols.js +1 -0
  45. package/dist/node_modules/mimic-function/index.js +1 -0
  46. package/dist/node_modules/onetime/index.js +1 -0
  47. package/dist/node_modules/ora/index.js +6 -0
  48. package/dist/node_modules/restore-cursor/index.js +1 -0
  49. package/dist/node_modules/signal-exit/dist/mjs/index.js +1 -0
  50. package/dist/node_modules/signal-exit/dist/mjs/signals.js +1 -0
  51. package/dist/node_modules/stdin-discarder/index.js +1 -0
  52. package/dist/node_modules/string-width/index.js +1 -0
  53. package/dist/node_modules/strip-ansi/index.js +1 -0
  54. package/dist/node_modules/strip-ansi/node_modules/ansi-regex/index.js +1 -0
  55. package/dist/services/agent-guide/adapters/claude-code.js +3 -144
  56. package/dist/services/agent-guide/adapters/cursor-cli.js +3 -135
  57. package/dist/services/agent-guide/adapters/generic-mcp.js +3 -159
  58. package/dist/services/agent-guide/adapters/index.js +1 -30
  59. package/dist/services/agent-guide/agent-guide-service.js +1 -148
  60. package/dist/services/agent-guide/index.js +1 -5
  61. package/dist/services/build.js +1 -140
  62. package/dist/services/ci-check/ci-check-service.js +1 -393
  63. package/dist/services/ci-check/index.js +1 -2
  64. package/dist/services/ci-check/types.js +1 -28
  65. package/dist/services/clean.js +1 -71
  66. package/dist/services/config.js +1 -76
  67. package/dist/services/deps.js +1 -62
  68. package/dist/services/diff.js +1 -33
  69. package/dist/services/doctor/checks/ai.js +2 -118
  70. package/dist/services/doctor/checks/cli.js +1 -146
  71. package/dist/services/doctor/checks/config.js +1 -170
  72. package/dist/services/doctor/checks/deps.js +1 -180
  73. package/dist/services/doctor/checks/index.js +1 -6
  74. package/dist/services/doctor/checks/mcp.js +1 -144
  75. package/dist/services/doctor/checks/workspace.js +1 -243
  76. package/dist/services/doctor/doctor-service.js +2 -115
  77. package/dist/services/doctor/index.js +1 -2
  78. package/dist/services/doctor/types.js +1 -26
  79. package/dist/services/implementation/discovery.js +2 -143
  80. package/dist/services/implementation/index.js +1 -2
  81. package/dist/services/implementation/resolver.js +1 -223
  82. package/dist/services/index.js +1 -53
  83. package/dist/services/integrity-diagram.js +6 -274
  84. package/dist/services/integrity.js +1 -272
  85. package/dist/services/list.js +1 -35
  86. package/dist/services/openapi/export-service.js +2 -51
  87. package/dist/services/openapi/import-service.js +1 -75
  88. package/dist/services/openapi/index.js +1 -4
  89. package/dist/services/openapi/sync-service.js +1 -121
  90. package/dist/services/openapi/validate-service.js +1 -130
  91. package/dist/services/regenerator.js +1 -23
  92. package/dist/services/registry.js +1 -73
  93. package/dist/services/setup/config-generators.js +26 -113
  94. package/dist/services/setup/file-merger.js +2 -60
  95. package/dist/services/setup/index.js +1 -4
  96. package/dist/services/setup/setup-service.js +1 -95
  97. package/dist/services/setup/targets/agents-md.js +1 -46
  98. package/dist/services/setup/targets/cli-config.js +1 -59
  99. package/dist/services/setup/targets/cursor-rules.js +1 -47
  100. package/dist/services/setup/targets/mcp-claude.js +1 -59
  101. package/dist/services/setup/targets/mcp-cursor.js +1 -58
  102. package/dist/services/setup/targets/vscode-settings.js +1 -62
  103. package/dist/services/setup/types.js +1 -26
  104. package/dist/services/sync.js +1 -62
  105. package/dist/services/test.js +1 -30
  106. package/dist/services/validate-implementation.js +1 -69
  107. package/dist/services/validate.js +1 -47
  108. package/dist/services/verification-cache/adapters/filesystem.js +1 -121
  109. package/dist/services/verification-cache/adapters/in-memory.js +1 -45
  110. package/dist/services/verification-cache/adapters/index.js +1 -3
  111. package/dist/services/verification-cache/adapters/workspace-state.js +1 -90
  112. package/dist/services/verification-cache/cache-service.js +1 -255
  113. package/dist/services/verification-cache/index.js +1 -6
  114. package/dist/services/verification-cache/types.js +1 -15
  115. package/dist/services/verify/ai-verifier.js +9 -336
  116. package/dist/services/verify/behavior-verifier.js +1 -185
  117. package/dist/services/verify/index.js +1 -4
  118. package/dist/services/verify/structure-verifier.js +2 -195
  119. package/dist/services/verify/verify-service.js +3 -203
  120. package/dist/services/watch.js +1 -31
  121. package/dist/services/workspace-info.js +2 -102
  122. package/dist/templates/app-config.template.js +28 -101
  123. package/dist/templates/data-view.template.js +27 -42
  124. package/dist/templates/event.template.js +14 -29
  125. package/dist/templates/experiment.template.js +51 -77
  126. package/dist/templates/handler.template.js +17 -53
  127. package/dist/templates/index.js +1 -36
  128. package/dist/templates/integration.template.js +50 -134
  129. package/dist/templates/knowledge.template.js +21 -62
  130. package/dist/templates/migration.template.js +26 -50
  131. package/dist/templates/operation.template.js +28 -44
  132. package/dist/templates/presentation.template.js +20 -46
  133. package/dist/templates/telemetry.template.js +53 -74
  134. package/dist/templates/workflow-runner.template.js +6 -12
  135. package/dist/templates/workflow.template.js +24 -51
  136. package/package.json +10 -16
  137. package/dist/adapters/ai.d.ts +0 -11
  138. package/dist/adapters/factory.d.ts +0 -28
  139. package/dist/adapters/fs.d.ts +0 -10
  140. package/dist/adapters/git.d.ts +0 -10
  141. package/dist/adapters/logger.d.ts +0 -17
  142. package/dist/adapters/watcher.d.ts +0 -10
  143. package/dist/adapters/workspace.d.ts +0 -93
  144. package/dist/ai/agents/claude-code-agent.d.ts +0 -21
  145. package/dist/ai/agents/cursor-agent.d.ts +0 -67
  146. package/dist/ai/agents/openai-codex-agent.d.ts +0 -21
  147. package/dist/ai/agents/orchestrator.d.ts +0 -49
  148. package/dist/ai/agents/simple-agent.d.ts +0 -16
  149. package/dist/ai/agents/types.d.ts +0 -35
  150. package/dist/ai/client.d.ts +0 -82
  151. package/dist/ai/index.d.ts +0 -16
  152. package/dist/ai/prompts/code-generation.d.ts +0 -25
  153. package/dist/ai/prompts/index.d.ts +0 -9
  154. package/dist/ai/prompts/spec-creation.d.ts +0 -28
  155. package/dist/ai/providers.d.ts +0 -28
  156. package/dist/formatters/index.d.ts +0 -10
  157. package/dist/formatters/json.d.ts +0 -88
  158. package/dist/formatters/sarif.d.ts +0 -100
  159. package/dist/formatters/text.d.ts +0 -34
  160. package/dist/index.d.ts +0 -66
  161. package/dist/libs/ai-providers/dist/factory.js +0 -154
  162. package/dist/libs/ai-providers/dist/index.js +0 -4
  163. package/dist/libs/ai-providers/dist/legacy.js +0 -72
  164. package/dist/libs/ai-providers/dist/models.js +0 -287
  165. package/dist/libs/ai-providers/dist/validation.js +0 -1
  166. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
  167. package/dist/libs/contracts/dist/client/index.js +0 -5
  168. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
  169. package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
  170. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  171. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  172. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
  173. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  174. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  175. package/dist/libs/contracts/dist/docs/index.js +0 -29
  176. package/dist/libs/contracts/dist/docs/presentations.js +0 -71
  177. package/dist/libs/contracts/dist/docs/registry.js +0 -44
  178. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  179. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  180. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  181. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  182. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  183. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  184. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  185. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  186. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  187. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  188. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  189. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  190. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  191. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  192. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  193. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  194. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  195. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  196. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  197. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  198. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  199. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  200. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  201. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  202. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  203. package/dist/libs/contracts/dist/events.js +0 -8
  204. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  205. package/dist/libs/contracts/dist/index.js +0 -72
  206. package/dist/libs/contracts/dist/install.js +0 -2
  207. package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
  208. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  209. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  210. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  211. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  212. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  213. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
  214. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  215. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  216. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  217. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
  218. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
  219. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  220. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
  221. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
  222. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
  223. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
  224. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  225. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
  226. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  227. package/dist/libs/contracts/dist/jsonschema.js +0 -24
  228. package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
  229. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  230. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  231. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  232. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  233. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  234. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  235. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  236. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  237. package/dist/libs/contracts/dist/llm/exporters.js +0 -352
  238. package/dist/libs/contracts/dist/llm/index.js +0 -2
  239. package/dist/libs/contracts/dist/llm/prompts.js +0 -211
  240. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  241. package/dist/libs/contracts/dist/openapi.js +0 -75
  242. package/dist/libs/contracts/dist/ownership.js +0 -21
  243. package/dist/libs/contracts/dist/presentations.js +0 -1
  244. package/dist/libs/contracts/dist/presentations.v2.js +0 -11
  245. package/dist/libs/contracts/dist/prompt.js +0 -1
  246. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  247. package/dist/libs/contracts/dist/regenerator/index.js +0 -2
  248. package/dist/libs/contracts/dist/regenerator/service.js +0 -92
  249. package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
  250. package/dist/libs/contracts/dist/registry.js +0 -208
  251. package/dist/libs/contracts/dist/resources.js +0 -1
  252. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  253. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  254. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  255. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
  256. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  257. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  258. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  259. package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
  260. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  261. package/dist/libs/contracts/dist/server/index.js +0 -8
  262. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  263. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
  264. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  265. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  266. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  267. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  268. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  269. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  270. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  271. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  272. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  273. package/dist/libs/contracts/dist/spec.js +0 -35
  274. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  275. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  276. package/dist/libs/contracts/dist/tests/index.js +0 -1
  277. package/dist/libs/contracts/dist/tests/runner.js +0 -150
  278. package/dist/libs/contracts/dist/workflow/index.js +0 -1
  279. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  280. package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
  281. package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
  282. package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
  283. package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
  284. package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
  285. package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
  286. package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
  287. package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
  288. package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
  289. package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
  290. package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
  291. package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
  292. package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
  293. package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
  294. package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
  295. package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
  296. package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
  297. package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
  298. package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
  299. package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
  300. package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
  301. package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
  302. package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
  303. package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
  304. package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
  305. package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
  306. package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
  307. package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
  308. package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
  309. package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
  310. package/dist/ports/ai.d.ts +0 -58
  311. package/dist/ports/fs.d.ts +0 -80
  312. package/dist/ports/git.d.ts +0 -32
  313. package/dist/ports/logger.d.ts +0 -87
  314. package/dist/ports/watcher.d.ts +0 -51
  315. package/dist/services/agent-guide/adapters/claude-code.d.ts +0 -34
  316. package/dist/services/agent-guide/adapters/cursor-cli.d.ts +0 -38
  317. package/dist/services/agent-guide/adapters/generic-mcp.d.ts +0 -52
  318. package/dist/services/agent-guide/adapters/index.d.ts +0 -22
  319. package/dist/services/agent-guide/agent-guide-service.d.ts +0 -55
  320. package/dist/services/agent-guide/types.d.ts +0 -57
  321. package/dist/services/build.d.ts +0 -58
  322. package/dist/services/ci-check/ci-check-service.d.ts +0 -15
  323. package/dist/services/ci-check/types.d.ts +0 -142
  324. package/dist/services/clean.d.ts +0 -40
  325. package/dist/services/config.d.ts +0 -25
  326. package/dist/services/deps.d.ts +0 -52
  327. package/dist/services/diff.d.ts +0 -33
  328. package/dist/services/doctor/doctor-service.d.ts +0 -23
  329. package/dist/services/doctor/types.d.ts +0 -117
  330. package/dist/services/implementation/discovery.d.ts +0 -29
  331. package/dist/services/implementation/resolver.d.ts +0 -43
  332. package/dist/services/implementation/types.d.ts +0 -78
  333. package/dist/services/integrity-diagram.d.ts +0 -35
  334. package/dist/services/integrity.d.ts +0 -133
  335. package/dist/services/list.d.ts +0 -30
  336. package/dist/services/openapi/export-service.d.ts +0 -52
  337. package/dist/services/openapi/import-service.d.ts +0 -15
  338. package/dist/services/openapi/sync-service.d.ts +0 -18
  339. package/dist/services/openapi/types.d.ts +0 -184
  340. package/dist/services/openapi/validate-service.d.ts +0 -15
  341. package/dist/services/regenerator.d.ts +0 -17
  342. package/dist/services/registry.d.ts +0 -52
  343. package/dist/services/setup/config-generators.d.ts +0 -41
  344. package/dist/services/setup/file-merger.d.ts +0 -26
  345. package/dist/services/setup/setup-service.d.ts +0 -11
  346. package/dist/services/setup/types.d.ts +0 -84
  347. package/dist/services/sync.d.ts +0 -40
  348. package/dist/services/test.d.ts +0 -14
  349. package/dist/services/validate-implementation.d.ts +0 -31
  350. package/dist/services/validate.d.ts +0 -40
  351. package/dist/services/verification-cache/adapters/filesystem.d.ts +0 -45
  352. package/dist/services/verification-cache/adapters/in-memory.d.ts +0 -26
  353. package/dist/services/verification-cache/adapters/workspace-state.d.ts +0 -48
  354. package/dist/services/verification-cache/cache-service.d.ts +0 -69
  355. package/dist/services/verification-cache/types.d.ts +0 -123
  356. package/dist/services/verify/ai-verifier.d.ts +0 -24
  357. package/dist/services/verify/behavior-verifier.d.ts +0 -11
  358. package/dist/services/verify/structure-verifier.d.ts +0 -11
  359. package/dist/services/verify/types.d.ts +0 -136
  360. package/dist/services/verify/verify-service.d.ts +0 -59
  361. package/dist/services/watch.d.ts +0 -24
  362. package/dist/services/workspace-info.d.ts +0 -61
  363. package/dist/templates/app-config.template.d.ts +0 -6
  364. package/dist/templates/data-view.template.d.ts +0 -6
  365. package/dist/templates/event.template.d.ts +0 -10
  366. package/dist/templates/experiment.template.d.ts +0 -6
  367. package/dist/templates/handler.template.d.ts +0 -15
  368. package/dist/templates/index.d.ts +0 -20
  369. package/dist/templates/integration.template.d.ts +0 -6
  370. package/dist/templates/knowledge.template.d.ts +0 -6
  371. package/dist/templates/migration.template.d.ts +0 -6
  372. package/dist/templates/operation.template.d.ts +0 -10
  373. package/dist/templates/presentation.template.d.ts +0 -10
  374. package/dist/templates/telemetry.template.d.ts +0 -6
  375. package/dist/templates/workflow-runner.template.d.ts +0 -15
  376. package/dist/templates/workflow.template.d.ts +0 -6
  377. package/dist/types/config.d.ts +0 -33
  378. package/dist/types.d.ts +0 -323
@@ -1,352 +0,0 @@
1
- import { jsonSchemaForSpec } from "../jsonschema.js";
2
- import { isEmitDeclRef } from "../spec.js";
3
-
4
- //#region ../../libs/contracts/dist/llm/exporters.js
5
- const DEFAULT_SPEC_OPTIONS = {
6
- format: "full",
7
- includeSchemas: true,
8
- includeScenarios: true,
9
- includeExamples: true,
10
- includePolicy: true,
11
- includeSideEffects: true
12
- };
13
- const DEFAULT_FEATURE_OPTIONS = {
14
- ...DEFAULT_SPEC_OPTIONS,
15
- includeRelatedSpecs: true,
16
- includeRelatedEvents: true,
17
- includeRelatedPresentations: true
18
- };
19
- /**
20
- * Export a single spec to full markdown with all details.
21
- * Includes: all fields, I/O schemas, policy, events, examples.
22
- * Best for: Complete documentation, implementation reference.
23
- */
24
- function specToFullMarkdown(spec, options = {}) {
25
- const opts = {
26
- ...DEFAULT_SPEC_OPTIONS,
27
- ...options
28
- };
29
- const m = spec.meta;
30
- const lines = [];
31
- lines.push(`# ${m.name}.v${m.version}`);
32
- lines.push("");
33
- lines.push(`> ${m.description}`);
34
- lines.push("");
35
- lines.push("## Metadata");
36
- lines.push("");
37
- lines.push("| Field | Value |");
38
- lines.push("|-------|-------|");
39
- lines.push(`| Kind | ${m.kind} |`);
40
- lines.push(`| Stability | ${m.stability} |`);
41
- lines.push(`| Owners | ${m.owners.join(", ")} |`);
42
- lines.push(`| Tags | ${m.tags.join(", ")} |`);
43
- lines.push("");
44
- lines.push("## Goal");
45
- lines.push("");
46
- lines.push(m.goal);
47
- lines.push("");
48
- lines.push("## Context");
49
- lines.push("");
50
- lines.push(m.context);
51
- lines.push("");
52
- if (opts.includeSchemas) {
53
- lines.push("## Input/Output");
54
- lines.push("");
55
- if (spec.io.input) {
56
- lines.push("### Input Schema");
57
- lines.push("");
58
- lines.push("```json");
59
- try {
60
- const schema = jsonSchemaForSpec(spec);
61
- lines.push(JSON.stringify(schema.input ?? {}, null, 2));
62
- } catch {
63
- lines.push("// Schema generation not available");
64
- }
65
- lines.push("```");
66
- lines.push("");
67
- }
68
- lines.push("### Output Schema");
69
- lines.push("");
70
- lines.push("```json");
71
- try {
72
- const schema = jsonSchemaForSpec(spec);
73
- lines.push(JSON.stringify(schema.output ?? {}, null, 2));
74
- } catch {
75
- lines.push("// Schema generation not available");
76
- }
77
- lines.push("```");
78
- lines.push("");
79
- if (spec.io.errors && Object.keys(spec.io.errors).length) {
80
- lines.push("### Error Codes");
81
- lines.push("");
82
- lines.push("| Code | HTTP | Description | When |");
83
- lines.push("|------|------|-------------|------|");
84
- for (const [code, err] of Object.entries(spec.io.errors)) lines.push(`| \`${code}\` | ${err.http ?? 400} | ${err.description} | ${err.when} |`);
85
- lines.push("");
86
- }
87
- }
88
- if (opts.includePolicy) {
89
- lines.push("## Policy");
90
- lines.push("");
91
- lines.push(`- **Auth Required:** ${spec.policy.auth}`);
92
- lines.push(`- **Idempotent:** ${spec.policy.idempotent ?? m.kind === "query"}`);
93
- if (spec.policy.rateLimit) lines.push(`- **Rate Limit:** ${spec.policy.rateLimit.rpm} rpm per ${spec.policy.rateLimit.key}`);
94
- if (spec.policy.flags?.length) lines.push(`- **Feature Flags:** ${spec.policy.flags.join(", ")}`);
95
- if (spec.policy.pii?.length) lines.push(`- **PII Fields:** ${spec.policy.pii.join(", ")}`);
96
- if (spec.policy.escalate) lines.push(`- **Escalation:** ${spec.policy.escalate}`);
97
- lines.push("");
98
- }
99
- if (opts.includeSideEffects && spec.sideEffects) {
100
- if (spec.sideEffects.emits?.length) {
101
- lines.push("## Events Emitted");
102
- lines.push("");
103
- for (const e of spec.sideEffects.emits) if (isEmitDeclRef(e)) lines.push(`- \`${e.ref.name}.v${e.ref.version}\` — ${e.when}`);
104
- else lines.push(`- \`${e.name}.v${e.version}\` — ${e.when}`);
105
- lines.push("");
106
- }
107
- if (spec.sideEffects.analytics?.length) {
108
- lines.push("## Analytics Events");
109
- lines.push("");
110
- for (const a of spec.sideEffects.analytics) lines.push(`- ${a}`);
111
- lines.push("");
112
- }
113
- }
114
- if (opts.includeScenarios && spec.acceptance?.scenarios?.length) {
115
- lines.push("## Acceptance Scenarios");
116
- lines.push("");
117
- for (const s of spec.acceptance.scenarios) {
118
- lines.push(`### ${s.name}`);
119
- lines.push("");
120
- lines.push("**Given:**");
121
- for (const g of s.given) lines.push(`- ${g}`);
122
- lines.push("");
123
- lines.push("**When:**");
124
- for (const w of s.when) lines.push(`- ${w}`);
125
- lines.push("");
126
- lines.push("**Then:**");
127
- for (const t of s.then) lines.push(`- ${t}`);
128
- lines.push("");
129
- }
130
- }
131
- if (opts.includeExamples && spec.acceptance?.examples?.length) {
132
- lines.push("## Examples");
133
- lines.push("");
134
- for (const ex of spec.acceptance.examples) {
135
- lines.push(`### ${ex.name}`);
136
- lines.push("");
137
- lines.push("**Input:**");
138
- lines.push("```json");
139
- lines.push(JSON.stringify(ex.input, null, 2));
140
- lines.push("```");
141
- lines.push("");
142
- lines.push("**Output:**");
143
- lines.push("```json");
144
- lines.push(JSON.stringify(ex.output, null, 2));
145
- lines.push("```");
146
- lines.push("");
147
- }
148
- }
149
- if (spec.transport) {
150
- lines.push("## Transport Configuration");
151
- lines.push("");
152
- if (spec.transport.rest) lines.push(`- **REST:** ${spec.transport.rest.method ?? "POST"} ${spec.transport.rest.path ?? "auto"}`);
153
- if (spec.transport.gql) lines.push(`- **GraphQL:** ${spec.transport.gql.field ?? "auto"}`);
154
- if (spec.transport.mcp) lines.push(`- **MCP Tool:** ${spec.transport.mcp.toolName ?? "auto"}`);
155
- lines.push("");
156
- }
157
- return lines.join("\n");
158
- }
159
- /**
160
- * Export a single spec as an actionable agent prompt.
161
- * Includes: instructions, full spec, expected output format.
162
- * Best for: Directly feeding to coding agents for implementation.
163
- */
164
- function specToAgentPrompt(spec, options) {
165
- const taskType = options?.taskType ?? "implement";
166
- const m = spec.meta;
167
- const lines = [];
168
- const taskVerb = {
169
- implement: "Implement",
170
- test: "Write tests for",
171
- refactor: "Refactor",
172
- review: "Review"
173
- }[taskType];
174
- lines.push(`# Task: ${taskVerb} ${m.name}.v${m.version}`);
175
- lines.push("");
176
- lines.push("## Context");
177
- lines.push("");
178
- lines.push(`You are working on a ContractSpec-driven codebase. This spec defines a ${m.kind} operation.`);
179
- lines.push("");
180
- lines.push(`**Goal:** ${m.goal}`);
181
- lines.push("");
182
- lines.push(`**Background:** ${m.context}`);
183
- lines.push("");
184
- lines.push("## Specification");
185
- lines.push("");
186
- lines.push(specToFullMarkdown(spec));
187
- lines.push("");
188
- lines.push("## Instructions");
189
- lines.push("");
190
- if (taskType === "implement") {
191
- lines.push("Implement this specification following these requirements:");
192
- lines.push("");
193
- lines.push("1. **Type Safety**: Use TypeScript with strict typing. No `any` types.");
194
- lines.push("2. **Input Validation**: Validate input against the schema before processing.");
195
- lines.push("3. **Error Handling**: Implement all error cases defined in the spec.");
196
- lines.push("4. **Events**: Emit events as specified in sideEffects.emits.");
197
- lines.push("5. **Policy**: Respect auth, rate limits, and feature flags.");
198
- lines.push("6. **Idempotency**: " + (spec.policy.idempotent ? "This operation MUST be idempotent." : "This operation may have side effects."));
199
- lines.push("");
200
- if (spec.policy.pii?.length) {
201
- lines.push("**PII Handling**: The following fields contain PII and must be handled carefully:");
202
- for (const field of spec.policy.pii) lines.push(`- ${field}`);
203
- lines.push("");
204
- }
205
- } else if (taskType === "test") {
206
- lines.push("Write comprehensive tests for this specification:");
207
- lines.push("");
208
- lines.push("1. Test all acceptance scenarios defined in the spec.");
209
- lines.push("2. Test all error cases with appropriate assertions.");
210
- lines.push("3. Test edge cases and boundary conditions.");
211
- lines.push("4. Verify events are emitted correctly.");
212
- lines.push("5. Use descriptive test names following the pattern: \"should [behavior] when [condition]\"");
213
- lines.push("");
214
- } else if (taskType === "refactor") {
215
- lines.push("Refactor this implementation while preserving all behavior:");
216
- lines.push("");
217
- lines.push("1. Maintain compliance with the specification.");
218
- lines.push("2. Improve code clarity and maintainability.");
219
- lines.push("3. Reduce complexity where possible.");
220
- lines.push("4. Ensure all existing tests still pass.");
221
- lines.push("");
222
- } else if (taskType === "review") {
223
- lines.push("Review this implementation against the specification:");
224
- lines.push("");
225
- lines.push("1. Verify input/output types match the schema.");
226
- lines.push("2. Check all error cases are handled.");
227
- lines.push("3. Verify events are emitted as specified.");
228
- lines.push("4. Check policy compliance (auth, rate limits).");
229
- lines.push("5. Report any deviations from the spec.");
230
- lines.push("");
231
- }
232
- if (options?.existingCode) {
233
- lines.push("## Existing Code");
234
- lines.push("");
235
- lines.push("```typescript");
236
- lines.push(options.existingCode);
237
- lines.push("```");
238
- lines.push("");
239
- }
240
- lines.push("## Expected Output");
241
- lines.push("");
242
- if (taskType === "implement" || taskType === "refactor") {
243
- lines.push("Provide a complete TypeScript implementation. Include:");
244
- lines.push("- Type definitions for input/output");
245
- lines.push("- Handler function with proper error handling");
246
- lines.push("- JSDoc comments explaining the implementation");
247
- } else if (taskType === "test") lines.push("Provide a complete test file using the testing framework available (prefer Vitest).");
248
- else if (taskType === "review") {
249
- lines.push("Provide a structured review with:");
250
- lines.push("- Compliance status (pass/fail for each requirement)");
251
- lines.push("- Issues found with severity (error/warning/info)");
252
- lines.push("- Suggestions for improvement");
253
- }
254
- lines.push("");
255
- return lines.join("\n");
256
- }
257
- /**
258
- * Export a feature module to markdown.
259
- * Includes all related specs, events, and presentations.
260
- */
261
- function featureToMarkdown(feature, deps, options = {}) {
262
- const opts = {
263
- ...DEFAULT_FEATURE_OPTIONS,
264
- ...options
265
- };
266
- const m = feature.meta;
267
- const lines = [];
268
- lines.push(`# Feature: ${m.title ?? m.key}`);
269
- lines.push("");
270
- if (m.description) {
271
- lines.push(`> ${m.description}`);
272
- lines.push("");
273
- }
274
- lines.push("## Overview");
275
- lines.push("");
276
- lines.push(`- **Key:** \`${m.key}\``);
277
- lines.push(`- **Stability:** ${m.stability}`);
278
- lines.push(`- **Owners:** ${m.owners.join(", ")}`);
279
- if (m.tags?.length) lines.push(`- **Tags:** ${m.tags.join(", ")}`);
280
- lines.push("");
281
- if (feature.operations?.length) {
282
- lines.push("## Operations");
283
- lines.push("");
284
- lines.push("| Name | Version | Type |");
285
- lines.push("|------|---------|------|");
286
- for (const op of feature.operations) {
287
- const kind = (deps?.specs?.getSpec(op.name, op.version))?.meta.kind ?? "unknown";
288
- lines.push(`| ${op.name} | v${op.version} | ${kind} |`);
289
- }
290
- lines.push("");
291
- if (opts.includeRelatedSpecs && deps?.specs) {
292
- lines.push("### Operation Details");
293
- lines.push("");
294
- for (const op of feature.operations) {
295
- const spec = deps.specs.getSpec(op.name, op.version);
296
- if (spec) {
297
- lines.push(`---`);
298
- lines.push("");
299
- lines.push(specToFullMarkdown(spec, opts));
300
- }
301
- }
302
- }
303
- }
304
- if (feature.events?.length) {
305
- lines.push("## Events");
306
- lines.push("");
307
- lines.push("| Name | Version |");
308
- lines.push("|------|---------|");
309
- for (const evt of feature.events) lines.push(`| ${evt.name} | v${evt.version} |`);
310
- lines.push("");
311
- }
312
- if (feature.presentations?.length) {
313
- lines.push("## Presentations");
314
- lines.push("");
315
- lines.push("| Name | Version |");
316
- lines.push("|------|---------|");
317
- for (const pres of feature.presentations) lines.push(`| ${pres.name} | v${pres.version} |`);
318
- lines.push("");
319
- if (opts.includeRelatedPresentations && deps?.presentations) {
320
- lines.push("### Presentation Details");
321
- lines.push("");
322
- for (const pres of feature.presentations) {
323
- const p = deps.presentations.get(pres.name, pres.version);
324
- if (p) {
325
- lines.push(`#### ${pres.name}.v${pres.version}`);
326
- lines.push("");
327
- lines.push(`- **Kind:** ${p.content.kind ?? "unknown"}`);
328
- if ("componentKey" in p.content) lines.push(`- **Component:** ${p.content.componentKey}`);
329
- lines.push("");
330
- }
331
- }
332
- }
333
- }
334
- if (feature.capabilities) {
335
- if (feature.capabilities.provides?.length) {
336
- lines.push("## Capabilities Provided");
337
- lines.push("");
338
- for (const cap of feature.capabilities.provides) lines.push(`- \`${cap.key}.v${cap.version}\``);
339
- lines.push("");
340
- }
341
- if (feature.capabilities.requires?.length) {
342
- lines.push("## Capabilities Required");
343
- lines.push("");
344
- for (const cap of feature.capabilities.requires) lines.push(`- \`${cap.key}\`${cap.version ? `.v${cap.version}` : ""} (${cap.optional ? "optional" : "required"})`);
345
- lines.push("");
346
- }
347
- }
348
- return lines.join("\n");
349
- }
350
-
351
- //#endregion
352
- export { featureToMarkdown, specToAgentPrompt, specToFullMarkdown };
@@ -1,2 +0,0 @@
1
- import { featureToMarkdown, specToAgentPrompt, specToFullMarkdown } from "./exporters.js";
2
- import { AGENT_SYSTEM_PROMPTS, generateImplementationPlan, generateVerificationPrompt } from "./prompts.js";
@@ -1,211 +0,0 @@
1
- import { specToFullMarkdown } from "./exporters.js";
2
-
3
- //#region ../../libs/contracts/dist/llm/prompts.js
4
- /**
5
- * System prompts for different agent types.
6
- */
7
- const AGENT_SYSTEM_PROMPTS = {
8
- "claude-code": `You are an expert TypeScript developer working with ContractSpec, a spec-first development framework.
9
-
10
- Your code follows these principles:
11
- - Type-safe with comprehensive TypeScript types (no \`any\`)
12
- - Well-documented with JSDoc comments
13
- - Production-ready with proper error handling
14
- - Following SOLID principles and clean code practices
15
- - Modular and testable
16
-
17
- When implementing specs:
18
- 1. Validate input against the schema before processing
19
- 2. Handle all error cases defined in the spec
20
- 3. Emit events as specified in sideEffects
21
- 4. Respect policy constraints (auth, rate limits, PII handling)
22
- 5. Follow the acceptance scenarios as your implementation guide
23
-
24
- Generate clean, idiomatic TypeScript that exactly matches the specification.`,
25
- "cursor-cli": `You are implementing features for a ContractSpec-driven codebase.
26
-
27
- ContractSpec is a spec-first framework where specifications define:
28
- - Operations (commands and queries) with typed I/O
29
- - Events that operations emit
30
- - Presentations for UI components
31
- - Features that group related specs
32
-
33
- When working with specs:
34
- - Read the spec carefully before implementing
35
- - Match the input/output types exactly
36
- - Implement all error cases
37
- - Follow the acceptance scenarios
38
- - Respect policy constraints
39
-
40
- Use the project's existing patterns and conventions.`,
41
- "generic-mcp": `You are a code generation assistant working with ContractSpec specifications.
42
-
43
- ContractSpec specs define:
44
- - meta: name, version, kind (command/query), description, goal, context
45
- - io: input schema, output schema, error definitions
46
- - policy: auth level, rate limits, feature flags, PII handling
47
- - sideEffects: events to emit, analytics, audit
48
- - acceptance: scenarios and examples
49
-
50
- Your task is to generate or modify code that complies with the given specification.
51
- Follow the spec exactly and handle all defined cases.`
52
- };
53
- /**
54
- * Generate a verification prompt for AI-powered semantic review.
55
- */
56
- function generateVerificationPrompt(spec, implementationCode) {
57
- return {
58
- agent: "generic-mcp",
59
- taskPrompt: `## Semantic Verification Task
60
-
61
- Verify that this implementation fulfills the specification's intent.
62
-
63
- **Specification:**
64
- ${specToFullMarkdown(spec)}
65
-
66
- **Implementation:**
67
- \`\`\`typescript
68
- ${implementationCode}
69
- \`\`\`
70
-
71
- Analyze and respond with JSON:
72
-
73
- \`\`\`json
74
- {
75
- "passed": true/false,
76
- "score": 0-100,
77
- "compliance": {
78
- "inputTypes": { "match": true/false, "issues": [] },
79
- "outputTypes": { "match": true/false, "issues": [] },
80
- "errorHandling": { "coverage": "full/partial/none", "missing": [] },
81
- "eventEmission": { "correct": true/false, "issues": [] },
82
- "policyCompliance": { "auth": true/false, "rateLimit": true/false, "pii": true/false }
83
- },
84
- "scenarios": [
85
- { "name": "scenario name", "covered": true/false, "notes": "" }
86
- ],
87
- "issues": [
88
- { "severity": "error/warning/info", "category": "type/export/import/scenario/error_handling/semantic", "message": "", "suggestion": "" }
89
- ],
90
- "summary": "Brief summary of verification results"
91
- }
92
- \`\`\``
93
- };
94
- }
95
- /**
96
- * Generate a feature implementation plan.
97
- */
98
- function generateImplementationPlan(spec, options) {
99
- const m = spec.meta;
100
- const fileStructure = [];
101
- const basePath = options?.projectRoot ?? "src";
102
- const specPath = m.name.replace(/\./g, "/");
103
- if (m.kind === "command" || m.kind === "query") fileStructure.push({
104
- path: `${basePath}/${specPath}/handler.ts`,
105
- purpose: "Main handler implementation",
106
- type: "create"
107
- }, {
108
- path: `${basePath}/${specPath}/types.ts`,
109
- purpose: "Type definitions",
110
- type: "create"
111
- }, {
112
- path: `${basePath}/${specPath}/handler.test.ts`,
113
- purpose: "Handler tests",
114
- type: "create"
115
- });
116
- const steps = [];
117
- let order = 1;
118
- steps.push({
119
- order: order++,
120
- title: "Define Types",
121
- description: "Create TypeScript types for input, output, and internal data structures",
122
- acceptanceCriteria: [
123
- "Input type matches spec schema exactly",
124
- "Output type matches spec schema exactly",
125
- "Error types defined for all error cases"
126
- ]
127
- });
128
- steps.push({
129
- order: order++,
130
- title: "Implement Input Validation",
131
- description: "Add validation logic for the input payload",
132
- acceptanceCriteria: [
133
- "All required fields are validated",
134
- "Type constraints are enforced",
135
- "Validation errors return appropriate error codes"
136
- ]
137
- });
138
- steps.push({
139
- order: order++,
140
- title: "Implement Core Logic",
141
- description: "Implement the main business logic of the operation",
142
- acceptanceCriteria: spec.acceptance?.scenarios?.map((s) => s.name) ?? ["Operation completes successfully for valid input"]
143
- });
144
- if (spec.io.errors && Object.keys(spec.io.errors).length > 0) steps.push({
145
- order: order++,
146
- title: "Implement Error Handling",
147
- description: "Handle all defined error cases",
148
- acceptanceCriteria: Object.entries(spec.io.errors).map(([code, err]) => `Handle ${code}: ${err.when}`)
149
- });
150
- if (spec.sideEffects?.emits?.length) steps.push({
151
- order: order++,
152
- title: "Implement Event Emission",
153
- description: "Emit events as specified",
154
- acceptanceCriteria: spec.sideEffects.emits.map((e) => {
155
- if ("ref" in e) return `Emit ${e.ref.name}.v${e.ref.version} when ${e.when}`;
156
- return `Emit ${e.name}.v${e.version} when ${e.when}`;
157
- })
158
- });
159
- steps.push({
160
- order: order++,
161
- title: "Write Tests",
162
- description: "Create comprehensive test suite",
163
- acceptanceCriteria: [
164
- "All acceptance scenarios covered",
165
- "All error cases tested",
166
- "Edge cases handled",
167
- "Events verified"
168
- ]
169
- });
170
- const constraints = {
171
- policy: [],
172
- security: [],
173
- pii: []
174
- };
175
- constraints.policy.push(`Auth level: ${spec.policy.auth}`);
176
- if (spec.policy.idempotent !== void 0) constraints.policy.push(`Idempotent: ${spec.policy.idempotent}`);
177
- if (spec.policy.rateLimit) constraints.policy.push(`Rate limit: ${spec.policy.rateLimit.rpm} rpm per ${spec.policy.rateLimit.key}`);
178
- if (spec.policy.flags?.length) constraints.policy.push(`Feature flags required: ${spec.policy.flags.join(", ")}`);
179
- if (spec.policy.escalate) constraints.security.push(`Escalation required: ${spec.policy.escalate}`);
180
- if (spec.policy.pii?.length) constraints.pii = spec.policy.pii;
181
- return {
182
- target: {
183
- type: "spec",
184
- name: m.name,
185
- version: m.version
186
- },
187
- context: {
188
- goal: m.goal,
189
- description: m.description,
190
- background: m.context
191
- },
192
- specMarkdown: specToFullMarkdown(spec),
193
- fileStructure,
194
- steps,
195
- constraints,
196
- verificationChecklist: [
197
- "Input validation works for all cases",
198
- "Output matches expected schema",
199
- "All error cases return correct codes",
200
- "Events are emitted with correct payloads",
201
- "Auth requirements are enforced",
202
- "Rate limiting is applied (if applicable)",
203
- "PII fields are handled correctly",
204
- "All acceptance scenarios pass",
205
- "Tests provide adequate coverage"
206
- ]
207
- };
208
- }
209
-
210
- //#endregion
211
- export { AGENT_SYSTEM_PROMPTS, generateImplementationPlan, generateVerificationPrompt };