@langwatch/server 3.8.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1330) hide show
  1. package/README.md +3 -3
  2. package/feature-map.json +4 -2
  3. package/langevals/evaluators/langevals/langevals_langevals/select_best_compare.py +165 -5
  4. package/langevals/evaluators/langevals/tests/test_select_best_compare.py +471 -9
  5. package/langevals/ts-integration/evaluators.generated.ts +83 -63
  6. package/langwatch/.env.example +7 -0
  7. package/langwatch/biome.jsonc +23 -0
  8. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-DKvtbwGG.js +2 -0
  9. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-D1vOO9OS.js +6 -0
  10. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-zxFsPi_K.js +2 -0
  11. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-soYSKpT_.js +2 -0
  12. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-BHJmgYGv.js +3 -0
  13. package/langwatch/dist/client/assets/AddParticipants-z6X3xaWh.js +2 -0
  14. package/langwatch/dist/client/assets/AgentHistoryDrawer-kb5K4X01.js +2 -0
  15. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Cf-aA1pn.js +5 -0
  16. package/langwatch/dist/client/assets/AgentListDrawer-z4OL5IVm.js +2 -0
  17. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-Ky7GOYHj.js +2 -0
  18. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-CAszeo8y.js +2 -0
  19. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-DWrxkhIq.js +2 -0
  20. package/langwatch/dist/client/assets/AiGatewayLayout-BqznP5T2.js +2 -0
  21. package/langwatch/dist/client/assets/AnnotationsTable-C9n949u_.js +2 -0
  22. package/langwatch/dist/client/assets/AreaChart-PNFZHqkl.js +2 -0
  23. package/langwatch/dist/client/assets/AuthCard-D14g-b3Y.js +2 -0
  24. package/langwatch/dist/client/assets/AutomationDrawer-Cjo9egay.js +112 -0
  25. package/langwatch/dist/client/assets/BarChart-B23ShI5J.js +4 -0
  26. package/langwatch/dist/client/assets/BatchEvaluationSummary-CmkigWIn.js +2 -0
  27. package/langwatch/dist/client/assets/BudgetEditDrawer-nkQpQiY0.js +2 -0
  28. package/langwatch/dist/client/assets/CartesianChart-Ci1mTvgb.js +54 -0
  29. package/langwatch/dist/client/assets/CascadeArchiveDialog-BPqLe1Ai.js +2 -0
  30. package/langwatch/dist/client/assets/ChartTooltip-BMGa2HEK.js +2 -0
  31. package/langwatch/dist/client/assets/ChatWindow-BBsct-iS.js +5 -0
  32. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-DOqtlBKU.js +9 -0
  33. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk--UfSQyVR.js +2 -0
  34. package/langwatch/dist/client/assets/ColorfulBlockIcons-zwwbjL9F.js +6 -0
  35. package/langwatch/dist/client/assets/ColumnTypeIcon-CZZ6Esh0.js +2 -0
  36. package/langwatch/dist/client/assets/ComparisonLeaderboardDrawer-ChH7KNaX.js +4 -0
  37. package/langwatch/dist/client/assets/ConfirmDialog-CWzCY4sN.js +2 -0
  38. package/langwatch/dist/client/assets/ContactSalesBlock-B3w2lKdE.js +2 -0
  39. package/langwatch/dist/client/assets/Conversation-BhvQmXJ-.js +2 -0
  40. package/langwatch/dist/client/assets/CopyInput-Qeb_2bgP.js +2 -0
  41. package/langwatch/dist/client/assets/CopyableInputWithPrefix-Bp04WBtM.js +2 -0
  42. package/langwatch/dist/client/assets/CreateProjectDrawer-Dg_yrbka.js +2 -0
  43. package/langwatch/dist/client/assets/CreateTeamDrawer-CLJnKmFE.js +2 -0
  44. package/langwatch/dist/client/assets/CustomGraph-C6j6slUs.js +2 -0
  45. package/langwatch/dist/client/assets/DashboardLayout-Cn5-9Ye2.js +96 -0
  46. package/langwatch/dist/client/assets/DashboardNameDrawer-BvGn3rsq.js +2 -0
  47. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-Wx7PJ_9S.js +2 -0
  48. package/langwatch/dist/client/assets/DatasetEditorTable-Ca3bmQrl.js +2 -0
  49. package/langwatch/dist/client/assets/DatasetPickerList-RZLjPQ2S.js +2 -0
  50. package/langwatch/dist/client/assets/DatasetPreviewTable-Ck22Wy4h.js +2 -0
  51. package/langwatch/dist/client/assets/DatasetSelector-BxeSHSDD.js +2 -0
  52. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-ncleLyuX.js +2 -0
  53. package/langwatch/dist/client/assets/DeleteConfirmationDialog-Br5m12kp.js +2 -0
  54. package/langwatch/dist/client/assets/DocsLinks-D-I122gH.js +2 -0
  55. package/langwatch/dist/client/assets/DynamicZodForm-BUbQBluG.js +2 -0
  56. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-Bci7dGy6.js +3 -0
  57. package/langwatch/dist/client/assets/EditModelProviderDrawer-CdUQa5qQ.js +4 -0
  58. package/langwatch/dist/client/assets/EditProjectDrawer-DDMa3VNp.js +2 -0
  59. package/langwatch/dist/client/assets/EmojiPickerModal-BLskXRKS.js +3 -0
  60. package/langwatch/dist/client/assets/EnterpriseLockedSurface-CGy3NpuC.js +2 -0
  61. package/langwatch/dist/client/assets/ErrorBarContext-CUuF6tzC.js +2 -0
  62. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Dw6JMkKa.js +107 -0
  63. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-F1nHh-cP.js +2 -0
  64. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-eotRSQPT.js +2 -0
  65. package/langwatch/dist/client/assets/EvaluatorEditorShared-BLZXXMFD.js +43 -0
  66. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-Bx_uZmkb.js +2 -0
  67. package/langwatch/dist/client/assets/EvaluatorListDrawer--2JYBA1w.js +2 -0
  68. package/langwatch/dist/client/assets/EvaluatorMappingsSection-DCqvgq8G.js +2 -0
  69. package/langwatch/dist/client/assets/EvaluatorSelection-BTMe6CCC.js +2 -0
  70. package/langwatch/dist/client/assets/EvaluatorSelectionBox-CDxYA37_.js +2 -0
  71. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BDgiQ_Gu.js +2 -0
  72. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-D4HFeq77.js +2 -0
  73. package/langwatch/dist/client/assets/ExecutionState-xp8LG59p.js +2 -0
  74. package/langwatch/dist/client/assets/FeatureFlagsDrawer-DIplgYQy.js +2 -0
  75. package/langwatch/dist/client/assets/FieldInfoTooltip-C_hEtQpK.js +2 -0
  76. package/langwatch/dist/client/assets/FieldsFilters-Ci5mVooQ.js +2 -0
  77. package/langwatch/dist/client/assets/FilterDisplay-BKjP30tt.js +2 -0
  78. package/langwatch/dist/client/assets/FilterSidebar-Cgxbpfi7.js +2 -0
  79. package/langwatch/dist/client/assets/FormatMoney-LZE9c_pf.js +2 -0
  80. package/langwatch/dist/client/assets/FoundryDrawer-DjVyu6Ww.js +2 -0
  81. package/langwatch/dist/client/assets/FullLogo-DRBt8v39.js +2 -0
  82. package/langwatch/dist/client/assets/GovernanceLayout-Baar1Fc8.js +2 -0
  83. package/langwatch/dist/client/assets/GraphsLayout-RNsRoPhs.js +2 -0
  84. package/langwatch/dist/client/assets/GroupBindingInputRow-BxvXd1EU.js +2 -0
  85. package/langwatch/dist/client/assets/GuardrailsDrawer-BtsfIXzD.js +91 -0
  86. package/langwatch/dist/client/assets/History-B3CO9rUC.js +17 -0
  87. package/langwatch/dist/client/assets/HorizontalFormControl-CpxShF8O.js +2 -0
  88. package/langwatch/dist/client/assets/HoverableBigText-BMBnTTnr.js +2 -0
  89. package/langwatch/dist/client/assets/InstallCliCard-DO5HE9Zk.js +2 -0
  90. package/langwatch/dist/client/assets/IntegratePaneShell-Bc7i3AU3.js +8 -0
  91. package/langwatch/dist/client/assets/InviteMemberDrawer-CiQbGDVl.js +2 -0
  92. package/langwatch/dist/client/assets/IsolatedErrorBoundary-QK1gsCee.js +2 -0
  93. package/langwatch/dist/client/assets/LLMModelCostDrawer-K4uPc99h.js +2 -0
  94. package/langwatch/dist/client/assets/LangyContextTarget-Dxr919ue.js +2 -0
  95. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-CnBBcfON.js +2 -0
  96. package/langwatch/dist/client/assets/Legend-C-o-ebW-.js +6 -0
  97. package/langwatch/dist/client/assets/Line-CbuF_DU9.js +2 -0
  98. package/langwatch/dist/client/assets/LineChart-CjG7MhLF.js +2 -0
  99. package/langwatch/dist/client/assets/ListTable-Dq11zhPy.js +2 -0
  100. package/langwatch/dist/client/assets/LoadingScreen-BRa1kl7f.js +2 -0
  101. package/langwatch/dist/client/assets/Markdown-Cip8Rj5C.js +35 -0
  102. package/langwatch/dist/client/assets/MenuLink-CEEzPpsg.js +2 -0
  103. package/langwatch/dist/client/assets/MessageCard-Nbu21sIo.js +2 -0
  104. package/langwatch/dist/client/assets/MetadataTag-CQmOL4su.js +5 -0
  105. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-s8Z1JIfQ.js +2 -0
  106. package/langwatch/dist/client/assets/ModelProviderScreen-BkZVsCiO.js +2 -0
  107. package/langwatch/dist/client/assets/ModelSelector-BjEx9IlF.js +2 -0
  108. package/langwatch/dist/client/assets/MyLayout-Dr6t6Ogu.js +2 -0
  109. package/langwatch/dist/client/assets/NavigationFooter-GfOzirbT.js +2 -0
  110. package/langwatch/dist/client/assets/NewWorkflowForm-uqnhwRpZ.js +2 -0
  111. package/langwatch/dist/client/assets/NoDataInfoBlock-Busjhz63.js +2 -0
  112. package/langwatch/dist/client/assets/OnboardingContainer-BGhio01s.js +2 -0
  113. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-DyCVUUmz.js +2 -0
  114. package/langwatch/dist/client/assets/OpsPageShell-GqOT9Ezv.js +2 -0
  115. package/langwatch/dist/client/assets/OttlEditor-BYyg1quG.js +3 -0
  116. package/langwatch/dist/client/assets/OverflownText-q6WIx911.js +2 -0
  117. package/langwatch/dist/client/assets/ProjectAvatar-B0tbfKzY.js +43 -0
  118. package/langwatch/dist/client/assets/ProjectLangyLayout-Du3nxtBV.js +82 -0
  119. package/langwatch/dist/client/assets/PromptEditorDrawer-DeL8XgdG.js +2 -0
  120. package/langwatch/dist/client/assets/PromptListDrawer-y4bmNt4t.js +2 -0
  121. package/langwatch/dist/client/assets/PropertySectionTitle-CK55WvKi.js +37 -0
  122. package/langwatch/dist/client/assets/ProviderModelSelector-B-0vpQ2t.js +2 -0
  123. package/langwatch/dist/client/assets/ProviderScopeChips-DN3rtvAE.js +2 -0
  124. package/langwatch/dist/client/assets/PushToCopiesDialog-Ry_M3FuH.js +2 -0
  125. package/langwatch/dist/client/assets/ReferenceDot-DrNtDSrg.js +2 -0
  126. package/langwatch/dist/client/assets/RenderInputOutput-DqsCnspr.js +261 -0
  127. package/langwatch/dist/client/assets/ScatterChart-jarSkvrF.js +2 -0
  128. package/langwatch/dist/client/assets/ScenarioFormDrawer-DvJcYmkQ.js +2 -0
  129. package/langwatch/dist/client/assets/ScenarioInputMappingSection-BewVLFCZ.js +2 -0
  130. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-BAPna8ym.js +3 -0
  131. package/langwatch/dist/client/assets/ScopeChipPicker-pQ061i-c.js +2 -0
  132. package/langwatch/dist/client/assets/SearchInput-DH_qIhwi.js +2 -0
  133. package/langwatch/dist/client/assets/SectionNavigationLayout-DwPBnqYj.js +2 -0
  134. package/langwatch/dist/client/assets/SelectDatasetDrawer-8MPCEZID.js +2 -0
  135. package/langwatch/dist/client/assets/SelectionActionBar-C2SOsiow.js +2 -0
  136. package/langwatch/dist/client/assets/SeriesFilterDrawer-d5DYEKTZ.js +2 -0
  137. package/langwatch/dist/client/assets/SettingsLayout-ZI47ZjuT.js +2 -0
  138. package/langwatch/dist/client/assets/SetupWithAgentButton-CNTb3Avj.js +4 -0
  139. package/langwatch/dist/client/assets/ShikiCommandBox-u0WEsz_9.js +5 -0
  140. package/langwatch/dist/client/assets/SpanDetails-L_YT0nxH.js +3 -0
  141. package/langwatch/dist/client/assets/SubscriptionPage-CaUbKJjG.js +2 -0
  142. package/langwatch/dist/client/assets/SuiteFormDrawer-BjUQdKq8.js +2 -0
  143. package/langwatch/dist/client/assets/Symbols-R6sphPWl.js +2 -0
  144. package/langwatch/dist/client/assets/TabButton-8Oc9UYh8.js +3 -0
  145. package/langwatch/dist/client/assets/TableCell-Ci8ylzki.js +2 -0
  146. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-DSKFRtdD.js +2 -0
  147. package/langwatch/dist/client/assets/TeamForm-CL9ycvq0.js +2 -0
  148. package/langwatch/dist/client/assets/TeamUserRoleField-D0ZTlKiH.js +2 -0
  149. package/langwatch/dist/client/assets/TraceDetails-JolY6sXJ.js +9 -0
  150. package/langwatch/dist/client/assets/TraceDetailsDrawer-lgPzHJ3L.js +2 -0
  151. package/langwatch/dist/client/assets/TraceIdPeek-DDi0ChdF.js +2 -0
  152. package/langwatch/dist/client/assets/TracesMapping-BPXT_-h4.js +2 -0
  153. package/langwatch/dist/client/assets/UpgradeModalContent-DmGd0n65.js +2 -0
  154. package/langwatch/dist/client/assets/UploadCSVDrawer-haYFZH65.js +3 -0
  155. package/langwatch/dist/client/assets/VariablesSection-DW_-pHw8.js +2 -0
  156. package/langwatch/dist/client/assets/VersionBadge-BrsZ4NP1.js +2 -0
  157. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9tl6d9Q.js +1161 -0
  158. package/langwatch/dist/client/assets/ViewAutomationDrawer-DliGiKaC.js +2 -0
  159. package/langwatch/dist/client/assets/VirtualKeySecretReveal-B9QMNIxJ.js +54 -0
  160. package/langwatch/dist/client/assets/WelcomeLayout-DZ1ue0he.js +2 -0
  161. package/langwatch/dist/client/assets/WithFeatureFlagGuard-CgkIIt3_.js +2 -0
  162. package/langwatch/dist/client/assets/WithPermissionGuard-Da_hdEdq.js +2 -0
  163. package/langwatch/dist/client/assets/WorkflowCard-C_ClnTV_.js +2 -0
  164. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-DozYRazW.js +2 -0
  165. package/langwatch/dist/client/assets/_...path_-Da4obdgF.js +2 -0
  166. package/langwatch/dist/client/assets/_Uint8Array-BKsS4AYJ.js +2 -0
  167. package/langwatch/dist/client/assets/__...path__-hjRUlcmj.js +22 -0
  168. package/langwatch/dist/client/assets/_baseAssignValue-B0IP5NGP.js +2 -0
  169. package/langwatch/dist/client/assets/_baseClone-DWP1OuEe.js +2 -0
  170. package/langwatch/dist/client/assets/_baseEach-Bv6waMUN.js +2 -0
  171. package/langwatch/dist/client/assets/_baseFor-K5aTWdeA.js +2 -0
  172. package/langwatch/dist/client/assets/_experiment_-Cv2h4AYK.js +2 -0
  173. package/langwatch/dist/client/assets/_id_-BoubOQoS.js +2 -0
  174. package/langwatch/dist/client/assets/_id_-BuzJEIUf.js +2 -0
  175. package/langwatch/dist/client/assets/_id_-BzLlrR7z.js +2 -0
  176. package/langwatch/dist/client/assets/_id_-DAzjJ7AY.js +2 -0
  177. package/langwatch/dist/client/assets/_id_-Dc2UAWAO.js +2 -0
  178. package/langwatch/dist/client/assets/_id_-DwutdLKk.js +2 -0
  179. package/langwatch/dist/client/assets/_id_-H7-5DI5r.js +2 -0
  180. package/langwatch/dist/client/assets/_project_-DTuunSJZ.js +8 -0
  181. package/langwatch/dist/client/assets/_runId_-BGhwmwQj.js +7 -0
  182. package/langwatch/dist/client/assets/_shell-ChQAHWWX.js +2 -0
  183. package/langwatch/dist/client/assets/_slug_-D6Y2wsW5.js +2 -0
  184. package/langwatch/dist/client/assets/_slug_-DLKkXVG8.js +2 -0
  185. package/langwatch/dist/client/assets/_slug_-yLo6E4BE.js +17 -0
  186. package/langwatch/dist/client/assets/_team_-TUptH6wK.js +2 -0
  187. package/langwatch/dist/client/assets/_workflow_-B_flNNON.js +3 -0
  188. package/langwatch/dist/client/assets/_workflow_-DUyBeEF1.js +25 -0
  189. package/langwatch/dist/client/assets/accept-BtE8pbrP.js +2 -0
  190. package/langwatch/dist/client/assets/activity-BDNvBEBL.js +1 -0
  191. package/langwatch/dist/client/assets/agents-CZnWSlhu.js +2 -0
  192. package/langwatch/dist/client/assets/alerts-BDNvBEBL.js +1 -0
  193. package/langwatch/dist/client/assets/all-in7z_yGY.js +2 -0
  194. package/langwatch/dist/client/assets/analytics-C8m2qboV.js +2 -0
  195. package/langwatch/dist/client/assets/annotation-scores-hmT53w46.js +2 -0
  196. package/langwatch/dist/client/assets/annotations-DwouO48Z.js +2 -0
  197. package/langwatch/dist/client/assets/anomaly-rules-DoJdIoCt.js +2 -0
  198. package/langwatch/dist/client/assets/api-keys-CykxAxvG.js +4 -0
  199. package/langwatch/dist/client/assets/asaplangy-D3J00Q-Z.js +5 -0
  200. package/langwatch/dist/client/assets/audit-log-Dy4vcEeJ.js +2 -0
  201. package/langwatch/dist/client/assets/auth-IqMSC5k1.js +2 -0
  202. package/langwatch/dist/client/assets/authentication-BqVl7Fh-.js +2 -0
  203. package/langwatch/dist/client/assets/authorize-BGMc1Gzv.js +2 -0
  204. package/langwatch/dist/client/assets/authorize-DhHzBVUd.js +2 -0
  205. package/langwatch/dist/client/assets/automations-BDNvBEBL.js +1 -0
  206. package/langwatch/dist/client/assets/automations-BhzNESFp.js +2 -0
  207. package/langwatch/dist/client/assets/billing-plans-D_IT1cHz.js +2 -0
  208. package/langwatch/dist/client/assets/blank-Ct2wtHyX.js +2 -0
  209. package/langwatch/dist/client/assets/blobs-Dwi1OImQ.js +2 -0
  210. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CnAsMlS_.js +133 -0
  211. package/langwatch/dist/client/assets/budgets-Cn5gXQK_.js +3 -0
  212. package/langwatch/dist/client/assets/bug-reports-feRha8NA.js +2 -0
  213. package/langwatch/dist/client/assets/cache-rules-T0g7jfVv.js +2 -0
  214. package/langwatch/dist/client/assets/choose-D7SJAjkq.js +2 -0
  215. package/langwatch/dist/client/assets/chunk-EX3LRPZG-DkekrL-i.js +232 -0
  216. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-2uc49Oqf.js +3 -0
  217. package/langwatch/dist/client/assets/chunk-PUDLZKDR-CdFvlX4m.js +157 -0
  218. package/langwatch/dist/client/assets/chunk-RYQCIY6F-BLUBc3em.js +2 -0
  219. package/langwatch/dist/client/assets/chunk-V7JOEXUC-daLm26hJ.js +207 -0
  220. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-CDA8LHAw.js +2 -0
  221. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-CDA8LHAw.js +2 -0
  222. package/langwatch/dist/client/assets/clsx-CjueKrWZ.js +2 -0
  223. package/langwatch/dist/client/assets/codeAgentConfig-BGKq9uCt.js +7 -0
  224. package/langwatch/dist/client/assets/codingDefaultSync-BHSxIX3Y.js +2 -0
  225. package/langwatch/dist/client/assets/configure-CrBmyV7I.js +4 -0
  226. package/langwatch/dist/client/assets/constants-CDt5HyiB.js +2 -0
  227. package/langwatch/dist/client/assets/custom-wRFdLdR4.js +12 -0
  228. package/langwatch/dist/client/assets/custom_evaluator-C4ikBFuX.js +31 -0
  229. package/langwatch/dist/client/assets/dagre-VKFMJZFB-BElJnuGp.js +5 -0
  230. package/langwatch/dist/client/assets/dagre-VMur7wh6.js +2 -0
  231. package/langwatch/dist/client/assets/data-privacy-DAIYO4AS.js +2 -0
  232. package/langwatch/dist/client/assets/data-retention-6spK_HnV.js +2 -0
  233. package/langwatch/dist/client/assets/datasets-_6-oF4ZW.js +2 -0
  234. package/langwatch/dist/client/assets/debounce-CS9Z04io.js +2 -0
  235. package/langwatch/dist/client/assets/defaultModelState-B2tL23ua.js +2 -0
  236. package/langwatch/dist/client/assets/dejaview-Cde-wWV4.js +2 -0
  237. package/langwatch/dist/client/assets/departments-Cm-0ZxEt.js +2 -0
  238. package/langwatch/dist/client/assets/devices-DmiWzGY2.js +2 -0
  239. package/langwatch/dist/client/assets/dist-C4xeXVRv.js +6 -0
  240. package/langwatch/dist/client/assets/drawerFromUrl-CKr5SifD.js +2 -0
  241. package/langwatch/dist/client/assets/edit-CLmkWTOM.js +62 -0
  242. package/langwatch/dist/client/assets/email-suppressions-cqwH0a9N.js +2 -0
  243. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-Byy32QYy.js +86 -0
  244. package/langwatch/dist/client/assets/error-D8QCVS4R.js +2 -0
  245. package/langwatch/dist/client/assets/errors-mlatPkMI.js +2 -0
  246. package/langwatch/dist/client/assets/evaluations-BBoYdpZy.js +2 -0
  247. package/langwatch/dist/client/assets/evaluations-DhzXchFj.js +2 -0
  248. package/langwatch/dist/client/assets/evaluators-BtHslgaT.js +2 -0
  249. package/langwatch/dist/client/assets/evaluators-_EDCn-tQ.js +148 -0
  250. package/langwatch/dist/client/assets/experiments-CffarahA.js +1 -0
  251. package/langwatch/dist/client/assets/feature-flags-mcBTRF0E.js +2 -0
  252. package/langwatch/dist/client/assets/fetchSSE-CnJPAkno.js +3 -0
  253. package/langwatch/dist/client/assets/fieldset-kmG3NTVs.js +2 -0
  254. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-CY9NG0NN.js +1 -0
  255. package/langwatch/dist/client/assets/forgot-password-wo5Sna-0.js +2 -0
  256. package/langwatch/dist/client/assets/formatMoney-ClmqgvaY.js +2 -0
  257. package/langwatch/dist/client/assets/formatTargetOutput-DXvqMkYJ.js +2 -0
  258. package/langwatch/dist/client/assets/foundry-CfvGgfP0.js +477 -0
  259. package/langwatch/dist/client/assets/gateway-Be0EsD57.js +2 -0
  260. package/langwatch/dist/client/assets/getEvaluator-D2EjIa3G.js +2 -0
  261. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-D2oUP3Tn.js +2 -0
  262. package/langwatch/dist/client/assets/governance-YZL-Q4Vy.js +2 -0
  263. package/langwatch/dist/client/assets/graphlib-DsLTzvlk.js +2 -0
  264. package/langwatch/dist/client/assets/grid-MxZhegzw.js +2 -0
  265. package/langwatch/dist/client/assets/groups-BmusUt3C.js +2 -0
  266. package/langwatch/dist/client/assets/guardrails-DAx8mDop.js +2 -0
  267. package/langwatch/dist/client/assets/handled-error-DbmvFmFF.js +2 -0
  268. package/langwatch/dist/client/assets/http-C64lOZI7.js +7 -0
  269. package/langwatch/dist/client/assets/identifierUtils-C2FgAR6z.js +2 -0
  270. package/langwatch/dist/client/assets/immer-DImI3Uq2.js +14 -0
  271. package/langwatch/dist/client/assets/index-8SbDirJv.js +68 -0
  272. package/langwatch/dist/client/assets/ingestion-source-detail-PQbeRniA.js +19 -0
  273. package/langwatch/dist/client/assets/ingestion-sources-CCyiAKHP.js +12 -0
  274. package/langwatch/dist/client/assets/integrations-WSl7N8v9.js +2 -0
  275. package/langwatch/dist/client/assets/isArrayLikeObject-DQ6J5Gh8.js +2 -0
  276. package/langwatch/dist/client/assets/isSymbol-DQQCRrSw.js +2 -0
  277. package/langwatch/dist/client/assets/langyHomeSuggestions-czH603Eu.js +2 -0
  278. package/langwatch/dist/client/assets/license-BXfbZQgG.js +2 -0
  279. package/langwatch/dist/client/assets/licenseStatusUtils-CeEgqpQ1.js +2 -0
  280. package/langwatch/dist/client/assets/lu-BSZWBZXU.js +2 -0
  281. package/langwatch/dist/client/assets/map-DUpZ7PrO.js +2 -0
  282. package/langwatch/dist/client/assets/mappingValidation-C7knTdfD.js +2 -0
  283. package/langwatch/dist/client/assets/me-DbCM2fI8.js +7 -0
  284. package/langwatch/dist/client/assets/me-DgXzEkaD.js +2 -0
  285. package/langwatch/dist/client/assets/members-CNILhgB4.js +2 -0
  286. package/langwatch/dist/client/assets/mermaid.core-1LNrQSiZ.js +12 -0
  287. package/langwatch/dist/client/assets/messages-CIoUj-2S.js +2 -0
  288. package/langwatch/dist/client/assets/metrics-Ba4ghWyR.js +2 -0
  289. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-BsK9qdX4.js +97 -0
  290. package/langwatch/dist/client/assets/model-costs-Cmo-7iNN.js +2 -0
  291. package/langwatch/dist/client/assets/model-providers-DNeQW-T1.js +2 -0
  292. package/langwatch/dist/client/assets/modelProviderHelpers-BgYFTBND.js +2 -0
  293. package/langwatch/dist/client/assets/my-queue-DAyfQ6lp.js +2 -0
  294. package/langwatch/dist/client/assets/normalizeComparison-QGQpERT7.js +2 -0
  295. package/langwatch/dist/client/assets/not-found-BFkr8OS7.js +2 -0
  296. package/langwatch/dist/client/assets/now-BWCCq_PO.js +2 -0
  297. package/langwatch/dist/client/assets/onboarding-DAAoh3gE.js +2 -0
  298. package/langwatch/dist/client/assets/online-evaluations-DbC0C3ct.js +2 -0
  299. package/langwatch/dist/client/assets/ops-BnGgY3gP.js +2 -0
  300. package/langwatch/dist/client/assets/organizations-D-hWxeYL.js +2 -0
  301. package/langwatch/dist/client/assets/pages-BthWVZpr.js +2 -0
  302. package/langwatch/dist/client/assets/persistence-NkzSPIBC.js +2 -0
  303. package/langwatch/dist/client/assets/personalProject-C9vU_vdl.js +2 -0
  304. package/langwatch/dist/client/assets/plans-B_rx4bLE.js +2 -0
  305. package/langwatch/dist/client/assets/preconditionFieldUtils-ryKgG9T1.js +2 -0
  306. package/langwatch/dist/client/assets/product-BuY5Xwg3.js +2 -0
  307. package/langwatch/dist/client/assets/project-C2NjfKL8.js +2 -0
  308. package/langwatch/dist/client/assets/projections-rLpLV9w3.js +2 -0
  309. package/langwatch/dist/client/assets/projects-BF0LrAID.js +2 -0
  310. package/langwatch/dist/client/assets/promptHandle-BT-5THDj.js +2 -0
  311. package/langwatch/dist/client/assets/prompts-BHe5aLJx.js +8 -0
  312. package/langwatch/dist/client/assets/radio-group-BPt-WSZX.js +2 -0
  313. package/langwatch/dist/client/assets/registry-olFQKglt.js +2 -0
  314. package/langwatch/dist/client/assets/reports-BLYN6Q1s.js +2 -0
  315. package/langwatch/dist/client/assets/request-DFzKYavU.js +2 -0
  316. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-CRtGWC_J.js +85 -0
  317. package/langwatch/dist/client/assets/reset-password-DYZspdMQ.js +2 -0
  318. package/langwatch/dist/client/assets/role-bindings-FmulBsng.js +2 -0
  319. package/langwatch/dist/client/assets/roles-RLhR-aqL.js +2 -0
  320. package/langwatch/dist/client/assets/routing-policies-ljceihkc.js +5 -0
  321. package/langwatch/dist/client/assets/scenarios-BQqYDDZG.js +2 -0
  322. package/langwatch/dist/client/assets/scheduler-BFnKJjAw.js +2 -0
  323. package/langwatch/dist/client/assets/schedules-BDNvBEBL.js +1 -0
  324. package/langwatch/dist/client/assets/scim-Bmka9JwE.js +2 -0
  325. package/langwatch/dist/client/assets/seatTypeCopy-fhsCX-T3.js +2 -0
  326. package/langwatch/dist/client/assets/secrets-Cwr6m0Ec.js +2 -0
  327. package/langwatch/dist/client/assets/segment-group-BktqF-NE.js +2 -0
  328. package/langwatch/dist/client/assets/segmented-control-Dux7mG6V.js +2 -0
  329. package/langwatch/dist/client/assets/select-BvA110t-.js +2 -0
  330. package/langwatch/dist/client/assets/send-KqbwnHm5.js +2 -0
  331. package/langwatch/dist/client/assets/sequenceView-CXTCS8lF.js +5 -0
  332. package/langwatch/dist/client/assets/seriesOptions-B04NlY20.js +1015 -0
  333. package/langwatch/dist/client/assets/settings-U355L_I1.js +2 -0
  334. package/langwatch/dist/client/assets/setup-BlSoABYV.js +2 -0
  335. package/langwatch/dist/client/assets/shikiAdapter-Ctbe7cQu.js +3 -0
  336. package/langwatch/dist/client/assets/showSuiteRunError-D2fez5Ub.js +2 -0
  337. package/langwatch/dist/client/assets/signin-DyT1qLoq.js +2 -0
  338. package/langwatch/dist/client/assets/signup-D8m3PZ3b.js +2 -0
  339. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-iaTfadDT.js +2 -0
  340. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-DH-TUWs1.js +2 -0
  341. package/langwatch/dist/client/assets/subscription-_ypR9RT2.js +3 -0
  342. package/langwatch/dist/client/assets/subscriptions-BRPlrnsz.js +2 -0
  343. package/langwatch/dist/client/assets/suggestionUI-BvF9IL3n.js +106 -0
  344. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-DT3qutmi.js +3 -0
  345. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-Chcqm6v8.js +9 -0
  346. package/langwatch/dist/client/assets/switch-BZp2DIfW.js +2 -0
  347. package/langwatch/dist/client/assets/switch-C1DNHB2v.js +2 -0
  348. package/langwatch/dist/client/assets/tabs-B6CQXTUQ.js +2 -0
  349. package/langwatch/dist/client/assets/teams-B3Yc0LtS.js +2 -0
  350. package/langwatch/dist/client/assets/teams-Df3DGQGZ.js +2 -0
  351. package/langwatch/dist/client/assets/tool-catalog-CpVqJ_Dp.js +7 -0
  352. package/langwatch/dist/client/assets/toolIcons-CwYXl2Eu.js +2 -0
  353. package/langwatch/dist/client/assets/tooltip-CM-lMDNU.js +2 -0
  354. package/langwatch/dist/client/assets/topic-clustering-DEtDEXOU.js +2 -0
  355. package/langwatch/dist/client/assets/topics-BGSBPvH8.js +2 -0
  356. package/langwatch/dist/client/assets/traceStore-C-SeEWpA.js +55 -0
  357. package/langwatch/dist/client/assets/traces-hMC5nfWE.js +289 -0
  358. package/langwatch/dist/client/assets/tracesMapping-CJhNJ9Ej.js +3 -0
  359. package/langwatch/dist/client/assets/tracking-in5OR8uP.js +2 -0
  360. package/langwatch/dist/client/assets/types-DNh2n8ZE.js +2 -0
  361. package/langwatch/dist/client/assets/types-OZJZgbcd.js +2 -0
  362. package/langwatch/dist/client/assets/types-nw9Z9F-v.js +2 -0
  363. package/langwatch/dist/client/assets/undo-2-CYjzz3Fj.js +2 -0
  364. package/langwatch/dist/client/assets/usage-BMXYHJUH.js +2 -0
  365. package/langwatch/dist/client/assets/usage-Da6wBDdP.js +2 -0
  366. package/langwatch/dist/client/assets/use-generic-onboarding-flow-eie3NRF5.js +2 -0
  367. package/langwatch/dist/client/assets/useActivePlan-Dsa3BYxd.js +2 -0
  368. package/langwatch/dist/client/assets/useAllPromptsForProject-BS-h_uSZ.js +2 -0
  369. package/langwatch/dist/client/assets/useAnnotationQueues-BMo2kZ_n.js +2 -0
  370. package/langwatch/dist/client/assets/useAvailableEvaluators-DkZ2Yt1F.js +2 -0
  371. package/langwatch/dist/client/assets/useCyclingVerb-BTWaxKR2.js +2 -0
  372. package/langwatch/dist/client/assets/useDepartmentColumn-xoZ52lPP.js +2 -0
  373. package/langwatch/dist/client/assets/useEvaluationsV3Store-CjI63SqB.js +2 -0
  374. package/langwatch/dist/client/assets/useExportTraces-kA2TFkjy.js +2 -0
  375. package/langwatch/dist/client/assets/useFeatureFlag-BjAcqOFH.js +2 -0
  376. package/langwatch/dist/client/assets/usePersonalContext-BGjy_Vrg.js +2 -0
  377. package/langwatch/dist/client/assets/useProjectSpanNames-DV-N8Iqc.js +2 -0
  378. package/langwatch/dist/client/assets/useProjectsForCopy-C63wLMNr.js +2 -0
  379. package/langwatch/dist/client/assets/useRunViaApiTabs-DMsq4RV1.js +50 -0
  380. package/langwatch/dist/client/assets/useShowLangy-C1pPUZqz.js +2 -0
  381. package/langwatch/dist/client/assets/useSimulationUpdateListener-ufWGuGhO.js +2 -0
  382. package/langwatch/dist/client/assets/useTargetName-DRCsNovZ.js +2 -0
  383. package/langwatch/dist/client/assets/useTargetNameMap-2sQCSyzN.js +2 -0
  384. package/langwatch/dist/client/assets/useTraceDetailsDrawer-CWSKPTh_.js +2 -0
  385. package/langwatch/dist/client/assets/useTraceUpdateListener-DqLF7KuU.js +2 -0
  386. package/langwatch/dist/client/assets/useUrlScopeFilter-BmRsU3rU.js +2 -0
  387. package/langwatch/dist/client/assets/useVariantMetrics-CK9aOmIb.js +2 -0
  388. package/langwatch/dist/client/assets/useWorkflowStore-CWWkoMW1.js +8 -0
  389. package/langwatch/dist/client/assets/users-B9jauEWz.js +2 -0
  390. package/langwatch/dist/client/assets/users-C8IaWy9-.js +2 -0
  391. package/langwatch/dist/client/assets/users-DIbzKO8Q.js +2 -0
  392. package/langwatch/dist/client/assets/v3-C9Ud_O3k.js +2 -0
  393. package/langwatch/dist/client/assets/variables-Dox25KUK.js +396 -0
  394. package/langwatch/dist/client/assets/viewStore-BCIvcW8n.js +2 -0
  395. package/langwatch/dist/client/assets/virtual-keys-D-qkAFBv.js +2 -0
  396. package/langwatch/dist/client/assets/welcome-CnjW7kg3.js +16 -0
  397. package/langwatch/dist/client/assets/wizard-CUCaNag_.js +2 -0
  398. package/langwatch/dist/client/assets/workbench-N1DutXtL.js +2 -0
  399. package/langwatch/dist/client/assets/workflows-D2XRYWpS.js +3 -0
  400. package/langwatch/dist/client/assets/wrap-D_XqGHIU.js +2 -0
  401. package/langwatch/dist/client/index.html +4 -4
  402. package/langwatch/dist/scenario-child-process.js +7 -0
  403. package/langwatch/e2e/auth-regression/better-auth-sso-smoketest.ts +72 -0
  404. package/langwatch/ee/LICENSE.md +52 -18
  405. package/langwatch/ee/README.md +15 -6
  406. package/langwatch/ee/admin/routes/__tests__/admin.integration.test.ts +1 -1
  407. package/langwatch/ee/admin/routes/admin.ts +1 -1
  408. package/langwatch/ee/audit-log/auditLog.ts +51 -0
  409. package/langwatch/ee/billing/__tests__/planLimits.unit.test.ts +6 -6
  410. package/langwatch/ee/billing/__tests__/planProvider.unit.test.ts +21 -33
  411. package/langwatch/ee/billing/__tests__/subscription.service.unit.test.ts +1 -0
  412. package/langwatch/ee/billing/__tests__/usage-limit.service.unit.test.ts +17 -17
  413. package/langwatch/ee/billing/planLimits.ts +1 -37
  414. package/langwatch/ee/billing/planProvider.ts +0 -13
  415. package/langwatch/ee/governance/reactors/__tests__/gatewayBudgetSync.reactor.unit.test.ts +39 -0
  416. package/langwatch/ee/governance/reactors/__tests__/governanceKpisSync.reactor.unit.test.ts +33 -0
  417. package/langwatch/ee/governance/reactors/__tests__/governanceOcsfEventsSync.reactor.unit.test.ts +33 -0
  418. package/langwatch/ee/governance/reactors/__tests__/governanceReactorsPreEnqueueGate.unit.test.ts +243 -0
  419. package/langwatch/ee/governance/reactors/gatewayBudgetSync.reactor.ts +391 -185
  420. package/langwatch/ee/governance/reactors/governanceKpisSync.reactor.ts +14 -7
  421. package/langwatch/ee/governance/reactors/governanceOcsfEventsSync.reactor.ts +97 -81
  422. package/langwatch/ee/governance/services/governanceAttributeKeys.ts +17 -0
  423. package/langwatch/ee/licensing/__tests__/constants.unit.test.ts +4 -6
  424. package/langwatch/ee/licensing/__tests__/defaults.unit.test.ts +63 -86
  425. package/langwatch/ee/licensing/__tests__/fixtures/testLicenses.ts +18 -0
  426. package/langwatch/ee/licensing/__tests__/licenseGenerationService.unit.test.ts +52 -16
  427. package/langwatch/ee/licensing/__tests__/licenseHandler.integration.test.ts +199 -15
  428. package/langwatch/ee/licensing/__tests__/mintedPlan.unit.test.ts +110 -0
  429. package/langwatch/ee/licensing/__tests__/planMapping.unit.test.ts +4 -29
  430. package/langwatch/ee/licensing/__tests__/planTemplates.unit.test.ts +0 -61
  431. package/langwatch/ee/licensing/__tests__/validation.unit.test.ts +69 -0
  432. package/langwatch/ee/licensing/constants.ts +11 -59
  433. package/langwatch/ee/licensing/defaults.ts +20 -32
  434. package/langwatch/ee/licensing/licenseGenerationService.ts +6 -19
  435. package/langwatch/ee/licensing/licenseHandler.ts +109 -92
  436. package/langwatch/ee/licensing/mintedPlan.ts +57 -0
  437. package/langwatch/ee/licensing/ossBaselineFloor.ts +45 -0
  438. package/langwatch/ee/licensing/planInfo.ts +0 -13
  439. package/langwatch/ee/licensing/planMapping.ts +0 -13
  440. package/langwatch/ee/licensing/planTemplates.ts +8 -42
  441. package/langwatch/ee/licensing/types.ts +24 -29
  442. package/langwatch/ee/licensing/validation.ts +13 -1
  443. package/langwatch/ee/scim/__tests__/scim-token.service.unit.test.ts +110 -0
  444. package/langwatch/ee/scim/__tests__/scim.costCenter.integration.test.ts +171 -0
  445. package/langwatch/ee/scim/__tests__/scim.service.unit.test.ts +415 -0
  446. package/langwatch/ee/scim/routes.ts +585 -0
  447. package/langwatch/ee/scim/scim-group.service.ts +465 -0
  448. package/langwatch/ee/scim/scim-role-resolver.ts +48 -0
  449. package/langwatch/ee/scim/scim-role-resolver.unit.test.ts +93 -0
  450. package/langwatch/ee/scim/scim-token.service.ts +71 -0
  451. package/langwatch/ee/scim/scim.service.ts +554 -0
  452. package/langwatch/ee/scim/scim.types.ts +149 -0
  453. package/langwatch/ee/scim/webhooks.ts +170 -0
  454. package/langwatch/ee/sso/__tests__/fallbackName.test.ts +142 -0
  455. package/langwatch/ee/sso/__tests__/matching.test.ts +126 -0
  456. package/langwatch/ee/sso/__tests__/parseIssuerUrl.test.ts +59 -0
  457. package/langwatch/ee/sso/__tests__/sso-gate.test.ts +459 -0
  458. package/langwatch/ee/sso/__tests__/sso-license.repository.test.ts +53 -0
  459. package/langwatch/ee/sso/__tests__/ssoPathGate.test.ts +182 -0
  460. package/langwatch/ee/sso/__tests__/ssoRouteTableCanary.test.ts +186 -0
  461. package/langwatch/ee/sso/matching.ts +48 -0
  462. package/langwatch/ee/sso/providers.ts +271 -0
  463. package/langwatch/ee/sso/sso-gate.ts +294 -0
  464. package/langwatch/ee/sso/sso-license.repository.ts +47 -0
  465. package/langwatch/ee/sso/ssoPathGate.ts +127 -0
  466. package/langwatch/package.json +1 -1
  467. package/langwatch/prisma/migrations/20260802120000_organization_user_disabled_at/migration.sql +7 -0
  468. package/langwatch/prisma/schema.prisma +8 -0
  469. package/langwatch/scripts/check-feature-parity.ts +0 -4
  470. package/langwatch/src/__tests__/noBinarySourceFiles.unit.test.ts +56 -0
  471. package/langwatch/src/app/api/agents/[[...route]]/app.ts +0 -2
  472. package/langwatch/src/app/api/agents/__tests__/agents-rest-api.integration.test.ts +0 -22
  473. package/langwatch/src/app/api/dashboards/[[...route]]/app.ts +0 -2
  474. package/langwatch/src/app/api/dashboards/__tests__/dashboard-rest-api.integration.test.ts +0 -18
  475. package/langwatch/src/app/api/dataset/[[...route]]/app.ts +0 -33
  476. package/langwatch/src/app/api/dataset/__tests__/dataset-rest-api.integration.test.ts +0 -24
  477. package/langwatch/src/app/api/dataset/__tests__/dataset-upload-api.integration.test.ts +0 -25
  478. package/langwatch/src/app/api/evaluators/[[...route]]/app.v1.ts +0 -2
  479. package/langwatch/src/app/api/export/scenario-runs/[[...route]]/app.ts +250 -0
  480. package/langwatch/src/app/api/export/scenario-runs/__tests__/scenario-run-export-route.integration.test.ts +336 -0
  481. package/langwatch/src/app/api/graphs/[[...route]]/app.ts +0 -2
  482. package/langwatch/src/app/api/middleware/__tests__/error-handler.unit.test.ts +4 -4
  483. package/langwatch/src/app/api/middleware/index.ts +0 -1
  484. package/langwatch/src/app/api/monitors/[[...route]]/app.ts +0 -2
  485. package/langwatch/src/app/api/projects/[[...route]]/app.ts +28 -8
  486. package/langwatch/src/app/api/prompts/[[...route]]/app.v1.ts +0 -2
  487. package/langwatch/src/app/api/scenario-events/[[...route]]/app.ts +0 -5
  488. package/langwatch/src/app/api/scenarios/[[...route]]/app.v1.ts +0 -2
  489. package/langwatch/src/app/api/shared/errors.ts +14 -0
  490. package/langwatch/src/app/api/simulation-runs/__tests__/simulation-run-platform-url.integration.test.ts +6 -3
  491. package/langwatch/src/app/api/suites/[[...route]]/app.ts +0 -2
  492. package/langwatch/src/app/api/teams/[[...route]]/app.ts +22 -1
  493. package/langwatch/src/app/api/teams/__tests__/teams-rest-api.integration.test.ts +146 -0
  494. package/langwatch/src/app/api/traces/[[...route]]/app.v1.ts +114 -0
  495. package/langwatch/src/app/api/triggers/[[...route]]/app.ts +0 -2
  496. package/langwatch/src/components/AddMembersForm.tsx +25 -5
  497. package/langwatch/src/components/AddOrEditDatasetDrawer.tsx +1 -9
  498. package/langwatch/src/components/ComparisonLeaderboardDrawer.tsx +496 -0
  499. package/langwatch/src/components/LicenseStatus.tsx +14 -16
  500. package/langwatch/src/components/__tests__/ComparisonLeaderboardDrawer.gate.integration.test.tsx +146 -0
  501. package/langwatch/src/components/__tests__/LicenseStatus.integration.test.tsx +129 -0
  502. package/langwatch/src/components/__tests__/UpgradeModal.integration.test.tsx +358 -68
  503. package/langwatch/src/components/agents/AgentCodeEditorDrawer.tsx +7 -14
  504. package/langwatch/src/components/agents/AgentHttpEditorDrawer.tsx +7 -14
  505. package/langwatch/src/components/agents/WorkflowSelectorDrawer.tsx +1 -15
  506. package/langwatch/src/components/analytics/DashboardNameDrawer.tsx +20 -26
  507. package/langwatch/src/components/auth/AuthCard.tsx +41 -0
  508. package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResults.tsx +72 -0
  509. package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResultsTable.tsx +109 -2
  510. package/langwatch/src/components/batch-evaluation-results/ComparisonCharts.tsx +241 -77
  511. package/langwatch/src/components/batch-evaluation-results/ComparisonLeaderboardChart.tsx +355 -0
  512. package/langwatch/src/components/batch-evaluation-results/ComparisonTable.tsx +437 -75
  513. package/langwatch/src/components/batch-evaluation-results/LeaderboardStep.tsx +105 -0
  514. package/langwatch/src/components/batch-evaluation-results/LeaderboardTrustPanel.tsx +464 -0
  515. package/langwatch/src/components/batch-evaluation-results/LeaderboardVerdictPanel.tsx +354 -0
  516. package/langwatch/src/components/batch-evaluation-results/PairwiseLeaderboard.tsx +553 -0
  517. package/langwatch/src/components/batch-evaluation-results/ParetoScatterChart.tsx +512 -0
  518. package/langwatch/src/components/batch-evaluation-results/TradeoffSummaryLine.tsx +58 -0
  519. package/langwatch/src/components/batch-evaluation-results/WinRateChart.tsx +12 -4
  520. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.filter-overflow.integration.test.tsx +8 -1
  521. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.leaderboard-gate.integration.test.tsx +192 -0
  522. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.test.tsx +8 -1
  523. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonTable.group-by-metadata.integration.test.tsx +352 -0
  524. package/langwatch/src/components/batch-evaluation-results/__tests__/bootstrapMeanCI.unit.test.ts +98 -0
  525. package/langwatch/src/components/batch-evaluation-results/__tests__/buildAxisLabels.unit.test.ts +134 -0
  526. package/langwatch/src/components/batch-evaluation-results/__tests__/buildPairwiseComparisons.test.ts +95 -0
  527. package/langwatch/src/components/batch-evaluation-results/__tests__/buildTrustChecks.unit.test.ts +551 -0
  528. package/langwatch/src/components/batch-evaluation-results/__tests__/computeBTLeaderboard.test.ts +428 -0
  529. package/langwatch/src/components/batch-evaluation-results/__tests__/computeBandClipping.unit.test.ts +125 -0
  530. package/langwatch/src/components/batch-evaluation-results/__tests__/computeComparability.unit.test.ts +208 -0
  531. package/langwatch/src/components/batch-evaluation-results/__tests__/computeJudgeBiasChecks.unit.test.ts +186 -0
  532. package/langwatch/src/components/batch-evaluation-results/__tests__/computeLeaderboardVerdict.test.ts +288 -0
  533. package/langwatch/src/components/batch-evaluation-results/__tests__/computeParetoDominance.unit.test.ts +599 -0
  534. package/langwatch/src/components/batch-evaluation-results/__tests__/computeSampleAdequacy.unit.test.ts +212 -0
  535. package/langwatch/src/components/batch-evaluation-results/__tests__/computeScoreBarScale.unit.test.ts +104 -0
  536. package/langwatch/src/components/batch-evaluation-results/__tests__/computeVariantMetrics.test.ts +99 -0
  537. package/langwatch/src/components/batch-evaluation-results/__tests__/detectComparisonColumns.test.ts +133 -0
  538. package/langwatch/src/components/batch-evaluation-results/__tests__/formatLeaderboardHeadline.unit.test.ts +252 -0
  539. package/langwatch/src/components/batch-evaluation-results/__tests__/formatTradeoffSummary.unit.test.ts +219 -0
  540. package/langwatch/src/components/batch-evaluation-results/__tests__/leaderboardCache.unit.test.ts +128 -0
  541. package/langwatch/src/components/batch-evaluation-results/__tests__/panelAgreement.unit.test.ts +165 -0
  542. package/langwatch/src/components/batch-evaluation-results/__tests__/paretoScatterPoints.unit.test.ts +95 -0
  543. package/langwatch/src/components/batch-evaluation-results/__tests__/scoreSeparation.unit.test.ts +314 -0
  544. package/langwatch/src/components/batch-evaluation-results/__tests__/variantMetricsSymmetry.unit.test.ts +129 -0
  545. package/langwatch/src/components/batch-evaluation-results/__tests__/verdictSafety.unit.test.ts +438 -0
  546. package/langwatch/src/components/batch-evaluation-results/__tests__/winMatrixHasPairwiseDetail.unit.test.ts +126 -0
  547. package/langwatch/src/components/batch-evaluation-results/bootstrapMeanCI.ts +78 -0
  548. package/langwatch/src/components/batch-evaluation-results/buildPairwiseComparisons.ts +30 -0
  549. package/langwatch/src/components/batch-evaluation-results/chartAxisLabels.ts +98 -0
  550. package/langwatch/src/components/batch-evaluation-results/computeBTLeaderboard.ts +814 -0
  551. package/langwatch/src/components/batch-evaluation-results/computeComparability.ts +305 -0
  552. package/langwatch/src/components/batch-evaluation-results/computeJudgeBiasChecks.ts +175 -0
  553. package/langwatch/src/components/batch-evaluation-results/computeLeaderboardVerdict.ts +277 -0
  554. package/langwatch/src/components/batch-evaluation-results/computeParetoDominance.ts +283 -0
  555. package/langwatch/src/components/batch-evaluation-results/computeSampleAdequacy.ts +91 -0
  556. package/langwatch/src/components/batch-evaluation-results/computeVariantMetrics.ts +236 -0
  557. package/langwatch/src/components/batch-evaluation-results/computeWinMatrixShape.ts +61 -0
  558. package/langwatch/src/components/batch-evaluation-results/formatLeaderboardHeadline.ts +139 -0
  559. package/langwatch/src/components/batch-evaluation-results/formatTradeoffSummary.ts +126 -0
  560. package/langwatch/src/components/batch-evaluation-results/mulberry32.ts +19 -0
  561. package/langwatch/src/components/batch-evaluation-results/scoreSeparation.ts +102 -0
  562. package/langwatch/src/components/batch-evaluation-results/types.ts +82 -9
  563. package/langwatch/src/components/batch-evaluation-results/useBTLeaderboard.ts +137 -0
  564. package/langwatch/src/components/batch-evaluation-results/usePairwiseSort.ts +78 -0
  565. package/langwatch/src/components/batch-evaluation-results/useResultsGrouping.ts +119 -0
  566. package/langwatch/src/components/batch-evaluation-results/useShowComparisonLeaderboard.ts +43 -0
  567. package/langwatch/src/components/batch-evaluation-results/useVariantMetrics.ts +106 -0
  568. package/langwatch/src/components/checks/DynamicZodForm.tsx +9 -0
  569. package/langwatch/src/components/drawerRegistry.ts +5 -0
  570. package/langwatch/src/components/evaluations/OnlineEvaluationDrawer.tsx +13 -20
  571. package/langwatch/src/components/evaluators/EvaluatorEditorShared.tsx +16 -20
  572. package/langwatch/src/components/evaluators/WorkflowSelectorForEvaluatorDrawer.tsx +1 -15
  573. package/langwatch/src/components/experiments/CreateExperimentButton.tsx +13 -17
  574. package/langwatch/src/components/license/LicenseDetailsCard.tsx +72 -23
  575. package/langwatch/src/components/license/LicenseGeneratorForm.tsx +0 -60
  576. package/langwatch/src/components/license/LicenseLoadError.tsx +23 -0
  577. package/langwatch/src/components/license/OverSeatsCallout.tsx +68 -0
  578. package/langwatch/src/components/license/ResourceLimitsDisplay.tsx +0 -74
  579. package/langwatch/src/components/license/__tests__/OverSeatsCallout.integration.test.tsx +56 -0
  580. package/langwatch/src/components/license/__tests__/ResourceLimitsDisplay.unit.test.ts +8 -135
  581. package/langwatch/src/components/license/__tests__/licenseStatusUtils.unit.test.ts +68 -13
  582. package/langwatch/src/components/license/__tests__/planFormDefaults.unit.test.ts +11 -11
  583. package/langwatch/src/components/license/__tests__/useLicenseActions.integration.test.ts +185 -0
  584. package/langwatch/src/components/license/licenseStatusUtils.ts +21 -17
  585. package/langwatch/src/components/license/planFormDefaults.ts +3 -18
  586. package/langwatch/src/components/license/useLicenseActions.ts +26 -3
  587. package/langwatch/src/components/me/PersonalRecentTracesTable.tsx +4 -0
  588. package/langwatch/src/components/ops/projections/BulkReplayWizard.tsx +23 -1
  589. package/langwatch/src/components/plans/PlansComparisonPage.tsx +18 -0
  590. package/langwatch/src/components/plans/__tests__/PlansComparisonPage.integration.test.tsx +17 -0
  591. package/langwatch/src/components/plans/__tests__/planCurrentResolver.unit.test.ts +19 -0
  592. package/langwatch/src/components/plans/planCurrentResolver.ts +13 -0
  593. package/langwatch/src/components/projects/CreateProjectDrawer.tsx +36 -40
  594. package/langwatch/src/components/prompts/PromptEditorDrawer.tsx +9 -15
  595. package/langwatch/src/components/prompts/__tests__/PromptEditorDrawer.test.tsx +0 -1
  596. package/langwatch/src/components/scenarios/ScenarioCreateModal.tsx +3 -5
  597. package/langwatch/src/components/scenarios/ScenarioFormDrawer.tsx +2 -32
  598. package/langwatch/src/components/settings/CreateTeamDrawer.tsx +31 -35
  599. package/langwatch/src/components/settings/EnterpriseCapabilitiesSection.tsx +236 -0
  600. package/langwatch/src/components/settings/InfoWithoutSelecting.tsx +25 -0
  601. package/langwatch/src/components/settings/OrganizationUserRoleField.tsx +21 -2
  602. package/langwatch/src/components/settings/__tests__/EnterpriseCapabilitiesSection.integration.test.tsx +173 -0
  603. package/langwatch/src/components/settings/__tests__/seatTypeCopy.unit.test.ts +94 -0
  604. package/langwatch/src/components/settings/__tests__/seatTypeExplanation.integration.test.tsx +126 -0
  605. package/langwatch/src/components/settings/seatTypeCopy.ts +29 -0
  606. package/langwatch/src/components/subscription/SubscriptionPage.tsx +0 -1
  607. package/langwatch/src/components/subscription/__tests__/subscription-test-setup.ts +0 -13
  608. package/langwatch/src/components/subscription/billing-plans.ts +3 -12
  609. package/langwatch/src/components/suites/RunHistoryFilters.tsx +55 -3
  610. package/langwatch/src/components/suites/RunHistoryPanel.tsx +44 -0
  611. package/langwatch/src/components/suites/ScenarioRunExportDialog.tsx +92 -0
  612. package/langwatch/src/components/suites/SuiteFormDrawer.tsx +4 -20
  613. package/langwatch/src/components/suites/__tests__/AllRunsPanel.integration.test.tsx +3 -0
  614. package/langwatch/src/components/suites/__tests__/RunHistoryEmptyState.integration.test.tsx +45 -0
  615. package/langwatch/src/components/suites/__tests__/RunHistoryLiveWindow.integration.test.tsx +135 -0
  616. package/langwatch/src/components/suites/__tests__/ScenarioRunExportUi.integration.test.tsx +227 -0
  617. package/langwatch/src/components/suites/__tests__/SuiteDetailPanel.integration.test.tsx +3 -0
  618. package/langwatch/src/components/suites/run-history-transforms.ts +1 -28
  619. package/langwatch/src/components/suites/useExportScenarioRuns.ts +333 -0
  620. package/langwatch/src/components/suites/useRunHistoryPagination.ts +14 -0
  621. package/langwatch/src/components/upgrade-modal/LimitContent.tsx +3 -154
  622. package/langwatch/src/env-create.mjs +4 -0
  623. package/langwatch/src/features/errors/logic/codes.ts +2 -1
  624. package/langwatch/src/features/errors/logic/presentation.ts +8 -3
  625. package/langwatch/src/features/langy/__tests__/presentLangyToolError.unit.test.ts +1 -1
  626. package/langwatch/src/features/langy/logic/langyToolFailure.ts +4 -7
  627. package/langwatch/src/features/traces-v2/components/TraceDrawer/conversationView/TurnSteps.tsx +1 -1
  628. package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/DrawerHeader.tsx +34 -0
  629. package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/__tests__/utils.unit.test.ts +74 -0
  630. package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/TerminalView.tsx +57 -3
  631. package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/__tests__/TerminalView.integration.test.tsx +43 -3
  632. package/langwatch/src/features/traces-v2/components/TraceTable/columns.ts +7 -0
  633. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/ContextSizeCell.tsx +48 -0
  634. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/__tests__/ContextSizeCell.integration.test.tsx +57 -0
  635. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/index.ts +2 -0
  636. package/langwatch/src/features/traces-v2/components/shared/TokenBreakdownTooltip.tsx +22 -0
  637. package/langwatch/src/features/traces-v2/lens/capabilities.ts +2 -0
  638. package/langwatch/src/features/traces-v2/types/trace.ts +2 -0
  639. package/langwatch/src/hooks/__tests__/useLicenseEnforcement.unit.test.tsx +18 -30
  640. package/langwatch/src/hooks/__tests__/useOrganizationTeamProject.personal-workspace.integration.test.tsx +30 -0
  641. package/langwatch/src/hooks/__tests__/usePostHogIdentify.unit.test.ts +3 -3
  642. package/langwatch/src/hooks/useMemberDisableAction.ts +53 -0
  643. package/langwatch/src/hooks/useOrganizationTeamProject.ts +8 -7
  644. package/langwatch/src/optimization_studio/components/Evaluate.tsx +39 -46
  645. package/langwatch/src/optimization_studio/components/workflow/NewWorkflowForm.tsx +22 -30
  646. package/langwatch/src/pages/[project]/analytics/custom/index.tsx +1 -6
  647. package/langwatch/src/pages/api/experiment/__tests__/init.unit.test.ts +2 -87
  648. package/langwatch/src/pages/api/experiment/init.ts +7 -60
  649. package/langwatch/src/pages/auth/__tests__/forgot-password.integration.test.tsx +38 -3
  650. package/langwatch/src/pages/auth/forgot-password.tsx +19 -23
  651. package/langwatch/src/pages/auth/reset-password.tsx +2 -23
  652. package/langwatch/src/pages/settings/__tests__/authentication.integration.test.tsx +7 -0
  653. package/langwatch/src/pages/settings/__tests__/team-settings.refused-save.integration.test.tsx +253 -0
  654. package/langwatch/src/pages/settings/authentication.tsx +7 -2
  655. package/langwatch/src/pages/settings/license.tsx +4 -3
  656. package/langwatch/src/pages/settings/members.tsx +126 -34
  657. package/langwatch/src/pages/settings/teams/[team].tsx +73 -20
  658. package/langwatch/src/pages/settings/usage.tsx +7 -8
  659. package/langwatch/src/prompts/prompt-playground/components/sidebar/AddPromptButton.tsx +3 -8
  660. package/langwatch/src/server/api/routers/__tests__/annotation.tenant-references.unit.test.ts +1 -1
  661. package/langwatch/src/server/api/routers/__tests__/apiKey.myBindings.unit.test.ts +1 -1
  662. package/langwatch/src/server/api/routers/__tests__/apiKey.nameById.unit.test.ts +1 -1
  663. package/langwatch/src/server/api/routers/__tests__/apiKey.restricted-permissions.unit.test.ts +4 -1
  664. package/langwatch/src/server/api/routers/__tests__/automations.router.integration.test.ts +1 -1
  665. package/langwatch/src/server/api/routers/__tests__/bugReports.gating.unit.test.ts +1 -1
  666. package/langwatch/src/server/api/routers/__tests__/enterprise-guards.integration.test.ts +0 -4
  667. package/langwatch/src/server/api/routers/__tests__/evaluators.tenant-workflow.unit.test.ts +1 -1
  668. package/langwatch/src/server/api/routers/__tests__/graphs.tenant-dashboard.unit.test.ts +1 -1
  669. package/langwatch/src/server/api/routers/__tests__/langy.turnErrors.unit.test.ts +1 -1
  670. package/langwatch/src/server/api/routers/__tests__/langyGithub.access-order.unit.test.ts +1 -1
  671. package/langwatch/src/server/api/routers/__tests__/license.integration.test.ts +1 -17
  672. package/langwatch/src/server/api/routers/__tests__/licenseEnforcement.reportLimitBlocked.unit.test.ts +1 -1
  673. package/langwatch/src/server/api/routers/__tests__/monitors.copy.integration.test.ts +1 -11
  674. package/langwatch/src/server/api/routers/__tests__/organization.acceptInvite.unit.test.ts +1 -1
  675. package/langwatch/src/server/api/routers/__tests__/organization.setMemberDisabled.integration.test.ts +306 -0
  676. package/langwatch/src/server/api/routers/__tests__/personal-workspace-invariants.integration.test.ts +794 -0
  677. package/langwatch/src/server/api/routers/__tests__/plan.getActivePlan.integration.test.ts +0 -1
  678. package/langwatch/src/server/api/routers/__tests__/project.getHasFirstMessage.unit.test.ts +1 -1
  679. package/langwatch/src/server/api/routers/__tests__/project.regenerateApiKey.unit.test.ts +2 -2
  680. package/langwatch/src/server/api/routers/__tests__/prompts.copy.integration.test.ts +0 -58
  681. package/langwatch/src/server/api/routers/__tests__/prompts.duplicate.integration.test.ts +0 -54
  682. package/langwatch/src/server/api/routers/__tests__/publicEnv.test.ts +60 -0
  683. package/langwatch/src/server/api/routers/__tests__/secrets.reserved-names.unit.test.ts +1 -1
  684. package/langwatch/src/server/api/routers/__tests__/team.update.multi-binding.unit.test.ts +1 -1
  685. package/langwatch/src/server/api/routers/__tests__/traces.4991-full-resolution.unit.test.ts +1 -1
  686. package/langwatch/src/server/api/routers/__tests__/tracesV2.transcript-read.unit.test.ts +121 -0
  687. package/langwatch/src/server/api/routers/__tests__/translate.unit.test.ts +1 -1
  688. package/langwatch/src/server/api/routers/__tests__/user.changePassword.unit.test.ts +105 -0
  689. package/langwatch/src/server/api/routers/__tests__/user.deactivation.unit.test.ts +1 -1
  690. package/langwatch/src/server/api/routers/__tests__/user.register.unit.test.ts +67 -5
  691. package/langwatch/src/server/api/routers/__tests__/workflows.generateCommitMessage.unit.test.ts +1 -1
  692. package/langwatch/src/server/api/routers/agents.ts +0 -6
  693. package/langwatch/src/server/api/routers/analytics/__tests__/dataForFilter.unit.test.ts +1 -1
  694. package/langwatch/src/server/api/routers/apiKey.ts +1 -1
  695. package/langwatch/src/server/api/routers/automations.ts +0 -4
  696. package/langwatch/src/server/api/routers/bugReports.ts +1 -1
  697. package/langwatch/src/server/api/routers/copyEvaluatorToProject.ts +2 -5
  698. package/langwatch/src/server/api/routers/dashboards.ts +0 -2
  699. package/langwatch/src/server/api/routers/dataset.ts +0 -9
  700. package/langwatch/src/server/api/routers/emailSuppression.ts +1 -1
  701. package/langwatch/src/server/api/routers/evaluators.ts +0 -4
  702. package/langwatch/src/server/api/routers/experiments.ts +0 -14
  703. package/langwatch/src/server/api/routers/export.ts +65 -24
  704. package/langwatch/src/server/api/routers/graphs.ts +0 -2
  705. package/langwatch/src/server/api/routers/group.ts +6 -0
  706. package/langwatch/src/server/api/routers/langyEgress.ts +1 -1
  707. package/langwatch/src/server/api/routers/langyGithub.ts +1 -1
  708. package/langwatch/src/server/api/routers/license.ts +44 -36
  709. package/langwatch/src/server/api/routers/licenseEnforcement.ts +0 -21
  710. package/langwatch/src/server/api/routers/modelProviders.ts +1 -1
  711. package/langwatch/src/server/api/routers/monitors.ts +0 -6
  712. package/langwatch/src/server/api/routers/onboarding/__tests__/onboarding.personal-workspace.integration.test.ts +8 -15
  713. package/langwatch/src/server/api/routers/onboarding/onboarding.router.unit.test.ts +1 -1
  714. package/langwatch/src/server/api/routers/onboarding/setProductInterest.integration.test.ts +1 -1
  715. package/langwatch/src/server/api/routers/ops.ts +2 -0
  716. package/langwatch/src/server/api/routers/organization.ts +67 -1
  717. package/langwatch/src/server/api/routers/project.ts +74 -36
  718. package/langwatch/src/server/api/routers/prompts/prompts.trpc-router.ts +0 -10
  719. package/langwatch/src/server/api/routers/publicEnv.ts +7 -3
  720. package/langwatch/src/server/api/routers/scenarios/__tests__/simulation-runner.router.unit.test.ts +1 -1
  721. package/langwatch/src/server/api/routers/scenarios/scenario-crud.router.ts +0 -4
  722. package/langwatch/src/server/api/routers/scimToken.ts +1 -1
  723. package/langwatch/src/server/api/routers/suites/suite.router.ts +0 -3
  724. package/langwatch/src/server/api/routers/team.ts +48 -39
  725. package/langwatch/src/server/api/routers/tracesV2.schemas.ts +2 -0
  726. package/langwatch/src/server/api/routers/tracesV2.ts +76 -20
  727. package/langwatch/src/server/api/routers/user.ts +16 -6
  728. package/langwatch/src/server/api/routers/workflows.ts +0 -7
  729. package/langwatch/src/server/api/trpc.ts +1 -1
  730. package/langwatch/src/server/api-key/__tests__/api-key.service.legacy-ceiling.unit.test.ts +379 -0
  731. package/langwatch/src/server/api-key/__tests__/api-key.service.safety.unit.test.ts +3 -0
  732. package/langwatch/src/server/api-key/__tests__/api-key.service.unit.test.ts +3 -0
  733. package/langwatch/src/server/api-key/api-key.service.ts +63 -22
  734. package/langwatch/src/server/api-router.ts +5 -3
  735. package/langwatch/src/server/app-layer/__tests__/tracing.unit.test.ts +142 -0
  736. package/langwatch/src/server/app-layer/clients/clickhouse/__tests__/cold-scan-detector.coverage.unit.test.ts +2 -0
  737. package/langwatch/src/server/app-layer/clients/clickhouse/windowed-read.ts +15 -0
  738. package/langwatch/src/server/app-layer/dependencies.ts +8 -0
  739. package/langwatch/src/server/app-layer/evaluations/repositories/__tests__/evaluation-run.resolver-window.unit.test.ts +103 -0
  740. package/langwatch/src/server/app-layer/evaluations/repositories/evaluation-run.clickhouse.repository.ts +35 -1
  741. package/langwatch/src/server/app-layer/groups/group.service.ts +37 -0
  742. package/langwatch/src/server/app-layer/groups/repositories/group.prisma.repository.ts +9 -0
  743. package/langwatch/src/server/app-layer/groups/repositories/group.repository.ts +8 -0
  744. package/langwatch/src/server/app-layer/langy/__tests__/langyConversationMemory.unit.test.ts +1 -1
  745. package/langwatch/src/server/app-layer/langy/__tests__/langyTurnContext.unit.test.ts +0 -0
  746. package/langwatch/src/server/app-layer/langy/langyConversationMemory.ts +1 -1
  747. package/langwatch/src/server/app-layer/logs/repositories/__tests__/canonical-log-record.clickhouse.repository.unit.test.ts +54 -0
  748. package/langwatch/src/server/app-layer/logs/repositories/canonical-log-record.clickhouse.repository.ts +29 -12
  749. package/langwatch/src/server/app-layer/ops/__tests__/integration/pending-counter-reconcile.integration.test.ts +240 -0
  750. package/langwatch/src/server/app-layer/ops/__tests__/integration/replay-full-rebuild.integration.test.ts +390 -0
  751. package/langwatch/src/server/app-layer/ops/__tests__/replay.service.unit.test.ts +105 -1
  752. package/langwatch/src/server/app-layer/ops/replay.service.ts +47 -0
  753. package/langwatch/src/server/app-layer/ops/repositories/__tests__/queue.redis.repository.reconcile-pending.unit.test.ts +752 -0
  754. package/langwatch/src/server/app-layer/ops/repositories/queue.redis.repository.ts +597 -48
  755. package/langwatch/src/server/app-layer/organizations/__tests__/organization.service.unit.test.ts +1 -0
  756. package/langwatch/src/server/app-layer/organizations/organization.service.ts +16 -0
  757. package/langwatch/src/server/app-layer/organizations/repositories/organization.prisma.repository.ts +63 -2
  758. package/langwatch/src/server/app-layer/organizations/repositories/organization.repository.ts +15 -0
  759. package/langwatch/src/server/app-layer/presets.ts +27 -13
  760. package/langwatch/src/server/app-layer/projects/__tests__/project-service-update.unit.test.ts +100 -0
  761. package/langwatch/src/server/app-layer/projects/project.service.ts +145 -6
  762. package/langwatch/src/server/app-layer/projects/repositories/project.prisma.repository.ts +2 -16
  763. package/langwatch/src/server/app-layer/projects/repositories/project.repository.ts +2 -13
  764. package/langwatch/src/server/app-layer/simulations/__tests__/scenario-run-export-sweep.integration.test.ts +370 -0
  765. package/langwatch/src/server/app-layer/simulations/repositories/simulation.clickhouse.repository.ts +302 -7
  766. package/langwatch/src/server/app-layer/simulations/repositories/simulation.repository.ts +62 -0
  767. package/langwatch/src/server/app-layer/subscription/__tests__/composite-plan-provider.unit.test.ts +2 -28
  768. package/langwatch/src/server/app-layer/subscription/__tests__/self-hosted-plan-provider.unit.test.ts +101 -0
  769. package/langwatch/src/server/app-layer/subscription/self-hosted-plan-provider.ts +34 -0
  770. package/langwatch/src/server/app-layer/teams/team.service.ts +27 -0
  771. package/langwatch/src/server/app-layer/traces/__tests__/claude-code-span-enrichment.unit.test.ts +179 -0
  772. package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-span-filter.unit.test.ts +50 -0
  773. package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-transcript.derivation.unit.test.ts +331 -0
  774. package/langwatch/src/server/app-layer/traces/__tests__/trace-io-extraction.service.unit.test.ts +20 -0
  775. package/langwatch/src/server/app-layer/traces/canonicalisation/__tests__/structuredIO.test.ts +22 -1
  776. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/claudeCode.unit.test.ts +217 -0
  777. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/codex.unit.test.ts +133 -0
  778. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/vercel.unit.test.ts +79 -0
  779. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/_constants.ts +9 -0
  780. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/claudeCode.ts +429 -6
  781. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/codex.ts +158 -70
  782. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/vercel.ts +26 -8
  783. package/langwatch/src/server/app-layer/traces/claude-code-span-enrichment.ts +89 -1
  784. package/langwatch/src/server/app-layer/traces/coding-agent-span-filter.ts +23 -1
  785. package/langwatch/src/server/app-layer/traces/coding-agent-transcript.derivation.ts +330 -75
  786. package/langwatch/src/server/app-layer/traces/repositories/__tests__/span-storage.resolver-window.unit.test.ts +108 -0
  787. package/langwatch/src/server/app-layer/traces/repositories/__tests__/trace-list.clickhouse.repository.integration.test.ts +31 -2
  788. package/langwatch/src/server/app-layer/traces/repositories/span-storage.clickhouse.repository.ts +36 -1
  789. package/langwatch/src/server/app-layer/traces/repositories/trace-list.clickhouse.repository.ts +7 -0
  790. package/langwatch/src/server/app-layer/traces/trace-io-extraction.service.ts +8 -1
  791. package/langwatch/src/server/app-layer/traces/trace-list.service.ts +10 -0
  792. package/langwatch/src/server/app-layer/tracing.ts +47 -0
  793. package/langwatch/src/server/app-layer/usage/usage.service.ts +0 -80
  794. package/langwatch/src/server/better-auth/__tests__/hooks.test.ts +72 -0
  795. package/langwatch/src/server/better-auth/__tests__/index.test.ts +31 -9
  796. package/langwatch/src/server/better-auth/__tests__/resetRecoversOauthUser.test.ts +128 -0
  797. package/langwatch/src/server/better-auth/__tests__/ssoGate.hook.test.ts +321 -0
  798. package/langwatch/src/server/better-auth/hooks.ts +46 -1
  799. package/langwatch/src/server/better-auth/index.ts +123 -284
  800. package/langwatch/src/server/clickhouse/__tests__/replicatedEngineGuard.unit.test.ts +301 -0
  801. package/langwatch/src/server/clickhouse/goose.ts +8 -0
  802. package/langwatch/src/server/clickhouse/migrations/00064_replicate_gateway_budget_scope_totals.sql +291 -0
  803. package/langwatch/src/server/clickhouse/migrations/00065_replicate_trace_analytics_rollup.sql +143 -0
  804. package/langwatch/src/server/clickhouse/migrations/00066_replicate_evaluation_analytics_rollup.sql +115 -0
  805. package/langwatch/src/server/datasets/__tests__/dataset-chunking.unit.test.ts +0 -0
  806. package/langwatch/src/server/evaluations/evaluators.generated.ts +83 -63
  807. package/langwatch/src/server/event-sourcing/pipeline/__tests__/staticBuilder.validations.unit.test.ts +46 -0
  808. package/langwatch/src/server/event-sourcing/pipeline/processManagerDefinition.ts +14 -0
  809. package/langwatch/src/server/event-sourcing/pipeline/staticBuilder.ts +8 -0
  810. package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/__tests__/graphTriggerActivity.groupKey.unit.test.ts +55 -0
  811. package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/graphTriggerActivity.subscriber.ts +23 -0
  812. package/langwatch/src/server/event-sourcing/pipelines/blob-maintenance/process-manager/blobCleanup.process.ts +6 -4
  813. package/langwatch/src/server/event-sourcing/pipelines/coding-agent-processing/schemas/constants.ts +6 -4
  814. package/langwatch/src/server/event-sourcing/pipelines/evaluation-processing/pipeline.ts +9 -1
  815. package/langwatch/src/server/event-sourcing/pipelines/log-processing/__tests__/logCommandCoalescing.unit.test.ts +174 -0
  816. package/langwatch/src/server/event-sourcing/pipelines/log-processing/pipeline.ts +7 -0
  817. package/langwatch/src/server/event-sourcing/pipelines/log-processing/schemas/constants.ts +19 -0
  818. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/__tests__/metricCommandCoalescing.unit.test.ts +137 -0
  819. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/pipeline.ts +7 -0
  820. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/schemas/constants.ts +19 -0
  821. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/__tests__/aiSdkStructuredOutput.integration.test.ts +199 -0
  822. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/pipeline.ts +9 -1
  823. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/spanStorageGroupKey.unit.test.ts +98 -0
  824. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummaryClaudeCodeLift.unit.test.ts +187 -1
  825. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorage.mapProjection.ts +10 -1
  826. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorageGroupKey.ts +63 -0
  827. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/traceSummary.foldProjection.ts +85 -18
  828. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/__tests__/projectMetadata.groupKey.unit.test.ts +140 -0
  829. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/projectMetadata.reactor.ts +23 -0
  830. package/langwatch/src/server/event-sourcing/projections/__tests__/projectionRouter.mapReactorCollapse.unit.test.ts +260 -0
  831. package/langwatch/src/server/event-sourcing/projections/foldProjection.types.ts +6 -3
  832. package/langwatch/src/server/event-sourcing/projections/global/__tests__/billingMeterDispatch.groupKey.unit.test.ts +139 -0
  833. package/langwatch/src/server/event-sourcing/projections/global/billingMeterDispatch.reactor.ts +27 -1
  834. package/langwatch/src/server/event-sourcing/projections/projectionRouter.ts +58 -41
  835. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/blobSweeper.integration.test.ts +149 -0
  836. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.decodeDrop.integration.test.ts +12 -1
  837. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.integration.test.ts +45 -0
  838. package/langwatch/src/server/event-sourcing/queues/groupQueue/blobSweeper.ts +130 -22
  839. package/langwatch/src/server/event-sourcing/queues/groupQueue/scripts.ts +46 -0
  840. package/langwatch/src/server/event-sourcing/replay/__tests__/traceAnalyticsRollupReplay.integration.test.ts +356 -0
  841. package/langwatch/src/server/event-sourcing/replay/replayService.ts +7 -0
  842. package/langwatch/src/server/event-sourcing/services/queues/__tests__/queueManager.commandGroupKey.test.ts +114 -2
  843. package/langwatch/src/server/event-sourcing/services/queues/queueManager.ts +13 -9
  844. package/langwatch/src/server/experiments-v3/execution/__tests__/buildTargetMetadata.unit.test.ts +93 -0
  845. package/langwatch/src/server/experiments-v3/execution/__tests__/orchestratorStorageDispatch.unit.test.ts +57 -0
  846. package/langwatch/src/server/experiments-v3/execution/__tests__/resultMapper.test.ts +180 -13
  847. package/langwatch/src/server/experiments-v3/execution/orchestrator.ts +40 -8
  848. package/langwatch/src/server/experiments-v3/execution/resultMapper.ts +81 -22
  849. package/langwatch/src/server/experiments-v3/execution/types.ts +8 -0
  850. package/langwatch/src/server/export/scenario-runs/__tests__/csv-serializer.unit.test.ts +732 -0
  851. package/langwatch/src/server/export/scenario-runs/__tests__/scenario-run-export.service.unit.test.ts +303 -0
  852. package/langwatch/src/server/export/scenario-runs/csv-serializer.ts +383 -0
  853. package/langwatch/src/server/export/scenario-runs/errors.ts +44 -0
  854. package/langwatch/src/server/export/scenario-runs/scenario-run-export.service.ts +200 -0
  855. package/langwatch/src/server/export/scenario-runs/types.ts +64 -0
  856. package/langwatch/src/server/featureFlag/frontendFeatureFlags.ts +4 -0
  857. package/langwatch/src/server/featureFlag/registry.ts +7 -0
  858. package/langwatch/src/server/gateway/virtualKey.service.ts +2 -2
  859. package/langwatch/src/server/license-enforcement/__tests__/constants.unit.test.ts +2 -10
  860. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.integration.test.ts +17 -194
  861. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.unit.test.ts +3 -301
  862. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.service.unit.test.ts +51 -137
  863. package/langwatch/src/server/license-enforcement/__tests__/license-limit-guard.unit.test.ts +46 -13
  864. package/langwatch/src/server/license-enforcement/__tests__/usage-stats.service.unit.test.ts +1 -3
  865. package/langwatch/src/server/license-enforcement/constants.ts +0 -26
  866. package/langwatch/src/server/license-enforcement/index.ts +0 -5
  867. package/langwatch/src/server/license-enforcement/license-enforcement.repository.ts +4 -227
  868. package/langwatch/src/server/license-enforcement/license-enforcement.service.ts +0 -52
  869. package/langwatch/src/server/license-enforcement/types.ts +8 -17
  870. package/langwatch/src/server/license-enforcement/usage-stats.service.ts +0 -32
  871. package/langwatch/src/server/modelProviders/__tests__/governanceSignup.providerScope.integration.test.ts +1 -1
  872. package/langwatch/src/server/rbac/__tests__/apiKeyCeilingStaleness.unit.test.ts +5 -0
  873. package/langwatch/src/server/rbac/__tests__/role-binding-resolver.ceiling.unit.test.ts +108 -3
  874. package/langwatch/src/server/rbac/role-binding-resolver.ts +147 -1
  875. package/langwatch/src/server/role/__tests__/role-service-rolebinding.unit.test.ts +2 -0
  876. package/langwatch/src/server/role/role.service.ts +15 -1
  877. package/langwatch/src/server/role-bindings/__tests__/role-binding.service.tenant.unit.test.ts +2 -0
  878. package/langwatch/src/server/role-bindings/personal-team-scope.ts +105 -0
  879. package/langwatch/src/server/role-bindings/role-binding.service.ts +10 -2
  880. package/langwatch/src/server/routes/__tests__/github-langy-install.integration.test.ts +1 -1
  881. package/langwatch/src/server/routes/auth.ts +6 -1
  882. package/langwatch/src/server/routes/github-langy.ts +1 -1
  883. package/langwatch/src/server/scenarios/__tests__/scenario-archive.integration.test.ts +11 -15
  884. package/langwatch/src/server/scenarios/scenario-run-category.ts +48 -0
  885. package/langwatch/src/server/stored-objects/__tests__/coerce-content-to-array.unit.test.ts +0 -0
  886. package/langwatch/src/server/stored-objects/__tests__/scenario-events-ingest.integration.test.ts +2 -6
  887. package/langwatch/src/server/teams/team.service.ts +14 -1
  888. package/langwatch/src/server/tracer/types.ts +3 -0
  889. package/langwatch/src/server/traces/__tests__/trace-service-claude-enrichment.unit.test.ts +85 -0
  890. package/langwatch/src/server/traces/mappers/__tests__/trace-summary.mapper.test.ts +106 -0
  891. package/langwatch/src/server/traces/mappers/trace-summary.mapper.ts +59 -0
  892. package/langwatch/src/server/traces/projection/catalog.ts +3 -0
  893. package/langwatch/src/server/traces/trace.service.ts +21 -1
  894. package/langwatch/src/server/workers/__tests__/livenessThread.unit.test.ts +133 -0
  895. package/langwatch/src/server/workers/startWorkers.ts +250 -29
  896. package/langwatch/src/utils/__tests__/api.unit.test.ts +15 -15
  897. package/langwatch/src/utils/constants.ts +1 -0
  898. package/langwatch/src/utils/lambdaFetch.ts +0 -0
  899. package/langwatch/test-setup.ts +9 -0
  900. package/mcp-server/dist/chunk-FMQIE5DL.js +2328 -0
  901. package/mcp-server/dist/create-mcp-server.js +1 -1
  902. package/mcp-server/dist/discover-evaluator-schema-HYPFWGNN.js +2191 -0
  903. package/mcp-server/dist/http-server-UBX7YFXE.js +24466 -0
  904. package/mcp-server/dist/index.js +49 -33
  905. package/package.json +1 -1
  906. package/packages/server/dist/cli.cjs +1 -1
  907. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-BeOD83jA.js +0 -2
  908. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-jHTYLVuB.js +0 -6
  909. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-DW5VXwj8.js +0 -2
  910. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-6ycw-4n0.js +0 -2
  911. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-DKQT3n1Q.js +0 -3
  912. package/langwatch/dist/client/assets/AddParticipants-7HKlJHjI.js +0 -2
  913. package/langwatch/dist/client/assets/AgentHistoryDrawer-B1kjJyfj.js +0 -2
  914. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Dkex2eS8.js +0 -5
  915. package/langwatch/dist/client/assets/AgentListDrawer-B-ab-fJ_.js +0 -2
  916. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-CBUwY7Q0.js +0 -2
  917. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-DZr-iX29.js +0 -2
  918. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-C1AYXbvP.js +0 -2
  919. package/langwatch/dist/client/assets/AiGatewayLayout-BFUOyL-l.js +0 -2
  920. package/langwatch/dist/client/assets/AnnotationsTable-CnwGxhJg.js +0 -2
  921. package/langwatch/dist/client/assets/AreaChart-BZjKjRMD.js +0 -2
  922. package/langwatch/dist/client/assets/AutomationDrawer-BTtX7UXo.js +0 -112
  923. package/langwatch/dist/client/assets/BatchEvaluationSummary-CFBL50E9.js +0 -2
  924. package/langwatch/dist/client/assets/BudgetEditDrawer-DhNs7V2e.js +0 -2
  925. package/langwatch/dist/client/assets/CartesianChart-CgGSWzzH.js +0 -54
  926. package/langwatch/dist/client/assets/CascadeArchiveDialog-BOcl2osO.js +0 -2
  927. package/langwatch/dist/client/assets/ChartTooltip-BKs8as3o.js +0 -4
  928. package/langwatch/dist/client/assets/ChatWindow-B-UHoZDM.js +0 -5
  929. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-jdmrD4H5.js +0 -9
  930. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk-CKLyE8Ty.js +0 -2
  931. package/langwatch/dist/client/assets/ColorfulBlockIcons-Ctm_Gy50.js +0 -6
  932. package/langwatch/dist/client/assets/ColumnTypeIcon-Bh1MI0_N.js +0 -2
  933. package/langwatch/dist/client/assets/ConfirmDialog-CbyD4lof.js +0 -2
  934. package/langwatch/dist/client/assets/ContactSalesBlock-3LFiXNMY.js +0 -2
  935. package/langwatch/dist/client/assets/Conversation-C27uRW0p.js +0 -2
  936. package/langwatch/dist/client/assets/CopyInput-BJ8UDgiW.js +0 -2
  937. package/langwatch/dist/client/assets/CopyableInputWithPrefix-DhfQEE7R.js +0 -2
  938. package/langwatch/dist/client/assets/CreateProjectDrawer-f6ESIihF.js +0 -2
  939. package/langwatch/dist/client/assets/CreateTeamDrawer-CsScDzr3.js +0 -2
  940. package/langwatch/dist/client/assets/CustomGraph-DOp8hQmM.js +0 -2
  941. package/langwatch/dist/client/assets/DashboardLayout-BhHe0vIT.js +0 -96
  942. package/langwatch/dist/client/assets/DashboardNameDrawer-WriiQpWZ.js +0 -2
  943. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-BWcEQSs7.js +0 -2
  944. package/langwatch/dist/client/assets/DatasetEditorTable-BLbB_Sn-.js +0 -2
  945. package/langwatch/dist/client/assets/DatasetPickerList-CDIBTAQW.js +0 -2
  946. package/langwatch/dist/client/assets/DatasetPreviewTable-UuBrd6hv.js +0 -2
  947. package/langwatch/dist/client/assets/DatasetSelector-DJI4ZOko.js +0 -2
  948. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-DfGbPivl.js +0 -2
  949. package/langwatch/dist/client/assets/DeleteConfirmationDialog-w7WZ7lHP.js +0 -2
  950. package/langwatch/dist/client/assets/DocsLinks-vsvIA7dY.js +0 -2
  951. package/langwatch/dist/client/assets/DynamicZodForm-lW0sHL84.js +0 -2
  952. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-UZGlf7Jf.js +0 -3
  953. package/langwatch/dist/client/assets/EditModelProviderDrawer-FxE8Cjfj.js +0 -4
  954. package/langwatch/dist/client/assets/EditProjectDrawer-DvGgMwQg.js +0 -2
  955. package/langwatch/dist/client/assets/EmojiPickerModal-DOTbYgFl.js +0 -3
  956. package/langwatch/dist/client/assets/EnterpriseLockedSurface-CM8Sj7hf.js +0 -2
  957. package/langwatch/dist/client/assets/ErrorBarContext-Bpz3-JDH.js +0 -2
  958. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Bnv6z6m_.js +0 -107
  959. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-DPt4B9Ey.js +0 -2
  960. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-C1OQ89no.js +0 -2
  961. package/langwatch/dist/client/assets/EvaluatorEditorShared-Dlnmyfw9.js +0 -43
  962. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-BFqreRNY.js +0 -2
  963. package/langwatch/dist/client/assets/EvaluatorListDrawer-B5GkvEER.js +0 -2
  964. package/langwatch/dist/client/assets/EvaluatorMappingsSection-uZ95zEz_.js +0 -2
  965. package/langwatch/dist/client/assets/EvaluatorSelection-CLClnlPT.js +0 -2
  966. package/langwatch/dist/client/assets/EvaluatorSelectionBox-VWh5DBap.js +0 -2
  967. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BTrBItgE.js +0 -2
  968. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-0T-zwQQZ.js +0 -2
  969. package/langwatch/dist/client/assets/ExecutionState-BPNxLkdI.js +0 -2
  970. package/langwatch/dist/client/assets/FeatureFlagsDrawer-CpSauosT.js +0 -2
  971. package/langwatch/dist/client/assets/FieldInfoTooltip-BlO6fteF.js +0 -2
  972. package/langwatch/dist/client/assets/FieldsFilters-B46wbf2n.js +0 -2
  973. package/langwatch/dist/client/assets/FilterDisplay-BzhnJIar.js +0 -2
  974. package/langwatch/dist/client/assets/FilterSidebar-CbZF27X2.js +0 -2
  975. package/langwatch/dist/client/assets/FormatMoney-vCZvmGG1.js +0 -2
  976. package/langwatch/dist/client/assets/FoundryDrawer-DskBXiS5.js +0 -2
  977. package/langwatch/dist/client/assets/FullLogo-Db9M_uOO.js +0 -2
  978. package/langwatch/dist/client/assets/GovernanceLayout-DiDbO74a.js +0 -2
  979. package/langwatch/dist/client/assets/GraphsLayout-BCvqg3RK.js +0 -2
  980. package/langwatch/dist/client/assets/GroupBindingInputRow-DQP7aETW.js +0 -2
  981. package/langwatch/dist/client/assets/GuardrailsDrawer-CHV6LBxp.js +0 -91
  982. package/langwatch/dist/client/assets/History-hXXVv0A2.js +0 -17
  983. package/langwatch/dist/client/assets/HorizontalFormControl-lYiaIlzD.js +0 -2
  984. package/langwatch/dist/client/assets/HoverableBigText-CIhevUVt.js +0 -2
  985. package/langwatch/dist/client/assets/InstallCliCard-CJKSPLJ_.js +0 -2
  986. package/langwatch/dist/client/assets/IntegratePaneShell-BpcA5j4P.js +0 -8
  987. package/langwatch/dist/client/assets/InviteMemberDrawer-DiuPqGoS.js +0 -2
  988. package/langwatch/dist/client/assets/IsolatedErrorBoundary-CZ4MnYEN.js +0 -2
  989. package/langwatch/dist/client/assets/LLMModelCostDrawer-D1G0lU1N.js +0 -2
  990. package/langwatch/dist/client/assets/LangyContextTarget-CIlp_Zew.js +0 -2
  991. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-Cd0jbm0t.js +0 -2
  992. package/langwatch/dist/client/assets/Legend-DY68SncN.js +0 -6
  993. package/langwatch/dist/client/assets/Line-B2wakHWw.js +0 -2
  994. package/langwatch/dist/client/assets/LineChart-Bb84FSVR.js +0 -2
  995. package/langwatch/dist/client/assets/ListTable-8idtTXBY.js +0 -2
  996. package/langwatch/dist/client/assets/LoadingScreen-DQ62wqSN.js +0 -2
  997. package/langwatch/dist/client/assets/Markdown-C9extmbX.js +0 -35
  998. package/langwatch/dist/client/assets/MenuLink-CVzOs3K8.js +0 -2
  999. package/langwatch/dist/client/assets/MessageCard--GCYkR2M.js +0 -2
  1000. package/langwatch/dist/client/assets/MetadataTag-CSCPlbDN.js +0 -5
  1001. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-DUwvNeux.js +0 -2
  1002. package/langwatch/dist/client/assets/ModelProviderScreen-BVBKstQm.js +0 -2
  1003. package/langwatch/dist/client/assets/ModelSelector-4R-dc-Ny.js +0 -2
  1004. package/langwatch/dist/client/assets/MyLayout-DCMYTSgX.js +0 -2
  1005. package/langwatch/dist/client/assets/NavigationFooter-1VNOUoV6.js +0 -2
  1006. package/langwatch/dist/client/assets/NewWorkflowForm-CsYSc1Vr.js +0 -2
  1007. package/langwatch/dist/client/assets/NoDataInfoBlock-C8x5bzL0.js +0 -2
  1008. package/langwatch/dist/client/assets/OnboardingContainer-e4kVlnyx.js +0 -2
  1009. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-D2jYsSON.js +0 -2
  1010. package/langwatch/dist/client/assets/OpsPageShell-Ch1rtwuD.js +0 -2
  1011. package/langwatch/dist/client/assets/OttlEditor-baChQv3o.js +0 -3
  1012. package/langwatch/dist/client/assets/OverflownText-CY4Y__oL.js +0 -2
  1013. package/langwatch/dist/client/assets/ProjectAvatar-DtI9dT1f.js +0 -43
  1014. package/langwatch/dist/client/assets/ProjectLangyLayout-Cl7GB9zi.js +0 -82
  1015. package/langwatch/dist/client/assets/PromptEditorDrawer-BLIu4fKV.js +0 -2
  1016. package/langwatch/dist/client/assets/PromptListDrawer-BHC9jUMJ.js +0 -2
  1017. package/langwatch/dist/client/assets/PropertySectionTitle-Da2IdhM3.js +0 -37
  1018. package/langwatch/dist/client/assets/ProviderModelSelector-Cg5Lbc1U.js +0 -2
  1019. package/langwatch/dist/client/assets/ProviderScopeChips-D7HJW6Ht.js +0 -2
  1020. package/langwatch/dist/client/assets/PushToCopiesDialog-B_hvn6aW.js +0 -2
  1021. package/langwatch/dist/client/assets/ReferenceDot-DbjBc6Dh.js +0 -2
  1022. package/langwatch/dist/client/assets/RenderInputOutput-BntIB-Ae.js +0 -261
  1023. package/langwatch/dist/client/assets/ScenarioFormDrawer-BORe6ffA.js +0 -2
  1024. package/langwatch/dist/client/assets/ScenarioInputMappingSection-DVpK_-Qh.js +0 -2
  1025. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-MJhw77cs.js +0 -3
  1026. package/langwatch/dist/client/assets/ScopeChipPicker-B3xHf0Ii.js +0 -2
  1027. package/langwatch/dist/client/assets/SearchInput-C7YbWRUQ.js +0 -2
  1028. package/langwatch/dist/client/assets/SectionNavigationLayout-CIP_2Nxf.js +0 -2
  1029. package/langwatch/dist/client/assets/SelectDatasetDrawer-D_nCx9JT.js +0 -2
  1030. package/langwatch/dist/client/assets/SelectionActionBar-fxhOYCmO.js +0 -2
  1031. package/langwatch/dist/client/assets/SeriesFilterDrawer-zoWjjTxC.js +0 -2
  1032. package/langwatch/dist/client/assets/SettingsLayout-sixsNIX_.js +0 -2
  1033. package/langwatch/dist/client/assets/SetupWithAgentButton-Bhxb1yOj.js +0 -4
  1034. package/langwatch/dist/client/assets/ShikiCommandBox-CN1W-H2m.js +0 -5
  1035. package/langwatch/dist/client/assets/SpanDetails-DavcMtlr.js +0 -3
  1036. package/langwatch/dist/client/assets/SubscriptionPage-gPKGn08f.js +0 -2
  1037. package/langwatch/dist/client/assets/SuiteFormDrawer-C_5urLUY.js +0 -2
  1038. package/langwatch/dist/client/assets/TabButton-Cp8UA45p.js +0 -3
  1039. package/langwatch/dist/client/assets/TableCell-Cbtwk2YR.js +0 -2
  1040. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-B0xHR5hC.js +0 -2
  1041. package/langwatch/dist/client/assets/TeamForm-DvN0gccP.js +0 -2
  1042. package/langwatch/dist/client/assets/TeamUserRoleField-DD6lt16j.js +0 -2
  1043. package/langwatch/dist/client/assets/TraceDetails-DZtIKcmo.js +0 -9
  1044. package/langwatch/dist/client/assets/TraceDetailsDrawer-DKgyPTw5.js +0 -2
  1045. package/langwatch/dist/client/assets/TraceIdPeek-7T88rBev.js +0 -2
  1046. package/langwatch/dist/client/assets/TracesMapping-CYIUxk62.js +0 -2
  1047. package/langwatch/dist/client/assets/UpgradeModalContent-eXy8pG4-.js +0 -2
  1048. package/langwatch/dist/client/assets/UploadCSVDrawer-BTttuVHZ.js +0 -3
  1049. package/langwatch/dist/client/assets/VariablesSection-hjZ5pmeK.js +0 -2
  1050. package/langwatch/dist/client/assets/VersionBadge-BPxGh4w7.js +0 -2
  1051. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9EYtw_g.js +0 -1161
  1052. package/langwatch/dist/client/assets/ViewAutomationDrawer-H_lJU8lG.js +0 -2
  1053. package/langwatch/dist/client/assets/VirtualKeySecretReveal-5GeVsP9d.js +0 -54
  1054. package/langwatch/dist/client/assets/WelcomeLayout-CDTLOa4d.js +0 -2
  1055. package/langwatch/dist/client/assets/WithFeatureFlagGuard-OePuXWRG.js +0 -2
  1056. package/langwatch/dist/client/assets/WithPermissionGuard-Cr6Aljmy.js +0 -2
  1057. package/langwatch/dist/client/assets/WorkflowCard-SFB2TN6O.js +0 -2
  1058. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-C9JwDruB.js +0 -2
  1059. package/langwatch/dist/client/assets/_...path_-Cgdgmf5W.js +0 -2
  1060. package/langwatch/dist/client/assets/_Uint8Array-DZ50H-2q.js +0 -2
  1061. package/langwatch/dist/client/assets/__...path__-CwRP2Csi.js +0 -22
  1062. package/langwatch/dist/client/assets/_baseAssignValue-BqKt0w0a.js +0 -2
  1063. package/langwatch/dist/client/assets/_baseClone-DCKy3Vq2.js +0 -2
  1064. package/langwatch/dist/client/assets/_baseEach-BGeacxUS.js +0 -2
  1065. package/langwatch/dist/client/assets/_baseFor-BQgMStOx.js +0 -2
  1066. package/langwatch/dist/client/assets/_experiment_-UwR3aJGK.js +0 -2
  1067. package/langwatch/dist/client/assets/_id_-7nn1sxUS.js +0 -2
  1068. package/langwatch/dist/client/assets/_id_-BGN_cxTM.js +0 -2
  1069. package/langwatch/dist/client/assets/_id_-C39KWPCF.js +0 -2
  1070. package/langwatch/dist/client/assets/_id_-CLpZ89Xl.js +0 -2
  1071. package/langwatch/dist/client/assets/_id_-CYndCW2V.js +0 -2
  1072. package/langwatch/dist/client/assets/_id_-CfWpUbg4.js +0 -2
  1073. package/langwatch/dist/client/assets/_id_-npXkLrUc.js +0 -2
  1074. package/langwatch/dist/client/assets/_project_-B7G8spwK.js +0 -8
  1075. package/langwatch/dist/client/assets/_runId_-BSik_ZD4.js +0 -7
  1076. package/langwatch/dist/client/assets/_shell-BGaZUKLi.js +0 -2
  1077. package/langwatch/dist/client/assets/_slug_-BN6BJfW8.js +0 -17
  1078. package/langwatch/dist/client/assets/_slug_-C7DGk6aN.js +0 -2
  1079. package/langwatch/dist/client/assets/_slug_-DOlOZ10W.js +0 -2
  1080. package/langwatch/dist/client/assets/_team_-B9rXOt0D.js +0 -2
  1081. package/langwatch/dist/client/assets/_workflow_-BJIdrL-L.js +0 -25
  1082. package/langwatch/dist/client/assets/_workflow_-BKcndaRn.js +0 -3
  1083. package/langwatch/dist/client/assets/accept-CSdmIcux.js +0 -2
  1084. package/langwatch/dist/client/assets/activity-QICCt22J.js +0 -1
  1085. package/langwatch/dist/client/assets/agents--fK5G7M5.js +0 -2
  1086. package/langwatch/dist/client/assets/alerts-QICCt22J.js +0 -1
  1087. package/langwatch/dist/client/assets/all-yOqzcthm.js +0 -2
  1088. package/langwatch/dist/client/assets/analytics-CjMLTwIY.js +0 -2
  1089. package/langwatch/dist/client/assets/annotation-scores-sPTr7fKF.js +0 -2
  1090. package/langwatch/dist/client/assets/annotations-Ye3ttmrc.js +0 -2
  1091. package/langwatch/dist/client/assets/anomaly-rules-DwSc-85q.js +0 -2
  1092. package/langwatch/dist/client/assets/api-keys-CKyHUAXs.js +0 -4
  1093. package/langwatch/dist/client/assets/asaplangy-6A4CIIRR.js +0 -5
  1094. package/langwatch/dist/client/assets/audit-log-DQ9_D13G.js +0 -2
  1095. package/langwatch/dist/client/assets/auth-CHp-bSLm.js +0 -2
  1096. package/langwatch/dist/client/assets/authentication-CktawfTg.js +0 -2
  1097. package/langwatch/dist/client/assets/authorize-BSFPddoX.js +0 -2
  1098. package/langwatch/dist/client/assets/authorize-YWRIgnuS.js +0 -2
  1099. package/langwatch/dist/client/assets/automations-CI-QD_zf.js +0 -2
  1100. package/langwatch/dist/client/assets/automations-QICCt22J.js +0 -1
  1101. package/langwatch/dist/client/assets/billing-plans-DUVLJ_Sk.js +0 -2
  1102. package/langwatch/dist/client/assets/blank-CqHTkVM2.js +0 -2
  1103. package/langwatch/dist/client/assets/blobs-B_lHV3eu.js +0 -2
  1104. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CQSMftlX.js +0 -133
  1105. package/langwatch/dist/client/assets/budgets-D0yk2zkk.js +0 -3
  1106. package/langwatch/dist/client/assets/bug-reports-D48JQaYJ.js +0 -2
  1107. package/langwatch/dist/client/assets/cache-rules-BLbEe56I.js +0 -2
  1108. package/langwatch/dist/client/assets/choose-CR8H5_AF.js +0 -2
  1109. package/langwatch/dist/client/assets/chunk-EX3LRPZG-CULySKMF.js +0 -232
  1110. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-vsHlz4qh.js +0 -3
  1111. package/langwatch/dist/client/assets/chunk-PUDLZKDR-ByJfzd90.js +0 -157
  1112. package/langwatch/dist/client/assets/chunk-RYQCIY6F-DW5yDiZP.js +0 -2
  1113. package/langwatch/dist/client/assets/chunk-V7JOEXUC-rGVlZXkP.js +0 -207
  1114. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-DjpCOWYp.js +0 -2
  1115. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-DjpCOWYp.js +0 -2
  1116. package/langwatch/dist/client/assets/codeAgentConfig-DlJOMg8p.js +0 -7
  1117. package/langwatch/dist/client/assets/codingDefaultSync-C3S2VHmn.js +0 -2
  1118. package/langwatch/dist/client/assets/configure-BPQgl6jf.js +0 -4
  1119. package/langwatch/dist/client/assets/constants-Bb5Vi_Bd.js +0 -2
  1120. package/langwatch/dist/client/assets/custom-D79e_fnJ.js +0 -12
  1121. package/langwatch/dist/client/assets/custom_evaluator-DgcItmbH.js +0 -31
  1122. package/langwatch/dist/client/assets/dagre-BqI7WPId.js +0 -2
  1123. package/langwatch/dist/client/assets/dagre-VKFMJZFB-BJj7ndf9.js +0 -5
  1124. package/langwatch/dist/client/assets/data-privacy-BuolZ3DI.js +0 -2
  1125. package/langwatch/dist/client/assets/data-retention-yWQxxUQF.js +0 -2
  1126. package/langwatch/dist/client/assets/datasets-u_OgZHiv.js +0 -2
  1127. package/langwatch/dist/client/assets/debounce-BJsF8wQY.js +0 -2
  1128. package/langwatch/dist/client/assets/defaultModelState-DY_b79Yj.js +0 -2
  1129. package/langwatch/dist/client/assets/dejaview-DSjI4vi2.js +0 -2
  1130. package/langwatch/dist/client/assets/departments-C3oaBPyA.js +0 -2
  1131. package/langwatch/dist/client/assets/devices-O_ZVZdxA.js +0 -2
  1132. package/langwatch/dist/client/assets/dist-Dd3SzC15.js +0 -6
  1133. package/langwatch/dist/client/assets/drawerFromUrl-DaNSDEzf.js +0 -2
  1134. package/langwatch/dist/client/assets/edit-CswmqyLU.js +0 -62
  1135. package/langwatch/dist/client/assets/email-suppressions-B8AuxWio.js +0 -2
  1136. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-DIiR5G9i.js +0 -86
  1137. package/langwatch/dist/client/assets/error-nKFTkytv.js +0 -2
  1138. package/langwatch/dist/client/assets/errors-e711UMq7.js +0 -2
  1139. package/langwatch/dist/client/assets/evaluations-Cg9PywKJ.js +0 -2
  1140. package/langwatch/dist/client/assets/evaluations-xuA_g6-G.js +0 -2
  1141. package/langwatch/dist/client/assets/evaluators-6oHFfk5m.js +0 -146
  1142. package/langwatch/dist/client/assets/evaluators-CBPI9nP9.js +0 -2
  1143. package/langwatch/dist/client/assets/experiments-DHsdWtPG.js +0 -1
  1144. package/langwatch/dist/client/assets/feature-flags-e-cVnxOK.js +0 -2
  1145. package/langwatch/dist/client/assets/fetchSSE-5rVPow_l.js +0 -3
  1146. package/langwatch/dist/client/assets/fieldset-BNLAUiqD.js +0 -2
  1147. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-DlrfK-aL.js +0 -1
  1148. package/langwatch/dist/client/assets/forgot-password-B_FXHTn9.js +0 -2
  1149. package/langwatch/dist/client/assets/formatMoney-DRwvOSzZ.js +0 -2
  1150. package/langwatch/dist/client/assets/formatTargetOutput-CkKef3lk.js +0 -2
  1151. package/langwatch/dist/client/assets/foundry-U39hnXil.js +0 -477
  1152. package/langwatch/dist/client/assets/gateway-DZnsUBnP.js +0 -2
  1153. package/langwatch/dist/client/assets/getEvaluator-irVFciCL.js +0 -2
  1154. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-BFtcAGI_.js +0 -2
  1155. package/langwatch/dist/client/assets/governance-BBQIXSQ_.js +0 -2
  1156. package/langwatch/dist/client/assets/graphlib-Bg9XziCe.js +0 -2
  1157. package/langwatch/dist/client/assets/grid-DVy6ELOp.js +0 -2
  1158. package/langwatch/dist/client/assets/groups-DYnJ4U2W.js +0 -2
  1159. package/langwatch/dist/client/assets/guardrails-DdKPd-Zs.js +0 -2
  1160. package/langwatch/dist/client/assets/handled-error-CI7XXA3n.js +0 -2
  1161. package/langwatch/dist/client/assets/http-DSF_1QKT.js +0 -7
  1162. package/langwatch/dist/client/assets/identifierUtils-B50FmQLB.js +0 -2
  1163. package/langwatch/dist/client/assets/immer-CFru3D02.js +0 -14
  1164. package/langwatch/dist/client/assets/index-CPtTUYLD.js +0 -68
  1165. package/langwatch/dist/client/assets/ingestion-source-detail-BLfzu5Yv.js +0 -19
  1166. package/langwatch/dist/client/assets/ingestion-sources-BcwE_tRu.js +0 -12
  1167. package/langwatch/dist/client/assets/integrations-D220c59Q.js +0 -2
  1168. package/langwatch/dist/client/assets/isArrayLikeObject-DUy1V36n.js +0 -2
  1169. package/langwatch/dist/client/assets/isSymbol-COuSxi_J.js +0 -2
  1170. package/langwatch/dist/client/assets/langyHomeSuggestions-6NtCcdnH.js +0 -2
  1171. package/langwatch/dist/client/assets/license-Be6bs3wD.js +0 -2
  1172. package/langwatch/dist/client/assets/licenseStatusUtils-YSS0xL-G.js +0 -2
  1173. package/langwatch/dist/client/assets/lu-DlSq9Be4.js +0 -2
  1174. package/langwatch/dist/client/assets/map-7tkBBrDN.js +0 -2
  1175. package/langwatch/dist/client/assets/mappingValidation-C-AT88B0.js +0 -2
  1176. package/langwatch/dist/client/assets/me-BHRwGQAJ.js +0 -7
  1177. package/langwatch/dist/client/assets/me-DyaTjlbw.js +0 -2
  1178. package/langwatch/dist/client/assets/members-Dn5oJBlv.js +0 -2
  1179. package/langwatch/dist/client/assets/mermaid.core-krP_t-L5.js +0 -12
  1180. package/langwatch/dist/client/assets/messages-CN1bd906.js +0 -2
  1181. package/langwatch/dist/client/assets/metrics-Do8QhcIC.js +0 -2
  1182. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-DBef2D4I.js +0 -97
  1183. package/langwatch/dist/client/assets/model-costs-D6eiVgIz.js +0 -2
  1184. package/langwatch/dist/client/assets/model-providers-CiSkvGtd.js +0 -2
  1185. package/langwatch/dist/client/assets/modelProviderHelpers-P2Cogc-H.js +0 -2
  1186. package/langwatch/dist/client/assets/my-queue-D1aRcnMh.js +0 -2
  1187. package/langwatch/dist/client/assets/normalizeComparison-BY-r_dYf.js +0 -2
  1188. package/langwatch/dist/client/assets/not-found-BiyummjJ.js +0 -2
  1189. package/langwatch/dist/client/assets/now-flOUcolU.js +0 -2
  1190. package/langwatch/dist/client/assets/onboarding-D3dMDvS6.js +0 -2
  1191. package/langwatch/dist/client/assets/online-evaluations-Dk2ygUi2.js +0 -2
  1192. package/langwatch/dist/client/assets/ops-Djcw5_lX.js +0 -2
  1193. package/langwatch/dist/client/assets/organizations-F6Q6gYJ3.js +0 -2
  1194. package/langwatch/dist/client/assets/pages-BXwixFEM.js +0 -2
  1195. package/langwatch/dist/client/assets/persistence-DZOtzFnQ.js +0 -2
  1196. package/langwatch/dist/client/assets/personalProject-DMRX2-SI.js +0 -2
  1197. package/langwatch/dist/client/assets/plans-C_VYB2VX.js +0 -2
  1198. package/langwatch/dist/client/assets/preconditionFieldUtils-B7QfymK4.js +0 -2
  1199. package/langwatch/dist/client/assets/product-D0RNZ3Ls.js +0 -2
  1200. package/langwatch/dist/client/assets/project-ZTQzA2gY.js +0 -2
  1201. package/langwatch/dist/client/assets/projections-DocSauqq.js +0 -2
  1202. package/langwatch/dist/client/assets/projects-ClyGKBO9.js +0 -2
  1203. package/langwatch/dist/client/assets/promptHandle-Cen_6YRW.js +0 -2
  1204. package/langwatch/dist/client/assets/prompts-CLb2R5Fd.js +0 -8
  1205. package/langwatch/dist/client/assets/radio-group-CWz2nJi3.js +0 -2
  1206. package/langwatch/dist/client/assets/registry-B64xvGV5.js +0 -2
  1207. package/langwatch/dist/client/assets/reports-C-XbHSdJ.js +0 -2
  1208. package/langwatch/dist/client/assets/request-C3Wgq2B3.js +0 -2
  1209. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-9g84jNsR.js +0 -85
  1210. package/langwatch/dist/client/assets/reset-password-ohopJtIH.js +0 -2
  1211. package/langwatch/dist/client/assets/role-bindings-BQ31P1EO.js +0 -2
  1212. package/langwatch/dist/client/assets/roles-CQDx2TP6.js +0 -2
  1213. package/langwatch/dist/client/assets/routing-policies-uvNo9gfx.js +0 -5
  1214. package/langwatch/dist/client/assets/scenarios-CpA_eExG.js +0 -2
  1215. package/langwatch/dist/client/assets/scheduler-CgzNzJjP.js +0 -2
  1216. package/langwatch/dist/client/assets/schedules-QICCt22J.js +0 -1
  1217. package/langwatch/dist/client/assets/scim-BivWilDe.js +0 -2
  1218. package/langwatch/dist/client/assets/secrets-Dp2ang1r.js +0 -2
  1219. package/langwatch/dist/client/assets/segment-group-DQ4SkpwM.js +0 -2
  1220. package/langwatch/dist/client/assets/segmented-control-BNxU6DEN.js +0 -2
  1221. package/langwatch/dist/client/assets/select-D17PWjH9.js +0 -2
  1222. package/langwatch/dist/client/assets/send-Dd5105kW.js +0 -2
  1223. package/langwatch/dist/client/assets/sequenceView-FFm7w152.js +0 -5
  1224. package/langwatch/dist/client/assets/seriesOptions-CDRg_FIS.js +0 -1015
  1225. package/langwatch/dist/client/assets/settings-aFAaBCpo.js +0 -2
  1226. package/langwatch/dist/client/assets/setup-BqCpBMpq.js +0 -2
  1227. package/langwatch/dist/client/assets/shikiAdapter-CbWAxLvq.js +0 -3
  1228. package/langwatch/dist/client/assets/showSuiteRunError-B2iiQdeh.js +0 -2
  1229. package/langwatch/dist/client/assets/signin-C6AzSXTw.js +0 -2
  1230. package/langwatch/dist/client/assets/signup-Co9SguQP.js +0 -2
  1231. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-CDfCuyr-.js +0 -2
  1232. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-mNUL4OCz.js +0 -2
  1233. package/langwatch/dist/client/assets/subscription-BYrIJoC0.js +0 -3
  1234. package/langwatch/dist/client/assets/subscriptions-CrupW2oH.js +0 -2
  1235. package/langwatch/dist/client/assets/suggestionUI-0NFK2m-V.js +0 -106
  1236. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-aY42sUsR.js +0 -3
  1237. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-BQgl3Mwz.js +0 -9
  1238. package/langwatch/dist/client/assets/switch-DGatWO8v.js +0 -2
  1239. package/langwatch/dist/client/assets/switch-mtnuJtgJ.js +0 -2
  1240. package/langwatch/dist/client/assets/tabs-U8n5D55_.js +0 -2
  1241. package/langwatch/dist/client/assets/teams-CMzKSSEB.js +0 -2
  1242. package/langwatch/dist/client/assets/teams-DBNLpvFi.js +0 -2
  1243. package/langwatch/dist/client/assets/tool-catalog-DgWWHys3.js +0 -7
  1244. package/langwatch/dist/client/assets/toolIcons-DmISNQ_S.js +0 -2
  1245. package/langwatch/dist/client/assets/tooltip-gjZ4s2dt.js +0 -2
  1246. package/langwatch/dist/client/assets/topic-clustering-wc06nKYO.js +0 -2
  1247. package/langwatch/dist/client/assets/topics-DbjuJKH7.js +0 -2
  1248. package/langwatch/dist/client/assets/traceStore-By6b3pBZ.js +0 -55
  1249. package/langwatch/dist/client/assets/traces-DjQaBgiE.js +0 -289
  1250. package/langwatch/dist/client/assets/tracesMapping-DpjIOyAg.js +0 -3
  1251. package/langwatch/dist/client/assets/tracking-D4oUOPlm.js +0 -2
  1252. package/langwatch/dist/client/assets/types-CCALFpCT.js +0 -2
  1253. package/langwatch/dist/client/assets/types-DfJmP3wn.js +0 -2
  1254. package/langwatch/dist/client/assets/types-X7bcC-zw.js +0 -2
  1255. package/langwatch/dist/client/assets/usage-B3fH-bNu.js +0 -2
  1256. package/langwatch/dist/client/assets/usage-YeRzOlEs.js +0 -2
  1257. package/langwatch/dist/client/assets/use-generic-onboarding-flow-DZY28ya2.js +0 -2
  1258. package/langwatch/dist/client/assets/useActivePlan-fRQ_etI2.js +0 -2
  1259. package/langwatch/dist/client/assets/useAllPromptsForProject-DCZJ0_-p.js +0 -2
  1260. package/langwatch/dist/client/assets/useAnnotationQueues-ByLqaEs6.js +0 -2
  1261. package/langwatch/dist/client/assets/useAvailableEvaluators-BKFN_L8t.js +0 -2
  1262. package/langwatch/dist/client/assets/useCompoundLicenseCheck-BqNF-zzC.js +0 -2
  1263. package/langwatch/dist/client/assets/useCyclingVerb-DSHVFfHS.js +0 -2
  1264. package/langwatch/dist/client/assets/useDepartmentColumn-D1DF_PiG.js +0 -2
  1265. package/langwatch/dist/client/assets/useEvaluationsV3Store-Bc6Q5CKo.js +0 -2
  1266. package/langwatch/dist/client/assets/useExportTraces-BqLmfd8N.js +0 -2
  1267. package/langwatch/dist/client/assets/useFeatureFlag-Do1Ecu3l.js +0 -2
  1268. package/langwatch/dist/client/assets/useInviteActions-DwPlKWmS.js +0 -2
  1269. package/langwatch/dist/client/assets/useLicenseEnforcement-DOI0dcqD.js +0 -2
  1270. package/langwatch/dist/client/assets/usePersonalContext-CggG6KVI.js +0 -2
  1271. package/langwatch/dist/client/assets/useProjectSpanNames-jFO9A6Re.js +0 -2
  1272. package/langwatch/dist/client/assets/useProjectsForCopy-B8F_BY79.js +0 -2
  1273. package/langwatch/dist/client/assets/useRunViaApiTabs-Cr0_nbbp.js +0 -50
  1274. package/langwatch/dist/client/assets/useShowLangy-kmjRxLHs.js +0 -2
  1275. package/langwatch/dist/client/assets/useSimulationUpdateListener-BQB61L8b.js +0 -2
  1276. package/langwatch/dist/client/assets/useTargetName-nPyk8kf-.js +0 -2
  1277. package/langwatch/dist/client/assets/useTargetNameMap-C2bPHyhD.js +0 -2
  1278. package/langwatch/dist/client/assets/useTraceDetailsDrawer-CL82mHNA.js +0 -2
  1279. package/langwatch/dist/client/assets/useTraceUpdateListener-r6BQdcuk.js +0 -2
  1280. package/langwatch/dist/client/assets/useUrlScopeFilter-DFlXMn0U.js +0 -2
  1281. package/langwatch/dist/client/assets/useWorkflowStore-DGHQA8ai.js +0 -8
  1282. package/langwatch/dist/client/assets/users-D5W8Qjjj.js +0 -2
  1283. package/langwatch/dist/client/assets/users-DFyHT5UO.js +0 -2
  1284. package/langwatch/dist/client/assets/users-rKylpyh9.js +0 -2
  1285. package/langwatch/dist/client/assets/v3-NB4P-Pc3.js +0 -2
  1286. package/langwatch/dist/client/assets/variables-DF2_abiB.js +0 -396
  1287. package/langwatch/dist/client/assets/viewStore-DtvCfAUF.js +0 -2
  1288. package/langwatch/dist/client/assets/virtual-keys-DW1kPrjW.js +0 -2
  1289. package/langwatch/dist/client/assets/welcome-DJsfSWej.js +0 -16
  1290. package/langwatch/dist/client/assets/wizard-D2X_QMNx.js +0 -2
  1291. package/langwatch/dist/client/assets/workbench-fZ1KK4fN.js +0 -2
  1292. package/langwatch/dist/client/assets/workflows-CY65pvqY.js +0 -3
  1293. package/langwatch/dist/client/assets/wrap-DlWOPhPw.js +0 -2
  1294. package/langwatch/src/app/api/middleware/__tests__/resource-limit-enforcement.integration.test.ts +0 -278
  1295. package/langwatch/src/app/api/middleware/__tests__/resource-limit.unit.test.ts +0 -299
  1296. package/langwatch/src/app/api/middleware/resource-limit.ts +0 -147
  1297. package/langwatch/src/app/api/scenario-events/[[...route]]/scenario-set-limit.ts +0 -54
  1298. package/langwatch/src/app/api/scenario-events/__tests__/scenario-set-limit.unit.test.ts +0 -195
  1299. package/langwatch/src/app/api/scenario-events/scenario-set-limit.stress.test.ts +0 -216
  1300. package/langwatch/src/components/__tests__/UpgradeModal.unit.test.tsx +0 -103
  1301. package/langwatch/src/hooks/useCompoundLicenseCheck.ts +0 -41
  1302. package/langwatch/src/pages/api/experiment/init.stress.test.ts +0 -130
  1303. package/langwatch/src/server/api/routers/__tests__/project.create.planLimit.integration.test.ts +0 -370
  1304. package/langwatch/src/server/api/routers/__tests__/team.createTeamWithMembers.planLimit.integration.test.ts +0 -251
  1305. package/langwatch/src/server/app-layer/usage/__tests__/usage-service-checkScenarioSetLimit.unit.test.ts +0 -322
  1306. package/langwatch/src/server/app-layer/usage/errors.ts +0 -24
  1307. package/langwatch/src/server/auditLog.ts +0 -49
  1308. package/langwatch/src/server/better-auth/__tests__/fallbackName.test.ts +0 -141
  1309. package/langwatch/src/server/better-auth/__tests__/parseIssuerUrl.test.ts +0 -58
  1310. package/langwatch/src/server/better-auth/__tests__/sso.test.ts +0 -125
  1311. package/langwatch/src/server/better-auth/sso.ts +0 -47
  1312. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummary.coalesce.unit.test.ts +0 -33
  1313. package/langwatch/src/server/license-enforcement/__tests__/limit-breakdown.unit.test.ts +0 -101
  1314. package/langwatch/src/server/license-enforcement/__tests__/personal-workspaces-excluded.integration.test.ts +0 -391
  1315. package/langwatch/src/server/license-enforcement/enforcement.middleware.ts +0 -103
  1316. package/langwatch/src/server/license-enforcement/limit-breakdown.ts +0 -96
  1317. package/langwatch/src/server/routes/scim.ts +0 -583
  1318. package/langwatch/src/server/routes/webhooks.ts +0 -168
  1319. package/langwatch/src/server/scim/__tests__/scim-token.service.unit.test.ts +0 -109
  1320. package/langwatch/src/server/scim/__tests__/scim.costCenter.integration.test.ts +0 -170
  1321. package/langwatch/src/server/scim/__tests__/scim.service.unit.test.ts +0 -414
  1322. package/langwatch/src/server/scim/scim-group.service.ts +0 -464
  1323. package/langwatch/src/server/scim/scim-role-resolver.ts +0 -47
  1324. package/langwatch/src/server/scim/scim-role-resolver.unit.test.ts +0 -92
  1325. package/langwatch/src/server/scim/scim-token.service.ts +0 -70
  1326. package/langwatch/src/server/scim/scim.service.ts +0 -553
  1327. package/langwatch/src/server/scim/scim.types.ts +0 -148
  1328. package/mcp-server/dist/chunk-DSB77X63.js +0 -2328
  1329. package/mcp-server/dist/discover-evaluator-schema-OFEADIJY.js +0 -2175
  1330. package/mcp-server/dist/http-server-YVM4PRTC.js +0 -24466
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{u as n}from"./Markdown-C9extmbX.js";import{En as r,G as i,Gn as a,Ln as o,Nt as s,On as c,Tn as l,U as u,W as d,X as f,_ as p,b as m,gt as h,sn as g,x as _}from"./CartesianChart-CgGSWzzH.js";import{i as v}from"./getRadiusAndStrokeWidthFromDot-BFtcAGI_.js";var y=e(t()),b=class{constructor(e){var t=e.x,n=e.y;this.xAxisScale=t,this.yAxisScale=n}map(e,t){var n=t.position;return{x:this.xAxisScale.map(e.x,{position:n})??0,y:this.yAxisScale.map(e.y,{position:n})??0}}mapWithFallback(e,t){var n=t.position,r=t.fallback,i=r===`rangeMin`?this.yAxisScale.rangeMin():r===`rangeMax`?this.yAxisScale.rangeMax():0,a=r===`rangeMin`?this.xAxisScale.rangeMin():r===`rangeMax`?this.xAxisScale.rangeMax():0;return{x:this.xAxisScale.map(e.x,{position:n})??a,y:this.yAxisScale.map(e.y,{position:n})??i}}isInRange(e){var t=e.x,n=e.y,r=t==null||this.xAxisScale.isInRange(t),i=n==null||this.yAxisScale.isInRange(n);return r&&i}};function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?x(Object(n),!0).forEach(function(t){C(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){var t=T(e,`string`);return typeof t==`symbol`?t:t+``}function T(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(null,arguments)}var D=(e,t,n,i,a)=>{var s=o(e),c=o(t),l=g(),u=r(e=>h(e,`xAxis`,n,l)),d=r(e=>h(e,`yAxis`,i,l));if(!s||!c||u==null||d==null)return null;var f=new b({x:u,y:d}),p=f.map({x:e,y:t},{position:`middle`});return a===`discard`&&!f.isInRange(p)?null:p};function O(e){var t=l();return(0,y.useEffect)(()=>(t(m(e)),()=>{t(_(e))})),null}var k=(e,t)=>y.isValidElement(e)?y.cloneElement(e,t):typeof e==`function`?e(t):y.createElement(v,E({},t,{cx:t.cx,cy:t.cy,className:`recharts-reference-dot-dot`}));function A(e){var t=e.x,r=e.y,o=e.r,s=p(),c=D(t,r,e.xAxisId,e.yAxisId,e.ifOverflow);if(!c)return null;var l=c.x,m=c.y,h=e.shape,g=e.className,_=S(S({clipPath:e.ifOverflow===`hidden`?`url(#${s})`:void 0},a(e)),{},{cx:l??void 0,cy:m??void 0});return y.createElement(f,{zIndex:e.zIndex},y.createElement(u,{className:n(`recharts-reference-dot`,g)},k(h,_),y.createElement(d,{x:l-o,y:m-o,width:2*o,height:2*o,upperWidth:2*o,lowerWidth:2*o},y.createElement(i,{label:e.label}),e.children)))}var j={ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,label:!1,fill:`#fff`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1,zIndex:s.scatter};function M(e){var t=c(e,j),n=t.x,r=t.y,i=t.r,a=t.ifOverflow,o=t.yAxisId,s=t.xAxisId;return y.createElement(y.Fragment,null,y.createElement(O,{y:r,x:n,r:i,yAxisId:o,xAxisId:s,ifOverflow:a}),y.createElement(A,t))}M.displayName=`ReferenceDot`;export{M as t};
2
- //# sourceMappingURL=ReferenceDot-DbjBc6Dh.js.map
@@ -1,261 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-json-view-B2Vyx9aO.js","assets/rolldown-runtime-DAXXjFlN.js","assets/react-BUD3sqOU.js"])))=>i.map(i=>d[i]);
2
- import{o as e,r as t}from"./rolldown-runtime-DAXXjFlN.js";import{t as n}from"./react-BUD3sqOU.js";import{dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{S as o}from"./shiki-CS25xJLQ.js";import{t as s}from"./jsx-runtime-CFwixLRt.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{Ct as u,Tt as d}from"./ProjectAvatar-DtI9dT1f.js";import{t as f}from"./tooltip-gjZ4s2dt.js";import{n as p}from"./toaster-BsYkODqs.js";import{Nt as ee}from"./index-CPtTUYLD.js";import{t as te}from"./next-dynamic-DcKsrHUa.js";var ne=e(n()),m=s();function re({parts:e}){if(e.length===0)return null;let t=e.slice(0,8),n=e.length-t.length;return(0,m.jsxs)(l,{align:`flex-start`,gap:2,marginBottom:2,children:[t.map((e,t)=>(0,m.jsx)(u,{part:e},`trace-media-${t}`)),n>0&&(0,m.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,"data-testid":`trace-media-overflow`,children:[`+`,n,` more media `,n===1?`item`:`items`,` in the raw content below`]})]})}var ie=t({StringBuffer:()=>b,abstract:()=>g,assert:()=>_,checkNotNull:()=>ge,clone:()=>oe,copyWithoutDuplicates:()=>ue,defineLazyProperty:()=>ae,getDuplicates:()=>le,isLexical:()=>de,isSyntactic:()=>y,padLeft:()=>fe,repeat:()=>v,repeatFn:()=>se,repeatStr:()=>ce,unescapeCodePoint:()=>me,unexpectedObjToString:()=>he}),h={};for(let e=0;e<128;e++)h[e]=String.fromCharCode(e);h[39]=`\\'`,h[34]=`\\"`,h[92]=`\\\\`,h[8]=`\\b`,h[12]=`\\f`,h[10]=`\\n`,h[13]=`\\r`,h[9]=`\\t`,h[11]=`\\v`;function g(e){let t=e||``;return function(){throw Error(`this method `+t+` is abstract! (it has no implementation in class `+this.constructor.name+`)`)}}function _(e,t){if(!e)throw Error(t||`Assertion failed`)}function ae(e,t,n){let r;Object.defineProperty(e,t,{get(){return r||=n.call(this),r}})}function oe(e){return e&&Object.assign({},e)}function se(e,t){let n=[];for(;t-->0;)n.push(e());return n}function ce(e,t){return Array(t+1).join(e)}function v(e,t){return se(()=>e,t)}function le(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];e.lastIndexOf(r)!==n&&t.indexOf(r)<0&&t.push(r)}return t}function ue(e){let t=[];return e.forEach(e=>{t.indexOf(e)<0&&t.push(e)}),t}function y(e){let t=e[0];return t===t.toUpperCase()}function de(e){return!y(e)}function fe(e,t,n){let r=n||` `;return e.length<t?ce(r,t-e.length)+e:e}function b(){this.strings=[]}b.prototype.append=function(e){this.strings.push(e)},b.prototype.contents=function(){return this.strings.join(``)};var pe=e=>String.fromCodePoint(parseInt(e,16));function me(e){if(e.charAt(0)===`\\`)switch(e.charAt(1)){case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
3
- `;case`r`:return`\r`;case`t`:return` `;case`v`:return`\v`;case`x`:return pe(e.slice(2,4));case`u`:return e.charAt(2)===`{`?pe(e.slice(3,-1)):pe(e.slice(2,6));default:return e.charAt(1)}else return e}function he(e){if(e==null)return String(e);let t=Object.prototype.toString.call(e);try{let n;return n=e.constructor&&e.constructor.name?e.constructor.name:t.indexOf(`[object `)===0?t.slice(8,-1):typeof e,n+`: `+JSON.stringify(String(e))}catch{return t}}function ge(e,t=`unexpected null value`){if(e==null)throw Error(t);return e}var _e=e=>new RegExp(String.raw`\p{${e}}`,`u`),ve=Object.fromEntries(`Cc.Cf.Cn.Co.Cs.Ll.Lm.Lo.Lt.Lu.Mc.Me.Mn.Nd.Nl.No.Pc.Pd.Pe.Pf.Pi.Po.Ps.Sc.Sk.Sm.So.Zl.Zp.Zs`.split(`.`).map(e=>[e,_e(e)]));ve.Ltmo=/\p{Lt}|\p{Lm}|\p{Lo}/u;var ye=Object.fromEntries([`XID_Start`,`XID_Continue`,`White_Space`].map(e=>[e,_e(e)])),x=class e{constructor(){if(this.constructor===e)throw Error(`PExpr cannot be instantiated -- it's abstract`)}withSource(e){return e&&(this.source=e.trimmed()),this}},S=Object.create(x.prototype),C=Object.create(x.prototype),w=class extends x{constructor(e){super(),this.obj=e}},T=class extends x{constructor(e,t){super(),this.from=e,this.to=t,this.matchCodePoint=e.length>1||t.length>1}},E=class extends x{constructor(e){super(),this.index=e}},D=class extends x{constructor(e){super(),this.terms=e}},O=class extends D{constructor(e,t,n){let r=e.rules[t].body;super([n,r]),this.superGrammar=e,this.name=t,this.body=n}},k=class extends D{constructor(e,t,n,r){let i=e.rules[t].body;super([...n,i,...r]),this.superGrammar=e,this.ruleName=t,this.expansionPos=n.length}},A=class extends x{constructor(e){super(),this.factors=e}},j=class extends x{constructor(e){super(),this.expr=e}},M=class extends j{},N=class extends j{},P=class extends j{};M.prototype.operator=`*`,N.prototype.operator=`+`,P.prototype.operator=`?`,M.prototype.minNumMatches=0,N.prototype.minNumMatches=1,P.prototype.minNumMatches=0,M.prototype.maxNumMatches=1/0,N.prototype.maxNumMatches=1/0,P.prototype.maxNumMatches=1;var F=class extends x{constructor(e){super(),this.expr=e}},I=class extends x{constructor(e){super(),this.expr=e}},L=class extends x{constructor(e){super(),this.expr=e}},R=class extends x{constructor(e,t=[]){super(),this.ruleName=e,this.args=t}isSyntactic(){return y(this.ruleName)}toMemoKey(){return this._memoKey||Object.defineProperty(this,"_memoKey",{value:this.toString()}),this._memoKey}},z=class extends x{constructor(e){if(super(),this.categoryOrProp=e,e in ve)this.pattern=ve[e];else if(e in ye)this.pattern=ye[e];else throw Error(`Invalid Unicode category or property name: ${JSON.stringify(e)}`)}};function B(e,t){let n;return t?(n=Error(t.getLineAndColumnMessage()+e),n.shortMessage=e,n.interval=t):n=Error(e),n}function be(){return B(`Interval sources don't match`)}function xe(e){let t=Error();return Object.defineProperty(t,"message",{enumerable:!0,get(){return e.message}}),Object.defineProperty(t,"shortMessage",{enumerable:!0,get(){return`Expected `+e.getExpectedText()}}),t.interval=e.getInterval(),t}function Se(e,t,n){return B(t?`Grammar ${e} is not declared in namespace '${t}'`:`Undeclared grammar `+e,n)}function Ce(e,t){return B(`Grammar `+e.name+` is already declared in this namespace`)}function we(e){return B(`Grammar '${e.name}' does not support incremental parsing`)}function Te(e,t,n){return B(`Rule `+e+` is not declared in grammar `+t,n)}function Ee(e,t,n){return B(`Cannot override rule `+e+` because it is not declared in `+t,n)}function De(e,t,n){return B(`Cannot extend rule `+e+` because it is not declared in `+t,n)}function Oe(e,t,n,r){let i=`Duplicate declaration for rule '`+e+`' in grammar '`+t+`'`;return t!==n&&(i+=` (originally declared in '`+n+`')`),B(i,r)}function ke(e,t,n,r){return B(`Wrong number of parameters for rule `+e+` (expected `+t+`, got `+n+`)`,r)}function Ae(e,t,n,r){return B(`Wrong number of arguments for rule `+e+` (expected `+t+`, got `+n+`)`,r)}function je(e,t,n){return B(`Duplicate parameter names in rule `+e+`: `+t.join(`, `),n)}function Me(e,t){return B(`Invalid parameter to rule `+e+`: `+t+` has arity `+t.getArity()+`, but parameter expressions must have arity 1`,t.source)}function Ne(e,t){return B(`Cannot apply syntactic rule `+e+` from here (inside a lexical context)`,t.source)}function Pe(e){let{ruleName:t}=e;return B(`applySyntactic is for syntactic rules, but '${t}' is a lexical rule. NOTE: A _syntactic rule_ is a rule whose name begins with a capital letter. See https://ohmjs.org/d/svl for more details.`,e.source)}function Fe(e){return B(`applySyntactic is not required here (in a syntactic context)`,e.source)}function Ie(e,t){return B(`Incorrect argument type: expected `+e,t.source)}function Le(e){return B(`'...' can appear at most once in a rule body`,e.source)}function Re(e){let t=e._node;_(t&&t.isNonterminal()&&t.ctorName===`escapeChar_unicodeCodePoint`);let n=e.children.slice(1,-1).map(e=>e.source),r=n[0].coverageWith(...n.slice(1));return B(`U+${r.contents} is not a valid Unicode code point`,r)}function ze(e,t){let n=t.length>0?t[t.length-1].args:[],r=`Nullable expression `+e.expr.substituteParams(n)+` is not allowed inside '`+e.operator+`' (possible infinite loop)`;if(t.length>0){let e=t.map(e=>new R(e.ruleName,e.args)).join(`
4
- `);r+=`
5
- Application stack (most recent application last):
6
- `+e}return B(r,e.expr.source)}function Be(e,t,n,r){return B(`Rule `+e+` involves an alternation which has inconsistent arity (expected `+t+`, got `+n+`)`,r.source)}function Ve(e){let t=e.map(e=>e.message);return B([`Errors:`].concat(t).join(`
7
- - `),e[0].interval)}function He(e,t,n,r){let i=r.slice(0,-1).map(e=>{let t=` `+e[0].name+` > `+e[1];return e.length===3?t+` for '`+e[2]+`'`:t}).join(`
8
- `);i+=`
9
- `+t+` > `+e;let a=``;e===`_iter`&&(a=[`
10
- NOTE: as of Ohm v16, there is no default action for iteration nodes — see `,` https://ohmjs.org/d/dsa for details.`].join(`
11
- `));let o=B([`Missing semantic action for '${e}' in ${n} '${t}'.${a}`,`Action stack (most recent call last):`,i].join(`
12
- `));return o.name=`missingSemanticAction`,o}function Ue(e){if(e.length===1)throw e[0];if(e.length>1)throw Ve(e)}function We(e){let t=0;return e.map(e=>{let n=e.toString();return t=Math.max(t,n.length),n}).map(e=>fe(e,t))}function Ge(e,t,n){let r=e.length,i=e.slice(0,n),a=e.slice(n+t.length);return(i+t+a).substr(0,r)}function Ke(...e){let t=this,{offset:n}=t,{repeatStr:r}=ie,i=new b;i.append(`Line `+t.lineNum+`, col `+t.colNum+`:
13
- `);let a=We([t.prevLine==null?0:t.lineNum-1,t.lineNum,t.nextLine==null?0:t.lineNum+1]),o=(e,t,n)=>{i.append(n+a[e]+` | `+t+`
14
- `)};t.prevLine!=null&&o(0,t.prevLine,` `),o(1,t.line,`> `);let s=t.line.length,c=r(` `,s+1);for(let i=0;i<e.length;++i){let a=e[i][0],o=e[i][1];_(a>=0&&a<=o,`range start must be >= 0 and <= end`);let l=n-t.colNum+1;a=Math.max(0,a-l),o=Math.min(o-l,s),c=Ge(c,r(`~`,o-a),a)}let l=2+a[1].length+3;return i.append(r(` `,l)),c=Ge(c,`^`,t.colNum-1),i.append(c.replace(/ +$/,``)+`
15
- `),t.nextLine!=null&&o(2,t.nextLine,` `),i.contents()}var qe=[];function Je(e){qe.push(e)}function Ye(e){qe.forEach(t=>{t(e)}),qe=null}function Xe(e,t){let n=1,r=1,i=0,a=0,o=null,s=null,c=-1;for(;i<t;){let t=e.charAt(i++);t===`
16
- `?(n++,r=1,c=a,a=i):t!==`\r`&&r++}let l=e.indexOf(`
17
- `,a);if(l===-1)l=e.length;else{let t=e.indexOf(`
18
- `,l+1);o=t===-1?e.slice(l):e.slice(l,t),o=o.replace(/^\r?\n/,``).replace(/\r$/,``)}c>=0&&(s=e.slice(c,a).replace(/\r?\n$/,``));let u=e.slice(a,l).replace(/\r$/,``);return{offset:t,lineNum:n,colNum:r,line:u,prevLine:s,nextLine:o,toString:Ke}}function Ze(e,t,...n){return Xe(e,t).toString(...n)}var Qe=(()=>{let e=0;return t=>``+t+e++})(),V=class e{constructor(e,t,n){Object.defineProperty(this,"_sourceString",{value:e,configurable:!1,enumerable:!1,writable:!1}),this.startIdx=t,this.endIdx=n}get sourceString(){return this._sourceString}get contents(){return this._contents===void 0&&(this._contents=this.sourceString.slice(this.startIdx,this.endIdx)),this._contents}get length(){return this.endIdx-this.startIdx}coverageWith(...t){return e.coverage(...t,this)}collapsedLeft(){return new e(this.sourceString,this.startIdx,this.startIdx)}collapsedRight(){return new e(this.sourceString,this.endIdx,this.endIdx)}getLineAndColumn(){return Xe(this.sourceString,this.startIdx)}getLineAndColumnMessage(){let e=[this.startIdx,this.endIdx];return Ze(this.sourceString,this.startIdx,e)}minus(t){if(this.sourceString!==t.sourceString)throw be();return this.startIdx===t.startIdx&&this.endIdx===t.endIdx?[]:this.startIdx<t.startIdx&&t.endIdx<this.endIdx?[new e(this.sourceString,this.startIdx,t.startIdx),new e(this.sourceString,t.endIdx,this.endIdx)]:this.startIdx<t.endIdx&&t.endIdx<this.endIdx?[new e(this.sourceString,t.endIdx,this.endIdx)]:this.startIdx<t.startIdx&&t.startIdx<this.endIdx?[new e(this.sourceString,this.startIdx,t.startIdx)]:[this]}relativeTo(t){if(this.sourceString!==t.sourceString)throw be();return _(this.startIdx>=t.startIdx&&this.endIdx<=t.endIdx,`other interval does not cover this one`),new e(this.sourceString,this.startIdx-t.startIdx,this.endIdx-t.startIdx)}trimmed(){let{contents:t}=this,n=this.startIdx+t.match(/^\s*/)[0].length,r=this.endIdx-t.match(/\s*$/)[0].length;return new e(this.sourceString,n,r)}subInterval(t,n){let r=this.startIdx+t;return new e(this.sourceString,r,r+n)}};V.coverage=function(e,...t){let{startIdx:n,endIdx:r}=e;for(let i of t)if(i.sourceString!==e.sourceString)throw be();else n=Math.min(n,i.startIdx),r=Math.max(r,i.endIdx);return new V(e.sourceString,n,r)};var $e=65535,H=class{constructor(e){this.source=e,this.pos=0,this.examinedLength=0}atEnd(){let e=this.pos>=this.source.length;return this.examinedLength=Math.max(this.examinedLength,this.pos+1),e}next(){let e=this.source[this.pos++];return this.examinedLength=Math.max(this.examinedLength,this.pos),e}nextCharCode(){let e=this.next();return e&&e.charCodeAt(0)}nextCodePoint(){let e=this.source.slice(this.pos++).codePointAt(0);return e>$e&&(this.pos+=1),this.examinedLength=Math.max(this.examinedLength,this.pos),e}matchString(e,t){let n;if(t){for(n=0;n<e.length;n++){let t=this.next(),r=e[n];if(t==null||t.toUpperCase()!==r.toUpperCase())return!1}return!0}for(n=0;n<e.length;n++)if(this.next()!==e[n])return!1;return!0}sourceSlice(e,t){return this.source.slice(e,t)}interval(e,t){return new V(this.source,e,t||this.pos)}},et=class{constructor(e,t,n,r,i,a,o){this.matcher=e,this.input=t,this.startExpr=n,this._cst=r,this._cstOffset=i,this._rightmostFailurePosition=a,this._rightmostFailures=o,this.failed()&&(ae(this,`message`,function(){let e=`Expected `+this.getExpectedText();return Ze(this.input,this.getRightmostFailurePosition())+e}),ae(this,`shortMessage`,function(){let e=`expected `+this.getExpectedText(),t=Xe(this.input,this.getRightmostFailurePosition());return`Line `+t.lineNum+`, col `+t.colNum+`: `+e}))}succeeded(){return!!this._cst}failed(){return!this.succeeded()}getRightmostFailurePosition(){return this._rightmostFailurePosition}getRightmostFailures(){if(!this._rightmostFailures){this.matcher.setInput(this.input);let e=this.matcher._match(this.startExpr,{tracing:!1,positionToRecordFailures:this.getRightmostFailurePosition()});this._rightmostFailures=e.getRightmostFailures()}return this._rightmostFailures}toString(){return this.succeeded()?`[match succeeded]`:`[match failed at position `+this.getRightmostFailurePosition()+`]`}getExpectedText(){if(this.succeeded())throw Error(`cannot get expected text of a successful MatchResult`);let e=new b,t=this.getRightmostFailures();t=t.filter(e=>!e.isFluffy());for(let n=0;n<t.length;n++)n>0&&(n===t.length-1?e.append(t.length>2?`, or `:` or `):e.append(`, `)),e.append(t[n].toString());return e.contents()}getInterval(){let e=this.getRightmostFailurePosition();return new V(this.input,e,e)}},tt=class{constructor(){this.applicationMemoKeyStack=[],this.memo={},this.maxExaminedLength=0,this.maxRightmostFailureOffset=-1,this.currentLeftRecursion=void 0}isActive(e){return this.applicationMemoKeyStack.indexOf(e.toMemoKey())>=0}enter(e){this.applicationMemoKeyStack.push(e.toMemoKey())}exit(){this.applicationMemoKeyStack.pop()}startLeftRecursion(e,t){t.isLeftRecursion=!0,t.headApplication=e,t.nextLeftRecursion=this.currentLeftRecursion,this.currentLeftRecursion=t;let{applicationMemoKeyStack:n}=this,r=n.indexOf(e.toMemoKey())+1,i=n.slice(r);t.isInvolved=function(e){return i.indexOf(e)>=0},t.updateInvolvedApplicationMemoKeys=function(){for(let e=r;e<n.length;e++){let t=n[e];this.isInvolved(t)||i.push(t)}}}endLeftRecursion(){this.currentLeftRecursion=this.currentLeftRecursion.nextLeftRecursion}shouldUseMemoizedResult(e){if(!e.isLeftRecursion)return!0;let{applicationMemoKeyStack:t}=this;for(let n=0;n<t.length;n++){let r=t[n];if(e.isInvolved(r))return!1}return!0}memoize(e,t){return this.memo[e]=t,this.maxExaminedLength=Math.max(this.maxExaminedLength,t.examinedLength),this.maxRightmostFailureOffset=Math.max(this.maxRightmostFailureOffset,t.rightmostFailureOffset),t}clearObsoleteEntries(e,t){if(e+this.maxExaminedLength<=t)return;let{memo:n}=this;this.maxExaminedLength=0,this.maxRightmostFailureOffset=-1,Object.keys(n).forEach(r=>{let i=n[r];e+i.examinedLength>t?delete n[r]:(this.maxExaminedLength=Math.max(this.maxExaminedLength,i.examinedLength),this.maxRightmostFailureOffset=Math.max(this.maxRightmostFailureOffset,i.rightmostFailureOffset))})}},nt=`✗`,rt=`✓`,it=`⋅`,at=`␉`,ot=`␊`,st=`␍`,ct={succeeded:1,isRootNode:2,isImplicitSpaces:4,isMemoized:8,isHeadOfLeftRecursion:16,terminatesLR:32};function lt(e){return v(` `,e).join(``)}function ut(e,t,n){let r=dt(e.slice(t,t+n));return r.length<n?r+v(` `,n-r.length).join(``):r}function dt(e){return typeof e==`string`?e.replace(/ /g,it).replace(/\t/g,at).replace(/\n/g,ot).replace(/\r/g,st):String(e)}var U=class e{constructor(e,t,n,r,i,a,o){this.input=e,this.pos=this.pos1=t,this.pos2=n,this.source=new V(e,t,n),this.expr=r,this.bindings=a,this.children=o||[],this.terminatingLREntry=null,this._flags=i?ct.succeeded:0}get displayString(){return this.expr.toDisplayString()}clone(){return this.cloneWithExpr(this.expr)}cloneWithExpr(t){let n=new e(this.input,this.pos,this.pos2,t,this.succeeded,this.bindings,this.children);return n.isHeadOfLeftRecursion=this.isHeadOfLeftRecursion,n.isImplicitSpaces=this.isImplicitSpaces,n.isMemoized=this.isMemoized,n.isRootNode=this.isRootNode,n.terminatesLR=this.terminatesLR,n.terminatingLREntry=this.terminatingLREntry,n}recordLRTermination(t,n){this.terminatingLREntry=new e(this.input,this.pos,this.pos2,this.expr,!1,[n],[t]),this.terminatingLREntry.terminatesLR=!0}walk(t,n){let r=t;typeof r==`function`&&(r={enter:r});function i(t,a,o){let s=!0;r.enter&&r.enter.call(n,t,a,o)===e.prototype.SKIP&&(s=!1),s&&(t.children.forEach(e=>{i(e,t,o+1)}),r.exit&&r.exit.call(n,t,a,o))}this.isRootNode?this.children.forEach(e=>{i(e,null,0)}):i(this,null,0)}toString(){let e=new b;return this.walk((t,n,r)=>{if(!t)return this.SKIP;if(t.expr.constructor.name!==`Alt`){if(e.append(ut(t.input,t.pos,10)+lt(r*2+1)),e.append((t.succeeded?rt:nt)+` `+t.displayString),t.isHeadOfLeftRecursion&&e.append(` (LR)`),t.succeeded){let n=dt(t.source.contents);e.append(` ⇒ `),e.append(typeof n==`string`?`"`+n+`"`:n)}e.append(`
19
- `)}}),e.contents()}};U.prototype.SKIP={},Object.keys(ct).forEach(e=>{let t=ct[e];Object.defineProperty(U.prototype,e,{get(){return(this._flags&t)!==0},set(e){e?this._flags|=t:this._flags&=~t}})}),x.prototype.allowsSkippingPrecedingSpace=g(`allowsSkippingPrecedingSpace`),S.allowsSkippingPrecedingSpace=C.allowsSkippingPrecedingSpace=R.prototype.allowsSkippingPrecedingSpace=w.prototype.allowsSkippingPrecedingSpace=T.prototype.allowsSkippingPrecedingSpace=z.prototype.allowsSkippingPrecedingSpace=function(){return!0},D.prototype.allowsSkippingPrecedingSpace=j.prototype.allowsSkippingPrecedingSpace=L.prototype.allowsSkippingPrecedingSpace=I.prototype.allowsSkippingPrecedingSpace=F.prototype.allowsSkippingPrecedingSpace=E.prototype.allowsSkippingPrecedingSpace=A.prototype.allowsSkippingPrecedingSpace=function(){return!1};var W;Je(e=>{W=e});var G;x.prototype.assertAllApplicationsAreValid=function(e,t){G=0,this._assertAllApplicationsAreValid(e,t)},x.prototype._assertAllApplicationsAreValid=g(`_assertAllApplicationsAreValid`),S._assertAllApplicationsAreValid=C._assertAllApplicationsAreValid=w.prototype._assertAllApplicationsAreValid=T.prototype._assertAllApplicationsAreValid=E.prototype._assertAllApplicationsAreValid=z.prototype._assertAllApplicationsAreValid=function(e,t){},L.prototype._assertAllApplicationsAreValid=function(e,t){G++,this.expr._assertAllApplicationsAreValid(e,t),G--},D.prototype._assertAllApplicationsAreValid=function(e,t){for(let n=0;n<this.terms.length;n++)this.terms[n]._assertAllApplicationsAreValid(e,t)},A.prototype._assertAllApplicationsAreValid=function(e,t){for(let n=0;n<this.factors.length;n++)this.factors[n]._assertAllApplicationsAreValid(e,t)},j.prototype._assertAllApplicationsAreValid=F.prototype._assertAllApplicationsAreValid=I.prototype._assertAllApplicationsAreValid=function(e,t){this.expr._assertAllApplicationsAreValid(e,t)},R.prototype._assertAllApplicationsAreValid=function(e,t,n=!1){let r=t.rules[this.ruleName],i=y(e)&&G===0;if(!r)throw Te(this.ruleName,t.name,this.source);if(!n&&y(this.ruleName)&&!i)throw Ne(this.ruleName,this);let a=this.args.length,o=r.formals.length;if(a!==o)throw Ae(this.ruleName,o,a,this.source);let s=W&&r===W.rules.applySyntactic;if(W&&r===W.rules.caseInsensitive&&!(this.args[0]instanceof w))throw Ie(`a Terminal (e.g. "abc")`,this.args[0]);if(s){let e=this.args[0];if(!(e instanceof R))throw Ie(`a syntactic rule application`,e);if(!y(e.ruleName))throw Pe(e);if(i)throw Fe(this)}this.args.forEach(n=>{if(n._assertAllApplicationsAreValid(e,t,s),n.getArity()!==1)throw Me(this.ruleName,n)})},x.prototype.assertChoicesHaveUniformArity=g(`assertChoicesHaveUniformArity`),S.assertChoicesHaveUniformArity=C.assertChoicesHaveUniformArity=w.prototype.assertChoicesHaveUniformArity=T.prototype.assertChoicesHaveUniformArity=E.prototype.assertChoicesHaveUniformArity=L.prototype.assertChoicesHaveUniformArity=z.prototype.assertChoicesHaveUniformArity=function(e){},D.prototype.assertChoicesHaveUniformArity=function(e){if(this.terms.length===0)return;let t=this.terms[0].getArity();for(let n=0;n<this.terms.length;n++){let r=this.terms[n];r.assertChoicesHaveUniformArity();let i=r.getArity();if(t!==i)throw Be(e,t,i,r)}},O.prototype.assertChoicesHaveUniformArity=function(e){let t=this.terms[0].getArity(),n=this.terms[1].getArity();if(t!==n)throw Be(e,n,t,this.terms[0])},A.prototype.assertChoicesHaveUniformArity=function(e){for(let t=0;t<this.factors.length;t++)this.factors[t].assertChoicesHaveUniformArity(e)},j.prototype.assertChoicesHaveUniformArity=function(e){this.expr.assertChoicesHaveUniformArity(e)},F.prototype.assertChoicesHaveUniformArity=function(e){},I.prototype.assertChoicesHaveUniformArity=function(e){this.expr.assertChoicesHaveUniformArity(e)},R.prototype.assertChoicesHaveUniformArity=function(e){},x.prototype.assertIteratedExprsAreNotNullable=g(`assertIteratedExprsAreNotNullable`),S.assertIteratedExprsAreNotNullable=C.assertIteratedExprsAreNotNullable=w.prototype.assertIteratedExprsAreNotNullable=T.prototype.assertIteratedExprsAreNotNullable=E.prototype.assertIteratedExprsAreNotNullable=z.prototype.assertIteratedExprsAreNotNullable=function(e){},D.prototype.assertIteratedExprsAreNotNullable=function(e){for(let t=0;t<this.terms.length;t++)this.terms[t].assertIteratedExprsAreNotNullable(e)},A.prototype.assertIteratedExprsAreNotNullable=function(e){for(let t=0;t<this.factors.length;t++)this.factors[t].assertIteratedExprsAreNotNullable(e)},j.prototype.assertIteratedExprsAreNotNullable=function(e){if(this.expr.assertIteratedExprsAreNotNullable(e),this.expr.isNullable(e))throw ze(this,[])},P.prototype.assertIteratedExprsAreNotNullable=F.prototype.assertIteratedExprsAreNotNullable=I.prototype.assertIteratedExprsAreNotNullable=L.prototype.assertIteratedExprsAreNotNullable=function(e){this.expr.assertIteratedExprsAreNotNullable(e)},R.prototype.assertIteratedExprsAreNotNullable=function(e){this.args.forEach(t=>{t.assertIteratedExprsAreNotNullable(e)})};var ft=class{constructor(e){this.matchLength=e}get ctorName(){throw Error(`subclass responsibility`)}numChildren(){return this.children?this.children.length:0}childAt(e){if(this.children)return this.children[e]}indexOfChild(e){return this.children.indexOf(e)}hasChildren(){return this.numChildren()>0}hasNoChildren(){return!this.hasChildren()}onlyChild(){if(this.numChildren()!==1)throw Error(`cannot get only child of a node of type `+this.ctorName+` (it has `+this.numChildren()+` children)`);return this.firstChild()}firstChild(){if(this.hasNoChildren())throw Error(`cannot get first child of a `+this.ctorName+` node, which has no children`);return this.childAt(0)}lastChild(){if(this.hasNoChildren())throw Error(`cannot get last child of a `+this.ctorName+` node, which has no children`);return this.childAt(this.numChildren()-1)}childBefore(e){let t=this.indexOfChild(e);if(t<0)throw Error(`Node.childBefore() called w/ an argument that is not a child`);if(t===0)throw Error(`cannot get child before first child`);return this.childAt(t-1)}childAfter(e){let t=this.indexOfChild(e);if(t<0)throw Error(`Node.childAfter() called w/ an argument that is not a child`);if(t===this.numChildren()-1)throw Error(`cannot get child after last child`);return this.childAt(t+1)}isTerminal(){return!1}isNonterminal(){return!1}isIteration(){return!1}isOptional(){return!1}},K=class extends ft{get ctorName(){return`_terminal`}isTerminal(){return!0}get primitiveValue(){throw Error("The `primitiveValue` property was removed in Ohm v17.")}},pt=class extends ft{constructor(e,t,n,r){super(r),this.ruleName=e,this.children=t,this.childOffsets=n}get ctorName(){return this.ruleName}isNonterminal(){return!0}isLexical(){return de(this.ctorName)}isSyntactic(){return y(this.ctorName)}},mt=class extends ft{constructor(e,t,n,r){super(n),this.children=e,this.childOffsets=t,this.optional=r}get ctorName(){return`_iter`}isIteration(){return!0}isOptional(){return this.optional}};x.prototype.eval=g(`eval`),S.eval=function(e){let{inputStream:t}=e,n=t.pos,r=t.nextCodePoint();return r===void 0?(e.processFailure(n,this),!1):(e.pushBinding(new K(String.fromCodePoint(r).length),n),!0)},C.eval=function(e){let{inputStream:t}=e,n=t.pos;return t.atEnd()?(e.pushBinding(new K(0),n),!0):(e.processFailure(n,this),!1)},w.prototype.eval=function(e){let{inputStream:t}=e,n=t.pos;return t.matchString(this.obj)?(e.pushBinding(new K(this.obj.length),n),!0):(e.processFailure(n,this),!1)},T.prototype.eval=function(e){let{inputStream:t}=e,n=t.pos,r=this.matchCodePoint?t.nextCodePoint():t.nextCharCode();return r!==void 0&&this.from.codePointAt(0)<=r&&r<=this.to.codePointAt(0)?(e.pushBinding(new K(String.fromCodePoint(r).length),n),!0):(e.processFailure(n,this),!1)},E.prototype.eval=function(e){return e.eval(e.currentApplication().args[this.index])},L.prototype.eval=function(e){e.enterLexifiedContext();let t=e.eval(this.expr);return e.exitLexifiedContext(),t},D.prototype.eval=function(e){for(let t=0;t<this.terms.length;t++)if(e.eval(this.terms[t]))return!0;return!1},A.prototype.eval=function(e){for(let t=0;t<this.factors.length;t++){let n=this.factors[t];if(!e.eval(n))return!1}return!0},j.prototype.eval=function(e){let{inputStream:t}=e,n=t.pos,r=this.getArity(),i=[],a=[];for(;i.length<r;)i.push([]),a.push([]);let o=0,s=n,c;for(;o<this.maxNumMatches&&e.eval(this.expr);){if(t.pos===s)throw ze(this,e._applicationStack);s=t.pos,o++;let n=e._bindings.splice(e._bindings.length-r,r),l=e._bindingOffsets.splice(e._bindingOffsets.length-r,r);for(c=0;c<n.length;c++)i[c].push(n[c]),a[c].push(l[c])}if(o<this.minNumMatches)return!1;let l=e.posToOffset(n),u=0;if(o>0){let e=i[r-1],t=a[r-1],n=t[t.length-1]+e[e.length-1].matchLength;l=a[0][0],u=n-l}let d=this instanceof P;for(c=0;c<i.length;c++)e._bindings.push(new mt(i[c],a[c],u,d)),e._bindingOffsets.push(l);return!0},F.prototype.eval=function(e){let{inputStream:t}=e,n=t.pos;e.pushFailuresInfo();let r=e.eval(this.expr);return e.popFailuresInfo(),r?(e.processFailure(n,this),!1):(t.pos=n,!0)},I.prototype.eval=function(e){let{inputStream:t}=e,n=t.pos;return e.eval(this.expr)?(t.pos=n,!0):!1},R.prototype.eval=function(e){let t=e.currentApplication(),n=t?t.args:[],r=this.substituteParams(n),i=e.getCurrentPosInfo();if(i.isActive(r))return r.handleCycle(e);let a=r.toMemoKey(),o=i.memo[a];if(o&&i.shouldUseMemoizedResult(o)){if(e.hasNecessaryInfo(o))return e.useMemoizedResult(e.inputStream.pos,o);delete i.memo[a]}return r.reallyEval(e)},R.prototype.handleCycle=function(e){let t=e.getCurrentPosInfo(),{currentLeftRecursion:n}=t,r=this.toMemoKey(),i=t.memo[r];return n&&n.headApplication.toMemoKey()===r?i.updateInvolvedApplicationMemoKeys():i||(i=t.memoize(r,{matchLength:0,examinedLength:0,value:!1,rightmostFailureOffset:-1}),t.startLeftRecursion(this,i)),e.useMemoizedResult(e.inputStream.pos,i)},R.prototype.reallyEval=function(e){let{inputStream:t}=e,n=t.pos,r=e.getCurrentPosInfo(),i=e.grammar.rules[this.ruleName],{body:a}=i,{description:o}=i;e.enterApplication(r,this),o&&e.pushFailuresInfo();let s=t.examinedLength;t.examinedLength=0;let c=this.evalOnce(a,e),l=r.currentLeftRecursion,u=this.toMemoKey(),d=l&&l.headApplication.toMemoKey()===u,f;e.doNotMemoize?e.doNotMemoize=!1:d?(c=this.growSeedResult(a,e,n,l,c),r.endLeftRecursion(),f=l,f.examinedLength=t.examinedLength-n,f.rightmostFailureOffset=e._getRightmostFailureOffset(),r.memoize(u,f)):(!l||!l.isInvolved(u))&&(f=r.memoize(u,{matchLength:t.pos-n,examinedLength:t.examinedLength-n,value:c,failuresAtRightmostPosition:e.cloneRecordedFailures(),rightmostFailureOffset:e._getRightmostFailureOffset()}));let p=!!c;if(o&&(e.popFailuresInfo(),p||e.processFailure(n,this),f&&(f.failuresAtRightmostPosition=e.cloneRecordedFailures(),f.rightmostFailureOffset=e._getRightmostFailureOffset())),e.isTracing()&&f){let t=e.getTraceEntry(n,this,p,p?[c]:[]);d&&(_(t.terminatingLREntry!=null||!p),t.isHeadOfLeftRecursion=!0),f.traceEntry=t}return t.examinedLength=Math.max(t.examinedLength,s),e.exitApplication(r,c),p},R.prototype.evalOnce=function(e,t){let{inputStream:n}=t,r=n.pos;if(t.eval(e)){let i=e.getArity(),a=t._bindings.splice(t._bindings.length-i,i),o=t._bindingOffsets.splice(t._bindingOffsets.length-i,i),s=n.pos-r;return new pt(this.ruleName,a,o,s)}else return!1},R.prototype.growSeedResult=function(e,t,n,r,i){if(!i)return!1;let{inputStream:a}=t;for(;;){if(r.matchLength=a.pos-n,r.value=i,r.failuresAtRightmostPosition=t.cloneRecordedFailures(),t.isTracing()){let e=t.trace[t.trace.length-1];r.traceEntry=new U(t.input,n,a.pos,this,!0,[i],[e.clone()])}if(a.pos=n,i=this.evalOnce(e,t),a.pos-n<=r.matchLength)break;t.isTracing()&&t.trace.splice(-2,1)}return t.isTracing()&&r.traceEntry.recordLRTermination(t.trace.pop(),i),a.pos=n+r.matchLength,r.value},z.prototype.eval=function(e){let{inputStream:t}=e,n=t.pos,r=t.nextCodePoint();if(r!==void 0&&r<=1114111){let t=String.fromCodePoint(r);if(this.pattern.test(t))return e.pushBinding(new K(t.length),n),!0}return e.processFailure(n,this),!1},x.prototype.getArity=g(`getArity`),S.getArity=C.getArity=w.prototype.getArity=T.prototype.getArity=E.prototype.getArity=R.prototype.getArity=z.prototype.getArity=function(){return 1},D.prototype.getArity=function(){return this.terms.length===0?0:this.terms[0].getArity()},A.prototype.getArity=function(){let e=0;for(let t=0;t<this.factors.length;t++)e+=this.factors[t].getArity();return e},j.prototype.getArity=function(){return this.expr.getArity()},F.prototype.getArity=function(){return 0},I.prototype.getArity=L.prototype.getArity=function(){return this.expr.getArity()};function q(e,t){let n={};if(e.source&&t){let r=e.source.relativeTo(t);n.sourceInterval=[r.startIdx,r.endIdx]}return n}x.prototype.outputRecipe=g(`outputRecipe`),S.outputRecipe=function(e,t){return[`any`,q(this,t)]},C.outputRecipe=function(e,t){return[`end`,q(this,t)]},w.prototype.outputRecipe=function(e,t){return[`terminal`,q(this,t),this.obj]},T.prototype.outputRecipe=function(e,t){return[`range`,q(this,t),this.from,this.to]},E.prototype.outputRecipe=function(e,t){return[`param`,q(this,t),this.index]},D.prototype.outputRecipe=function(e,t){return[`alt`,q(this,t)].concat(this.terms.map(n=>n.outputRecipe(e,t)))},O.prototype.outputRecipe=function(e,t){return this.terms[0].outputRecipe(e,t)},k.prototype.outputRecipe=function(e,t){let n=this.terms.slice(0,this.expansionPos),r=this.terms.slice(this.expansionPos+1);return[`splice`,q(this,t),n.map(n=>n.outputRecipe(e,t)),r.map(n=>n.outputRecipe(e,t))]},A.prototype.outputRecipe=function(e,t){return[`seq`,q(this,t)].concat(this.factors.map(n=>n.outputRecipe(e,t)))},M.prototype.outputRecipe=N.prototype.outputRecipe=P.prototype.outputRecipe=F.prototype.outputRecipe=I.prototype.outputRecipe=L.prototype.outputRecipe=function(e,t){return[this.constructor.name.toLowerCase(),q(this,t),this.expr.outputRecipe(e,t)]},R.prototype.outputRecipe=function(e,t){return[`app`,q(this,t),this.ruleName,this.args.map(n=>n.outputRecipe(e,t))]},z.prototype.outputRecipe=function(e,t){return[`unicodeChar`,q(this,t),this.categoryOrProp]},x.prototype.introduceParams=g(`introduceParams`),S.introduceParams=C.introduceParams=w.prototype.introduceParams=T.prototype.introduceParams=E.prototype.introduceParams=z.prototype.introduceParams=function(e){return this},D.prototype.introduceParams=function(e){return this.terms.forEach((t,n,r)=>{r[n]=t.introduceParams(e)}),this},A.prototype.introduceParams=function(e){return this.factors.forEach((t,n,r)=>{r[n]=t.introduceParams(e)}),this},j.prototype.introduceParams=F.prototype.introduceParams=I.prototype.introduceParams=L.prototype.introduceParams=function(e){return this.expr=this.expr.introduceParams(e),this},R.prototype.introduceParams=function(e){let t=e.indexOf(this.ruleName);if(t>=0){if(this.args.length>0)throw Error(`Parameterized rules cannot be passed as arguments to another rule.`);return new E(t).withSource(this.source)}else return this.args.forEach((t,n,r)=>{r[n]=t.introduceParams(e)}),this},x.prototype.isNullable=function(e){return this._isNullable(e,Object.create(null))},x.prototype._isNullable=g(`_isNullable`),S._isNullable=T.prototype._isNullable=E.prototype._isNullable=N.prototype._isNullable=z.prototype._isNullable=function(e,t){return!1},C._isNullable=function(e,t){return!0},w.prototype._isNullable=function(e,t){return typeof this.obj==`string`?this.obj===``:!1},D.prototype._isNullable=function(e,t){return this.terms.length===0||this.terms.some(n=>n._isNullable(e,t))},A.prototype._isNullable=function(e,t){return this.factors.every(n=>n._isNullable(e,t))},M.prototype._isNullable=P.prototype._isNullable=F.prototype._isNullable=I.prototype._isNullable=function(e,t){return!0},L.prototype._isNullable=function(e,t){return this.expr._isNullable(e,t)},R.prototype._isNullable=function(e,t){let n=this.toMemoKey();if(!Object.prototype.hasOwnProperty.call(t,n)){let{body:r}=e.rules[this.ruleName],i=r.substituteParams(this.args);t[n]=!1,t[n]=i._isNullable(e,t)}return t[n]},x.prototype.substituteParams=g(`substituteParams`),S.substituteParams=C.substituteParams=w.prototype.substituteParams=T.prototype.substituteParams=z.prototype.substituteParams=function(e){return this},E.prototype.substituteParams=function(e){return ge(e[this.index])},D.prototype.substituteParams=function(e){return new D(this.terms.map(t=>t.substituteParams(e)))},A.prototype.substituteParams=function(e){return new A(this.factors.map(t=>t.substituteParams(e)))},j.prototype.substituteParams=F.prototype.substituteParams=I.prototype.substituteParams=L.prototype.substituteParams=function(e){return new this.constructor(this.expr.substituteParams(e))},R.prototype.substituteParams=function(e){if(this.args.length===0)return this;{let t=this.args.map(t=>t.substituteParams(e));return new R(this.ruleName,t)}};function ht(e){return/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)}function gt(e){let t=Object.create(null);e.forEach(e=>{t[e]=(t[e]||0)+1}),Object.keys(t).forEach(n=>{if(t[n]<=1)return;let r=1;e.forEach((t,i)=>{t===n&&(e[i]=t+`_`+r++)})})}x.prototype.toArgumentNameList=g(`toArgumentNameList`),S.toArgumentNameList=function(e,t){return[`any`]},C.toArgumentNameList=function(e,t){return[`end`]},w.prototype.toArgumentNameList=function(e,t){return typeof this.obj==`string`&&/^[_a-zA-Z0-9]+$/.test(this.obj)?[`_`+this.obj]:[`$`+e]},T.prototype.toArgumentNameList=function(e,t){let n=this.from+`_to_`+this.to;return ht(n)||(n=`_`+n),ht(n)||(n=`$`+e),[n]},D.prototype.toArgumentNameList=function(e,t){let n=this.terms.map(t=>t.toArgumentNameList(e,!0)),r=[],i=n[0].length;for(let e=0;e<i;e++){let t=[];for(let r=0;r<this.terms.length;r++)t.push(n[r][e]);let i=ue(t);r.push(i.join(`_or_`))}return t||gt(r),r},A.prototype.toArgumentNameList=function(e,t){let n=[];return this.factors.forEach(t=>{let r=t.toArgumentNameList(e,!0);n=n.concat(r),e+=r.length}),t||gt(n),n},j.prototype.toArgumentNameList=function(e,t){let n=this.expr.toArgumentNameList(e,t).map(e=>e[e.length-1]===`s`?e+`es`:e+`s`);return t||gt(n),n},P.prototype.toArgumentNameList=function(e,t){return this.expr.toArgumentNameList(e,t).map(e=>`opt`+e[0].toUpperCase()+e.slice(1))},F.prototype.toArgumentNameList=function(e,t){return[]},I.prototype.toArgumentNameList=L.prototype.toArgumentNameList=function(e,t){return this.expr.toArgumentNameList(e,t)},R.prototype.toArgumentNameList=function(e,t){return[this.ruleName]},z.prototype.toArgumentNameList=function(e,t){return[`$`+e]},E.prototype.toArgumentNameList=function(e,t){return[`param`+this.index]},x.prototype.toDisplayString=g(`toDisplayString`),D.prototype.toDisplayString=A.prototype.toDisplayString=function(){return this.source?this.source.trimmed().contents:`[`+this.constructor.name+`]`},S.toDisplayString=C.toDisplayString=j.prototype.toDisplayString=F.prototype.toDisplayString=I.prototype.toDisplayString=L.prototype.toDisplayString=w.prototype.toDisplayString=T.prototype.toDisplayString=E.prototype.toDisplayString=function(){return this.toString()},R.prototype.toDisplayString=function(){if(this.args.length>0){let e=this.args.map(e=>e.toDisplayString());return this.ruleName+`<`+e.join(`,`)+`>`}else return this.ruleName},z.prototype.toDisplayString=function(){return`Unicode [`+this.categoryOrProp+`] character`};function _t(e){return e===`description`||e===`string`||e===`code`}var J=class e{constructor(e,t,n){if(!_t(n))throw Error(`invalid Failure type: `+n);this.pexpr=e,this.text=t,this.type=n,this.fluffy=!1}getPExpr(){return this.pexpr}getText(){return this.text}getType(){return this.type}isDescription(){return this.type===`description`}isStringTerminal(){return this.type===`string`}isCode(){return this.type===`code`}isFluffy(){return this.fluffy}makeFluffy(){this.fluffy=!0}clearFluffy(){this.fluffy=!1}subsumes(e){return this.getText()===e.getText()&&this.type===e.type&&(!this.isFluffy()||this.isFluffy()&&e.isFluffy())}toString(){return this.type===`string`?JSON.stringify(this.getText()):this.getText()}clone(){let t=new e(this.pexpr,this.text,this.type);return this.isFluffy()&&t.makeFluffy(),t}toKey(){return this.toString()+`#`+this.type}};x.prototype.toFailure=g(`toFailure`),S.toFailure=function(e){return new J(this,`any object`,`description`)},C.toFailure=function(e){return new J(this,`end of input`,`description`)},w.prototype.toFailure=function(e){return new J(this,this.obj,`string`)},T.prototype.toFailure=function(e){return new J(this,JSON.stringify(this.from)+`..`+JSON.stringify(this.to),`code`)},F.prototype.toFailure=function(e){let t=this.expr===S?`nothing`:`not `+this.expr.toFailure(e);return new J(this,t,`description`)},I.prototype.toFailure=function(e){return this.expr.toFailure(e)},R.prototype.toFailure=function(e){let{description:t}=e.rules[this.ruleName];return t||=(/^[aeiouAEIOU]/.test(this.ruleName)?`an`:`a`)+` `+this.ruleName,new J(this,t,`description`)},z.prototype.toFailure=function(e){return new J(this,`a Unicode [`+this.categoryOrProp+`] character`,`description`)},D.prototype.toFailure=function(e){let t=`(`+this.terms.map(t=>t.toFailure(e)).join(` or `)+`)`;return new J(this,t,`description`)},A.prototype.toFailure=function(e){let t=`(`+this.factors.map(t=>t.toFailure(e)).join(` `)+`)`;return new J(this,t,`description`)},j.prototype.toFailure=function(e){let t=`(`+this.expr.toFailure(e)+this.operator+`)`;return new J(this,t,`description`)},x.prototype.toString=g(`toString`),S.toString=function(){return`any`},C.toString=function(){return`end`},w.prototype.toString=function(){return JSON.stringify(this.obj)},T.prototype.toString=function(){return JSON.stringify(this.from)+`..`+JSON.stringify(this.to)},E.prototype.toString=function(){return`$`+this.index},L.prototype.toString=function(){return`#(`+this.expr.toString()+`)`},D.prototype.toString=function(){return this.terms.length===1?this.terms[0].toString():`(`+this.terms.map(e=>e.toString()).join(` | `)+`)`},A.prototype.toString=function(){return this.factors.length===1?this.factors[0].toString():`(`+this.factors.map(e=>e.toString()).join(` `)+`)`},j.prototype.toString=function(){return this.expr+this.operator},F.prototype.toString=function(){return`~`+this.expr},I.prototype.toString=function(){return`&`+this.expr},R.prototype.toString=function(){if(this.args.length>0){let e=this.args.map(e=>e.toString());return this.ruleName+`<`+e.join(`,`)+`>`}else return this.ruleName},z.prototype.toString=function(){return`\\p{`+this.categoryOrProp+`}`};var vt=class e extends x{constructor(e){super(),this.obj=e}_getString(e){let t=e.currentApplication().args[this.obj.index];return _(t instanceof w,`expected a Terminal expression`),t.obj}allowsSkippingPrecedingSpace(){return!0}eval(e){let{inputStream:t}=e,n=t.pos,r=this._getString(e);return t.matchString(r,!0)?(e.pushBinding(new K(r.length),n),!0):(e.processFailure(n,this),!1)}getArity(){return 1}substituteParams(t){return new e(this.obj.substituteParams(t))}toDisplayString(){return this.obj.toDisplayString()+` (case-insensitive)`}toFailure(e){return new J(this,this.obj.toFailure(e)+` (case-insensitive)`,`description`)}_isNullable(e,t){return this.obj._isNullable(e,t)}},yt;Je(e=>{yt=e.rules.applySyntactic.body});var bt=new R(`spaces`),xt=class{constructor(e,t,n){this.matcher=e,this.startExpr=t,this.grammar=e.grammar,this.input=e.getInput(),this.inputStream=new H(this.input),this.memoTable=e._memoTable,this.userData=void 0,this.doNotMemoize=!1,this._bindings=[],this._bindingOffsets=[],this._applicationStack=[],this._posStack=[0],this.inLexifiedContextStack=[!1],this.rightmostFailurePosition=-1,this._rightmostFailurePositionStack=[],this._recordedFailuresStack=[],n!==void 0&&(this.positionToRecordFailures=n,this.recordedFailures=Object.create(null))}posToOffset(e){return e-this._posStack[this._posStack.length-1]}enterApplication(e,t){this._posStack.push(this.inputStream.pos),this._applicationStack.push(t),this.inLexifiedContextStack.push(!1),e.enter(t),this._rightmostFailurePositionStack.push(this.rightmostFailurePosition),this.rightmostFailurePosition=-1}exitApplication(e,t){let n=this._posStack.pop();this._applicationStack.pop(),this.inLexifiedContextStack.pop(),e.exit(),this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,this._rightmostFailurePositionStack.pop()),t&&this.pushBinding(t,n)}enterLexifiedContext(){this.inLexifiedContextStack.push(!0)}exitLexifiedContext(){this.inLexifiedContextStack.pop()}currentApplication(){return this._applicationStack[this._applicationStack.length-1]}inSyntacticContext(){let e=this.currentApplication();return e?e.isSyntactic()&&!this.inLexifiedContext():this.startExpr.factors[0].isSyntactic()}inLexifiedContext(){return this.inLexifiedContextStack[this.inLexifiedContextStack.length-1]}skipSpaces(){return this.pushFailuresInfo(),this.eval(bt),this.popBinding(),this.popFailuresInfo(),this.inputStream.pos}skipSpacesIfInSyntacticContext(){return this.inSyntacticContext()?this.skipSpaces():this.inputStream.pos}maybeSkipSpacesBefore(e){return e.allowsSkippingPrecedingSpace()&&e!==bt?this.skipSpacesIfInSyntacticContext():this.inputStream.pos}pushBinding(e,t){this._bindings.push(e),this._bindingOffsets.push(this.posToOffset(t))}popBinding(){this._bindings.pop(),this._bindingOffsets.pop()}numBindings(){return this._bindings.length}truncateBindings(e){for(;this._bindings.length>e;)this.popBinding()}getCurrentPosInfo(){return this.getPosInfo(this.inputStream.pos)}getPosInfo(e){let t=this.memoTable[e];return t||=this.memoTable[e]=new tt,t}processFailure(e,t){if(this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,e),this.recordedFailures&&e===this.positionToRecordFailures){let e=this.currentApplication();e&&(t=t.substituteParams(e.args)),this.recordFailure(t.toFailure(this.grammar),!1)}}recordFailure(e,t){let n=e.toKey();this.recordedFailures[n]?this.recordedFailures[n].isFluffy()&&!e.isFluffy()&&this.recordedFailures[n].clearFluffy():this.recordedFailures[n]=t?e.clone():e}recordFailures(e,t){Object.keys(e).forEach(n=>{this.recordFailure(e[n],t)})}cloneRecordedFailures(){if(!this.recordedFailures)return;let e=Object.create(null);return Object.keys(this.recordedFailures).forEach(t=>{e[t]=this.recordedFailures[t].clone()}),e}getRightmostFailurePosition(){return this.rightmostFailurePosition}_getRightmostFailureOffset(){return this.rightmostFailurePosition>=0?this.posToOffset(this.rightmostFailurePosition):-1}getMemoizedTraceEntry(e,t){let n=this.memoTable[e];if(n&&t instanceof R){let e=n.memo[t.toMemoKey()];if(e&&e.traceEntry){let n=e.traceEntry.cloneWithExpr(t);return n.isMemoized=!0,n}}return null}getTraceEntry(e,t,n,r){if(t instanceof R){let e=this.currentApplication(),n=e?e.args:[];t=t.substituteParams(n)}return this.getMemoizedTraceEntry(e,t)||new U(this.input,e,this.inputStream.pos,t,n,r,this.trace)}isTracing(){return!!this.trace}hasNecessaryInfo(e){return this.trace&&!e.traceEntry?!1:this.recordedFailures&&this.inputStream.pos+e.rightmostFailureOffset===this.positionToRecordFailures?!!e.failuresAtRightmostPosition:!0}useMemoizedResult(e,t){this.trace&&this.trace.push(t.traceEntry);let n=this.inputStream.pos+t.rightmostFailureOffset;return this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,n),this.recordedFailures&&this.positionToRecordFailures===n&&t.failuresAtRightmostPosition&&this.recordFailures(t.failuresAtRightmostPosition,!0),this.inputStream.examinedLength=Math.max(this.inputStream.examinedLength,t.examinedLength+e),t.value?(this.inputStream.pos+=t.matchLength,this.pushBinding(t.value,e),!0):!1}eval(e){let{inputStream:t}=this,n=this._bindings.length,r=this.userData,i;this.recordedFailures&&=(i=this.recordedFailures,Object.create(null));let a=t.pos,o=this.maybeSkipSpacesBefore(e),s;this.trace&&=(s=this.trace,[]);let c=e.eval(this);if(this.trace){let t=this._bindings.slice(n),r=this.getTraceEntry(o,e,c,t);r.isImplicitSpaces=e===bt,r.isRootNode=e===this.startExpr,s.push(r),this.trace=s}return c?this.recordedFailures&&t.pos===this.positionToRecordFailures&&Object.keys(this.recordedFailures).forEach(e=>{this.recordedFailures[e].makeFluffy()}):(t.pos=a,this.truncateBindings(n),this.userData=r),this.recordedFailures&&this.recordFailures(i,!1),e===yt&&this.skipSpaces(),c}getMatchResult(){this.grammar._setUpMatchState(this),this.eval(this.startExpr);let e;this.recordedFailures&&(e=Object.keys(this.recordedFailures).map(e=>this.recordedFailures[e]));let t=this._bindings[0];return t&&(t.grammar=this.grammar),new et(this.matcher,this.input,this.startExpr,t,this._bindingOffsets[0],this.rightmostFailurePosition,e)}getTrace(){this.trace=[];let e=this.getMatchResult(),t=this.trace[this.trace.length-1];return t.result=e,t}pushFailuresInfo(){this._rightmostFailurePositionStack.push(this.rightmostFailurePosition),this._recordedFailuresStack.push(this.recordedFailures)}popFailuresInfo(){this.rightmostFailurePosition=this._rightmostFailurePositionStack.pop(),this.recordedFailures=this._recordedFailuresStack.pop()}},St=class{constructor(e){this.grammar=e,this._memoTable=[],this._input=``,this._isMemoTableStale=!1}_resetMemoTable(){this._memoTable=[],this._isMemoTableStale=!1}getInput(){return this._input}setInput(e){return this._input!==e&&this.replaceInputRange(0,this._input.length,e),this}replaceInputRange(e,t,n){let r=this._input,i=this._memoTable;if(e<0||e>r.length||t<0||t>r.length||e>t)throw Error(`Invalid indices: `+e+` and `+t);this._input=r.slice(0,e)+n+r.slice(t),this._input!==r&&i.length>0&&(this._isMemoTableStale=!0);let a=i.slice(t);i.length=e;for(let e=0;e<n.length;e++)i.push(void 0);for(let e of a)i.push(e);for(let t=0;t<e;t++){let n=i[t];n&&n.clearObsoleteEntries(t,e)}return this}match(e,t={incremental:!0}){return this._match(this._getStartExpr(e),{incremental:t.incremental,tracing:!1})}trace(e,t={incremental:!0}){return this._match(this._getStartExpr(e),{incremental:t.incremental,tracing:!0})}_match(e,t={}){let n={tracing:!1,incremental:!0,positionToRecordFailures:void 0,...t};if(!n.incremental)this._resetMemoTable();else if(this._isMemoTableStale&&!this.grammar.supportsIncrementalParsing)throw we(this.grammar);let r=new xt(this,e,n.positionToRecordFailures);return n.tracing?r.getTrace():r.getMatchResult()}_getStartExpr(e){let t=e||this.grammar.defaultStartRule;if(!t)throw Error(`Missing start rule argument -- the grammar has no default start rule.`);return new A([this.grammar.parseApplication(t),C])}},Y=[],Ct=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),wt=class{constructor(e,t,n){this._node=e,this.source=t,this._baseInterval=n,e.isNonterminal()&&_(t===n),this._childWrappers=[]}_forgetMemoizedResultFor(e){delete this._node[this._semantics.attributeKeys[e]],this.children.forEach(t=>{t._forgetMemoizedResultFor(e)})}child(e){if(!(0<=e&&e<this._node.numChildren()))return;let t=this._childWrappers[e];if(!t){let n=this._node.childAt(e),r=this._node.childOffsets[e],i=this._baseInterval.subInterval(r,n.matchLength),a=n.isNonterminal()?i:this._baseInterval;t=this._childWrappers[e]=this._semantics.wrap(n,i,a)}return t}_children(){for(let e=0;e<this._node.numChildren();e++)this.child(e);return this._childWrappers}isIteration(){return this._node.isIteration()}isTerminal(){return this._node.isTerminal()}isNonterminal(){return this._node.isNonterminal()}isSyntactic(){return this.isNonterminal()&&this._node.isSyntactic()}isLexical(){return this.isNonterminal()&&this._node.isLexical()}isOptional(){return this._node.isOptional()}iteration(e){let t=e||[],n=new mt(t.map(e=>e._node),[],-1,!1),r=this._semantics.wrap(n,null,null);return r._childWrappers=t,r}get children(){return this._children()}get ctorName(){return this._node.ctorName}get numChildren(){return this._node.numChildren()}get sourceString(){return this.source.contents}},X=class e{constructor(e,t){let n=this;if(this.grammar=e,this.checkedActionDicts=!1,this.Wrapper=class extends (t?t.Wrapper:wt){constructor(e,t,r){super(e,t,r),n.checkActionDictsIfHaventAlready(),this._semantics=n}toString(){return`[semantics wrapper for `+n.grammar.name+`]`}},this.super=t,t){if(!(e.equals(this.super.grammar)||e._inheritsFrom(this.super.grammar)))throw Error(`Cannot extend a semantics for grammar '`+this.super.grammar.name+`' for use with grammar '`+e.name+`' (not a sub-grammar)`);this.operations=Object.create(this.super.operations),this.attributes=Object.create(this.super.attributes),this.attributeKeys=Object.create(null);for(let e in this.attributes)Object.defineProperty(this.attributeKeys,e,{value:Qe(e)})}else this.operations=Object.create(null),this.attributes=Object.create(null),this.attributeKeys=Object.create(null)}toString(){return`[semantics for `+this.grammar.name+`]`}checkActionDictsIfHaventAlready(){this.checkedActionDicts||=(this.checkActionDicts(),!0)}checkActionDicts(){let e;for(e in this.operations)this.operations[e].checkActionDict(this.grammar);for(e in this.attributes)this.attributes[e].checkActionDict(this.grammar)}toRecipe(t){function n(t){return t.super!==e.BuiltInSemantics._getSemantics()}let r=`(function(g) {
20
- `;if(n(this)){r+=` var semantics = `+this.super.toRecipe(!0)+`(g`;let e=this.super.grammar,t=this.grammar;for(;t!==e;)r+=`.superGrammar`,t=t.superGrammar;r+=`);
21
- `,r+=` return g.extendSemantics(semantics)`}else r+=` return g.createSemantics()`;return[`Operation`,`Attribute`].forEach(e=>{let t=this[e.toLowerCase()+`s`];Object.keys(t).forEach(i=>{let{actionDict:a,formals:o,builtInDefault:s}=t[i],c=i;o.length>0&&(c+=`(`+o.join(`, `)+`)`);let l;l=n(this)&&this.super[e.toLowerCase()+`s`][i]?`extend`+e:`add`+e,r+=`
22
- .`+l+`(`+JSON.stringify(c)+`, {`;let u=[];Object.keys(a).forEach(e=>{if(a[e]!==s){let t=a[e].toString().trim();t=t.replace(/^.*\(/,`function(`),u.push(`
23
- `+JSON.stringify(e)+`: `+t)}}),r+=u.join(`,`)+`
24
- })`})}),r+=`;
25
- })`,t||(r=`(function() {
26
- var grammar = this.fromRecipe(`+this.grammar.toRecipe()+`);
27
- var semantics = `+r+`(grammar);
28
- return semantics;
29
- });
30
- `),r}addOperationOrAttribute(e,t,n){let r=e+`s`,i=Tt(t,e),{name:a}=i,{formals:o}=i;this.assertNewName(a,e);let s=Et(e,a,u),c={_default:s};Object.keys(n).forEach(e=>{c[e]=n[e]});let l=e===`operation`?new Z(a,o,c,s):new Dt(a,c,s);l.checkActionDict(this.grammar),this[r][a]=l;function u(...t){let n=this._semantics[r][a];if(arguments.length!==n.formals.length)throw Error(`Invalid number of arguments passed to `+a+` `+e+` (expected `+n.formals.length+`, got `+arguments.length+`)`);let i=Object.create(null);for(let[e,r]of Object.entries(t)){let t=n.formals[e];i[t]=r}let o=this.args;this.args=i;let s=n.execute(this._semantics,this);return this.args=o,s}e===`operation`?(this.Wrapper.prototype[a]=u,this.Wrapper.prototype[a].toString=function(){return`[`+a+` operation]`}):(Object.defineProperty(this.Wrapper.prototype,a,{get:u,configurable:!0}),Object.defineProperty(this.attributeKeys,a,{value:Qe(a)}))}extendOperationOrAttribute(e,t,n){let r=e+`s`;if(Tt(t,`attribute`),!(this.super&&t in this.super[r]))throw Error(`Cannot extend `+e+` '`+t+`': did not inherit an `+e+` with that name`);if(Ct(this[r],t))throw Error(`Cannot extend `+e+` '`+t+`' again`);let i=this[r][t].formals,a=this[r][t].actionDict,o=Object.create(a);Object.keys(n).forEach(e=>{o[e]=n[e]}),this[r][t]=e===`operation`?new Z(t,i,o):new Dt(t,o),this[r][t].checkActionDict(this.grammar)}assertNewName(e,t){if(Ct(wt.prototype,e))throw Error(`Cannot add `+t+` '`+e+`': that's a reserved name`);if(e in this.operations)throw Error(`Cannot add `+t+` '`+e+`': an operation with that name already exists`);if(e in this.attributes)throw Error(`Cannot add `+t+` '`+e+`': an attribute with that name already exists`)}wrap(e,t,n){let r=n||t;return e instanceof this.Wrapper?e:new this.Wrapper(e,t,r)}};function Tt(e,t){if(!X.prototypeGrammar)return _(e.indexOf(`(`)===-1),{name:e,formals:[]};let n=X.prototypeGrammar.match(e,t===`operation`?`OperationSignature`:`AttributeSignature`);if(n.failed())throw Error(n.message);return X.prototypeGrammarSemantics(n).parse()}function Et(e,t,n){return function(...r){let i=(this._semantics.operations[t]||this._semantics.attributes[t]).formals.map(e=>this.args[e]);if(!this.isIteration()&&r.length===1)return n.apply(r[0],i);throw He(this.ctorName,t,e,Y)}}X.createSemantics=function(e,t){let n=new X(e,t===void 0?X.BuiltInSemantics._getSemantics():t),r=function(t){if(!(t instanceof et))throw TypeError(`Semantics expected a MatchResult, but got `+he(t));if(t.failed())throw TypeError(`cannot apply Semantics to `+t.toString());let r=t._cst;if(r.grammar!==e)throw Error(`Cannot use a MatchResult from grammar '`+r.grammar.name+`' with a semantics for '`+e.name+`'`);let i=new H(t.input);return n.wrap(r,i.interval(t._cstOffset,t.input.length))};return r.addOperation=function(e,t){return n.addOperationOrAttribute(`operation`,e,t),r},r.extendOperation=function(e,t){return n.extendOperationOrAttribute(`operation`,e,t),r},r.addAttribute=function(e,t){return n.addOperationOrAttribute(`attribute`,e,t),r},r.extendAttribute=function(e,t){return n.extendOperationOrAttribute(`attribute`,e,t),r},r._getActionDict=function(t){let r=n.operations[t]||n.attributes[t];if(!r)throw Error(`"`+t+`" is not a valid operation or attribute name in this semantics for "`+e.name+`"`);return r.actionDict},r._remove=function(e){let t;return e in n.operations?(t=n.operations[e],delete n.operations[e]):e in n.attributes&&(t=n.attributes[e],delete n.attributes[e]),delete n.Wrapper.prototype[e],t},r.getOperationNames=function(){return Object.keys(n.operations)},r.getAttributeNames=function(){return Object.keys(n.attributes)},r.getGrammar=function(){return n.grammar},r.toRecipe=function(e){return n.toRecipe(e)},r.toString=n.toString.bind(n),r._getSemantics=function(){return n},r};var Z=class{constructor(e,t,n,r){this.name=e,this.formals=t,this.actionDict=n,this.builtInDefault=r}checkActionDict(e){e._checkTopDownActionDict(this.typeName,this.name,this.actionDict)}execute(e,t){try{let{ctorName:e}=t._node,n=this.actionDict[e];return n?(Y.push([this,e]),n.apply(t,t._children())):t.isNonterminal()&&(n=this.actionDict._nonterminal,n)?(Y.push([this,`_nonterminal`,e]),n.apply(t,t._children())):(Y.push([this,`default action`,e]),this.actionDict._default.apply(t,t._children()))}finally{Y.pop()}}};Z.prototype.typeName=`operation`;var Dt=class extends Z{constructor(e,t,n){super(e,[],t,n)}execute(e,t){let n=t._node,r=e.attributeKeys[this.name];return Ct(n,r)||(n[r]=Z.prototype.execute.call(this,e,t)),n[r]}};Dt.prototype.typeName=`attribute`;var Ot=[`_iter`,`_terminal`,`_nonterminal`,`_default`];function kt(e){return Object.keys(e.rules).sort().map(t=>e.rules[t])}var At=e=>e.replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`),jt,Mt,Q=class e{constructor(e,t,n,r){if(this.name=e,this.superGrammar=t,this.rules=n,r){if(!(r in n))throw Error(`Invalid start rule: '`+r+`' is not a rule in grammar '`+e+`'`);this.defaultStartRule=r}this._matchStateInitializer=void 0,this.supportsIncrementalParsing=!0}matcher(){return new St(this)}isBuiltIn(){return this===e.ProtoBuiltInRules||this===e.BuiltInRules}equals(e){if(this===e)return!0;if(e==null||this.name!==e.name||this.defaultStartRule!==e.defaultStartRule||!(this.superGrammar===e.superGrammar||this.superGrammar.equals(e.superGrammar)))return!1;let t=kt(this),n=kt(e);return t.length===n.length&&t.every((e,t)=>e.description===n[t].description&&e.formals.join(`,`)===n[t].formals.join(`,`)&&e.body.toString()===n[t].body.toString())}match(e,t){let n=this.matcher();return n.replaceInputRange(0,0,e),n.match(t)}trace(e,t){let n=this.matcher();return n.replaceInputRange(0,0,e),n.trace(t)}createSemantics(){return X.createSemantics(this)}extendSemantics(e){return X.createSemantics(this,e._getSemantics())}_checkTopDownActionDict(e,t,n){let r=[];for(let e in n){let t=n[e];if(!Ot.includes(e)&&!(e in this.rules)){r.push(`'${e}' is not a valid semantic action for '${this.name}'`);continue}if(typeof t!=`function`){r.push(`'${e}' must be a function in an action dictionary for '${this.name}'`);continue}let i=t.length,a=this._topDownActionArity(e);if(i!==a){let t;t=e===`_iter`||e===`_nonterminal`?`it should use a rest parameter, e.g. \`${e}(...children) {}\`. NOTE: this is new in Ohm v16 — see https://ohmjs.org/d/ati for details.`:`expected ${a}, got ${i}`,r.push(`Semantic action '${e}' has the wrong arity: ${t}`)}}if(r.length>0){let n=r.map(e=>`- `+e),i=Error([`Found errors in the action dictionary of the '${t}' ${e}:`,...n].join(`
31
- `));throw i.problems=r,i}}_topDownActionArity(e){return Ot.includes(e)?0:this.rules[e].body.getArity()}_inheritsFrom(e){let t=this.superGrammar;for(;t;){if(t.equals(e,!0))return!0;t=t.superGrammar}return!1}toRecipe(e=void 0){let t={};this.source&&(t.source=this.source.contents);let n=null;this.defaultStartRule&&(n=this.defaultStartRule);let r={};Object.keys(this.rules).forEach(e=>{let t=this.rules[e],{body:n}=t,i=!this.superGrammar||!this.superGrammar.rules[e],a;a=i?`define`:n instanceof O?`extend`:`override`;let o={};if(t.source&&this.source){let e=t.source.relativeTo(this.source);o.sourceInterval=[e.startIdx,e.endIdx]}let s=i?t.description:null,c=n.outputRecipe(t.formals,this.source);r[e]=[a,o,s,t.formals,c]});let i=`null`;return e?i=e:this.superGrammar&&!this.superGrammar.isBuiltIn()&&(i=this.superGrammar.toRecipe()),At(`[${[...[`grammar`,t,this.name].map(JSON.stringify),i,...[n,r].map(JSON.stringify)].join(`,`)}]`)}toOperationActionDictionaryTemplate(){return this._toOperationOrAttributeActionDictionaryTemplate()}toAttributeActionDictionaryTemplate(){return this._toOperationOrAttributeActionDictionaryTemplate()}_toOperationOrAttributeActionDictionaryTemplate(){let e=new b;e.append(`{`);let t=!0;for(let n in this.rules){let{body:r}=this.rules[n];t?t=!1:e.append(`,`),e.append(`
32
- `),e.append(` `),this.addSemanticActionTemplate(n,r,e)}return e.append(`
33
- }`),e.contents()}addSemanticActionTemplate(e,t,n){n.append(e),n.append(`: function(`);let r=this._topDownActionArity(e);n.append(v(`_`,r).join(`, `)),n.append(`) {
34
- `),n.append(` }`)}parseApplication(e){let t;if(e.indexOf(`<`)===-1)t=new R(e);else{let n=jt.match(e,`Base_application`);t=Mt(n,{})}if(!(t.ruleName in this.rules))throw Te(t.ruleName,this.name);let{formals:n}=this.rules[t.ruleName];if(n.length!==t.args.length){let{source:e}=this.rules[t.ruleName];throw ke(t.ruleName,n.length,t.args.length,e)}return t}_setUpMatchState(e){this._matchStateInitializer&&this._matchStateInitializer(e)}};Q.ProtoBuiltInRules=new Q(`ProtoBuiltInRules`,void 0,{any:{body:S,formals:[],description:`any character`,primitive:!0},end:{body:C,formals:[],description:`end of input`,primitive:!0},caseInsensitive:{body:new vt(new E(0)),formals:[`str`],primitive:!0},lower:{body:new z(`Ll`),formals:[],description:`a lowercase letter`,primitive:!0},upper:{body:new z(`Lu`),formals:[],description:`an uppercase letter`,primitive:!0},unicodeLtmo:{body:new z(`Ltmo`),formals:[],description:`a Unicode character in Lt, Lm, or Lo`,primitive:!0},spaces:{body:new M(new R(`space`)),formals:[]},space:{body:new T(`\0`,` `),formals:[],description:`a space`}}),Q.initApplicationParser=function(e,t){jt=e,Mt=t};var Nt=class{constructor(e){this.name=e}sourceInterval(e,t){return this.source.subInterval(e,t-e)}ensureSuperGrammar(){return this.superGrammar||this.withSuperGrammar(this.name===`BuiltInRules`?Q.ProtoBuiltInRules:Q.BuiltInRules),this.superGrammar}ensureSuperGrammarRuleForOverriding(e,t){let n=this.ensureSuperGrammar().rules[e];if(!n)throw Ee(e,this.superGrammar.name,t);return n}installOverriddenOrExtendedRule(e,t,n,r){let i=le(t);if(i.length>0)throw je(e,i,r);let a=this.ensureSuperGrammar().rules[e],o=a.formals,s=o?o.length:0;if(t.length!==s)throw ke(e,s,t.length,r);return this.install(e,t,n,a.description,r)}install(e,t,n,r,i,a=!1){return this.rules[e]={body:n.introduceParams(t),formals:t,description:r,source:i,primitive:a},this}withSuperGrammar(e){if(this.superGrammar)throw Error(`the super grammar of a GrammarDecl cannot be set more than once`);return this.superGrammar=e,this.rules=Object.create(e.rules),e.isBuiltIn()||(this.defaultStartRule=e.defaultStartRule),this}withDefaultStartRule(e){return this.defaultStartRule=e,this}withSource(e){return this.source=new H(e).interval(0,e.length),this}build(){let e=new Q(this.name,this.ensureSuperGrammar(),this.rules,this.defaultStartRule);e._matchStateInitializer=e.superGrammar._matchStateInitializer,e.supportsIncrementalParsing=e.superGrammar.supportsIncrementalParsing;let t=[],n=!1;return Object.keys(e.rules).forEach(r=>{let{body:i}=e.rules[r];try{i.assertChoicesHaveUniformArity(r)}catch(e){t.push(e)}try{i.assertAllApplicationsAreValid(r,e)}catch(e){t.push(e),n=!0}}),n||Object.keys(e.rules).forEach(n=>{let{body:r}=e.rules[n];try{r.assertIteratedExprsAreNotNullable(e,[])}catch(e){t.push(e)}}),t.length>0&&Ue(t),this.source&&(e.source=this.source),e}define(e,t,n,r,i,a){if(this.ensureSuperGrammar(),this.superGrammar.rules[e])throw Oe(e,this.name,this.superGrammar.name,i);if(this.rules[e])throw Oe(e,this.name,this.name,i);let o=le(t);if(o.length>0)throw je(e,o,i);return this.install(e,t,n,r,i,a)}override(e,t,n,r,i){return this.ensureSuperGrammarRuleForOverriding(e,i),this.installOverriddenOrExtendedRule(e,t,n,i),this}extend(e,t,n,r,i){if(!this.ensureSuperGrammar().rules[e])throw De(e,this.superGrammar.name,i);let a=new O(this.superGrammar,e,n);return a.source=n.source,this.installOverriddenOrExtendedRule(e,t,a,i),this}},$=class{constructor(e){this.currentDecl=null,this.currentRuleName=null,this.options=e||{}}newGrammar(e){return new Nt(e)}grammar(e,t,n,r,i){let a=new Nt(t);return n&&a.withSuperGrammar(n instanceof Q?n:this.fromRecipe(n)),r&&a.withDefaultStartRule(r),e&&e.source&&a.withSource(e.source),this.currentDecl=a,Object.keys(i).forEach(e=>{this.currentRuleName=e;let t=i[e],n=t[0],r=t[1],o=t[2],s=t[3],c=this.fromRecipe(t[4]),l;a.source&&r&&r.sourceInterval&&(l=a.source.subInterval(r.sourceInterval[0],r.sourceInterval[1]-r.sourceInterval[0])),a[n](e,s,c,o,l)}),this.currentRuleName=this.currentDecl=null,a.build()}terminal(e){return new w(e)}range(e,t){return new T(e,t)}param(e){return new E(e)}alt(...e){let t=[];for(let n of e)n instanceof x||(n=this.fromRecipe(n)),n instanceof D?t=t.concat(n.terms):t.push(n);return t.length===1?t[0]:new D(t)}seq(...e){let t=[];for(let n of e)n instanceof x||(n=this.fromRecipe(n)),n instanceof A?t=t.concat(n.factors):t.push(n);return t.length===1?t[0]:new A(t)}star(e){return e instanceof x||(e=this.fromRecipe(e)),new M(e)}plus(e){return e instanceof x||(e=this.fromRecipe(e)),new N(e)}opt(e){return e instanceof x||(e=this.fromRecipe(e)),new P(e)}not(e){return e instanceof x||(e=this.fromRecipe(e)),new F(e)}lookahead(e){return e instanceof x||(e=this.fromRecipe(e)),this.options.eliminateLookaheads?new F(new F(e)):new I(e)}lex(e){return e instanceof x||(e=this.fromRecipe(e)),new L(e)}app(e,t){return t&&t.length>0&&(t=t.map(function(e){return e instanceof x?e:this.fromRecipe(e)},this)),new R(e,t)}splice(e,t){return new k(this.currentDecl.superGrammar,this.currentRuleName,e.map(e=>this.fromRecipe(e)),t.map(e=>this.fromRecipe(e)))}fromRecipe(e){let t=e[0]===`grammar`?e.slice(1):e.slice(2),n=this[e[0]](...t),r=e[1];return r&&r.sourceInterval&&this.currentDecl&&n.withSource(this.currentDecl.sourceInterval(...r.sourceInterval)),n}};function Pt(e){return typeof e==`function`?e.call(new $):(typeof e==`string`&&(e=JSON.parse(e)),new $().fromRecipe(e))}var Ft=Pt([`grammar`,{source:`BuiltInRules {
35
-
36
- alnum (an alpha-numeric character)
37
- = letter
38
- | digit
39
-
40
- letter (a letter)
41
- = lower
42
- | upper
43
- | unicodeLtmo
44
-
45
- digit (a digit)
46
- = "0".."9"
47
-
48
- hexDigit (a hexadecimal digit)
49
- = digit
50
- | "a".."f"
51
- | "A".."F"
52
-
53
- ListOf<elem, sep>
54
- = NonemptyListOf<elem, sep>
55
- | EmptyListOf<elem, sep>
56
-
57
- NonemptyListOf<elem, sep>
58
- = elem (sep elem)*
59
-
60
- EmptyListOf<elem, sep>
61
- = /* nothing */
62
-
63
- listOf<elem, sep>
64
- = nonemptyListOf<elem, sep>
65
- | emptyListOf<elem, sep>
66
-
67
- nonemptyListOf<elem, sep>
68
- = elem (sep elem)*
69
-
70
- emptyListOf<elem, sep>
71
- = /* nothing */
72
-
73
- // Allows a syntactic rule application within a lexical context.
74
- applySyntactic<app> = app
75
- }`},`BuiltInRules`,null,null,{alnum:[`define`,{sourceInterval:[18,78]},`an alpha-numeric character`,[],[`alt`,{sourceInterval:[60,78]},[`app`,{sourceInterval:[60,66]},`letter`,[]],[`app`,{sourceInterval:[73,78]},`digit`,[]]]],letter:[`define`,{sourceInterval:[82,142]},`a letter`,[],[`alt`,{sourceInterval:[107,142]},[`app`,{sourceInterval:[107,112]},`lower`,[]],[`app`,{sourceInterval:[119,124]},`upper`,[]],[`app`,{sourceInterval:[131,142]},`unicodeLtmo`,[]]]],digit:[`define`,{sourceInterval:[146,177]},`a digit`,[],[`range`,{sourceInterval:[169,177]},`0`,`9`]],hexDigit:[`define`,{sourceInterval:[181,254]},`a hexadecimal digit`,[],[`alt`,{sourceInterval:[219,254]},[`app`,{sourceInterval:[219,224]},`digit`,[]],[`range`,{sourceInterval:[231,239]},`a`,`f`],[`range`,{sourceInterval:[246,254]},`A`,`F`]]],ListOf:[`define`,{sourceInterval:[258,336]},null,[`elem`,`sep`],[`alt`,{sourceInterval:[282,336]},[`app`,{sourceInterval:[282,307]},`NonemptyListOf`,[[`param`,{sourceInterval:[297,301]},0],[`param`,{sourceInterval:[303,306]},1]]],[`app`,{sourceInterval:[314,336]},`EmptyListOf`,[[`param`,{sourceInterval:[326,330]},0],[`param`,{sourceInterval:[332,335]},1]]]]],NonemptyListOf:[`define`,{sourceInterval:[340,388]},null,[`elem`,`sep`],[`seq`,{sourceInterval:[372,388]},[`param`,{sourceInterval:[372,376]},0],[`star`,{sourceInterval:[377,388]},[`seq`,{sourceInterval:[378,386]},[`param`,{sourceInterval:[378,381]},1],[`param`,{sourceInterval:[382,386]},0]]]]],EmptyListOf:[`define`,{sourceInterval:[392,434]},null,[`elem`,`sep`],[`seq`,{sourceInterval:[438,438]}]],listOf:[`define`,{sourceInterval:[438,516]},null,[`elem`,`sep`],[`alt`,{sourceInterval:[462,516]},[`app`,{sourceInterval:[462,487]},`nonemptyListOf`,[[`param`,{sourceInterval:[477,481]},0],[`param`,{sourceInterval:[483,486]},1]]],[`app`,{sourceInterval:[494,516]},`emptyListOf`,[[`param`,{sourceInterval:[506,510]},0],[`param`,{sourceInterval:[512,515]},1]]]]],nonemptyListOf:[`define`,{sourceInterval:[520,568]},null,[`elem`,`sep`],[`seq`,{sourceInterval:[552,568]},[`param`,{sourceInterval:[552,556]},0],[`star`,{sourceInterval:[557,568]},[`seq`,{sourceInterval:[558,566]},[`param`,{sourceInterval:[558,561]},1],[`param`,{sourceInterval:[562,566]},0]]]]],emptyListOf:[`define`,{sourceInterval:[572,682]},null,[`elem`,`sep`],[`seq`,{sourceInterval:[685,685]}]],applySyntactic:[`define`,{sourceInterval:[685,710]},null,[`app`],[`param`,{sourceInterval:[707,710]},0]]}]);Q.BuiltInRules=Ft,Ye(Q.BuiltInRules);var It=Pt([`grammar`,{source:`Ohm {
76
-
77
- Grammars
78
- = Grammar*
79
-
80
- Grammar
81
- = ident SuperGrammar? "{" Rule* "}"
82
-
83
- SuperGrammar
84
- = "<:" ident
85
-
86
- Rule
87
- = ident Formals? ruleDescr? "=" RuleBody -- define
88
- | ident Formals? ":=" OverrideRuleBody -- override
89
- | ident Formals? "+=" RuleBody -- extend
90
-
91
- RuleBody
92
- = "|"? NonemptyListOf<TopLevelTerm, "|">
93
-
94
- TopLevelTerm
95
- = Seq caseName -- inline
96
- | Seq
97
-
98
- OverrideRuleBody
99
- = "|"? NonemptyListOf<OverrideTopLevelTerm, "|">
100
-
101
- OverrideTopLevelTerm
102
- = "..." -- superSplice
103
- | TopLevelTerm
104
-
105
- Formals
106
- = "<" ListOf<ident, ","> ">"
107
-
108
- Params
109
- = "<" ListOf<Seq, ","> ">"
110
-
111
- Alt
112
- = NonemptyListOf<Seq, "|">
113
-
114
- Seq
115
- = Iter*
116
-
117
- Iter
118
- = Pred "*" -- star
119
- | Pred "+" -- plus
120
- | Pred "?" -- opt
121
- | Pred
122
-
123
- Pred
124
- = "~" Lex -- not
125
- | "&" Lex -- lookahead
126
- | Lex
127
-
128
- Lex
129
- = "#" Base -- lex
130
- | Base
131
-
132
- Base
133
- = ident Params? ~(ruleDescr? "=" | ":=" | "+=") -- application
134
- | oneCharTerminal ".." oneCharTerminal -- range
135
- | terminal -- terminal
136
- | "(" Alt ")" -- paren
137
-
138
- ruleDescr (a rule description)
139
- = "(" ruleDescrText ")"
140
-
141
- ruleDescrText
142
- = (~")" any)*
143
-
144
- caseName
145
- = "--" (~"\\n" space)* name (~"\\n" space)* ("\\n" | &"}")
146
-
147
- name (a name)
148
- = nameFirst nameRest*
149
-
150
- nameFirst
151
- = "_"
152
- | letter
153
-
154
- nameRest
155
- = "_"
156
- | alnum
157
-
158
- ident (an identifier)
159
- = name
160
-
161
- terminal
162
- = "\\"" terminalChar* "\\""
163
-
164
- oneCharTerminal
165
- = "\\"" terminalChar "\\""
166
-
167
- terminalChar
168
- = escapeChar
169
- | ~"\\\\" ~"\\"" ~"\\n" "\\u{0}".."\\u{10FFFF}"
170
-
171
- escapeChar (an escape sequence)
172
- = "\\\\\\\\" -- backslash
173
- | "\\\\\\"" -- doubleQuote
174
- | "\\\\\\'" -- singleQuote
175
- | "\\\\b" -- backspace
176
- | "\\\\n" -- lineFeed
177
- | "\\\\r" -- carriageReturn
178
- | "\\\\t" -- tab
179
- | "\\\\u{" hexDigit hexDigit? hexDigit?
180
- hexDigit? hexDigit? hexDigit? "}" -- unicodeCodePoint
181
- | "\\\\u" hexDigit hexDigit hexDigit hexDigit -- unicodeEscape
182
- | "\\\\x" hexDigit hexDigit -- hexEscape
183
-
184
- space
185
- += comment
186
-
187
- comment
188
- = "//" (~"\\n" any)* &("\\n" | end) -- singleLine
189
- | "/*" (~"*/" any)* "*/" -- multiLine
190
-
191
- tokens = token*
192
-
193
- token = caseName | comment | ident | operator | punctuation | terminal | any
194
-
195
- operator = "<:" | "=" | ":=" | "+=" | "*" | "+" | "?" | "~" | "&"
196
-
197
- punctuation = "<" | ">" | "," | "--"
198
- }`},`Ohm`,null,`Grammars`,{Grammars:[`define`,{sourceInterval:[9,32]},null,[],[`star`,{sourceInterval:[24,32]},[`app`,{sourceInterval:[24,31]},`Grammar`,[]]]],Grammar:[`define`,{sourceInterval:[36,83]},null,[],[`seq`,{sourceInterval:[50,83]},[`app`,{sourceInterval:[50,55]},`ident`,[]],[`opt`,{sourceInterval:[56,69]},[`app`,{sourceInterval:[56,68]},`SuperGrammar`,[]]],[`terminal`,{sourceInterval:[70,73]},`{`],[`star`,{sourceInterval:[74,79]},[`app`,{sourceInterval:[74,78]},`Rule`,[]]],[`terminal`,{sourceInterval:[80,83]},`}`]]],SuperGrammar:[`define`,{sourceInterval:[87,116]},null,[],[`seq`,{sourceInterval:[106,116]},[`terminal`,{sourceInterval:[106,110]},`<:`],[`app`,{sourceInterval:[111,116]},`ident`,[]]]],Rule_define:[`define`,{sourceInterval:[131,181]},null,[],[`seq`,{sourceInterval:[131,170]},[`app`,{sourceInterval:[131,136]},`ident`,[]],[`opt`,{sourceInterval:[137,145]},[`app`,{sourceInterval:[137,144]},`Formals`,[]]],[`opt`,{sourceInterval:[146,156]},[`app`,{sourceInterval:[146,155]},`ruleDescr`,[]]],[`terminal`,{sourceInterval:[157,160]},`=`],[`app`,{sourceInterval:[162,170]},`RuleBody`,[]]]],Rule_override:[`define`,{sourceInterval:[188,248]},null,[],[`seq`,{sourceInterval:[188,235]},[`app`,{sourceInterval:[188,193]},`ident`,[]],[`opt`,{sourceInterval:[194,202]},[`app`,{sourceInterval:[194,201]},`Formals`,[]]],[`terminal`,{sourceInterval:[214,218]},`:=`],[`app`,{sourceInterval:[219,235]},`OverrideRuleBody`,[]]]],Rule_extend:[`define`,{sourceInterval:[255,305]},null,[],[`seq`,{sourceInterval:[255,294]},[`app`,{sourceInterval:[255,260]},`ident`,[]],[`opt`,{sourceInterval:[261,269]},[`app`,{sourceInterval:[261,268]},`Formals`,[]]],[`terminal`,{sourceInterval:[281,285]},`+=`],[`app`,{sourceInterval:[286,294]},`RuleBody`,[]]]],Rule:[`define`,{sourceInterval:[120,305]},null,[],[`alt`,{sourceInterval:[131,305]},[`app`,{sourceInterval:[131,170]},`Rule_define`,[]],[`app`,{sourceInterval:[188,235]},`Rule_override`,[]],[`app`,{sourceInterval:[255,294]},`Rule_extend`,[]]]],RuleBody:[`define`,{sourceInterval:[309,362]},null,[],[`seq`,{sourceInterval:[324,362]},[`opt`,{sourceInterval:[324,328]},[`terminal`,{sourceInterval:[324,327]},`|`]],[`app`,{sourceInterval:[329,362]},`NonemptyListOf`,[[`app`,{sourceInterval:[344,356]},`TopLevelTerm`,[]],[`terminal`,{sourceInterval:[358,361]},`|`]]]]],TopLevelTerm_inline:[`define`,{sourceInterval:[385,408]},null,[],[`seq`,{sourceInterval:[385,397]},[`app`,{sourceInterval:[385,388]},`Seq`,[]],[`app`,{sourceInterval:[389,397]},`caseName`,[]]]],TopLevelTerm:[`define`,{sourceInterval:[366,418]},null,[],[`alt`,{sourceInterval:[385,418]},[`app`,{sourceInterval:[385,397]},`TopLevelTerm_inline`,[]],[`app`,{sourceInterval:[415,418]},`Seq`,[]]]],OverrideRuleBody:[`define`,{sourceInterval:[422,491]},null,[],[`seq`,{sourceInterval:[445,491]},[`opt`,{sourceInterval:[445,449]},[`terminal`,{sourceInterval:[445,448]},`|`]],[`app`,{sourceInterval:[450,491]},`NonemptyListOf`,[[`app`,{sourceInterval:[465,485]},`OverrideTopLevelTerm`,[]],[`terminal`,{sourceInterval:[487,490]},`|`]]]]],OverrideTopLevelTerm_superSplice:[`define`,{sourceInterval:[522,543]},null,[],[`terminal`,{sourceInterval:[522,527]},`...`]],OverrideTopLevelTerm:[`define`,{sourceInterval:[495,562]},null,[],[`alt`,{sourceInterval:[522,562]},[`app`,{sourceInterval:[522,527]},`OverrideTopLevelTerm_superSplice`,[]],[`app`,{sourceInterval:[550,562]},`TopLevelTerm`,[]]]],Formals:[`define`,{sourceInterval:[566,606]},null,[],[`seq`,{sourceInterval:[580,606]},[`terminal`,{sourceInterval:[580,583]},`<`],[`app`,{sourceInterval:[584,602]},`ListOf`,[[`app`,{sourceInterval:[591,596]},`ident`,[]],[`terminal`,{sourceInterval:[598,601]},`,`]]],[`terminal`,{sourceInterval:[603,606]},`>`]]],Params:[`define`,{sourceInterval:[610,647]},null,[],[`seq`,{sourceInterval:[623,647]},[`terminal`,{sourceInterval:[623,626]},`<`],[`app`,{sourceInterval:[627,643]},`ListOf`,[[`app`,{sourceInterval:[634,637]},`Seq`,[]],[`terminal`,{sourceInterval:[639,642]},`,`]]],[`terminal`,{sourceInterval:[644,647]},`>`]]],Alt:[`define`,{sourceInterval:[651,685]},null,[],[`app`,{sourceInterval:[661,685]},`NonemptyListOf`,[[`app`,{sourceInterval:[676,679]},`Seq`,[]],[`terminal`,{sourceInterval:[681,684]},`|`]]]],Seq:[`define`,{sourceInterval:[689,704]},null,[],[`star`,{sourceInterval:[699,704]},[`app`,{sourceInterval:[699,703]},`Iter`,[]]]],Iter_star:[`define`,{sourceInterval:[719,736]},null,[],[`seq`,{sourceInterval:[719,727]},[`app`,{sourceInterval:[719,723]},`Pred`,[]],[`terminal`,{sourceInterval:[724,727]},`*`]]],Iter_plus:[`define`,{sourceInterval:[743,760]},null,[],[`seq`,{sourceInterval:[743,751]},[`app`,{sourceInterval:[743,747]},`Pred`,[]],[`terminal`,{sourceInterval:[748,751]},`+`]]],Iter_opt:[`define`,{sourceInterval:[767,783]},null,[],[`seq`,{sourceInterval:[767,775]},[`app`,{sourceInterval:[767,771]},`Pred`,[]],[`terminal`,{sourceInterval:[772,775]},`?`]]],Iter:[`define`,{sourceInterval:[708,794]},null,[],[`alt`,{sourceInterval:[719,794]},[`app`,{sourceInterval:[719,727]},`Iter_star`,[]],[`app`,{sourceInterval:[743,751]},`Iter_plus`,[]],[`app`,{sourceInterval:[767,775]},`Iter_opt`,[]],[`app`,{sourceInterval:[790,794]},`Pred`,[]]]],Pred_not:[`define`,{sourceInterval:[809,824]},null,[],[`seq`,{sourceInterval:[809,816]},[`terminal`,{sourceInterval:[809,812]},`~`],[`app`,{sourceInterval:[813,816]},`Lex`,[]]]],Pred_lookahead:[`define`,{sourceInterval:[831,852]},null,[],[`seq`,{sourceInterval:[831,838]},[`terminal`,{sourceInterval:[831,834]},`&`],[`app`,{sourceInterval:[835,838]},`Lex`,[]]]],Pred:[`define`,{sourceInterval:[798,862]},null,[],[`alt`,{sourceInterval:[809,862]},[`app`,{sourceInterval:[809,816]},`Pred_not`,[]],[`app`,{sourceInterval:[831,838]},`Pred_lookahead`,[]],[`app`,{sourceInterval:[859,862]},`Lex`,[]]]],Lex_lex:[`define`,{sourceInterval:[876,892]},null,[],[`seq`,{sourceInterval:[876,884]},[`terminal`,{sourceInterval:[876,879]},`#`],[`app`,{sourceInterval:[880,884]},`Base`,[]]]],Lex:[`define`,{sourceInterval:[866,903]},null,[],[`alt`,{sourceInterval:[876,903]},[`app`,{sourceInterval:[876,884]},`Lex_lex`,[]],[`app`,{sourceInterval:[899,903]},`Base`,[]]]],Base_application:[`define`,{sourceInterval:[918,979]},null,[],[`seq`,{sourceInterval:[918,963]},[`app`,{sourceInterval:[918,923]},`ident`,[]],[`opt`,{sourceInterval:[924,931]},[`app`,{sourceInterval:[924,930]},`Params`,[]]],[`not`,{sourceInterval:[932,963]},[`alt`,{sourceInterval:[934,962]},[`seq`,{sourceInterval:[934,948]},[`opt`,{sourceInterval:[934,944]},[`app`,{sourceInterval:[934,943]},`ruleDescr`,[]]],[`terminal`,{sourceInterval:[945,948]},`=`]],[`terminal`,{sourceInterval:[951,955]},`:=`],[`terminal`,{sourceInterval:[958,962]},`+=`]]]]],Base_range:[`define`,{sourceInterval:[986,1041]},null,[],[`seq`,{sourceInterval:[986,1022]},[`app`,{sourceInterval:[986,1001]},`oneCharTerminal`,[]],[`terminal`,{sourceInterval:[1002,1006]},`..`],[`app`,{sourceInterval:[1007,1022]},`oneCharTerminal`,[]]]],Base_terminal:[`define`,{sourceInterval:[1048,1106]},null,[],[`app`,{sourceInterval:[1048,1056]},`terminal`,[]]],Base_paren:[`define`,{sourceInterval:[1113,1168]},null,[],[`seq`,{sourceInterval:[1113,1124]},[`terminal`,{sourceInterval:[1113,1116]},`(`],[`app`,{sourceInterval:[1117,1120]},`Alt`,[]],[`terminal`,{sourceInterval:[1121,1124]},`)`]]],Base:[`define`,{sourceInterval:[907,1168]},null,[],[`alt`,{sourceInterval:[918,1168]},[`app`,{sourceInterval:[918,963]},`Base_application`,[]],[`app`,{sourceInterval:[986,1022]},`Base_range`,[]],[`app`,{sourceInterval:[1048,1056]},`Base_terminal`,[]],[`app`,{sourceInterval:[1113,1124]},`Base_paren`,[]]]],ruleDescr:[`define`,{sourceInterval:[1172,1231]},`a rule description`,[],[`seq`,{sourceInterval:[1210,1231]},[`terminal`,{sourceInterval:[1210,1213]},`(`],[`app`,{sourceInterval:[1214,1227]},`ruleDescrText`,[]],[`terminal`,{sourceInterval:[1228,1231]},`)`]]],ruleDescrText:[`define`,{sourceInterval:[1235,1266]},null,[],[`star`,{sourceInterval:[1255,1266]},[`seq`,{sourceInterval:[1256,1264]},[`not`,{sourceInterval:[1256,1260]},[`terminal`,{sourceInterval:[1257,1260]},`)`]],[`app`,{sourceInterval:[1261,1264]},`any`,[]]]]],caseName:[`define`,{sourceInterval:[1270,1338]},null,[],[`seq`,{sourceInterval:[1285,1338]},[`terminal`,{sourceInterval:[1285,1289]},`--`],[`star`,{sourceInterval:[1290,1304]},[`seq`,{sourceInterval:[1291,1302]},[`not`,{sourceInterval:[1291,1296]},[`terminal`,{sourceInterval:[1292,1296]},`
199
- `]],[`app`,{sourceInterval:[1297,1302]},`space`,[]]]],[`app`,{sourceInterval:[1305,1309]},`name`,[]],[`star`,{sourceInterval:[1310,1324]},[`seq`,{sourceInterval:[1311,1322]},[`not`,{sourceInterval:[1311,1316]},[`terminal`,{sourceInterval:[1312,1316]},`
200
- `]],[`app`,{sourceInterval:[1317,1322]},`space`,[]]]],[`alt`,{sourceInterval:[1326,1337]},[`terminal`,{sourceInterval:[1326,1330]},`
201
- `],[`lookahead`,{sourceInterval:[1333,1337]},[`terminal`,{sourceInterval:[1334,1337]},`}`]]]]],name:[`define`,{sourceInterval:[1342,1382]},`a name`,[],[`seq`,{sourceInterval:[1363,1382]},[`app`,{sourceInterval:[1363,1372]},`nameFirst`,[]],[`star`,{sourceInterval:[1373,1382]},[`app`,{sourceInterval:[1373,1381]},`nameRest`,[]]]]],nameFirst:[`define`,{sourceInterval:[1386,1418]},null,[],[`alt`,{sourceInterval:[1402,1418]},[`terminal`,{sourceInterval:[1402,1405]},`_`],[`app`,{sourceInterval:[1412,1418]},`letter`,[]]]],nameRest:[`define`,{sourceInterval:[1422,1452]},null,[],[`alt`,{sourceInterval:[1437,1452]},[`terminal`,{sourceInterval:[1437,1440]},`_`],[`app`,{sourceInterval:[1447,1452]},`alnum`,[]]]],ident:[`define`,{sourceInterval:[1456,1489]},`an identifier`,[],[`app`,{sourceInterval:[1485,1489]},`name`,[]]],terminal:[`define`,{sourceInterval:[1493,1531]},null,[],[`seq`,{sourceInterval:[1508,1531]},[`terminal`,{sourceInterval:[1508,1512]},`"`],[`star`,{sourceInterval:[1513,1526]},[`app`,{sourceInterval:[1513,1525]},`terminalChar`,[]]],[`terminal`,{sourceInterval:[1527,1531]},`"`]]],oneCharTerminal:[`define`,{sourceInterval:[1535,1579]},null,[],[`seq`,{sourceInterval:[1557,1579]},[`terminal`,{sourceInterval:[1557,1561]},`"`],[`app`,{sourceInterval:[1562,1574]},`terminalChar`,[]],[`terminal`,{sourceInterval:[1575,1579]},`"`]]],terminalChar:[`define`,{sourceInterval:[1583,1660]},null,[],[`alt`,{sourceInterval:[1602,1660]},[`app`,{sourceInterval:[1602,1612]},`escapeChar`,[]],[`seq`,{sourceInterval:[1621,1660]},[`not`,{sourceInterval:[1621,1626]},[`terminal`,{sourceInterval:[1622,1626]},`\\`]],[`not`,{sourceInterval:[1627,1632]},[`terminal`,{sourceInterval:[1628,1632]},`"`]],[`not`,{sourceInterval:[1633,1638]},[`terminal`,{sourceInterval:[1634,1638]},`
202
- `]],[`range`,{sourceInterval:[1639,1660]},`\0`,`􏿿`]]]],escapeChar_backslash:[`define`,{sourceInterval:[1703,1758]},null,[],[`terminal`,{sourceInterval:[1703,1709]},`\\\\`]],escapeChar_doubleQuote:[`define`,{sourceInterval:[1765,1822]},null,[],[`terminal`,{sourceInterval:[1765,1771]},`\\"`]],escapeChar_singleQuote:[`define`,{sourceInterval:[1829,1886]},null,[],[`terminal`,{sourceInterval:[1829,1835]},`\\'`]],escapeChar_backspace:[`define`,{sourceInterval:[1893,1948]},null,[],[`terminal`,{sourceInterval:[1893,1898]},`\\b`]],escapeChar_lineFeed:[`define`,{sourceInterval:[1955,2009]},null,[],[`terminal`,{sourceInterval:[1955,1960]},`\\n`]],escapeChar_carriageReturn:[`define`,{sourceInterval:[2016,2076]},null,[],[`terminal`,{sourceInterval:[2016,2021]},`\\r`]],escapeChar_tab:[`define`,{sourceInterval:[2083,2132]},null,[],[`terminal`,{sourceInterval:[2083,2088]},`\\t`]],escapeChar_unicodeCodePoint:[`define`,{sourceInterval:[2139,2243]},null,[],[`seq`,{sourceInterval:[2139,2221]},[`terminal`,{sourceInterval:[2139,2145]},`\\u{`],[`app`,{sourceInterval:[2146,2154]},`hexDigit`,[]],[`opt`,{sourceInterval:[2155,2164]},[`app`,{sourceInterval:[2155,2163]},`hexDigit`,[]]],[`opt`,{sourceInterval:[2165,2174]},[`app`,{sourceInterval:[2165,2173]},`hexDigit`,[]]],[`opt`,{sourceInterval:[2188,2197]},[`app`,{sourceInterval:[2188,2196]},`hexDigit`,[]]],[`opt`,{sourceInterval:[2198,2207]},[`app`,{sourceInterval:[2198,2206]},`hexDigit`,[]]],[`opt`,{sourceInterval:[2208,2217]},[`app`,{sourceInterval:[2208,2216]},`hexDigit`,[]]],[`terminal`,{sourceInterval:[2218,2221]},`}`]]],escapeChar_unicodeEscape:[`define`,{sourceInterval:[2250,2309]},null,[],[`seq`,{sourceInterval:[2250,2291]},[`terminal`,{sourceInterval:[2250,2255]},`\\u`],[`app`,{sourceInterval:[2256,2264]},`hexDigit`,[]],[`app`,{sourceInterval:[2265,2273]},`hexDigit`,[]],[`app`,{sourceInterval:[2274,2282]},`hexDigit`,[]],[`app`,{sourceInterval:[2283,2291]},`hexDigit`,[]]]],escapeChar_hexEscape:[`define`,{sourceInterval:[2316,2371]},null,[],[`seq`,{sourceInterval:[2316,2339]},[`terminal`,{sourceInterval:[2316,2321]},`\\x`],[`app`,{sourceInterval:[2322,2330]},`hexDigit`,[]],[`app`,{sourceInterval:[2331,2339]},`hexDigit`,[]]]],escapeChar:[`define`,{sourceInterval:[1664,2371]},`an escape sequence`,[],[`alt`,{sourceInterval:[1703,2371]},[`app`,{sourceInterval:[1703,1709]},`escapeChar_backslash`,[]],[`app`,{sourceInterval:[1765,1771]},`escapeChar_doubleQuote`,[]],[`app`,{sourceInterval:[1829,1835]},`escapeChar_singleQuote`,[]],[`app`,{sourceInterval:[1893,1898]},`escapeChar_backspace`,[]],[`app`,{sourceInterval:[1955,1960]},`escapeChar_lineFeed`,[]],[`app`,{sourceInterval:[2016,2021]},`escapeChar_carriageReturn`,[]],[`app`,{sourceInterval:[2083,2088]},`escapeChar_tab`,[]],[`app`,{sourceInterval:[2139,2221]},`escapeChar_unicodeCodePoint`,[]],[`app`,{sourceInterval:[2250,2291]},`escapeChar_unicodeEscape`,[]],[`app`,{sourceInterval:[2316,2339]},`escapeChar_hexEscape`,[]]]],space:[`extend`,{sourceInterval:[2375,2394]},null,[],[`app`,{sourceInterval:[2387,2394]},`comment`,[]]],comment_singleLine:[`define`,{sourceInterval:[2412,2458]},null,[],[`seq`,{sourceInterval:[2412,2443]},[`terminal`,{sourceInterval:[2412,2416]},`//`],[`star`,{sourceInterval:[2417,2429]},[`seq`,{sourceInterval:[2418,2427]},[`not`,{sourceInterval:[2418,2423]},[`terminal`,{sourceInterval:[2419,2423]},`
203
- `]],[`app`,{sourceInterval:[2424,2427]},`any`,[]]]],[`lookahead`,{sourceInterval:[2430,2443]},[`alt`,{sourceInterval:[2432,2442]},[`terminal`,{sourceInterval:[2432,2436]},`
204
- `],[`app`,{sourceInterval:[2439,2442]},`end`,[]]]]]],comment_multiLine:[`define`,{sourceInterval:[2465,2501]},null,[],[`seq`,{sourceInterval:[2465,2487]},[`terminal`,{sourceInterval:[2465,2469]},`/*`],[`star`,{sourceInterval:[2470,2482]},[`seq`,{sourceInterval:[2471,2480]},[`not`,{sourceInterval:[2471,2476]},[`terminal`,{sourceInterval:[2472,2476]},`*/`]],[`app`,{sourceInterval:[2477,2480]},`any`,[]]]],[`terminal`,{sourceInterval:[2483,2487]},`*/`]]],comment:[`define`,{sourceInterval:[2398,2501]},null,[],[`alt`,{sourceInterval:[2412,2501]},[`app`,{sourceInterval:[2412,2443]},`comment_singleLine`,[]],[`app`,{sourceInterval:[2465,2487]},`comment_multiLine`,[]]]],tokens:[`define`,{sourceInterval:[2505,2520]},null,[],[`star`,{sourceInterval:[2514,2520]},[`app`,{sourceInterval:[2514,2519]},`token`,[]]]],token:[`define`,{sourceInterval:[2524,2600]},null,[],[`alt`,{sourceInterval:[2532,2600]},[`app`,{sourceInterval:[2532,2540]},`caseName`,[]],[`app`,{sourceInterval:[2543,2550]},`comment`,[]],[`app`,{sourceInterval:[2553,2558]},`ident`,[]],[`app`,{sourceInterval:[2561,2569]},`operator`,[]],[`app`,{sourceInterval:[2572,2583]},`punctuation`,[]],[`app`,{sourceInterval:[2586,2594]},`terminal`,[]],[`app`,{sourceInterval:[2597,2600]},`any`,[]]]],operator:[`define`,{sourceInterval:[2604,2669]},null,[],[`alt`,{sourceInterval:[2615,2669]},[`terminal`,{sourceInterval:[2615,2619]},`<:`],[`terminal`,{sourceInterval:[2622,2625]},`=`],[`terminal`,{sourceInterval:[2628,2632]},`:=`],[`terminal`,{sourceInterval:[2635,2639]},`+=`],[`terminal`,{sourceInterval:[2642,2645]},`*`],[`terminal`,{sourceInterval:[2648,2651]},`+`],[`terminal`,{sourceInterval:[2654,2657]},`?`],[`terminal`,{sourceInterval:[2660,2663]},`~`],[`terminal`,{sourceInterval:[2666,2669]},`&`]]],punctuation:[`define`,{sourceInterval:[2673,2709]},null,[],[`alt`,{sourceInterval:[2687,2709]},[`terminal`,{sourceInterval:[2687,2690]},`<`],[`terminal`,{sourceInterval:[2693,2696]},`>`],[`terminal`,{sourceInterval:[2699,2702]},`,`],[`terminal`,{sourceInterval:[2705,2709]},`--`]]]}]),Lt=Object.create(x.prototype);function Rt(e,t){for(let n in e)if(n===t)return!0;return!1}function zt(e,t,n,r){let i=new $(r),a,o,s,c=!1;return(n||It).createSemantics().addOperation(`visit`,{Grammars(e){return e.children.map(e=>e.visit())},Grammar(e,n,r,o,s){let c=e.visit();a=i.newGrammar(c),n.child(0)&&n.child(0).visit(),o.children.map(e=>e.visit());let l=a.build();if(l.source=this.source.trimmed(),Rt(t,c))throw Ce(l,t);return t[c]=l,l},SuperGrammar(e,n){let r=n.visit();if(r===`null`)a.withSuperGrammar(null);else{if(!t||!Rt(t,r))throw Se(r,t,n.source);a.withSuperGrammar(t[r])}},Rule_define(e,t,n,r,i){o=e.visit(),s=t.children.map(e=>e.visit())[0]||[],!a.defaultStartRule&&a.ensureSuperGrammar()!==Q.ProtoBuiltInRules&&a.withDefaultStartRule(o);let c=i.visit(),l=n.children.map(e=>e.visit())[0],u=this.source.trimmed();return a.define(o,s,c,l,u)},Rule_override(e,t,n,r){o=e.visit(),s=t.children.map(e=>e.visit())[0]||[];let i=this.source.trimmed();a.ensureSuperGrammarRuleForOverriding(o,i),c=!0;let l=r.visit();return c=!1,a.override(o,s,l,null,i)},Rule_extend(e,t,n,r){o=e.visit(),s=t.children.map(e=>e.visit())[0]||[];let i=r.visit(),c=this.source.trimmed();return a.extend(o,s,i,null,c)},RuleBody(e,t){return i.alt(...t.visit()).withSource(this.source)},OverrideRuleBody(e,t){let n=t.visit(),r=n.indexOf(Lt);if(r>=0){let e=n.slice(0,r),t=n.slice(r+1);return t.forEach(e=>{if(e===Lt)throw Le(e)}),new k(a.superGrammar,o,e,t).withSource(this.source)}else return i.alt(...n).withSource(this.source)},Formals(e,t,n){return t.visit()},Params(e,t,n){return t.visit()},Alt(e){return i.alt(...e.visit()).withSource(this.source)},TopLevelTerm_inline(e,t){let n=o+`_`+t.visit(),r=e.visit(),l=this.source.trimmed(),u=!(a.superGrammar&&a.superGrammar.rules[n]);c&&!u?a.override(n,s,r,null,l):a.define(n,s,r,null,l);let d=s.map(e=>i.app(e));return i.app(n,d).withSource(r.source)},OverrideTopLevelTerm_superSplice(e){return Lt},Seq(e){return i.seq(...e.children.map(e=>e.visit())).withSource(this.source)},Iter_star(e,t){return i.star(e.visit()).withSource(this.source)},Iter_plus(e,t){return i.plus(e.visit()).withSource(this.source)},Iter_opt(e,t){return i.opt(e.visit()).withSource(this.source)},Pred_not(e,t){return i.not(t.visit()).withSource(this.source)},Pred_lookahead(e,t){return i.lookahead(t.visit()).withSource(this.source)},Lex_lex(e,t){return i.lex(t.visit()).withSource(this.source)},Base_application(e,t){let n=t.children.map(e=>e.visit())[0]||[];return i.app(e.visit(),n).withSource(this.source)},Base_range(e,t,n){return i.range(e.visit(),n.visit()).withSource(this.source)},Base_terminal(e){return i.terminal(e.visit()).withSource(this.source)},Base_paren(e,t,n){return t.visit()},ruleDescr(e,t,n){return t.visit()},ruleDescrText(e){return this.sourceString.trim()},caseName(e,t,n,r,i){return n.visit()},name(e,t){return this.sourceString},nameFirst(e){},nameRest(e){},terminal(e,t,n){return t.children.map(e=>e.visit()).join(``)},oneCharTerminal(e,t,n){return t.visit()},escapeChar(e){try{return me(this.sourceString)}catch(t){throw t instanceof RangeError&&t.message.startsWith(`Invalid code point `)?Re(e):t}},NonemptyListOf(e,t,n){return[e.visit()].concat(n.children.map(e=>e.visit()))},EmptyListOf(){return[]},_terminal(){return this.sourceString}})(e).visit()}var Bt=Pt([`grammar`,{source:`OperationsAndAttributes {
205
-
206
- AttributeSignature =
207
- name
208
-
209
- OperationSignature =
210
- name Formals?
211
-
212
- Formals
213
- = "(" ListOf<name, ","> ")"
214
-
215
- name (a name)
216
- = nameFirst nameRest*
217
-
218
- nameFirst
219
- = "_"
220
- | letter
221
-
222
- nameRest
223
- = "_"
224
- | alnum
225
-
226
- }`},`OperationsAndAttributes`,null,`AttributeSignature`,{AttributeSignature:[`define`,{sourceInterval:[29,58]},null,[],[`app`,{sourceInterval:[54,58]},`name`,[]]],OperationSignature:[`define`,{sourceInterval:[62,100]},null,[],[`seq`,{sourceInterval:[87,100]},[`app`,{sourceInterval:[87,91]},`name`,[]],[`opt`,{sourceInterval:[92,100]},[`app`,{sourceInterval:[92,99]},`Formals`,[]]]]],Formals:[`define`,{sourceInterval:[104,143]},null,[],[`seq`,{sourceInterval:[118,143]},[`terminal`,{sourceInterval:[118,121]},`(`],[`app`,{sourceInterval:[122,139]},`ListOf`,[[`app`,{sourceInterval:[129,133]},`name`,[]],[`terminal`,{sourceInterval:[135,138]},`,`]]],[`terminal`,{sourceInterval:[140,143]},`)`]]],name:[`define`,{sourceInterval:[147,187]},`a name`,[],[`seq`,{sourceInterval:[168,187]},[`app`,{sourceInterval:[168,177]},`nameFirst`,[]],[`star`,{sourceInterval:[178,187]},[`app`,{sourceInterval:[178,186]},`nameRest`,[]]]]],nameFirst:[`define`,{sourceInterval:[191,223]},null,[],[`alt`,{sourceInterval:[207,223]},[`terminal`,{sourceInterval:[207,210]},`_`],[`app`,{sourceInterval:[217,223]},`letter`,[]]]],nameRest:[`define`,{sourceInterval:[227,257]},null,[],[`alt`,{sourceInterval:[242,257]},[`terminal`,{sourceInterval:[242,245]},`_`],[`app`,{sourceInterval:[252,257]},`alnum`,[]]]]}]);Vt(Q.BuiltInRules),Ht(Bt);function Vt(e){let t={empty(){return this.iteration()},nonEmpty(e,t,n){return this.iteration([e].concat(n.children))},self(...e){return this}};X.BuiltInSemantics=X.createSemantics(e,null).addOperation(`asIteration`,{emptyListOf:t.empty,nonemptyListOf:t.nonEmpty,EmptyListOf:t.empty,NonemptyListOf:t.nonEmpty,_iter:t.self})}function Ht(e){X.prototypeGrammarSemantics=e.createSemantics().addOperation(`parse`,{AttributeSignature(e){return{name:e.parse(),formals:[]}},OperationSignature(e,t){return{name:e.parse(),formals:t.children.map(e=>e.parse())[0]||[]}},Formals(e,t,n){return t.asIteration().children.map(e=>e.parse())},name(e,t){return this.sourceString}}),X.prototypeGrammar=e}function Ut(e){let t=0,n=[0],r=()=>n[n.length-1],i={},a=/( *).*(?:$|\r?\n|\r)/g,o;for(;(o=a.exec(e))!=null;){let[e,a]=o;if(e.length===0)break;let s=a.length,c=r(),l=t+s;if(s>c)n.push(s),i[l]=1;else if(s<c){let e=n.length;for(;r()!==s;)n.pop();i[l]=-1*(e-n.length)}t+=e.length}return n.length>1&&(i[t]=1-n.length),i}var Wt=`an indented block`,Gt=`a dedent`,Kt=1114112,qt=class extends H{constructor(e){super(e.input),this.state=e}_indentationAt(e){return this.state.userData[e]||0}atEnd(){return super.atEnd()&&this._indentationAt(this.pos)===0}next(){if(this._indentationAt(this.pos)!==0){this.examinedLength=Math.max(this.examinedLength,this.pos);return}return super.next()}nextCharCode(){return this._indentationAt(this.pos)===0?super.nextCharCode():(this.examinedLength=Math.max(this.examinedLength,this.pos),Kt)}nextCodePoint(){return this._indentationAt(this.pos)===0?super.nextCodePoint():(this.examinedLength=Math.max(this.examinedLength,this.pos),Kt)}},Jt=class extends x{constructor(e=!0){super(),this.isIndent=e}allowsSkippingPrecedingSpace(){return!0}eval(e){let{inputStream:t}=e,n=e.userData;e.doNotMemoize=!0;let r=t.pos,i=this.isIndent?1:-1;return(n[r]||0)*i>0?(e.userData=Object.create(n),e.userData[r]-=i,e.pushBinding(new K(0),r),!0):(e.processFailure(r,this),!1)}getArity(){return 1}_assertAllApplicationsAreValid(e,t){}_isNullable(e,t){return!1}assertChoicesHaveUniformArity(e){}assertIteratedExprsAreNotNullable(e){}introduceParams(e){return this}substituteParams(e){return this}toString(){return this.isIndent?`indent`:`dedent`}toDisplayString(){return this.toString()}toFailure(e){let t=this.isIndent?Wt:Gt;return new J(this,t,`description`)}},Yt=new k(Ft,`any`,[new R(`indent`),new R(`dedent`)],[]),Xt=new $().newGrammar(`IndentationSensitive`).withSuperGrammar(Ft).define(`indent`,[],new Jt(!0),Wt,void 0,!0).define(`dedent`,[],new Jt(!1),Gt,void 0,!0).extend(`any`,[],Yt,`any character`,void 0).build();Object.assign(Xt,{_matchStateInitializer(e){e.userData=Ut(e.input),e.inputStream=new qt(e)},supportsIncrementalParsing:!1}),Q.initApplicationParser(It,zt);var Zt=e=>!!e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e);function Qt(e,t,n){let r=It.match(e,`Grammars`);if(r.failed())throw xe(r);return zt(r,t,void 0,n)}function $t(e,t,n){let r=en(e,t,n),i=Object.keys(r);if(i.length===0)throw Error(`Missing grammar definition`);if(i.length>1){let e=r[i[1]].source;throw Error(Ze(e.sourceString,e.startIdx)+`Found more than one grammar definition -- use ohm.grammars() instead.`)}return r[i[0]]}function en(e,t,n){let r=Object.create(t||{});if(typeof e!=`string`)if(Zt(e))e=e.toString();else throw TypeError(`Expected string as first argument, got `+he(e));return Qt(e,r,n),r}function tn(e,t){return $t(e,t)}var nn=tn(`
227
- PyRepr {
228
- Expression = null | Boolean | ObjectExpr | Array | String | UUID | Number | AngleBracket
229
-
230
- ObjectExpr = ClassExpr | DictExpr
231
-
232
- ClassExpr = identifier "(" ListOf<ArgValue, ","> ")"
233
- DictExpr = "{" ListOf<DictPair, ","> "}"
234
-
235
- ArgValue = KeyValue | Expression
236
-
237
- KeyValue = identifier ("=" | ":") Expression
238
- DictPair = (String | identifier) ":" Expression
239
-
240
- Array = "[" ListOf<Expression, ","> "]"
241
-
242
- String = "'" (~"'" any)* "'" | "\\"" (~"\\"" any)* "\\""
243
-
244
- Number = float | integer
245
- float = "-"? digit+ "." digit+ ("e" "-"? digit+)?
246
- integer = "-"? digit+
247
-
248
- Boolean = "True" | "False"
249
-
250
- null = "None"
251
-
252
- AngleBracket = "<" (~">" any)* ">"
253
-
254
- UUID = letter alnum alnum+
255
- | digit+ letter+ alnum+
256
- | alnum+ "-" alnum+
257
-
258
- identifier = ~("None" | "True" | "False") letter (alnum | "_")*
259
- }
260
- `),rn=nn.createSemantics().addOperation(`toJSON`,{Expression:e=>e.toJSON(),ObjectExpr:e=>e.toJSON(),ClassExpr:(e,t,n,r)=>{let i=0,a=n.toJSON().map(e=>Array.isArray(e)?e:[`arg${i++}`,e]);return{[e.sourceString]:Object.fromEntries(a)}},DictExpr:(e,t,n)=>Object.fromEntries(t.toJSON()),KeyValue:(e,t,n)=>[e.sourceString,n.toJSON()],DictPair:(e,t,n)=>[e.toJSON(),n.toJSON()],Array:(e,t,n)=>t.toJSON(),String:(e,t,n)=>t.sourceString,Number:e=>e.toJSON(),float:function(e,t,n,r,i,a,o){return parseFloat(this.sourceString)},integer:function(e,t){return parseInt(this.sourceString,10)},Boolean:e=>e.sourceString===`True`,null:e=>null,AngleBracket:(e,t,n)=>`<${t.sourceString}>`,UUID:(e,t,n)=>e.sourceString+t.sourceString+n.sourceString,identifier:(e,t)=>e.sourceString+t.sourceString,NonemptyListOf:(e,t,n)=>[e.toJSON(),...n.toJSON()],EmptyListOf:()=>[],_iter:(...e)=>e.map(e=>e.toJSON()),ArgValue:e=>e.toJSON()}),an=e=>/^[A-Z][A-Za-z0-9_]*\(/.test(e),on=e=>{if(typeof e==`object`&&Array.isArray(e))return e.map(e=>on(e));if(typeof e==`object`&&e)return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,on(t)]));if(typeof e==`string`&&an(e)){let t=nn.match(e);if(t.succeeded()){let e=rn(t).toJSON();return typeof e==`object`&&!Array.isArray(e)&&(e=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,typeof t==`object`&&`arg0`in t&&Object.keys(t).length===1?t.arg0:t]))),e}}return e};function sn(e){return(0,m.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,width:28,height:28,viewBox:`0 0 28 28`,...e,children:[(0,m.jsx)(`path`,{stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .586 1.414`}),(0,m.jsx)(`path`,{stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M17 6h-7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V13z`}),(0,m.jsx)(`path`,{stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M17 6v7h7`})]})}var cn=te(()=>o(()=>import(`./react-json-view-B2Vyx9aO.js`),__vite__mapDeps([0,1,2])),{loading:()=>(0,m.jsx)(`div`,{})}),ln=ne.memo(function(e){let{value:t}=e,{colorMode:n}=ee(),i;try{if(t&&typeof t==`string`){let e=JSON.parse(t);typeof e==`object`&&(i=e),typeof e==`string`&&(t=e)}typeof t==`object`&&t&&(i=t)}catch{}let o={...e};delete o.value;let[s,l]=(0,ne.useState)(!1),u=(0,ne.useMemo)(()=>d(i??t),[t]),te=()=>(0,m.jsx)(f,{content:`Copy`,children:(0,m.jsx)(r,{children:(0,m.jsx)(un,{position:`relative`,onClick:()=>{(async()=>{try{await navigator.clipboard.writeText(i?JSON.stringify(i,null,2):t?typeof t==`string`?t:JSON.stringify(t,null,2):`${t}`),p.create({title:`Copied to clipboard`,type:`success`})}catch{if(window.location.protocol===`http:`&&window.location.hostname!==`localhost`&&window.location.hostname!==`127.0.0.1`){p.create({title:`Cannot copy to clipboard on HTTP`,type:`error`});return}p.create({title:`Failed to copy to clipboard`,type:`error`})}})()},children:(0,m.jsx)(sn,{width:12,height:12})})})});return(0,m.jsxs)(r,{position:`relative`,width:`full`,children:[(0,m.jsx)(re,{parts:u}),typeof document<`u`&&(i??(typeof t==`string`&&an(t)))?(t=>{let i=on(t),u=!1;return typeof i!=`object`&&(u=!0),(0,m.jsxs)(m.Fragment,{children:[e.showTools&&(0,m.jsxs)(a,{position:`absolute`,top:-2,right:-2,zIndex:1,gap:`-1px`,children:[!u&&e.showTools!==`copy-only`&&(0,m.jsx)(f,{content:`View Raw`,children:(0,m.jsx)(r,{children:(0,m.jsx)(un,{onClick:()=>l(!s),background:s?`bg.emphasized`:`bg.muted`,children:`{}`})})}),te()]}),s||u?(0,m.jsx)(c,{fontFamily:`mono`,fontSize:`13px`,children:JSON.stringify(t,null,2)}):(0,m.jsx)(cn,{src:i,name:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,collapseStringsAfterLength:1e3,style:{fontSize:`13px`,backgroundColor:`transparent`},theme:n===`dark`?`twilight`:`rjv-default`,displayArrayKey:!1,...o})]})})(i??t):(0,m.jsxs)(m.Fragment,{children:[e.showTools&&(0,m.jsx)(a,{position:`absolute`,top:-2,right:-2,zIndex:1,gap:`-1px`,children:te()}),(0,m.jsx)(c,{fontFamily:`mono`,fontSize:`14px`,children:t?typeof t==`string`?t:JSON.stringify(t,null,2):`${t}`})]})]})});function un(e){return(0,m.jsx)(i,{size:`xs`,fontSize:`10px`,fontFamily:`mono`,padding:1,height:`22px`,width:`auto`,minWidth:`0`,borderRadius:`0`,border:`1px solid`,borderColor:`border.emphasized`,colorPalette:`gray`,...e})}export{re as a,on as i,sn as n,an as r,ln as t};
261
- //# sourceMappingURL=RenderInputOutput-BntIB-Ae.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a,t as o}from"./portal-Sdfvrza9.js";import{t as s}from"./jsx-runtime-CFwixLRt.js";import{t as c}from"./heading-C0sACr0w.js";import{n as l,t as u}from"./v-stack-hkuSkmCA.js";import{s as d}from"./shikiAdapter-CbWAxLvq.js";import{Mt as f,R as p}from"./ProjectAvatar-DtI9dT1f.js";import{c as m,d as h,f as g,n as _,s as v}from"./toaster-BsYkODqs.js";import{K as y,P as b}from"./Markdown-C9extmbX.js";import{t as x}from"./grid-DVy6ELOp.js";import{t as S}from"./icon-D6xQEiPb.js";import{a as C,t as w}from"./field-BadoNaN5.js";import{i as T,n as E,r as D,t as O}from"./alert-CPsXih3K.js";import{r as k,t as A}from"./card-By_Mbslh.js";import{t as j}from"./icon-button-Wlb_dGXL.js";import{n as M}from"./personalProject-DMRX2-SI.js";import{t as ee}from"./grid-item-CKAuKzga.js";import{g as N,h as P,l as te,m as F,t as I,u as ne}from"./errors-e711UMq7.js";import{t as re}from"./spacer-C38e7o6r.js";import{et as L,tt as R}from"./immer-CFru3D02.js";import{n as z}from"./api-l6Cnm0vQ.js";import{f as ie}from"./trpcError-CFsR-0nB.js";import{n as B}from"./log-out-CUZz1cYc.js";import{t as V}from"./circle-dot-StVmYH4p.js";import{t as H}from"./code-MiD0yvEx.js";import{t as U}from"./globe-Bc_PfXMH.js";import{r as ae}from"./next-router-CWLrMXvP.js";import{s as oe,t as se,u as ce}from"./index.esm-Cpy5fWo1.js";import{$n as W,An as G,En as le,Er as K,F as ue,G as de,H as fe,I as pe,Ln as me,Mr as q,Qn as J,St as Y,Un as he,Vt as X,W as ge,br as _e,nr as ve,pn as ye}from"./index-CPtTUYLD.js";import{t as be}from"./zod-BDLLToBM.js";import{t as xe}from"./useLicenseEnforcement-DOI0dcqD.js";import{t as Se}from"./useModelProvidersSettings-CzJv8_Jy.js";import{t as Ce}from"./AgentTypeSelectorDrawer-CBUwY7Q0.js";import{n as we}from"./ScenarioInputMappingSection-DVpK_-Qh.js";import{r as Te}from"./constants-c0j3xvrs.js";import{r as Ee}from"./ModelSelector-4R-dc-Ny.js";import{t as De}from"./useCompoundLicenseCheck-BqNF-zzC.js";import{t as Oe}from"./PromptEditorDrawer-BLIu4fKV.js";import{t as ke}from"./useAllPromptsForProject-DCZJ0_-p.js";import{t as Ae}from"./dist-CtqZVBlK.js";import{a as je,n as Me,o as Ne,r as Pe,s as Fe,t as Ie}from"./defaultModelState-DY_b79Yj.js";import{t as Le}from"./latestAliases-BsL8GXW2.js";import{n as Re}from"./ProviderModelSelector-Cg5Lbc1U.js";var ze=h(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Z=e(t()),Q=ie(`pollForScenarioRun`),Be=500,Ve=Math.ceil(3e4/Be);async function He(e,t){Q.info({projectId:t.projectId,scenarioSetId:t.scenarioSetId,batchRunId:t.batchRunId},`Starting poll`);for(let n=0;n<Ve;n++){try{Q.info({attempt:n},`Fetching batch run data`);let r=await e(t),i=r.changed?r.runs:[];if(Q.info({attempt:n,runsCount:i.length},`Fetch completed`),n%10==0&&Q.info({attempt:n,runsCount:i.length,firstRun:i[0]?{scenarioRunId:i[0].scenarioRunId,status:i[0].status,messagesCount:i[0].messages?.length??0}:null},`Polling attempt`),i.length>0&&i[0]?.scenarioRunId){let e=i[0];return e.status===p.ERROR||e.status===p.FAILED||e.status===p.CANCELLED||e.status===p.STALLED?(Q.info({status:e.status,scenarioRunId:e.scenarioRunId},`Run terminated with error, cancelled, or stalled`),{success:!1,error:`run_error`,scenarioRunId:e.scenarioRunId}):(Q.info({status:e.status,hasMessages:e.messages&&e.messages.length>0,scenarioRunId:e.scenarioRunId},`Run ready`),{success:!0,scenarioRunId:e.scenarioRunId})}}catch(e){Q.error({error:e},`Fetch error`)}await new Promise(e=>setTimeout(e,Be))}return Q.warn({maxAttempts:Ve},`Timed out`),{success:!1,error:`timeout`}}function Ue({projectId:e,projectSlug:t,onRunComplete:n,onRunFailed:r}){let i=z.useContext(),a=z.scenarios.run.useMutation(),[o,s]=(0,Z.useState)(!1),{hasEnabledProviders:c}=Se({projectId:e});return{runScenario:(0,Z.useCallback)(async o=>{let{scenarioId:l,target:u,setId:d,batchRunId:f}=o;if(!(!e||!t||!u)){if(!c){_.create({title:`No model provider configured`,description:`A model provider must be configured to run scenarios.`,type:`error`,meta:{closable:!0},action:{label:`Configure model providers`,onClick:()=>window.open(`/settings/model-providers`,`_blank`,`noopener,noreferrer`)}});return}try{let{setId:t,batchRunId:o}=await a.mutateAsync({projectId:e,scenarioId:l,target:{type:u.type,referenceId:u.id},setId:d,batchRunId:f});s(!0);let c=await He(i.scenarios.getBatchRunData.fetch,{projectId:e,scenarioSetId:t,batchRunId:o});if(c.success)n?.({scenarioRunId:c.scenarioRunId,setId:t,batchRunId:o});else if(c.error===`run_error`){let e=c.scenarioRunId?{scenarioRunId:c.scenarioRunId,setId:t,batchRunId:o}:null;_.create({title:`Scenario run failed`,description:`The scenario encountered an error during execution.`,type:`error`,meta:{closable:!0},action:e?{label:`View failed run`,onClick:()=>r?.(e)}:void 0})}else _.create({title:`Run timed out`,description:`The scenario run took too long to start. Please try again.`,type:`error`,meta:{closable:!0}})}catch(e){I({error:e,fallbackTitle:`Couldn't start the scenario`})}finally{s(!1)}}},[e,t,c,a,n,r,i]),isRunning:a.isPending||o}}function We(e){let{project:t}=X(),n=e&&t?.id?`langwatch:scenario-target:${t.id}:${e}`:null,[r,i]=me(n??`langwatch:scenario-target:temp`,null);return{target:r&&n?{type:r.type,id:r.id}:null,setTarget:e=>{n&&i(e?{type:e.type,id:e.id,timestamp:Date.now()}:null)},clearTarget:()=>{n&&i(null)},hasPersistedTarget:!!r&&!!n}}var Ge=new Set([`http`,`code`,`workflow`]);function Ke(e,t){return(0,Z.useMemo)(()=>{let n=[...(e??[]).filter(e=>Ge.has(e.type))].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime());return t?n.filter(e=>e.name.toLowerCase().includes(t.toLowerCase())):n},[e,t])}function qe(e){return e!==null&&Ge.has(e.type)}var $=s();function Je({selectedTarget:e,onTargetChange:t,onSaveAndRun:n,onSaveWithoutRunning:s,onCreateAgent:c,onCreatePrompt:u,isLoading:d=!1}){let{project:p}=X(),{data:m}=ke(),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(!1),{data:y}=z.agents.getAll.useQuery({projectId:p?.id??``},{enabled:_&&!!p?.id}),b=(0,Z.useRef)(null),x=(0,Z.useRef)(null),S=(0,Z.useMemo)(()=>{let e=[...m?.filter(e=>e.version>0)??[]].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime());return h?e.filter(e=>(e.handle??e.id).toLowerCase().includes(h.toLowerCase())):e},[m,h]),C=Ke(y,h),w=e=>{t(e),v(!1),g(``),n(e)};return(0,$.jsxs)(f.Root,{open:_,onOpenChange:e=>{v(e.open),e.open&&setTimeout(()=>{b.current?.focus(),x.current?.scrollTo(0,0)},0)},positioning:{placement:`bottom-end`},children:[(0,$.jsx)(f.Trigger,{asChild:!0,children:(0,$.jsxs)(i,{colorPalette:`blue`,size:`sm`,loading:d,children:[(0,$.jsx)(W,{size:14}),`Save and Run`,(0,$.jsx)(L,{size:14})]})}),(0,$.jsx)(o,{children:(0,$.jsxs)(f.Content,{width:`320px`,padding:0,children:[(0,$.jsx)(r,{padding:2,borderBottomWidth:`1px`,borderColor:`border`,position:`sticky`,top:0,bg:`bg`,zIndex:10,children:(0,$.jsx)(q,{ref:b,size:`sm`,placeholder:`Search prompts or agents...`,value:h,onChange:e=>g(e.target.value)})}),(0,$.jsxs)(r,{ref:x,maxHeight:`400px`,overflowY:`auto`,children:[(0,$.jsxs)(r,{children:[(0,$.jsx)(l,{fontSize:`xs`,fontWeight:`bold`,textTransform:`uppercase`,color:`fg.muted`,paddingX:3,paddingY:2,bg:`bg.subtle`,position:`sticky`,top:0,zIndex:5,children:`Run against Agent`}),C.length===0?(0,$.jsx)(l,{fontSize:`sm`,color:`fg.subtle`,paddingX:3,paddingY:2,children:h?`No agents found`:`No agents available`}):C.map(t=>(0,$.jsxs)(a,{paddingX:3,paddingY:2,cursor:`pointer`,bg:qe(e)&&e.id===t.id?`blue.subtle`:`transparent`,_hover:{bg:`bg.muted`},onClick:()=>w({type:t.type,id:t.id}),children:[t.type===`code`?(0,$.jsx)(H,{size:14,color:`var(--chakra-colors-fg-muted)`}):(0,$.jsx)(U,{size:14,color:`var(--chakra-colors-fg-muted)`}),(0,$.jsx)(l,{fontSize:`sm`,flex:1,children:t.name}),(0,$.jsx)(W,{size:12,color:`var(--chakra-colors-blue-500)`})]},t.id)),(0,$.jsxs)(a,{paddingX:3,paddingY:2,cursor:`pointer`,_hover:{bg:`bg.muted`},borderTopWidth:`1px`,borderColor:`border.muted`,color:`blue.500`,onClick:()=>{v(!1),g(``),c()},children:[(0,$.jsx)(J,{size:14}),(0,$.jsx)(l,{fontSize:`sm`,children:`Add New Agent`})]})]}),(0,$.jsxs)(r,{borderTopWidth:`1px`,borderColor:`border`,children:[(0,$.jsx)(l,{fontSize:`xs`,fontWeight:`bold`,textTransform:`uppercase`,color:`fg.muted`,paddingX:3,paddingY:2,bg:`bg.subtle`,position:`sticky`,top:0,zIndex:5,children:`Run against Prompt`}),S.length===0?(0,$.jsx)(l,{fontSize:`sm`,color:`fg.subtle`,paddingX:3,paddingY:2,children:h?`No prompts found`:`No prompts available`}):S.map(t=>(0,$.jsxs)(a,{paddingX:3,paddingY:2,cursor:`pointer`,bg:e?.type===`prompt`&&e.id===t.id?`blue.subtle`:`transparent`,_hover:{bg:`bg.muted`},onClick:()=>w({type:`prompt`,id:t.id}),children:[(0,$.jsx)(_e,{size:14,color:`var(--chakra-colors-fg-muted)`}),(0,$.jsx)(l,{fontSize:`sm`,flex:1,children:t.handle??t.id}),(0,$.jsx)(W,{size:12,color:`var(--chakra-colors-blue-500)`})]},t.id)),(0,$.jsxs)(a,{paddingX:3,paddingY:2,cursor:`pointer`,_hover:{bg:`bg.muted`},borderTopWidth:`1px`,borderColor:`border.muted`,color:`blue.500`,onClick:()=>{v(!1),g(``),u?.()},children:[(0,$.jsx)(J,{size:14}),(0,$.jsx)(l,{fontSize:`sm`,children:`Add New Prompt`})]})]})]}),(0,$.jsx)(r,{borderTopWidth:`1px`,borderColor:`border`,children:(0,$.jsxs)(a,{paddingX:3,paddingY:3,cursor:`pointer`,_hover:{bg:`bg.muted`},onClick:()=>{v(!1),g(``),s()},children:[(0,$.jsx)(ze,{size:14,color:`var(--chakra-colors-fg-muted)`}),(0,$.jsx)(l,{fontSize:`sm`,children:`Save without running`})]})})]})})]})}var Ye=ie(`langwatch:scenarios:ai-generation`);function Xe(){let[e,t]=(0,Z.useState)([]);return(0,Z.useEffect)(()=>{let e=Pe();e&&t([e])},[]),{history:e,addPrompt:(0,Z.useCallback)(e=>{t(t=>[...t,e])},[]),hasHistory:e.length>0}}function Ze(e){let[t,n]=(0,Z.useState)(`idle`);return{generate:(0,Z.useCallback)(async(t,r)=>{if(!e)throw Error(`Project ID is required`);n(`generating`);try{let i=await je(t,e,r);return n(`done`),i}catch(e){throw n(`error`),e}},[e]),status:t}}function Qe(e){let t=e.getValues(`name`).trim(),n=e.getValues(`situation`).trim(),r=e.getValues(`criteria`);return t.length>0||n.length>0||r.length>0}var $e=5,et=5e3;function tt({form:e}){let{project:t}=X(),[o,s]=(0,Z.useState)(`prompt`),[c,d]=(0,Z.useState)(``),{history:f,addPrompt:p,hasHistory:h}=Xe(),{generate:y,status:b}=Ze(t?.id),{hasEnabledProviders:x,providers:C}=Se({projectId:t?.id}),w=z.modelProvider.getResolvedDefault.useQuery({projectId:t?.id??``,featureKey:`scenarios.generator`},{enabled:!!t?.id}),T=Ie({hasEnabledProviders:x,providers:C,defaultModel:w.data?.model}),E=!T.ok,D=e!==null&&Qe(e),O=!!(c.trim()&&b!==`generating`&&!E&&e),j=(0,Z.useCallback)(async()=>{if(!(!c.trim()||!t?.id||!e)&&!(D&&!h&&!window.confirm(`This will replace the current scenario content. Continue?`)))try{let t=await y(c,h?{name:e.getValues(`name`),situation:e.getValues(`situation`),criteria:e.getValues(`criteria`)}:null);e.setValue(`name`,t.name??``),e.setValue(`situation`,t.situation??``),e.setValue(`criteria`,t.criteria??[]),p(c),d(``)}catch(e){Ye.error({error:e},`Error generating scenario`);let t=Me(e),n=t.cta===`configure`||t.cta===`configure-and-retry`;_.create({title:t.title,description:t.copy,type:`error`,duration:et,action:n?{label:`Model settings`,onClick:()=>window.open(`/settings/model-providers`,`_blank`)}:void 0,meta:{closable:!0}})}},[c,t?.id,e,D,h,y,p]),M=(0,Z.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&O&&(e.preventDefault(),j())},[O,j]);return o===`prompt`?x?(0,$.jsx)(k,{overflow:`hidden`,children:(0,$.jsx)(A,{children:(0,$.jsxs)(u,{align:`stretch`,gap:3,children:[(0,$.jsxs)(a,{gap:3,children:[(0,$.jsx)(r,{display:`grid`,placeItems:`center`,width:`34px`,height:`34px`,bg:`bg.surface`,borderWidth:`1px`,borderColor:`border`,borderRadius:`10px`,children:(0,$.jsx)(K,{size:18})}),(0,$.jsxs)(r,{children:[(0,$.jsx)(l,{fontWeight:`semibold`,fontSize:`sm`,children:h?`Refine with AI`:`Draft with AI`}),(0,$.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:h?`Your draft is ready to shape.`:`Start from an idea, not a form.`})]})]}),(0,$.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:h?`Ask for harder edge cases, clearer criteria, or a different persona.`:`Describe the behavior you care about and AI will draft the situation and criteria.`}),(0,$.jsxs)(i,{colorPalette:`orange`,size:`sm`,onClick:()=>s(`input`),"aria-label":`Generate with AI`,children:[(0,$.jsx)(K,{size:14}),h?`Refine the draft`:`Start a draft`]}),(0,$.jsx)(Ne,{model:w.data?.model})]})})}):(0,$.jsx)(k,{children:(0,$.jsx)(A,{children:(0,$.jsxs)(u,{align:`stretch`,gap:3,children:[(0,$.jsxs)(a,{gap:3,children:[(0,$.jsx)(r,{p:2,bg:`orange.100`,borderRadius:`md`,color:`orange.600`,children:(0,$.jsx)(S,{as:m,boxSize:4})}),(0,$.jsx)(l,{fontWeight:`semibold`,fontSize:`sm`,children:`Model Provider Required`})]}),(0,$.jsxs)(l,{fontSize:`xs`,color:`fg.muted`,children:[`Scenarios require a model provider to run.`,` `,(0,$.jsx)(g,{href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,color:`blue.500`,fontWeight:`medium`,children:`Configure model provider`})]}),(0,$.jsx)(i,{colorPalette:`blue`,asChild:!0,size:`sm`,children:(0,$.jsx)(`a`,{"data-testid":`scenario-ai-configure-model-provider-button`,href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,children:`Configure model provider`})})]})})}):(0,$.jsx)(k,{overflow:`hidden`,children:(0,$.jsx)(A,{children:(0,$.jsxs)(u,{align:`stretch`,gap:3,children:[(0,$.jsxs)(a,{justify:`space-between`,children:[(0,$.jsxs)(a,{gap:3,children:[(0,$.jsx)(r,{display:`grid`,placeItems:`center`,width:`34px`,height:`34px`,bg:`bg.surface`,borderWidth:`1px`,borderColor:`border`,borderRadius:`10px`,children:(0,$.jsx)(K,{size:18})}),(0,$.jsxs)(r,{children:[(0,$.jsx)(l,{fontWeight:`semibold`,fontSize:`sm`,children:`AI draft`}),(0,$.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:h?`Refine this draft`:`Draft this scenario`})]})]}),(0,$.jsxs)(i,{variant:`ghost`,size:`xs`,onClick:()=>s(`prompt`),children:[(0,$.jsx)(B,{size:14}),`Back`]})]}),(0,$.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:h?`Describe what should change. The form stays editable.`:`Describe what your agent does and the behavior you want to test.`}),T.ok===!1&&T.reason===`no-default`&&(0,$.jsxs)(nt,{children:[`No default model set. Configure one in`,` `,(0,$.jsx)(g,{href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,color:`blue.500`,fontWeight:`medium`,children:`Settings → Model Providers`}),`.`]}),T.ok===!1&&T.reason===`stale-default`&&(0,$.jsxs)(nt,{children:[`Your default model's provider is disabled. Configure a new default in`,` `,(0,$.jsx)(g,{href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,color:`blue.500`,fontWeight:`medium`,children:`Settings → Model Providers`}),`.`]}),b===`done`&&h&&(0,$.jsxs)(a,{gap:2,padding:2,bg:`green.50`,borderRadius:`md`,fontSize:`xs`,color:`green.700`,children:[(0,$.jsx)(S,{as:v,boxSize:3}),(0,$.jsx)(l,{children:`Generated! Review and edit the form on the left.`})]}),h&&(0,$.jsxs)(r,{borderWidth:`1px`,borderColor:`border.subtle`,borderRadius:`md`,bg:`bg.surface`,padding:2.5,children:[(0,$.jsxs)(l,{fontSize:`10px`,fontWeight:`bold`,color:`fg.muted`,letterSpacing:`0.08em`,textTransform:`uppercase`,marginBottom:1,children:[`Latest request · `,f.length,` `,f.length===1?`turn`:`turns`]}),(0,$.jsx)(l,{fontSize:`xs`,color:`fg.muted`,lineClamp:2,children:f.at(-1)})]}),(0,$.jsx)(R,{placeholder:h?`Refine: e.g., Add more edge cases about escalation`:`e.g., A customer support agent that handles refund requests. Test an angry customer who was charged twice.`,value:c,onChange:e=>d(e.target.value),onKeyDown:M,disabled:b===`generating`||E,rows:$e,fontSize:`sm`}),(0,$.jsx)(i,{colorPalette:`orange`,size:`sm`,onClick:j,disabled:!O,children:b===`generating`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(n,{size:`sm`}),`Drafting…`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{size:14}),h?`Refine with AI`:`Draft with AI`]})}),(0,$.jsx)(Ne,{model:w.data?.model})]})})})}function nt({children:e}){return(0,$.jsxs)(T,{status:`warning`,fontSize:`xs`,alignItems:`flex-start`,children:[(0,$.jsx)(D,{children:(0,$.jsx)(S,{as:m,boxSize:3})}),(0,$.jsxs)(O,{gap:2,children:[(0,$.jsx)(E,{children:e}),(0,$.jsx)(i,{colorPalette:`blue`,color:`white`,asChild:!0,size:`sm`,alignSelf:`flex-start`,children:(0,$.jsx)(`a`,{"data-testid":`scenario-ai-configure-default-model-button`,href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,children:`Configure default model`})})]})]})}function rt({form:e}){return(0,$.jsxs)(u,{align:`stretch`,gap:4,children:[(0,$.jsx)(tt,{form:e??null}),(0,$.jsx)(k,{children:(0,$.jsx)(A,{children:(0,$.jsxs)(u,{align:`stretch`,gap:3,children:[(0,$.jsx)(l,{fontWeight:`semibold`,fontSize:`sm`,children:`Writing Great Scenarios`}),(0,$.jsxs)(u,{align:`stretch`,gap:3,children:[(0,$.jsxs)(a,{align:`start`,gap:3,children:[(0,$.jsx)(S,{color:`green.500`,mt:.5,children:(0,$.jsx)(V,{size:16})}),(0,$.jsxs)(u,{align:`start`,gap:0,children:[(0,$.jsx)(l,{fontSize:`sm`,fontWeight:`medium`,children:`Define Success Clearly`}),(0,$.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:`What does 'good' look like? Be specific about expected outcomes.`})]})]}),(0,$.jsxs)(a,{align:`start`,gap:3,children:[(0,$.jsx)(S,{color:`yellow.500`,mt:.5,children:(0,$.jsx)(m,{size:16})}),(0,$.jsxs)(u,{align:`start`,gap:0,children:[(0,$.jsx)(l,{fontSize:`sm`,fontWeight:`medium`,children:`Consider Edge Cases`}),(0,$.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:`What unusual situations should your agent handle?`})]})]}),(0,$.jsxs)(a,{align:`start`,gap:3,children:[(0,$.jsx)(S,{color:`purple.500`,mt:.5,children:(0,$.jsx)(he,{size:16})}),(0,$.jsxs)(u,{align:`start`,gap:0,children:[(0,$.jsx)(l,{fontSize:`sm`,fontWeight:`medium`,children:`Think About Personas`}),(0,$.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:`Who are your users? Different users have different needs.`})]})]}),(0,$.jsxs)(a,{align:`start`,gap:3,children:[(0,$.jsx)(S,{color:`blue.500`,mt:.5,children:(0,$.jsx)(d,{size:16})}),(0,$.jsxs)(u,{align:`start`,gap:0,children:[(0,$.jsx)(l,{fontSize:`sm`,fontWeight:`medium`,children:`Conversation Flow`}),(0,$.jsx)(l,{fontSize:`xs`,color:`fg.muted`,children:`How should the conversation progress?`})]})]})]})]})})}),(0,$.jsx)(k,{children:(0,$.jsx)(A,{children:(0,$.jsxs)(u,{align:`stretch`,gap:3,children:[(0,$.jsx)(l,{fontWeight:`semibold`,fontSize:`sm`,children:`Best Practices`}),(0,$.jsxs)(N,{gap:2,listStyleType:`none`,children:[(0,$.jsxs)(P,{fontSize:`xs`,color:`fg.muted`,children:[(0,$.jsx)(F,{asChild:!0,color:`blue.500`,children:(0,$.jsx)(v,{size:14})}),`Start with small simulations to validate quickly`]}),(0,$.jsxs)(P,{fontSize:`xs`,color:`fg.muted`,children:[(0,$.jsx)(F,{asChild:!0,color:`blue.500`,children:(0,$.jsx)(v,{size:14})}),`Use specific prompts for better results`]}),(0,$.jsxs)(P,{fontSize:`xs`,color:`fg.muted`,children:[(0,$.jsx)(F,{asChild:!0,color:`blue.500`,children:(0,$.jsx)(v,{size:14})}),`Include edge cases in your testing`]}),(0,$.jsxs)(P,{fontSize:`xs`,color:`fg.muted`,children:[(0,$.jsx)(F,{asChild:!0,color:`blue.500`,children:(0,$.jsx)(v,{size:14})}),`Review metrics after each run`]})]})]})})})]})}function it({value:e,onChange:t,placeholder:n=`Add a criterion...`,disabled:r=!1}){let[o,s]=(0,Z.useState)(``),[c,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(``),g=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{c&&requestAnimationFrame(()=>g.current?.focus())},[c]);let _=()=>{o.trim()&&(t([...e,o.trim()]),s(``)),d(!1)},v=n=>{t(e.filter((e,t)=>t!==n)),p(null)},b=t=>{p(t),h(e[t]??``)},x=()=>{if(f!==null){if(m.trim()){let n=[...e];n[f]=m.trim(),t(n)}else t(e.filter((e,t)=>t!==f));p(null)}},S=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),_()),e.key===`Escape`&&(s(``),d(!1))},C=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),x()),e.key===`Escape`&&p(null)};return(0,$.jsxs)(u,{align:`stretch`,gap:2,"data-testid":`criteria-list`,children:[e.map((e,t)=>f===t?(0,$.jsxs)(a,{gap:2,align:`start`,children:[(0,$.jsxs)(l,{fontSize:`sm`,color:`fg.muted`,flexShrink:0,mt:`6px`,children:[t+1,`.`]}),(0,$.jsxs)(u,{align:`stretch`,gap:1,flex:1,children:[(0,$.jsx)(R,{value:m,onChange:e=>h(e.target.value),onKeyDown:C,onBlur:x,size:`sm`,autoresize:!0,rows:2,autoFocus:!0}),(0,$.jsxs)(a,{gap:1,children:[(0,$.jsx)(j,{type:`button`,size:`xs`,variant:`outline`,colorPalette:`red`,onClick:()=>v(t),"aria-label":`Delete criterion`,children:(0,$.jsx)(y,{size:12})}),(0,$.jsx)(re,{}),(0,$.jsx)(i,{type:`button`,size:`xs`,variant:`outline`,onMouseDown:e=>e.preventDefault(),onClick:()=>p(null),children:`Cancel`}),(0,$.jsx)(i,{type:`button`,size:`xs`,variant:`outline`,onClick:x,children:`Save`})]})]})]},t):(0,$.jsxs)(a,{gap:1,align:`start`,py:1,role:`group`,cursor:`pointer`,onClick:()=>b(t),children:[(0,$.jsxs)(l,{fontSize:`sm`,color:`fg.muted`,flexShrink:0,mt:`1px`,children:[t+1,`.`]}),(0,$.jsx)(l,{flex:1,fontSize:`sm`,whiteSpace:`pre-wrap`,children:e}),(0,$.jsx)(ve,{size:14,style:{flexShrink:0,marginTop:`2px`,color:`var(--chakra-colors-fg-muted)`}})]},t)),c&&(0,$.jsxs)(u,{align:`stretch`,gap:1,children:[(0,$.jsxs)(a,{gap:2,align:`start`,children:[(0,$.jsxs)(l,{fontSize:`sm`,color:`fg.muted`,flexShrink:0,mt:`6px`,children:[e.length+1,`.`]}),(0,$.jsx)(R,{ref:g,size:`sm`,value:o,onChange:e=>s(e.target.value),placeholder:n,flex:1,onKeyDown:S,onBlur:_,_placeholder:{color:`gray.400`,fontStyle:`italic`},autoresize:!0,rows:2})]}),(0,$.jsxs)(a,{gap:1,justify:`end`,children:[(0,$.jsx)(i,{type:`button`,size:`xs`,variant:`outline`,onMouseDown:e=>e.preventDefault(),onClick:()=>{s(``),d(!1)},children:`Cancel`}),(0,$.jsx)(i,{type:`button`,size:`xs`,variant:`outline`,onClick:_,children:`Save`})]})]}),!c&&(0,$.jsxs)(i,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>d(!0),disabled:r,alignSelf:`start`,children:[(0,$.jsx)(J,{size:14}),e.length===0?`Add the first criteria`:`Add criteria`]})]})}function at({children:e,...t}){return(0,$.jsx)(l,{fontSize:`11px`,fontWeight:`bold`,textTransform:`uppercase`,color:`fg.muted`,letterSpacing:`0.5px`,...t,children:e})}var ot=le({name:G().min(1,`Name is required`),situation:G(),criteria:ye(G()),labels:ye(G())});function st({defaultValues:e,formRef:t}){let n=oe({defaultValues:{name:``,situation:``,criteria:[],labels:[],...e},resolver:be(ot)}),{register:r,control:i,reset:a,formState:{errors:o}}=n;(0,Z.useEffect)(()=>{t?.(n)},[n,t]);let s=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{let t=e?JSON.stringify([e.name,e.situation,e.criteria,e.labels]):null;t!==s.current&&(s.current=t,e&&a({name:``,situation:``,criteria:[],labels:[],...e}))},[e,a]),(0,$.jsxs)(u,{align:`stretch`,gap:6,children:[(0,$.jsx)(u,{align:`stretch`,gap:3,children:(0,$.jsxs)(C,{invalid:!!o.name,children:[(0,$.jsx)(at,{children:`Name`}),(0,$.jsx)(q,{...r(`name`),placeholder:`e.g., Angry refund request`}),(0,$.jsx)(w,{children:o.name?.message})]})}),(0,$.jsxs)(u,{align:`stretch`,gap:3,children:[(0,$.jsxs)(u,{align:`stretch`,gap:1,children:[(0,$.jsx)(at,{children:`Situation`}),(0,$.jsx)(l,{fontSize:`13px`,color:`fg.muted`,children:`Describe the user, their context, and what they're trying to accomplish. Think about a critical path or a complex edge case.`})]}),(0,$.jsxs)(C,{invalid:!!o.situation,children:[(0,$.jsx)(R,{...r(`situation`),placeholder:`e.g., A frustrated premium subscriber who was charged twice...`,rows:5,_placeholder:{color:`gray.400`,fontStyle:`italic`}}),(0,$.jsx)(w,{children:o.situation?.message})]})]}),(0,$.jsxs)(u,{align:`stretch`,gap:3,children:[(0,$.jsxs)(u,{align:`stretch`,gap:1,children:[(0,$.jsx)(at,{children:`Criteria`}),(0,$.jsx)(l,{fontSize:`13px`,color:`fg.muted`,children:`What must the agent DO or NOT DO? e.g. "Must remain empathetic", "Must NOT offer refund without manager approval"`})]}),(0,$.jsx)(se,{name:`criteria`,control:i,render:({field:e})=>(0,$.jsx)(it,{value:e.value,onChange:e.onChange,placeholder:`e.g., Must apologize for the inconvenience`})})]})]})}function ct({label:e,value:t,onChange:n,featureKey:r,size:i=`full`}){let{project:a}=X(),o=a?.id??``,s=z.modelProvider.listAllForProjectForFrontend.useQuery({projectId:o},{enabled:!!o,refetchOnMount:!1}),c=z.modelProvider.getResolvedDefault.useQuery({projectId:o,featureKey:r},{enabled:!!o}),d=(0,Z.useMemo)(()=>{let e=(s.data?.providers??[]).filter(e=>e.enabled===!0),t=new Set(e.map(e=>e.provider)),n=[];for(let e of Le)t.has(e)&&n.push(`${e}/latest`,`${e}/latest-mini`);let r=Ee.filter(e=>e.mode===`chat`&&t.has(e.value.split(`/`)[0]??``)).map(e=>e.value),i=[];for(let t of e)for(let e of t.customModels??[])e?.modelId&&i.push(`${t.provider}/${e.modelId}`);return Array.from(new Set([...n,...i,...r]))},[s.data]),f=(0,Z.useMemo)(()=>Te(s.data?.providers??[]),[s.data]),p=c.data?.model??``;return(0,$.jsxs)(u,{align:`stretch`,gap:1,width:`full`,children:[(0,$.jsx)(l,{fontSize:`sm`,fontWeight:`medium`,children:e}),(0,$.jsx)(Re,{model:t??``,options:d,size:i,onChange:e=>n(e===`__inherit__`?null:e),inheritOption:p?{model:p,label:`Default model`}:void 0,displayNames:f})]})}function lt({open:e,onOpenChange:t,simulatorModel:n,judgeModel:r,onSimulatorChange:a,onJudgeChange:o,onConfirm:s,isRunning:c}){return(0,$.jsx)(Y.Root,{open:e,onOpenChange:e=>t(e.open),children:(0,$.jsxs)(Y.Content,{bg:`bg`,children:[(0,$.jsx)(Y.Header,{children:(0,$.jsx)(Y.Title,{children:`Choose models for this run`})}),(0,$.jsx)(Y.Body,{children:(0,$.jsxs)(u,{gap:4,align:`stretch`,children:[(0,$.jsx)(l,{fontSize:`sm`,color:`fg.muted`,children:`Pick the model that role-plays the user and the model that judges the run. Both default to your project's Default model.`}),(0,$.jsx)(ct,{label:`User simulator`,featureKey:`scenarios.user_simulator`,value:n,onChange:a}),(0,$.jsx)(ct,{label:`Judge`,featureKey:`scenarios.judge`,value:r,onChange:o})]})}),(0,$.jsxs)(Y.Footer,{children:[(0,$.jsx)(Y.ActionTrigger,{asChild:!0,children:(0,$.jsx)(i,{variant:`outline`,children:`Cancel`})}),(0,$.jsx)(i,{colorPalette:`blue`,loading:c,onClick:s,children:`Save and run`})]}),(0,$.jsx)(Y.CloseTrigger,{})]})})}function ut(e){let t=de(),{drawerOpen:n}=ge(),r=e.open??n(`scenarioEditor`);return(0,$.jsx)(dt,{...e,open:r,scenarioId:t.scenarioId})}function dt(e){let{project:t}=X(),n=ae(),{closeDrawer:r,openDrawer:o}=ge(),s=pe(),l=s&&`initialFormData`in s?s:{},u=z.useContext(),[d,f]=(0,Z.useState)(null),{runScenario:p,isRunning:m}=Ue({projectId:t?.id,projectSlug:t?.slug}),h=e.scenarioId,g=xe(`scenarios`),{target:v,setTarget:y}=We(h),[S,C]=(0,Z.useState)(null),[w,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(!1),[A,j]=(0,Z.useState)(null),[N,P]=(0,Z.useState)(null),[F,re]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{v&&!S&&C(v)},[v,S]);let L=(0,Z.useCallback)(e=>{C(e),e&&h&&y(e)},[y,h]),R=(0,Z.useCallback)(()=>{let e=e=>{let t=e.type;L({type:t,id:e.id}),_.create({title:`Agent created`,description:`"${e.name}" is now selected as the target.`,type:`success`,meta:{closable:!0}})};fe(`agentHttpEditor`,{onSave:e}),fe(`agentCodeEditor`,{onSave:e}),fe(`workflowSelector`,{onSave:e}),D(!0)},[L]),ie=e.open!==!1&&e.open!==void 0,B=e.onClose??r,{data:V}=z.scenarios.getById.useQuery({projectId:t?.id??``,id:h??``},{enabled:!!t&&!!h}),H=z.scenarios.create.useMutation({onSuccess:n=>{u.scenarios.getAll.invalidate({projectId:t?.id??``}),e.onSuccess?.(n)},onError:e=>{d&&ne({error:e,form:d,hasFormErrorSlot:!0})||I({error:e,fallbackTitle:`Couldn't create scenario`})}}),U=z.scenarios.update.useMutation({onSuccess:n=>{u.scenarios.getAll.invalidate({projectId:t?.id??``}),u.scenarios.getById.invalidate({projectId:t?.id??``,id:n.id}),e.onSuccess?.(n)},onError:e=>{d&&ne({error:e,form:d,hasFormErrorSlot:!0})||I({error:e,fallbackTitle:`Couldn't save scenario`})}}),oe=(0,Z.useCallback)(e=>{o(`scenarioEditor`,{urlParams:{scenarioId:e}},{resetStack:!0})},[o]),se=(0,Z.useCallback)(async({projectId:e,scenarioId:t,data:n,models:r})=>{try{return await U.mutateAsync({projectId:e,id:t,...n,...r??{}})}catch{return null}},[U]),ce=(0,Z.useCallback)(async({projectId:e,data:t,skipTransition:n,models:r})=>{try{let i=await H.mutateAsync({projectId:e,...t,...r??{}});return n||oe(i.id),i}catch{return null}},[H,oe]),W=(0,Z.useCallback)(e=>new Promise(t=>{De([g],()=>{ce(e).then(t)}),g.isAllowed||t(null)}),[ce,g]),G=(0,Z.useCallback)(async({data:e,skipTransition:n=!1,models:r})=>{let i=t?.id;return i?V?await se({projectId:i,scenarioId:V.id,data:e,models:r}):await W({projectId:i,data:e,skipTransition:n,models:r}):null},[t?.id,V,se,W]),le=(0,Z.useCallback)(async e=>{let n=d;if(!(!n||!t?.id||!t?.slug)){if(!e){_.create({title:`Select a target`,description:`Please select a prompt or agent to run the scenario against.`,type:`warning`,meta:{closable:!0}});return}if(e.type===`workflow`)try{let n=await u.agents.getById.fetch({id:e.id,projectId:t.id});if(n&&!we(n.config.scenarioMappings??{})){let t=()=>o(`agentWorkflowEditor`,{urlParams:{agentId:e.id}});_.create({title:`Configure scenario mappings`,description:`Map at least one scenario input — "input" or "messages" — to an agent input before running this workflow agent.`,type:`warning`,action:{label:`Open agent editor`,onClick:t},meta:{closable:!0}}),t();return}}catch{}await n.trigger()&&(P(V?.simulatorModel??null),re(V?.judgeModel??null),j(e),k(!0))}},[t?.id,t?.slug,d,u,o,V]),K=(0,Z.useCallback)(async()=>{let e=d,r=A;if(!(!e||!r||!t?.id||!t?.slug)){k(!1);try{await e.handleSubmit(async e=>{let i=await G({data:e,skipTransition:!0,models:{simulatorModel:N,judgeModel:F}});if(!i)return;y(r);let a=Ae(b.SCENARIO_BATCH).toString();p({scenarioId:i.id,target:r,batchRunId:a}),n.push(`/${t.slug}/simulations?pendingBatch=${a}`)})()}catch(e){I({error:e,fallbackTitle:`Couldn't run scenario`})}}},[d,A,t?.id,t?.slug,G,y,p,n,N,F]),de=(0,Z.useCallback)(async()=>{let e=d;e&&await e.handleSubmit(async e=>{try{await G({data:e,skipTransition:!0})&&(_.create({title:V?`Scenario updated`:`Scenario created`,type:`success`,meta:{closable:!0}}),B())}catch{}})()},[G,V,d,B]),me=(0,Z.useCallback)(e=>{f(e)},[]),q=H.isPending||U.isPending||m,J=e.initialFormData??l.initialFormData,Y=(0,Z.useMemo)(()=>V??J??void 0,[V,J]);return(0,$.jsxs)(M.Root,{open:ie,onOpenChange:({open:e})=>!e&&B(),size:`xl`,children:[(0,$.jsxs)(M.Content,{bg:`bg`,children:[(0,$.jsx)(M.CloseTrigger,{}),(0,$.jsx)(M.Header,{borderBottomWidth:`1px`,children:(0,$.jsx)(c,{size:`md`,children:V?`Edit Scenario`:`Create Scenario`})}),(0,$.jsx)(M.Body,{padding:0,overflow:`hidden`,children:(0,$.jsxs)(x,{templateColumns:`1fr 320px`,height:`full`,overflow:`hidden`,children:[(0,$.jsxs)(ee,{overflowY:`auto`,padding:6,borderRightWidth:`1px`,borderColor:`border`,children:[d&&(0,$.jsx)(te,{form:d}),(0,$.jsx)(st,{defaultValues:Y,formRef:me},h??`new`)]}),(0,$.jsx)(ee,{overflowY:`auto`,padding:4,bg:`bg.muted`,children:(0,$.jsx)(rt,{form:d})})]})}),(0,$.jsxs)(M.Footer,{borderTopWidth:`1px`,justifyContent:`space-between`,children:[d&&(0,$.jsx)(ft,{form:d}),(0,$.jsxs)(a,{gap:2,flexShrink:0,children:[(0,$.jsx)(i,{variant:`outline`,size:`sm`,onClick:B,children:`Cancel`}),(0,$.jsx)(Je,{selectedTarget:S,onTargetChange:L,onSaveAndRun:le,onSaveWithoutRunning:de,onCreateAgent:R,onCreatePrompt:()=>T(!0),isLoading:q})]})]})]}),(0,$.jsx)(lt,{open:O,onOpenChange:k,simulatorModel:N,judgeModel:F,onSimulatorChange:P,onJudgeChange:re,onConfirm:K,isRunning:q}),(0,$.jsx)(Ce,{open:E,onClose:()=>{D(!1),ue()}}),(0,$.jsx)(Oe,{open:w,onClose:()=>T(!1),onSave:e=>{L({type:`prompt`,id:e.id}),T(!1),_.create({title:`Prompt created`,description:`"${e.name}" is now selected as the target.`,type:`success`,meta:{closable:!0}})}})]})}function ft({form:e}){let t=ce({control:e.control,name:`labels`});return(0,$.jsxs)(a,{gap:2,flex:1,overflow:`hidden`,flexWrap:`wrap`,children:[(0,$.jsx)(l,{fontSize:`xs`,fontWeight:`medium`,color:`fg.muted`,flexShrink:0,children:`Labels`}),(0,$.jsx)(Fe,{labels:t,onRemove:(n,r)=>e.setValue(`labels`,t.filter((e,t)=>t!==r)),onAdd:n=>e.setValue(`labels`,[...t,n])})]})}export{dt as ScenarioFormDrawer,ut as ScenarioFormDrawerFromUrl,Ue as a,We as i,qe as n,Ke as r,ct as t};
2
- //# sourceMappingURL=ScenarioFormDrawer-BORe6ffA.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{n as i,t as a}from"./v-stack-hkuSkmCA.js";import{f as o}from"./toaster-BsYkODqs.js";import{nt as s}from"./Markdown-C9extmbX.js";import{t as c}from"./VariablesSection-hjZ5pmeK.js";var l=e(t()),u=r(),d=[{identifier:`input`,type:`str`},{identifier:`messages`,type:`str`},{identifier:`threadId`,type:`str`}],f={input:`The latest message from the simulated user`,messages:`Full conversation history as a JSON string`,threadId:`Unique identifier for the conversation thread`},p=[{identifier:`output`,type:`str`}],m={output:`The agent's response sent back to the scenario`};function h(e){let t={};for(let[n,r]of Object.entries(e))if(r.type===`source`&&r.path[0]){let e=r.path[0];t[e]={type:`source`,sourceId:`agent_input`,path:[n]}}return t}function g(e){return{id:`agent_input`,name:`Agent Inputs`,type:`evaluator`,fields:e.map(e=>({name:e.identifier,label:e.identifier,type:e.type??`str`}))}}function _(e){return{id:`agent_output`,name:`Agent Outputs`,type:`evaluator`,fields:e.map(e=>({name:e.identifier,label:e.identifier,type:e.type??`str`}))}}function v(e){let t=Object.values(e).filter(e=>e.type===`source`).map(e=>e.path[0]);return t.includes(`input`)||t.includes(`messages`)}function y({mappings:e}){return v(e)}function b({inputs:e,mappings:t,onMappingChange:r,outputs:v,outputField:y,onOutputFieldChange:b}){let x=(0,l.useMemo)(()=>h(t),[t]),S=(0,l.useMemo)(()=>g(e),[e]),C=(0,l.useMemo)(()=>Object.entries(t).filter(e=>e[1].type===`value`),[t]),w=(0,l.useMemo)(()=>_(v??[]),[v]),T=(v??[]).length>0,E=v?.[0]?.identifier??`output`,D=y===void 0?E:y,O=D!==``&&T,k=(0,l.useMemo)(()=>O?{output:{type:`source`,sourceId:`agent_output`,path:[D]}}:{},[O,D]),A=(0,l.useMemo)(()=>O?new Set:new Set([`output`]),[O]),j=(0,l.useMemo)(()=>{let e=!!x.input,t=!!x.messages;return e||t?new Set:new Set([`input`,`messages`])},[x]);return(0,u.jsxs)(a,{align:`stretch`,gap:4,children:[(0,u.jsx)(s,{}),(0,u.jsxs)(a,{align:`start`,gap:1,children:[(0,u.jsx)(i,{fontSize:`sm`,fontWeight:`medium`,children:`Scenario Mappings`}),(0,u.jsxs)(i,{fontSize:`xs`,color:`fg.muted`,children:[`Configure how this agent connects to the scenario framework. When run as a scenario target, these mappings control which data flows in and out.`,` `,(0,u.jsx)(o,{href:`https://docs.langwatch.ai/features/scenarios`,target:`_blank`,color:`blue.fg`,children:`Learn more`})]})]}),(0,u.jsxs)(n,{children:[(0,u.jsx)(c,{variables:d,onChange:()=>{},mappings:x,onMappingChange:(e,n)=>{for(let[n,i]of Object.entries(t))i.type===`source`&&i.path[0]===e&&r(n,void 0);if(n?.type===`source`&&n.path[0]){let t=n.path[0];r(t,{type:`source`,sourceId:`scenario`,path:[e]})}},availableSources:[S],showMappings:!0,canAddRemove:!1,readOnly:!0,title:`Inputs`,variableInfo:f,missingMappingIds:j,optionalHighlighting:!0,showMissingMappingsError:!1}),j.size>0&&(0,u.jsx)(i,{fontSize:`xs`,color:`fg.error`,marginTop:1,children:`Map at least one of: input or messages`}),C.length>0&&(0,u.jsx)(a,{align:`stretch`,gap:1,marginTop:2,children:C.map(([e,t])=>(0,u.jsxs)(n,{children:[(0,u.jsx)(i,{as:`span`,fontSize:`xs`,color:`fg.muted`,fontFamily:`mono`,children:e}),(0,u.jsx)(i,{as:`span`,fontSize:`xs`,color:`fg.muted`,children:`: `}),(0,u.jsx)(i,{as:`span`,fontSize:`xs`,children:t.value})]},e))})]}),v!==void 0&&(0,u.jsxs)(n,{children:[(0,u.jsx)(c,{variables:p,onChange:()=>{},mappings:k,onMappingChange:(e,t)=>{t?.type===`source`&&t.path[0]?b?.(t.path[0]):b?.(``)},availableSources:[w],showMappings:!0,canAddRemove:!1,readOnly:!0,title:`Output`,variableInfo:m,missingMappingIds:A,showMissingMappingsError:!1}),(v??[]).length===0&&(0,u.jsx)(i,{fontSize:`xs`,color:`fg.error`,marginTop:1,children:`Add at least one output to the agent`})]})]})}export{v as n,y as r,b as t};
2
- //# sourceMappingURL=ScenarioInputMappingSection-DVpK_-Qh.js.map