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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/dist/_virtual/rolldown_runtime.js +1 -22
  2. package/dist/adapters/ai.js +1 -82
  3. package/dist/adapters/factory.js +1 -36
  4. package/dist/adapters/fs.js +1 -118
  5. package/dist/adapters/git.js +1 -54
  6. package/dist/adapters/index.js +1 -7
  7. package/dist/adapters/logger.js +1 -80
  8. package/dist/adapters/watcher.js +1 -69
  9. package/dist/adapters/workspace.js +2 -190
  10. package/dist/ai/agents/claude-code-agent.js +9 -146
  11. package/dist/ai/agents/cursor-agent.js +17 -286
  12. package/dist/ai/agents/index.js +1 -5
  13. package/dist/ai/agents/openai-codex-agent.js +8 -140
  14. package/dist/ai/agents/orchestrator.js +1 -142
  15. package/dist/ai/agents/simple-agent.js +4 -80
  16. package/dist/ai/client.js +1 -162
  17. package/dist/ai/index.js +1 -27
  18. package/dist/ai/prompts/code-generation.js +13 -55
  19. package/dist/ai/prompts/index.js +1 -12
  20. package/dist/ai/prompts/spec-creation.js +20 -61
  21. package/dist/ai/providers.js +1 -40
  22. package/dist/formatters/index.js +1 -18
  23. package/dist/formatters/json.js +1 -71
  24. package/dist/formatters/sarif.js +1 -163
  25. package/dist/formatters/text.js +2 -208
  26. package/dist/index.js +1 -81
  27. package/dist/services/agent-guide/adapters/claude-code.js +3 -144
  28. package/dist/services/agent-guide/adapters/cursor-cli.js +3 -135
  29. package/dist/services/agent-guide/adapters/generic-mcp.js +3 -159
  30. package/dist/services/agent-guide/adapters/index.js +1 -30
  31. package/dist/services/agent-guide/agent-guide-service.js +1 -148
  32. package/dist/services/agent-guide/index.js +1 -5
  33. package/dist/services/build.js +1 -140
  34. package/dist/services/ci-check/ci-check-service.js +1 -393
  35. package/dist/services/ci-check/index.js +1 -2
  36. package/dist/services/ci-check/types.js +1 -28
  37. package/dist/services/clean.js +1 -71
  38. package/dist/services/config.js +1 -76
  39. package/dist/services/deps.js +1 -62
  40. package/dist/services/diff.js +1 -33
  41. package/dist/services/doctor/checks/ai.js +2 -118
  42. package/dist/services/doctor/checks/cli.js +1 -146
  43. package/dist/services/doctor/checks/config.js +1 -170
  44. package/dist/services/doctor/checks/deps.js +1 -180
  45. package/dist/services/doctor/checks/index.js +1 -6
  46. package/dist/services/doctor/checks/mcp.js +1 -144
  47. package/dist/services/doctor/checks/workspace.js +1 -243
  48. package/dist/services/doctor/doctor-service.js +2 -115
  49. package/dist/services/doctor/index.js +1 -2
  50. package/dist/services/doctor/types.js +1 -26
  51. package/dist/services/implementation/discovery.js +2 -143
  52. package/dist/services/implementation/index.js +1 -2
  53. package/dist/services/implementation/resolver.js +1 -223
  54. package/dist/services/index.js +1 -53
  55. package/dist/services/integrity-diagram.js +6 -274
  56. package/dist/services/integrity.js +1 -272
  57. package/dist/services/list.js +1 -35
  58. package/dist/services/openapi/export-service.js +2 -51
  59. package/dist/services/openapi/import-service.js +1 -75
  60. package/dist/services/openapi/index.js +1 -4
  61. package/dist/services/openapi/sync-service.js +1 -121
  62. package/dist/services/openapi/validate-service.js +1 -130
  63. package/dist/services/regenerator.js +1 -23
  64. package/dist/services/registry.js +1 -73
  65. package/dist/services/setup/config-generators.js +26 -113
  66. package/dist/services/setup/file-merger.js +2 -60
  67. package/dist/services/setup/index.js +1 -4
  68. package/dist/services/setup/setup-service.js +1 -95
  69. package/dist/services/setup/targets/agents-md.js +1 -46
  70. package/dist/services/setup/targets/cli-config.js +1 -59
  71. package/dist/services/setup/targets/cursor-rules.js +1 -47
  72. package/dist/services/setup/targets/mcp-claude.js +1 -59
  73. package/dist/services/setup/targets/mcp-cursor.js +1 -58
  74. package/dist/services/setup/targets/vscode-settings.js +1 -62
  75. package/dist/services/setup/types.js +1 -26
  76. package/dist/services/sync.js +1 -62
  77. package/dist/services/test.js +1 -30
  78. package/dist/services/validate-implementation.js +1 -69
  79. package/dist/services/validate.js +1 -47
  80. package/dist/services/verification-cache/adapters/filesystem.js +1 -121
  81. package/dist/services/verification-cache/adapters/in-memory.js +1 -45
  82. package/dist/services/verification-cache/adapters/index.js +1 -3
  83. package/dist/services/verification-cache/adapters/workspace-state.js +1 -90
  84. package/dist/services/verification-cache/cache-service.js +1 -255
  85. package/dist/services/verification-cache/index.js +1 -6
  86. package/dist/services/verification-cache/types.js +1 -15
  87. package/dist/services/verify/ai-verifier.js +9 -336
  88. package/dist/services/verify/behavior-verifier.js +1 -185
  89. package/dist/services/verify/index.js +1 -4
  90. package/dist/services/verify/structure-verifier.js +2 -195
  91. package/dist/services/verify/verify-service.js +3 -203
  92. package/dist/services/watch.js +1 -31
  93. package/dist/services/workspace-info.js +2 -102
  94. package/dist/templates/app-config.template.js +28 -101
  95. package/dist/templates/data-view.template.js +27 -42
  96. package/dist/templates/event.template.js +14 -29
  97. package/dist/templates/experiment.template.js +51 -77
  98. package/dist/templates/handler.template.js +17 -53
  99. package/dist/templates/index.js +1 -36
  100. package/dist/templates/integration.template.js +50 -134
  101. package/dist/templates/knowledge.template.js +21 -62
  102. package/dist/templates/migration.template.js +26 -50
  103. package/dist/templates/operation.template.js +28 -44
  104. package/dist/templates/presentation.template.js +20 -46
  105. package/dist/templates/telemetry.template.js +53 -74
  106. package/dist/templates/workflow-runner.template.js +6 -12
  107. package/dist/templates/workflow.template.js +24 -51
  108. package/package.json +10 -15
  109. package/dist/adapters/ai.d.ts +0 -11
  110. package/dist/adapters/factory.d.ts +0 -28
  111. package/dist/adapters/fs.d.ts +0 -10
  112. package/dist/adapters/git.d.ts +0 -10
  113. package/dist/adapters/logger.d.ts +0 -17
  114. package/dist/adapters/watcher.d.ts +0 -10
  115. package/dist/adapters/workspace.d.ts +0 -93
  116. package/dist/ai/agents/claude-code-agent.d.ts +0 -21
  117. package/dist/ai/agents/cursor-agent.d.ts +0 -67
  118. package/dist/ai/agents/openai-codex-agent.d.ts +0 -21
  119. package/dist/ai/agents/orchestrator.d.ts +0 -49
  120. package/dist/ai/agents/simple-agent.d.ts +0 -16
  121. package/dist/ai/agents/types.d.ts +0 -35
  122. package/dist/ai/client.d.ts +0 -82
  123. package/dist/ai/index.d.ts +0 -16
  124. package/dist/ai/prompts/code-generation.d.ts +0 -25
  125. package/dist/ai/prompts/index.d.ts +0 -9
  126. package/dist/ai/prompts/spec-creation.d.ts +0 -28
  127. package/dist/ai/providers.d.ts +0 -28
  128. package/dist/formatters/index.d.ts +0 -10
  129. package/dist/formatters/json.d.ts +0 -88
  130. package/dist/formatters/sarif.d.ts +0 -100
  131. package/dist/formatters/text.d.ts +0 -34
  132. package/dist/index.d.ts +0 -66
  133. package/dist/libs/ai-providers/dist/factory.js +0 -154
  134. package/dist/libs/ai-providers/dist/index.js +0 -4
  135. package/dist/libs/ai-providers/dist/legacy.js +0 -72
  136. package/dist/libs/ai-providers/dist/models.js +0 -287
  137. package/dist/libs/ai-providers/dist/validation.js +0 -1
  138. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
  139. package/dist/libs/contracts/dist/client/index.js +0 -5
  140. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
  141. package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
  142. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  143. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  144. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
  145. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  146. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  147. package/dist/libs/contracts/dist/docs/index.js +0 -29
  148. package/dist/libs/contracts/dist/docs/presentations.js +0 -71
  149. package/dist/libs/contracts/dist/docs/registry.js +0 -44
  150. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  151. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  152. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  153. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  154. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  155. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  156. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  157. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  158. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  159. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  160. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  161. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  162. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  163. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  164. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  165. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  166. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  167. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  168. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  169. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  170. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  171. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  172. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  173. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  174. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  175. package/dist/libs/contracts/dist/events.js +0 -8
  176. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  177. package/dist/libs/contracts/dist/index.js +0 -72
  178. package/dist/libs/contracts/dist/install.js +0 -2
  179. package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
  180. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  181. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  182. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  183. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  184. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  185. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
  186. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  187. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  188. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  189. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
  190. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
  191. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  192. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
  193. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
  194. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
  195. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
  196. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  197. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
  198. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  199. package/dist/libs/contracts/dist/jsonschema.js +0 -24
  200. package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
  201. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  202. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  203. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  204. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  205. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  206. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  207. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  208. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  209. package/dist/libs/contracts/dist/llm/exporters.js +0 -352
  210. package/dist/libs/contracts/dist/llm/index.js +0 -2
  211. package/dist/libs/contracts/dist/llm/prompts.js +0 -211
  212. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  213. package/dist/libs/contracts/dist/openapi.js +0 -75
  214. package/dist/libs/contracts/dist/ownership.js +0 -21
  215. package/dist/libs/contracts/dist/presentations.js +0 -1
  216. package/dist/libs/contracts/dist/presentations.v2.js +0 -11
  217. package/dist/libs/contracts/dist/prompt.js +0 -1
  218. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  219. package/dist/libs/contracts/dist/regenerator/index.js +0 -2
  220. package/dist/libs/contracts/dist/regenerator/service.js +0 -92
  221. package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
  222. package/dist/libs/contracts/dist/registry.js +0 -208
  223. package/dist/libs/contracts/dist/resources.js +0 -1
  224. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  225. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  226. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  227. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
  228. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  229. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  230. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  231. package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
  232. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  233. package/dist/libs/contracts/dist/server/index.js +0 -8
  234. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  235. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
  236. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  237. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  238. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  239. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  240. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  241. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  242. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  243. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  244. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  245. package/dist/libs/contracts/dist/spec.js +0 -35
  246. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  247. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  248. package/dist/libs/contracts/dist/tests/index.js +0 -1
  249. package/dist/libs/contracts/dist/tests/runner.js +0 -150
  250. package/dist/libs/contracts/dist/workflow/index.js +0 -1
  251. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  252. package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
  253. package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
  254. package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
  255. package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
  256. package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
  257. package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
  258. package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
  259. package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
  260. package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
  261. package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
  262. package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
  263. package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
  264. package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
  265. package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
  266. package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
  267. package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
  268. package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
  269. package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
  270. package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
  271. package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
  272. package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
  273. package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
  274. package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
  275. package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
  276. package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
  277. package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
  278. package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
  279. package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
  280. package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
  281. package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
  282. package/dist/ports/ai.d.ts +0 -58
  283. package/dist/ports/fs.d.ts +0 -80
  284. package/dist/ports/git.d.ts +0 -32
  285. package/dist/ports/logger.d.ts +0 -87
  286. package/dist/ports/watcher.d.ts +0 -51
  287. package/dist/services/agent-guide/adapters/claude-code.d.ts +0 -34
  288. package/dist/services/agent-guide/adapters/cursor-cli.d.ts +0 -38
  289. package/dist/services/agent-guide/adapters/generic-mcp.d.ts +0 -52
  290. package/dist/services/agent-guide/adapters/index.d.ts +0 -22
  291. package/dist/services/agent-guide/agent-guide-service.d.ts +0 -55
  292. package/dist/services/agent-guide/types.d.ts +0 -57
  293. package/dist/services/build.d.ts +0 -58
  294. package/dist/services/ci-check/ci-check-service.d.ts +0 -15
  295. package/dist/services/ci-check/types.d.ts +0 -142
  296. package/dist/services/clean.d.ts +0 -40
  297. package/dist/services/config.d.ts +0 -25
  298. package/dist/services/deps.d.ts +0 -52
  299. package/dist/services/diff.d.ts +0 -33
  300. package/dist/services/doctor/doctor-service.d.ts +0 -23
  301. package/dist/services/doctor/types.d.ts +0 -117
  302. package/dist/services/implementation/discovery.d.ts +0 -29
  303. package/dist/services/implementation/resolver.d.ts +0 -43
  304. package/dist/services/implementation/types.d.ts +0 -78
  305. package/dist/services/integrity-diagram.d.ts +0 -35
  306. package/dist/services/integrity.d.ts +0 -133
  307. package/dist/services/list.d.ts +0 -30
  308. package/dist/services/openapi/export-service.d.ts +0 -52
  309. package/dist/services/openapi/import-service.d.ts +0 -15
  310. package/dist/services/openapi/sync-service.d.ts +0 -18
  311. package/dist/services/openapi/types.d.ts +0 -184
  312. package/dist/services/openapi/validate-service.d.ts +0 -15
  313. package/dist/services/regenerator.d.ts +0 -17
  314. package/dist/services/registry.d.ts +0 -52
  315. package/dist/services/setup/config-generators.d.ts +0 -41
  316. package/dist/services/setup/file-merger.d.ts +0 -26
  317. package/dist/services/setup/setup-service.d.ts +0 -11
  318. package/dist/services/setup/types.d.ts +0 -84
  319. package/dist/services/sync.d.ts +0 -40
  320. package/dist/services/test.d.ts +0 -14
  321. package/dist/services/validate-implementation.d.ts +0 -31
  322. package/dist/services/validate.d.ts +0 -40
  323. package/dist/services/verification-cache/adapters/filesystem.d.ts +0 -45
  324. package/dist/services/verification-cache/adapters/in-memory.d.ts +0 -26
  325. package/dist/services/verification-cache/adapters/workspace-state.d.ts +0 -48
  326. package/dist/services/verification-cache/cache-service.d.ts +0 -69
  327. package/dist/services/verification-cache/types.d.ts +0 -123
  328. package/dist/services/verify/ai-verifier.d.ts +0 -24
  329. package/dist/services/verify/behavior-verifier.d.ts +0 -11
  330. package/dist/services/verify/structure-verifier.d.ts +0 -11
  331. package/dist/services/verify/types.d.ts +0 -136
  332. package/dist/services/verify/verify-service.d.ts +0 -59
  333. package/dist/services/watch.d.ts +0 -24
  334. package/dist/services/workspace-info.d.ts +0 -61
  335. package/dist/templates/app-config.template.d.ts +0 -6
  336. package/dist/templates/data-view.template.d.ts +0 -6
  337. package/dist/templates/event.template.d.ts +0 -10
  338. package/dist/templates/experiment.template.d.ts +0 -6
  339. package/dist/templates/handler.template.d.ts +0 -15
  340. package/dist/templates/index.d.ts +0 -20
  341. package/dist/templates/integration.template.d.ts +0 -6
  342. package/dist/templates/knowledge.template.d.ts +0 -6
  343. package/dist/templates/migration.template.d.ts +0 -6
  344. package/dist/templates/operation.template.d.ts +0 -10
  345. package/dist/templates/presentation.template.d.ts +0 -10
  346. package/dist/templates/telemetry.template.d.ts +0 -6
  347. package/dist/templates/workflow-runner.template.d.ts +0 -15
  348. package/dist/templates/workflow.template.d.ts +0 -6
  349. package/dist/types/config.d.ts +0 -33
  350. package/dist/types.d.ts +0 -323
