switchboard-cli 0.1.0-alpha.1 → 0.1.0-alpha.2

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 (907) hide show
  1. package/calibration/ledger/baselines/baseline-2026-04-09.yaml +1 -1
  2. package/calibration/ledger/history.yaml +9 -0
  3. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/diffs/adv-056e52eb6d09.yaml +9 -0
  4. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/diffs/blind-aa04e10023e9.yaml +9 -0
  5. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/escalations/esc-2bd30ef5717a30b3.yaml +15 -0
  6. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/manifest.yaml +8 -0
  7. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/seeds/adv-056e52eb6d09.yaml +7 -0
  8. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/seeds/blind-aa04e10023e9.yaml +8 -0
  9. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/summary.yaml +10 -0
  10. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/traces/adv-056e52eb6d09.yaml +141 -0
  11. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/traces/blind-aa04e10023e9.yaml +146 -0
  12. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-a/adv-056e52eb6d09.yaml +24 -0
  13. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-a/blind-aa04e10023e9.yaml +24 -0
  14. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-b/adv-056e52eb6d09.yaml +31 -0
  15. package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-b/blind-aa04e10023e9.yaml +32 -0
  16. package/node_modules/@switchboard/core/package.json +20 -0
  17. package/node_modules/@switchboard/core/src/activation.ts +285 -0
  18. package/node_modules/@switchboard/core/src/audited-receipt.ts +403 -0
  19. package/node_modules/@switchboard/core/src/budget-ledger.ts +223 -0
  20. package/node_modules/@switchboard/core/src/build-map.ts +327 -0
  21. package/node_modules/@switchboard/core/src/canonical-delta.ts +754 -0
  22. package/node_modules/@switchboard/core/src/canonical-pack.ts +400 -0
  23. package/node_modules/@switchboard/core/src/canonical.ts +248 -0
  24. package/node_modules/@switchboard/core/src/claim-spread.ts +219 -0
  25. package/node_modules/@switchboard/core/src/classifier.ts +207 -0
  26. package/node_modules/@switchboard/core/src/claude-executor.ts +37 -0
  27. package/node_modules/@switchboard/core/src/codex-audit.ts +301 -0
  28. package/node_modules/@switchboard/core/src/codex-executor.ts +22 -0
  29. package/node_modules/@switchboard/core/src/compiler-adapter.ts +284 -0
  30. package/node_modules/@switchboard/core/src/compiler.ts +183 -0
  31. package/node_modules/@switchboard/core/src/dispatch-formatter.ts +348 -0
  32. package/node_modules/@switchboard/core/src/dispatch-receipt.ts +135 -0
  33. package/node_modules/@switchboard/core/src/dossier.ts +229 -0
  34. package/node_modules/@switchboard/core/src/eval-scope.ts +208 -0
  35. package/node_modules/@switchboard/core/src/evaluation-lane.ts +584 -0
  36. package/node_modules/@switchboard/core/src/execution-trace.ts +455 -0
  37. package/node_modules/@switchboard/core/src/gate-state.ts +296 -0
  38. package/node_modules/@switchboard/core/src/gates.ts +198 -0
  39. package/node_modules/@switchboard/core/src/governance-envelope.ts +317 -0
  40. package/node_modules/@switchboard/core/src/handoff-v2.ts +221 -0
  41. package/node_modules/@switchboard/core/src/handoff-visibility.ts +204 -0
  42. package/node_modules/@switchboard/core/src/handoff.ts +87 -0
  43. package/node_modules/@switchboard/core/src/harness-compiler.ts +246 -0
  44. package/node_modules/@switchboard/core/src/index.ts +57 -0
  45. package/node_modules/@switchboard/core/src/ingest.ts +128 -0
  46. package/node_modules/@switchboard/core/src/launch-block-payload.ts +51 -0
  47. package/node_modules/@switchboard/core/src/ledger.ts +313 -0
  48. package/node_modules/@switchboard/core/src/live-event-bus.ts +37 -0
  49. package/node_modules/@switchboard/core/src/live-event.ts +238 -0
  50. package/node_modules/@switchboard/core/src/lock-readiness.ts +242 -0
  51. package/node_modules/@switchboard/core/src/loop-compiler.ts +152 -0
  52. package/node_modules/@switchboard/core/src/loop-validator.ts +55 -0
  53. package/node_modules/@switchboard/core/src/meta-harness.ts +411 -0
  54. package/node_modules/@switchboard/core/src/overflow-manifest.ts +220 -0
  55. package/node_modules/@switchboard/core/src/packet-integrity.ts +302 -0
  56. package/node_modules/@switchboard/core/src/parallel-conflict.ts +268 -0
  57. package/node_modules/@switchboard/core/src/preflight.ts +181 -0
  58. package/node_modules/@switchboard/core/src/pressure-assessment.ts +265 -0
  59. package/node_modules/@switchboard/core/src/product-objects.ts +99 -0
  60. package/node_modules/@switchboard/core/src/project-charter.ts +193 -0
  61. package/node_modules/@switchboard/core/src/proof-capture.ts +319 -0
  62. package/node_modules/@switchboard/core/src/provider-registry.ts +163 -0
  63. package/node_modules/@switchboard/core/src/receipt-v2.ts +904 -0
  64. package/node_modules/@switchboard/core/src/reconcile-matrix.ts +154 -0
  65. package/node_modules/@switchboard/core/src/reconcile-v2.ts +272 -0
  66. package/node_modules/@switchboard/core/src/reconcile.ts +450 -0
  67. package/node_modules/@switchboard/core/src/return-normalizer.ts +226 -0
  68. package/node_modules/@switchboard/core/src/router.ts +207 -0
  69. package/node_modules/@switchboard/core/src/routing-v2.ts +214 -0
  70. package/node_modules/@switchboard/core/src/run-snapshot.ts +405 -0
  71. package/node_modules/@switchboard/core/src/surface-playbooks.ts +36 -0
  72. package/node_modules/@switchboard/core/src/surface-profiles.ts +166 -0
  73. package/node_modules/@switchboard/core/src/synthesis-provider.ts +1114 -0
  74. package/node_modules/@switchboard/core/src/types.ts +3054 -0
  75. package/node_modules/@switchboard/projections/package.json +21 -0
  76. package/node_modules/@switchboard/projections/src/claude/index.ts +164 -0
  77. package/node_modules/@switchboard/projections/src/index.ts +160 -0
  78. package/node_modules/yaml/LICENSE +13 -0
  79. package/node_modules/yaml/README.md +172 -0
  80. package/node_modules/yaml/bin.mjs +11 -0
  81. package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
  82. package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
  83. package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
  84. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
  85. package/node_modules/yaml/browser/dist/compose/composer.js +217 -0
  86. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
  87. package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
  88. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
  89. package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  90. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
  91. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
  92. package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
  93. package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  94. package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
  95. package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  96. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
  97. package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
  98. package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
  99. package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
  100. package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
  101. package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
  102. package/node_modules/yaml/browser/dist/errors.js +57 -0
  103. package/node_modules/yaml/browser/dist/index.js +17 -0
  104. package/node_modules/yaml/browser/dist/log.js +11 -0
  105. package/node_modules/yaml/browser/dist/nodes/Alias.js +114 -0
  106. package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
  107. package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
  108. package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  109. package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
  110. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
  111. package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
  112. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
  113. package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
  114. package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
  115. package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
  116. package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  117. package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  118. package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  119. package/node_modules/yaml/browser/dist/parse/lexer.js +717 -0
  120. package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  121. package/node_modules/yaml/browser/dist/parse/parser.js +967 -0
  122. package/node_modules/yaml/browser/dist/public-api.js +102 -0
  123. package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
  124. package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
  125. package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
  126. package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
  127. package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  128. package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  129. package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  130. package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  131. package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  132. package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  133. package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
  134. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
  135. package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  136. package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  137. package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  138. package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +64 -0
  139. package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
  140. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
  141. package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
  142. package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
  143. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  144. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
  145. package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
  146. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
  147. package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
  148. package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
  149. package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
  150. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
  151. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
  152. package/node_modules/yaml/browser/dist/util.js +11 -0
  153. package/node_modules/yaml/browser/dist/visit.js +233 -0
  154. package/node_modules/yaml/browser/index.js +5 -0
  155. package/node_modules/yaml/browser/package.json +3 -0
  156. package/node_modules/yaml/dist/cli.d.ts +8 -0
  157. package/node_modules/yaml/dist/cli.mjs +201 -0
  158. package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
  159. package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
  160. package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
  161. package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
  162. package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
  163. package/node_modules/yaml/dist/compose/compose-node.js +112 -0
  164. package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  165. package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
  166. package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
  167. package/node_modules/yaml/dist/compose/composer.js +222 -0
  168. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  169. package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
  170. package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
  171. package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
  172. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
  173. package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
  174. package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  175. package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  176. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
  177. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
  178. package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  179. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
  180. package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
  181. package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
  182. package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  183. package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  184. package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  185. package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
  186. package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  187. package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  188. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  189. package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
  190. package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
  191. package/node_modules/yaml/dist/doc/Document.js +337 -0
  192. package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  193. package/node_modules/yaml/dist/doc/anchors.js +76 -0
  194. package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  195. package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
  196. package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  197. package/node_modules/yaml/dist/doc/createNode.js +90 -0
  198. package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
  199. package/node_modules/yaml/dist/doc/directives.js +178 -0
  200. package/node_modules/yaml/dist/errors.d.ts +21 -0
  201. package/node_modules/yaml/dist/errors.js +62 -0
  202. package/node_modules/yaml/dist/index.d.ts +25 -0
  203. package/node_modules/yaml/dist/index.js +50 -0
  204. package/node_modules/yaml/dist/log.d.ts +3 -0
  205. package/node_modules/yaml/dist/log.js +19 -0
  206. package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
  207. package/node_modules/yaml/dist/nodes/Alias.js +116 -0
  208. package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  209. package/node_modules/yaml/dist/nodes/Collection.js +151 -0
  210. package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  211. package/node_modules/yaml/dist/nodes/Node.js +40 -0
  212. package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
  213. package/node_modules/yaml/dist/nodes/Pair.js +39 -0
  214. package/node_modules/yaml/dist/nodes/Scalar.d.ts +43 -0
  215. package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
  216. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
  217. package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
  218. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
  219. package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
  220. package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
  221. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
  222. package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
  223. package/node_modules/yaml/dist/nodes/identity.js +53 -0
  224. package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
  225. package/node_modules/yaml/dist/nodes/toJS.js +39 -0
  226. package/node_modules/yaml/dist/options.d.ts +350 -0
  227. package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  228. package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
  229. package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  230. package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  231. package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  232. package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  233. package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
  234. package/node_modules/yaml/dist/parse/cst.js +112 -0
  235. package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  236. package/node_modules/yaml/dist/parse/lexer.js +719 -0
  237. package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  238. package/node_modules/yaml/dist/parse/line-counter.js +41 -0
  239. package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  240. package/node_modules/yaml/dist/parse/parser.js +972 -0
  241. package/node_modules/yaml/dist/public-api.d.ts +44 -0
  242. package/node_modules/yaml/dist/public-api.js +107 -0
  243. package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
  244. package/node_modules/yaml/dist/schema/Schema.js +39 -0
  245. package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  246. package/node_modules/yaml/dist/schema/common/map.js +19 -0
  247. package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  248. package/node_modules/yaml/dist/schema/common/null.js +17 -0
  249. package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  250. package/node_modules/yaml/dist/schema/common/seq.js +19 -0
  251. package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  252. package/node_modules/yaml/dist/schema/common/string.js +16 -0
  253. package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  254. package/node_modules/yaml/dist/schema/core/bool.js +21 -0
  255. package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  256. package/node_modules/yaml/dist/schema/core/float.js +47 -0
  257. package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  258. package/node_modules/yaml/dist/schema/core/int.js +42 -0
  259. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  260. package/node_modules/yaml/dist/schema/core/schema.js +25 -0
  261. package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  262. package/node_modules/yaml/dist/schema/json/schema.js +64 -0
  263. package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
  264. package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
  265. package/node_modules/yaml/dist/schema/tags.js +99 -0
  266. package/node_modules/yaml/dist/schema/types.d.ts +92 -0
  267. package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  268. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
  269. package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  270. package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  271. package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  272. package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  273. package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  274. package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  275. package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
  276. package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +68 -0
  277. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
  278. package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
  279. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  280. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
  281. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  282. package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
  283. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
  284. package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
  285. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  286. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  287. package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  288. package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
  289. package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
  290. package/node_modules/yaml/dist/stringify/stringify.js +132 -0
  291. package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  292. package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
  293. package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  294. package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
  295. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
  296. package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
  297. package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  298. package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
  299. package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  300. package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
  301. package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
  302. package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
  303. package/node_modules/yaml/dist/test-events.d.ts +4 -0
  304. package/node_modules/yaml/dist/test-events.js +134 -0
  305. package/node_modules/yaml/dist/util.d.ts +16 -0
  306. package/node_modules/yaml/dist/util.js +28 -0
  307. package/node_modules/yaml/dist/visit.d.ts +102 -0
  308. package/node_modules/yaml/dist/visit.js +236 -0
  309. package/node_modules/yaml/package.json +97 -0
  310. package/node_modules/yaml/util.js +2 -0
  311. package/node_modules/zod/LICENSE +21 -0
  312. package/node_modules/zod/README.md +208 -0
  313. package/node_modules/zod/index.cjs +33 -0
  314. package/node_modules/zod/index.d.cts +4 -0
  315. package/node_modules/zod/index.d.ts +4 -0
  316. package/node_modules/zod/index.js +4 -0
  317. package/node_modules/zod/package.json +118 -0
  318. package/node_modules/zod/src/index.ts +4 -0
  319. package/node_modules/zod/src/v3/ZodError.ts +330 -0
  320. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  321. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  322. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  323. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  324. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  325. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  326. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  327. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  328. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  329. package/node_modules/zod/src/v3/errors.ts +13 -0
  330. package/node_modules/zod/src/v3/external.ts +6 -0
  331. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  332. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  333. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  334. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  335. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  336. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  337. package/node_modules/zod/src/v3/index.ts +4 -0
  338. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  339. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  340. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  341. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  342. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  343. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  344. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  345. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  346. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  347. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  348. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  349. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  350. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  351. package/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
  352. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  353. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  354. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  355. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  356. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  357. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  358. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  359. package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
  360. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  361. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  362. package/node_modules/zod/src/v3/tests/function.test.ts +257 -0
  363. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  364. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  365. package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
  366. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  367. package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
  368. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  369. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  370. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  371. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  372. package/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
  373. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  374. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  375. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  376. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  377. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  378. package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
  379. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  380. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  381. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  382. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  383. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  384. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  385. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  386. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  387. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  388. package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
  389. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  390. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  391. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  392. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  393. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  394. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  395. package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
  396. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  397. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  398. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  399. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  400. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  401. package/node_modules/zod/src/v3/types.ts +5136 -0
  402. package/node_modules/zod/src/v4/classic/checks.ts +30 -0
  403. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  404. package/node_modules/zod/src/v4/classic/compat.ts +66 -0
  405. package/node_modules/zod/src/v4/classic/errors.ts +75 -0
  406. package/node_modules/zod/src/v4/classic/external.ts +50 -0
  407. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  408. package/node_modules/zod/src/v4/classic/iso.ts +90 -0
  409. package/node_modules/zod/src/v4/classic/parse.ts +33 -0
  410. package/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
  411. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  412. package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  413. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
  414. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  415. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  416. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  417. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
  418. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
  419. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
  420. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  421. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  422. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
  423. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  424. package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
  425. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
  426. package/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
  427. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  428. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
  429. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
  430. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
  431. package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
  432. package/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
  433. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
  434. package/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
  435. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  436. package/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
  437. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
  438. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
  439. package/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
  440. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
  441. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
  442. package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
  443. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  444. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  445. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
  446. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  447. package/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
  448. package/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
  449. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
  450. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
  451. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
  452. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
  453. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
  454. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
  455. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  456. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  457. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  458. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
  459. package/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
  460. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
  461. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
  462. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
  463. package/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
  464. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
  465. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
  466. package/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
  467. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
  468. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
  469. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
  470. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
  471. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
  472. package/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
  473. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  474. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  475. package/node_modules/zod/src/v4/core/api.ts +1594 -0
  476. package/node_modules/zod/src/v4/core/checks.ts +1283 -0
  477. package/node_modules/zod/src/v4/core/config.ts +15 -0
  478. package/node_modules/zod/src/v4/core/core.ts +134 -0
  479. package/node_modules/zod/src/v4/core/doc.ts +44 -0
  480. package/node_modules/zod/src/v4/core/errors.ts +424 -0
  481. package/node_modules/zod/src/v4/core/function.ts +176 -0
  482. package/node_modules/zod/src/v4/core/index.ts +15 -0
  483. package/node_modules/zod/src/v4/core/json-schema.ts +143 -0
  484. package/node_modules/zod/src/v4/core/parse.ts +94 -0
  485. package/node_modules/zod/src/v4/core/regexes.ts +135 -0
  486. package/node_modules/zod/src/v4/core/registries.ts +96 -0
  487. package/node_modules/zod/src/v4/core/schemas.ts +3842 -0
  488. package/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
  489. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  490. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  491. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  492. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  493. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  494. package/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
  495. package/node_modules/zod/src/v4/core/util.ts +775 -0
  496. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  497. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  498. package/node_modules/zod/src/v4/index.ts +4 -0
  499. package/node_modules/zod/src/v4/locales/ar.ts +125 -0
  500. package/node_modules/zod/src/v4/locales/az.ts +121 -0
  501. package/node_modules/zod/src/v4/locales/be.ts +184 -0
  502. package/node_modules/zod/src/v4/locales/ca.ts +127 -0
  503. package/node_modules/zod/src/v4/locales/cs.ts +142 -0
  504. package/node_modules/zod/src/v4/locales/de.ts +124 -0
  505. package/node_modules/zod/src/v4/locales/en.ts +127 -0
  506. package/node_modules/zod/src/v4/locales/eo.ts +125 -0
  507. package/node_modules/zod/src/v4/locales/es.ts +125 -0
  508. package/node_modules/zod/src/v4/locales/fa.ts +134 -0
  509. package/node_modules/zod/src/v4/locales/fi.ts +131 -0
  510. package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
  511. package/node_modules/zod/src/v4/locales/fr.ts +124 -0
  512. package/node_modules/zod/src/v4/locales/he.ts +125 -0
  513. package/node_modules/zod/src/v4/locales/hu.ts +126 -0
  514. package/node_modules/zod/src/v4/locales/id.ts +125 -0
  515. package/node_modules/zod/src/v4/locales/index.ts +39 -0
  516. package/node_modules/zod/src/v4/locales/it.ts +125 -0
  517. package/node_modules/zod/src/v4/locales/ja.ts +122 -0
  518. package/node_modules/zod/src/v4/locales/kh.ts +126 -0
  519. package/node_modules/zod/src/v4/locales/ko.ts +131 -0
  520. package/node_modules/zod/src/v4/locales/mk.ts +127 -0
  521. package/node_modules/zod/src/v4/locales/ms.ts +124 -0
  522. package/node_modules/zod/src/v4/locales/nl.ts +126 -0
  523. package/node_modules/zod/src/v4/locales/no.ts +124 -0
  524. package/node_modules/zod/src/v4/locales/ota.ts +125 -0
  525. package/node_modules/zod/src/v4/locales/pl.ts +126 -0
  526. package/node_modules/zod/src/v4/locales/ps.ts +133 -0
  527. package/node_modules/zod/src/v4/locales/pt.ts +123 -0
  528. package/node_modules/zod/src/v4/locales/ru.ts +184 -0
  529. package/node_modules/zod/src/v4/locales/sl.ts +126 -0
  530. package/node_modules/zod/src/v4/locales/sv.ts +127 -0
  531. package/node_modules/zod/src/v4/locales/ta.ts +125 -0
  532. package/node_modules/zod/src/v4/locales/th.ts +126 -0
  533. package/node_modules/zod/src/v4/locales/tr.ts +121 -0
  534. package/node_modules/zod/src/v4/locales/ua.ts +126 -0
  535. package/node_modules/zod/src/v4/locales/ur.ts +126 -0
  536. package/node_modules/zod/src/v4/locales/vi.ts +125 -0
  537. package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
  538. package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
  539. package/node_modules/zod/src/v4/mini/checks.ts +32 -0
  540. package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
  541. package/node_modules/zod/src/v4/mini/external.ts +40 -0
  542. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  543. package/node_modules/zod/src/v4/mini/iso.ts +62 -0
  544. package/node_modules/zod/src/v4/mini/parse.ts +1 -0
  545. package/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
  546. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
  547. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
  548. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
  549. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  550. package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
  551. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
  552. package/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
  553. package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
  554. package/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
  555. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  556. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
  557. package/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
  558. package/node_modules/zod/src/v4-mini/index.ts +1 -0
  559. package/node_modules/zod/v3/ZodError.cjs +138 -0
  560. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  561. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  562. package/node_modules/zod/v3/ZodError.js +133 -0
  563. package/node_modules/zod/v3/errors.cjs +17 -0
  564. package/node_modules/zod/v3/errors.d.cts +5 -0
  565. package/node_modules/zod/v3/errors.d.ts +5 -0
  566. package/node_modules/zod/v3/errors.js +9 -0
  567. package/node_modules/zod/v3/external.cjs +22 -0
  568. package/node_modules/zod/v3/external.d.cts +6 -0
  569. package/node_modules/zod/v3/external.d.ts +6 -0
  570. package/node_modules/zod/v3/external.js +6 -0
  571. package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  572. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  573. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  574. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  575. package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  576. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  577. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  578. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  579. package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  580. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  581. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  582. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  583. package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  584. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  585. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  586. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  587. package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  588. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  589. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  590. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  591. package/node_modules/zod/v3/helpers/util.cjs +137 -0
  592. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  593. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  594. package/node_modules/zod/v3/helpers/util.js +133 -0
  595. package/node_modules/zod/v3/index.cjs +33 -0
  596. package/node_modules/zod/v3/index.d.cts +4 -0
  597. package/node_modules/zod/v3/index.d.ts +4 -0
  598. package/node_modules/zod/v3/index.js +4 -0
  599. package/node_modules/zod/v3/locales/en.cjs +111 -0
  600. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  601. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  602. package/node_modules/zod/v3/locales/en.js +109 -0
  603. package/node_modules/zod/v3/standard-schema.cjs +2 -0
  604. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  605. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  606. package/node_modules/zod/v3/standard-schema.js +1 -0
  607. package/node_modules/zod/v3/types.cjs +3775 -0
  608. package/node_modules/zod/v3/types.d.cts +1031 -0
  609. package/node_modules/zod/v3/types.d.ts +1031 -0
  610. package/node_modules/zod/v3/types.js +3693 -0
  611. package/node_modules/zod/v4/classic/checks.cjs +32 -0
  612. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  613. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  614. package/node_modules/zod/v4/classic/checks.js +1 -0
  615. package/node_modules/zod/v4/classic/coerce.cjs +47 -0
  616. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  617. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  618. package/node_modules/zod/v4/classic/coerce.js +17 -0
  619. package/node_modules/zod/v4/classic/compat.cjs +57 -0
  620. package/node_modules/zod/v4/classic/compat.d.cts +46 -0
  621. package/node_modules/zod/v4/classic/compat.d.ts +46 -0
  622. package/node_modules/zod/v4/classic/compat.js +27 -0
  623. package/node_modules/zod/v4/classic/errors.cjs +67 -0
  624. package/node_modules/zod/v4/classic/errors.d.cts +30 -0
  625. package/node_modules/zod/v4/classic/errors.d.ts +30 -0
  626. package/node_modules/zod/v4/classic/errors.js +41 -0
  627. package/node_modules/zod/v4/classic/external.cjs +70 -0
  628. package/node_modules/zod/v4/classic/external.d.cts +13 -0
  629. package/node_modules/zod/v4/classic/external.d.ts +13 -0
  630. package/node_modules/zod/v4/classic/external.js +18 -0
  631. package/node_modules/zod/v4/classic/index.cjs +33 -0
  632. package/node_modules/zod/v4/classic/index.d.cts +4 -0
  633. package/node_modules/zod/v4/classic/index.d.ts +4 -0
  634. package/node_modules/zod/v4/classic/index.js +4 -0
  635. package/node_modules/zod/v4/classic/iso.cjs +60 -0
  636. package/node_modules/zod/v4/classic/iso.d.cts +22 -0
  637. package/node_modules/zod/v4/classic/iso.d.ts +22 -0
  638. package/node_modules/zod/v4/classic/iso.js +30 -0
  639. package/node_modules/zod/v4/classic/parse.cjs +32 -0
  640. package/node_modules/zod/v4/classic/parse.d.cts +23 -0
  641. package/node_modules/zod/v4/classic/parse.d.ts +23 -0
  642. package/node_modules/zod/v4/classic/parse.js +6 -0
  643. package/node_modules/zod/v4/classic/schemas.cjs +1109 -0
  644. package/node_modules/zod/v4/classic/schemas.d.cts +630 -0
  645. package/node_modules/zod/v4/classic/schemas.d.ts +630 -0
  646. package/node_modules/zod/v4/classic/schemas.js +1006 -0
  647. package/node_modules/zod/v4/core/api.cjs +1039 -0
  648. package/node_modules/zod/v4/core/api.d.cts +284 -0
  649. package/node_modules/zod/v4/core/api.d.ts +284 -0
  650. package/node_modules/zod/v4/core/api.js +906 -0
  651. package/node_modules/zod/v4/core/checks.cjs +591 -0
  652. package/node_modules/zod/v4/core/checks.d.cts +278 -0
  653. package/node_modules/zod/v4/core/checks.d.ts +278 -0
  654. package/node_modules/zod/v4/core/checks.js +565 -0
  655. package/node_modules/zod/v4/core/core.cjs +67 -0
  656. package/node_modules/zod/v4/core/core.d.cts +49 -0
  657. package/node_modules/zod/v4/core/core.d.ts +49 -0
  658. package/node_modules/zod/v4/core/core.js +61 -0
  659. package/node_modules/zod/v4/core/doc.cjs +39 -0
  660. package/node_modules/zod/v4/core/doc.d.cts +14 -0
  661. package/node_modules/zod/v4/core/doc.d.ts +14 -0
  662. package/node_modules/zod/v4/core/doc.js +35 -0
  663. package/node_modules/zod/v4/core/errors.cjs +226 -0
  664. package/node_modules/zod/v4/core/errors.d.cts +208 -0
  665. package/node_modules/zod/v4/core/errors.d.ts +208 -0
  666. package/node_modules/zod/v4/core/errors.js +195 -0
  667. package/node_modules/zod/v4/core/function.cjs +102 -0
  668. package/node_modules/zod/v4/core/function.d.cts +52 -0
  669. package/node_modules/zod/v4/core/function.d.ts +52 -0
  670. package/node_modules/zod/v4/core/function.js +75 -0
  671. package/node_modules/zod/v4/core/index.cjs +44 -0
  672. package/node_modules/zod/v4/core/index.d.cts +15 -0
  673. package/node_modules/zod/v4/core/index.d.ts +15 -0
  674. package/node_modules/zod/v4/core/index.js +15 -0
  675. package/node_modules/zod/v4/core/json-schema.cjs +2 -0
  676. package/node_modules/zod/v4/core/json-schema.d.cts +87 -0
  677. package/node_modules/zod/v4/core/json-schema.d.ts +87 -0
  678. package/node_modules/zod/v4/core/json-schema.js +1 -0
  679. package/node_modules/zod/v4/core/parse.cjs +87 -0
  680. package/node_modules/zod/v4/core/parse.d.cts +25 -0
  681. package/node_modules/zod/v4/core/parse.d.ts +25 -0
  682. package/node_modules/zod/v4/core/parse.js +57 -0
  683. package/node_modules/zod/v4/core/regexes.cjs +103 -0
  684. package/node_modules/zod/v4/core/regexes.d.cts +62 -0
  685. package/node_modules/zod/v4/core/regexes.d.ts +62 -0
  686. package/node_modules/zod/v4/core/regexes.js +95 -0
  687. package/node_modules/zod/v4/core/registries.cjs +56 -0
  688. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  689. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  690. package/node_modules/zod/v4/core/registries.js +51 -0
  691. package/node_modules/zod/v4/core/schemas.cjs +1748 -0
  692. package/node_modules/zod/v4/core/schemas.d.cts +1041 -0
  693. package/node_modules/zod/v4/core/schemas.d.ts +1041 -0
  694. package/node_modules/zod/v4/core/schemas.js +1717 -0
  695. package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
  696. package/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
  697. package/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
  698. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  699. package/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
  700. package/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
  701. package/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
  702. package/node_modules/zod/v4/core/to-json-schema.js +849 -0
  703. package/node_modules/zod/v4/core/util.cjs +539 -0
  704. package/node_modules/zod/v4/core/util.d.cts +183 -0
  705. package/node_modules/zod/v4/core/util.d.ts +183 -0
  706. package/node_modules/zod/v4/core/util.js +493 -0
  707. package/node_modules/zod/v4/core/versions.cjs +8 -0
  708. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  709. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  710. package/node_modules/zod/v4/core/versions.js +5 -0
  711. package/node_modules/zod/v4/index.cjs +22 -0
  712. package/node_modules/zod/v4/index.d.cts +3 -0
  713. package/node_modules/zod/v4/index.d.ts +3 -0
  714. package/node_modules/zod/v4/index.js +3 -0
  715. package/node_modules/zod/v4/locales/ar.cjs +142 -0
  716. package/node_modules/zod/v4/locales/ar.d.cts +4 -0
  717. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  718. package/node_modules/zod/v4/locales/ar.js +116 -0
  719. package/node_modules/zod/v4/locales/az.cjs +141 -0
  720. package/node_modules/zod/v4/locales/az.d.cts +4 -0
  721. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  722. package/node_modules/zod/v4/locales/az.js +115 -0
  723. package/node_modules/zod/v4/locales/be.cjs +190 -0
  724. package/node_modules/zod/v4/locales/be.d.cts +4 -0
  725. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  726. package/node_modules/zod/v4/locales/be.js +164 -0
  727. package/node_modules/zod/v4/locales/ca.cjs +144 -0
  728. package/node_modules/zod/v4/locales/ca.d.cts +4 -0
  729. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  730. package/node_modules/zod/v4/locales/ca.js +118 -0
  731. package/node_modules/zod/v4/locales/cs.cjs +161 -0
  732. package/node_modules/zod/v4/locales/cs.d.cts +4 -0
  733. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  734. package/node_modules/zod/v4/locales/cs.js +135 -0
  735. package/node_modules/zod/v4/locales/de.cjs +142 -0
  736. package/node_modules/zod/v4/locales/de.d.cts +4 -0
  737. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  738. package/node_modules/zod/v4/locales/de.js +116 -0
  739. package/node_modules/zod/v4/locales/en.cjs +145 -0
  740. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  741. package/node_modules/zod/v4/locales/en.d.ts +5 -0
  742. package/node_modules/zod/v4/locales/en.js +117 -0
  743. package/node_modules/zod/v4/locales/eo.cjs +144 -0
  744. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  745. package/node_modules/zod/v4/locales/eo.d.ts +5 -0
  746. package/node_modules/zod/v4/locales/eo.js +116 -0
  747. package/node_modules/zod/v4/locales/es.cjs +143 -0
  748. package/node_modules/zod/v4/locales/es.d.cts +4 -0
  749. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  750. package/node_modules/zod/v4/locales/es.js +117 -0
  751. package/node_modules/zod/v4/locales/fa.cjs +148 -0
  752. package/node_modules/zod/v4/locales/fa.d.cts +4 -0
  753. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  754. package/node_modules/zod/v4/locales/fa.js +122 -0
  755. package/node_modules/zod/v4/locales/fi.cjs +148 -0
  756. package/node_modules/zod/v4/locales/fi.d.cts +4 -0
  757. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  758. package/node_modules/zod/v4/locales/fi.js +122 -0
  759. package/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
  760. package/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
  761. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  762. package/node_modules/zod/v4/locales/fr-CA.js +117 -0
  763. package/node_modules/zod/v4/locales/fr.cjs +142 -0
  764. package/node_modules/zod/v4/locales/fr.d.cts +4 -0
  765. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  766. package/node_modules/zod/v4/locales/fr.js +116 -0
  767. package/node_modules/zod/v4/locales/he.cjs +143 -0
  768. package/node_modules/zod/v4/locales/he.d.cts +4 -0
  769. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  770. package/node_modules/zod/v4/locales/he.js +117 -0
  771. package/node_modules/zod/v4/locales/hu.cjs +143 -0
  772. package/node_modules/zod/v4/locales/hu.d.cts +4 -0
  773. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  774. package/node_modules/zod/v4/locales/hu.js +117 -0
  775. package/node_modules/zod/v4/locales/id.cjs +142 -0
  776. package/node_modules/zod/v4/locales/id.d.cts +4 -0
  777. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  778. package/node_modules/zod/v4/locales/id.js +116 -0
  779. package/node_modules/zod/v4/locales/index.cjs +84 -0
  780. package/node_modules/zod/v4/locales/index.d.cts +39 -0
  781. package/node_modules/zod/v4/locales/index.d.ts +39 -0
  782. package/node_modules/zod/v4/locales/index.js +39 -0
  783. package/node_modules/zod/v4/locales/it.cjs +143 -0
  784. package/node_modules/zod/v4/locales/it.d.cts +4 -0
  785. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  786. package/node_modules/zod/v4/locales/it.js +117 -0
  787. package/node_modules/zod/v4/locales/ja.cjs +141 -0
  788. package/node_modules/zod/v4/locales/ja.d.cts +4 -0
  789. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  790. package/node_modules/zod/v4/locales/ja.js +115 -0
  791. package/node_modules/zod/v4/locales/kh.cjs +143 -0
  792. package/node_modules/zod/v4/locales/kh.d.cts +4 -0
  793. package/node_modules/zod/v4/locales/kh.d.ts +4 -0
  794. package/node_modules/zod/v4/locales/kh.js +117 -0
  795. package/node_modules/zod/v4/locales/ko.cjs +147 -0
  796. package/node_modules/zod/v4/locales/ko.d.cts +4 -0
  797. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  798. package/node_modules/zod/v4/locales/ko.js +121 -0
  799. package/node_modules/zod/v4/locales/mk.cjs +144 -0
  800. package/node_modules/zod/v4/locales/mk.d.cts +4 -0
  801. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  802. package/node_modules/zod/v4/locales/mk.js +118 -0
  803. package/node_modules/zod/v4/locales/ms.cjs +142 -0
  804. package/node_modules/zod/v4/locales/ms.d.cts +4 -0
  805. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  806. package/node_modules/zod/v4/locales/ms.js +116 -0
  807. package/node_modules/zod/v4/locales/nl.cjs +143 -0
  808. package/node_modules/zod/v4/locales/nl.d.cts +4 -0
  809. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  810. package/node_modules/zod/v4/locales/nl.js +117 -0
  811. package/node_modules/zod/v4/locales/no.cjs +142 -0
  812. package/node_modules/zod/v4/locales/no.d.cts +4 -0
  813. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  814. package/node_modules/zod/v4/locales/no.js +116 -0
  815. package/node_modules/zod/v4/locales/ota.cjs +143 -0
  816. package/node_modules/zod/v4/locales/ota.d.cts +4 -0
  817. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  818. package/node_modules/zod/v4/locales/ota.js +117 -0
  819. package/node_modules/zod/v4/locales/pl.cjs +143 -0
  820. package/node_modules/zod/v4/locales/pl.d.cts +4 -0
  821. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  822. package/node_modules/zod/v4/locales/pl.js +117 -0
  823. package/node_modules/zod/v4/locales/ps.cjs +148 -0
  824. package/node_modules/zod/v4/locales/ps.d.cts +4 -0
  825. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  826. package/node_modules/zod/v4/locales/ps.js +122 -0
  827. package/node_modules/zod/v4/locales/pt.cjs +142 -0
  828. package/node_modules/zod/v4/locales/pt.d.cts +4 -0
  829. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  830. package/node_modules/zod/v4/locales/pt.js +116 -0
  831. package/node_modules/zod/v4/locales/ru.cjs +190 -0
  832. package/node_modules/zod/v4/locales/ru.d.cts +4 -0
  833. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  834. package/node_modules/zod/v4/locales/ru.js +164 -0
  835. package/node_modules/zod/v4/locales/sl.cjs +143 -0
  836. package/node_modules/zod/v4/locales/sl.d.cts +4 -0
  837. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  838. package/node_modules/zod/v4/locales/sl.js +117 -0
  839. package/node_modules/zod/v4/locales/sv.cjs +144 -0
  840. package/node_modules/zod/v4/locales/sv.d.cts +4 -0
  841. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  842. package/node_modules/zod/v4/locales/sv.js +118 -0
  843. package/node_modules/zod/v4/locales/ta.cjs +143 -0
  844. package/node_modules/zod/v4/locales/ta.d.cts +4 -0
  845. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  846. package/node_modules/zod/v4/locales/ta.js +117 -0
  847. package/node_modules/zod/v4/locales/th.cjs +143 -0
  848. package/node_modules/zod/v4/locales/th.d.cts +4 -0
  849. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  850. package/node_modules/zod/v4/locales/th.js +117 -0
  851. package/node_modules/zod/v4/locales/tr.cjs +143 -0
  852. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  853. package/node_modules/zod/v4/locales/tr.d.ts +5 -0
  854. package/node_modules/zod/v4/locales/tr.js +115 -0
  855. package/node_modules/zod/v4/locales/ua.cjs +143 -0
  856. package/node_modules/zod/v4/locales/ua.d.cts +4 -0
  857. package/node_modules/zod/v4/locales/ua.d.ts +4 -0
  858. package/node_modules/zod/v4/locales/ua.js +117 -0
  859. package/node_modules/zod/v4/locales/ur.cjs +143 -0
  860. package/node_modules/zod/v4/locales/ur.d.cts +4 -0
  861. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  862. package/node_modules/zod/v4/locales/ur.js +117 -0
  863. package/node_modules/zod/v4/locales/vi.cjs +142 -0
  864. package/node_modules/zod/v4/locales/vi.d.cts +4 -0
  865. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  866. package/node_modules/zod/v4/locales/vi.js +116 -0
  867. package/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
  868. package/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
  869. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  870. package/node_modules/zod/v4/locales/zh-CN.js +116 -0
  871. package/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
  872. package/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
  873. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  874. package/node_modules/zod/v4/locales/zh-TW.js +117 -0
  875. package/node_modules/zod/v4/mini/checks.cjs +34 -0
  876. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  877. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  878. package/node_modules/zod/v4/mini/checks.js +1 -0
  879. package/node_modules/zod/v4/mini/coerce.cjs +47 -0
  880. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  881. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  882. package/node_modules/zod/v4/mini/coerce.js +17 -0
  883. package/node_modules/zod/v4/mini/external.cjs +62 -0
  884. package/node_modules/zod/v4/mini/external.d.cts +11 -0
  885. package/node_modules/zod/v4/mini/external.d.ts +11 -0
  886. package/node_modules/zod/v4/mini/external.js +13 -0
  887. package/node_modules/zod/v4/mini/index.cjs +32 -0
  888. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  889. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  890. package/node_modules/zod/v4/mini/index.js +3 -0
  891. package/node_modules/zod/v4/mini/iso.cjs +60 -0
  892. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  893. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  894. package/node_modules/zod/v4/mini/iso.js +30 -0
  895. package/node_modules/zod/v4/mini/parse.cjs +8 -0
  896. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  897. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  898. package/node_modules/zod/v4/mini/parse.js +1 -0
  899. package/node_modules/zod/v4/mini/schemas.cjs +839 -0
  900. package/node_modules/zod/v4/mini/schemas.d.cts +356 -0
  901. package/node_modules/zod/v4/mini/schemas.d.ts +356 -0
  902. package/node_modules/zod/v4/mini/schemas.js +732 -0
  903. package/node_modules/zod/v4-mini/index.cjs +17 -0
  904. package/node_modules/zod/v4-mini/index.d.cts +1 -0
  905. package/node_modules/zod/v4-mini/index.d.ts +1 -0
  906. package/node_modules/zod/v4-mini/index.js +1 -0
  907. package/package.json +10 -20
