@langwatch/server 3.6.0 → 3.7.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 (1120) hide show
  1. package/feature-map.json +1279 -0
  2. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-C2BpUHmD.js +2 -0
  3. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-MGG9OkL5.js +6 -0
  4. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-DT7Wwgex.js +2 -0
  5. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-B_bvSihT.js +2 -0
  6. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-DTTe34qt.js +3 -0
  7. package/langwatch/dist/client/assets/AddParticipants-Cu80BF8F.js +2 -0
  8. package/langwatch/dist/client/assets/AgentHistoryDrawer-Dv3a7Uw1.js +2 -0
  9. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-BsTydMou.js +5 -0
  10. package/langwatch/dist/client/assets/AgentListDrawer-CkuGaFHx.js +2 -0
  11. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-K0PUyG8U.js +2 -0
  12. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-CMHvyQPV.js +2 -0
  13. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-B18KFX98.js +2 -0
  14. package/langwatch/dist/client/assets/AiGatewayLayout-DL7at8rW.js +2 -0
  15. package/langwatch/dist/client/assets/AnnotationsTable-CrX2ZAvY.js +2 -0
  16. package/langwatch/dist/client/assets/AreaChart-BYqCBYVe.js +2 -0
  17. package/langwatch/dist/client/assets/AutomationDrawer-gr9nl_bx.js +112 -0
  18. package/langwatch/dist/client/assets/BatchEvaluationSummary-DJGlsFFE.js +2 -0
  19. package/langwatch/dist/client/assets/BudgetEditDrawer-DA_Za9Jh.js +2 -0
  20. package/langwatch/dist/client/assets/CartesianChart-BvVgDMpj.js +54 -0
  21. package/langwatch/dist/client/assets/CascadeArchiveDialog-CRcsYqD3.js +2 -0
  22. package/langwatch/dist/client/assets/ChartCard-C-6jgIhJ.js +2 -0
  23. package/langwatch/dist/client/assets/ChartTooltip-DDBarZKG.js +4 -0
  24. package/langwatch/dist/client/assets/ChatWindow-DgNy40Dm.js +5 -0
  25. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-N8k4omh5.js +9 -0
  26. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk-B-0KIS0U.js +2 -0
  27. package/langwatch/dist/client/assets/ColorfulBlockIcons-DntRdsrM.js +6 -0
  28. package/langwatch/dist/client/assets/ColumnTypeIcon-DHpZtj81.js +2 -0
  29. package/langwatch/dist/client/assets/ConfirmDialog-Bv_GbZtR.js +2 -0
  30. package/langwatch/dist/client/assets/ContactSalesBlock-BKfDeTTe.js +2 -0
  31. package/langwatch/dist/client/assets/Conversation-BLw2XAh1.js +2 -0
  32. package/langwatch/dist/client/assets/CopyInput-D4OHtSik.js +2 -0
  33. package/langwatch/dist/client/assets/CopyableInputWithPrefix-CqmK9rdo.js +2 -0
  34. package/langwatch/dist/client/assets/CreateProjectDrawer-z3akmVmk.js +2 -0
  35. package/langwatch/dist/client/assets/CreateTeamDrawer-Cq0VeHPU.js +2 -0
  36. package/langwatch/dist/client/assets/CustomGraph-D1JcOEDG.js +2 -0
  37. package/langwatch/dist/client/assets/DashboardLayout-cHFbN-Gk.js +6 -0
  38. package/langwatch/dist/client/assets/DashboardNameDrawer-Gox6uoUt.js +2 -0
  39. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-jE8I0jR2.js +2 -0
  40. package/langwatch/dist/client/assets/DatasetEditorTable-DKIy0xQj.js +2 -0
  41. package/langwatch/dist/client/assets/DatasetPickerList-DxrvRALJ.js +2 -0
  42. package/langwatch/dist/client/assets/DatasetPreviewTable-BtNFthdy.js +2 -0
  43. package/langwatch/dist/client/assets/DatasetSelector-DnwaHRnP.js +2 -0
  44. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-CdUN3LnJ.js +2 -0
  45. package/langwatch/dist/client/assets/DeleteConfirmationDialog-DuCAmpDY.js +2 -0
  46. package/langwatch/dist/client/assets/DocsLinks-CIoxiusp.js +2 -0
  47. package/langwatch/dist/client/assets/DynamicZodForm-g1UNpH1b.js +2 -0
  48. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-BTKzOnMx.js +3 -0
  49. package/langwatch/dist/client/assets/EditModelProviderDrawer-CRJeagvH.js +4 -0
  50. package/langwatch/dist/client/assets/EditProjectDrawer-B6CJf6nC.js +2 -0
  51. package/langwatch/dist/client/assets/EmojiPickerModal-DT_Uj7SU.js +3 -0
  52. package/langwatch/dist/client/assets/EnterpriseLockedSurface-BjKgoqAx.js +2 -0
  53. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-BnIwWX8t.js +107 -0
  54. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-BMpitetN.js +2 -0
  55. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-8SJeJRen.js +2 -0
  56. package/langwatch/dist/client/assets/EvaluatorEditorShared-BJefmSxm.js +43 -0
  57. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-D9r7pDt9.js +2 -0
  58. package/langwatch/dist/client/assets/EvaluatorListDrawer-J_BFDGv3.js +2 -0
  59. package/langwatch/dist/client/assets/EvaluatorMappingsSection-DZFvYqNu.js +2 -0
  60. package/langwatch/dist/client/assets/EvaluatorSelection-DLWkQLtb.js +2 -0
  61. package/langwatch/dist/client/assets/EvaluatorSelectionBox-CPndz_g-.js +2 -0
  62. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-B1g5DjJ7.js +2 -0
  63. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-KKfZF0P-.js +2 -0
  64. package/langwatch/dist/client/assets/ExecutionState-Dh8lIhIP.js +2 -0
  65. package/langwatch/dist/client/assets/ExternalImage-As_YKOAz.js +34 -0
  66. package/langwatch/dist/client/assets/FeatureFlagsDrawer-ClPIMzIj.js +2 -0
  67. package/langwatch/dist/client/assets/FieldInfoTooltip-s2rM7SM0.js +2 -0
  68. package/langwatch/dist/client/assets/FieldsFilters-DePzLbr2.js +2 -0
  69. package/langwatch/dist/client/assets/FilterDisplay-ClLW19sO.js +2 -0
  70. package/langwatch/dist/client/assets/FilterSidebar-_ppaUjTr.js +2 -0
  71. package/langwatch/dist/client/assets/FormatMoney-CGjDIju_.js +2 -0
  72. package/langwatch/dist/client/assets/FoundryDrawer-DGKNXqmH.js +2 -0
  73. package/langwatch/dist/client/assets/FullLogo-itaa7fj-.js +2 -0
  74. package/langwatch/dist/client/assets/GovernanceLayout-DO9JArUM.js +2 -0
  75. package/langwatch/dist/client/assets/GraphsLayout-CjPYn5X3.js +2 -0
  76. package/langwatch/dist/client/assets/GroupBindingInputRow-zL2daQIU.js +2 -0
  77. package/langwatch/dist/client/assets/GuardrailsDrawer-Cf49144Z.js +91 -0
  78. package/langwatch/dist/client/assets/History-Cyg2gtXB.js +17 -0
  79. package/langwatch/dist/client/assets/HorizontalFormControl-COLSSPyK.js +2 -0
  80. package/langwatch/dist/client/assets/HoverableBigText-BLoq2yxD.js +2 -0
  81. package/langwatch/dist/client/assets/InstallCliCard-DvH3ygIs.js +2 -0
  82. package/langwatch/dist/client/assets/IntegratePaneShell-DmBxXblY.js +8 -0
  83. package/langwatch/dist/client/assets/InviteMemberDrawer-BPyf9yg9.js +2 -0
  84. package/langwatch/dist/client/assets/LLMModelCostDrawer-Ddduogw2.js +2 -0
  85. package/langwatch/dist/client/assets/LangyContextTarget-C6xwYVGg.js +2 -0
  86. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-BYKcrVD_.js +2 -0
  87. package/langwatch/dist/client/assets/Legend-DoNXU8yt.js +6 -0
  88. package/langwatch/dist/client/assets/Line-DVmhil3S.js +2 -0
  89. package/langwatch/dist/client/assets/LineChart-JT5Tcp_D.js +2 -0
  90. package/langwatch/dist/client/assets/ListTable-sDgRCJ9e.js +2 -0
  91. package/langwatch/dist/client/assets/LoadingScreen-XWYCoKBN.js +2 -0
  92. package/langwatch/dist/client/assets/Markdown-CjWZDaeK.js +3 -0
  93. package/langwatch/dist/client/assets/MenuLink-CCPiKN-n.js +2 -0
  94. package/langwatch/dist/client/assets/MessageCard-CbSQoH1U.js +2 -0
  95. package/langwatch/dist/client/assets/MetadataTag-B1XwJcdK.js +5 -0
  96. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-DKgydORR.js +2 -0
  97. package/langwatch/dist/client/assets/ModelProviderScreen-CoHgPhxe.js +2 -0
  98. package/langwatch/dist/client/assets/ModelSelector-dbR6V8hR.js +2 -0
  99. package/langwatch/dist/client/assets/MyLayout-BCFIoFGU.js +2 -0
  100. package/langwatch/dist/client/assets/NavigationFooter-BV-y1Ccf.js +2 -0
  101. package/langwatch/dist/client/assets/NewWorkflowForm-DgYkTq45.js +2 -0
  102. package/langwatch/dist/client/assets/NoDataInfoBlock-CqSD7i-D.js +2 -0
  103. package/langwatch/dist/client/assets/OnboardingContainer-jXD3w576.js +2 -0
  104. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-3RfgPXAt.js +2 -0
  105. package/langwatch/dist/client/assets/OpsPageShell-BOi49ML9.js +2 -0
  106. package/langwatch/dist/client/assets/OttlEditor-7MOJI6SZ.js +3 -0
  107. package/langwatch/dist/client/assets/OverflownText-DITOBs56.js +2 -0
  108. package/langwatch/dist/client/assets/ProjectAvatar-BOH7ULC-.js +2 -0
  109. package/langwatch/dist/client/assets/ProjectLangyLayout-D6uI0rgc.js +82 -0
  110. package/langwatch/dist/client/assets/PromptEditorDrawer-CawpMwv2.js +2 -0
  111. package/langwatch/dist/client/assets/PromptListDrawer-mJuEu6sl.js +2 -0
  112. package/langwatch/dist/client/assets/PropertySectionTitle-DM-QD_X7.js +37 -0
  113. package/langwatch/dist/client/assets/ProviderModelSelector-bu_UnJgn.js +2 -0
  114. package/langwatch/dist/client/assets/ProviderScopeChips-DAith1M3.js +2 -0
  115. package/langwatch/dist/client/assets/PushToCopiesDialog-ZhJKOmpB.js +2 -0
  116. package/langwatch/dist/client/assets/RandomColorAvatar-D4Pjdi5E.js +2 -0
  117. package/langwatch/dist/client/assets/ReferenceDot-BNL3mb_4.js +2 -0
  118. package/langwatch/dist/client/assets/RenderInputOutput-B6SIoJEE.js +261 -0
  119. package/langwatch/dist/client/assets/ScenarioFormDrawer-BreFWAEL.js +2 -0
  120. package/langwatch/dist/client/assets/ScenarioInputMappingSection-BO7xuz3Q.js +2 -0
  121. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-B7tqZUtg.js +3 -0
  122. package/langwatch/dist/client/assets/ScopeChipPicker-DW0UYA9z.js +2 -0
  123. package/langwatch/dist/client/assets/SearchInput-Q-TBf_3C.js +2 -0
  124. package/langwatch/dist/client/assets/SectionNavigationLayout-DELi2l8C.js +2 -0
  125. package/langwatch/dist/client/assets/SelectDatasetDrawer-z00GrHUJ.js +2 -0
  126. package/langwatch/dist/client/assets/SelectionActionBar-CmpsxKus.js +2 -0
  127. package/langwatch/dist/client/assets/SeriesFilterDrawer-DBl29Nft.js +2 -0
  128. package/langwatch/dist/client/assets/SettingsLayout-TFI-annu.js +2 -0
  129. package/langwatch/dist/client/assets/SetupWithAgentButton-ChiBWonD.js +4 -0
  130. package/langwatch/dist/client/assets/ShikiCommandBox-CvJJv-UK.js +5 -0
  131. package/langwatch/dist/client/assets/SpanDetails-Bf9G4Q7r.js +3 -0
  132. package/langwatch/dist/client/assets/SubscriptionPage-DojUae0-.js +2 -0
  133. package/langwatch/dist/client/assets/SuiteFormDrawer-BkSwohnS.js +2 -0
  134. package/langwatch/dist/client/assets/TabButton-IdHwwJvZ.js +3 -0
  135. package/langwatch/dist/client/assets/TableCell-BOc9hDdP.js +2 -0
  136. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-BkACL4B0.js +2 -0
  137. package/langwatch/dist/client/assets/TeamForm-CoGCbaXE.js +2 -0
  138. package/langwatch/dist/client/assets/TeamUserRoleField-DaCIsPr0.js +2 -0
  139. package/langwatch/dist/client/assets/TraceDetails-D_HPr1ii.js +9 -0
  140. package/langwatch/dist/client/assets/TraceDetailsDrawer-CFMdgFO6.js +2 -0
  141. package/langwatch/dist/client/assets/TraceIdPeek-DmsxeUlT.js +2 -0
  142. package/langwatch/dist/client/assets/TracesMapping-qL9_JqHU.js +2 -0
  143. package/langwatch/dist/client/assets/UpgradeModal-DaVSEBO2.js +92 -0
  144. package/langwatch/dist/client/assets/UpgradeModalContent-DUimbawj.js +2 -0
  145. package/langwatch/dist/client/assets/UploadCSVDrawer-2fH0dmmN.js +3 -0
  146. package/langwatch/dist/client/assets/VariablesSection-BOZytTct.js +2 -0
  147. package/langwatch/dist/client/assets/VersionBadge-BNwXa8K1.js +2 -0
  148. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-BvCK6x4i.js +1161 -0
  149. package/langwatch/dist/client/assets/ViewAutomationDrawer-CBoDRCfF.js +2 -0
  150. package/langwatch/dist/client/assets/VirtualKeySecretReveal-z9OhRCRq.js +54 -0
  151. package/langwatch/dist/client/assets/WelcomeLayout-veH9XP9n.js +2 -0
  152. package/langwatch/dist/client/assets/WithFeatureFlagGuard-D09SSCsN.js +2 -0
  153. package/langwatch/dist/client/assets/WithPermissionGuard-BBKTBlhW.js +2 -0
  154. package/langwatch/dist/client/assets/WorkflowCard-CUUg0Jb9.js +2 -0
  155. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-DQPMmz5y.js +2 -0
  156. package/langwatch/dist/client/assets/_...path_-Dl2wM_Co.js +2 -0
  157. package/langwatch/dist/client/assets/_Uint8Array-CVdXk-9j.js +2 -0
  158. package/langwatch/dist/client/assets/__...path__-dvuiwbR8.js +22 -0
  159. package/langwatch/dist/client/assets/_baseAssignValue-D1riHssy.js +2 -0
  160. package/langwatch/dist/client/assets/_baseClone-Btuu3kUN.js +2 -0
  161. package/langwatch/dist/client/assets/_baseEach-D42E_cYN.js +2 -0
  162. package/langwatch/dist/client/assets/_baseFor-DjY96g6R.js +2 -0
  163. package/langwatch/dist/client/assets/_experiment_-C41VDj2_.js +2 -0
  164. package/langwatch/dist/client/assets/_id_-6sd4MNOz.js +2 -0
  165. package/langwatch/dist/client/assets/_id_-7yHuXZsv.js +2 -0
  166. package/langwatch/dist/client/assets/_id_-BiJsS6cZ.js +2 -0
  167. package/langwatch/dist/client/assets/_id_-BxNfkyzv.js +2 -0
  168. package/langwatch/dist/client/assets/_id_-DjvwAa9I.js +2 -0
  169. package/langwatch/dist/client/assets/_id_-Dv1Ha5td.js +2 -0
  170. package/langwatch/dist/client/assets/_id_-qIAmzXj9.js +2 -0
  171. package/langwatch/dist/client/assets/_project_-WrF4swO9.js +8 -0
  172. package/langwatch/dist/client/assets/_runId_-uzKEhtNe.js +7 -0
  173. package/langwatch/dist/client/assets/_shell-CBKyngpn.js +2 -0
  174. package/langwatch/dist/client/assets/_slug_-B7rGjVou.js +17 -0
  175. package/langwatch/dist/client/assets/_slug_-BM065qSQ.js +2 -0
  176. package/langwatch/dist/client/assets/_slug_-DTN4hRRD.js +2 -0
  177. package/langwatch/dist/client/assets/_team_-DFCS7cLC.js +2 -0
  178. package/langwatch/dist/client/assets/_workflow_-Dm-v5D1q.js +25 -0
  179. package/langwatch/dist/client/assets/_workflow_-Od6Ld1fG.js +3 -0
  180. package/langwatch/dist/client/assets/accept-DfhUN0Qn.js +2 -0
  181. package/langwatch/dist/client/assets/activity-ikjk_AlK.js +1 -0
  182. package/langwatch/dist/client/assets/agents-BbtJ377u.js +2 -0
  183. package/langwatch/dist/client/assets/alerts-ikjk_AlK.js +1 -0
  184. package/langwatch/dist/client/assets/all-Ba9m0fkb.js +2 -0
  185. package/langwatch/dist/client/assets/analytics-BfdI38ZC.js +2 -0
  186. package/langwatch/dist/client/assets/annotation-scores-BY75kcBF.js +2 -0
  187. package/langwatch/dist/client/assets/annotations-DIwdkHHY.js +2 -0
  188. package/langwatch/dist/client/assets/anomaly-rules-BmEX38RD.js +2 -0
  189. package/langwatch/dist/client/assets/api-keys-BPifPObL.js +4 -0
  190. package/langwatch/dist/client/assets/asaplangy-BjnuNv4L.js +5 -0
  191. package/langwatch/dist/client/assets/audit-log-2z_Ec4XU.js +2 -0
  192. package/langwatch/dist/client/assets/auth-BJm09Odd.js +2 -0
  193. package/langwatch/dist/client/assets/authentication-D4a-VSlX.js +2 -0
  194. package/langwatch/dist/client/assets/authorize-BBjJ2zjw.js +2 -0
  195. package/langwatch/dist/client/assets/authorize-CHqAf3Jd.js +2 -0
  196. package/langwatch/dist/client/assets/automations-Bds5nLI_.js +2 -0
  197. package/langwatch/dist/client/assets/automations-ikjk_AlK.js +1 -0
  198. package/langwatch/dist/client/assets/billing-plans-K7xawVCS.js +2 -0
  199. package/langwatch/dist/client/assets/blank-DsMQ71pJ.js +2 -0
  200. package/langwatch/dist/client/assets/blobs-Dc7nKnmO.js +2 -0
  201. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-57B2W0rq.js +133 -0
  202. package/langwatch/dist/client/assets/budgets-dKK-wYyg.js +3 -0
  203. package/langwatch/dist/client/assets/bug-reports-BxCDdVoL.js +2 -0
  204. package/langwatch/dist/client/assets/cache-rules-Ds14kJAt.js +2 -0
  205. package/langwatch/dist/client/assets/choose-X7Hyqyyu.js +2 -0
  206. package/langwatch/dist/client/assets/chunk-EX3LRPZG-DF3ACR9i.js +232 -0
  207. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-CIlmcu0O.js +3 -0
  208. package/langwatch/dist/client/assets/chunk-PUDLZKDR-Dj_zAVVr.js +157 -0
  209. package/langwatch/dist/client/assets/chunk-RYQCIY6F-CjWAFgxP.js +2 -0
  210. package/langwatch/dist/client/assets/chunk-V7JOEXUC-BgVcuIhi.js +207 -0
  211. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-Cw7PXCaC.js +2 -0
  212. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-Cw7PXCaC.js +2 -0
  213. package/langwatch/dist/client/assets/codeAgentConfig-B0NzDmlQ.js +7 -0
  214. package/langwatch/dist/client/assets/codingDefaultSync-ebaLPfnN.js +2 -0
  215. package/langwatch/dist/client/assets/configure-CrbOTC5S.js +4 -0
  216. package/langwatch/dist/client/assets/custom-D8Emd7w-.js +12 -0
  217. package/langwatch/dist/client/assets/custom_evaluator-BtYta_Dj.js +31 -0
  218. package/langwatch/dist/client/assets/dagre-ClO7SEns.js +2 -0
  219. package/langwatch/dist/client/assets/dagre-VKFMJZFB-evqDS8UW.js +5 -0
  220. package/langwatch/dist/client/assets/data-privacy-GCArtTFq.js +2 -0
  221. package/langwatch/dist/client/assets/data-retention-BtLi9M98.js +2 -0
  222. package/langwatch/dist/client/assets/datasets-DeNG9KNJ.js +2 -0
  223. package/langwatch/dist/client/assets/debounce-r-8TPIqh.js +2 -0
  224. package/langwatch/dist/client/assets/defaultModelState-ByR0bEhZ.js +2 -0
  225. package/langwatch/dist/client/assets/dejaview-BF8VqQGI.js +2 -0
  226. package/langwatch/dist/client/assets/departments-D2L92_Qa.js +2 -0
  227. package/langwatch/dist/client/assets/devices-C8e0So_K.js +2 -0
  228. package/langwatch/dist/client/assets/dist-B1XMO10X.js +6 -0
  229. package/langwatch/dist/client/assets/drawerFromUrl-BZIwwDLm.js +2 -0
  230. package/langwatch/dist/client/assets/edit-pIB-bQM_.js +62 -0
  231. package/langwatch/dist/client/assets/email-suppressions-Bq0lhfwG.js +2 -0
  232. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-BqEHcyA0.js +86 -0
  233. package/langwatch/dist/client/assets/error-2TTx9xpE.js +2 -0
  234. package/langwatch/dist/client/assets/evaluations-0Nc6rWP8.js +2 -0
  235. package/langwatch/dist/client/assets/evaluations-DHmE-YCm.js +2 -0
  236. package/langwatch/dist/client/assets/evaluators-DKbY-ajr.js +146 -0
  237. package/langwatch/dist/client/assets/evaluators-v4CDfsOE.js +2 -0
  238. package/langwatch/dist/client/assets/experiments-BRN0rGL9.js +1 -0
  239. package/langwatch/dist/client/assets/external-link-CtHzR85H.js +2 -0
  240. package/langwatch/dist/client/assets/feature-flags-BDyiuat4.js +2 -0
  241. package/langwatch/dist/client/assets/fetchSSE-GcVBzE9n.js +3 -0
  242. package/langwatch/dist/client/assets/fieldset-CIGh0Uxg.js +2 -0
  243. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-BOl-6oqO.js +1 -0
  244. package/langwatch/dist/client/assets/forgot-password-DjvudMXW.js +2 -0
  245. package/langwatch/dist/client/assets/formatMoney-ByqR-Rrd.js +2 -0
  246. package/langwatch/dist/client/assets/foundry-Co_CpgKb.js +477 -0
  247. package/langwatch/dist/client/assets/gateway-B0y3Tz7G.js +2 -0
  248. package/langwatch/dist/client/assets/getEvaluator-pJF3ehUx.js +2 -0
  249. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-Bbj-WQTj.js +2 -0
  250. package/langwatch/dist/client/assets/governance-BtuwwuRw.js +2 -0
  251. package/langwatch/dist/client/assets/graphlib-CwcejmA1.js +2 -0
  252. package/langwatch/dist/client/assets/groups-DTVa4dcS.js +2 -0
  253. package/langwatch/dist/client/assets/guardrails-BnCJsF0m.js +2 -0
  254. package/langwatch/dist/client/assets/http-BIG04f8c.js +7 -0
  255. package/langwatch/dist/client/assets/identifierUtils-B1LGnOD5.js +2 -0
  256. package/langwatch/dist/client/assets/immer-BdlOHsfO.js +14 -0
  257. package/langwatch/dist/client/assets/index-DtiounXP.js +68 -0
  258. package/langwatch/dist/client/assets/ingestion-source-detail-hmCupOG1.js +19 -0
  259. package/langwatch/dist/client/assets/ingestion-sources-sv7eDiMD.js +12 -0
  260. package/langwatch/dist/client/assets/integrations-CM7dYrOG.js +2 -0
  261. package/langwatch/dist/client/assets/isArrayLikeObject-6lUBvOUd.js +2 -0
  262. package/langwatch/dist/client/assets/isSymbol-n0ARt1yC.js +2 -0
  263. package/langwatch/dist/client/assets/langyHomeSuggestions-Oyh_vavj.js +2 -0
  264. package/langwatch/dist/client/assets/latestAliases-D_86OOcA.js +2 -0
  265. package/langwatch/dist/client/assets/license-CYtxniam.js +2 -0
  266. package/langwatch/dist/client/assets/loadModelCatalog-31-xT4W4.js +2 -0
  267. package/langwatch/dist/client/assets/map-BCpZm9Sc.js +2 -0
  268. package/langwatch/dist/client/assets/mappingValidation-DPNnGAuO.js +2 -0
  269. package/langwatch/dist/client/assets/me-1nxAV6zO.js +2 -0
  270. package/langwatch/dist/client/assets/me-wWuZrajs.js +7 -0
  271. package/langwatch/dist/client/assets/members-Bau-5CPK.js +2 -0
  272. package/langwatch/dist/client/assets/mermaid.core-oQEgcWXd.js +12 -0
  273. package/langwatch/dist/client/assets/messages-kTp5NaSm.js +2 -0
  274. package/langwatch/dist/client/assets/metrics-Cpovzjg4.js +2 -0
  275. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-OcYZSGuC.js +97 -0
  276. package/langwatch/dist/client/assets/model-costs-DiRpmy-H.js +2 -0
  277. package/langwatch/dist/client/assets/model-providers-DRq5Q7er.js +2 -0
  278. package/langwatch/dist/client/assets/modelProviderHelpers-STUAbD02.js +2 -0
  279. package/langwatch/dist/client/assets/my-queue-veenWZWf.js +2 -0
  280. package/langwatch/dist/client/assets/normalizeComparison-CDNTbMdZ.js +2 -0
  281. package/langwatch/dist/client/assets/not-found-Nu1odKyD.js +2 -0
  282. package/langwatch/dist/client/assets/now-BQGidI_5.js +2 -0
  283. package/langwatch/dist/client/assets/onboarding-BWJ038z8.js +2 -0
  284. package/langwatch/dist/client/assets/online-evaluations-k-WwH1ML.js +2 -0
  285. package/langwatch/dist/client/assets/ops-D9am3MEi.js +2 -0
  286. package/langwatch/dist/client/assets/organizations-CMTT_97U.js +2 -0
  287. package/langwatch/dist/client/assets/pages-D5p_o0LC.js +2 -0
  288. package/langwatch/dist/client/assets/persistence-jLMreGhL.js +2 -0
  289. package/langwatch/dist/client/assets/plans-v8LBcXa9.js +2 -0
  290. package/langwatch/dist/client/assets/product-CAja-R4_.js +2 -0
  291. package/langwatch/dist/client/assets/project-DbS0dYGR.js +2 -0
  292. package/langwatch/dist/client/assets/projections-B4mXJEvc.js +2 -0
  293. package/langwatch/dist/client/assets/projects-DnYaZW6w.js +2 -0
  294. package/langwatch/dist/client/assets/promptHandle-CQ_zUeRB.js +2 -0
  295. package/langwatch/dist/client/assets/prompts-BAxWZhm5.js +8 -0
  296. package/langwatch/dist/client/assets/radio-group-y_PtCP6q.js +2 -0
  297. package/langwatch/dist/client/assets/registry-KCPOxhx0.js +2 -0
  298. package/langwatch/dist/client/assets/reports-B_Y4pHYs.js +2 -0
  299. package/langwatch/dist/client/assets/request-bU99z82H.js +2 -0
  300. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-BYId9zaF.js +85 -0
  301. package/langwatch/dist/client/assets/reset-password-zMr6-23y.js +2 -0
  302. package/langwatch/dist/client/assets/role-bindings-BvPzAUj1.js +2 -0
  303. package/langwatch/dist/client/assets/roles-CjwqOKoo.js +2 -0
  304. package/langwatch/dist/client/assets/routing-policies-C7yjQJuY.js +5 -0
  305. package/langwatch/dist/client/assets/scenarios-CdrzuCtM.js +2 -0
  306. package/langwatch/dist/client/assets/scheduler-CfXVwiOa.js +2 -0
  307. package/langwatch/dist/client/assets/schedules-ikjk_AlK.js +1 -0
  308. package/langwatch/dist/client/assets/scim-CGJ8MwNu.js +2 -0
  309. package/langwatch/dist/client/assets/secrets-DZef0jTb.js +2 -0
  310. package/langwatch/dist/client/assets/segment-group-EW0AyNd-.js +2 -0
  311. package/langwatch/dist/client/assets/segmented-control-SS4Yq_Ti.js +2 -0
  312. package/langwatch/dist/client/assets/select-C5JAM7Gf.js +2 -0
  313. package/langwatch/dist/client/assets/send-TZcuPW9Z.js +2 -0
  314. package/langwatch/dist/client/assets/sequenceView-vubFe0e7.js +5 -0
  315. package/langwatch/dist/client/assets/seriesOptions-0YtTiTzZ.js +1011 -0
  316. package/langwatch/dist/client/assets/settings-CfAtn_PH.js +2 -0
  317. package/langwatch/dist/client/assets/setup-In6OXn3a.js +2 -0
  318. package/langwatch/dist/client/assets/shikiAdapter-lZp3oxvk.js +3 -0
  319. package/langwatch/dist/client/assets/signin-CMU_rlgk.js +2 -0
  320. package/langwatch/dist/client/assets/signup-CYKtIfrB.js +2 -0
  321. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-CKO-9021.js +2 -0
  322. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-BnXuBsJr.js +2 -0
  323. package/langwatch/dist/client/assets/subscription-CBiotOK9.js +3 -0
  324. package/langwatch/dist/client/assets/subscriptions-D55paZaw.js +2 -0
  325. package/langwatch/dist/client/assets/suggestionUI-KPD1is36.js +106 -0
  326. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-B0ptAIsf.js +3 -0
  327. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-DzqdWH4x.js +9 -0
  328. package/langwatch/dist/client/assets/switch-BOt3Np6s.js +2 -0
  329. package/langwatch/dist/client/assets/switch-BnyTlP1L.js +2 -0
  330. package/langwatch/dist/client/assets/tabs-D8PJtlU3.js +2 -0
  331. package/langwatch/dist/client/assets/teams-CE3UCC84.js +2 -0
  332. package/langwatch/dist/client/assets/teams-CxmVu0zp.js +2 -0
  333. package/langwatch/dist/client/assets/tool-catalog-DTTKCxyF.js +7 -0
  334. package/langwatch/dist/client/assets/toolIcons-n2K5OHKw.js +2 -0
  335. package/langwatch/dist/client/assets/tooltip-CYWvZEOf.js +2 -0
  336. package/langwatch/dist/client/assets/topic-clustering-C37AbBFy.js +2 -0
  337. package/langwatch/dist/client/assets/topics-rviNSdYR.js +2 -0
  338. package/langwatch/dist/client/assets/traceExecutor-DQlsNg6N.js +55 -0
  339. package/langwatch/dist/client/assets/traces-DnlS2lMP.js +289 -0
  340. package/langwatch/dist/client/assets/tracesMapping-DJvqZsfB.js +3 -0
  341. package/langwatch/dist/client/assets/tracking-6s9dX1_R.js +2 -0
  342. package/langwatch/dist/client/assets/types-BeNupKna.js +2 -0
  343. package/langwatch/dist/client/assets/types-ChBnYRcc.js +2 -0
  344. package/langwatch/dist/client/assets/types-DXVP3BA7.js +2 -0
  345. package/langwatch/dist/client/assets/types-atzk7phf.js +2 -0
  346. package/langwatch/dist/client/assets/unsubscribe-uUCCImkQ.js +2 -0
  347. package/langwatch/dist/client/assets/usage-DBjFOkD3.js +2 -0
  348. package/langwatch/dist/client/assets/usage-De8DbhVE.js +2 -0
  349. package/langwatch/dist/client/assets/use-breakpoint-BdbDgj6J.js +2 -0
  350. package/langwatch/dist/client/assets/use-generic-onboarding-flow-CQjNkSYf.js +2 -0
  351. package/langwatch/dist/client/assets/useActivePlan-DZotDN7k.js +2 -0
  352. package/langwatch/dist/client/assets/useAllPromptsForProject-yZtsv1kJ.js +2 -0
  353. package/langwatch/dist/client/assets/useAnnotationQueues-BJ8Vb6SZ.js +2 -0
  354. package/langwatch/dist/client/assets/useAvailableEvaluators-C6cl3TSs.js +2 -0
  355. package/langwatch/dist/client/assets/useCyclingVerb-CMPh6fkl.js +2 -0
  356. package/langwatch/dist/client/assets/useDepartmentColumn-C4l1_4BR.js +2 -0
  357. package/langwatch/dist/client/assets/useEvaluationsV3Store-CMnxA8pt.js +2 -0
  358. package/langwatch/dist/client/assets/useExportTraces-DzTqFSlc.js +2 -0
  359. package/langwatch/dist/client/assets/useFeatureFlag-CKFU9lsX.js +2 -0
  360. package/langwatch/dist/client/assets/useInviteActions-CNRL7usw.js +2 -0
  361. package/langwatch/dist/client/assets/useLicenseEnforcement-BIiCopDI.js +2 -0
  362. package/langwatch/dist/client/assets/useLiteMemberGuard-ChV0lUs4.js +43 -0
  363. package/langwatch/dist/client/assets/usePersonalContext-D-HsFKQo.js +2 -0
  364. package/langwatch/dist/client/assets/useProjectSpanNames-BKMm-yLN.js +2 -0
  365. package/langwatch/dist/client/assets/useProjectsForCopy-BPGjhWUl.js +2 -0
  366. package/langwatch/dist/client/assets/useRunViaApiTabs-BGv2kygX.js +50 -0
  367. package/langwatch/dist/client/assets/useSavedViews-DH6Poufh.js +2 -0
  368. package/langwatch/dist/client/assets/useShowLangy-DvcJ7z1U.js +2 -0
  369. package/langwatch/dist/client/assets/useSimulationUpdateListener-CcqEq03v.js +2 -0
  370. package/langwatch/dist/client/assets/useTargetName-CByKsdU-.js +2 -0
  371. package/langwatch/dist/client/assets/useTargetNameMap-C8kjUxhY.js +2 -0
  372. package/langwatch/dist/client/assets/useTraceDetailsDrawer-BgcNOady.js +2 -0
  373. package/langwatch/dist/client/assets/useTraceUpdateListener-D5UNLNbd.js +2 -0
  374. package/langwatch/dist/client/assets/useUrlScopeFilter-D0HZ-mkj.js +2 -0
  375. package/langwatch/dist/client/assets/useWorkflowStore-CVvg8K0Q.js +8 -0
  376. package/langwatch/dist/client/assets/users-802bPAIG.js +2 -0
  377. package/langwatch/dist/client/assets/users-CWkRn-Tl.js +2 -0
  378. package/langwatch/dist/client/assets/users-DhJ0ZUHi.js +2 -0
  379. package/langwatch/dist/client/assets/v3-D65ySaeM.js +2 -0
  380. package/langwatch/dist/client/assets/variables-BpyyIkKh.js +396 -0
  381. package/langwatch/dist/client/assets/viewStore-Bq2Jqc8R.js +2 -0
  382. package/langwatch/dist/client/assets/virtual-keys-Cbeg9TQU.js +2 -0
  383. package/langwatch/dist/client/assets/welcome-Bh4D-qW7.js +16 -0
  384. package/langwatch/dist/client/assets/wizard-spBSxei8.js +2 -0
  385. package/langwatch/dist/client/assets/workbench-Bid7wYk7.js +2 -0
  386. package/langwatch/dist/client/assets/workflows-1TodsGOO.js +3 -0
  387. package/langwatch/dist/client/assets/wrap-noqflF_F.js +2 -0
  388. package/langwatch/dist/client/index.html +1 -1
  389. package/langwatch/package.json +1 -1
  390. package/langwatch/packages/api/README.md +283 -0
  391. package/langwatch/packages/api/node_modules/.bin/tsc +21 -0
  392. package/langwatch/packages/api/node_modules/.bin/tsserver +21 -0
  393. package/langwatch/packages/api/node_modules/.bin/vitest +21 -0
  394. package/langwatch/packages/api/package.json +39 -0
  395. package/langwatch/packages/api/src/__tests__/builder.unit.test.ts +1135 -0
  396. package/langwatch/packages/api/src/__tests__/errorLogging.integration.test.ts +130 -0
  397. package/langwatch/packages/api/src/__tests__/errors.unit.test.ts +331 -0
  398. package/langwatch/packages/api/src/__tests__/sse.unit.test.ts +247 -0
  399. package/langwatch/packages/api/src/__tests__/versioning.unit.test.ts +379 -0
  400. package/langwatch/packages/api/src/builder.ts +163 -0
  401. package/langwatch/packages/api/src/errors.ts +255 -0
  402. package/langwatch/packages/api/src/index.ts +41 -0
  403. package/langwatch/packages/api/src/middleware.ts +227 -0
  404. package/langwatch/packages/api/src/pipeline.ts +254 -0
  405. package/langwatch/packages/api/src/response.ts +38 -0
  406. package/langwatch/packages/api/src/route-mounting.ts +140 -0
  407. package/langwatch/packages/api/src/sse.ts +179 -0
  408. package/langwatch/packages/api/src/types.ts +217 -0
  409. package/langwatch/packages/api/src/version-builder.ts +131 -0
  410. package/langwatch/packages/api/src/versioning.ts +221 -0
  411. package/langwatch/packages/api/tsconfig.json +16 -0
  412. package/langwatch/packages/api/vitest.config.ts +8 -0
  413. package/langwatch/packages/automations/README.md +17 -0
  414. package/langwatch/packages/automations/node_modules/.bin/liquid +21 -0
  415. package/langwatch/packages/automations/node_modules/.bin/liquidjs +21 -0
  416. package/langwatch/packages/automations/node_modules/.bin/marked +21 -0
  417. package/langwatch/packages/automations/node_modules/.bin/tsc +21 -0
  418. package/langwatch/packages/automations/node_modules/.bin/tsserver +21 -0
  419. package/langwatch/packages/automations/node_modules/.bin/vitest +21 -0
  420. package/langwatch/packages/automations/package.json +43 -0
  421. package/langwatch/packages/automations/src/cadences.ts +50 -0
  422. package/langwatch/packages/automations/src/enums.ts +24 -0
  423. package/langwatch/packages/automations/src/index.ts +26 -0
  424. package/langwatch/packages/automations/src/providers/__tests__/webhook.unit.test.ts +147 -0
  425. package/langwatch/packages/automations/src/providers/annotationQueue.ts +26 -0
  426. package/langwatch/packages/automations/src/providers/dataset.ts +43 -0
  427. package/langwatch/packages/automations/src/providers/email.ts +36 -0
  428. package/langwatch/packages/automations/src/providers/slack.ts +96 -0
  429. package/langwatch/packages/automations/src/providers/types.ts +84 -0
  430. package/langwatch/packages/automations/src/providers/webhook.ts +137 -0
  431. package/langwatch/packages/automations/src/templating/__tests__/alertDefaultsRender.unit.test.ts +133 -0
  432. package/langwatch/packages/automations/src/templating/__tests__/blockKitAllowlist.unit.test.ts +723 -0
  433. package/langwatch/packages/automations/src/templating/__tests__/engine.unit.test.ts +106 -0
  434. package/langwatch/packages/automations/src/templating/__tests__/exampleContext.unit.test.ts +39 -0
  435. package/langwatch/packages/automations/src/templating/__tests__/fixtures.ts +42 -0
  436. package/langwatch/packages/automations/src/templating/__tests__/graphAlertTemplateContext.unit.test.ts +260 -0
  437. package/langwatch/packages/automations/src/templating/__tests__/markdown.unit.test.ts +71 -0
  438. package/langwatch/packages/automations/src/templating/__tests__/renderEmail.unit.test.ts +183 -0
  439. package/langwatch/packages/automations/src/templating/__tests__/renderSlack.unit.test.ts +233 -0
  440. package/langwatch/packages/automations/src/templating/__tests__/renderWebhookBody.unit.test.ts +145 -0
  441. package/langwatch/packages/automations/src/templating/__tests__/reportDefaultsRender.unit.test.ts +148 -0
  442. package/langwatch/packages/automations/src/templating/__tests__/templateContext.unit.test.ts +137 -0
  443. package/langwatch/packages/automations/src/templating/__tests__/validate.unit.test.ts +28 -0
  444. package/langwatch/packages/automations/src/templating/banner.ts +29 -0
  445. package/langwatch/packages/automations/src/templating/blockKitAllowlist.ts +662 -0
  446. package/langwatch/packages/automations/src/templating/defaults.ts +400 -0
  447. package/langwatch/packages/automations/src/templating/emailLayout.ts +59 -0
  448. package/langwatch/packages/automations/src/templating/engine.ts +255 -0
  449. package/langwatch/packages/automations/src/templating/exampleContext.ts +171 -0
  450. package/langwatch/packages/automations/src/templating/markdown.ts +61 -0
  451. package/langwatch/packages/automations/src/templating/renderEmail.ts +112 -0
  452. package/langwatch/packages/automations/src/templating/renderSlack.ts +184 -0
  453. package/langwatch/packages/automations/src/templating/renderWebhookBody.ts +105 -0
  454. package/langwatch/packages/automations/src/templating/renderWithFallback.ts +54 -0
  455. package/langwatch/packages/automations/src/templating/templateContext.ts +812 -0
  456. package/langwatch/packages/automations/src/templating/validate.ts +24 -0
  457. package/langwatch/packages/automations/tsconfig.json +18 -0
  458. package/langwatch/packages/automations/vitest.config.ts +8 -0
  459. package/langwatch/packages/observability/README.md +86 -0
  460. package/langwatch/packages/observability/node_modules/.bin/esbuild +18 -0
  461. package/langwatch/packages/observability/node_modules/.bin/pino +21 -0
  462. package/langwatch/packages/observability/node_modules/.bin/pino-pretty +21 -0
  463. package/langwatch/packages/observability/node_modules/.bin/tsc +21 -0
  464. package/langwatch/packages/observability/node_modules/.bin/tsserver +21 -0
  465. package/langwatch/packages/observability/node_modules/.bin/vitest +21 -0
  466. package/langwatch/packages/observability/package.json +44 -0
  467. package/langwatch/packages/observability/src/__tests__/browserSafety.unit.test.ts +14 -0
  468. package/langwatch/packages/observability/src/__tests__/context.unit.test.ts +228 -0
  469. package/langwatch/packages/observability/src/__tests__/logger.unit.test.ts +227 -0
  470. package/langwatch/packages/observability/src/__tests__/requestLogging.unit.test.ts +252 -0
  471. package/langwatch/packages/observability/src/__tests__/runtimeSafety.unit.test.ts +96 -0
  472. package/langwatch/packages/observability/src/__tests__/traceContext.unit.test.ts +108 -0
  473. package/langwatch/packages/observability/src/constants.ts +46 -0
  474. package/langwatch/packages/observability/src/context/core.ts +124 -0
  475. package/langwatch/packages/observability/src/context/index.ts +19 -0
  476. package/langwatch/packages/observability/src/context/logging.ts +24 -0
  477. package/langwatch/packages/observability/src/index.ts +32 -0
  478. package/langwatch/packages/observability/src/logger.ts +280 -0
  479. package/langwatch/packages/observability/src/request/requestLogging.ts +131 -0
  480. package/langwatch/packages/observability/src/trace/traceContext.ts +56 -0
  481. package/langwatch/packages/observability/tsconfig.json +16 -0
  482. package/langwatch/packages/observability/vitest.config.ts +8 -0
  483. package/langwatch/packages/react-rum/node_modules/.bin/tsc +21 -0
  484. package/langwatch/packages/react-rum/node_modules/.bin/tsserver +21 -0
  485. package/langwatch/packages/react-rum/node_modules/.bin/vitest +21 -0
  486. package/langwatch/packages/react-rum/package.json +43 -0
  487. package/langwatch/packages/react-rum/src/browserTracing.ts +130 -0
  488. package/langwatch/packages/react-rum/src/constants.ts +67 -0
  489. package/langwatch/packages/react-rum/src/index.ts +34 -0
  490. package/langwatch/packages/react-rum/src/navigation.test.ts +188 -0
  491. package/langwatch/packages/react-rum/src/navigation.ts +189 -0
  492. package/langwatch/packages/react-rum/src/navigationContextManager.ts +71 -0
  493. package/langwatch/packages/react-rum/src/sampling.test.ts +182 -0
  494. package/langwatch/packages/react-rum/src/sampling.ts +124 -0
  495. package/langwatch/packages/react-rum/src/session.test.ts +85 -0
  496. package/langwatch/packages/react-rum/src/session.ts +62 -0
  497. package/langwatch/packages/react-rum/src/sessionSpanProcessor.ts +34 -0
  498. package/langwatch/packages/react-rum/tsconfig.json +18 -0
  499. package/langwatch/packages/react-rum/vitest.config.ts +8 -0
  500. package/langwatch/packages/redaction/node_modules/.bin/tsc +21 -0
  501. package/langwatch/packages/redaction/node_modules/.bin/tsserver +21 -0
  502. package/langwatch/packages/redaction/node_modules/.bin/vitest +21 -0
  503. package/langwatch/packages/redaction/package.json +29 -0
  504. package/langwatch/packages/redaction/src/__tests__/secrets.unit.test.ts +226 -0
  505. package/langwatch/packages/redaction/src/__tests__/sessionReport.unit.test.ts +239 -0
  506. package/langwatch/packages/redaction/src/index.ts +29 -0
  507. package/langwatch/packages/redaction/src/markers.ts +101 -0
  508. package/langwatch/packages/redaction/src/secrets.ts +286 -0
  509. package/langwatch/packages/redaction/src/sessionReport.ts +356 -0
  510. package/langwatch/packages/redaction/tsconfig.json +18 -0
  511. package/langwatch/packages/ssrf/node_modules/.bin/tsc +21 -0
  512. package/langwatch/packages/ssrf/node_modules/.bin/tsserver +21 -0
  513. package/langwatch/packages/ssrf/node_modules/.bin/vitest +21 -0
  514. package/langwatch/packages/ssrf/package.json +29 -0
  515. package/langwatch/packages/ssrf/src/index.test.ts +72 -0
  516. package/langwatch/packages/ssrf/src/index.ts +320 -0
  517. package/langwatch/packages/ssrf/tsconfig.json +18 -0
  518. package/langwatch/packages/ssrf/vitest.config.ts +8 -0
  519. package/langwatch/scripts/__tests__/bug-report-discovery.unit.test.ts +37 -0
  520. package/langwatch/scripts/build-mcp-server.sh +15 -0
  521. package/langwatch/scripts/generate-langy-skills.ts +10 -0
  522. package/langwatch/scripts/update-matrix-provider-keys.ts +1 -1
  523. package/langwatch/src/components/EditModelProviderDrawer.tsx +7 -1
  524. package/langwatch/src/components/settings/ModelProviderCredentialsSection.tsx +13 -21
  525. package/langwatch/src/components/settings/ModelProviderForm.tsx +32 -3
  526. package/langwatch/src/components/settings/__tests__/ModelProviderForm.credential-preservation.integration.test.tsx +277 -0
  527. package/langwatch/src/components/settings/__tests__/ModelProviderForm.credential-requiredness.integration.test.tsx +260 -0
  528. package/langwatch/src/components/settings/__tests__/modelProviderDrawerHarness.tsx +152 -0
  529. package/langwatch/src/features/onboarding/components/sections/model-provider/ModelProviderSetup.tsx +7 -3
  530. package/langwatch/src/hooks/__tests__/useProviderFormSubmit.integration.test.tsx +7 -1
  531. package/langwatch/src/hooks/useModelProviderApiKeyValidation.ts +25 -4
  532. package/langwatch/src/hooks/useModelProviderFields.ts +45 -37
  533. package/langwatch/src/hooks/useModelProviderForm.ts +2 -0
  534. package/langwatch/src/hooks/useProviderFormSubmit.ts +27 -19
  535. package/langwatch/src/hooks/useRequiredCredentialKeys.ts +38 -0
  536. package/langwatch/src/pages/settings/__tests__/model-providers.no-project.integration.test.tsx +508 -0
  537. package/langwatch/src/pages/settings/model-providers.tsx +19 -97
  538. package/langwatch/src/server/api/routers/__tests__/prepareEnvKeys.unit.test.ts +56 -0
  539. package/langwatch/src/server/api/routers/modelProviders.ts +146 -15
  540. package/langwatch/src/server/api/routers/modelProviders.utils.ts +1 -10
  541. package/langwatch/src/server/app-layer/traces/__tests__/audio-model-cost.unit.test.ts +133 -0
  542. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/_constants.ts +6 -0
  543. package/langwatch/src/server/app-layer/traces/model-cost-matching.ts +17 -1
  544. package/langwatch/src/server/app-layer/traces/repositories/__tests__/span-storage.clickhouse.repository.unit.test.ts +6 -0
  545. package/langwatch/src/server/app-layer/traces/repositories/span-storage.clickhouse.repository.ts +6 -0
  546. package/langwatch/src/server/gateway/__tests__/config.materialiser.integration.test.ts +132 -3
  547. package/langwatch/src/server/gateway/config.materialiser.ts +11 -9
  548. package/langwatch/src/server/modelProviders/__tests__/modelProvider.credentialPreservation.integration.test.ts +206 -0
  549. package/langwatch/src/server/modelProviders/__tests__/modelProvider.deleteScope.integration.test.ts +0 -4
  550. package/langwatch/src/server/modelProviders/__tests__/modelProvider.noProject.integration.test.ts +748 -0
  551. package/langwatch/src/server/modelProviders/__tests__/modelProvider.repository.integration.test.ts +3 -3
  552. package/langwatch/src/server/modelProviders/__tests__/modelProvider.repository.unit.test.ts +7 -8
  553. package/langwatch/src/server/modelProviders/__tests__/modelProvider.service.extraHeaders.unit.test.ts +0 -5
  554. package/langwatch/src/server/modelProviders/__tests__/modelProvider.service.unit.test.ts +5 -1
  555. package/langwatch/src/server/modelProviders/__tests__/registry.unit.test.ts +31 -0
  556. package/langwatch/src/server/modelProviders/llmModelCost.tsx +20 -2
  557. package/langwatch/src/server/modelProviders/llmModels.json +736 -209
  558. package/langwatch/src/server/modelProviders/llmModels.overlay.json +149 -2
  559. package/langwatch/src/server/modelProviders/llmModels.types.ts +9 -2
  560. package/langwatch/src/server/modelProviders/modelProvider.repository.ts +10 -12
  561. package/langwatch/src/server/modelProviders/modelProvider.service.ts +142 -34
  562. package/langwatch/src/server/modelProviders/registry.ts +45 -15
  563. package/langwatch/src/server/tracer/collector/cost.ts +15 -2
  564. package/langwatch/src/utils/__tests__/modelProviderCredentialRules.unit.test.ts +259 -0
  565. package/langwatch/src/utils/__tests__/modelProviderHelpers.unit.test.ts +12 -0
  566. package/langwatch/src/utils/modelProviderHelpers.ts +207 -16
  567. package/package.json +5 -1
  568. package/packages/handled-error/node_modules/.bin/tsc +21 -0
  569. package/packages/handled-error/node_modules/.bin/tsserver +21 -0
  570. package/packages/handled-error/node_modules/.bin/vitest +21 -0
  571. package/packages/handled-error/package.json +31 -0
  572. package/packages/handled-error/src/handled-error.test.ts +305 -0
  573. package/packages/handled-error/src/handled-error.ts +431 -0
  574. package/packages/handled-error/src/index.ts +16 -0
  575. package/packages/handled-error/tsconfig.json +22 -0
  576. package/packages/langy/node_modules/.bin/tsc +21 -0
  577. package/packages/langy/node_modules/.bin/tsserver +21 -0
  578. package/packages/langy/node_modules/.bin/vitest +21 -0
  579. package/packages/langy/package.json +40 -0
  580. package/packages/langy/src/cards/cliJson.ts +95 -0
  581. package/packages/langy/src/cards/cliJson.unit.test.ts +80 -0
  582. package/packages/langy/src/cards/created-resource.unit.test.ts +137 -0
  583. package/packages/langy/src/cards/derived-safe.ts +265 -0
  584. package/packages/langy/src/cards/derived-safe.unit.test.ts +283 -0
  585. package/packages/langy/src/cards/digest.ts +247 -0
  586. package/packages/langy/src/cards/digest.unit.test.ts +230 -0
  587. package/packages/langy/src/cards/handled-error.ts +697 -0
  588. package/packages/langy/src/cards/handled-error.unit.test.ts +795 -0
  589. package/packages/langy/src/cards/index.ts +51 -0
  590. package/packages/langy/src/cards/primitives.ts +113 -0
  591. package/packages/langy/src/cards/promotion.unit.test.ts +253 -0
  592. package/packages/langy/src/cards/registry.ts +450 -0
  593. package/packages/langy/src/cards/registry.unit.test.ts +141 -0
  594. package/packages/langy/src/cards/schemas.ts +561 -0
  595. package/packages/langy/src/cards/tool-result.ts +151 -0
  596. package/packages/langy/src/cards/tool-result.unit.test.ts +37 -0
  597. package/packages/langy/src/constants.ts +253 -0
  598. package/packages/langy/src/event-sourcing/contracts/cursor.ts +46 -0
  599. package/packages/langy/src/event-sourcing/contracts/cursor.unit.test.ts +66 -0
  600. package/packages/langy/src/event-sourcing/contracts/events.ts +345 -0
  601. package/packages/langy/src/event-sourcing/contracts/turnWire.ts +81 -0
  602. package/packages/langy/src/event-sourcing/folds/conversationFold.ts +413 -0
  603. package/packages/langy/src/event-sourcing/folds/messageMap.ts +71 -0
  604. package/packages/langy/src/event-sourcing/folds/turnFold.ts +372 -0
  605. package/packages/langy/src/event-sourcing/folds/turnFold.unit.test.ts +217 -0
  606. package/packages/langy/src/event-sourcing/turnPhase.ts +124 -0
  607. package/packages/langy/src/event-sourcing/turnPhase.unit.test.ts +110 -0
  608. package/packages/langy/src/event-sourcing/turnProjection.ts +120 -0
  609. package/packages/langy/src/event-sourcing/turnProjection.unit.test.ts +207 -0
  610. package/packages/langy/src/index.ts +16 -0
  611. package/packages/langy/src/inline-channel/choices.ts +136 -0
  612. package/packages/langy/src/inline-channel/choices.unit.test.ts +213 -0
  613. package/packages/langy/src/inline-channel/fence.ts +125 -0
  614. package/packages/langy/src/inline-channel/fence.unit.test.ts +112 -0
  615. package/packages/langy/src/inline-channel/parts.ts +85 -0
  616. package/packages/langy/src/inline-channel/parts.unit.test.ts +100 -0
  617. package/packages/langy/src/inline-channel/preview.ts +68 -0
  618. package/packages/langy/src/inline-channel/preview.unit.test.ts +116 -0
  619. package/packages/langy/src/inline-channel/salvage.ts +260 -0
  620. package/packages/langy/src/inline-channel/salvage.unit.test.ts +135 -0
  621. package/packages/langy/src/json.ts +47 -0
  622. package/packages/langy/tsconfig.json +22 -0
  623. package/packages/server/dist/cli.cjs +11045 -10616
  624. package/python-sdk/src/langwatch/openai.py +107 -28
  625. package/skills/.env.example +1 -0
  626. package/skills/.release-please-shim +1 -0
  627. package/skills/CHANGELOG.md +158 -0
  628. package/skills/README.md +99 -0
  629. package/skills/_compiled/README.md +43 -0
  630. package/skills/_compiled/generate.sh +31 -0
  631. package/skills/_compiled/native/agent-best-practices/SKILL.md +91 -0
  632. package/skills/_compiled/native/agent-improve/SKILL.md +133 -0
  633. package/skills/_compiled/native/agent-performance/SKILL.md +125 -0
  634. package/skills/_compiled/native/datasets/SKILL.md +437 -0
  635. package/skills/_compiled/native/debug-instrumentation/SKILL.md +104 -0
  636. package/skills/_compiled/native/debug-with-langwatch/SKILL.md +109 -0
  637. package/skills/_compiled/native/eval-triage/SKILL.md +87 -0
  638. package/skills/_compiled/native/evaluate-multimodal/SKILL.md +121 -0
  639. package/skills/_compiled/native/evaluations/SKILL.md +58 -0
  640. package/skills/_compiled/native/experiments/SKILL.md +191 -0
  641. package/skills/_compiled/native/generate-rag-dataset/SKILL.md +123 -0
  642. package/skills/_compiled/native/github/SKILL.md +107 -0
  643. package/skills/_compiled/native/level-up/SKILL.md +149 -0
  644. package/skills/_compiled/native/online-evaluations/SKILL.md +179 -0
  645. package/skills/_compiled/native/prompts/SKILL.md +187 -0
  646. package/skills/_compiled/native/scenarios/SKILL.md +924 -0
  647. package/skills/_compiled/native/setup-lw/SKILL.md +82 -0
  648. package/skills/_compiled/native/test-cli-usability/SKILL.md +109 -0
  649. package/skills/_compiled/native/test-compliance/SKILL.md +160 -0
  650. package/skills/_compiled/native/tracing/SKILL.md +115 -0
  651. package/skills/_compiler/compile.ts +181 -0
  652. package/skills/_compiler/native.ts +74 -0
  653. package/skills/_lib/feature-skills.ts +66 -0
  654. package/skills/_lib/frontmatter.ts +21 -0
  655. package/skills/_lib/mdx-inline.ts +148 -0
  656. package/skills/_publish/sync.ts +73 -0
  657. package/skills/_shared/api-key-setup.mdx +1 -0
  658. package/skills/_shared/cli-install.mdx +1 -0
  659. package/skills/_shared/cli-setup.mdx +15 -0
  660. package/skills/_shared/consultant-mode.mdx +9 -0
  661. package/skills/_shared/plan-limits.mdx +8 -0
  662. package/skills/_shared/projects-and-api-keys.mdx +13 -0
  663. package/skills/_tests/README.md +47 -0
  664. package/skills/_tests/agent-best-practices.scenario.test.ts +79 -0
  665. package/skills/_tests/agent-improve.scenario.test.ts +90 -0
  666. package/skills/_tests/agent-performance.scenario.test.ts +110 -0
  667. package/skills/_tests/claude-code-adapter.test.ts +70 -0
  668. package/skills/_tests/cli-auth.scenario.test.ts +171 -0
  669. package/skills/_tests/cli-comprehensive.scenario.test.ts +171 -0
  670. package/skills/_tests/cli-crud.scenario.test.ts +245 -0
  671. package/skills/_tests/cli-gateway-coding-agents.scenario.test.ts +597 -0
  672. package/skills/_tests/cli-gateway.scenario.test.ts +254 -0
  673. package/skills/_tests/cli-projects-api-keys.scenario.test.ts +182 -0
  674. package/skills/_tests/cli-suites.scenario.test.ts +234 -0
  675. package/skills/_tests/datasets.scenario.test.ts +586 -0
  676. package/skills/_tests/docs-skills-pages.test.ts +206 -0
  677. package/skills/_tests/evaluation-skill-boundaries.test.ts +84 -0
  678. package/skills/_tests/experiments-faithfulness.scenario.test.ts +80 -0
  679. package/skills/_tests/experiments-python-langgraph.scenario.test.ts +80 -0
  680. package/skills/_tests/experiments-python-openai.scenario.test.ts +110 -0
  681. package/skills/_tests/experiments-rag.scenario.test.ts +88 -0
  682. package/skills/_tests/experiments-typescript-vercel.scenario.test.ts +80 -0
  683. package/skills/_tests/fixtures/cli-prompts/python-with-prompts/main.py +24 -0
  684. package/skills/_tests/fixtures/python-agno/main.py +14 -0
  685. package/skills/_tests/fixtures/python-google-adk/main.py +28 -0
  686. package/skills/_tests/fixtures/python-health-agent/main.py +32 -0
  687. package/skills/_tests/fixtures/python-langgraph/main.py +35 -0
  688. package/skills/_tests/fixtures/python-openai/main.py +36 -0
  689. package/skills/_tests/fixtures/python-rag-agent/main.py +53 -0
  690. package/skills/_tests/fixtures/typescript-mastra/index.ts +11 -0
  691. package/skills/_tests/fixtures/typescript-vercel/index.ts +16 -0
  692. package/skills/_tests/fixtures/typescript-voice/index.ts +18 -0
  693. package/skills/_tests/helpers/claude-code-adapter.ts +387 -0
  694. package/skills/_tests/helpers/experiments-scenario.ts +197 -0
  695. package/skills/_tests/helpers/judge-model.ts +12 -0
  696. package/skills/_tests/level-up.scenario.test.ts +236 -0
  697. package/skills/_tests/native-skills.test.ts +191 -0
  698. package/skills/_tests/online-evaluations.scenario.test.ts +257 -0
  699. package/skills/_tests/prompts-cli.scenario.test.ts +330 -0
  700. package/skills/_tests/prompts.scenario.test.ts +434 -0
  701. package/skills/_tests/publish-sync.test.ts +119 -0
  702. package/skills/_tests/recipes.scenario.test.ts +343 -0
  703. package/skills/_tests/scenarios.scenario.test.ts +884 -0
  704. package/skills/_tests/tracing.scenario.test.ts +472 -0
  705. package/skills/_tests/voice-factories.test.ts +60 -0
  706. package/skills/agent-improve/SKILL.mdx +100 -0
  707. package/skills/agent-performance/SKILL.mdx +102 -0
  708. package/skills/datasets/SKILL.mdx +416 -0
  709. package/skills/evaluations/SKILL.mdx +57 -0
  710. package/skills/experiments/SKILL.mdx +155 -0
  711. package/skills/github/SKILL.mdx +107 -0
  712. package/skills/initial-prompt.md +66 -0
  713. package/skills/level-up/SKILL.mdx +112 -0
  714. package/skills/online-evaluations/SKILL.mdx +150 -0
  715. package/skills/package.json +53 -0
  716. package/skills/pnpm-lock.yaml +4862 -0
  717. package/skills/pnpm-workspace.yaml +2 -0
  718. package/skills/prompts/SKILL.mdx +151 -0
  719. package/skills/recipes/README.md +30 -0
  720. package/skills/recipes/agent-best-practices/SKILL.mdx +84 -0
  721. package/skills/recipes/debug-instrumentation/SKILL.mdx +88 -0
  722. package/skills/recipes/debug-with-langwatch/SKILL.mdx +97 -0
  723. package/skills/recipes/eval-triage/SKILL.mdx +75 -0
  724. package/skills/recipes/evaluate-multimodal/SKILL.mdx +110 -0
  725. package/skills/recipes/generate-rag-dataset/SKILL.mdx +105 -0
  726. package/skills/recipes/setup-lw/SKILL.mdx +71 -0
  727. package/skills/recipes/test-cli-usability/SKILL.mdx +106 -0
  728. package/skills/recipes/test-compliance/SKILL.mdx +149 -0
  729. package/skills/scenarios/SKILL.mdx +874 -0
  730. package/skills/tracing/SKILL.mdx +88 -0
  731. package/skills/tsconfig.json +15 -0
  732. package/skills/version.txt +1 -0
  733. package/skills/vitest.config.ts +7 -0
  734. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-BQSucfOX.js +0 -2
  735. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-DAsTHYTP.js +0 -6
  736. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-B5Ck48cm.js +0 -2
  737. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-C8HFvayF.js +0 -2
  738. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-BRzya-3u.js +0 -3
  739. package/langwatch/dist/client/assets/AddParticipants-DGPUGXt7.js +0 -2
  740. package/langwatch/dist/client/assets/AgentHistoryDrawer-D13d_z7X.js +0 -2
  741. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-CuT-fXSu.js +0 -5
  742. package/langwatch/dist/client/assets/AgentListDrawer-CWtvhmue.js +0 -2
  743. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-BRHSlvwQ.js +0 -2
  744. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-CylJD3xL.js +0 -2
  745. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-CaoZTrdq.js +0 -2
  746. package/langwatch/dist/client/assets/AiGatewayLayout-B5Q-EfZV.js +0 -2
  747. package/langwatch/dist/client/assets/AnnotationsTable-DoO83AX9.js +0 -2
  748. package/langwatch/dist/client/assets/AreaChart-CXmFZ9PN.js +0 -2
  749. package/langwatch/dist/client/assets/AutomationDrawer-Bv4nX8y6.js +0 -112
  750. package/langwatch/dist/client/assets/BatchEvaluationSummary-uqdSLrh7.js +0 -2
  751. package/langwatch/dist/client/assets/BudgetEditDrawer-CGUdeHXR.js +0 -2
  752. package/langwatch/dist/client/assets/CartesianChart-D35vYym3.js +0 -54
  753. package/langwatch/dist/client/assets/CascadeArchiveDialog-DSo9Fwed.js +0 -2
  754. package/langwatch/dist/client/assets/ChartCard-DgQ4fTGc.js +0 -2
  755. package/langwatch/dist/client/assets/ChartTooltip-Cf8ESsQ9.js +0 -4
  756. package/langwatch/dist/client/assets/ChatWindow-DplHBlw_.js +0 -5
  757. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-CPxNogVm.js +0 -9
  758. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk-BdUx3xAP.js +0 -2
  759. package/langwatch/dist/client/assets/ColorfulBlockIcons-CUrsa--K.js +0 -6
  760. package/langwatch/dist/client/assets/ColumnTypeIcon-DNzTCt_2.js +0 -2
  761. package/langwatch/dist/client/assets/ConfirmDialog-DTpkLGhm.js +0 -2
  762. package/langwatch/dist/client/assets/ContactSalesBlock-BaXLliHv.js +0 -2
  763. package/langwatch/dist/client/assets/Conversation-DZIYz2Vp.js +0 -2
  764. package/langwatch/dist/client/assets/CopyInput-Csb1U32e.js +0 -2
  765. package/langwatch/dist/client/assets/CopyableInputWithPrefix-C3PRtdkW.js +0 -2
  766. package/langwatch/dist/client/assets/CreateProjectDrawer-32NvkFfD.js +0 -2
  767. package/langwatch/dist/client/assets/CreateTeamDrawer-DtGf5dkO.js +0 -2
  768. package/langwatch/dist/client/assets/CustomGraph-C3a1gzo6.js +0 -2
  769. package/langwatch/dist/client/assets/DashboardLayout-RHGL-98_.js +0 -6
  770. package/langwatch/dist/client/assets/DashboardNameDrawer-DD8bwnCt.js +0 -2
  771. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-DiY-VkTs.js +0 -2
  772. package/langwatch/dist/client/assets/DatasetEditorTable-CwI345qA.js +0 -2
  773. package/langwatch/dist/client/assets/DatasetPickerList-CpHDt0t8.js +0 -2
  774. package/langwatch/dist/client/assets/DatasetPreviewTable-v8OUUAB3.js +0 -2
  775. package/langwatch/dist/client/assets/DatasetSelector-isPOzukH.js +0 -2
  776. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-BI7NSI6A.js +0 -2
  777. package/langwatch/dist/client/assets/DeleteConfirmationDialog-7K0S0Qdq.js +0 -2
  778. package/langwatch/dist/client/assets/DocsLinks-NNRxMwQU.js +0 -2
  779. package/langwatch/dist/client/assets/DynamicZodForm-3XwhQhOl.js +0 -2
  780. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-MYW_WiO2.js +0 -3
  781. package/langwatch/dist/client/assets/EditModelProviderDrawer-Isp2BSHG.js +0 -4
  782. package/langwatch/dist/client/assets/EditProjectDrawer-Dj2lYKdO.js +0 -2
  783. package/langwatch/dist/client/assets/EmojiPickerModal-DdZxZuTV.js +0 -3
  784. package/langwatch/dist/client/assets/EnterpriseLockedSurface-CxLn8Im_.js +0 -2
  785. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-DIFGzOw4.js +0 -107
  786. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-Cm114u5E.js +0 -2
  787. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-aCxccvFM.js +0 -2
  788. package/langwatch/dist/client/assets/EvaluatorEditorShared-DiLlkD4v.js +0 -43
  789. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-Bv3sLSRP.js +0 -2
  790. package/langwatch/dist/client/assets/EvaluatorListDrawer-eUbPJehC.js +0 -2
  791. package/langwatch/dist/client/assets/EvaluatorMappingsSection-DvSTsuT8.js +0 -2
  792. package/langwatch/dist/client/assets/EvaluatorSelection-Bi_Ud8sy.js +0 -2
  793. package/langwatch/dist/client/assets/EvaluatorSelectionBox-v8iA4p4D.js +0 -2
  794. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-DlwvjPGU.js +0 -2
  795. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-ul5Ud4lG.js +0 -2
  796. package/langwatch/dist/client/assets/ExecutionState-DKBVAVTm.js +0 -2
  797. package/langwatch/dist/client/assets/ExternalImage-DbtOSrKl.js +0 -34
  798. package/langwatch/dist/client/assets/FeatureFlagsDrawer-YiildcJp.js +0 -2
  799. package/langwatch/dist/client/assets/FieldInfoTooltip-CXhYVsTQ.js +0 -2
  800. package/langwatch/dist/client/assets/FieldsFilters-CrGJyKXz.js +0 -2
  801. package/langwatch/dist/client/assets/FilterDisplay-BT6B5ZoZ.js +0 -2
  802. package/langwatch/dist/client/assets/FilterSidebar-0UgGuTeu.js +0 -2
  803. package/langwatch/dist/client/assets/FormatMoney-CEzwUDkl.js +0 -2
  804. package/langwatch/dist/client/assets/FoundryDrawer-BIy5SFvr.js +0 -2
  805. package/langwatch/dist/client/assets/FullLogo-EwD3nY0N.js +0 -2
  806. package/langwatch/dist/client/assets/GovernanceLayout-COAapH9g.js +0 -2
  807. package/langwatch/dist/client/assets/GraphsLayout-ygWQTw_g.js +0 -2
  808. package/langwatch/dist/client/assets/GroupBindingInputRow-DF_WY6iQ.js +0 -2
  809. package/langwatch/dist/client/assets/GuardrailsDrawer-BIq6RhSh.js +0 -91
  810. package/langwatch/dist/client/assets/History-V1jF0Epn.js +0 -17
  811. package/langwatch/dist/client/assets/HorizontalFormControl-CLz9xuFM.js +0 -2
  812. package/langwatch/dist/client/assets/HoverableBigText-CxXucdYS.js +0 -2
  813. package/langwatch/dist/client/assets/InstallCliCard-SGRlvABl.js +0 -2
  814. package/langwatch/dist/client/assets/IntegratePaneShell--xX7Q_FZ.js +0 -8
  815. package/langwatch/dist/client/assets/InviteMemberDrawer-BgkE2My_.js +0 -2
  816. package/langwatch/dist/client/assets/LLMModelCostDrawer-Be2PXHIC.js +0 -2
  817. package/langwatch/dist/client/assets/LangyContextTarget-DUSindiC.js +0 -2
  818. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-C1PAs5gE.js +0 -2
  819. package/langwatch/dist/client/assets/Legend-UkJ5OBun.js +0 -6
  820. package/langwatch/dist/client/assets/Line-Bq29STZQ.js +0 -2
  821. package/langwatch/dist/client/assets/LineChart-DjFD6yv4.js +0 -2
  822. package/langwatch/dist/client/assets/ListTable-CSs4ttpJ.js +0 -2
  823. package/langwatch/dist/client/assets/LoadingScreen-D0JSh0Q2.js +0 -2
  824. package/langwatch/dist/client/assets/Markdown-Dm0jXfOR.js +0 -3
  825. package/langwatch/dist/client/assets/MenuLink-CCRiOtxz.js +0 -2
  826. package/langwatch/dist/client/assets/MessageCard-DqgrJCJ6.js +0 -2
  827. package/langwatch/dist/client/assets/MetadataTag-W5I0CKzN.js +0 -5
  828. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-XgGjvYky.js +0 -2
  829. package/langwatch/dist/client/assets/ModelProviderScreen-BtASYmAL.js +0 -2
  830. package/langwatch/dist/client/assets/ModelSelector-BBb1wHS_.js +0 -2
  831. package/langwatch/dist/client/assets/MyLayout-DX7ntheK.js +0 -2
  832. package/langwatch/dist/client/assets/NavigationFooter-CJaT-F50.js +0 -2
  833. package/langwatch/dist/client/assets/NewWorkflowForm-BrvVQJNY.js +0 -2
  834. package/langwatch/dist/client/assets/NoDataInfoBlock-B3c1WwDO.js +0 -2
  835. package/langwatch/dist/client/assets/OnboardingContainer-DRrQV_9c.js +0 -2
  836. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-DHbPXgEV.js +0 -2
  837. package/langwatch/dist/client/assets/OpsPageShell-BamkwuvB.js +0 -2
  838. package/langwatch/dist/client/assets/OttlEditor-BhsdMVM9.js +0 -3
  839. package/langwatch/dist/client/assets/OverflownText-DhbWrtC6.js +0 -2
  840. package/langwatch/dist/client/assets/ProjectAvatar--gOpUll9.js +0 -2
  841. package/langwatch/dist/client/assets/ProjectLangyLayout-C7WNak1h.js +0 -82
  842. package/langwatch/dist/client/assets/PromptEditorDrawer-k_dFbREL.js +0 -2
  843. package/langwatch/dist/client/assets/PromptListDrawer-B-C4Cl6I.js +0 -2
  844. package/langwatch/dist/client/assets/PropertySectionTitle-CK67qoQ9.js +0 -37
  845. package/langwatch/dist/client/assets/ProviderModelSelector-Cm89XYO8.js +0 -2
  846. package/langwatch/dist/client/assets/ProviderScopeChips-S0Ctqbwg.js +0 -2
  847. package/langwatch/dist/client/assets/PushToCopiesDialog-C3eBpZ9F.js +0 -2
  848. package/langwatch/dist/client/assets/RandomColorAvatar-CTya_4BQ.js +0 -2
  849. package/langwatch/dist/client/assets/ReferenceDot-St9tkyoA.js +0 -2
  850. package/langwatch/dist/client/assets/RenderInputOutput-DOVNZVJ2.js +0 -261
  851. package/langwatch/dist/client/assets/ScenarioFormDrawer-9224CX_d.js +0 -2
  852. package/langwatch/dist/client/assets/ScenarioInputMappingSection-Sqtj3HwL.js +0 -2
  853. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-fzMzXl1A.js +0 -3
  854. package/langwatch/dist/client/assets/ScopeChipPicker-B6r27G3S.js +0 -2
  855. package/langwatch/dist/client/assets/SearchInput-C_AroTij.js +0 -2
  856. package/langwatch/dist/client/assets/SectionNavigationLayout-DNvKM1pq.js +0 -2
  857. package/langwatch/dist/client/assets/SelectDatasetDrawer-CeZvw0Rl.js +0 -2
  858. package/langwatch/dist/client/assets/SelectionActionBar-5j-e3Y3p.js +0 -2
  859. package/langwatch/dist/client/assets/SeriesFilterDrawer-C2Io5BkG.js +0 -2
  860. package/langwatch/dist/client/assets/SettingsLayout-CYtjUobV.js +0 -2
  861. package/langwatch/dist/client/assets/SetupWithAgentButton-BKWI-UTU.js +0 -4
  862. package/langwatch/dist/client/assets/ShikiCommandBox-D_TBnZxW.js +0 -5
  863. package/langwatch/dist/client/assets/SpanDetails-xl9OjARI.js +0 -3
  864. package/langwatch/dist/client/assets/SubscriptionPage-85dxt08g.js +0 -2
  865. package/langwatch/dist/client/assets/SuiteFormDrawer-BYdeRl8R.js +0 -2
  866. package/langwatch/dist/client/assets/TabButton-BY-_E4cy.js +0 -3
  867. package/langwatch/dist/client/assets/TableCell-B6fYjFy7.js +0 -2
  868. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-CTaJP17t.js +0 -2
  869. package/langwatch/dist/client/assets/TeamForm-DQIdGXFE.js +0 -2
  870. package/langwatch/dist/client/assets/TeamUserRoleField-UXHlsd5l.js +0 -2
  871. package/langwatch/dist/client/assets/TraceDetails-Bm1Ufstq.js +0 -9
  872. package/langwatch/dist/client/assets/TraceDetailsDrawer-BlZH_mba.js +0 -2
  873. package/langwatch/dist/client/assets/TraceIdPeek-By6CFB9R.js +0 -2
  874. package/langwatch/dist/client/assets/TracesMapping-QHyuw6AD.js +0 -2
  875. package/langwatch/dist/client/assets/UpgradeModal-BmLw5ONS.js +0 -92
  876. package/langwatch/dist/client/assets/UpgradeModalContent-C_lXaZaj.js +0 -2
  877. package/langwatch/dist/client/assets/UploadCSVDrawer-BKntPqbk.js +0 -3
  878. package/langwatch/dist/client/assets/VariablesSection-DnkttoMe.js +0 -2
  879. package/langwatch/dist/client/assets/VersionBadge-8Mh0h6z8.js +0 -2
  880. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-fQIOpGM1.js +0 -1161
  881. package/langwatch/dist/client/assets/ViewAutomationDrawer-CPoifrwV.js +0 -2
  882. package/langwatch/dist/client/assets/VirtualKeySecretReveal-CKCq8oBA.js +0 -54
  883. package/langwatch/dist/client/assets/WelcomeLayout-B_rw1HA0.js +0 -2
  884. package/langwatch/dist/client/assets/WithFeatureFlagGuard-DwfApI3b.js +0 -2
  885. package/langwatch/dist/client/assets/WithPermissionGuard-BP1dFkpM.js +0 -2
  886. package/langwatch/dist/client/assets/WorkflowCard-B_SYXPpi.js +0 -2
  887. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-D_fcHR54.js +0 -2
  888. package/langwatch/dist/client/assets/_...path_-Ipy6q2Lm.js +0 -2
  889. package/langwatch/dist/client/assets/_Uint8Array-B8b3z1r6.js +0 -2
  890. package/langwatch/dist/client/assets/__...path__-3xWAWxQ-.js +0 -22
  891. package/langwatch/dist/client/assets/_baseAssignValue-D7YNnh37.js +0 -2
  892. package/langwatch/dist/client/assets/_baseClone-o3pPcmbM.js +0 -2
  893. package/langwatch/dist/client/assets/_baseEach-CJ0DbEY4.js +0 -2
  894. package/langwatch/dist/client/assets/_baseFor-C04Mk-th.js +0 -2
  895. package/langwatch/dist/client/assets/_experiment_-DYMW8ia6.js +0 -2
  896. package/langwatch/dist/client/assets/_id_-B8SzykYR.js +0 -2
  897. package/langwatch/dist/client/assets/_id_-BT8l3_4N.js +0 -2
  898. package/langwatch/dist/client/assets/_id_-BTgcDKRo.js +0 -2
  899. package/langwatch/dist/client/assets/_id_-BrxUqiAK.js +0 -2
  900. package/langwatch/dist/client/assets/_id_-Cke69ccV.js +0 -2
  901. package/langwatch/dist/client/assets/_id_-CxtJm9qq.js +0 -2
  902. package/langwatch/dist/client/assets/_id_-DGNS0pL2.js +0 -2
  903. package/langwatch/dist/client/assets/_project_-CPYgRSe0.js +0 -8
  904. package/langwatch/dist/client/assets/_runId_-CnJnzVCf.js +0 -7
  905. package/langwatch/dist/client/assets/_shell-JRkk6wPs.js +0 -2
  906. package/langwatch/dist/client/assets/_slug_-D3cx1Thv.js +0 -17
  907. package/langwatch/dist/client/assets/_slug_-Dx0M4BvX.js +0 -2
  908. package/langwatch/dist/client/assets/_slug_-cRMpdOOA.js +0 -2
  909. package/langwatch/dist/client/assets/_team_-BW8SVrk-.js +0 -2
  910. package/langwatch/dist/client/assets/_workflow_-C35QPIPs.js +0 -25
  911. package/langwatch/dist/client/assets/_workflow_-DowL6naf.js +0 -3
  912. package/langwatch/dist/client/assets/accept-D3cDvj0y.js +0 -2
  913. package/langwatch/dist/client/assets/activity-CrGqZpWa.js +0 -1
  914. package/langwatch/dist/client/assets/agents-BNeoLDoj.js +0 -2
  915. package/langwatch/dist/client/assets/alerts-CrGqZpWa.js +0 -1
  916. package/langwatch/dist/client/assets/all-BHRNPEIX.js +0 -2
  917. package/langwatch/dist/client/assets/analytics-CZuaBlXL.js +0 -2
  918. package/langwatch/dist/client/assets/annotation-scores-CeAaT6zF.js +0 -2
  919. package/langwatch/dist/client/assets/annotations-CpkTmTvn.js +0 -2
  920. package/langwatch/dist/client/assets/anomaly-rules-BOLIh6OR.js +0 -2
  921. package/langwatch/dist/client/assets/api-keys-mK1aqQaM.js +0 -4
  922. package/langwatch/dist/client/assets/asaplangy-D_DeMaDk.js +0 -5
  923. package/langwatch/dist/client/assets/audit-log-CL6iYEbl.js +0 -2
  924. package/langwatch/dist/client/assets/auth-DWhhuKxO.js +0 -2
  925. package/langwatch/dist/client/assets/authentication-CvPvvVW6.js +0 -2
  926. package/langwatch/dist/client/assets/authorize-C1bDXq-Z.js +0 -2
  927. package/langwatch/dist/client/assets/authorize-xZkU_nXs.js +0 -2
  928. package/langwatch/dist/client/assets/automations-ChfL33YS.js +0 -2
  929. package/langwatch/dist/client/assets/automations-CrGqZpWa.js +0 -1
  930. package/langwatch/dist/client/assets/billing-plans-CXxmUM3Y.js +0 -2
  931. package/langwatch/dist/client/assets/blank-DFMnaDEJ.js +0 -2
  932. package/langwatch/dist/client/assets/blobs-D-pozzQX.js +0 -2
  933. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3--iqoZYgE.js +0 -133
  934. package/langwatch/dist/client/assets/budgets-BAJ1tdYz.js +0 -3
  935. package/langwatch/dist/client/assets/bug-reports-DOqvPuTB.js +0 -2
  936. package/langwatch/dist/client/assets/cache-rules-DbITxirX.js +0 -2
  937. package/langwatch/dist/client/assets/choose-BSGQGAYS.js +0 -2
  938. package/langwatch/dist/client/assets/chunk-EX3LRPZG-B7fiWf8z.js +0 -232
  939. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-CiS2XotT.js +0 -3
  940. package/langwatch/dist/client/assets/chunk-PUDLZKDR-_aske-8B.js +0 -157
  941. package/langwatch/dist/client/assets/chunk-RYQCIY6F-Bzb9D1UT.js +0 -2
  942. package/langwatch/dist/client/assets/chunk-V7JOEXUC-BNxgutMB.js +0 -207
  943. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-GwNDfT24.js +0 -2
  944. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-GwNDfT24.js +0 -2
  945. package/langwatch/dist/client/assets/codeAgentConfig-DWx3pMLC.js +0 -7
  946. package/langwatch/dist/client/assets/codingDefaultSync-C9Lev3y1.js +0 -2
  947. package/langwatch/dist/client/assets/configure-Coe_YM3c.js +0 -4
  948. package/langwatch/dist/client/assets/custom-Dpn85JW8.js +0 -12
  949. package/langwatch/dist/client/assets/custom_evaluator-DGAwXo2Z.js +0 -31
  950. package/langwatch/dist/client/assets/dagre-D7MBpcKV.js +0 -2
  951. package/langwatch/dist/client/assets/dagre-VKFMJZFB-COHUH3Np.js +0 -5
  952. package/langwatch/dist/client/assets/data-privacy-CtKFJ8SN.js +0 -2
  953. package/langwatch/dist/client/assets/data-retention-e5nryGvV.js +0 -2
  954. package/langwatch/dist/client/assets/datasets-JEoBpoYL.js +0 -2
  955. package/langwatch/dist/client/assets/debounce-KKoMEqvq.js +0 -2
  956. package/langwatch/dist/client/assets/defaultModelState-C4_m_XBI.js +0 -2
  957. package/langwatch/dist/client/assets/dejaview-BV4oU0up.js +0 -2
  958. package/langwatch/dist/client/assets/departments-BjNbKZtW.js +0 -2
  959. package/langwatch/dist/client/assets/devices-CaLokczo.js +0 -2
  960. package/langwatch/dist/client/assets/dist-BToT9Gni.js +0 -6
  961. package/langwatch/dist/client/assets/drawerFromUrl-Cpd3NvN0.js +0 -2
  962. package/langwatch/dist/client/assets/edit-BW6g7_XC.js +0 -62
  963. package/langwatch/dist/client/assets/email-suppressions-DYhLkUjt.js +0 -2
  964. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-CBcweIHJ.js +0 -86
  965. package/langwatch/dist/client/assets/error-CmmaHju0.js +0 -2
  966. package/langwatch/dist/client/assets/evaluations-BX71jpba.js +0 -2
  967. package/langwatch/dist/client/assets/evaluations-C82dwzqH.js +0 -2
  968. package/langwatch/dist/client/assets/evaluators-CKOs_qOx.js +0 -146
  969. package/langwatch/dist/client/assets/evaluators-Cnp4esT5.js +0 -2
  970. package/langwatch/dist/client/assets/experiments-CzhcDWnc.js +0 -1
  971. package/langwatch/dist/client/assets/external-link-BzETHrAG.js +0 -2
  972. package/langwatch/dist/client/assets/feature-flags-Cl5NHQrK.js +0 -2
  973. package/langwatch/dist/client/assets/fetchSSE-DWKCnoHV.js +0 -3
  974. package/langwatch/dist/client/assets/fieldset-CE_IDQSv.js +0 -2
  975. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-B2EV4X5b.js +0 -1
  976. package/langwatch/dist/client/assets/forgot-password-Bdtjps2K.js +0 -2
  977. package/langwatch/dist/client/assets/formatMoney-CI_YqDED.js +0 -2
  978. package/langwatch/dist/client/assets/foundry-DdJynGEa.js +0 -477
  979. package/langwatch/dist/client/assets/gateway-BvjtD98W.js +0 -2
  980. package/langwatch/dist/client/assets/getEvaluator-OH0w_5fd.js +0 -2
  981. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-BB5SvhT3.js +0 -2
  982. package/langwatch/dist/client/assets/governance-DUSWlZID.js +0 -2
  983. package/langwatch/dist/client/assets/graphlib-Dn160vFe.js +0 -2
  984. package/langwatch/dist/client/assets/groups--YQRJnbz.js +0 -2
  985. package/langwatch/dist/client/assets/guardrails-_Jb3oZg3.js +0 -2
  986. package/langwatch/dist/client/assets/http-7YWbWWla.js +0 -7
  987. package/langwatch/dist/client/assets/identifierUtils-BuQJ50Jl.js +0 -2
  988. package/langwatch/dist/client/assets/immer-tl_oI9yy.js +0 -14
  989. package/langwatch/dist/client/assets/index-CUhcyBp3.js +0 -68
  990. package/langwatch/dist/client/assets/ingestion-source-detail-E-alCDhM.js +0 -19
  991. package/langwatch/dist/client/assets/ingestion-sources-APi2TUL6.js +0 -12
  992. package/langwatch/dist/client/assets/integrations-osNA42lv.js +0 -2
  993. package/langwatch/dist/client/assets/isArrayLikeObject-CJZEoMj_.js +0 -2
  994. package/langwatch/dist/client/assets/isSymbol-IFJb2-6T.js +0 -2
  995. package/langwatch/dist/client/assets/langyHomeSuggestions-B0_Fr3Q2.js +0 -2
  996. package/langwatch/dist/client/assets/latestAliases-BG98QtLZ.js +0 -2
  997. package/langwatch/dist/client/assets/license-Dbjlsvq9.js +0 -2
  998. package/langwatch/dist/client/assets/loadModelCatalog-CtqlQvVB.js +0 -2
  999. package/langwatch/dist/client/assets/map-DH6XyRvi.js +0 -2
  1000. package/langwatch/dist/client/assets/mappingValidation-oCsaOwz3.js +0 -2
  1001. package/langwatch/dist/client/assets/me-Bqm1rCwb.js +0 -2
  1002. package/langwatch/dist/client/assets/me-BxYTDdYk.js +0 -7
  1003. package/langwatch/dist/client/assets/members-C-RYfdOt.js +0 -2
  1004. package/langwatch/dist/client/assets/mermaid.core-CIOVe75m.js +0 -12
  1005. package/langwatch/dist/client/assets/messages-DSB9EzQc.js +0 -2
  1006. package/langwatch/dist/client/assets/metrics-C_DWHPhN.js +0 -2
  1007. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-D9FhjenJ.js +0 -97
  1008. package/langwatch/dist/client/assets/model-costs-DHTDEPq7.js +0 -2
  1009. package/langwatch/dist/client/assets/model-providers-B5lYdYGB.js +0 -2
  1010. package/langwatch/dist/client/assets/modelProviderHelpers-DDoNJl7J.js +0 -2
  1011. package/langwatch/dist/client/assets/my-queue-DBUdNObC.js +0 -2
  1012. package/langwatch/dist/client/assets/normalizeComparison-CCZ-bOPv.js +0 -2
  1013. package/langwatch/dist/client/assets/not-found-1cA6pijP.js +0 -2
  1014. package/langwatch/dist/client/assets/now-Sx_cFlpx.js +0 -2
  1015. package/langwatch/dist/client/assets/onboarding-Brb1FAS4.js +0 -2
  1016. package/langwatch/dist/client/assets/online-evaluations-Di78dvHe.js +0 -2
  1017. package/langwatch/dist/client/assets/ops-BDrWqQb1.js +0 -2
  1018. package/langwatch/dist/client/assets/organizations-I7_fQcGq.js +0 -2
  1019. package/langwatch/dist/client/assets/pages-BowufdCe.js +0 -2
  1020. package/langwatch/dist/client/assets/persistence-ChzYQRy2.js +0 -2
  1021. package/langwatch/dist/client/assets/plans-DUiB6dWS.js +0 -2
  1022. package/langwatch/dist/client/assets/product-CLC45PiC.js +0 -2
  1023. package/langwatch/dist/client/assets/project-CO0U6_JZ.js +0 -2
  1024. package/langwatch/dist/client/assets/projections-yljzVGg_.js +0 -2
  1025. package/langwatch/dist/client/assets/projects-DbpxS5ex.js +0 -2
  1026. package/langwatch/dist/client/assets/promptHandle-BwdZsauS.js +0 -2
  1027. package/langwatch/dist/client/assets/prompts-DUxsvuSh.js +0 -8
  1028. package/langwatch/dist/client/assets/radio-group-DJFHT54R.js +0 -2
  1029. package/langwatch/dist/client/assets/registry-C3oFDiqP.js +0 -2
  1030. package/langwatch/dist/client/assets/reports-BQKkyGFY.js +0 -2
  1031. package/langwatch/dist/client/assets/request-CmAXw9Uw.js +0 -2
  1032. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-D1dMWBTG.js +0 -85
  1033. package/langwatch/dist/client/assets/reset-password-CTK4_mwV.js +0 -2
  1034. package/langwatch/dist/client/assets/role-bindings-C6ZsuMgm.js +0 -2
  1035. package/langwatch/dist/client/assets/roles-BCVxn7jA.js +0 -2
  1036. package/langwatch/dist/client/assets/routing-policies-CRBbtcKU.js +0 -5
  1037. package/langwatch/dist/client/assets/scenarios-t3nGDwOk.js +0 -2
  1038. package/langwatch/dist/client/assets/scheduler-BLbmBCjU.js +0 -2
  1039. package/langwatch/dist/client/assets/schedules-CrGqZpWa.js +0 -1
  1040. package/langwatch/dist/client/assets/scim-Db5_4cCw.js +0 -2
  1041. package/langwatch/dist/client/assets/secrets-w56NYZDd.js +0 -2
  1042. package/langwatch/dist/client/assets/segment-group-BZ45xnHN.js +0 -2
  1043. package/langwatch/dist/client/assets/segmented-control-DD0HLoke.js +0 -2
  1044. package/langwatch/dist/client/assets/select-BVcV39WT.js +0 -2
  1045. package/langwatch/dist/client/assets/send-C4QAmSdY.js +0 -2
  1046. package/langwatch/dist/client/assets/sequenceView-BjWvujkI.js +0 -5
  1047. package/langwatch/dist/client/assets/seriesOptions-BYBEdexs.js +0 -1011
  1048. package/langwatch/dist/client/assets/settings-BLUJDHk_.js +0 -2
  1049. package/langwatch/dist/client/assets/setup-DZUDYG7y.js +0 -2
  1050. package/langwatch/dist/client/assets/shikiAdapter-S_u9TjIh.js +0 -3
  1051. package/langwatch/dist/client/assets/signin-DIBdy2xA.js +0 -2
  1052. package/langwatch/dist/client/assets/signup-CNRmYZe8.js +0 -2
  1053. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-CvKHJ3lm.js +0 -2
  1054. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-DAiJnxt-.js +0 -2
  1055. package/langwatch/dist/client/assets/subscription-DCXG9i3Z.js +0 -3
  1056. package/langwatch/dist/client/assets/subscriptions-vembyNSC.js +0 -2
  1057. package/langwatch/dist/client/assets/suggestionUI-CKer7JjV.js +0 -106
  1058. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-BSx4-zBB.js +0 -3
  1059. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-CiuP6lw7.js +0 -9
  1060. package/langwatch/dist/client/assets/switch-COTwlCOb.js +0 -2
  1061. package/langwatch/dist/client/assets/switch-vUOdjiD1.js +0 -2
  1062. package/langwatch/dist/client/assets/tabs-DdHsJkYS.js +0 -2
  1063. package/langwatch/dist/client/assets/teams-CNWyUErs.js +0 -2
  1064. package/langwatch/dist/client/assets/teams-DfkeiBlG.js +0 -2
  1065. package/langwatch/dist/client/assets/tool-catalog-Fz2CTXGX.js +0 -7
  1066. package/langwatch/dist/client/assets/toolIcons-8yYANIzS.js +0 -2
  1067. package/langwatch/dist/client/assets/tooltip-Croc0I6e.js +0 -2
  1068. package/langwatch/dist/client/assets/topic-clustering-BUhCtd-n.js +0 -2
  1069. package/langwatch/dist/client/assets/topics-DTHKQBbG.js +0 -2
  1070. package/langwatch/dist/client/assets/traceExecutor-apa7WEzU.js +0 -55
  1071. package/langwatch/dist/client/assets/traces-DHbPO8-r.js +0 -289
  1072. package/langwatch/dist/client/assets/tracesMapping-AU2q390i.js +0 -3
  1073. package/langwatch/dist/client/assets/tracking-2cJI_Hu7.js +0 -2
  1074. package/langwatch/dist/client/assets/types-CQ-IJ_jx.js +0 -2
  1075. package/langwatch/dist/client/assets/types-DV4H6wK9.js +0 -2
  1076. package/langwatch/dist/client/assets/types-PSz4yYPE.js +0 -2
  1077. package/langwatch/dist/client/assets/types-Qc1U0Lzq.js +0 -2
  1078. package/langwatch/dist/client/assets/unsubscribe-B7-aB2wW.js +0 -2
  1079. package/langwatch/dist/client/assets/usage-B56MHHfN.js +0 -2
  1080. package/langwatch/dist/client/assets/usage-BrFpMBrn.js +0 -2
  1081. package/langwatch/dist/client/assets/use-breakpoint-BTtibx4n.js +0 -2
  1082. package/langwatch/dist/client/assets/use-generic-onboarding-flow-eiutgTpm.js +0 -2
  1083. package/langwatch/dist/client/assets/useActivePlan-DZDUm8JK.js +0 -2
  1084. package/langwatch/dist/client/assets/useAllPromptsForProject-BY-Cnuhg.js +0 -2
  1085. package/langwatch/dist/client/assets/useAnnotationQueues-BWrpwDYN.js +0 -2
  1086. package/langwatch/dist/client/assets/useAvailableEvaluators-D7TbKINw.js +0 -2
  1087. package/langwatch/dist/client/assets/useCyclingVerb-Bp3m8dQc.js +0 -2
  1088. package/langwatch/dist/client/assets/useDepartmentColumn-DTsM9Nhy.js +0 -2
  1089. package/langwatch/dist/client/assets/useEvaluationsV3Store-KPEU27UA.js +0 -2
  1090. package/langwatch/dist/client/assets/useExportTraces-DK-tRqPq.js +0 -2
  1091. package/langwatch/dist/client/assets/useFeatureFlag-D9ikgDaE.js +0 -2
  1092. package/langwatch/dist/client/assets/useInviteActions-DyYvQrlw.js +0 -2
  1093. package/langwatch/dist/client/assets/useLicenseEnforcement-DRk7-NQ0.js +0 -2
  1094. package/langwatch/dist/client/assets/useLiteMemberGuard-klZnweA7.js +0 -43
  1095. package/langwatch/dist/client/assets/usePersonalContext-CrhmQYta.js +0 -2
  1096. package/langwatch/dist/client/assets/useProjectSpanNames-w6NW0Ct5.js +0 -2
  1097. package/langwatch/dist/client/assets/useProjectsForCopy-DxbxCEv5.js +0 -2
  1098. package/langwatch/dist/client/assets/useRunViaApiTabs-WzgJSfv2.js +0 -50
  1099. package/langwatch/dist/client/assets/useSavedViews-CNmeuzC3.js +0 -2
  1100. package/langwatch/dist/client/assets/useShowLangy-BvJ39ifH.js +0 -2
  1101. package/langwatch/dist/client/assets/useSimulationUpdateListener-Bu7hXXtv.js +0 -2
  1102. package/langwatch/dist/client/assets/useTargetName-VjbhYyp5.js +0 -2
  1103. package/langwatch/dist/client/assets/useTargetNameMap-CB8rbgsw.js +0 -2
  1104. package/langwatch/dist/client/assets/useTraceDetailsDrawer-BQRQYAwh.js +0 -2
  1105. package/langwatch/dist/client/assets/useTraceUpdateListener-DvzIDKvr.js +0 -2
  1106. package/langwatch/dist/client/assets/useUrlScopeFilter-u6ryUPSP.js +0 -2
  1107. package/langwatch/dist/client/assets/useWorkflowStore-PvyqdAIQ.js +0 -8
  1108. package/langwatch/dist/client/assets/users-B6_uecCc.js +0 -2
  1109. package/langwatch/dist/client/assets/users-BKSIVGOV.js +0 -2
  1110. package/langwatch/dist/client/assets/users-Cvlw527b.js +0 -2
  1111. package/langwatch/dist/client/assets/v3-D_vxEDZB.js +0 -2
  1112. package/langwatch/dist/client/assets/variables-fv0lgY95.js +0 -396
  1113. package/langwatch/dist/client/assets/viewStore-149qmWlN.js +0 -2
  1114. package/langwatch/dist/client/assets/virtual-keys-BrPMP91L.js +0 -2
  1115. package/langwatch/dist/client/assets/welcome-CvpidJSe.js +0 -16
  1116. package/langwatch/dist/client/assets/wizard-D3LrFT3o.js +0 -2
  1117. package/langwatch/dist/client/assets/workbench-YhI9hb4n.js +0 -2
  1118. package/langwatch/dist/client/assets/workflows-D66JEP8o.js +0 -3
  1119. package/langwatch/dist/client/assets/wrap-C4rzJqks.js +0 -2
  1120. package/langwatch/src/pages/settings/__tests__/model-providers.first-project.integration.test.tsx +0 -426
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{c as n}from"./ExternalImage-DbtOSrKl.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-D35vYym3.js";import{i as v}from"./getRadiusAndStrokeWidthFromDot-BB5SvhT3.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-St9tkyoA.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{r}from"./portal-FJIui2Z2.js";import{S as i}from"./shiki-CS25xJLQ.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./box-Ck5lef6C.js";import{t as s}from"./text-A3qvcMyN.js";import{gt as c,mt as l}from"./useLiteMemberGuard-klZnweA7.js";import{t as u}from"./tooltip-Croc0I6e.js";import{n as d}from"./toaster-CRP22oRW.js";import{t as f}from"./h-stack-CMPhqSp5.js";import{t as p}from"./v-stack-ClAMS101.js";import{jt as ee}from"./index-CUhcyBp3.js";import{t as te}from"./next-dynamic-DcKsrHUa.js";var ne=e(n()),m=a();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)(p,{align:`flex-start`,gap:2,marginBottom:2,children:[t.map((e,t)=>(0,m.jsx)(l,{part:e},`trace-media-${t}`)),n>0&&(0,m.jsxs)(s,{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(()=>i(()=>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(),r;try{if(t&&typeof t==`string`){let e=JSON.parse(t);typeof e==`object`&&(r=e),typeof e==`string`&&(t=e)}typeof t==`object`&&t&&(r=t)}catch{}let i={...e};delete i.value;let[a,l]=(0,ne.useState)(!1),p=(0,ne.useMemo)(()=>c(r??t),[t]),te=()=>(0,m.jsx)(u,{content:`Copy`,children:(0,m.jsx)(o,{children:(0,m.jsx)(un,{position:`relative`,onClick:()=>{(async()=>{try{await navigator.clipboard.writeText(r?JSON.stringify(r,null,2):t?typeof t==`string`?t:JSON.stringify(t,null,2):`${t}`),d.create({title:`Copied to clipboard`,type:`success`})}catch{if(window.location.protocol===`http:`&&window.location.hostname!==`localhost`&&window.location.hostname!==`127.0.0.1`){d.create({title:`Cannot copy to clipboard on HTTP`,type:`error`});return}d.create({title:`Failed to copy to clipboard`,type:`error`})}})()},children:(0,m.jsx)(sn,{width:12,height:12})})})});return(0,m.jsxs)(o,{position:`relative`,width:`full`,children:[(0,m.jsx)(re,{parts:p}),typeof document<`u`&&(r??(typeof t==`string`&&an(t)))?(t=>{let r=on(t),c=!1;return typeof r!=`object`&&(c=!0),(0,m.jsxs)(m.Fragment,{children:[e.showTools&&(0,m.jsxs)(f,{position:`absolute`,top:-2,right:-2,zIndex:1,gap:`-1px`,children:[!c&&e.showTools!==`copy-only`&&(0,m.jsx)(u,{content:`View Raw`,children:(0,m.jsx)(o,{children:(0,m.jsx)(un,{onClick:()=>l(!a),background:a?`bg.emphasized`:`bg.muted`,children:`{}`})})}),te()]}),a||c?(0,m.jsx)(s,{fontFamily:`mono`,fontSize:`13px`,children:JSON.stringify(t,null,2)}):(0,m.jsx)(cn,{src:r,name:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,collapseStringsAfterLength:1e3,style:{fontSize:`13px`,backgroundColor:`transparent`},theme:n===`dark`?`twilight`:`rjv-default`,displayArrayKey:!1,...i})]})})(r??t):(0,m.jsxs)(m.Fragment,{children:[e.showTools&&(0,m.jsx)(f,{position:`absolute`,top:-2,right:-2,zIndex:1,gap:`-1px`,children:te()}),(0,m.jsx)(s,{fontFamily:`mono`,fontSize:`14px`,children:t?typeof t==`string`?t:JSON.stringify(t,null,2):`${t}`})]})]})});function un(e){return(0,m.jsx)(r,{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-DOVNZVJ2.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{i as n,r,t as i}from"./portal-FJIui2Z2.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./box-Ck5lef6C.js";import{t as s}from"./text-A3qvcMyN.js";import{s as c}from"./shikiAdapter-S_u9TjIh.js";import{Ct as l,cn as u,k as d}from"./useLiteMemberGuard-klZnweA7.js";import{n as f}from"./toaster-CRP22oRW.js";import{G as p,N as m}from"./ExternalImage-DbtOSrKl.js";import{n as h,r as g}from"./external-link-BzETHrAG.js";import{t as _}from"./icon-CkSWK_vf.js";import{i as v,n as y,r as b,t as x}from"./alert-C5hocQt_.js";import{r as S,t as C}from"./card-54_vstoB.js";import{t as w}from"./icon-button-Ce2kwA7j.js";import{a as T,t as E}from"./field-Dz4Xmo3X.js";import{t as D}from"./grid-item-BDl8eynK.js";import{t as O}from"./h-stack-CMPhqSp5.js";import{n as k,r as A,t as j}from"./list-B9tuDjf4.js";import{t as ee}from"./spacer-CbmCSsJg.js";import{it as M,rt as N}from"./immer-tl_oI9yy.js";import{t as P}from"./v-stack-ClAMS101.js";import{t as te}from"./createLucideIcon-WbxVGt4j.js";import{n as F}from"./close-button-RGOW3hmk.js";import{t as ne}from"./arrow-left-BWMkb3Ih.js";import{t as re}from"./circle-dot-BvmYnoxN.js";import{t as I}from"./code-RXLqs93S.js";import{t as L}from"./globe-DJqSMfhQ.js";import{r as ie}from"./next-router-Bn5Y8Iek.js";import{n as R,u as ae}from"./api-BK6L1im2.js";import{t as z}from"./src-RcSZrN9Q.js";import{$n as B,Ar as V,Er as H,H as oe,M as se,N as ce,Or as U,Qn as W,Rt as G,Un as le,V as ue,_n as K,br as q,in as J,kn as de,ni as fe,nr as pe,xn as Y,yt as X,z as me}from"./index-CUhcyBp3.js";import{l as he,s as ge,t as _e}from"./index.esm-C0ipNBTK.js";import{t as ve}from"./zod-BGMkf8aO.js";import{t as ye}from"./useLicenseEnforcement-DRk7-NQ0.js";import{t as be}from"./useModelProvidersSettings-DwRsXmh4.js";import{t as xe}from"./AgentTypeSelectorDrawer-BRHSlvwQ.js";import{n as Se}from"./ScenarioInputMappingSection-Sqtj3HwL.js";import{r as Ce}from"./constants-c0j3xvrs.js";import{r as we}from"./ModelSelector-BBb1wHS_.js";import{t as Te}from"./useCompoundLicenseCheck-BqNF-zzC.js";import{t as Ee}from"./PromptEditorDrawer-k_dFbREL.js";import{t as De}from"./useAllPromptsForProject-BY-Cnuhg.js";import{t as Oe}from"./dist-CtqZVBlK.js";import{a as ke,n as Ae,o as je,r as Me,s as Ne,t as Pe}from"./defaultModelState-C4_m_XBI.js";import{t as Fe}from"./latestAliases-BG98QtLZ.js";import{n as Ie}from"./ProviderModelSelector-Cm89XYO8.js";var Le=te(`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=z(`pollForScenarioRun`),Re=500,ze=Math.ceil(3e4/Re);async function Be(e,t){Q.info({projectId:t.projectId,scenarioSetId:t.scenarioSetId,batchRunId:t.batchRunId},`Starting poll`);for(let n=0;n<ze;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===d.ERROR||e.status===d.FAILED||e.status===d.CANCELLED||e.status===d.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,Re))}return Q.warn({maxAttempts:ze},`Timed out`),{success:!1,error:`timeout`}}function Ve({projectId:e,projectSlug:t,onRunComplete:n,onRunFailed:r}){let i=R.useContext(),a=R.scenarios.run.useMutation(),[o,s]=(0,Z.useState)(!1),{hasEnabledProviders:c}=be({projectId:e});return{runScenario:(0,Z.useCallback)(async o=>{let{scenarioId:l,target:u,setId:d,batchRunId:p}=o;if(!(!e||!t||!u)){if(!c){f.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:p});s(!0);let c=await Be(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;f.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 f.create({title:`Run timed out`,description:`The scenario run took too long to start. Please try again.`,type:`error`,meta:{closable:!0}})}catch(e){let t=e instanceof Error?e.message:`An unexpected error occurred`;f.create({title:`Failed to start scenario`,description:t,type:`error`,meta:{closable:!0}})}finally{s(!1)}}},[e,t,c,a,n,r,i]),isRunning:a.isPending||o}}function He(e){let{project:t}=G(),n=e&&t?.id?`langwatch:scenario-target:${t.id}:${e}`:null,[r,i]=de(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 Ue=new Set([`http`,`code`,`workflow`]);function We(e,t){return(0,Z.useMemo)(()=>{let n=[...(e??[]).filter(e=>Ue.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 Ge(e){return e!==null&&Ue.has(e.type)}var $=a();function Ke({selectedTarget:e,onTargetChange:t,onSaveAndRun:n,onSaveWithoutRunning:a,onCreateAgent:c,onCreatePrompt:u,isLoading:d=!1}){let{project:f}=G(),{data:p}=De(),{data:m}=R.agents.getAll.useQuery({projectId:f?.id??``},{enabled:!!f?.id}),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(!1),y=(0,Z.useRef)(null),b=(0,Z.useRef)(null),x=(0,Z.useMemo)(()=>{let e=[...p?.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},[p,h]),S=We(m,h),C=e=>{t(e),v(!1),g(``),n(e)};return(0,$.jsxs)(l.Root,{open:_,onOpenChange:e=>{v(e.open),e.open&&setTimeout(()=>{y.current?.focus(),b.current?.scrollTo(0,0)},0)},positioning:{placement:`bottom-end`},children:[(0,$.jsx)(l.Trigger,{asChild:!0,children:(0,$.jsxs)(r,{colorPalette:`blue`,size:`sm`,loading:d,children:[(0,$.jsx)(B,{size:14}),`Save and Run`,(0,$.jsx)(N,{size:14})]})}),(0,$.jsx)(i,{children:(0,$.jsxs)(l.Content,{width:`320px`,padding:0,children:[(0,$.jsx)(o,{padding:2,borderBottomWidth:`1px`,borderColor:`border`,position:`sticky`,top:0,bg:`bg`,zIndex:10,children:(0,$.jsx)(V,{ref:y,size:`sm`,placeholder:`Search prompts or agents...`,value:h,onChange:e=>g(e.target.value)})}),(0,$.jsxs)(o,{ref:b,maxHeight:`400px`,overflowY:`auto`,children:[(0,$.jsxs)(o,{children:[(0,$.jsx)(s,{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`}),S.length===0?(0,$.jsx)(s,{fontSize:`sm`,color:`fg.subtle`,paddingX:3,paddingY:2,children:h?`No agents found`:`No agents available`}):S.map(t=>(0,$.jsxs)(O,{paddingX:3,paddingY:2,cursor:`pointer`,bg:Ge(e)&&e.id===t.id?`blue.subtle`:`transparent`,_hover:{bg:`bg.muted`},onClick:()=>C({type:t.type,id:t.id}),children:[t.type===`code`?(0,$.jsx)(I,{size:14,color:`var(--chakra-colors-fg-muted)`}):(0,$.jsx)(L,{size:14,color:`var(--chakra-colors-fg-muted)`}),(0,$.jsx)(s,{fontSize:`sm`,flex:1,children:t.name}),(0,$.jsx)(B,{size:12,color:`var(--chakra-colors-blue-500)`})]},t.id)),(0,$.jsxs)(O,{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)(W,{size:14}),(0,$.jsx)(s,{fontSize:`sm`,children:`Add New Agent`})]})]}),(0,$.jsxs)(o,{borderTopWidth:`1px`,borderColor:`border`,children:[(0,$.jsx)(s,{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`}),x.length===0?(0,$.jsx)(s,{fontSize:`sm`,color:`fg.subtle`,paddingX:3,paddingY:2,children:h?`No prompts found`:`No prompts available`}):x.map(t=>(0,$.jsxs)(O,{paddingX:3,paddingY:2,cursor:`pointer`,bg:e?.type===`prompt`&&e.id===t.id?`blue.subtle`:`transparent`,_hover:{bg:`bg.muted`},onClick:()=>C({type:`prompt`,id:t.id}),children:[(0,$.jsx)(q,{size:14,color:`var(--chakra-colors-fg-muted)`}),(0,$.jsx)(s,{fontSize:`sm`,flex:1,children:t.handle??t.id}),(0,$.jsx)(B,{size:12,color:`var(--chakra-colors-blue-500)`})]},t.id)),(0,$.jsxs)(O,{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)(W,{size:14}),(0,$.jsx)(s,{fontSize:`sm`,children:`Add New Prompt`})]})]})]}),(0,$.jsx)(o,{borderTopWidth:`1px`,borderColor:`border`,children:(0,$.jsxs)(O,{paddingX:3,paddingY:3,cursor:`pointer`,_hover:{bg:`bg.muted`},onClick:()=>{v(!1),g(``),a()},children:[(0,$.jsx)(Le,{size:14,color:`var(--chakra-colors-fg-muted)`}),(0,$.jsx)(s,{fontSize:`sm`,children:`Save without running`})]})})]})})]})}function qe({label:e,value:t,onChange:n,featureKey:r,size:i=`full`}){let{project:a}=G(),o=a?.id??``,c=R.modelProvider.listAllForProjectForFrontend.useQuery({projectId:o},{enabled:!!o,refetchOnMount:!1}),l=R.modelProvider.getResolvedDefault.useQuery({projectId:o,featureKey:r},{enabled:!!o}),u=(0,Z.useMemo)(()=>{let e=(c.data?.providers??[]).filter(e=>e.enabled===!0),t=new Set(e.map(e=>e.provider)),n=[];for(let e of Fe)t.has(e)&&n.push(`${e}/latest`,`${e}/latest-mini`);let r=we.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]))},[c.data]),d=(0,Z.useMemo)(()=>Ce(c.data?.providers??[]),[c.data]),f=l.data?.model??``;return(0,$.jsxs)(P,{align:`stretch`,gap:1,width:`full`,children:[(0,$.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:e}),(0,$.jsx)(Ie,{model:t??``,options:u,size:i,onChange:e=>n(e===`__inherit__`?null:e),inheritOption:f?{model:f,label:`Default model`}:void 0,displayNames:d})]})}function Je({open:e,onOpenChange:t,simulatorModel:n,judgeModel:i,onSimulatorChange:a,onJudgeChange:o,onConfirm:c,isRunning:l}){return(0,$.jsx)(X.Root,{open:e,onOpenChange:e=>t(e.open),children:(0,$.jsxs)(X.Content,{bg:`bg`,children:[(0,$.jsx)(X.Header,{children:(0,$.jsx)(X.Title,{children:`Choose models for this run`})}),(0,$.jsx)(X.Body,{children:(0,$.jsxs)(P,{gap:4,align:`stretch`,children:[(0,$.jsx)(s,{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)(qe,{label:`User simulator`,featureKey:`scenarios.user_simulator`,value:n,onChange:a}),(0,$.jsx)(qe,{label:`Judge`,featureKey:`scenarios.judge`,value:i,onChange:o})]})}),(0,$.jsxs)(X.Footer,{children:[(0,$.jsx)(X.ActionTrigger,{asChild:!0,children:(0,$.jsx)(r,{variant:`outline`,children:`Cancel`})}),(0,$.jsx)(r,{colorPalette:`blue`,loading:l,onClick:c,children:`Save and run`})]}),(0,$.jsx)(X.CloseTrigger,{})]})})}var Ye=z(`langwatch:scenarios:ai-generation`);function Xe(){let[e,t]=(0,Z.useState)([]);return(0,Z.useEffect)(()=>{let e=Me();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 ke(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}=G(),[i,a]=(0,Z.useState)(`prompt`),[c,l]=(0,Z.useState)(``),{history:u,addPrompt:d,hasHistory:p}=Xe(),{generate:m,status:g}=Ze(t?.id),{hasEnabledProviders:v,providers:y}=be({projectId:t?.id}),b=R.modelProvider.getResolvedDefault.useQuery({projectId:t?.id??``,featureKey:`scenarios.generator`},{enabled:!!t?.id}),x=Pe({hasEnabledProviders:v,providers:y,defaultModel:b.data?.model}),w=!x.ok,T=e!==null&&Qe(e),E=!!(c.trim()&&g!==`generating`&&!w&&e),D=(0,Z.useCallback)(async()=>{if(!(!c.trim()||!t?.id||!e)&&!(T&&!p&&!window.confirm(`This will replace the current scenario content. Continue?`)))try{let t=await m(c,p?{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??[]),d(c),l(``)}catch(e){Ye.error({error:e},`Error generating scenario`);let t=Ae(e),n=t.cta===`configure`||t.cta===`configure-and-retry`;f.create({title:`Generation failed`,description:t.tier===`unknown`?t.rawMessage: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,T,p,m,d]),k=(0,Z.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&E&&(e.preventDefault(),D())},[E,D]);return i===`prompt`?v?(0,$.jsx)(S,{overflow:`hidden`,children:(0,$.jsx)(C,{children:(0,$.jsxs)(P,{align:`stretch`,gap:3,children:[(0,$.jsxs)(O,{gap:3,children:[(0,$.jsx)(o,{display:`grid`,placeItems:`center`,width:`34px`,height:`34px`,bg:`bg.surface`,borderWidth:`1px`,borderColor:`border`,borderRadius:`10px`,children:(0,$.jsx)(H,{size:18})}),(0,$.jsxs)(o,{children:[(0,$.jsx)(s,{fontWeight:`semibold`,fontSize:`sm`,children:p?`Refine with AI`:`Draft with AI`}),(0,$.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:p?`Your draft is ready to shape.`:`Start from an idea, not a form.`})]})]}),(0,$.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:p?`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)(r,{colorPalette:`orange`,size:`sm`,onClick:()=>a(`input`),"aria-label":`Generate with AI`,children:[(0,$.jsx)(H,{size:14}),p?`Refine the draft`:`Start a draft`]}),(0,$.jsx)(je,{model:b.data?.model})]})})}):(0,$.jsx)(S,{children:(0,$.jsx)(C,{children:(0,$.jsxs)(P,{align:`stretch`,gap:3,children:[(0,$.jsxs)(O,{gap:3,children:[(0,$.jsx)(o,{p:2,bg:`orange.100`,borderRadius:`md`,color:`orange.600`,children:(0,$.jsx)(_,{as:F,boxSize:4})}),(0,$.jsx)(s,{fontWeight:`semibold`,fontSize:`sm`,children:`Model Provider Required`})]}),(0,$.jsxs)(s,{fontSize:`xs`,color:`fg.muted`,children:[`Scenarios require a model provider to run.`,` `,(0,$.jsx)(U,{href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,color:`blue.500`,fontWeight:`medium`,children:`Configure model provider`})]}),(0,$.jsx)(r,{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)(S,{overflow:`hidden`,children:(0,$.jsx)(C,{children:(0,$.jsxs)(P,{align:`stretch`,gap:3,children:[(0,$.jsxs)(O,{justify:`space-between`,children:[(0,$.jsxs)(O,{gap:3,children:[(0,$.jsx)(o,{display:`grid`,placeItems:`center`,width:`34px`,height:`34px`,bg:`bg.surface`,borderWidth:`1px`,borderColor:`border`,borderRadius:`10px`,children:(0,$.jsx)(H,{size:18})}),(0,$.jsxs)(o,{children:[(0,$.jsx)(s,{fontWeight:`semibold`,fontSize:`sm`,children:`AI draft`}),(0,$.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:p?`Refine this draft`:`Draft this scenario`})]})]}),(0,$.jsxs)(r,{variant:`ghost`,size:`xs`,onClick:()=>a(`prompt`),children:[(0,$.jsx)(ne,{size:14}),`Back`]})]}),(0,$.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:p?`Describe what should change. The form stays editable.`:`Describe what your agent does and the behavior you want to test.`}),x.ok===!1&&x.reason===`no-default`&&(0,$.jsxs)(nt,{children:[`No default model set. Configure one in`,` `,(0,$.jsx)(U,{href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,color:`blue.500`,fontWeight:`medium`,children:`Settings → Model Providers`}),`.`]}),x.ok===!1&&x.reason===`stale-default`&&(0,$.jsxs)(nt,{children:[`Your default model's provider is disabled. Configure a new default in`,` `,(0,$.jsx)(U,{href:`/settings/model-providers`,target:`_blank`,rel:`noopener noreferrer`,color:`blue.500`,fontWeight:`medium`,children:`Settings → Model Providers`}),`.`]}),g===`done`&&p&&(0,$.jsxs)(O,{gap:2,padding:2,bg:`green.50`,borderRadius:`md`,fontSize:`xs`,color:`green.700`,children:[(0,$.jsx)(_,{as:h,boxSize:3}),(0,$.jsx)(s,{children:`Generated! Review and edit the form on the left.`})]}),p&&(0,$.jsxs)(o,{borderWidth:`1px`,borderColor:`border.subtle`,borderRadius:`md`,bg:`bg.surface`,padding:2.5,children:[(0,$.jsxs)(s,{fontSize:`10px`,fontWeight:`bold`,color:`fg.muted`,letterSpacing:`0.08em`,textTransform:`uppercase`,marginBottom:1,children:[`Latest request · `,u.length,` `,u.length===1?`turn`:`turns`]}),(0,$.jsx)(s,{fontSize:`xs`,color:`fg.muted`,lineClamp:2,children:u.at(-1)})]}),(0,$.jsx)(M,{placeholder:p?`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=>l(e.target.value),onKeyDown:k,disabled:g===`generating`||w,rows:$e,fontSize:`sm`}),(0,$.jsx)(r,{colorPalette:`orange`,size:`sm`,onClick:D,disabled:!E,children:g===`generating`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(n,{size:`sm`}),`Drafting…`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(H,{size:14}),p?`Refine with AI`:`Draft with AI`]})}),(0,$.jsx)(je,{model:b.data?.model})]})})})}function nt({children:e}){return(0,$.jsxs)(v,{status:`warning`,fontSize:`xs`,alignItems:`flex-start`,children:[(0,$.jsx)(b,{children:(0,$.jsx)(_,{as:F,boxSize:3})}),(0,$.jsxs)(x,{gap:2,children:[(0,$.jsx)(y,{children:e}),(0,$.jsx)(r,{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)(P,{align:`stretch`,gap:4,children:[(0,$.jsx)(tt,{form:e??null}),(0,$.jsx)(S,{children:(0,$.jsx)(C,{children:(0,$.jsxs)(P,{align:`stretch`,gap:3,children:[(0,$.jsx)(s,{fontWeight:`semibold`,fontSize:`sm`,children:`Writing Great Scenarios`}),(0,$.jsxs)(P,{align:`stretch`,gap:3,children:[(0,$.jsxs)(O,{align:`start`,gap:3,children:[(0,$.jsx)(_,{color:`green.500`,mt:.5,children:(0,$.jsx)(re,{size:16})}),(0,$.jsxs)(P,{align:`start`,gap:0,children:[(0,$.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:`Define Success Clearly`}),(0,$.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:`What does 'good' look like? Be specific about expected outcomes.`})]})]}),(0,$.jsxs)(O,{align:`start`,gap:3,children:[(0,$.jsx)(_,{color:`yellow.500`,mt:.5,children:(0,$.jsx)(F,{size:16})}),(0,$.jsxs)(P,{align:`start`,gap:0,children:[(0,$.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:`Consider Edge Cases`}),(0,$.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:`What unusual situations should your agent handle?`})]})]}),(0,$.jsxs)(O,{align:`start`,gap:3,children:[(0,$.jsx)(_,{color:`purple.500`,mt:.5,children:(0,$.jsx)(le,{size:16})}),(0,$.jsxs)(P,{align:`start`,gap:0,children:[(0,$.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:`Think About Personas`}),(0,$.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:`Who are your users? Different users have different needs.`})]})]}),(0,$.jsxs)(O,{align:`start`,gap:3,children:[(0,$.jsx)(_,{color:`blue.500`,mt:.5,children:(0,$.jsx)(c,{size:16})}),(0,$.jsxs)(P,{align:`start`,gap:0,children:[(0,$.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:`Conversation Flow`}),(0,$.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:`How should the conversation progress?`})]})]})]})]})})}),(0,$.jsx)(S,{children:(0,$.jsx)(C,{children:(0,$.jsxs)(P,{align:`stretch`,gap:3,children:[(0,$.jsx)(s,{fontWeight:`semibold`,fontSize:`sm`,children:`Best Practices`}),(0,$.jsxs)(A,{gap:2,listStyleType:`none`,children:[(0,$.jsxs)(k,{fontSize:`xs`,color:`fg.muted`,children:[(0,$.jsx)(j,{asChild:!0,color:`blue.500`,children:(0,$.jsx)(h,{size:14})}),`Start with small simulations to validate quickly`]}),(0,$.jsxs)(k,{fontSize:`xs`,color:`fg.muted`,children:[(0,$.jsx)(j,{asChild:!0,color:`blue.500`,children:(0,$.jsx)(h,{size:14})}),`Use specific prompts for better results`]}),(0,$.jsxs)(k,{fontSize:`xs`,color:`fg.muted`,children:[(0,$.jsx)(j,{asChild:!0,color:`blue.500`,children:(0,$.jsx)(h,{size:14})}),`Include edge cases in your testing`]}),(0,$.jsxs)(k,{fontSize:`xs`,color:`fg.muted`,children:[(0,$.jsx)(j,{asChild:!0,color:`blue.500`,children:(0,$.jsx)(h,{size:14})}),`Review metrics after each run`]})]})]})})})]})}function it({value:e,onChange:t,placeholder:n=`Add a criterion...`,disabled:i=!1}){let[a,o]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),[f,m]=(0,Z.useState)(``),h=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{c&&requestAnimationFrame(()=>h.current?.focus())},[c]);let g=()=>{a.trim()&&(t([...e,a.trim()]),o(``)),l(!1)},_=n=>{t(e.filter((e,t)=>t!==n)),d(null)},v=t=>{d(t),m(e[t]??``)},y=()=>{if(u!==null){if(f.trim()){let n=[...e];n[u]=f.trim(),t(n)}else t(e.filter((e,t)=>t!==u));d(null)}},b=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),g()),e.key===`Escape`&&(o(``),l(!1))},x=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y()),e.key===`Escape`&&d(null)};return(0,$.jsxs)(P,{align:`stretch`,gap:2,"data-testid":`criteria-list`,children:[e.map((e,t)=>u===t?(0,$.jsxs)(O,{gap:2,align:`start`,children:[(0,$.jsxs)(s,{fontSize:`sm`,color:`fg.muted`,flexShrink:0,mt:`6px`,children:[t+1,`.`]}),(0,$.jsxs)(P,{align:`stretch`,gap:1,flex:1,children:[(0,$.jsx)(M,{value:f,onChange:e=>m(e.target.value),onKeyDown:x,onBlur:y,size:`sm`,autoresize:!0,rows:2,autoFocus:!0}),(0,$.jsxs)(O,{gap:1,children:[(0,$.jsx)(w,{type:`button`,size:`xs`,variant:`outline`,colorPalette:`red`,onClick:()=>_(t),"aria-label":`Delete criterion`,children:(0,$.jsx)(p,{size:12})}),(0,$.jsx)(ee,{}),(0,$.jsx)(r,{type:`button`,size:`xs`,variant:`outline`,onMouseDown:e=>e.preventDefault(),onClick:()=>d(null),children:`Cancel`}),(0,$.jsx)(r,{type:`button`,size:`xs`,variant:`outline`,onClick:y,children:`Save`})]})]})]},t):(0,$.jsxs)(O,{gap:1,align:`start`,py:1,role:`group`,cursor:`pointer`,onClick:()=>v(t),children:[(0,$.jsxs)(s,{fontSize:`sm`,color:`fg.muted`,flexShrink:0,mt:`1px`,children:[t+1,`.`]}),(0,$.jsx)(s,{flex:1,fontSize:`sm`,whiteSpace:`pre-wrap`,children:e}),(0,$.jsx)(pe,{size:14,style:{flexShrink:0,marginTop:`2px`,color:`var(--chakra-colors-fg-muted)`}})]},t)),c&&(0,$.jsxs)(P,{align:`stretch`,gap:1,children:[(0,$.jsxs)(O,{gap:2,align:`start`,children:[(0,$.jsxs)(s,{fontSize:`sm`,color:`fg.muted`,flexShrink:0,mt:`6px`,children:[e.length+1,`.`]}),(0,$.jsx)(M,{ref:h,size:`sm`,value:a,onChange:e=>o(e.target.value),placeholder:n,flex:1,onKeyDown:b,onBlur:g,_placeholder:{color:`gray.400`,fontStyle:`italic`},autoresize:!0,rows:2})]}),(0,$.jsxs)(O,{gap:1,justify:`end`,children:[(0,$.jsx)(r,{type:`button`,size:`xs`,variant:`outline`,onMouseDown:e=>e.preventDefault(),onClick:()=>{o(``),l(!1)},children:`Cancel`}),(0,$.jsx)(r,{type:`button`,size:`xs`,variant:`outline`,onClick:g,children:`Save`})]})]}),!c&&(0,$.jsxs)(r,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>l(!0),disabled:i,alignSelf:`start`,children:[(0,$.jsx)(W,{size:14}),e.length===0?`Add the first criteria`:`Add criteria`]})]})}function at({children:e,...t}){return(0,$.jsx)(s,{fontSize:`11px`,fontWeight:`bold`,textTransform:`uppercase`,color:`fg.muted`,letterSpacing:`0.5px`,...t,children:e})}var ot=K({name:Y().min(1,`Name is required`),situation:Y(),criteria:J(Y()),labels:J(Y())});function st({defaultValues:e,formRef:t}){let n=ge({defaultValues:{name:``,situation:``,criteria:[],labels:[],...e},resolver:ve(ot)}),{register:r,control:i,reset:a,formState:{errors:o}}=n;(0,Z.useEffect)(()=>{t?.(n)},[n,t]);let c=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{let t=e?JSON.stringify([e.name,e.situation,e.criteria,e.labels]):null;t!==c.current&&(c.current=t,e&&a({name:``,situation:``,criteria:[],labels:[],...e}))},[e,a]),(0,$.jsxs)(P,{align:`stretch`,gap:6,children:[(0,$.jsx)(P,{align:`stretch`,gap:3,children:(0,$.jsxs)(T,{invalid:!!o.name,children:[(0,$.jsx)(at,{children:`Name`}),(0,$.jsx)(V,{...r(`name`),placeholder:`e.g., Angry refund request`}),(0,$.jsx)(E,{children:o.name?.message})]})}),(0,$.jsxs)(P,{align:`stretch`,gap:3,children:[(0,$.jsxs)(P,{align:`stretch`,gap:1,children:[(0,$.jsx)(at,{children:`Situation`}),(0,$.jsx)(s,{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)(T,{invalid:!!o.situation,children:[(0,$.jsx)(M,{...r(`situation`),placeholder:`e.g., A frustrated premium subscriber who was charged twice...`,rows:5,_placeholder:{color:`gray.400`,fontStyle:`italic`}}),(0,$.jsx)(E,{children:o.situation?.message})]})]}),(0,$.jsxs)(P,{align:`stretch`,gap:3,children:[(0,$.jsxs)(P,{align:`stretch`,gap:1,children:[(0,$.jsx)(at,{children:`Criteria`}),(0,$.jsx)(s,{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)(_e,{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(e){let t=oe(),{drawerOpen:n}=ue(),r=e.open??n(`scenarioEditor`);return(0,$.jsx)(lt,{...e,open:r,scenarioId:t.scenarioId})}function lt(e){let{project:t}=G(),n=ie(),{closeDrawer:i,openDrawer:a}=ue(),o=ce(),s=o&&`initialFormData`in o?o:{},c=R.useContext(),[l,d]=(0,Z.useState)(null),{runScenario:p,isRunning:h}=Ve({projectId:t?.id,projectSlug:t?.slug}),_=e.scenarioId,v=ye(`scenarios`),{target:y,setTarget:b}=He(_),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(!1),[j,ee]=(0,Z.useState)(null),[M,N]=(0,Z.useState)(null),[P,te]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{y&&!x&&S(y)},[y,x]);let F=(0,Z.useCallback)(e=>{S(e),e&&_&&b(e)},[b,_]),ne=(0,Z.useCallback)(()=>{let e=e=>{let t=e.type;F({type:t,id:e.id}),f.create({title:`Agent created`,description:`"${e.name}" is now selected as the target.`,type:`success`,meta:{closable:!0}})};me(`agentHttpEditor`,{onSave:e}),me(`agentCodeEditor`,{onSave:e}),me(`workflowSelector`,{onSave:e}),E(!0)},[F]),re=e.open!==!1&&e.open!==void 0,I=e.onClose??i,{data:L}=R.scenarios.getById.useQuery({projectId:t?.id??``,id:_??``},{enabled:!!t&&!!_}),z=R.scenarios.create.useMutation({onSuccess:n=>{c.scenarios.getAll.invalidate({projectId:t?.id??``}),e.onSuccess?.(n)},onError:e=>{ae(e)||f.create({title:`Failed to create scenario`,description:e.message,type:`error`,meta:{closable:!0}})}}),B=R.scenarios.update.useMutation({onSuccess:n=>{c.scenarios.getAll.invalidate({projectId:t?.id??``}),c.scenarios.getById.invalidate({projectId:t?.id??``,id:n.id}),e.onSuccess?.(n)},onError:e=>{ae(e)||f.create({title:`Failed to update scenario`,description:e.message,type:`error`,meta:{closable:!0}})}}),V=(0,Z.useCallback)(e=>{a(`scenarioEditor`,{urlParams:{scenarioId:e}},{resetStack:!0})},[a]),H=(0,Z.useCallback)(async({data:e,skipTransition:n=!1,models:r})=>{if(!t?.id)return null;if(L)try{return await B.mutateAsync({projectId:t.id,id:L.id,...e,...r??{}})}catch{return null}return new Promise(i=>{Te([v],async()=>{try{let a=await z.mutateAsync({projectId:t.id,...e,...r??{}});n||V(a.id),i(a)}catch{i(null)}}),v.isAllowed||i(null)})},[t?.id,L,z,B,v,V]),oe=(0,Z.useCallback)(async e=>{let n=l;if(!(!n||!t?.id||!t?.slug)){if(!e){f.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 c.agents.getById.fetch({id:e.id,projectId:t.id});if(n&&!Se(n.config.scenarioMappings??{})){let t=()=>a(`agentWorkflowEditor`,{urlParams:{agentId:e.id}});f.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()&&(N(L?.simulatorModel??null),te(L?.judgeModel??null),ee(e),A(!0))}},[t?.id,t?.slug,l,c,a,L]),U=(0,Z.useCallback)(async()=>{let e=l,r=j;if(!(!e||!r||!t?.id||!t?.slug)){A(!1);try{await e.handleSubmit(async e=>{let i=await H({data:e,skipTransition:!0,models:{simulatorModel:M,judgeModel:P}});if(!i)return;b(r);let a=Oe(m.SCENARIO_BATCH).toString();p({scenarioId:i.id,target:r,batchRunId:a}),n.push(`/${t.slug}/simulations?pendingBatch=${a}`)})()}catch(e){f.create({title:`Failed to run scenario`,description:e instanceof Error?e.message:`An error occurred`,type:`error`,meta:{closable:!0}})}}},[l,j,t?.id,t?.slug,H,b,p,n,M,P]),W=(0,Z.useCallback)(async()=>{let e=l;e&&await e.handleSubmit(async e=>{try{await H({data:e,skipTransition:!0})&&(f.create({title:L?`Scenario updated`:`Scenario created`,type:`success`,meta:{closable:!0}}),I())}catch{}})()},[H,L,l,I]),le=(0,Z.useCallback)(e=>{d(e)},[]),K=z.isPending||B.isPending||h,q=e.initialFormData??s.initialFormData,J=(0,Z.useMemo)(()=>L??q??void 0,[L,q]);return(0,$.jsxs)(u.Root,{open:re,onOpenChange:({open:e})=>!e&&I(),size:`xl`,children:[(0,$.jsxs)(u.Content,{bg:`bg`,children:[(0,$.jsx)(u.CloseTrigger,{}),(0,$.jsx)(u.Header,{borderBottomWidth:`1px`,children:(0,$.jsx)(fe,{size:`md`,children:L?`Edit Scenario`:`Create Scenario`})}),(0,$.jsx)(u.Body,{padding:0,overflow:`hidden`,children:(0,$.jsxs)(g,{templateColumns:`1fr 320px`,height:`full`,overflow:`hidden`,children:[(0,$.jsx)(D,{overflowY:`auto`,padding:6,borderRightWidth:`1px`,borderColor:`border`,children:(0,$.jsx)(st,{defaultValues:J,formRef:le},_??`new`)}),(0,$.jsx)(D,{overflowY:`auto`,padding:4,bg:`bg.muted`,children:(0,$.jsx)(rt,{form:l})})]})}),(0,$.jsxs)(u.Footer,{borderTopWidth:`1px`,justifyContent:`space-between`,children:[l&&(0,$.jsx)(ut,{form:l}),(0,$.jsxs)(O,{gap:2,flexShrink:0,children:[(0,$.jsx)(r,{variant:`outline`,size:`sm`,onClick:I,children:`Cancel`}),(0,$.jsx)(Ke,{selectedTarget:x,onTargetChange:F,onSaveAndRun:oe,onSaveWithoutRunning:W,onCreateAgent:ne,onCreatePrompt:()=>w(!0),isLoading:K})]})]})]}),(0,$.jsx)(Je,{open:k,onOpenChange:A,simulatorModel:M,judgeModel:P,onSimulatorChange:N,onJudgeChange:te,onConfirm:U,isRunning:K}),(0,$.jsx)(xe,{open:T,onClose:()=>{E(!1),se()}}),(0,$.jsx)(Ee,{open:C,onClose:()=>w(!1),onSave:e=>{F({type:`prompt`,id:e.id}),w(!1),f.create({title:`Prompt created`,description:`"${e.name}" is now selected as the target.`,type:`success`,meta:{closable:!0}})}})]})}function ut({form:e}){let t=he({control:e.control,name:`labels`});return(0,$.jsxs)(O,{gap:2,flex:1,overflow:`hidden`,flexWrap:`wrap`,children:[(0,$.jsx)(s,{fontSize:`xs`,fontWeight:`medium`,color:`fg.muted`,flexShrink:0,children:`Labels`}),(0,$.jsx)(Ne,{labels:t,onRemove:(n,r)=>e.setValue(`labels`,t.filter((e,t)=>t!==r)),onAdd:n=>e.setValue(`labels`,[...t,n])})]})}export{lt as ScenarioFormDrawer,ct as ScenarioFormDrawerFromUrl,Ve as a,He as i,Ge as n,We as r,qe as t};
2
- //# sourceMappingURL=ScenarioFormDrawer-9224CX_d.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{t as n}from"./jsx-runtime-CFwixLRt.js";import{t as r}from"./box-Ck5lef6C.js";import{t as i}from"./text-A3qvcMyN.js";import{nt as a}from"./ExternalImage-DbtOSrKl.js";import{t as o}from"./v-stack-ClAMS101.js";import{Or as s}from"./index-CUhcyBp3.js";import{t as c}from"./VariablesSection-DnkttoMe.js";var l=e(t()),u=n(),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:n,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)(o,{align:`stretch`,gap:4,children:[(0,u.jsx)(a,{}),(0,u.jsxs)(o,{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)(s,{href:`https://docs.langwatch.ai/features/scenarios`,target:`_blank`,color:`blue.fg`,children:`Learn more`})]})]}),(0,u.jsxs)(r,{children:[(0,u.jsx)(c,{variables:d,onChange:()=>{},mappings:x,onMappingChange:(e,r)=>{for(let[r,i]of Object.entries(t))i.type===`source`&&i.path[0]===e&&n(r,void 0);if(r?.type===`source`&&r.path[0]){let t=r.path[0];n(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)(o,{align:`stretch`,gap:1,marginTop:2,children:C.map(([e,t])=>(0,u.jsxs)(r,{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)(r,{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-Sqtj3HwL.js.map