@auto-engineer/narrative 0.11.11

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 (541) hide show
  1. package/.turbo/turbo-build.log +9 -0
  2. package/.turbo/turbo-format.log +4 -0
  3. package/.turbo/turbo-lint.log +4 -0
  4. package/.turbo/turbo-test.log +14 -0
  5. package/.turbo/turbo-type-check.log +4 -0
  6. package/CHANGELOG.md +691 -0
  7. package/DEBUG.md +136 -0
  8. package/LICENSE +10 -0
  9. package/README.md +141 -0
  10. package/dist/scripts/build.d.ts +3 -0
  11. package/dist/scripts/build.d.ts.map +1 -0
  12. package/dist/scripts/build.js +71 -0
  13. package/dist/scripts/build.js.map +1 -0
  14. package/dist/scripts/convert-flow-exec.d.ts +3 -0
  15. package/dist/scripts/convert-flow-exec.d.ts.map +1 -0
  16. package/dist/scripts/convert-flow-exec.js +17 -0
  17. package/dist/scripts/convert-flow-exec.js.map +1 -0
  18. package/dist/scripts/convert-flow-helper.d.ts +3 -0
  19. package/dist/scripts/convert-flow-helper.d.ts.map +1 -0
  20. package/dist/scripts/convert-flow-helper.js +85 -0
  21. package/dist/scripts/convert-flow-helper.js.map +1 -0
  22. package/dist/scripts/convert-flow.d.ts +3 -0
  23. package/dist/scripts/convert-flow.d.ts.map +1 -0
  24. package/dist/scripts/convert-flow.js +108 -0
  25. package/dist/scripts/convert-flow.js.map +1 -0
  26. package/dist/scripts/print-schema.d.ts +2 -0
  27. package/dist/scripts/print-schema.d.ts.map +1 -0
  28. package/dist/scripts/print-schema.js +20 -0
  29. package/dist/scripts/print-schema.js.map +1 -0
  30. package/dist/src/commands/export-schema-helper.d.ts +2 -0
  31. package/dist/src/commands/export-schema-helper.d.ts.map +1 -0
  32. package/dist/src/commands/export-schema-helper.js +48 -0
  33. package/dist/src/commands/export-schema-helper.js.map +1 -0
  34. package/dist/src/commands/export-schema-runner.d.ts +3 -0
  35. package/dist/src/commands/export-schema-runner.d.ts.map +1 -0
  36. package/dist/src/commands/export-schema-runner.js +53 -0
  37. package/dist/src/commands/export-schema-runner.js.map +1 -0
  38. package/dist/src/commands/export-schema.d.ts +23 -0
  39. package/dist/src/commands/export-schema.d.ts.map +1 -0
  40. package/dist/src/commands/export-schema.js +124 -0
  41. package/dist/src/commands/export-schema.js.map +1 -0
  42. package/dist/src/commands/filestore.node.d.ts +3 -0
  43. package/dist/src/commands/filestore.node.d.ts.map +1 -0
  44. package/dist/src/commands/filestore.node.js +11 -0
  45. package/dist/src/commands/filestore.node.js.map +1 -0
  46. package/dist/src/data-flow-builders.d.ts +71 -0
  47. package/dist/src/data-flow-builders.d.ts.map +1 -0
  48. package/dist/src/data-flow-builders.js +326 -0
  49. package/dist/src/data-flow-builders.js.map +1 -0
  50. package/dist/src/data-narrative-builders.d.ts +71 -0
  51. package/dist/src/data-narrative-builders.d.ts.map +1 -0
  52. package/dist/src/data-narrative-builders.js +326 -0
  53. package/dist/src/data-narrative-builders.js.map +1 -0
  54. package/dist/src/flow-context.d.ts +25 -0
  55. package/dist/src/flow-context.d.ts.map +1 -0
  56. package/dist/src/flow-context.js +579 -0
  57. package/dist/src/flow-context.js.map +1 -0
  58. package/dist/src/flow-context.specs.d.ts +2 -0
  59. package/dist/src/flow-context.specs.d.ts.map +1 -0
  60. package/dist/src/flow-context.specs.js +185 -0
  61. package/dist/src/flow-context.specs.js.map +1 -0
  62. package/dist/src/flow-registry.d.ts +12 -0
  63. package/dist/src/flow-registry.d.ts.map +1 -0
  64. package/dist/src/flow-registry.js +46 -0
  65. package/dist/src/flow-registry.js.map +1 -0
  66. package/dist/src/flow.d.ts +49 -0
  67. package/dist/src/flow.d.ts.map +1 -0
  68. package/dist/src/flow.js +146 -0
  69. package/dist/src/flow.js.map +1 -0
  70. package/dist/src/fluent-builder.d.ts +35 -0
  71. package/dist/src/fluent-builder.d.ts.map +1 -0
  72. package/dist/src/fluent-builder.js +287 -0
  73. package/dist/src/fluent-builder.js.map +1 -0
  74. package/dist/src/fluent-builder.specs.d.ts +2 -0
  75. package/dist/src/fluent-builder.specs.d.ts.map +1 -0
  76. package/dist/src/fluent-builder.specs.js +28 -0
  77. package/dist/src/fluent-builder.specs.js.map +1 -0
  78. package/dist/src/getFlows.cache.specs.d.ts +2 -0
  79. package/dist/src/getFlows.cache.specs.d.ts.map +1 -0
  80. package/dist/src/getFlows.cache.specs.js +234 -0
  81. package/dist/src/getFlows.cache.specs.js.map +1 -0
  82. package/dist/src/getFlows.d.ts +21 -0
  83. package/dist/src/getFlows.d.ts.map +1 -0
  84. package/dist/src/getFlows.js +119 -0
  85. package/dist/src/getFlows.js.map +1 -0
  86. package/dist/src/getFlows.specs.d.ts +2 -0
  87. package/dist/src/getFlows.specs.d.ts.map +1 -0
  88. package/dist/src/getFlows.specs.js +1080 -0
  89. package/dist/src/getFlows.specs.js.map +1 -0
  90. package/dist/src/getNarratives.d.ts +21 -0
  91. package/dist/src/getNarratives.d.ts.map +1 -0
  92. package/dist/src/getNarratives.js +119 -0
  93. package/dist/src/getNarratives.js.map +1 -0
  94. package/dist/src/id/addAutoIds.d.ts +3 -0
  95. package/dist/src/id/addAutoIds.d.ts.map +1 -0
  96. package/dist/src/id/addAutoIds.js +47 -0
  97. package/dist/src/id/addAutoIds.js.map +1 -0
  98. package/dist/src/id/addAutoIds.specs.d.ts +2 -0
  99. package/dist/src/id/addAutoIds.specs.d.ts.map +1 -0
  100. package/dist/src/id/addAutoIds.specs.js +265 -0
  101. package/dist/src/id/addAutoIds.specs.js.map +1 -0
  102. package/dist/src/id/generators.d.ts +2 -0
  103. package/dist/src/id/generators.d.ts.map +1 -0
  104. package/dist/src/id/generators.js +5 -0
  105. package/dist/src/id/generators.js.map +1 -0
  106. package/dist/src/id/hasAllIds.d.ts +3 -0
  107. package/dist/src/id/hasAllIds.d.ts.map +1 -0
  108. package/dist/src/id/hasAllIds.js +19 -0
  109. package/dist/src/id/hasAllIds.js.map +1 -0
  110. package/dist/src/id/hasAllIds.specs.d.ts +2 -0
  111. package/dist/src/id/hasAllIds.specs.d.ts.map +1 -0
  112. package/dist/src/id/hasAllIds.specs.js +231 -0
  113. package/dist/src/id/hasAllIds.specs.js.map +1 -0
  114. package/dist/src/id/index.d.ts +3 -0
  115. package/dist/src/id/index.d.ts.map +1 -0
  116. package/dist/src/id/index.js +3 -0
  117. package/dist/src/id/index.js.map +1 -0
  118. package/dist/src/index.d.ts +45 -0
  119. package/dist/src/index.d.ts.map +1 -0
  120. package/dist/src/index.js +31 -0
  121. package/dist/src/index.js.map +1 -0
  122. package/dist/src/integration-export-registry.d.ts +42 -0
  123. package/dist/src/integration-export-registry.d.ts.map +1 -0
  124. package/dist/src/integration-export-registry.js +74 -0
  125. package/dist/src/integration-export-registry.js.map +1 -0
  126. package/dist/src/integration-registry.d.ts +12 -0
  127. package/dist/src/integration-registry.d.ts.map +1 -0
  128. package/dist/src/integration-registry.js +42 -0
  129. package/dist/src/integration-registry.js.map +1 -0
  130. package/dist/src/loader/fs-path.d.ts +6 -0
  131. package/dist/src/loader/fs-path.d.ts.map +1 -0
  132. package/dist/src/loader/fs-path.js +28 -0
  133. package/dist/src/loader/fs-path.js.map +1 -0
  134. package/dist/src/loader/graph.d.ts +15 -0
  135. package/dist/src/loader/graph.d.ts.map +1 -0
  136. package/dist/src/loader/graph.js +292 -0
  137. package/dist/src/loader/graph.js.map +1 -0
  138. package/dist/src/loader/importmap.d.ts +2 -0
  139. package/dist/src/loader/importmap.d.ts.map +1 -0
  140. package/dist/src/loader/importmap.js +55 -0
  141. package/dist/src/loader/importmap.js.map +1 -0
  142. package/dist/src/loader/index.d.ts +9 -0
  143. package/dist/src/loader/index.d.ts.map +1 -0
  144. package/dist/src/loader/index.js +55 -0
  145. package/dist/src/loader/index.js.map +1 -0
  146. package/dist/src/loader/resolver.d.ts +4 -0
  147. package/dist/src/loader/resolver.d.ts.map +1 -0
  148. package/dist/src/loader/resolver.js +18 -0
  149. package/dist/src/loader/resolver.js.map +1 -0
  150. package/dist/src/loader/runtime-cjs.d.ts +3 -0
  151. package/dist/src/loader/runtime-cjs.d.ts.map +1 -0
  152. package/dist/src/loader/runtime-cjs.js +131 -0
  153. package/dist/src/loader/runtime-cjs.js.map +1 -0
  154. package/dist/src/loader/ts-utils.d.ts +39 -0
  155. package/dist/src/loader/ts-utils.d.ts.map +1 -0
  156. package/dist/src/loader/ts-utils.js +563 -0
  157. package/dist/src/loader/ts-utils.js.map +1 -0
  158. package/dist/src/loader/types.d.ts +23 -0
  159. package/dist/src/loader/types.d.ts.map +1 -0
  160. package/dist/src/loader/types.js +2 -0
  161. package/dist/src/loader/types.js.map +1 -0
  162. package/dist/src/loader/vfs-compiler-host.d.ts +5 -0
  163. package/dist/src/loader/vfs-compiler-host.d.ts.map +1 -0
  164. package/dist/src/loader/vfs-compiler-host.js +47 -0
  165. package/dist/src/loader/vfs-compiler-host.js.map +1 -0
  166. package/dist/src/model-to-flow.specs.d.ts +2 -0
  167. package/dist/src/model-to-flow.specs.d.ts.map +1 -0
  168. package/dist/src/model-to-flow.specs.js +1786 -0
  169. package/dist/src/model-to-flow.specs.js.map +1 -0
  170. package/dist/src/narrative-context.d.ts +25 -0
  171. package/dist/src/narrative-context.d.ts.map +1 -0
  172. package/dist/src/narrative-context.js +579 -0
  173. package/dist/src/narrative-context.js.map +1 -0
  174. package/dist/src/narrative-context.specs.d.ts +2 -0
  175. package/dist/src/narrative-context.specs.d.ts.map +1 -0
  176. package/dist/src/narrative-context.specs.js +185 -0
  177. package/dist/src/narrative-context.specs.js.map +1 -0
  178. package/dist/src/narrative-registry.d.ts +12 -0
  179. package/dist/src/narrative-registry.d.ts.map +1 -0
  180. package/dist/src/narrative-registry.js +46 -0
  181. package/dist/src/narrative-registry.js.map +1 -0
  182. package/dist/src/narrative.d.ts +49 -0
  183. package/dist/src/narrative.d.ts.map +1 -0
  184. package/dist/src/narrative.js +147 -0
  185. package/dist/src/narrative.js.map +1 -0
  186. package/dist/src/samples/items.flow.d.ts +2 -0
  187. package/dist/src/samples/items.flow.d.ts.map +1 -0
  188. package/dist/src/samples/items.flow.js +63 -0
  189. package/dist/src/samples/items.flow.js.map +1 -0
  190. package/dist/src/samples/mixed-given-types.flow.d.ts +2 -0
  191. package/dist/src/samples/mixed-given-types.flow.d.ts.map +1 -0
  192. package/dist/src/samples/mixed-given-types.flow.js +36 -0
  193. package/dist/src/samples/mixed-given-types.flow.js.map +1 -0
  194. package/dist/src/samples/place-order.flow.d.ts +25 -0
  195. package/dist/src/samples/place-order.flow.d.ts.map +1 -0
  196. package/dist/src/samples/place-order.flow.js +30 -0
  197. package/dist/src/samples/place-order.flow.js.map +1 -0
  198. package/dist/src/samples/questionnaires.flow.d.ts +2 -0
  199. package/dist/src/samples/questionnaires.flow.d.ts.map +1 -0
  200. package/dist/src/samples/questionnaires.flow.js +259 -0
  201. package/dist/src/samples/questionnaires.flow.js.map +1 -0
  202. package/dist/src/samples/seasonal-assistant.schema.json +737 -0
  203. package/dist/src/samples/test-with-ids.flow.d.ts +2 -0
  204. package/dist/src/samples/test-with-ids.flow.d.ts.map +1 -0
  205. package/dist/src/samples/test-with-ids.flow.js +80 -0
  206. package/dist/src/samples/test-with-ids.flow.js.map +1 -0
  207. package/dist/src/schema-test.d.ts +2 -0
  208. package/dist/src/schema-test.d.ts.map +1 -0
  209. package/dist/src/schema-test.js +57 -0
  210. package/dist/src/schema-test.js.map +1 -0
  211. package/dist/src/schema.d.ts +19393 -0
  212. package/dist/src/schema.d.ts.map +1 -0
  213. package/dist/src/schema.js +342 -0
  214. package/dist/src/schema.js.map +1 -0
  215. package/dist/src/slice-builder.d.ts +16 -0
  216. package/dist/src/slice-builder.d.ts.map +1 -0
  217. package/dist/src/slice-builder.js +72 -0
  218. package/dist/src/slice-builder.js.map +1 -0
  219. package/dist/src/testing.d.ts +32 -0
  220. package/dist/src/testing.d.ts.map +1 -0
  221. package/dist/src/testing.js +36 -0
  222. package/dist/src/testing.js.map +1 -0
  223. package/dist/src/transformers/flow-to-model/assemble.d.ts +3 -0
  224. package/dist/src/transformers/flow-to-model/assemble.d.ts.map +1 -0
  225. package/dist/src/transformers/flow-to-model/assemble.js +9 -0
  226. package/dist/src/transformers/flow-to-model/assemble.js.map +1 -0
  227. package/dist/src/transformers/flow-to-model/debug.d.ts +3 -0
  228. package/dist/src/transformers/flow-to-model/debug.d.ts.map +1 -0
  229. package/dist/src/transformers/flow-to-model/debug.js +6 -0
  230. package/dist/src/transformers/flow-to-model/debug.js.map +1 -0
  231. package/dist/src/transformers/flow-to-model/example-shapes.d.ts +6 -0
  232. package/dist/src/transformers/flow-to-model/example-shapes.d.ts.map +1 -0
  233. package/dist/src/transformers/flow-to-model/example-shapes.js +60 -0
  234. package/dist/src/transformers/flow-to-model/example-shapes.js.map +1 -0
  235. package/dist/src/transformers/flow-to-model/guards.d.ts +15 -0
  236. package/dist/src/transformers/flow-to-model/guards.d.ts.map +1 -0
  237. package/dist/src/transformers/flow-to-model/guards.js +18 -0
  238. package/dist/src/transformers/flow-to-model/guards.js.map +1 -0
  239. package/dist/src/transformers/flow-to-model/index.d.ts +4 -0
  240. package/dist/src/transformers/flow-to-model/index.d.ts.map +1 -0
  241. package/dist/src/transformers/flow-to-model/index.js +193 -0
  242. package/dist/src/transformers/flow-to-model/index.js.map +1 -0
  243. package/dist/src/transformers/flow-to-model/inlining.d.ts +4 -0
  244. package/dist/src/transformers/flow-to-model/inlining.d.ts.map +1 -0
  245. package/dist/src/transformers/flow-to-model/inlining.js +95 -0
  246. package/dist/src/transformers/flow-to-model/inlining.js.map +1 -0
  247. package/dist/src/transformers/flow-to-model/integrations.d.ts +36 -0
  248. package/dist/src/transformers/flow-to-model/integrations.d.ts.map +1 -0
  249. package/dist/src/transformers/flow-to-model/integrations.js +147 -0
  250. package/dist/src/transformers/flow-to-model/integrations.js.map +1 -0
  251. package/dist/src/transformers/flow-to-model/messages.d.ts +5 -0
  252. package/dist/src/transformers/flow-to-model/messages.d.ts.map +1 -0
  253. package/dist/src/transformers/flow-to-model/messages.js +88 -0
  254. package/dist/src/transformers/flow-to-model/messages.js.map +1 -0
  255. package/dist/src/transformers/flow-to-model/normalize.d.ts +3 -0
  256. package/dist/src/transformers/flow-to-model/normalize.d.ts.map +1 -0
  257. package/dist/src/transformers/flow-to-model/normalize.js +23 -0
  258. package/dist/src/transformers/flow-to-model/normalize.js.map +1 -0
  259. package/dist/src/transformers/flow-to-model/spec-processors.d.ts +34 -0
  260. package/dist/src/transformers/flow-to-model/spec-processors.d.ts.map +1 -0
  261. package/dist/src/transformers/flow-to-model/spec-processors.js +395 -0
  262. package/dist/src/transformers/flow-to-model/spec-processors.js.map +1 -0
  263. package/dist/src/transformers/flow-to-model/strings.d.ts +2 -0
  264. package/dist/src/transformers/flow-to-model/strings.d.ts.map +1 -0
  265. package/dist/src/transformers/flow-to-model/strings.js +11 -0
  266. package/dist/src/transformers/flow-to-model/strings.js.map +1 -0
  267. package/dist/src/transformers/flow-to-model/type-inference.d.ts +3 -0
  268. package/dist/src/transformers/flow-to-model/type-inference.d.ts.map +1 -0
  269. package/dist/src/transformers/flow-to-model/type-inference.js +92 -0
  270. package/dist/src/transformers/flow-to-model/type-inference.js.map +1 -0
  271. package/dist/src/transformers/flow-to-model/type-inference.specs.d.ts +2 -0
  272. package/dist/src/transformers/flow-to-model/type-inference.specs.d.ts.map +1 -0
  273. package/dist/src/transformers/flow-to-model/type-inference.specs.js +167 -0
  274. package/dist/src/transformers/flow-to-model/type-inference.specs.js.map +1 -0
  275. package/dist/src/transformers/flow-to-model/zod-adapter.d.ts +6 -0
  276. package/dist/src/transformers/flow-to-model/zod-adapter.d.ts.map +1 -0
  277. package/dist/src/transformers/flow-to-model/zod-adapter.js +101 -0
  278. package/dist/src/transformers/flow-to-model/zod-adapter.js.map +1 -0
  279. package/dist/src/transformers/model-to-flow/analysis/extract-flow.d.ts +2 -0
  280. package/dist/src/transformers/model-to-flow/analysis/extract-flow.d.ts.map +1 -0
  281. package/dist/src/transformers/model-to-flow/analysis/extract-flow.js +22 -0
  282. package/dist/src/transformers/model-to-flow/analysis/extract-flow.js.map +1 -0
  283. package/dist/src/transformers/model-to-flow/analysis/lint-helpers.d.ts +18 -0
  284. package/dist/src/transformers/model-to-flow/analysis/lint-helpers.d.ts.map +1 -0
  285. package/dist/src/transformers/model-to-flow/analysis/lint-helpers.js +78 -0
  286. package/dist/src/transformers/model-to-flow/analysis/lint-helpers.js.map +1 -0
  287. package/dist/src/transformers/model-to-flow/analysis/type-decls.d.ts +7 -0
  288. package/dist/src/transformers/model-to-flow/analysis/type-decls.d.ts.map +1 -0
  289. package/dist/src/transformers/model-to-flow/analysis/type-decls.js +74 -0
  290. package/dist/src/transformers/model-to-flow/analysis/type-decls.js.map +1 -0
  291. package/dist/src/transformers/model-to-flow/analysis/usage.d.ts +9 -0
  292. package/dist/src/transformers/model-to-flow/analysis/usage.d.ts.map +1 -0
  293. package/dist/src/transformers/model-to-flow/analysis/usage.js +90 -0
  294. package/dist/src/transformers/model-to-flow/analysis/usage.js.map +1 -0
  295. package/dist/src/transformers/model-to-flow/ast/emit-helpers.d.ts +18 -0
  296. package/dist/src/transformers/model-to-flow/ast/emit-helpers.d.ts.map +1 -0
  297. package/dist/src/transformers/model-to-flow/ast/emit-helpers.js +159 -0
  298. package/dist/src/transformers/model-to-flow/ast/emit-helpers.js.map +1 -0
  299. package/dist/src/transformers/model-to-flow/formatting/prettier.d.ts +2 -0
  300. package/dist/src/transformers/model-to-flow/formatting/prettier.d.ts.map +1 -0
  301. package/dist/src/transformers/model-to-flow/formatting/prettier.js +26 -0
  302. package/dist/src/transformers/model-to-flow/formatting/prettier.js.map +1 -0
  303. package/dist/src/transformers/model-to-flow/formatting/sort-types.d.ts +6 -0
  304. package/dist/src/transformers/model-to-flow/formatting/sort-types.d.ts.map +1 -0
  305. package/dist/src/transformers/model-to-flow/formatting/sort-types.js +17 -0
  306. package/dist/src/transformers/model-to-flow/formatting/sort-types.js.map +1 -0
  307. package/dist/src/transformers/model-to-flow/generators/compose.d.ts +6 -0
  308. package/dist/src/transformers/model-to-flow/generators/compose.d.ts.map +1 -0
  309. package/dist/src/transformers/model-to-flow/generators/compose.js +79 -0
  310. package/dist/src/transformers/model-to-flow/generators/compose.js.map +1 -0
  311. package/dist/src/transformers/model-to-flow/generators/flow.d.ts +15 -0
  312. package/dist/src/transformers/model-to-flow/generators/flow.d.ts.map +1 -0
  313. package/dist/src/transformers/model-to-flow/generators/flow.js +316 -0
  314. package/dist/src/transformers/model-to-flow/generators/flow.js.map +1 -0
  315. package/dist/src/transformers/model-to-flow/generators/gwt.d.ts +57 -0
  316. package/dist/src/transformers/model-to-flow/generators/gwt.d.ts.map +1 -0
  317. package/dist/src/transformers/model-to-flow/generators/gwt.js +186 -0
  318. package/dist/src/transformers/model-to-flow/generators/gwt.js.map +1 -0
  319. package/dist/src/transformers/model-to-flow/generators/imports.d.ts +16 -0
  320. package/dist/src/transformers/model-to-flow/generators/imports.d.ts.map +1 -0
  321. package/dist/src/transformers/model-to-flow/generators/imports.js +57 -0
  322. package/dist/src/transformers/model-to-flow/generators/imports.js.map +1 -0
  323. package/dist/src/transformers/model-to-flow/generators/types.d.ts +13 -0
  324. package/dist/src/transformers/model-to-flow/generators/types.d.ts.map +1 -0
  325. package/dist/src/transformers/model-to-flow/generators/types.js +22 -0
  326. package/dist/src/transformers/model-to-flow/generators/types.js.map +1 -0
  327. package/dist/src/transformers/model-to-flow/index.d.ts +13 -0
  328. package/dist/src/transformers/model-to-flow/index.d.ts.map +1 -0
  329. package/dist/src/transformers/model-to-flow/index.js +25 -0
  330. package/dist/src/transformers/model-to-flow/index.js.map +1 -0
  331. package/dist/src/transformers/model-to-flow/utils/integration-extractor.d.ts +12 -0
  332. package/dist/src/transformers/model-to-flow/utils/integration-extractor.d.ts.map +1 -0
  333. package/dist/src/transformers/model-to-flow/utils/integration-extractor.js +64 -0
  334. package/dist/src/transformers/model-to-flow/utils/integration-extractor.js.map +1 -0
  335. package/dist/src/transformers/model-to-flow/utils/strings.d.ts +9 -0
  336. package/dist/src/transformers/model-to-flow/utils/strings.d.ts.map +1 -0
  337. package/dist/src/transformers/model-to-flow/utils/strings.js +11 -0
  338. package/dist/src/transformers/model-to-flow/utils/strings.js.map +1 -0
  339. package/dist/src/transformers/model-to-narrative/analysis/extract-flow.d.ts +2 -0
  340. package/dist/src/transformers/model-to-narrative/analysis/extract-flow.d.ts.map +1 -0
  341. package/dist/src/transformers/model-to-narrative/analysis/extract-flow.js +22 -0
  342. package/dist/src/transformers/model-to-narrative/analysis/extract-flow.js.map +1 -0
  343. package/dist/src/transformers/model-to-narrative/analysis/lint-helpers.d.ts +18 -0
  344. package/dist/src/transformers/model-to-narrative/analysis/lint-helpers.d.ts.map +1 -0
  345. package/dist/src/transformers/model-to-narrative/analysis/lint-helpers.js +78 -0
  346. package/dist/src/transformers/model-to-narrative/analysis/lint-helpers.js.map +1 -0
  347. package/dist/src/transformers/model-to-narrative/analysis/type-decls.d.ts +7 -0
  348. package/dist/src/transformers/model-to-narrative/analysis/type-decls.d.ts.map +1 -0
  349. package/dist/src/transformers/model-to-narrative/analysis/type-decls.js +74 -0
  350. package/dist/src/transformers/model-to-narrative/analysis/type-decls.js.map +1 -0
  351. package/dist/src/transformers/model-to-narrative/analysis/usage.d.ts +9 -0
  352. package/dist/src/transformers/model-to-narrative/analysis/usage.d.ts.map +1 -0
  353. package/dist/src/transformers/model-to-narrative/analysis/usage.js +90 -0
  354. package/dist/src/transformers/model-to-narrative/analysis/usage.js.map +1 -0
  355. package/dist/src/transformers/model-to-narrative/ast/emit-helpers.d.ts +18 -0
  356. package/dist/src/transformers/model-to-narrative/ast/emit-helpers.d.ts.map +1 -0
  357. package/dist/src/transformers/model-to-narrative/ast/emit-helpers.js +159 -0
  358. package/dist/src/transformers/model-to-narrative/ast/emit-helpers.js.map +1 -0
  359. package/dist/src/transformers/model-to-narrative/formatting/prettier.d.ts +2 -0
  360. package/dist/src/transformers/model-to-narrative/formatting/prettier.d.ts.map +1 -0
  361. package/dist/src/transformers/model-to-narrative/formatting/prettier.js +26 -0
  362. package/dist/src/transformers/model-to-narrative/formatting/prettier.js.map +1 -0
  363. package/dist/src/transformers/model-to-narrative/formatting/sort-types.d.ts +6 -0
  364. package/dist/src/transformers/model-to-narrative/formatting/sort-types.d.ts.map +1 -0
  365. package/dist/src/transformers/model-to-narrative/formatting/sort-types.js +17 -0
  366. package/dist/src/transformers/model-to-narrative/formatting/sort-types.js.map +1 -0
  367. package/dist/src/transformers/model-to-narrative/generators/compose.d.ts +6 -0
  368. package/dist/src/transformers/model-to-narrative/generators/compose.d.ts.map +1 -0
  369. package/dist/src/transformers/model-to-narrative/generators/compose.js +79 -0
  370. package/dist/src/transformers/model-to-narrative/generators/compose.js.map +1 -0
  371. package/dist/src/transformers/model-to-narrative/generators/flow.d.ts +15 -0
  372. package/dist/src/transformers/model-to-narrative/generators/flow.d.ts.map +1 -0
  373. package/dist/src/transformers/model-to-narrative/generators/flow.js +316 -0
  374. package/dist/src/transformers/model-to-narrative/generators/flow.js.map +1 -0
  375. package/dist/src/transformers/model-to-narrative/generators/gwt.d.ts +57 -0
  376. package/dist/src/transformers/model-to-narrative/generators/gwt.d.ts.map +1 -0
  377. package/dist/src/transformers/model-to-narrative/generators/gwt.js +186 -0
  378. package/dist/src/transformers/model-to-narrative/generators/gwt.js.map +1 -0
  379. package/dist/src/transformers/model-to-narrative/generators/imports.d.ts +16 -0
  380. package/dist/src/transformers/model-to-narrative/generators/imports.d.ts.map +1 -0
  381. package/dist/src/transformers/model-to-narrative/generators/imports.js +57 -0
  382. package/dist/src/transformers/model-to-narrative/generators/imports.js.map +1 -0
  383. package/dist/src/transformers/model-to-narrative/generators/types.d.ts +13 -0
  384. package/dist/src/transformers/model-to-narrative/generators/types.d.ts.map +1 -0
  385. package/dist/src/transformers/model-to-narrative/generators/types.js +22 -0
  386. package/dist/src/transformers/model-to-narrative/generators/types.js.map +1 -0
  387. package/dist/src/transformers/model-to-narrative/index.d.ts +13 -0
  388. package/dist/src/transformers/model-to-narrative/index.d.ts.map +1 -0
  389. package/dist/src/transformers/model-to-narrative/index.js +25 -0
  390. package/dist/src/transformers/model-to-narrative/index.js.map +1 -0
  391. package/dist/src/transformers/model-to-narrative/utils/integration-extractor.d.ts +12 -0
  392. package/dist/src/transformers/model-to-narrative/utils/integration-extractor.d.ts.map +1 -0
  393. package/dist/src/transformers/model-to-narrative/utils/integration-extractor.js +64 -0
  394. package/dist/src/transformers/model-to-narrative/utils/integration-extractor.js.map +1 -0
  395. package/dist/src/transformers/model-to-narrative/utils/strings.d.ts +9 -0
  396. package/dist/src/transformers/model-to-narrative/utils/strings.d.ts.map +1 -0
  397. package/dist/src/transformers/model-to-narrative/utils/strings.js +11 -0
  398. package/dist/src/transformers/model-to-narrative/utils/strings.js.map +1 -0
  399. package/dist/src/transformers/narrative-to-model/assemble.d.ts +3 -0
  400. package/dist/src/transformers/narrative-to-model/assemble.d.ts.map +1 -0
  401. package/dist/src/transformers/narrative-to-model/assemble.js +9 -0
  402. package/dist/src/transformers/narrative-to-model/assemble.js.map +1 -0
  403. package/dist/src/transformers/narrative-to-model/debug.d.ts +3 -0
  404. package/dist/src/transformers/narrative-to-model/debug.d.ts.map +1 -0
  405. package/dist/src/transformers/narrative-to-model/debug.js +6 -0
  406. package/dist/src/transformers/narrative-to-model/debug.js.map +1 -0
  407. package/dist/src/transformers/narrative-to-model/example-shapes.d.ts +6 -0
  408. package/dist/src/transformers/narrative-to-model/example-shapes.d.ts.map +1 -0
  409. package/dist/src/transformers/narrative-to-model/example-shapes.js +60 -0
  410. package/dist/src/transformers/narrative-to-model/example-shapes.js.map +1 -0
  411. package/dist/src/transformers/narrative-to-model/guards.d.ts +15 -0
  412. package/dist/src/transformers/narrative-to-model/guards.d.ts.map +1 -0
  413. package/dist/src/transformers/narrative-to-model/guards.js +18 -0
  414. package/dist/src/transformers/narrative-to-model/guards.js.map +1 -0
  415. package/dist/src/transformers/narrative-to-model/index.d.ts +4 -0
  416. package/dist/src/transformers/narrative-to-model/index.d.ts.map +1 -0
  417. package/dist/src/transformers/narrative-to-model/index.js +193 -0
  418. package/dist/src/transformers/narrative-to-model/index.js.map +1 -0
  419. package/dist/src/transformers/narrative-to-model/inlining.d.ts +4 -0
  420. package/dist/src/transformers/narrative-to-model/inlining.d.ts.map +1 -0
  421. package/dist/src/transformers/narrative-to-model/inlining.js +95 -0
  422. package/dist/src/transformers/narrative-to-model/inlining.js.map +1 -0
  423. package/dist/src/transformers/narrative-to-model/integrations.d.ts +36 -0
  424. package/dist/src/transformers/narrative-to-model/integrations.d.ts.map +1 -0
  425. package/dist/src/transformers/narrative-to-model/integrations.js +147 -0
  426. package/dist/src/transformers/narrative-to-model/integrations.js.map +1 -0
  427. package/dist/src/transformers/narrative-to-model/messages.d.ts +5 -0
  428. package/dist/src/transformers/narrative-to-model/messages.d.ts.map +1 -0
  429. package/dist/src/transformers/narrative-to-model/messages.js +88 -0
  430. package/dist/src/transformers/narrative-to-model/messages.js.map +1 -0
  431. package/dist/src/transformers/narrative-to-model/normalize.d.ts +3 -0
  432. package/dist/src/transformers/narrative-to-model/normalize.d.ts.map +1 -0
  433. package/dist/src/transformers/narrative-to-model/normalize.js +23 -0
  434. package/dist/src/transformers/narrative-to-model/normalize.js.map +1 -0
  435. package/dist/src/transformers/narrative-to-model/spec-processors.d.ts +34 -0
  436. package/dist/src/transformers/narrative-to-model/spec-processors.d.ts.map +1 -0
  437. package/dist/src/transformers/narrative-to-model/spec-processors.js +395 -0
  438. package/dist/src/transformers/narrative-to-model/spec-processors.js.map +1 -0
  439. package/dist/src/transformers/narrative-to-model/strings.d.ts +2 -0
  440. package/dist/src/transformers/narrative-to-model/strings.d.ts.map +1 -0
  441. package/dist/src/transformers/narrative-to-model/strings.js +11 -0
  442. package/dist/src/transformers/narrative-to-model/strings.js.map +1 -0
  443. package/dist/src/transformers/narrative-to-model/type-inference.d.ts +3 -0
  444. package/dist/src/transformers/narrative-to-model/type-inference.d.ts.map +1 -0
  445. package/dist/src/transformers/narrative-to-model/type-inference.js +92 -0
  446. package/dist/src/transformers/narrative-to-model/type-inference.js.map +1 -0
  447. package/dist/src/transformers/narrative-to-model/type-inference.specs.d.ts +2 -0
  448. package/dist/src/transformers/narrative-to-model/type-inference.specs.d.ts.map +1 -0
  449. package/dist/src/transformers/narrative-to-model/type-inference.specs.js +167 -0
  450. package/dist/src/transformers/narrative-to-model/type-inference.specs.js.map +1 -0
  451. package/dist/src/transformers/narrative-to-model/zod-adapter.d.ts +6 -0
  452. package/dist/src/transformers/narrative-to-model/zod-adapter.d.ts.map +1 -0
  453. package/dist/src/transformers/narrative-to-model/zod-adapter.js +101 -0
  454. package/dist/src/transformers/narrative-to-model/zod-adapter.js.map +1 -0
  455. package/dist/src/types.d.ts +143 -0
  456. package/dist/src/types.d.ts.map +1 -0
  457. package/dist/src/types.js +36 -0
  458. package/dist/src/types.js.map +1 -0
  459. package/dist/tsconfig.tsbuildinfo +1 -0
  460. package/eslint.config.ts +12 -0
  461. package/package.json +50 -0
  462. package/scripts/build.ts +84 -0
  463. package/scripts/convert-flow-exec.ts +17 -0
  464. package/scripts/convert-flow-helper.ts +93 -0
  465. package/scripts/convert-flow.ts +128 -0
  466. package/scripts/print-schema.ts +30 -0
  467. package/src/commands/export-schema-helper.ts +76 -0
  468. package/src/commands/export-schema-runner.ts +72 -0
  469. package/src/commands/export-schema.ts +157 -0
  470. package/src/commands/filestore.node.ts +12 -0
  471. package/src/data-narrative-builders.ts +418 -0
  472. package/src/fluent-builder.specs.ts +36 -0
  473. package/src/fluent-builder.ts +382 -0
  474. package/src/getFlows.cache.specs.ts +287 -0
  475. package/src/getFlows.specs.ts +1246 -0
  476. package/src/getNarratives.ts +186 -0
  477. package/src/id/addAutoIds.specs.ts +296 -0
  478. package/src/id/addAutoIds.ts +53 -0
  479. package/src/id/generators.ts +5 -0
  480. package/src/id/hasAllIds.specs.ts +267 -0
  481. package/src/id/hasAllIds.ts +23 -0
  482. package/src/id/index.ts +2 -0
  483. package/src/index.ts +131 -0
  484. package/src/integration-export-registry.ts +83 -0
  485. package/src/integration-registry.ts +53 -0
  486. package/src/loader/fs-path.ts +29 -0
  487. package/src/loader/graph.ts +379 -0
  488. package/src/loader/importmap.ts +68 -0
  489. package/src/loader/index.ts +81 -0
  490. package/src/loader/resolver.ts +22 -0
  491. package/src/loader/runtime-cjs.ts +151 -0
  492. package/src/loader/ts-utils.ts +770 -0
  493. package/src/loader/types.ts +20 -0
  494. package/src/loader/vfs-compiler-host.ts +51 -0
  495. package/src/model-to-flow.specs.ts +1822 -0
  496. package/src/narrative-context.specs.ts +226 -0
  497. package/src/narrative-context.ts +708 -0
  498. package/src/narrative-registry.ts +65 -0
  499. package/src/narrative.ts +236 -0
  500. package/src/samples/items.flow.ts +90 -0
  501. package/src/samples/mixed-given-types.flow.ts +70 -0
  502. package/src/samples/place-order.flow.ts +57 -0
  503. package/src/samples/questionnaires.flow.ts +359 -0
  504. package/src/samples/seasonal-assistant.schema.json +737 -0
  505. package/src/samples/test-with-ids.flow.ts +109 -0
  506. package/src/schema-test.ts +67 -0
  507. package/src/schema.ts +398 -0
  508. package/src/slice-builder.ts +100 -0
  509. package/src/testing.ts +40 -0
  510. package/src/transformers/model-to-narrative/analysis/extract-flow.ts +26 -0
  511. package/src/transformers/model-to-narrative/analysis/lint-helpers.ts +98 -0
  512. package/src/transformers/model-to-narrative/analysis/type-decls.ts +94 -0
  513. package/src/transformers/model-to-narrative/analysis/usage.ts +111 -0
  514. package/src/transformers/model-to-narrative/ast/emit-helpers.ts +199 -0
  515. package/src/transformers/model-to-narrative/formatting/prettier.ts +30 -0
  516. package/src/transformers/model-to-narrative/formatting/sort-types.ts +19 -0
  517. package/src/transformers/model-to-narrative/generators/compose.ts +124 -0
  518. package/src/transformers/model-to-narrative/generators/flow.ts +570 -0
  519. package/src/transformers/model-to-narrative/generators/gwt.ts +335 -0
  520. package/src/transformers/model-to-narrative/generators/imports.ts +110 -0
  521. package/src/transformers/model-to-narrative/generators/types.ts +48 -0
  522. package/src/transformers/model-to-narrative/index.ts +27 -0
  523. package/src/transformers/model-to-narrative/utils/integration-extractor.ts +67 -0
  524. package/src/transformers/model-to-narrative/utils/strings.ts +10 -0
  525. package/src/transformers/narrative-to-model/assemble.ts +10 -0
  526. package/src/transformers/narrative-to-model/debug.ts +6 -0
  527. package/src/transformers/narrative-to-model/example-shapes.ts +66 -0
  528. package/src/transformers/narrative-to-model/guards.ts +24 -0
  529. package/src/transformers/narrative-to-model/index.ts +274 -0
  530. package/src/transformers/narrative-to-model/inlining.ts +106 -0
  531. package/src/transformers/narrative-to-model/integrations.ts +201 -0
  532. package/src/transformers/narrative-to-model/messages.ts +104 -0
  533. package/src/transformers/narrative-to-model/normalize.ts +27 -0
  534. package/src/transformers/narrative-to-model/spec-processors.ts +648 -0
  535. package/src/transformers/narrative-to-model/strings.ts +11 -0
  536. package/src/transformers/narrative-to-model/type-inference.specs.ts +176 -0
  537. package/src/transformers/narrative-to-model/type-inference.ts +127 -0
  538. package/src/transformers/narrative-to-model/zod-adapter.ts +110 -0
  539. package/src/types.ts +226 -0
  540. package/tsconfig.json +11 -0
  541. package/tsconfig.test.json +9 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-to-flow.specs.js","sourceRoot":"","sources":["../../src/model-to-flow.specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,MAAM,MAAM,0CAA0C,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,MAAe,CAAC,CAAC;QAErD,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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E,YAAY;4BAClB,MAAM,EAAE;gCACN,KAAK,EAAE;oCACL,IAAI,EAAE,EAAE;oCACR,KAAK,EAAE,CAAC,6BAA6B,CAAC;iCACvC;6BACF;yBACF;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE,oBAAoB;oBAC1B,UAAU,EAAE,2BAA2B;oBACvC,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,sBAAsB;4BAC5B,EAAE,EAAE,gBAAgB;4BACpB,IAAI,EAAE,YAAY;4BAClB,MAAM,EAAE;gCACN,KAAK,EAAE;oCACL,IAAI,EAAE,EAAE;oCACR,KAAK,EAAE,CAAC,iCAAiC,CAAC;iCAC3C;6BACF;yBACF;qBACF;iBACF;aACF;YACD,QAAQ,EAAE,EAAE;YACZ,YAAY,EAAE,EAAE;SACjB,CAAC;QAEF,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;QAEtE,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;CAsBxB,CAAC,CAAC;IACD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { DataItem } from './types';