@@ -0,0 +1,1114 @@
1
+ import type {
2
+ ActivationInput,
3
+ FollowUpQuestion,
4
+ InferredChip,
5
+ IntakeAnalysis,
6
+ ResearchAngle,
7
+ ResearchClassification,
8
+ RoutingResult,
9
+ SynthesizedSeed,
10
+ } from "./types";
11
+ import {
12
+ intakeAnalysisSchema,
13
+ researchClassificationSchema,
14
+ synthesizedSeedSchema,
15
+ } from "./types";
16
+
17
+ // ---------------------------------------------------------------------------
18
+ // Interface — exactly 3 methods, no more.
19
+ // ---------------------------------------------------------------------------
20
+
21
+ export interface SynthesisProvider {
22
+ extractSeed(input: ActivationInput): SynthesizedSeed;
23
+ classifyResearchAngles(seed: SynthesizedSeed): ResearchClassification;
24
+ generateBrief(
25
+ input: ActivationInput,
26
+ seed: SynthesizedSeed,
27
+ route: RoutingResult,
28
+ ): string;
29
+ }
30
+
31
+ // ---------------------------------------------------------------------------
32
+ // Helpers
33
+ // ---------------------------------------------------------------------------
34
+
35
+ function compact(text: string) {
36
+ return text.replace(/\s+/g, " ").trim();
37
+ }
38
+
39
+ function truncate(text: string, limit = 180) {
40
+ const c = compact(text);
41
+ return c.length <= limit ? c : `${c.slice(0, limit - 1).trimEnd()}…`;
42
+ }
43
+
44
+ function sentence(text: string) {
45
+ return (
46
+ text
47
+ .split(/[\n.!?]/)
48
+ .map((p) => compact(p))
49
+ .find(Boolean) ?? truncate(text, 120)
50
+ );
51
+ }
52
+
53
+ function titleCase(text: string) {
54
+ return text
55
+ .split(/\s+/)
56
+ .filter(Boolean)
57
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
58
+ .join(" ");
59
+ }
60
+
61
+ function slugify(value: string) {
62
+ return value
63
+ .toLowerCase()
64
+ .replace(/[^a-z0-9]+/g, "-")
65
+ .replace(/^-+|-+$/g, "")
66
+ .slice(0, 50);
67
+ }
68
+
69
+ // ---------------------------------------------------------------------------
70
+ // Problem / solution split
71
+ // ---------------------------------------------------------------------------
72
+
73
+ const SOLUTION_MARKERS_FOR_SPLIT = [
74
+ " that helps ", " that turns ", " that converts ", " that takes ",
75
+ " which helps ", " which turns ",
76
+ " it turns ", " it helps ", " it takes ", " it converts ",
77
+ " to help ", " designed to ", " built to ", " meant to ",
78
+ ];
79
+
80
+ function splitProblemSolution(raw: string): { problem: string; solution: string } {
81
+ const normalized = compact(raw);
82
+ const lowerNorm = normalized.toLowerCase();
83
+
84
+ // Strategy 1: Find explicit pain sentences in the full text
85
+ // Look for "Right now..." or "The problem is..." deeper in the input
86
+ const sentences = raw.split(/(?<=[.!?\n])\s+/).map((s) => compact(s)).filter((s) => s.length > 15);
87
+ const painSentences: string[] = [];
88
+ const solutionSentences: string[] = [];
89
+
90
+ for (const s of sentences) {
91
+ const lower = s.toLowerCase();
92
+ const isPain =
93
+ /^right now\b/i.test(s) ||
94
+ /\bhard to\b/i.test(lower) ||
95
+ /\beverywhere\b/i.test(lower) ||
96
+ /\bforgetting\b/i.test(lower) ||
97
+ /\bpain\b/i.test(lower) ||
98
+ /\bstruggle\b/i.test(lower) ||
99
+ /\bmanually\b/i.test(lower) ||
100
+ /\bproblem isn'?t\b/i.test(lower) ||
101
+ /\bthe problem\b/i.test(lower) ||
102
+ // Feature-extension markers
103
+ /\bcurrently only\b/i.test(lower) ||
104
+ /\bcurrently supports?\b/i.test(lower) ||
105
+ /\bwe have a\b.*\bthat\b/i.test(lower) ||
106
+ /\bdoesn'?t (?:support|have|include)\b/i.test(lower) ||
107
+ // Narrative pain markers
108
+ /\bkeep getting\b/i.test(lower) ||
109
+ /\bover and over\b/i.test(lower) ||
110
+ /\binstead of\b/i.test(lower) ||
111
+ /\bchasing\b/i.test(lower) ||
112
+ /\bwasting time\b/i.test(lower) ||
113
+ /\bfrustrat/i.test(lower) ||
114
+ /\btoo much time\b/i.test(lower) ||
115
+ /\bkeep having to\b/i.test(lower) ||
116
+ /\bscattered\b/i.test(lower) ||
117
+ /\bno single\b/i.test(lower) ||
118
+ /\bno way to\b/i.test(lower);
119
+
120
+ const isSolution =
121
+ /\bshould\b/i.test(lower) ||
122
+ /\bthe product\b/i.test(lower) ||
123
+ /\bi think\b/i.test(lower) ||
124
+ /\bif i had to imagine\b/i.test(lower) ||
125
+ /\bthe core outcome\b/i.test(lower) ||
126
+ // Feature-extension solution markers
127
+ /\bi need to add\b/i.test(lower) ||
128
+ /\badd a\b/i.test(lower) ||
129
+ /\bthe .+ should\b/i.test(lower) ||
130
+ /\bpreferences?\s+should\b/i.test(lower) ||
131
+ // Narrative solution markers
132
+ /\bi want to build\b/i.test(lower) ||
133
+ /\bi need a tool\b/i.test(lower) ||
134
+ /\bi want (?:a|something)\b/i.test(lower) ||
135
+ /\bshould feel\b/i.test(lower) ||
136
+ /\bmy team gets\b/i.test(lower) ||
137
+ /\bclients? (?:fill|complete|submit|answer)\b/i.test(lower) ||
138
+ /\bsystem (?:generates?|creates?|produces?)\b/i.test(lower);
139
+
140
+ // "I want to build..." is always solution, even if it also contains pain markers
141
+ if (isSolution && /\bi want to build\b/i.test(lower)) {
142
+ solutionSentences.push(s);
143
+ } else if (isPain) {
144
+ painSentences.push(s);
145
+ } else if (isSolution) {
146
+ solutionSentences.push(s);
147
+ }
148
+ }
149
+
150
+ if (painSentences.length > 0) {
151
+ const problem = painSentences.slice(0, 2).join(" ");
152
+ const solution = solutionSentences.length > 0
153
+ ? solutionSentences.slice(0, 2).join(" ")
154
+ : extractCoreSolution(normalized);
155
+ return {
156
+ problem: truncate(problem, 300),
157
+ solution: truncate(solution, 300),
158
+ };
159
+ }
160
+
161
+ // Strategy 2: Structural split on "that helps/turns..." in the first sentence
162
+ for (const marker of SOLUTION_MARKERS_FOR_SPLIT) {
163
+ const idx = lowerNorm.indexOf(marker);
164
+ if (idx > 15) {
165
+ const problem = normalized.slice(0, idx).trim();
166
+ const solution = normalized.slice(idx).trim();
167
+ if (problem.length > 10 && solution.length > 10) {
168
+ return { problem, solution };
169
+ }
170
+ }
171
+ }
172
+
173
+ return { problem: normalized, solution: "Needs further shaping." };
174
+ }
175
+
176
+ function extractCoreSolution(text: string): string {
177
+ // Look for "The product should..." or "The core outcome..."
178
+ const match = text.match(
179
+ /(?:the product should|the core outcome[^:]*:|if i had to imagine v1[^:]*:)\s*(.{20,250})/i,
180
+ );
181
+ if (match?.[1]) return compact(match[1]);
182
+
183
+ // Look for narrative solution: "I want to build a [thing] where [flow]"
184
+ const narrativeMatch = text.match(
185
+ /i want to build\s+(.{15,250}?)(?:\.\s|$)/i,
186
+ );
187
+ if (narrativeMatch?.[1]) return compact(narrativeMatch[1]);
188
+
189
+ // Look for feature-extension: "I need to add [feature]"
190
+ const addMatch = text.match(
191
+ /i need to add\s+(.{15,250}?)(?:\.\s|$)/i,
192
+ );
193
+ if (addMatch?.[1]) return compact(addMatch[1]);
194
+
195
+ // Look for "I need a tool that..."
196
+ const needMatch = text.match(
197
+ /i need\s+(.{15,200}?)(?:\.\s|$)/i,
198
+ );
199
+ if (needMatch?.[1]) return compact(needMatch[1]);
200
+
201
+ // Look for declarative tool/feature descriptions: "A [tool/app/system] that/for..."
202
+ const declarativeMatch = text.match(
203
+ /\ba\s+(?:cli\s+)?(?:tool|app|system|feature|page|component|service|module|script)\s+(?:that|for|which)\s+(.{15,250}?)(?:\.\s|$)/i,
204
+ );
205
+ if (declarativeMatch?.[1]) return compact(declarativeMatch[1]);
206
+
207
+ // Fall back to the first sentence's solution clause
208
+ const solutionMatch = text.match(/(?:that helps?|that turns?|which helps?)\s+(.{20,200})/i);
209
+ if (solutionMatch?.[1]) return compact(solutionMatch[1]);
210
+
211
+ // Fall back: if what_do_you_want_next starts with "implement" or "build", use it
212
+ const implMatch = text.match(/\b(?:implement|build)\s+(.{15,200}?)(?:\.\s|$)/i);
213
+ if (implMatch?.[1]) return compact(implMatch[1]);
214
+
215
+ return "Needs further shaping.";
216
+ }
217
+
218
+ // ---------------------------------------------------------------------------
219
+ // Target user extraction
220
+ // ---------------------------------------------------------------------------
221
+
222
+ const USER_PATTERNS = [
223
+ /\btarget\s+user(?:\s+is)?[:\s]+([^.,;!?\n]{4,80})/i,
224
+ /\bfor\s+([^.,;!?\n]{4,60}?)(?:\s+(?:that|who|which|shipping|building|working|using|running))/i,
225
+ /\btargeting\s+([^.,;!?\n]{4,60})/i,
226
+ /\baimed at\s+([^.,;!?\n]{4,60})/i,
227
+ /\bfor\s+([^.,;!?\n]{4,60})/i,
228
+ ];
229
+
230
+ // Words that indicate the match is an action/purpose, not a user segment
231
+ const NON_USER_MARKERS = [
232
+ "managing", "building", "creating", "making", "doing", "getting",
233
+ "tracking", "handling", "processing", "running", "stuff", "things",
234
+ "better", "faster", "easier", "more",
235
+ ];
236
+
237
+ export const GENERIC_USER_FALLBACK = "Solo builders shipping software.";
238
+
239
+ function extractTargetUser(raw: string): { user: string; explicit: boolean } {
240
+ for (const pattern of USER_PATTERNS) {
241
+ const match = raw.match(pattern);
242
+ if (match?.[1]) {
243
+ const candidate = compact(match[1]);
244
+ const candidateWords = candidate.toLowerCase().split(/\s+/);
245
+
246
+ // Reject if the first word looks like a verb/action, not a user type
247
+ if (candidateWords[0] && NON_USER_MARKERS.includes(candidateWords[0])) continue;
248
+
249
+ if (candidateWords.length >= 2 && candidate.length > 5) {
250
+ return { user: candidate, explicit: true };
251
+ }
252
+ }
253
+ }
254
+ return { user: GENERIC_USER_FALLBACK, explicit: false };
255
+ }
256
+
257
+ // ---------------------------------------------------------------------------
258
+ // Non-goal inference
259
+ // ---------------------------------------------------------------------------
260
+
261
+ const ADJACENCY_MAP: Record<string, string> = {
262
+ route: "Not a general-purpose workflow engine or DAG builder.",
263
+ compil: "Not a code generation or transpilation tool.",
264
+ handoff: "Not a project management or ticketing system.",
265
+ return: "Not an observability or logging platform.",
266
+ brief: "Not a document or wiki editor.",
267
+ dispatch: "Not a task queue or job scheduler.",
268
+ autonom: "Not an autonomous agent platform or LLM gateway.",
269
+ chat: "Not a chat wrapper or conversational interface.",
270
+ deploy: "Not a CI/CD pipeline or deployment platform.",
271
+ team: "Not a team collaboration or communication tool.",
272
+ analytic: "Not an analytics dashboard or reporting tool.",
273
+ plugin: "Not a plugin marketplace or extension system.",
274
+ review: "Not a code review tool or pull request manager.",
275
+ pipeline: "Not a data pipeline or ETL framework.",
276
+ manage: "Not a generic management console or admin panel.",
277
+ marketplace: "Not a marketplace or commerce platform.",
278
+ collaborat: "Not a real-time collaboration tool.",
279
+ };
280
+
281
+ const PRODUCT_GUARDRAIL_LINE_SET = new Set<string>(Object.values(ADJACENCY_MAP));
282
+ const GENERIC_MINIMUM_NON_GOALS = [
283
+ "Not a generic chat wrapper or prompt management product.",
284
+ "Not an autonomous agent platform.",
285
+ ] as const;
286
+
287
+ /** True when a boundary line is a product-level guardrail (keyword map or generic minimum), not user-authored scope. */
288
+ export function isProductLevelGuardrailBoundary(line: string): boolean {
289
+ const t = compact(line);
290
+ if (!t) return false;
291
+ if ((GENERIC_MINIMUM_NON_GOALS as readonly string[]).includes(t)) return true;
292
+ return PRODUCT_GUARDRAIL_LINE_SET.has(t);
293
+ }
294
+
295
+ const EXPLICIT_NON_GOAL_PATTERNS = [
296
+ /i do (?:NOT|not) want (?:this to become |it to be |to build )?([^.]+?)(?:\.|$)/gim,
297
+ /i (?:also )?do (?:NOT|not) want ([^.]+?)(?:\.|$)/gim,
298
+ /(?:^|\.\s+)no\s+([^.]{6,60}?)\s+in v1\b/gi,
299
+ /should (?:NOT|not) (?:be|become|feel) ([^.]+?)(?:\.|$)/gim,
300
+ ];
301
+
302
+ function extractExplicitNonGoals(text: string): string[] {
303
+ const goals: string[] = [];
304
+ const combined = `${text}`;
305
+
306
+ for (const pattern of EXPLICIT_NON_GOAL_PATTERNS) {
307
+ pattern.lastIndex = 0;
308
+ let match: RegExpExecArray | null;
309
+ while ((match = pattern.exec(combined)) !== null) {
310
+ if (!match[1]) continue;
311
+ const candidate = compact(match[1]);
312
+ if (candidate.length > 5 && candidate.length < 120) {
313
+ // Normalize to "Not..." phrasing
314
+ const normalized = candidate.startsWith("not ")
315
+ ? candidate.charAt(0).toUpperCase() + candidate.slice(1)
316
+ : `Not ${candidate.charAt(0).toLowerCase()}${candidate.slice(1)}`;
317
+ // Remove trailing "in V1" if present
318
+ const cleaned = normalized.replace(/\s+in v1$/i, "").trim();
319
+ const final = cleaned.endsWith(".") ? cleaned : `${cleaned}.`;
320
+
321
+ // Deduplicate: skip if any existing goal shares 60%+ keywords
322
+ const finalWords = new Set(compact(final).toLowerCase().split(/\s+/).filter((w) => w.length > 3));
323
+ const isDupe = goals.some((existing) => {
324
+ const existingWords = new Set(compact(existing).toLowerCase().split(/\s+/).filter((w) => w.length > 3));
325
+ let overlap = 0;
326
+ for (const w of finalWords) { if (existingWords.has(w)) overlap++; }
327
+ return finalWords.size > 0 && overlap / finalWords.size >= 0.6;
328
+ });
329
+
330
+ if (!isDupe) {
331
+ goals.push(final);
332
+ }
333
+ }
334
+ }
335
+ }
336
+
337
+ return goals;
338
+ }
339
+
340
+ function inferNonGoals(raw: string, solution: string, constraints: string): string[] {
341
+ // Step 1: Extract explicit non-goals from user's own words
342
+ const explicit = extractExplicitNonGoals(`${raw}\n${constraints}`);
343
+
344
+ // Step 2: Supplement with inferred non-goals from adjacency map (only if explicit list is thin)
345
+ const combined = `${raw} ${solution} ${constraints}`.toLowerCase();
346
+ const inferred: string[] = [];
347
+
348
+ // Only add keyword guardrails when the idea has not already supplied competing boundaries.
349
+ if (explicit.length < 2) {
350
+ for (const [keyword, nonGoal] of Object.entries(ADJACENCY_MAP)) {
351
+ if (combined.includes(keyword) && !explicit.some((e) => e.toLowerCase().includes(keyword))) {
352
+ inferred.push(nonGoal);
353
+ if (explicit.length + inferred.length >= 5) break;
354
+ }
355
+ }
356
+ }
357
+
358
+ const all = [...explicit, ...inferred];
359
+
360
+ if (all.length < 2) {
361
+ all.push("Not a generic chat wrapper or prompt management product.");
362
+ all.push("Not an autonomous agent platform.");
363
+ }
364
+
365
+ return all.slice(0, 7);
366
+ }
367
+
368
+ // ---------------------------------------------------------------------------
369
+ // Missing inputs detection — split into lock-blocking vs cautions
370
+ // ---------------------------------------------------------------------------
371
+
372
+ export type IntakeGapBuckets = {
373
+ /** Must be resolved before the record can be locked (activation blocked in UI). */
374
+ blocking: string[];
375
+ /** Important but non-blocking until lock. */
376
+ cautions: string[];
377
+ /** Combined list (blocking first) for seed confidence scoring. */
378
+ combined: string[];
379
+ };
380
+
381
+ function collectIntakeGaps(input: ActivationInput, seed: Partial<SynthesizedSeed>): IntakeGapBuckets {
382
+ const blocking: string[] = [];
383
+ const cautions: string[] = [];
384
+
385
+ if (!seed.target_user || seed.target_user === GENERIC_USER_FALLBACK) {
386
+ blocking.push("Target user is not on record — name who this is for before locking.");
387
+ }
388
+
389
+ if (seed.proposed_solution === "Needs further shaping.") {
390
+ blocking.push("No clear change or solution approach — describe what actually ships in this slice.");
391
+ }
392
+
393
+ if (!compact(input.constraints)) {
394
+ cautions.push("No extra constraints stated — add boundaries if V1 should refuse certain directions.");
395
+ }
396
+
397
+ if (compact(input.what_do_you_want_next).split(/\s+/).length < 4) {
398
+ cautions.push("First outcome is vague — tighten “what should happen first” when you can.");
399
+ }
400
+
401
+ const wordCount = compact(input.raw_idea).split(/\s+/).length;
402
+ if (wordCount < 8) {
403
+ blocking.push("The idea is too thin to compile — add enough detail to define the problem and slice.");
404
+ }
405
+
406
+ const affirmativeText = input.raw_idea
407
+ .replace(/I do (?:NOT|not) want[^.]*\./g, "")
408
+ .replace(/I (?:also )?do (?:NOT|not) want[^.]*\./g, "")
409
+ .replace(/I care[^.]*\./g, "");
410
+ const segments = affirmativeText.split(/,\s*|\band\b/i).map((s) => compact(s));
411
+ const capabilitySegments = segments.filter(
412
+ (s) => s.length > 10 && /\b(management|collaboration|review|pipeline|dashboard|marketplace|analytics|deploy|monitor|tracking|automation)\b/i.test(s),
413
+ );
414
+ if (capabilitySegments.length >= 3) {
415
+ cautions.push(
416
+ "The idea lists many features — pick one wedge capability so the record is not a wishlist.",
417
+ );
418
+ }
419
+
420
+ const combined = [...blocking, ...cautions];
421
+ return { blocking, cautions, combined };
422
+ }
423
+
424
+ // ---------------------------------------------------------------------------
425
+ // Confidence scoring
426
+ // ---------------------------------------------------------------------------
427
+
428
+ function scoreConfidence(blocking: string[], cautions: string[] = []): SynthesizedSeed["confidence"] {
429
+ const total = blocking.length + cautions.length;
430
+ if (blocking.length >= 2) return "low";
431
+ if (blocking.length >= 1) return "medium";
432
+ if (total === 0) return "high";
433
+ if (total === 1) return "high";
434
+ if (total <= 2) return "medium";
435
+ return "low";
436
+ }
437
+
438
+ // ---------------------------------------------------------------------------
439
+ // Title derivation (improved from original)
440
+ // ---------------------------------------------------------------------------
441
+
442
+ function deriveTitle(raw: string): string {
443
+ const normalized = compact(raw);
444
+
445
+ // Strategy 1: Look for "turn X into Y" — the product's core transformation
446
+ const transformMatch = normalized.match(
447
+ /(?:helps?\s+)?turn\w*\s+(.{5,40}?)\s+into\s+(.{5,40}?)(?:\.|,|\s+fast|\s+quick|$)/i,
448
+ );
449
+ if (transformMatch?.[1] && transformMatch[2]) {
450
+ const x = compact(transformMatch[1]).replace(/^messy\s+/i, "").replace(/[^\w\s-]/g, " ");
451
+ const y = compact(transformMatch[2]).replace(/^a\s+/i, "").replace(/[^\w\s-]/g, " ");
452
+ const combined = `${x} To ${y}`;
453
+ const w = combined.split(/\s+/).filter(Boolean).slice(0, 5);
454
+ if (w.length >= 3) return titleCase(w.join(" "));
455
+ }
456
+
457
+ // Strategy 1b: Look for "that helps/turns [concept]" without "into"
458
+ const conceptMatch = normalized.match(
459
+ /(?:that|which)\s+(?:helps?\s+)?(?:turn|convert|transform|ingest|cluster|compile|route|dispatch|generate|validate|manage|track|organize|build|create)\w*\s+(.{8,50}?)(?:\s+into\b|\s+from\b|\s+across\b|\.|,|$)/i,
460
+ );
461
+ if (conceptMatch?.[1]) {
462
+ const concept = conceptMatch[1].replace(/[^\w\s-]/g, " ").trim();
463
+ const w = concept.split(/\s+/).filter(Boolean).slice(0, 5);
464
+ if (w.length >= 2) return titleCase(w.join(" "));
465
+ }
466
+
467
+ // Strategy 2: Narrative-style — "I want to build a [adj] [noun] where [purpose]"
468
+ // Extract the purpose/action, not just the noun
469
+ const narrativeBuildMatch = normalized.match(
470
+ /(?:build|create|make)\s+(?:a\s+)?(?:\w+\s+){0,3}(?:tool|app|system|platform|product)\s+(?:where|that|so|for)\s+(.{10,60}?)(?:\s*,|\s+and\s+the|\s+the system|\.|$)/i,
471
+ );
472
+ if (narrativeBuildMatch?.[1]) {
473
+ const purpose = compact(narrativeBuildMatch[1])
474
+ .replace(/^(?:new\s+)?(?:clients?|users?|people)\s+/i, "")
475
+ .replace(/[^\w\s-]/g, " ");
476
+ const w = purpose.split(/\s+/).filter(Boolean).slice(0, 5);
477
+ if (w.length >= 2) return titleCase(w.join(" "));
478
+ }
479
+
480
+ // Strategy 2b: Look for "a [noun] for [user] that..." — declarative style
481
+ const nounMatch = normalized.match(
482
+ /\ba\s+([\w-]+(?:\s+[\w-]+){0,3})\s+(?:for|that|which)\b/i,
483
+ );
484
+ if (nounMatch?.[1]) {
485
+ const noun = nounMatch[1].trim();
486
+ const GENERIC = ["tool", "app", "thing", "product", "platform", "system"];
487
+ if (!GENERIC.includes(noun.toLowerCase())) {
488
+ return titleCase(noun);
489
+ }
490
+ }
491
+
492
+ // Strategy 3: Look for the core outcome phrase — "turn X into Y"
493
+ const outcomeMatch = normalized.match(
494
+ /turn\w*\s+(.{5,30}?)\s+into\s+(.{5,40}?)(?:\.|,|$)/i,
495
+ );
496
+ if (outcomeMatch) {
497
+ const w = compact(`${outcomeMatch[1]} to ${outcomeMatch[2]}`)
498
+ .replace(/[^\w\s-]/g, " ")
499
+ .split(/\s+/)
500
+ .filter(Boolean)
501
+ .slice(0, 6);
502
+ if (w.length >= 3) return titleCase(w.join(" "));
503
+ }
504
+
505
+ // Strategy 4: Fall back to stripping boilerplate and taking what's left
506
+ const cleaned = sentence(normalized)
507
+ .replace(/^(i want to build|build|create|make)\s+/i, "")
508
+ .replace(/^(an?\s+(?:tool|app|platform|product|system)\s+(?:for|that)\s+)/i, "")
509
+ .replace(/[^\w\s-]/g, " ");
510
+
511
+ const w = cleaned.split(/\s+/).filter(Boolean).slice(0, 6);
512
+ return titleCase(w.join(" ")) || "New Project";
513
+ }
514
+
515
+ // ---------------------------------------------------------------------------
516
+ // V1 outcome derivation — extract from raw idea, not from operator intent
517
+ // ---------------------------------------------------------------------------
518
+
519
+ const V1_OUTCOME_PATTERNS = [
520
+ /the core outcome I want is[:\s]*(.{15,200})/i,
521
+ /if I had to imagine V1[^:]*:[:\s]*(.{15,250})/i,
522
+ /V1[,:]?\s*(?:should|would|could|maybe)\s+(.{15,200})/i,
523
+ /the real (?:win|value|outcome) (?:is|would be)[:\s]*(.{15,200})/i,
524
+ /I want (?:something|a product|it) (?:that|to)\s+(.{15,150})/i,
525
+ // Feature-extension: "I need to add [feature]"
526
+ /I need to add\s+(.{15,200})/i,
527
+ // Narrative outcome: "my team gets [good thing] instead of [bad thing]"
528
+ /(?:my team|we|I)\s+(?:get|gets|receive|receives)\s+(.{15,150})/i,
529
+ // Narrative outcome: "instead of [bad], [good]"
530
+ /instead of\s+.{10,60}?,\s*(.{15,150})/i,
531
+ // Narrative outcome: "so that [outcome]" or "so [someone] can [outcome]"
532
+ /so (?:that |I |we |my team )(?:can )?(.{15,150})/i,
533
+ ];
534
+
535
+ function deriveV1Outcome(raw: string, solution: string): string {
536
+ // Strategy 1: Find explicit outcome statements in the raw idea
537
+ for (const pattern of V1_OUTCOME_PATTERNS) {
538
+ const match = raw.match(pattern);
539
+ if (match?.[1]) {
540
+ const candidate = compact(match[1]);
541
+ // Take up to first period or newline
542
+ const trimmed = candidate.split(/[.\n]/).map((p) => compact(p)).find((p) => p.length > 10);
543
+ if (trimmed && trimmed.length > 15) {
544
+ return truncate(trimmed, 220);
545
+ }
546
+ }
547
+ }
548
+
549
+ // Strategy 2: Use the first sentence of the proposed solution
550
+ if (solution && solution !== "Needs further shaping.") {
551
+ const firstSol = solution.split(/[.\n]/).map((p) => compact(p)).find((p) => p.length > 15);
552
+ if (firstSol) return truncate(firstSol, 220);
553
+ }
554
+
555
+ // Strategy 3: Fall back to the one-liner
556
+ return truncate(deriveOneLiner(raw), 220);
557
+ }
558
+
559
+ // ---------------------------------------------------------------------------
560
+ // First build slice derivation — the product's actual first slice
561
+ // ---------------------------------------------------------------------------
562
+
563
+ function deriveFirstBuildSlice(raw: string, solution: string): string {
564
+ // Look for "If I had to imagine V1" sections with bullet lists
565
+ const v1Match = raw.match(/if I had to imagine V1[^:]*:[\s\n]*((?:[-•]\s*.+[\n]?)+)/i);
566
+ if (v1Match?.[1]) {
567
+ const bullets = v1Match[1]
568
+ .split("\n")
569
+ .map((l) => l.replace(/^[-•]\s*/, "").trim())
570
+ .filter((l) => l.length > 5);
571
+ if (bullets.length >= 2) {
572
+ return bullets.join(". ") + ".";
573
+ }
574
+ }
575
+
576
+ // Fall back to the core solution description
577
+ if (solution && solution !== "Needs further shaping.") {
578
+ return truncate(solution, 300);
579
+ }
580
+
581
+ return "Define and implement the narrowest slice that proves the core value proposition.";
582
+ }
583
+
584
+ // ---------------------------------------------------------------------------
585
+ // Open questions extraction — preserve the user's explicit uncertainties
586
+ // ---------------------------------------------------------------------------
587
+
588
+ const UNCERTAINTY_PATTERNS = [
589
+ /I'?m not sure (?:yet|about|whether|if)[:\s]*\n?((?:[-•]\s*.+[\n]?)+)/i,
590
+ /I don'?t know (?:yet|whether|if)[:\s]*\n?((?:[-•]\s*.+[\n]?)+)/i,
591
+ /open questions?[:\s]*\n?((?:[-•]\s*.+[\n]?)+)/i,
592
+ /not sure[:\s]*\n?((?:[-•]\s*.+[\n]?)+)/i,
593
+ ];
594
+
595
+ function extractOpenQuestions(raw: string): string[] {
596
+ for (const pattern of UNCERTAINTY_PATTERNS) {
597
+ const match = raw.match(pattern);
598
+ if (match?.[1]) {
599
+ const bullets = match[1]
600
+ .split("\n")
601
+ .map((l) => l.replace(/^[-•]\s*/, "").trim())
602
+ .filter((l) => l.length > 8);
603
+ if (bullets.length >= 1) {
604
+ return bullets.slice(0, 5);
605
+ }
606
+ }
607
+ }
608
+ return [];
609
+ }
610
+
611
+ // ---------------------------------------------------------------------------
612
+ // One-liner derivation
613
+ // ---------------------------------------------------------------------------
614
+
615
+ function deriveOneLiner(raw: string): string {
616
+ const normalized = compact(raw);
617
+
618
+ // Strip "I want to build" prefix and clean up
619
+ const stripped = normalized
620
+ .replace(/^i want to build\s+/i, "")
621
+ .replace(/^i('?m| am) building\s+/i, "")
622
+ .replace(/^build\s+/i, "");
623
+
624
+ // Take the first sentence of the stripped version
625
+ const first = stripped.split(/[.\n!?]/).map((p) => compact(p)).find((p) => p.length > 10);
626
+ return truncate(first ?? stripped, 160);
627
+ }
628
+
629
+ // ---------------------------------------------------------------------------
630
+ // Task-type detection — product idea vs implementation request
631
+ // ---------------------------------------------------------------------------
632
+
633
+ import type { TaskType } from "./types";
634
+
635
+ function detectTaskType(raw: string, repoExists: boolean): TaskType {
636
+ const lower = compact(raw);
637
+
638
+ // Strong implementation signals
639
+ const implSignals = [
640
+ /\bwe have a\b.*\bapp\b/i,
641
+ /\bexisting\b.*\b(?:repo|codebase|app|project|page|component)\b/i,
642
+ /\bcurrently (?:only )?supports?\b/i,
643
+ /\bi need to add\b/i,
644
+ /\badd a\b.*\b(?:layout|panel|page|section|feature|endpoint|route)\b/i,
645
+ /\brefactor\b/i,
646
+ /\bmigrate\b/i,
647
+ /\bthe current\b.*\b(?:page|component|module|file|code)\b/i,
648
+ /\bsrc\/\b/i,
649
+ /\b\.tsx?\b/i,
650
+ /\bpackage\.json\b/i,
651
+ ];
652
+
653
+ // Strong product-idea signals
654
+ const productSignals = [
655
+ /\bi want to build a (?:tool|product|app|platform)\b/i,
656
+ /\bthe product should\b/i,
657
+ /\bif i had to imagine v1\b/i,
658
+ /\bthe core outcome i want\b/i,
659
+ /\bwho it is for\b/i,
660
+ /\btarget user\b/i,
661
+ /\bv1 promise\b/i,
662
+ ];
663
+
664
+ const implCount = implSignals.filter((p) => p.test(lower)).length;
665
+ const productCount = productSignals.filter((p) => p.test(lower)).length;
666
+
667
+ // Repo exists is a strong implementation signal — repo-bound work is implementation
668
+ // unless there are truly NO implementation signals AND strong product signals
669
+ if (repoExists && implCount >= 1) return "implementation-request";
670
+ if (implCount >= 2) return "implementation-request";
671
+
672
+ // Product-idea only wins when repo is NOT present, or when impl signals are zero
673
+ if (productCount >= 2 && !repoExists) return "product-idea";
674
+ if (productCount >= 2 && implCount === 0 && repoExists) return "product-idea";
675
+
676
+ // Repo tie-breaker: any impl signal with repo → implementation
677
+ if (repoExists && implCount > 0) return "implementation-request";
678
+ if (productCount > implCount) return "product-idea";
679
+
680
+ // Repo-present with no other signals defaults to implementation
681
+ if (repoExists) return "implementation-request";
682
+
683
+ return "unknown";
684
+ }
685
+
686
+ // ---------------------------------------------------------------------------
687
+ // LocalSynthesisProvider
688
+ // ---------------------------------------------------------------------------
689
+
690
+ export class LocalSynthesisProvider implements SynthesisProvider {
691
+ extractSeed(input: ActivationInput): SynthesizedSeed {
692
+ let { problem, solution } = splitProblemSolution(input.raw_idea);
693
+
694
+ // If raw_idea didn't yield a solution, try what_do_you_want_next
695
+ if (solution === "Needs further shaping." && input.what_do_you_want_next) {
696
+ const fromNext = extractCoreSolution(`${input.raw_idea} ${input.what_do_you_want_next}`);
697
+ if (fromNext !== "Needs further shaping.") {
698
+ solution = fromNext;
699
+ }
700
+ }
701
+
702
+ const { user } = extractTargetUser(`${input.raw_idea} ${input.what_do_you_want_next ?? ""} ${input.constraints ?? ""}`);
703
+ const title = deriveTitle(input.raw_idea);
704
+ const nonGoals = inferNonGoals(input.raw_idea, solution, input.constraints);
705
+ const oneLiner = deriveOneLiner(input.raw_idea);
706
+ const v1Outcome = deriveV1Outcome(input.raw_idea, solution);
707
+ const openQuestions = extractOpenQuestions(input.raw_idea);
708
+ const firstBuildSlice = deriveFirstBuildSlice(input.raw_idea, solution);
709
+
710
+ const partial = {
711
+ title,
712
+ one_liner: oneLiner,
713
+ problem: truncate(problem, 240),
714
+ proposed_solution: truncate(solution, 240),
715
+ target_user: user,
716
+ v1_outcome: v1Outcome,
717
+ non_goals: nonGoals,
718
+ };
719
+
720
+ const gaps = collectIntakeGaps(input, partial);
721
+ const missingInputs = gaps.blocking;
722
+ const confidence = scoreConfidence(gaps.blocking, gaps.cautions);
723
+
724
+ const taskType = detectTaskType(input.raw_idea, input.repo_exists);
725
+
726
+ return synthesizedSeedSchema.parse({
727
+ ...partial,
728
+ missing_inputs: missingInputs,
729
+ open_questions: openQuestions,
730
+ first_build_slice: firstBuildSlice,
731
+ confidence,
732
+ task_type: taskType,
733
+ });
734
+ }
735
+
736
+ classifyResearchAngles(seed: SynthesizedSeed): ResearchClassification {
737
+ if (seed.confidence === "high" && seed.missing_inputs.length === 0) {
738
+ return researchClassificationSchema.parse({
739
+ angles: [],
740
+ research_needed: false,
741
+ summary: "Seed is strong enough to proceed without additional research.",
742
+ });
743
+ }
744
+
745
+ const angles: ResearchAngle[] = [];
746
+
747
+ if (seed.target_user === GENERIC_USER_FALLBACK) {
748
+ angles.push({
749
+ category: "user-validation",
750
+ question: "Who exactly will use this and what is their current workflow?",
751
+ why_it_matters: "A generic target user leads to generic solutions that serve no one well.",
752
+ priority: "blocking",
753
+ });
754
+ }
755
+
756
+ if (seed.proposed_solution === "Needs further shaping.") {
757
+ angles.push({
758
+ category: "technical-feasibility",
759
+ question: "What is the simplest technical approach that solves the core problem?",
760
+ why_it_matters: "Without a clear solution approach, the build brief cannot be execution-ready.",
761
+ priority: "blocking",
762
+ });
763
+ }
764
+
765
+ // Check for domain-specific terms that might need research
766
+ const domainTerms = seed.problem.match(
767
+ /\b(compliance|regulatory|medical|financial|legal|security|encryption|protocol)\b/i,
768
+ );
769
+ if (domainTerms) {
770
+ angles.push({
771
+ category: "domain-knowledge",
772
+ question: `What domain constraints apply to ${domainTerms[0].toLowerCase()} in this context?`,
773
+ why_it_matters: "Domain-specific requirements can fundamentally reshape the solution.",
774
+ priority: "strengthening",
775
+ });
776
+ }
777
+
778
+ // Check if the idea mentions patterns that could benefit from competitive research
779
+ const hasCompetitiveSignal = seed.missing_inputs.some(
780
+ (m) => m.includes("many features") || m.includes("single capability"),
781
+ );
782
+ if (hasCompetitiveSignal && angles.length < 3) {
783
+ angles.push({
784
+ category: "competitive-landscape",
785
+ question: "What existing tools partially solve this and where do they fall short?",
786
+ why_it_matters: "Understanding the landscape prevents building what already exists.",
787
+ priority: "strengthening",
788
+ });
789
+ }
790
+
791
+ return researchClassificationSchema.parse({
792
+ angles: angles.slice(0, 3),
793
+ research_needed: angles.length > 0,
794
+ summary:
795
+ angles.length === 0
796
+ ? "Seed is strong enough to proceed without additional research."
797
+ : `${angles.length} research angle${angles.length > 1 ? "s" : ""} identified before proceeding.`,
798
+ });
799
+ }
800
+
801
+ generateBrief(
802
+ input: ActivationInput,
803
+ seed: SynthesizedSeed,
804
+ route: RoutingResult,
805
+ ): string {
806
+ const constraintsLine = compact(input.constraints)
807
+ ? `Constraints to respect: ${truncate(input.constraints, 180)}.`
808
+ : "No extra constraints were supplied beyond keeping V1 narrow and coherent.";
809
+
810
+ // Combine missing inputs (structural gaps) with open questions (user's explicit uncertainties)
811
+ const allQuestions = [...seed.missing_inputs, ...seed.open_questions];
812
+ const openQuestions =
813
+ allQuestions.length > 0
814
+ ? allQuestions.map((q) => `- ${q}`).join("\n")
815
+ : "- None identified.";
816
+
817
+ const nonGoals = seed.non_goals.map((g) => `- ${g}`).join("\n");
818
+ const firstSlice = deriveFirstBuildSlice(input.raw_idea, seed.proposed_solution);
819
+
820
+ return `# SB_SPEC
821
+
822
+ ## What this product is
823
+
824
+ ${seed.one_liner}
825
+
826
+ ## Who it is for
827
+
828
+ ${seed.target_user}
829
+
830
+ ## The problem
831
+
832
+ ${seed.problem}
833
+
834
+ ## The proposed solution
835
+
836
+ ${seed.proposed_solution}
837
+
838
+ ## V1 promise
839
+
840
+ ${seed.v1_outcome}
841
+
842
+ ## Scope in
843
+
844
+ - ${firstSlice}
845
+ - Keep the primary artifact aligned with the current product definition.
846
+ - Touch only files and artifacts that directly support the first build slice.
847
+
848
+ ## Scope out
849
+
850
+ ${nonGoals}
851
+
852
+ ## First build slice
853
+
854
+ ${firstSlice}
855
+
856
+ ${constraintsLine}
857
+
858
+ ## Acceptance criteria
859
+
860
+ - The product seed is valid and reflects the user's actual problem, target user, and desired outcome.
861
+ - The primary artifact is execution-ready for the first build slice.
862
+ - The next recommended surface is explicit, deterministic, and accompanied by a return condition.
863
+ - The first handoff can be launched as one SBX bundle.
864
+
865
+ ## Open questions
866
+
867
+ ${openQuestions}
868
+
869
+ ## What must not change
870
+
871
+ These boundaries anchor original intent and must survive every handoff:
872
+ ${nonGoals}
873
+
874
+ ## Key risks / unknowns
875
+
876
+ - Is the seed strong enough to drive execution without further shaping? (confidence: ${seed.confidence})
877
+ - ${route.return_condition}
878
+ `;
879
+ }
880
+ }
881
+
882
+ // ---------------------------------------------------------------------------
883
+ // Intake analysis — infer chips + follow-ups from raw input
884
+ // ---------------------------------------------------------------------------
885
+
886
+ const BOUNDARY_PATTERNS: { pattern: RegExp; id: string; label: string }[] = [
887
+ { pattern: /\bno\s+billing\b/i, id: "no-billing", label: "No billing" },
888
+ { pattern: /\bno\s+subscriptions?\b/i, id: "no-subscriptions", label: "No subscriptions" },
889
+ { pattern: /\bno\s+admin\b/i, id: "no-admin", label: "No admin panel" },
890
+ { pattern: /\bno\s+team\b/i, id: "no-team", label: "No team features" },
891
+ { pattern: /\bno\s+(?:multi-?)?workspace\b/i, id: "no-workspace", label: "No multi-workspace" },
892
+ { pattern: /\bno\s+(?:CRM|crm)\b/i, id: "no-crm", label: "No CRM" },
893
+ { pattern: /\bno\s+project management\b/i, id: "no-pm", label: "No project management" },
894
+ { pattern: /\bpersonal\s+(?:settings|account)\s+only\b/i, id: "personal-only", label: "Personal settings only" },
895
+ { pattern: /\bno\s+(?:deep\s+)?(?:jira|slack|hubspot)\s+integrations?\b/i, id: "no-integrations", label: "No deep integrations" },
896
+ { pattern: /\bno\s+(?:client|user)\s+(?:accounts?|login)\b/i, id: "no-client-accounts", label: "No client accounts" },
897
+ { pattern: /\bno\s+(?:meeting\s+)?transcription\b/i, id: "no-transcription", label: "No transcription" },
898
+ { pattern: /\bno\s+(?:client|team)\s+permissions?\b/i, id: "no-permissions", label: "No permissions system" },
899
+ { pattern: /\bkeep\s+(?:it\s+)?(?:simple|lightweight|minimal)\b/i, id: "keep-simple", label: "Keep it simple" },
900
+ { pattern: /\bmanual\s+curation\b/i, id: "manual-curation", label: "Manual curation in the loop" },
901
+ { pattern: /\bpreserve\s+(?:user\s+)?(?:voice|language)\b/i, id: "preserve-voice", label: "Preserve user voice" },
902
+ { pattern: /\bnot\s+(?:a\s+)?(?:giant\s+)?enterprise\b|\bno\s+enterprise\b/i, id: "no-enterprise", label: "No enterprise features" },
903
+ { pattern: /\bno(?:t want)?\s+(?:a\s+)?(?:generic\s+)?dashboard\b/i, id: "no-dashboard", label: "No generic dashboard" },
904
+ { pattern: /\bno\s+analytics\b/i, id: "no-analytics", label: "No analytics" },
905
+ { pattern: /\bsingle.?page\b/i, id: "single-page", label: "Single-page app" },
906
+ ];
907
+
908
+ const SYSTEM_PATTERNS: { pattern: RegExp; id: string; label: string }[] = [
909
+ { pattern: /\bsupabase\b/i, id: "supabase", label: "Supabase" },
910
+ { pattern: /\bauth\s+context\b|\bexisting\s+auth\b/i, id: "auth-context", label: "Auth context" },
911
+ { pattern: /\bnew\s+\w+(?:_\w+)*\s+table\b|\bnew\s+(?:table|schema)\b/i, id: "new-db-table", label: "New database table" },
912
+ { pattern: /\bexisting\s+(?:\w+\s+)?table\b/i, id: "existing-db", label: "Existing database" },
913
+ { pattern: /\bavatar\s+upload\b|\bfile\s+upload\b|\bimage\s+upload\b/i, id: "upload", label: "File/image upload" },
914
+ { pattern: /\bAPI\s+route\b|\bendpoint\b/i, id: "api-route", label: "API route" },
915
+ { pattern: /\b\/\w+\b.*page\b|\bpage\s+at\s+\//i, id: "ui-page", label: "UI page/route" },
916
+ { pattern: /\bserver\s+(?:actions?|components?)\b/i, id: "server-actions", label: "Server actions" },
917
+ { pattern: /\bmiddleware\b/i, id: "middleware", label: "Middleware" },
918
+ { pattern: /\bnotion\b/i, id: "notion", label: "Notion" },
919
+ { pattern: /\bCSV\b/i, id: "csv", label: "CSV import/export" },
920
+ { pattern: /\bNext\.?js\b/i, id: "nextjs", label: "Next.js" },
921
+ { pattern: /\btailwind\b/i, id: "tailwind", label: "Tailwind CSS" },
922
+ { pattern: /\bclaude\b|\bai\s+(?:api|call|prompt)\b|\bllm\b/i, id: "ai-api", label: "AI/LLM API" },
923
+ ];
924
+
925
+ const SOURCE_PATTERNS: { pattern: RegExp; id: string; label: string }[] = [
926
+ { pattern: /\bcall\s+(?:notes?|transcripts?)\b/i, id: "call-notes", label: "Call notes" },
927
+ { pattern: /\bsupport\s+tickets?\b/i, id: "tickets", label: "Support tickets" },
928
+ { pattern: /\bscreenshots?\b/i, id: "screenshots", label: "Screenshots" },
929
+ { pattern: /\bvoice\s+(?:notes?|memos?)\b/i, id: "voice-notes", label: "Voice notes" },
930
+ { pattern: /\bnotion\s+docs?\b/i, id: "notion-docs", label: "Notion docs" },
931
+ { pattern: /\bslack\s+messages?\b/i, id: "slack-msgs", label: "Slack messages" },
932
+ { pattern: /\bexisting\s+(?:code|repo)\b/i, id: "existing-code", label: "Existing codebase" },
933
+ { pattern: /\bfigma\b/i, id: "figma", label: "Figma designs" },
934
+ { pattern: /\bbrief\b|\bPRD\b|\bspec\b/i, id: "brief", label: "Existing brief/spec" },
935
+ ];
936
+
937
+ function inferChips(raw: string, constraints: string): InferredChip[] {
938
+ const combined = `${raw}\n${constraints}`;
939
+ const chips: InferredChip[] = [];
940
+
941
+ for (const { pattern, id, label } of BOUNDARY_PATTERNS) {
942
+ if (pattern.test(combined)) {
943
+ chips.push({ id, label, category: "boundary", selected: true, inferred_from: pattern.source });
944
+ }
945
+ }
946
+
947
+ for (const { pattern, id, label } of SYSTEM_PATTERNS) {
948
+ if (pattern.test(combined)) {
949
+ chips.push({ id, label, category: "system", selected: true, inferred_from: pattern.source });
950
+ }
951
+ }
952
+
953
+ for (const { pattern, id, label } of SOURCE_PATTERNS) {
954
+ if (pattern.test(combined)) {
955
+ chips.push({ id, label, category: "source", selected: true, inferred_from: pattern.source });
956
+ }
957
+ }
958
+
959
+ return chips;
960
+ }
961
+
962
+ function inferFollowUps(
963
+ seed: SynthesizedSeed,
964
+ chips: InferredChip[],
965
+ ): FollowUpQuestion[] {
966
+ const questions: FollowUpQuestion[] = [];
967
+
968
+ // Budget: 0 for high confidence, 1 for medium, 1-2 for low
969
+ const budget = seed.confidence === "high" ? 0 : seed.confidence === "medium" ? 1 : 2;
970
+ if (budget === 0) return [];
971
+
972
+ // Check for new DB table without confirmation
973
+ const hasNewTable = chips.some((c) => c.id === "new-db-table");
974
+ const hasUpload = chips.some((c) => c.id === "upload");
975
+
976
+ if (hasNewTable && seed.confidence !== "high" && questions.length < budget) {
977
+ questions.push({
978
+ question: "Should creating the new database table be part of this scope?",
979
+ why: "Database changes affect migration and deployment.",
980
+ options: ["Yes, include migration", "No, assume table exists", "Not sure yet"],
981
+ });
982
+ }
983
+
984
+ if (hasUpload && seed.confidence !== "high" && questions.length < budget) {
985
+ questions.push({
986
+ question: "Should file upload use existing storage infrastructure?",
987
+ why: "Storage setup affects scope and complexity.",
988
+ options: ["Yes, reuse existing", "No, needs new setup", "Not sure yet"],
989
+ });
990
+ }
991
+
992
+ // Generic fallback for low confidence
993
+ if (seed.confidence === "low" && questions.length === 0 && budget > 0) {
994
+ if (seed.task_type === "implementation-request") {
995
+ questions.push({
996
+ question: "What is the single most important thing this change should accomplish?",
997
+ why: "Helps Switchboard choose the right scope and execution boundaries.",
998
+ });
999
+ } else {
1000
+ questions.push({
1001
+ question: "Who will use this first — and what will they do in the first session?",
1002
+ why: "Helps Switchboard determine the right V1 slice.",
1003
+ });
1004
+ }
1005
+ }
1006
+
1007
+ return questions.slice(0, budget);
1008
+ }
1009
+
1010
+ function normRough(s: string): string {
1011
+ return compact(s)
1012
+ .toLowerCase()
1013
+ .replace(/[^a-z0-9\s]/g, " ")
1014
+ .replace(/\s+/g, " ")
1015
+ .trim();
1016
+ }
1017
+
1018
+ function isSubstantiveDuplicate(candidate: string, refs: string[]): boolean {
1019
+ const c = normRough(candidate);
1020
+ if (c.length < 16) return false;
1021
+ for (const r of refs) {
1022
+ const br = normRough(r);
1023
+ if (!br) continue;
1024
+ if (c === br) return true;
1025
+ if (c.length >= 28 && br.length >= 28 && (c.includes(br) || br.includes(c))) return true;
1026
+ }
1027
+ return false;
1028
+ }
1029
+
1030
+ /** Drop preview fields that repeat the same substantive text as direction / problem / one-liner. */
1031
+ function buildDistinctActivationPreview(seed: SynthesizedSeed): IntakeAnalysis["activation_preview"] {
1032
+ const problem = seed.problem;
1033
+ const proposed_solution = seed.proposed_solution;
1034
+ let v1_outcome = seed.v1_outcome;
1035
+ let first_build_slice = seed.first_build_slice;
1036
+
1037
+ const refsForV1 = [proposed_solution, problem, seed.one_liner];
1038
+ if (isSubstantiveDuplicate(v1_outcome, refsForV1)) {
1039
+ v1_outcome = "";
1040
+ }
1041
+
1042
+ const refsForSlice = [proposed_solution, v1_outcome || seed.v1_outcome, problem, seed.one_liner];
1043
+ if (isSubstantiveDuplicate(first_build_slice, refsForSlice)) {
1044
+ first_build_slice = "";
1045
+ }
1046
+
1047
+ return {
1048
+ title: seed.title,
1049
+ one_liner: seed.one_liner,
1050
+ problem,
1051
+ proposed_solution,
1052
+ target_user: seed.target_user,
1053
+ v1_outcome,
1054
+ non_goals: seed.non_goals,
1055
+ first_build_slice,
1056
+ open_questions: seed.open_questions,
1057
+ missing_inputs: [],
1058
+ confidence: seed.confidence,
1059
+ task_type: seed.task_type,
1060
+ };
1061
+ }
1062
+
1063
+ export function analyzeIntake(
1064
+ rawIdea: string,
1065
+ constraints: string,
1066
+ repoExists: boolean,
1067
+ whatDoYouWantNext: string = "",
1068
+ operatorTargetUser?: string,
1069
+ ): IntakeAnalysis {
1070
+ const taskType = detectTaskType(rawIdea, repoExists);
1071
+ const chips = inferChips(rawIdea, constraints);
1072
+
1073
+ const provider = new LocalSynthesisProvider();
1074
+ const activationInput: ActivationInput = {
1075
+ raw_idea: rawIdea,
1076
+ repo_exists: repoExists,
1077
+ what_do_you_want_next: whatDoYouWantNext.trim() || "—",
1078
+ constraints,
1079
+ };
1080
+ const seed = provider.extractSeed(activationInput);
1081
+
1082
+ const targetMeta = operatorTargetUser?.trim()
1083
+ ? { user: operatorTargetUser.trim(), explicit: true }
1084
+ : extractTargetUser(rawIdea);
1085
+ const gaps = collectIntakeGaps(activationInput, seed);
1086
+
1087
+ const followUps = inferFollowUps(seed, chips);
1088
+
1089
+ const blocked = gaps.blocking.length > 0;
1090
+ const confidenceNote = blocked
1091
+ ? "Lock blocked — the draft record is missing required fields."
1092
+ : seed.confidence === "high"
1093
+ ? "Minimum lock criteria met — review the charter, then write the opening record."
1094
+ : seed.confidence === "medium"
1095
+ ? "Shaped enough to lock if you accept the cautions below."
1096
+ : "Thin signal — cautions and open items are explicit; lock only if you accept the risk.";
1097
+
1098
+ const activation_preview = buildDistinctActivationPreview(seed);
1099
+
1100
+ return intakeAnalysisSchema.parse({
1101
+ task_type: taskType,
1102
+ chips,
1103
+ follow_ups: followUps,
1104
+ confidence_note: confidenceNote,
1105
+ activation_preview,
1106
+ target_user_on_record: targetMeta.explicit,
1107
+ activation_state: blocked ? "blocked_by_missing_evidence" : "ready_to_lock",
1108
+ lock_blocking_requirements: gaps.blocking,
1109
+ lock_cautions: gaps.cautions,
1110
+ lock_tracked_open: seed.open_questions,
1111
+ });
1112
+ }
1113
+
1114
+ export { slugify };