@@ -1,22 +1 @@
1
- //#region rolldown:runtime
2
- var __defProp = Object.defineProperty;
3
- var __export = (all, symbols) => {
4
- let target = {};
5
- for (var name in all) {
6
- __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
10
- }
11
- if (symbols) {
12
- __defProp(target, Symbol.toStringTag, { value: "Module" });
13
- }
14
- return target;
15
- };
16
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
17
- if (typeof require !== "undefined") return require.apply(this, arguments);
18
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
19
- });
20
-
21
- //#endregion
22
- export { __export, __require };
1
+ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n&&e(r,Symbol.toStringTag,{value:`Module`}),r},n=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function.")});export{t as __export,n as __require};
@@ -1,82 +1 @@
1
- import { anthropic } from "@ai-sdk/anthropic";
2
- import { openai } from "@ai-sdk/openai";
3
- import { ollama } from "ollama-ai-provider";
4
- import { generateObject, generateText, streamText } from "ai";
5
-
6
- //#region src/adapters/ai.ts
7
- /**
8
- * Node.js AI adapter implementation using Vercel AI SDK.
9
- */
10
- /**
11
- * Create a Node.js AI adapter using Vercel AI SDK.
12
- */
13
- function createNodeAiAdapter(config) {
14
- return {
15
- async validateProvider(providerConfig) {
16
- try {
17
- const { aiProvider } = providerConfig;
18
- if (aiProvider === "ollama") return { success: true };
19
- if (aiProvider === "claude" && !process.env["ANTHROPIC_API_KEY"]) return {
20
- success: false,
21
- error: "ANTHROPIC_API_KEY environment variable not set"
22
- };
23
- if (aiProvider === "openai" && !process.env["OPENAI_API_KEY"]) return {
24
- success: false,
25
- error: "OPENAI_API_KEY environment variable not set"
26
- };
27
- return { success: true };
28
- } catch (error) {
29
- return {
30
- success: false,
31
- error: error instanceof Error ? error.message : String(error)
32
- };
33
- }
34
- },
35
- async generateText(options) {
36
- return { text: (await generateText({
37
- model: getAIProvider(config),
38
- prompt: options.prompt,
39
- system: options.systemPrompt
40
- })).text };
41
- },
42
- async generateStructured(options) {
43
- return { object: (await generateObject({
44
- model: getAIProvider(config),
45
- schema: options.schema,
46
- prompt: options.prompt,
47
- system: options.systemPrompt
48
- })).object };
49
- },
50
- async streamText(options, onChunk) {
51
- const result = await streamText({
52
- model: getAIProvider(config),
53
- prompt: options.prompt,
54
- system: options.systemPrompt
55
- });
56
- let fullText = "";
57
- for await (const chunk of result.textStream) {
58
- fullText += chunk;
59
- onChunk(chunk);
60
- }
61
- return fullText;
62
- }
63
- };
64
- }
65
- /**
66
- * Get AI provider based on configuration.
67
- */
68
- function getAIProvider(config) {
69
- const { aiProvider, aiModel, customEndpoint } = config;
70
- switch (aiProvider) {
71
- case "claude": return anthropic(aiModel ?? "claude-3-5-sonnet-20241022");
72
- case "openai": return openai(aiModel ?? "gpt-4o");
73
- case "ollama": return ollama(aiModel ?? "codellama");
74
- case "custom":
75
- if (!customEndpoint) throw new Error("Custom endpoint required. Set customEndpoint in config or CONTRACTSPEC_LLM_ENDPOINT env var");
76
- return openai(aiModel ?? "default");
77
- default: throw new Error(`Unknown AI provider: ${aiProvider}`);
78
- }
79
- }
80
-
81
- //#endregion
82
- export { createNodeAiAdapter };
1
+ import{anthropic as e}from"../node_modules/@ai-sdk/anthropic/dist/index.js";import{openai as t}from"../node_modules/@ai-sdk/openai/dist/index.js";import{ollama as n}from"ollama-ai-provider";import{generateObject as r,generateText as i,streamText as a}from"ai";function o(e){return{async validateProvider(e){try{let{aiProvider:t}=e;return t===`ollama`?{success:!0}:t===`claude`&&!process.env.ANTHROPIC_API_KEY?{success:!1,error:`ANTHROPIC_API_KEY environment variable not set`}:t===`openai`&&!process.env.OPENAI_API_KEY?{success:!1,error:`OPENAI_API_KEY environment variable not set`}:{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:String(e)}}},async generateText(t){return{text:(await i({model:s(e),prompt:t.prompt,system:t.systemPrompt})).text}},async generateStructured(t){return{object:(await r({model:s(e),schema:t.schema,prompt:t.prompt,system:t.systemPrompt})).object}},async streamText(t,n){let r=await a({model:s(e),prompt:t.prompt,system:t.systemPrompt}),i=``;for await(let e of r.textStream)i+=e,n(e);return i}}}function s(r){let{aiProvider:i,aiModel:a,customEndpoint:o}=r;switch(i){case`claude`:return e(a??`claude-3-5-sonnet-20241022`);case`openai`:return t(a??`gpt-4o`);case`ollama`:return n(a??`codellama`);case`custom`:if(!o)throw Error(`Custom endpoint required. Set customEndpoint in config or CONTRACTSPEC_LLM_ENDPOINT env var`);return t(a??`default`);default:throw Error(`Unknown AI provider: ${i}`)}}export{o as createNodeAiAdapter};
@@ -1,36 +1 @@
1
- import { createNodeFsAdapter } from "./fs.js";
2
- import { createNodeGitAdapter } from "./git.js";
3
- import { createNodeWatcherAdapter } from "./watcher.js";
4
- import { createNodeAiAdapter } from "./ai.js";
5
- import { createConsoleLoggerAdapter, createNoopLoggerAdapter } from "./logger.js";
6
-
7
- //#region src/adapters/factory.ts
8
- /**
9
- * Create all Node.js adapters with default configuration.
10
- */
11
- function createNodeAdapters(options = {}) {
12
- const { cwd, config, silent } = options;
13
- const workspaceConfig = config ?? {
14
- aiProvider: "claude",
15
- agentMode: "simple",
16
- outputDir: "./src",
17
- conventions: {
18
- operations: "interactions/commands|queries",
19
- events: "events",
20
- presentations: "presentations",
21
- forms: "forms"
22
- },
23
- defaultOwners: [],
24
- defaultTags: []
25
- };
26
- return {
27
- fs: createNodeFsAdapter(cwd),
28
- git: createNodeGitAdapter(cwd),
29
- watcher: createNodeWatcherAdapter(cwd),
30
- ai: createNodeAiAdapter(workspaceConfig),
31
- logger: silent ? createNoopLoggerAdapter() : createConsoleLoggerAdapter()
32
- };
33
- }
34
-
35
- //#endregion
36
- export { createNodeAdapters };
1
+ import{createNodeFsAdapter as e}from"./fs.js";import{createNodeGitAdapter as t}from"./git.js";import{createNodeWatcherAdapter as n}from"./watcher.js";import{createNodeAiAdapter as r}from"./ai.js";import{createConsoleLoggerAdapter as i,createNoopLoggerAdapter as a}from"./logger.js";function o(o={}){let{cwd:s,config:c,silent:l}=o,u=c??{aiProvider:`claude`,agentMode:`simple`,outputDir:`./src`,conventions:{operations:`interactions/commands|queries`,events:`events`,presentations:`presentations`,forms:`forms`},defaultOwners:[],defaultTags:[]};return{fs:e(s),git:t(s),watcher:n(s),ai:r(u),logger:l?a():i()}}export{o as createNodeAdapters};
@@ -1,118 +1 @@
1
- import { access, mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
2
- import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
3
- import { glob } from "glob";
4
-
5
- //#region src/adapters/fs.ts
6
- /**
7
- * Node.js filesystem adapter implementation.
8
- */
9
- const DEFAULT_SPEC_PATTERNS = [
10
- "**/*.contracts.ts",
11
- "**/*.event.ts",
12
- "**/*.presentation.ts",
13
- "**/*.feature.ts",
14
- "**/*.capability.ts",
15
- "**/*.workflow.ts",
16
- "**/*.data-view.ts",
17
- "**/*.form.ts",
18
- "**/*.migration.ts",
19
- "**/*.telemetry.ts",
20
- "**/*.experiment.ts",
21
- "**/*.app-config.ts",
22
- "**/*.integration.ts",
23
- "**/*.knowledge.ts",
24
- "**/*.policy.ts",
25
- "**/*.test-spec.ts",
26
- "**/contracts/*.ts",
27
- "**/contracts/index.ts",
28
- "**/events.ts",
29
- "**/presentations.ts",
30
- "**/events/index.ts",
31
- "**/presentations/index.ts"
32
- ];
33
- const DEFAULT_IGNORES = [
34
- "node_modules/**",
35
- "dist/**",
36
- ".turbo/**"
37
- ];
38
- /**
39
- * Create a Node.js filesystem adapter.
40
- */
41
- function createNodeFsAdapter(cwd) {
42
- const baseCwd = cwd ?? process.cwd();
43
- return {
44
- async exists(path) {
45
- try {
46
- await access(resolvePath(path));
47
- return true;
48
- } catch {
49
- return false;
50
- }
51
- },
52
- async readFile(path) {
53
- return readFile(resolvePath(path), "utf-8");
54
- },
55
- async writeFile(path, content) {
56
- const fullPath = resolvePath(path);
57
- await mkdir(dirname(fullPath), { recursive: true });
58
- await writeFile(fullPath, content, "utf-8");
59
- },
60
- async remove(path) {
61
- await rm(resolvePath(path), {
62
- recursive: true,
63
- force: true
64
- });
65
- },
66
- async stat(path) {
67
- const stats = await stat(resolvePath(path));
68
- return {
69
- size: stats.size,
70
- isFile: stats.isFile(),
71
- isDirectory: stats.isDirectory(),
72
- mtime: stats.mtime
73
- };
74
- },
75
- async mkdir(path) {
76
- await mkdir(resolvePath(path), { recursive: true });
77
- },
78
- async glob(options) {
79
- const patterns = options.patterns ?? (options.pattern ? [options.pattern] : DEFAULT_SPEC_PATTERNS);
80
- const ignore = options.ignore ?? DEFAULT_IGNORES;
81
- const globCwd = options.cwd ?? baseCwd;
82
- const absolute = options.absolute ?? true;
83
- const all = [];
84
- for (const pattern of patterns) {
85
- const matches = await glob(pattern, {
86
- cwd: globCwd,
87
- ignore,
88
- absolute
89
- });
90
- all.push(...matches);
91
- }
92
- return Array.from(new Set(all)).sort((a, b) => a.localeCompare(b));
93
- },
94
- resolve(...paths) {
95
- const [first, ...rest] = paths;
96
- if (!first) return baseCwd;
97
- return resolve(baseCwd, first, ...rest);
98
- },
99
- dirname(path) {
100
- return dirname(path);
101
- },
102
- basename(path) {
103
- return basename(path);
104
- },
105
- join(...paths) {
106
- return join(...paths);
107
- },
108
- relative(from, to) {
109
- return relative(from, to);
110
- }
111
- };
112
- function resolvePath(path) {
113
- return isAbsolute(path) ? path : resolve(baseCwd, path);
114
- }
115
- }
116
-
117
- //#endregion
118
- export { createNodeFsAdapter };
1
+ import{access as e,mkdir as t,readFile as n,rm as r,stat as i,writeFile as a}from"node:fs/promises";import{basename as o,dirname as s,isAbsolute as c,join as l,relative as u,resolve as d}from"node:path";import{glob as f}from"glob";const p=[`**/*.contracts.ts`,`**/*.event.ts`,`**/*.presentation.ts`,`**/*.feature.ts`,`**/*.capability.ts`,`**/*.workflow.ts`,`**/*.data-view.ts`,`**/*.form.ts`,`**/*.migration.ts`,`**/*.telemetry.ts`,`**/*.experiment.ts`,`**/*.app-config.ts`,`**/*.integration.ts`,`**/*.knowledge.ts`,`**/*.policy.ts`,`**/*.test-spec.ts`,`**/contracts/*.ts`,`**/contracts/index.ts`,`**/events.ts`,`**/presentations.ts`,`**/events/index.ts`,`**/presentations/index.ts`],m=[`node_modules/**`,`dist/**`,`.turbo/**`];function h(h){let g=h??process.cwd();return{async exists(t){try{return await e(_(t)),!0}catch{return!1}},async readFile(e){return n(_(e),`utf-8`)},async writeFile(e,n){let r=_(e);await t(s(r),{recursive:!0}),await a(r,n,`utf-8`)},async remove(e){await r(_(e),{recursive:!0,force:!0})},async stat(e){let t=await i(_(e));return{size:t.size,isFile:t.isFile(),isDirectory:t.isDirectory(),mtime:t.mtime}},async mkdir(e){await t(_(e),{recursive:!0})},async glob(e){let t=e.patterns??(e.pattern?[e.pattern]:p),n=e.ignore??m,r=e.cwd??g,i=e.absolute??!0,a=[];for(let e of t){let t=await f(e,{cwd:r,ignore:n,absolute:i});a.push(...t)}return Array.from(new Set(a)).sort((e,t)=>e.localeCompare(t))},resolve(...e){let[t,...n]=e;return t?d(g,t,...n):g},dirname(e){return s(e)},basename(e){return o(e)},join(...e){return l(...e)},relative(e,t){return u(e,t)}};function _(e){return c(e)?e:d(g,e)}}export{h as createNodeFsAdapter};
@@ -1,54 +1 @@
1
- import { access } from "node:fs/promises";
2
- import { resolve } from "node:path";
3
- import { execSync } from "node:child_process";
4
-
5
- //#region src/adapters/git.ts
6
- /**
7
- * Node.js git adapter implementation.
8
- */
9
- /**
10
- * Create a Node.js git adapter.
11
- */
12
- function createNodeGitAdapter(cwd) {
13
- const baseCwd = cwd ?? process.cwd();
14
- return {
15
- async showFile(ref, filePath) {
16
- try {
17
- return execSync(`git show ${ref}:${filePath}`, {
18
- cwd: baseCwd,
19
- encoding: "utf-8",
20
- stdio: [
21
- "ignore",
22
- "pipe",
23
- "pipe"
24
- ]
25
- });
26
- } catch (error) {
27
- throw new Error(`Could not load ${filePath} at ref ${ref}: ${error instanceof Error ? error.message : String(error)}`);
28
- }
29
- },
30
- async clean(options) {
31
- const flags = [];
32
- if (options?.force) flags.push("-f");
33
- if (options?.directories) flags.push("-d");
34
- if (options?.ignored) flags.push("-x");
35
- if (options?.dryRun) flags.push("--dry-run");
36
- execSync(`git clean ${flags.join(" ")}`, {
37
- cwd: baseCwd,
38
- stdio: "inherit"
39
- });
40
- },
41
- async isGitRepo(path) {
42
- const targetPath = path ? resolve(baseCwd, path) : baseCwd;
43
- try {
44
- await access(resolve(targetPath, ".git"));
45
- return true;
46
- } catch {
47
- return false;
48
- }
49
- }
50
- };
51
- }
52
-
53
- //#endregion
54
- export { createNodeGitAdapter };
1
+ import{access as e}from"node:fs/promises";import{resolve as t}from"node:path";import{execSync as n}from"node:child_process";function r(r){let i=r??process.cwd();return{async showFile(e,t){try{return n(`git show ${e}:${t}`,{cwd:i,encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`]})}catch(n){throw Error(`Could not load ${t} at ref ${e}: ${n instanceof Error?n.message:String(n)}`)}},async clean(e){let t=[];e?.force&&t.push(`-f`),e?.directories&&t.push(`-d`),e?.ignored&&t.push(`-x`),e?.dryRun&&t.push(`--dry-run`),n(`git clean ${t.join(` `)}`,{cwd:i,stdio:`inherit`})},async isGitRepo(n){let r=n?t(i,n):i;try{return await e(t(r,`.git`)),!0}catch{return!1}}}}export{r as createNodeGitAdapter};
@@ -1,7 +1 @@
1
- import { createNodeFsAdapter } from "./fs.js";
2
- import { createNodeGitAdapter } from "./git.js";
3
- import { createNodeWatcherAdapter } from "./watcher.js";
4
- import { createNodeAiAdapter } from "./ai.js";
5
- import { createConsoleLoggerAdapter, createNoopLoggerAdapter } from "./logger.js";
6
- import { createNodeAdapters } from "./factory.js";
7
- import { detectPackageManager, findPackageRoot, findWorkspaceRoot, getExecCommand, getInstallCommand, getPackageName, getRunCommand, getWorkspaceInfo, getWorkspacePackages, isMonorepo } from "./workspace.js";
1
+ import{createNodeFsAdapter as e}from"./fs.js";import{createNodeGitAdapter as t}from"./git.js";import{createNodeWatcherAdapter as n}from"./watcher.js";import{createNodeAiAdapter as r}from"./ai.js";import{createConsoleLoggerAdapter as i,createNoopLoggerAdapter as a}from"./logger.js";import{createNodeAdapters as o}from"./factory.js";import{detectPackageManager as s,findPackageRoot as c,findWorkspaceRoot as l,getExecCommand as u,getInstallCommand as d,getPackageName as f,getRunCommand as p,getWorkspaceInfo as m,getWorkspacePackages as h,isMonorepo as g}from"./workspace.js";
@@ -1,80 +1 @@
1
- //#region src/adapters/logger.ts
2
- /**
3
- * Create a console-based logger adapter.
4
- * This is a basic implementation - CLI apps should inject their own
5
- * logger with chalk/ora for better terminal output.
6
- */
7
- function createConsoleLoggerAdapter() {
8
- return {
9
- debug(message, data) {
10
- if (process.env["DEBUG"]) console.debug(`[DEBUG] ${message}`, data ?? "");
11
- },
12
- info(message, data) {
13
- console.info(`[INFO] ${message}`, data ?? "");
14
- },
15
- warn(message, data) {
16
- console.warn(`[WARN] ${message}`, data ?? "");
17
- },
18
- error(message, data) {
19
- console.error(`[ERROR] ${message}`, data ?? "");
20
- },
21
- createProgress() {
22
- return createConsoleProgressReporter();
23
- }
24
- };
25
- }
26
- /**
27
- * Create a no-op logger adapter.
28
- * Useful for testing or when logging is not desired.
29
- */
30
- function createNoopLoggerAdapter() {
31
- const noop = () => {};
32
- return {
33
- debug: noop,
34
- info: noop,
35
- warn: noop,
36
- error: noop,
37
- createProgress: createNoopProgressReporter
38
- };
39
- }
40
- /**
41
- * Create a console-based progress reporter.
42
- */
43
- function createConsoleProgressReporter() {
44
- return {
45
- start(message) {
46
- console.log(`⏳ ${message}`);
47
- },
48
- update(update) {
49
- const progress = update.current !== void 0 && update.total !== void 0 ? ` (${update.current}/${update.total})` : "";
50
- console.log(` ${update.message}${progress}`);
51
- },
52
- succeed(message) {
53
- console.log(`✅ ${message ?? "Done"}`);
54
- },
55
- fail(message) {
56
- console.error(`❌ ${message ?? "Failed"}`);
57
- },
58
- warn(message) {
59
- console.warn(`⚠️ ${message ?? "Warning"}`);
60
- },
61
- stop() {}
62
- };
63
- }
64
- /**
65
- * Create a no-op progress reporter.
66
- */
67
- function createNoopProgressReporter() {
68
- const noop = () => {};
69
- return {
70
- start: noop,
71
- update: noop,
72
- succeed: noop,
73
- fail: noop,
74
- warn: noop,
75
- stop: noop
76
- };
77
- }
78
-
79
- //#endregion
80
- export { createConsoleLoggerAdapter, createNoopLoggerAdapter };
1
+ function e(){return{debug(e,t){process.env.DEBUG&&console.debug(`[DEBUG] ${e}`,t??``)},info(e,t){console.info(`[INFO] ${e}`,t??``)},warn(e,t){console.warn(`[WARN] ${e}`,t??``)},error(e,t){console.error(`[ERROR] ${e}`,t??``)},createProgress(){return n()}}}function t(){let e=()=>{};return{debug:e,info:e,warn:e,error:e,createProgress:r}}function n(){return{start(e){console.log(`⏳ ${e}`)},update(e){let t=e.current!==void 0&&e.total!==void 0?` (${e.current}/${e.total})`:``;console.log(` ${e.message}${t}`)},succeed(e){console.log(`✅ ${e??`Done`}`)},fail(e){console.error(`❌ ${e??`Failed`}`)},warn(e){console.warn(`⚠️ ${e??`Warning`}`)},stop(){}}}function r(){let e=()=>{};return{start:e,update:e,succeed:e,fail:e,warn:e,stop:e}}export{e as createConsoleLoggerAdapter,t as createNoopLoggerAdapter};
@@ -1,69 +1 @@
1
- import chokidar from "chokidar";
2
-
3
- //#region src/adapters/watcher.ts
4
- /**
5
- * Node.js file watcher adapter implementation using chokidar.
6
- */
7
- const DEFAULT_IGNORES = [
8
- "node_modules/**",
9
- "dist/**",
10
- ".turbo/**"
11
- ];
12
- /**
13
- * Create a Node.js file watcher adapter using chokidar.
14
- */
15
- function createNodeWatcherAdapter(cwd) {
16
- const baseCwd = cwd ?? process.cwd();
17
- return { watch(options) {
18
- const handlers = [];
19
- let debounceTimer;
20
- const watcher = chokidar.watch(options.pattern, {
21
- cwd: baseCwd,
22
- ignored: options.ignore ?? DEFAULT_IGNORES,
23
- persistent: true,
24
- ignoreInitial: true,
25
- awaitWriteFinish: {
26
- stabilityThreshold: 250,
27
- pollInterval: 50
28
- }
29
- });
30
- const emitEvent = (event) => {
31
- if (options.debounceMs && options.debounceMs > 0) {
32
- clearTimeout(debounceTimer);
33
- debounceTimer = setTimeout(() => {
34
- handlers.forEach((handler) => handler(event));
35
- }, options.debounceMs);
36
- } else handlers.forEach((handler) => handler(event));
37
- };
38
- watcher.on("add", (path) => {
39
- emitEvent({
40
- type: "add",
41
- path
42
- });
43
- });
44
- watcher.on("change", (path) => {
45
- emitEvent({
46
- type: "change",
47
- path
48
- });
49
- });
50
- watcher.on("unlink", (path) => {
51
- emitEvent({
52
- type: "unlink",
53
- path
54
- });
55
- });
56
- return {
57
- on(handler) {
58
- handlers.push(handler);
59
- },
60
- async close() {
61
- clearTimeout(debounceTimer);
62
- await watcher.close();
63
- }
64
- };
65
- } };
66
- }
67
-
68
- //#endregion
69
- export { createNodeWatcherAdapter };
1
+ import e from"chokidar";const t=[`node_modules/**`,`dist/**`,`.turbo/**`];function n(n){let r=n??process.cwd();return{watch(n){let i=[],a,o=e.watch(n.pattern,{cwd:r,ignored:n.ignore??t,persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:250,pollInterval:50}}),s=e=>{n.debounceMs&&n.debounceMs>0?(clearTimeout(a),a=setTimeout(()=>{i.forEach(t=>t(e))},n.debounceMs)):i.forEach(t=>t(e))};return o.on(`add`,e=>{s({type:`add`,path:e})}),o.on(`change`,e=>{s({type:`change`,path:e})}),o.on(`unlink`,e=>{s({type:`unlink`,path:e})}),{on(e){i.push(e)},async close(){clearTimeout(a),await o.close()}}}}}export{n as createNodeWatcherAdapter};
@@ -1,190 +1,2 @@
1
- import { dirname, join, resolve } from "node:path";
2
- import { existsSync, readFileSync } from "node:fs";
3
-
4
- //#region src/adapters/workspace.ts
5
- /**
6
- * Workspace and monorepo detection utilities.
7
- *
8
- * Provides utilities for detecting workspace roots, package managers,
9
- * and monorepo configurations across Bun, pnpm, Yarn, and npm.
10
- */
11
- /**
12
- * Lock files and their corresponding package managers.
13
- */
14
- const LOCK_FILES = {
15
- "bun.lockb": "bun",
16
- "bun.lock": "bun",
17
- "pnpm-lock.yaml": "pnpm",
18
- "yarn.lock": "yarn",
19
- "package-lock.json": "npm"
20
- };
21
- /**
22
- * Monorepo indicator files.
23
- */
24
- const MONOREPO_FILES = [
25
- "pnpm-workspace.yaml",
26
- "lerna.json",
27
- "nx.json",
28
- "turbo.json",
29
- "rush.json"
30
- ];
31
- /**
32
- * Find the nearest directory containing a package.json.
33
- */
34
- function findPackageRoot(startDir = process.cwd()) {
35
- let current = resolve(startDir);
36
- while (true) {
37
- if (existsSync(join(current, "package.json"))) return current;
38
- const parent = dirname(current);
39
- if (parent === current) break;
40
- current = parent;
41
- }
42
- return startDir;
43
- }
44
- /**
45
- * Find the workspace root (monorepo root or single package root).
46
- *
47
- * Walks up the directory tree looking for:
48
- * 1. pnpm-workspace.yaml (pnpm monorepo)
49
- * 2. package.json with "workspaces" field (yarn/npm/bun monorepo)
50
- * 3. Lock files (bun.lockb, pnpm-lock.yaml, yarn.lock, package-lock.json)
51
- */
52
- function findWorkspaceRoot(startDir = process.cwd()) {
53
- let current = resolve(startDir);
54
- let lastPackageJson = null;
55
- while (true) {
56
- for (const file of MONOREPO_FILES) if (existsSync(join(current, file))) return current;
57
- const pkgPath = join(current, "package.json");
58
- if (existsSync(pkgPath)) {
59
- lastPackageJson = current;
60
- try {
61
- if (JSON.parse(readFileSync(pkgPath, "utf-8")).workspaces) return current;
62
- } catch {}
63
- }
64
- for (const lockFile of Object.keys(LOCK_FILES)) if (existsSync(join(current, lockFile))) return current;
65
- const parent = dirname(current);
66
- if (parent === current) break;
67
- current = parent;
68
- }
69
- return lastPackageJson ?? startDir;
70
- }
71
- /**
72
- * Detect the package manager in use.
73
- *
74
- * Priority:
75
- * 1. Lock file presence (most reliable)
76
- * 2. packageManager field in package.json
77
- * 3. COREPACK_ROOT environment variable
78
- * 4. Default to npm
79
- */
80
- function detectPackageManager(workspaceRoot = process.cwd()) {
81
- for (const pm of [
82
- "bun",
83
- "pnpm",
84
- "yarn",
85
- "npm"
86
- ]) {
87
- const lockFiles = Object.entries(LOCK_FILES).filter(([, manager]) => manager === pm);
88
- for (const [lockFile] of lockFiles) if (existsSync(join(workspaceRoot, lockFile))) return pm;
89
- }
90
- const pkgPath = join(workspaceRoot, "package.json");
91
- if (existsSync(pkgPath)) try {
92
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
93
- if (pkg.packageManager) {
94
- const match = pkg.packageManager.match(/^(bun|pnpm|yarn|npm)@/);
95
- if (match) return match[1];
96
- }
97
- } catch {}
98
- if (process.env.BUN_INSTALL || typeof globalThis.Bun !== "undefined") return "bun";
99
- return "npm";
100
- }
101
- /**
102
- * Check if the workspace is a monorepo.
103
- */
104
- function isMonorepo(workspaceRoot = process.cwd()) {
105
- for (const file of MONOREPO_FILES) if (existsSync(join(workspaceRoot, file))) return true;
106
- const pkgPath = join(workspaceRoot, "package.json");
107
- if (existsSync(pkgPath)) try {
108
- if (JSON.parse(readFileSync(pkgPath, "utf-8")).workspaces) return true;
109
- } catch {}
110
- return false;
111
- }
112
- /**
113
- * Get workspace package patterns from package.json or pnpm-workspace.yaml.
114
- */
115
- function getWorkspacePackages(workspaceRoot) {
116
- const pnpmWorkspacePath = join(workspaceRoot, "pnpm-workspace.yaml");
117
- if (existsSync(pnpmWorkspacePath)) try {
118
- const match = readFileSync(pnpmWorkspacePath, "utf-8").match(/packages:\s*\n((?:\s+-\s+['"]?[^\n]+['"]?\n?)+)/);
119
- if (match?.[1]) return match[1].split("\n").map((line) => line.replace(/^\s+-\s+['"]?|['"]?\s*$/g, "")).filter(Boolean);
120
- } catch {}
121
- const pkgPath = join(workspaceRoot, "package.json");
122
- if (existsSync(pkgPath)) try {
123
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
124
- if (Array.isArray(pkg.workspaces)) return pkg.workspaces;
125
- if (pkg.workspaces?.packages && Array.isArray(pkg.workspaces.packages)) return pkg.workspaces.packages;
126
- } catch {}
127
- }
128
- /**
129
- * Get package name from package.json.
130
- */
131
- function getPackageName(packageRoot) {
132
- const pkgPath = join(packageRoot, "package.json");
133
- if (existsSync(pkgPath)) try {
134
- return JSON.parse(readFileSync(pkgPath, "utf-8")).name;
135
- } catch {}
136
- }
137
- /**
138
- * Get complete workspace information.
139
- */
140
- function getWorkspaceInfo(startDir = process.cwd()) {
141
- const packageRoot = findPackageRoot(startDir);
142
- const workspaceRoot = findWorkspaceRoot(startDir);
143
- const packageManager = detectPackageManager(workspaceRoot);
144
- const isMonorepoWorkspace = isMonorepo(workspaceRoot);
145
- return {
146
- packageManager,
147
- workspaceRoot,
148
- packageRoot,
149
- isMonorepo: isMonorepoWorkspace,
150
- packages: isMonorepoWorkspace ? getWorkspacePackages(workspaceRoot) : void 0,
151
- packageName: getPackageName(packageRoot)
152
- };
153
- }
154
- /**
155
- * Get the run command for the detected package manager.
156
- */
157
- function getRunCommand(packageManager, script) {
158
- switch (packageManager) {
159
- case "bun": return `bun run ${script}`;
160
- case "pnpm": return `pnpm run ${script}`;
161
- case "yarn": return `yarn ${script}`;
162
- case "npm": return `npm run ${script}`;
163
- }
164
- }
165
- /**
166
- * Get the exec command for the detected package manager.
167
- */
168
- function getExecCommand(packageManager, command) {
169
- switch (packageManager) {
170
- case "bun": return `bunx ${command}`;
171
- case "pnpm": return `pnpm exec ${command}`;
172
- case "yarn": return `yarn ${command}`;
173
- case "npm": return `npx ${command}`;
174
- }
175
- }
176
- /**
177
- * Get the install command for the detected package manager.
178
- */
179
- function getInstallCommand(packageManager, isDev = false) {
180
- const devFlag = isDev ? packageManager === "npm" ? "--save-dev" : "-D" : "";
181
- switch (packageManager) {
182
- case "bun": return `bun add ${devFlag}`.trim();
183
- case "pnpm": return `pnpm add ${devFlag}`.trim();
184
- case "yarn": return `yarn add ${devFlag}`.trim();
185
- case "npm": return `npm install ${devFlag}`.trim();
186
- }
187
- }
188
-
189
- //#endregion
190
- export { detectPackageManager, findPackageRoot, findWorkspaceRoot, getExecCommand, getInstallCommand, getPackageName, getRunCommand, getWorkspaceInfo, getWorkspacePackages, isMonorepo };
1
+ import{dirname as e,join as t,resolve as n}from"node:path";import{existsSync as r,readFileSync as i}from"node:fs";const a={"bun.lockb":`bun`,"bun.lock":`bun`,"pnpm-lock.yaml":`pnpm`,"yarn.lock":`yarn`,"package-lock.json":`npm`},o=[`pnpm-workspace.yaml`,`lerna.json`,`nx.json`,`turbo.json`,`rush.json`];function s(i=process.cwd()){let a=n(i);for(;;){if(r(t(a,`package.json`)))return a;let n=e(a);if(n===a)break;a=n}return i}function c(s=process.cwd()){let c=n(s),l=null;for(;;){for(let e of o)if(r(t(c,e)))return c;let n=t(c,`package.json`);if(r(n)){l=c;try{if(JSON.parse(i(n,`utf-8`)).workspaces)return c}catch{}}for(let e of Object.keys(a))if(r(t(c,e)))return c;let s=e(c);if(s===c)break;c=s}return l??s}function l(e=process.cwd()){for(let n of[`bun`,`pnpm`,`yarn`,`npm`]){let i=Object.entries(a).filter(([,e])=>e===n);for(let[a]of i)if(r(t(e,a)))return n}let n=t(e,`package.json`);if(r(n))try{let e=JSON.parse(i(n,`utf-8`));if(e.packageManager){let t=e.packageManager.match(/^(bun|pnpm|yarn|npm)@/);if(t)return t[1]}}catch{}return process.env.BUN_INSTALL||globalThis.Bun!==void 0?`bun`:`npm`}function u(e=process.cwd()){for(let n of o)if(r(t(e,n)))return!0;let n=t(e,`package.json`);if(r(n))try{if(JSON.parse(i(n,`utf-8`)).workspaces)return!0}catch{}return!1}function d(e){let n=t(e,`pnpm-workspace.yaml`);if(r(n))try{let e=i(n,`utf-8`).match(/packages:\s*\n((?:\s+-\s+['"]?[^\n]+['"]?\n?)+)/);if(e?.[1])return e[1].split(`
2
+ `).map(e=>e.replace(/^\s+-\s+['"]?|['"]?\s*$/g,``)).filter(Boolean)}catch{}let a=t(e,`package.json`);if(r(a))try{let e=JSON.parse(i(a,`utf-8`));if(Array.isArray(e.workspaces))return e.workspaces;if(e.workspaces?.packages&&Array.isArray(e.workspaces.packages))return e.workspaces.packages}catch{}}function f(e){let n=t(e,`package.json`);if(r(n))try{return JSON.parse(i(n,`utf-8`)).name}catch{}}function p(e=process.cwd()){let t=s(e),n=c(e),r=l(n),i=u(n);return{packageManager:r,workspaceRoot:n,packageRoot:t,isMonorepo:i,packages:i?d(n):void 0,packageName:f(t)}}function m(e,t){switch(e){case`bun`:return`bun run ${t}`;case`pnpm`:return`pnpm run ${t}`;case`yarn`:return`yarn ${t}`;case`npm`:return`npm run ${t}`}}function h(e,t){switch(e){case`bun`:return`bunx ${t}`;case`pnpm`:return`pnpm exec ${t}`;case`yarn`:return`yarn ${t}`;case`npm`:return`npx ${t}`}}function g(e,t=!1){let n=t?e===`npm`?`--save-dev`:`-D`:``;switch(e){case`bun`:return`bun add ${n}`.trim();case`pnpm`:return`pnpm add ${n}`.trim();case`yarn`:return`yarn add ${n}`.trim();case`npm`:return`npm install ${n}`.trim()}}export{l as detectPackageManager,s as findPackageRoot,c as findWorkspaceRoot,h as getExecCommand,g as getInstallCommand,f as getPackageName,m as getRunCommand,p as getWorkspaceInfo,d as getWorkspacePackages,u as isMonorepo};