2
+ import type { GivenTypeInfo } from './loader/ts-utils';
3
+ import { Narrative, Slice } from './index';
4
+ export declare function setGivenTypesByFile(types: Map<string, GivenTypeInfo[]>): void;
5
+ export declare function startNarrative(name: string, id?: string): Narrative;
6
+ export declare function getCurrentNarrative(): Narrative | null;
7
+ export declare function clearCurrentNarrative(): void;
8
+ export declare function getCurrentSlice(): Slice | null;
9
+ export declare function addSlice(slice: Slice): void;
10
+ export declare function startClientBlock(slice: Slice, description?: string): void;
11
+ export declare function endClientBlock(): void;
12
+ export declare function startServerBlock(slice: Slice, description?: string): void;
13
+ export declare function endServerBlock(): void;
14
+ export declare function pushSpec(description: string): void;
15
+ export declare function recordShouldBlock(description?: string): void;
16
+ export declare function setQueryRequest(request: string): void;
17
+ export declare function setSliceData(data: DataItem[]): void;
18
+ export declare function recordRule(description: string, id?: string): void;
19
+ export declare function recordExample(description: string): void;
20
+ export declare function recordGivenData(data: unknown[], contextParam?: Partial<Record<string, string>>): void;
21
+ export declare function recordAndGivenData(data: unknown[], contextParam?: Partial<Record<string, string>>): void;
22
+ export declare function recordWhenData(data: unknown, contextParam?: Partial<Record<string, string>>): void;
23
+ export declare function recordThenData(data: unknown[], contextParam?: Record<string, string>): void;
24
+ export declare function recordAndThenData(data: unknown[], contextParam?: Partial<Record<string, string>>): void;
25
+ //# sourceMappingURL=narrative-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"narrative-context.d.ts","sourceRoot":"","sources":["../../src/narrative-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgC,QAAQ,EAAwB,MAAM,SAAS,CAAC;AAC5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAW,MAAM,SAAS,CAAC;AAgCpD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,GAAG,IAAI,CAU7E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAsBnE;AAED,wBAAgB,mBAAmB,IAAI,SAAS,GAAG,IAAI,CAEtD;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,wBAAgB,eAAe,IAAI,KAAK,GAAG,IAAI,CAG9C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAI3C;AAuDD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,GAAE,MAAW,GAAG,IAAI,CAgB7E;AAED,wBAAgB,cAAc,IAAI,IAAI,CAIrC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,GAAE,M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 @@
1
+ import createDebug from 'debug';
2
+ function normalizeContext(context) {
3
+ if (!context)
4
+ return undefined;
5
+ const filtered = {};
6
+ for (const [key, value] of Object.entries(context)) {
7
+ if (value !== undefined) {
8
+ filtered[key] = value;
9
+ }
10
+ }
11
+ return Object.keys(filtered).length > 0 ? filtered : undefined;
12
+ }
13
+ const debug = createDebug('auto:narrative:context:given-types');
14
+ let context = null;
15
+ let givenTypesByFile = new Map();
16
+ let whenTypesByFile = new Map();
17
+ const givenCallCounters = new Map();
18
+ const whenCallCounters = new Map();
19
+ export function setGivenTypesByFile(types) {
20
+ const whenTypes = types.get('__whenTypes');
21
+ if (whenTypes) {
22
+ whenTypesByFile = whenTypes;
23
+ types.delete('__whenTypes');
24
+ }
25
+ givenTypesByFile = types;
26
+ givenCallCounters.clear();
27
+ whenCallCounters.clear();
28
+ }
29
+ export function startNarrative(name, id) {
30
+ const sourceFile = globalThis.__aeCurrentModulePath;
31
+ if (sourceFile !== null && sourceFile !== undefined && sourceFile !== '') {
32
+ givenCallCounters.set(sourceFile, 0);
33
+ whenCallCounters.set(sourceFile, 0);
34
+ }
35
+ const narrative = {
36
+ name,
37
+ id,
38
+ slices: [],
39
+ ...(typeof sourceFile === 'string' ? { sourceFile } : {}),
40
+ };
41
+ context = {
42
+ narrative,
43
+ currentSliceIndex: null,
44
+ currentSpecTarget: null,
45
+ currentSpecIndex: null,
46
+ currentRuleIndex: null,
47
+ currentExampleIndex: null,
48
+ };
49
+ return narrative;
50
+ }
51
+ export function getCurrentNarrative() {
52
+ return context?.narrative ?? null;
53
+ }
54
+ export function clearCurrentNarrative() {
55
+ context = null;
56
+ }
57
+ export function getCurrentSlice() {
58
+ if (!context || context.currentSliceIndex === null)
59
+ return null;
60
+ return context.narrative.slices[context.currentSliceIndex] ?? null;
61
+ }
62
+ export function addSlice(slice) {
63
+ if (!context)
64
+ throw new Error('No active narrative');
65
+ context.narrative.slices.push(slice);
66
+ context.currentSliceIndex = context.narrative.slices.length - 1;
67
+ }
68
+ function getClientSpecs(slice) {
69
+ if (slice.type === 'command' || slice.type === 'query') {
70
+ return slice.client.specs;
71
+ }
72
+ return undefined;
73
+ }
74
+ function getServerSpecs(slice) {
75
+ if ('server' in slice) {
76
+ return slice.server?.specs;
77
+ }
78
+ return undefined;
79
+ }
80
+ function getCurrentSpecs(slice) {
81
+ if (!context?.currentSpecTarget)
82
+ return undefined;
83
+ switch (context.currentSpecTarget) {
84
+ case 'client':
85
+ return getClientSpecs(slice);
86
+ case 'server':
87
+ return getServerSpecs(slice);
88
+ default:
89
+ return undefined;
90
+ }
91
+ }
92
+ function getCurrentExample(slice) {
93
+ if (!context ||
94
+ context.currentSpecIndex === null ||
95
+ context.currentRuleIndex === null ||
96
+ context.currentExampleIndex === null) {
97
+ return undefined;
98
+ }
99
+ const spec = getCurrentSpecs(slice);
100
+ if (!spec)
101
+ return undefined;
102
+ // Only server specs have object rules with examples
103
+ if (context.currentSpecTarget === 'server') {
104
+ const objectRules = spec.rules;
105
+ return objectRules[context.currentRuleIndex]?.examples[context.currentExampleIndex];
106
+ }
107
+ return undefined;
108
+ }
109
+ export function startClientBlock(slice, description = '') {
110
+ if (!context)
111
+ throw new Error('No active flow context');
112
+ if (slice.type === 'command' || slice.type === 'query') {
113
+ slice.client = {
114
+ description,
115
+ specs: undefined,
116
+ };
117
+ context.currentSpecTarget = 'client';
118
+ }
119
+ else if (slice.type === 'experience') {
120
+ slice.client = {
121
+ description: description || undefined,
122
+ specs: undefined,
123
+ };
124
+ context.currentSpecTarget = 'client';
125
+ }
126
+ }
127
+ export function endClientBlock() {
128
+ if (context) {
129
+ context.currentSpecTarget = null;
130
+ }
131
+ }
132
+ export function startServerBlock(slice, description = '') {
133
+ if (!context)
134
+ throw new Error('No active flow context');
135
+ if (slice.type === 'command') {
136
+ slice.server = {
137
+ description,
138
+ specs: { name: '', rules: [] },
139
+ data: undefined,
140
+ };
141
+ }
142
+ else if (slice.type === 'query') {
143
+ slice.server = {
144
+ description,
145
+ specs: { name: '', rules: [] },
146
+ data: undefined,
147
+ };
148
+ }
149
+ else if (slice.type === 'react') {
150
+ slice.server = {
151
+ description: description || undefined,
152
+ specs: { name: '', rules: [] },
153
+ data: undefined,
154
+ };
155
+ }
156
+ context.currentSpecTarget = 'server';
157
+ }
158
+ export function endServerBlock() {
159
+ if (context) {
160
+ context.currentSpecTarget = null;
161
+ }
162
+ }
163
+ function initializeClientSpecs(slice, description) {
164
+ if (slice.type === 'command' || slice.type === 'query') {
165
+ slice.client.specs = {
166
+ name: description,
167
+ rules: [],
168
+ };
169
+ }
170
+ else if (slice.type === 'experience') {
171
+ if (slice.client == null) {
172
+ slice.client = { description: '', specs: undefined };
173
+ }
174
+ slice.client.specs = {
175
+ name: description,
176
+ rules: [],
177
+ };
178
+ }
179
+ }
180
+ function initializeServerSpecs(slice, description) {
181
+ if ('server' in slice && slice.server != null) {
182
+ slice.server.specs = {
183
+ name: description,
184
+ rules: [],
185
+ };
186
+ if (context)
187
+ context.currentSpecIndex = 0;
188
+ }
189
+ }
190
+ export function pushSpec(description) {
191
+ if (!context || !context.currentSpecTarget)
192
+ throw new Error('No active spec target');
193
+ const slice = getCurrentSlice();
194
+ if (!slice)
195
+ throw new Error('No active slice');
196
+ switch (context.currentSpecTarget) {
197
+ case 'client':
198
+ initializeClientSpecs(slice, description);
199
+ break;
200
+ case 'server':
201
+ initializeServerSpecs(slice, description);
202
+ break;
203
+ }
204
+ }
205
+ export function recordShouldBlock(description) {
206
+ if (typeof description === 'string' && context?.currentSpecTarget === 'client') {
207
+ const slice = getCurrentSlice();
208
+ if (slice && (slice.type === 'command' || slice.type === 'query' || slice.type === 'experience')) {
209
+ if (!slice.client.specs) {
210
+ slice.client.specs = {
211
+ name: '',
212
+ rules: [],
213
+ };
214
+ }
215
+ slice.client.specs.rules.push(description);
216
+ }
217
+ }
218
+ }
219
+ export function setQueryRequest(request) {
220
+ const slice = getCurrentSlice();
221
+ if (!slice || slice.type !== 'query')
222
+ throw new Error('Request can only be set on query slices');
223
+ slice.request = request;
224
+ }
225
+ export function setSliceData(data) {
226
+ const slice = getCurrentSlice();
227
+ if (!slice)
228
+ throw new Error('No active slice');
229
+ const sinks = data.filter((item) => item.__type === 'sink');
230
+ const sources = data.filter((item) => item.__type === 'source');
231
+ if (slice.type === 'command') {
232
+ // Command slices only have sinks in their data
233
+ slice.server.data = sinks.length > 0 ? sinks : undefined;
234
+ }
235
+ else if (slice.type === 'query') {
236
+ // Query slices only have sources in their data
237
+ slice.server.data = sources.length > 0 ? sources : undefined;
238
+ }
239
+ else if (slice.type === 'react') {
240
+ slice.server.data = data.length > 0 ? stripTypeDiscriminator(data) : undefined;
241
+ }
242
+ }
243
+ function stripTypeDiscriminator(items) {
244
+ return items.map((item) => {
245
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
246
+ const { __type, ...rest } = item;
247
+ return rest;
248
+ });
249
+ }
250
+ export function recordRule(description, id) {
251
+ if (!context || context.currentSpecIndex === null)
252
+ throw new Error('No active spec context');
253
+ const slice = getCurrentSlice();
254
+ if (!slice)
255
+ throw new Error('No active slice');
256
+ const spec = getCurrentSpecs(slice);
257
+ if (!spec)
258
+ throw new Error('No active specs for current slice');
259
+ // Only server specs have object rules with examples
260
+ if (context.currentSpecTarget === 'server') {
261
+ const objectRules = spec.rules;
262
+ objectRules.push({
263
+ id,
264
+ description,
265
+ examples: [],
266
+ });
267
+ context.currentRuleIndex = objectRules.length - 1;
268
+ }
269
+ }
270
+ export function recordExample(description) {
271
+ if (!context || context.currentSpecIndex === null || context.currentRuleIndex === null) {
272
+ throw new Error('No active rule context');
273
+ }
274
+ const slice = getCurrentSlice();
275
+ if (!slice)
276
+ throw new Error('No active slice');
277
+ const spec = getCurrentSpecs(slice);
278
+ if (!spec)
279
+ throw new Error('No active specs for current slice');
280
+ // Only server specs have object rules with examples
281
+ if (context.currentSpecTarget === 'server') {
282
+ const objectRules = spec.rules;
283
+ const rule = objectRules[context.currentRuleIndex];
284
+ rule.examples.push({
285
+ description,
286
+ when: { commandRef: '', exampleData: {} }, // Default, will be updated
287
+ then: [],
288
+ });
289
+ context.currentExampleIndex = rule.examples.length - 1;
290
+ }
291
+ }
292
+ function processItemWithASTMatch(item, matchingType, contextParam) {
293
+ const refType = getRefTypeFromClassification(matchingType.classification);
294
+ return {
295
+ [refType]: matchingType.typeName,
296
+ exampleData: ensureMessageFormat(item).data,
297
+ ...(contextParam && { context: contextParam }),
298
+ };
299
+ }
300
+ function processGivenItems(data, contextParam) {
301
+ const sourceFile = context?.narrative.sourceFile;
302
+ return data.map((item) => {
303
+ if (sourceFile !== null && sourceFile !== undefined && sourceFile !== '') {
304
+ const currentCount = givenCallCounters.get(sourceFile) ?? 0;
305
+ givenCallCounters.set(sourceFile, currentCount + 1);
306
+ // Look up AST-extracted type info by ordinal position
307
+ const givenTypes = givenTypesByFile.get(sourceFile) || [];
308
+ const matchingType = givenTypes[currentCount];
309
+ if (matchingType !== null && matchingType !== undefined) {
310
+ debug('AST match for %s at ordinal %d: %s', sourceFile, currentCount, matchingType.typeName);
311
+ return processItemWithASTMatch(item, matchingType, contextParam);
312
+ }
313
+ else {
314
+ debug('No AST match for %s at ordinal %d, item: %o', sourceFile, currentCount, item);
315
+ }
316
+ }
317
+ // Fallback: emit explicit InferredType for downstream processing
318
+ return {
319
+ eventRef: 'InferredType',
320
+ exampleData: ensureMessageFormat(item).data,
321
+ ...(contextParam && { context: contextParam }),
322
+ };
323
+ });
324
+ }
325
+ export function recordGivenData(data, contextParam) {
326
+ if (!context ||
327
+ context.currentSpecIndex === null ||
328
+ context.currentRuleIndex === null ||
329
+ context.currentExampleIndex === null) {
330
+ throw new Error('No active example context');
331
+ }
332
+ const slice = getCurrentSlice();
333
+ if (!slice)
334
+ throw new Error('No active slice');
335
+ const example = getCurrentExample(slice);
336
+ if (!example)
337
+ throw new Error('No active example for current slice');
338
+ const items = processGivenItems(data, normalizeContext(contextParam));
339
+ example.given = items;
340
+ }
341
+ export function recordAndGivenData(data, contextParam) {
342
+ if (!context ||
343
+ context.currentSpecIndex === null ||
344
+ context.currentRuleIndex === null ||
345
+ context.currentExampleIndex === null) {
346
+ throw new Error('No active example context');
347
+ }
348
+ const slice = getCurrentSlice();
349
+ if (!slice)
350
+ throw new Error('No active slice');
351
+ const example = getCurrentExample(slice);
352
+ if (!example)
353
+ throw new Error('No active example for current slice');
354
+ const items = processGivenItems(data, normalizeContext(contextParam));
355
+ if (example.given && Array.isArray(example.given)) {
356
+ example.given.push(...items);
357
+ }
358
+ else {
359
+ example.given = items;
360
+ }
361
+ }
362
+ function updateExampleWhen(example, data, sliceType, contextParam) {
363
+ const ordinal = incrementWhenCounter();
364
+ if (typeof data === 'object' && data !== null && Object.keys(data).length === 0) {
365
+ if (sliceType === 'query') {
366
+ example.when = { eventRef: '', exampleData: {} };
367
+ }
368
+ else {
369
+ example.when = { commandRef: '', exampleData: {} };
370
+ }
371
+ return;
372
+ }
373
+ if (sliceType === 'react' || (sliceType === 'query' && Array.isArray(data))) {
374
+ // For react slices and query slices with array input, when is an array of events
375
+ const eventsArray = Array.isArray(data) ? data : [data];
376
+ example.when = eventsArray.map((item) => convertToEventExample(item, contextParam));
377
+ }
378
+ else {
379
+ example.when = convertToCommandOrEventExample(data, contextParam, ordinal);
380
+ }
381
+ }
382
+ export function recordWhenData(data, contextParam) {
383
+ if (!context ||
384
+ context.currentSpecIndex === null ||
385
+ context.currentRuleIndex === null ||
386
+ context.currentExampleIndex === null) {
387
+ throw new Error('No active example context');
388
+ }
389
+ const slice = getCurrentSlice();
390
+ if (!slice)
391
+ throw new Error('No active slice');
392
+ const example = getCurrentExample(slice);
393
+ if (!example)
394
+ throw new Error('No active example for current slice');
395
+ updateExampleWhen(example, data, slice.type, normalizeContext(contextParam));
396
+ }
397
+ export function recordThenData(data, contextParam) {
398
+ if (!context ||
399
+ context.currentSpecIndex === null ||
400
+ context.currentRuleIndex === null ||
401
+ context.currentExampleIndex === null) {
402
+ throw new Error('No active example context');
403
+ }
404
+ const slice = getCurrentSlice();
405
+ if (!slice)
406
+ throw new Error('No active slice');
407
+ const example = getCurrentExample(slice);
408
+ if (!example)
409
+ throw new Error('No active example for current slice');
410
+ const outcomes = data.map((item) => convertToOutcomeExample(item, slice.type, normalizeContext(contextParam)));
411
+ example.then = outcomes;
412
+ }
413
+ export function recordAndThenData(data, contextParam) {
414
+ if (!context ||
415
+ context.currentSpecIndex === null ||
416
+ context.currentRuleIndex === null ||
417
+ context.currentExampleIndex === null) {
418
+ throw new Error('No active example context');
419
+ }
420
+ const slice = getCurrentSlice();
421
+ if (!slice)
422
+ throw new Error('No active slice');
423
+ const example = getCurrentExample(slice);
424
+ if (!example)
425
+ throw new Error('No active example for current slice');
426
+ const outcomes = data.map((item) => convertToOutcomeExample(item, slice.type, normalizeContext(contextParam)));
427
+ example.then.push(...outcomes);
428
+ }
429
+ function convertToEventExample(item, contextParam) {
430
+ const message = ensureMessageFormat(item);
431
+ return {
432
+ eventRef: message.type,
433
+ exampleData: message.data,
434
+ ...(contextParam && { context: contextParam }),
435
+ };
436
+ }
437
+ function getRefTypeFromClassification(classification) {
438
+ if (classification === 'event')
439
+ return 'eventRef';
440
+ if (classification === 'command')
441
+ return 'commandRef';
442
+ return 'stateRef';
443
+ }
444
+ function isValidSourceFile(sourceFile) {
445
+ return sourceFile !== null && sourceFile !== undefined && sourceFile !== '';
446
+ }
447
+ function isValidMatchingType(matchingType) {
448
+ return matchingType !== null && matchingType !== undefined && matchingType.typeName !== '';
449
+ }
450
+ function incrementWhenCounter() {
451
+ const sourceFile = context?.narrative.sourceFile;
452
+ if (!isValidSourceFile(sourceFile)) {
453
+ return -1;
454
+ }
455
+ const currentCount = whenCallCounters.get(sourceFile) ?? 0;
456
+ whenCallCounters.set(sourceFile, currentCount + 1);
457
+ debug('[when-counter] incremented counter for %s to %d', sourceFile, currentCount + 1);
458
+ return currentCount;
459
+ }
460
+ function tryGetWhenTypeFromAST(item, ordinal) {
461
+ const sourceFile = context?.narrative.sourceFile;
462
+ debug('[when-ast] tryGetWhenTypeFromAST called, sourceFile=%s, ordinal=%d', sourceFile, ordinal);
463
+ debug('[when-ast] whenTypesByFile has %d files', whenTypesByFile.size);
464
+ debug('[when-ast] whenTypesByFile keys: %o', [...whenTypesByFile.keys()]);
465
+ if (!isValidSourceFile(sourceFile)) {
466
+ debug('[when-ast] sourceFile is null/undefined/empty, returning null');
467
+ return null;
468
+ }
469
+ const whenTypes = whenTypesByFile.get(sourceFile) || [];
470
+ debug('[when-ast] sourceFile=%s, ordinal=%d, whenTypes.length=%d', sourceFile, ordinal, whenTypes.length);
471
+ if (whenTypes.length > 0) {
472
+ debug('[when-ast] available types: %o', whenTypes.map((t) => ({ typeName: t.typeName, classification: t.classification })));
473
+ }
474
+ const matchingType = whenTypes[ordinal];
475
+ if (!isValidMatchingType(matchingType)) {
476
+ debug('[when-ast] No valid AST match for when at %s ordinal %d, falling back', sourceFile, ordinal);
477
+ return null;
478
+ }
479
+ const refType = getRefTypeFromClassification(matchingType.classification);
480
+ debug('[when-ast] ✅ AST match for when at %s ordinal %d: %s -> %s', sourceFile, ordinal, matchingType.typeName, refType);
481
+ return {
482
+ [refType]: matchingType.typeName,
483
+ exampleData: ensureMessageFormat(item).data,
484
+ };
485
+ }
486
+ function convertToCommandOrEventExample(item, contextParam, ordinal) {
487
+ if (ordinal !== undefined && ordinal >= 0) {
488
+ const astResult = tryGetWhenTypeFromAST(item, ordinal);
489
+ if (astResult)
490
+ return astResult;
491
+ }
492
+ // Fallback to the original logic
493
+ const message = ensureMessageFormat(item);
494
+ return {
495
+ commandRef: message.type,
496
+ exampleData: message.data,
497
+ ...(contextParam && { context: contextParam }),
498
+ };
499
+ }
500
+ function convertToOutcomeExample(item, sliceType, contextParam) {
501
+ const message = ensureMessageFormat(item);
502
+ // Check if it's an error
503
+ if (message.type === 'Error' || 'errorType' in message.data) {
504
+ return {
505
+ errorType: message.data.errorType || 'IllegalStateError',
506
+ message: message.data.message,
507
+ };
508
+ }
509
+ if (sliceType === 'command') {
510
+ return {
511
+ eventRef: message.type,
512
+ exampleData: message.data,
513
+ };
514
+ }
515
+ else if (sliceType === 'query') {
516
+ return {
517
+ stateRef: message.type,
518
+ exampleData: message.data,
519
+ };
520
+ }
521
+ else if (sliceType === 'react') {
522
+ return {
523
+ commandRef: message.type,
524
+ exampleData: message.data,
525
+ };
526
+ }
527
+ return {
528
+ eventRef: message.type,
529
+ exampleData: message.data,
530
+ ...(contextParam && { context: contextParam }),
531
+ };
532
+ }
533
+ function ensureMessageFormat(item) {
534
+ if (typeof item !== 'object' || item === null) {
535
+ throw new Error('Invalid message format');
536
+ }
537
+ const obj = item;
538
+ if ('type' in obj && typeof obj.type === 'string') {
539
+ return parseMessageObject(obj);
540
+ }
541
+ // Handle enhanced DSL format - pure data objects without type field
542
+ // The type will be inferred during schema processing from the TypeScript types
543
+ return {
544
+ type: 'InferredType', // Placeholder - will be resolved during schema generation
545
+ data: obj,
546
+ };
547
+ }
548
+ function parseMessageObject(obj) {
549
+ // Handle direct type/data structure
550
+ if (hasValidDataProperty(obj)) {
551
+ return { type: obj.type, data: obj.data };
552
+ }
553
+ // Handle builder format with __messageCategory
554
+ if ('__messageCategory' in obj) {
555
+ return parseBuilderFormat(obj);
556
+ }
557
+ // Handle legacy format where properties are at top level
558
+ return parseLegacyFormat(obj);
559
+ }
560
+ function hasValidDataProperty(obj) {
561
+ return 'data' in obj && typeof obj.data === 'object' && obj.data !== null;
562
+ }
563
+ function parseBuilderFormat(obj) {
564
+ const data = 'data' in obj
565
+ ? obj.data
566
+ : Object.fromEntries(Object.entries(obj).filter(([key]) => key !== 'type' && key !== '__messageCategory'));
567
+ return {
568
+ type: obj.type,
569
+ data,
570
+ };
571
+ }
572
+ function parseLegacyFormat(obj) {
573
+ const data = Object.fromEntries(Object.entries(obj).filter(([key]) => key !== 'type'));
574
+ return {
575
+ type: obj.type,
576
+ data,
577
+ };
578
+ }
579
+ //# sourceMappingURL=narrative-context.js.map