rasa-pro 3.13.1a18__py3-none-any.whl → 3.13.1a20__py3-none-any.whl

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.

Potentially problematic release.


This version of rasa-pro might be problematic. Click here for more details.

Files changed (273) hide show
  1. rasa/__main__.py +8 -0
  2. rasa/builder/auth.py +71 -0
  3. rasa/builder/config.py +16 -0
  4. rasa/builder/copilot/constants.py +15 -0
  5. rasa/builder/copilot/copilot.py +342 -0
  6. rasa/builder/copilot/copilot_response_handler.py +471 -0
  7. rasa/builder/copilot/exceptions.py +20 -0
  8. rasa/builder/copilot/models.py +344 -0
  9. rasa/builder/copilot/prompts/copilot_system_prompt.jinja2 +495 -0
  10. rasa/builder/copilot/telemetry.py +195 -0
  11. rasa/builder/document_retrieval/__init__.py +0 -0
  12. rasa/builder/document_retrieval/constants.py +16 -0
  13. rasa/builder/{inkeep_document_retrieval.py → document_retrieval/inkeep_document_retrieval.py} +53 -44
  14. rasa/builder/document_retrieval/models.py +62 -0
  15. rasa/builder/download.py +140 -0
  16. rasa/builder/guardrails/__init__.py +1 -0
  17. rasa/builder/guardrails/constants.py +4 -0
  18. rasa/builder/guardrails/exceptions.py +4 -0
  19. rasa/builder/guardrails/lakera.py +188 -0
  20. rasa/builder/guardrails/models.py +199 -0
  21. rasa/builder/guardrails/utils.py +305 -0
  22. rasa/builder/job_manager.py +87 -0
  23. rasa/builder/jobs.py +232 -0
  24. rasa/builder/llm_service.py +89 -173
  25. rasa/builder/logging_utils.py +162 -4
  26. rasa/builder/main.py +29 -16
  27. rasa/builder/models.py +93 -121
  28. rasa/builder/project_generator.py +91 -7
  29. rasa/builder/scrape_rasa_docs.py +1 -1
  30. rasa/builder/service.py +650 -452
  31. rasa/builder/shared/tracker_context.py +212 -0
  32. rasa/builder/validation_service.py +4 -4
  33. rasa/cli/data.py +8 -3
  34. rasa/cli/project_templates/basic/actions/action_api.py +15 -0
  35. rasa/cli/project_templates/basic/actions/action_human_handoff.py +44 -0
  36. rasa/cli/project_templates/basic/config.yml +23 -0
  37. rasa/cli/project_templates/{plain → basic}/credentials.yml +8 -7
  38. rasa/cli/project_templates/basic/data/general/feedback.yml +20 -0
  39. rasa/cli/project_templates/basic/data/general/goodbye.yml +6 -0
  40. rasa/cli/project_templates/basic/data/general/hello.yml +7 -0
  41. rasa/cli/project_templates/basic/data/general/help.yml +6 -0
  42. rasa/cli/project_templates/basic/data/general/human_handoff.yml +16 -0
  43. rasa/cli/project_templates/basic/data/general/welcome.yml +9 -0
  44. rasa/cli/project_templates/{finance/data/patterns → basic/data/system}/pattern_completed.yml +2 -1
  45. rasa/cli/project_templates/basic/data/system/pattern_correction.yml +7 -0
  46. rasa/cli/project_templates/basic/data/system/pattern_search.yml +8 -0
  47. rasa/cli/project_templates/basic/data/system/pattern_session_start.yml +8 -0
  48. rasa/cli/project_templates/basic/docs/rasa_assistant_qa.txt +65 -0
  49. rasa/cli/project_templates/basic/docs/template.txt +7 -0
  50. rasa/cli/project_templates/basic/domain/general/assistant_details.yml +12 -0
  51. rasa/cli/project_templates/basic/domain/general/bot_identity.yml +5 -0
  52. rasa/cli/project_templates/basic/domain/general/cannot_handle.yml +5 -0
  53. rasa/cli/project_templates/basic/domain/general/feedback.yml +28 -0
  54. rasa/cli/project_templates/basic/domain/general/goodbye.yml +7 -0
  55. rasa/cli/project_templates/basic/domain/general/help.yml +5 -0
  56. rasa/cli/project_templates/basic/domain/general/human_handoff_domain.yml +35 -0
  57. rasa/cli/project_templates/{finance/domain/default_actions.yml → basic/domain/general/utils.yml} +0 -3
  58. rasa/cli/project_templates/basic/domain/general/welcome.yml +7 -0
  59. rasa/cli/project_templates/{plain → basic}/endpoints.yml +42 -27
  60. rasa/cli/project_templates/basic/prompts/rephraser_demo_personality_prompt.jinja2 +19 -0
  61. rasa/cli/project_templates/defaults.py +25 -3
  62. rasa/cli/project_templates/finance/actions/__init__.py +46 -0
  63. rasa/cli/project_templates/finance/actions/accounts/__init__.py +0 -0
  64. rasa/cli/project_templates/finance/actions/{action_ask_account.py → accounts/action_ask_account.py} +6 -9
  65. rasa/cli/project_templates/finance/actions/{action_check_balance.py → accounts/action_check_balance.py} +4 -4
  66. rasa/cli/project_templates/finance/actions/action_session_start.py +11 -6
  67. rasa/cli/project_templates/finance/actions/cards/__init__.py +0 -0
  68. rasa/cli/project_templates/finance/actions/{action_ask_card.py → cards/action_ask_card.py} +4 -3
  69. rasa/cli/project_templates/finance/actions/{action_check_card_existence.py → cards/action_check_card_existence.py} +4 -3
  70. rasa/cli/project_templates/finance/actions/{action_update_card_status.py → cards/action_update_card_status.py} +18 -9
  71. rasa/cli/project_templates/finance/actions/database.py +1 -0
  72. rasa/cli/project_templates/finance/actions/transfers/__init__.py +0 -0
  73. rasa/cli/project_templates/finance/actions/{action_add_payee.py → transfers/action_add_payee.py} +8 -3
  74. rasa/cli/project_templates/finance/actions/{action_ask_account_from.py → transfers/action_ask_account_from.py} +5 -4
  75. rasa/cli/project_templates/finance/actions/{action_check_payee_existence.py → transfers/action_check_payee_existence.py} +3 -3
  76. rasa/cli/project_templates/finance/actions/{action_check_sufficient_funds.py → transfers/action_check_sufficient_funds.py} +3 -4
  77. rasa/cli/project_templates/finance/actions/{action_list_payees.py → transfers/action_list_payees.py} +4 -3
  78. rasa/cli/project_templates/finance/actions/{action_remove_payee.py → transfers/action_remove_payee.py} +4 -4
  79. rasa/cli/project_templates/finance/config.yml +8 -19
  80. rasa/cli/project_templates/finance/credentials.yml +6 -7
  81. rasa/cli/project_templates/finance/csvs/cards.csv +10 -10
  82. rasa/cli/project_templates/finance/csvs/payees.csv +10 -9
  83. rasa/cli/project_templates/finance/data/{flows → accounts}/check_balance.yml +2 -1
  84. rasa/cli/project_templates/finance/data/general/bot_identity.yml +6 -0
  85. rasa/cli/project_templates/finance/data/general/feedback.yml +20 -0
  86. rasa/cli/project_templates/finance/data/general/goodbye.yml +6 -0
  87. rasa/cli/project_templates/finance/data/general/hello.yml +7 -0
  88. rasa/cli/project_templates/finance/data/{flows/welcome.yml → general/help.yml} +2 -7
  89. rasa/cli/project_templates/finance/data/general/human_handoff.yml +16 -0
  90. rasa/cli/project_templates/finance/data/general/welcome.yml +9 -0
  91. rasa/cli/project_templates/finance/data/{patterns → system/patterns}/pattern_chitchat.yml +0 -2
  92. rasa/cli/project_templates/finance/data/system/patterns/pattern_completed.yml +7 -0
  93. rasa/cli/project_templates/finance/data/system/patterns/pattern_correction.yml +7 -0
  94. rasa/cli/project_templates/finance/data/system/patterns/pattern_search.yml +8 -0
  95. rasa/cli/project_templates/finance/data/{patterns → system/patterns}/pattern_session_start.yml +0 -1
  96. rasa/cli/project_templates/finance/domain/{check_balance.yml → accounts/check_balance.yml} +2 -0
  97. rasa/cli/project_templates/finance/domain/general/assistant_details.yml +12 -0
  98. rasa/cli/project_templates/finance/domain/general/bot_identity.yml +5 -0
  99. rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +5 -0
  100. rasa/cli/project_templates/finance/domain/general/defaults.yml +24 -0
  101. rasa/cli/project_templates/finance/domain/general/feedback.yml +28 -0
  102. rasa/cli/project_templates/finance/domain/general/goodbye.yml +7 -0
  103. rasa/cli/project_templates/finance/domain/general/help.yml +5 -0
  104. rasa/cli/project_templates/finance/domain/general/human_handoff.yml +30 -0
  105. rasa/cli/project_templates/finance/domain/general/utils.yml +13 -0
  106. rasa/cli/project_templates/finance/domain/general/welcome.yml +8 -0
  107. rasa/cli/project_templates/finance/endpoints.yml +1 -0
  108. rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +3 -3
  109. rasa/cli/project_templates/telco/actions/actions_billing.py +24 -17
  110. rasa/cli/project_templates/telco/actions/actions_get_data_from_db.py +6 -1
  111. rasa/cli/project_templates/telco/actions/actions_run_diagnostics.py +6 -1
  112. rasa/cli/project_templates/telco/actions/actions_session_start.py +6 -1
  113. rasa/cli/project_templates/tutorial/config.yml +2 -1
  114. rasa/cli/scaffold.py +27 -2
  115. rasa/cli/train.py +8 -0
  116. rasa/cli/utils.py +31 -15
  117. rasa/core/actions/action.py +28 -41
  118. rasa/core/actions/action_run_slot_rejections.py +1 -1
  119. rasa/core/channels/development_inspector.py +47 -14
  120. rasa/core/channels/inspector/dist/assets/{arc-371401b1.js → arc-1ddec37b.js} +1 -1
  121. rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-3f126156.js → blockDiagram-38ab4fdb-18af387c.js} +1 -1
  122. rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-12f22eb7.js → c4Diagram-3d4e48cf-250127a3.js} +1 -1
  123. rasa/core/channels/inspector/dist/assets/channel-59f6d54b.js +1 -0
  124. rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-03b1d386.js → classDiagram-70f12bd4-c3388b34.js} +1 -1
  125. rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-84f69d63.js → classDiagram-v2-f2320105-9c893a82.js} +1 -1
  126. rasa/core/channels/inspector/dist/assets/clone-26177ddb.js +1 -0
  127. rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-ca47fd38.js → createText-2e5e7dd3-c111213b.js} +1 -1
  128. rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-f837ca8a.js → edges-e0da2a9e-812a729d.js} +1 -1
  129. rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-8717ac54.js → erDiagram-9861fffd-fd5051bc.js} +1 -1
  130. rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-94f38b83.js → flowDb-956e92f1-3287ac02.js} +1 -1
  131. rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-b616f9fb.js → flowDiagram-66a62f08-692fb0b2.js} +1 -1
  132. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-29c03f5a.js +1 -0
  133. rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-f5d24bb8.js → flowchart-elk-definition-4a651766-008376f1.js} +1 -1
  134. rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-b43ba8d9.js → ganttDiagram-c361ad54-df330a69.js} +1 -1
  135. rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-c3aafaa5.js → gitGraphDiagram-72cf32ee-e03676fb.js} +1 -1
  136. rasa/core/channels/inspector/dist/assets/{graph-0d0a2c10.js → graph-46fad2ba.js} +1 -1
  137. rasa/core/channels/inspector/dist/assets/{index-3862675e-58ea0305.js → index-3862675e-a484ac55.js} +1 -1
  138. rasa/core/channels/inspector/dist/assets/{index-cce6f8a1.js → index-a003633f.js} +179 -179
  139. rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-b8f60461.js → infoDiagram-f8f76790-3f9e6ec2.js} +1 -1
  140. rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-95be5545.js → journeyDiagram-49397b02-79f72383.js} +1 -1
  141. rasa/core/channels/inspector/dist/assets/{layout-da885b9b.js → layout-aad098e5.js} +1 -1
  142. rasa/core/channels/inspector/dist/assets/{line-f1c817d3.js → line-219ab7ae.js} +1 -1
  143. rasa/core/channels/inspector/dist/assets/{linear-d42801e6.js → linear-2cddbe62.js} +1 -1
  144. rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-a38923a6.js → mindmap-definition-fc14e90a-1d41ed99.js} +1 -1
  145. rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-ca6e71e9.js → pieDiagram-8a3498a8-cc496ee8.js} +1 -1
  146. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-b290dae9.js → quadrantDiagram-120e2f19-84d32884.js} +1 -1
  147. rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-03f02ceb.js → requirementDiagram-deff3bca-c0deb984.js} +1 -1
  148. rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-c49eee40.js → sankeyDiagram-04a897e0-b9d7fd62.js} +1 -1
  149. rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-b2cd6a3d.js → sequenceDiagram-704730f1-7d517565.js} +1 -1
  150. rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-e53a2028.js → stateDiagram-587899a1-98ef9b27.js} +1 -1
  151. rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-e1982a03.js → stateDiagram-v2-d93cdb3a-cee70748.js} +1 -1
  152. rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-d0226ca5.js → styles-6aaf32cf-3f9d1c96.js} +1 -1
  153. rasa/core/channels/inspector/dist/assets/{styles-9a916d00-0e21dc00.js → styles-9a916d00-67471923.js} +1 -1
  154. rasa/core/channels/inspector/dist/assets/{styles-c10674c1-9588494e.js → styles-c10674c1-bd093fb7.js} +1 -1
  155. rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-be478d4f.js → svgDrawCommon-08f97a94-675794e8.js} +1 -1
  156. rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-74631749.js → timeline-definition-85554ec2-0ac67617.js} +1 -1
  157. rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-a043552f.js → xychartDiagram-e933f94c-c018dc37.js} +1 -1
  158. rasa/core/channels/inspector/dist/index.html +2 -2
  159. rasa/core/channels/inspector/index.html +1 -1
  160. rasa/core/channels/inspector/package.json +4 -3
  161. rasa/core/channels/inspector/src/App.tsx +53 -7
  162. rasa/core/channels/inspector/src/components/Chat.tsx +3 -2
  163. rasa/core/channels/inspector/src/components/DiagramFlow.tsx +1 -1
  164. rasa/core/channels/inspector/src/components/LatencyDisplay.tsx +268 -0
  165. rasa/core/channels/inspector/src/components/LoadingSpinner.tsx +6 -2
  166. rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +8 -3
  167. rasa/core/channels/inspector/src/types.ts +8 -0
  168. rasa/core/channels/inspector/yarn.lock +12 -12
  169. rasa/core/channels/studio_chat.py +119 -34
  170. rasa/core/channels/voice_ready/twilio_voice.py +1 -1
  171. rasa/core/channels/voice_stream/asr/asr_engine.py +5 -1
  172. rasa/core/channels/voice_stream/asr/deepgram.py +5 -0
  173. rasa/core/channels/voice_stream/audiocodes.py +16 -8
  174. rasa/core/channels/voice_stream/browser_audio.py +39 -4
  175. rasa/core/channels/voice_stream/call_state.py +13 -2
  176. rasa/core/channels/voice_stream/genesys.py +16 -13
  177. rasa/core/channels/voice_stream/jambonz.py +14 -12
  178. rasa/core/channels/voice_stream/twilio_media_streams.py +14 -13
  179. rasa/core/channels/voice_stream/util.py +11 -1
  180. rasa/core/channels/voice_stream/voice_channel.py +108 -29
  181. rasa/core/nlg/callback.py +1 -1
  182. rasa/core/nlg/contextual_response_rephraser.py +19 -9
  183. rasa/core/nlg/generator.py +21 -5
  184. rasa/core/nlg/response.py +43 -6
  185. rasa/core/nlg/translate.py +8 -0
  186. rasa/core/policies/enterprise_search_policy.py +16 -21
  187. rasa/dialogue_understanding/commands/correct_slots_command.py +38 -10
  188. rasa/dialogue_understanding/generator/command_generator.py +5 -5
  189. rasa/dialogue_understanding/generator/command_parser.py +9 -13
  190. rasa/dialogue_understanding/processor/command_processor.py +149 -55
  191. rasa/dialogue_understanding/stack/utils.py +13 -3
  192. rasa/dialogue_understanding_test/du_test_schema.yml +3 -3
  193. rasa/dialogue_understanding_test/validation.py +9 -10
  194. rasa/e2e_test/e2e_config.py +18 -11
  195. rasa/e2e_test/e2e_test_schema.yml +3 -3
  196. rasa/e2e_test/utils/validation.py +17 -19
  197. rasa/engine/validation.py +86 -91
  198. rasa/exceptions.py +26 -1
  199. rasa/model_manager/model_api.py +2 -2
  200. rasa/model_manager/socket_bridge.py +8 -2
  201. rasa/shared/providers/_configs/default_litellm_client_config.py +3 -7
  202. rasa/shared/utils/cli.py +2 -0
  203. rasa/shared/utils/common.py +2 -1
  204. rasa/shared/utils/health_check/health_check.py +10 -14
  205. rasa/studio/upload.py +6 -2
  206. rasa/studio/utils.py +33 -22
  207. rasa/telemetry.py +95 -22
  208. rasa/utils/licensing.py +21 -10
  209. rasa/utils/log_utils.py +1 -1
  210. rasa/utils/tensorflow/transformer.py +3 -3
  211. rasa/validator.py +7 -5
  212. rasa/version.py +1 -1
  213. {rasa_pro-3.13.1a18.dist-info → rasa_pro-3.13.1a20.dist-info}/METADATA +7 -7
  214. {rasa_pro-3.13.1a18.dist-info → rasa_pro-3.13.1a20.dist-info}/RECORD +242 -203
  215. rasa/builder/create_openai_vector_store.py +0 -228
  216. rasa/builder/llm-helper-schema.json +0 -69
  217. rasa/builder/llm_context.py +0 -81
  218. rasa/builder/llm_helper_prompt.jinja2 +0 -245
  219. rasa/cli/project_templates/finance/data/nlu.yml +0 -29
  220. rasa/cli/project_templates/finance/data/patterns/pattern_search.yml +0 -5
  221. rasa/cli/project_templates/finance/domain/default_flows.yml +0 -33
  222. rasa/cli/project_templates/finance/prompts/command-generator.jinja2 +0 -57
  223. rasa/cli/project_templates/finance/tests/conversation_repair/cancellations.yml +0 -12
  224. rasa/cli/project_templates/finance/tests/conversation_repair/cannot_handle.yml +0 -7
  225. rasa/cli/project_templates/finance/tests/conversation_repair/chitchat.yml +0 -7
  226. rasa/cli/project_templates/finance/tests/conversation_repair/clarification.yml +0 -9
  227. rasa/cli/project_templates/finance/tests/conversation_repair/completion.yml +0 -18
  228. rasa/cli/project_templates/finance/tests/conversation_repair/corrections.yml +0 -17
  229. rasa/cli/project_templates/finance/tests/conversation_repair/digressions.yml +0 -32
  230. rasa/cli/project_templates/finance/tests/conversation_repair/human_handoff.yml +0 -21
  231. rasa/cli/project_templates/finance/tests/conversation_repair/skipping_collect_steps.yml +0 -16
  232. rasa/cli/project_templates/finance/tests/demo_scripts/main.yml +0 -16
  233. rasa/cli/project_templates/finance/tests/happy_paths/balance_verification.yml +0 -15
  234. rasa/cli/project_templates/finance/tests/happy_paths/banking_questions.yml +0 -12
  235. rasa/cli/project_templates/finance/tests/happy_paths/card_blocking.yml +0 -52
  236. rasa/cli/project_templates/finance/tests/happy_paths/money_transfer.yml +0 -136
  237. rasa/cli/project_templates/finance/tests/happy_paths/payee_management.yml +0 -27
  238. rasa/cli/project_templates/finance/tests/happy_paths/user_greeted.yml +0 -5
  239. rasa/cli/project_templates/plain/config.yml +0 -17
  240. rasa/cli/project_templates/plain/data/patterns/pattern_session_start.yml +0 -7
  241. rasa/cli/project_templates/plain/domain.yml +0 -5
  242. rasa/core/channels/inspector/dist/assets/channel-f1efda17.js +0 -1
  243. rasa/core/channels/inspector/dist/assets/clone-fdf164e2.js +0 -1
  244. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-7d7a1629.js +0 -1
  245. rasa/shared/importers/static.py +0 -63
  246. /rasa/{cli/project_templates/plain/actions → builder/copilot}/__init__.py +0 -0
  247. /rasa/builder/{inkeep-rag-response-schema.json → document_retrieval/inkeep-rag-response-schema.json} +0 -0
  248. /rasa/cli/project_templates/finance/actions/{action_process_immediate_payment.py → transfers/action_process_immediate_payment.py} +0 -0
  249. /rasa/cli/project_templates/finance/actions/{action_schedule_payment.py → transfers/action_schedule_payment.py} +0 -0
  250. /rasa/cli/project_templates/finance/actions/{action_validate_payment_date.py → transfers/action_validate_payment_date.py} +0 -0
  251. /rasa/cli/project_templates/finance/data/{flows → cards}/block_card.yml +0 -0
  252. /rasa/cli/project_templates/finance/data/{flows → cards}/select_card.yml +0 -0
  253. /rasa/cli/project_templates/finance/data/{source → system/source}/accounts.json +0 -0
  254. /rasa/cli/project_templates/finance/data/{source → system/source}/advisors.json +0 -0
  255. /rasa/cli/project_templates/finance/data/{source → system/source}/appointments.json +0 -0
  256. /rasa/cli/project_templates/finance/data/{source → system/source}/branches.json +0 -0
  257. /rasa/cli/project_templates/finance/data/{source → system/source}/cards.json +0 -0
  258. /rasa/cli/project_templates/finance/data/{source → system/source}/payees.json +0 -0
  259. /rasa/cli/project_templates/finance/data/{source → system/source}/transactions.json +0 -0
  260. /rasa/cli/project_templates/finance/data/{source → system/source}/users.json +0 -0
  261. /rasa/cli/project_templates/finance/data/{flows → transfers}/add_payee.yml +0 -0
  262. /rasa/cli/project_templates/finance/data/{flows → transfers}/list_payees.yml +0 -0
  263. /rasa/cli/project_templates/finance/data/{flows → transfers}/remove_payee.yml +0 -0
  264. /rasa/cli/project_templates/finance/data/{flows → transfers}/transfer_money.yml +0 -0
  265. /rasa/cli/project_templates/finance/domain/{block_card.yml → cards/block_card.yml} +0 -0
  266. /rasa/cli/project_templates/finance/domain/{select_card.yml → cards/select_card.yml} +0 -0
  267. /rasa/cli/project_templates/finance/domain/{add_payee.yml → transfers/add_payee.yml} +0 -0
  268. /rasa/cli/project_templates/finance/domain/{list_payees.yml → transfers/list_payees.yml} +0 -0
  269. /rasa/cli/project_templates/finance/domain/{remove_payee.yml → transfers/remove_payee.yml} +0 -0
  270. /rasa/cli/project_templates/finance/domain/{transfer_money.yml → transfers/transfer_money.yml} +0 -0
  271. {rasa_pro-3.13.1a18.dist-info → rasa_pro-3.13.1a20.dist-info}/NOTICE +0 -0
  272. {rasa_pro-3.13.1a18.dist-info → rasa_pro-3.13.1a20.dist-info}/WHEEL +0 -0
  273. {rasa_pro-3.13.1a18.dist-info → rasa_pro-3.13.1a20.dist-info}/entry_points.txt +0 -0
@@ -2,12 +2,17 @@ import asyncio
2
2
 
3
3
  from rasa_sdk import Action
4
4
  from rasa_sdk.events import EventType
5
+ from rasa_sdk.executor import CollectingDispatcher
6
+ from rasa_sdk.interfaces import Tracker
7
+ from rasa_sdk.types import DomainDict
5
8
 
6
9
 
7
10
  class ActionSleepAndRespond(Action):
8
11
  def name(self) -> str:
9
12
  return "action_sleep_few_sec"
10
13
 
11
- async def run(self, dispatcher, tracker, domain) -> list[EventType]:
14
+ async def run(
15
+ self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: DomainDict
16
+ ) -> list[EventType]:
12
17
  await asyncio.sleep(3)
13
18
  return []
@@ -1,5 +1,6 @@
1
1
  recipe: default.v1
2
2
  language: en
3
+ assistant_id: placeholder_default
3
4
  pipeline:
4
5
  - name: CompactLLMCommandGenerator
5
6
  llm:
@@ -9,4 +10,4 @@ pipeline:
9
10
 
10
11
  policies:
11
12
  - name: FlowPolicy
12
- # - name: EnterpriseSearchPolicy
13
+ # - name: EnterpriseSearchPolicy
rasa/cli/scaffold.py CHANGED
@@ -5,6 +5,9 @@ from collections import defaultdict
5
5
  from enum import Enum
6
6
  from typing import List, Text
7
7
 
8
+ import randomname
9
+ import structlog
10
+
8
11
  from rasa import telemetry
9
12
  from rasa.api import train
10
13
  from rasa.cli import SubParsersAction
@@ -16,15 +19,18 @@ from rasa.shared.constants import (
16
19
  DEFAULT_MODELS_PATH,
17
20
  DOCS_BASE_URL,
18
21
  )
22
+ from rasa.shared.utils import yaml
19
23
  from rasa.shared.utils.cli import print_error_and_exit, print_success
20
24
 
25
+ structlogger = structlog.get_logger(__name__)
26
+
21
27
 
22
28
  class ProjectTemplateName(Enum):
23
29
  """Enum of CALM project templates."""
24
30
 
25
31
  DEFAULT = "default"
26
32
  TUTORIAL = "tutorial"
27
- PLAIN = "plain"
33
+ BASIC = "basic"
28
34
  FINANCE = "finance"
29
35
  TELCO = "telco"
30
36
 
@@ -42,6 +48,9 @@ class ProjectTemplateName(Enum):
42
48
 
43
49
  template_domain_path = defaultdict(lambda: DEFAULT_DOMAIN_PATH)
44
50
  template_domain_path[ProjectTemplateName.DEFAULT] = "domain"
51
+ template_domain_path[ProjectTemplateName.BASIC] = "domain"
52
+ template_domain_path[ProjectTemplateName.FINANCE] = "domain"
53
+ template_domain_path[ProjectTemplateName.TELCO] = "domain"
45
54
 
46
55
 
47
56
  def add_subparser(
@@ -179,9 +188,25 @@ def create_initial_project(
179
188
  if hasattr(dir_util, "_path_created"):
180
189
  dir_util._path_created.clear()
181
190
  else:
182
- dir_util.SkipRepeatAbsolutePaths.clear()
191
+ dir_util.SkipRepeatAbsolutePaths.clear() # type: ignore[attr-defined]
183
192
  dir_util.copy_tree(scaffold_path(template), path)
184
193
 
194
+ create_random_assistant_id(path)
195
+
196
+
197
+ def create_random_assistant_id(path: Text) -> None:
198
+ """Create a random assistant id."""
199
+ assistant_id = f"{randomname.get_name()}"
200
+ config = yaml.read_yaml_file(os.path.join(path, "config.yml"))
201
+
202
+ if isinstance(config, dict):
203
+ config["assistant_id"] = assistant_id
204
+ yaml.write_yaml(config, os.path.join(path, "config.yml"))
205
+ else:
206
+ structlogger.warning(
207
+ "cli.scaffold.create_random_assistant_id.invalid_config", config=config
208
+ )
209
+
185
210
 
186
211
  def scaffold_path(template: ProjectTemplateName) -> Text:
187
212
  import importlib_resources
rasa/cli/train.py CHANGED
@@ -15,6 +15,7 @@ from rasa.core.nlg.contextual_response_rephraser import ContextualResponseRephra
15
15
  from rasa.core.nlg.generator import NaturalLanguageGenerator
16
16
  from rasa.core.train import do_compare_training
17
17
  from rasa.engine.validation import validate_api_type_config_key_usage
18
+ from rasa.exceptions import DetailedRasaException
18
19
  from rasa.shared.constants import (
19
20
  CONFIG_MANDATORY_KEYS,
20
21
  CONFIG_MANDATORY_KEYS_CORE,
@@ -81,6 +82,13 @@ def _check_nlg_endpoint_validity(endpoint: Union[Path, str]) -> None:
81
82
  ContextualResponseRephraser.__name__,
82
83
  )
83
84
  NaturalLanguageGenerator.create(endpoints.nlg)
85
+ except DetailedRasaException as e:
86
+ structlogger.error(
87
+ e.code,
88
+ event_info=e.info,
89
+ **e.ctx,
90
+ )
91
+ sys.exit(1)
84
92
  except Exception as e:
85
93
  structlogger.error(
86
94
  "cli.train.nlg_failed_to_initialise.validation_error",
rasa/cli/utils.py CHANGED
@@ -14,7 +14,7 @@ import structlog
14
14
  import rasa.shared.utils.cli
15
15
  import rasa.shared.utils.io
16
16
  from rasa import telemetry
17
- from rasa.exceptions import ModelNotFound
17
+ from rasa.exceptions import ModelNotFound, ValidationError
18
18
  from rasa.shared.constants import (
19
19
  ASSISTANT_ID_DEFAULT_VALUE,
20
20
  ASSISTANT_ID_KEY,
@@ -191,16 +191,15 @@ def validate_config_path(
191
191
  config = rasa.cli.utils.get_validated_path(config, "config", default_config)
192
192
 
193
193
  if not config or not os.path.exists(config):
194
- structlogger.error(
195
- "cli.validate_config_path.does_not_exists",
194
+ display_research_study_prompt()
195
+ raise ValidationError(
196
+ code="cli.validate_config_path.does_not_exists",
196
197
  config=config,
197
198
  event_info=(
198
199
  f"The config file '{config}' does not exist. "
199
200
  f"Use '--config' to specify a valid config file."
200
201
  ),
201
202
  )
202
- display_research_study_prompt()
203
- sys.exit(1)
204
203
 
205
204
  return str(config)
206
205
 
@@ -221,8 +220,9 @@ def validate_mandatory_config_keys(
221
220
  """
222
221
  missing_keys = set(rasa.cli.utils.missing_config_keys(config, mandatory_keys))
223
222
  if missing_keys:
224
- structlogger.error(
225
- "cli.validate_mandatory_config_keys.missing_keys",
223
+ display_research_study_prompt()
224
+ raise ValidationError(
225
+ code="cli.validate_mandatory_config_keys.missing_keys",
226
226
  config=config,
227
227
  missing_keys=missing_keys,
228
228
  event_info=(
@@ -232,8 +232,6 @@ def validate_mandatory_config_keys(
232
232
  )
233
233
  ),
234
234
  )
235
- display_research_study_prompt()
236
- sys.exit(1)
237
235
 
238
236
  return str(config)
239
237
 
@@ -287,7 +285,10 @@ def validate_files(
287
285
  event_info="Encountered empty domain during validation.",
288
286
  )
289
287
  display_research_study_prompt()
290
- sys.exit(1)
288
+ raise ValidationError(
289
+ code="cli.validate_files.empty_domain",
290
+ event_info="Encountered empty domain during validation.",
291
+ )
291
292
 
292
293
  valid_domain = _validate_domain(validator)
293
294
  valid_nlu = _validate_nlu(validator, fail_on_warnings)
@@ -295,7 +296,10 @@ def validate_files(
295
296
  validator, max_history, fail_on_warnings
296
297
  )
297
298
  valid_flows = validator.verify_flows()
298
- valid_translations = validator.verify_translations(summary_mode=True)
299
+ if validator.config:
300
+ valid_translations = validator.verify_translations(summary_mode=True)
301
+ else:
302
+ valid_translations = True
299
303
  valid_CALM_slot_mappings = validator.validate_CALM_slot_mappings()
300
304
 
301
305
  all_good = (
@@ -307,7 +311,8 @@ def validate_files(
307
311
  and valid_CALM_slot_mappings
308
312
  )
309
313
 
310
- validator.warn_if_config_mandatory_keys_are_not_set()
314
+ if validator.config:
315
+ validator.warn_if_config_mandatory_keys_are_not_set()
311
316
 
312
317
  telemetry.track_validate_files(all_good)
313
318
  if not all_good:
@@ -316,7 +321,10 @@ def validate_files(
316
321
  event_info="Project validation completed with errors.",
317
322
  )
318
323
  display_research_study_prompt()
319
- sys.exit(1)
324
+ raise ValidationError(
325
+ code="cli.validate_files.project_validation_error",
326
+ event_info="Project validation completed with errors.",
327
+ )
320
328
 
321
329
 
322
330
  def _validate_domain(validator: "Validator") -> bool:
@@ -354,7 +362,7 @@ def _validate_story_structure(
354
362
  # Check if a valid setting for `max_history` was given
355
363
  if isinstance(max_history, int) and max_history < 1:
356
364
  raise argparse.ArgumentTypeError(
357
- f"The value of `--max-history {max_history}` " f"is not a positive integer."
365
+ f"The value of `--max-history {max_history}` is not a positive integer."
358
366
  )
359
367
 
360
368
  return validator.verify_story_structure(
@@ -391,7 +399,15 @@ def cancel_cause_not_found(
391
399
  ),
392
400
  )
393
401
  display_research_study_prompt()
394
- sys.exit(1)
402
+ raise ValidationError(
403
+ code="cli.path_does_not_exist",
404
+ path=current,
405
+ event_info=(
406
+ f"The path '{current}' does not exist. "
407
+ f"Please make sure to {default_clause} specify it "
408
+ f"with '--{parameter}'."
409
+ ),
410
+ )
395
411
 
396
412
 
397
413
  def parse_last_positional_argument_as_model_path() -> None:
@@ -23,11 +23,9 @@ from rasa.core.constants import (
23
23
  KEY_IS_COEXISTENCE_ASSISTANT,
24
24
  UTTER_SOURCE_METADATA_KEY,
25
25
  )
26
- from rasa.core.nlg.translate import get_translated_buttons, get_translated_text
27
26
  from rasa.core.policies.policy import PolicyPrediction
28
27
  from rasa.core.utils import add_bot_utterance_metadata
29
28
  from rasa.e2e_test.constants import KEY_STUB_CUSTOM_ACTIONS
30
- from rasa.engine.language import Language
31
29
  from rasa.nlu.constants import (
32
30
  RESPONSE_SELECTOR_DEFAULT_INTENT,
33
31
  RESPONSE_SELECTOR_PREDICTION_KEY,
@@ -84,7 +82,6 @@ from rasa.shared.core.events import (
84
82
  UserUttered,
85
83
  )
86
84
  from rasa.shared.core.flows import FlowsList
87
- from rasa.shared.core.flows.constants import KEY_TRANSLATION
88
85
  from rasa.shared.core.slot_mappings import (
89
86
  SlotFillingManager,
90
87
  extract_slot_value,
@@ -251,36 +248,25 @@ def action_for_name_or_text(
251
248
  return RemoteAction(action_name_or_text, action_endpoint)
252
249
 
253
250
 
254
- def create_bot_utterance(
255
- message: Dict[Text, Any], language: Optional[Language] = None
256
- ) -> BotUttered:
257
- """Create BotUttered event from message with translation support."""
258
- message_copy = copy.deepcopy(message)
259
-
260
- text = get_translated_text(
261
- text=message_copy.pop(TEXT, None),
262
- translation=message_copy.pop(KEY_TRANSLATION, {}),
263
- language=language,
264
- )
265
-
266
- buttons = get_translated_buttons(
267
- buttons=message_copy.pop(BUTTONS, None), language=language
251
+ def create_bot_utterance(message: Dict[Text, Any]) -> BotUttered:
252
+ """Create BotUttered event from message."""
253
+ bot_message = BotUttered(
254
+ text=message.pop(TEXT, None),
255
+ data={
256
+ ELEMENTS: message.pop(ELEMENTS, None),
257
+ QUICK_REPLIES: message.pop(QUICK_REPLIES, None),
258
+ BUTTONS: message.pop(BUTTONS, None),
259
+ # for legacy / compatibility reasons we need to set the image
260
+ # to be the attachment if there is no other attachment (the
261
+ # `.get` is intentional - no `pop` as we still need the image`
262
+ # property to set it in the following line)
263
+ ATTACHMENT: message.pop(ATTACHMENT, None) or message.get(IMAGE, None),
264
+ IMAGE: message.pop(IMAGE, None),
265
+ CUSTOM: message.pop(CUSTOM, None),
266
+ },
267
+ metadata=message,
268
268
  )
269
-
270
- data = {
271
- ELEMENTS: message_copy.pop(ELEMENTS, None),
272
- QUICK_REPLIES: message_copy.pop(QUICK_REPLIES, None),
273
- BUTTONS: buttons,
274
- # for legacy / compatibility reasons we need to set the image
275
- # to be the attachment if there is no other attachment (the
276
- # `.get` is intentional - no `pop` as we still need the image`
277
- # property to set it in the following line)
278
- ATTACHMENT: message_copy.pop(ATTACHMENT, None) or message_copy.get(IMAGE, None),
279
- IMAGE: message_copy.pop(IMAGE, None),
280
- CUSTOM: message_copy.pop(CUSTOM, None),
281
- }
282
-
283
- return BotUttered(text=text, data=data, metadata=message_copy)
269
+ return bot_message
284
270
 
285
271
 
286
272
  class Action:
@@ -393,7 +379,7 @@ class ActionBotResponse(Action):
393
379
  message = add_bot_utterance_metadata(
394
380
  message, self.utter_action, nlg, domain, tracker
395
381
  )
396
- return [create_bot_utterance(message, tracker.current_language)]
382
+ return [create_bot_utterance(message)]
397
383
 
398
384
  def name(self) -> Text:
399
385
  """Returns action name."""
@@ -427,7 +413,7 @@ class ActionEndToEndResponse(Action):
427
413
  ) -> List[Event]:
428
414
  """Runs action (see parent class for full docstring)."""
429
415
  message = {"text": self.action_text}
430
- return [create_bot_utterance(message, tracker.current_language)]
416
+ return [create_bot_utterance(message)]
431
417
 
432
418
  def event_for_successful_execution(
433
419
  self,
@@ -893,7 +879,10 @@ class RemoteAction(Action):
893
879
  generated_response = response.pop("response", None)
894
880
  if generated_response is not None:
895
881
  draft = await nlg.generate(
896
- generated_response, tracker, output_channel.name(), **response
882
+ generated_response,
883
+ tracker,
884
+ output_channel.name(),
885
+ **response,
897
886
  )
898
887
  if not draft:
899
888
  continue
@@ -909,11 +898,8 @@ class RemoteAction(Action):
909
898
  draft["buttons"].extend(buttons)
910
899
 
911
900
  response = {k: v for k, v in response.items() if v}
912
-
913
901
  response.update(draft)
914
- bot_messages.append(
915
- create_bot_utterance(response, tracker.current_language)
916
- )
902
+ bot_messages.append(create_bot_utterance(response))
917
903
 
918
904
  return bot_messages
919
905
 
@@ -1070,6 +1056,7 @@ def _revert_rephrasing_events() -> List[Event]:
1070
1056
  ]
1071
1057
 
1072
1058
 
1059
+ # TODO: this should be removed, e.g. it uses a hardcoded message and no translation
1073
1060
  class ActionDefaultAskAffirmation(Action):
1074
1061
  """Default implementation which asks the user to affirm his intent.
1075
1062
 
@@ -1121,7 +1108,7 @@ class ActionDefaultAskAffirmation(Action):
1121
1108
  "utter_action": self.name(),
1122
1109
  }
1123
1110
 
1124
- return [create_bot_utterance(message, tracker.current_language)]
1111
+ return [create_bot_utterance(message)]
1125
1112
 
1126
1113
 
1127
1114
  class ActionDefaultAskRephrase(ActionBotResponse):
@@ -1157,7 +1144,7 @@ class ActionSendText(Action):
1157
1144
 
1158
1145
  should_send_text = metadata_copy.get("should_send_text", True)
1159
1146
  if should_send_text:
1160
- return [create_bot_utterance(message, tracker.current_language)]
1147
+ return [create_bot_utterance(message)]
1161
1148
  return []
1162
1149
 
1163
1150
 
@@ -216,6 +216,6 @@ class ActionRunSlotRejections(Action):
216
216
  message = add_bot_utterance_metadata(
217
217
  message, utterance, nlg, domain, tracker
218
218
  )
219
- events.append(create_bot_utterance(message, tracker.current_language))
219
+ events.append(create_bot_utterance(message))
220
220
 
221
221
  return events
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import asyncio
4
+ import time
4
5
  from functools import partial
5
6
  from typing import (
6
7
  TYPE_CHECKING,
@@ -35,6 +36,7 @@ if TYPE_CHECKING:
35
36
  from sanic.response import HTTPResponse
36
37
 
37
38
  from rasa.core.channels.channel import UserMessage
39
+ from rasa.core.processor import MessageProcessor
38
40
  from rasa.shared.core.trackers import DialogueStateTracker
39
41
 
40
42
  from rasa.hooks import hookimpl
@@ -49,6 +51,7 @@ class DevelopmentInspectorPlugin:
49
51
  """Plugin for broadcasting tracker updates to development inspector clients."""
50
52
 
51
53
  def __init__(self, inspector: DevelopmentInspectProxy) -> None:
54
+ """Initializes the plugin."""
52
55
  self.inspector = inspector
53
56
  self.tasks: List[asyncio.Task] = []
54
57
 
@@ -61,19 +64,21 @@ class DevelopmentInspectorPlugin:
61
64
  """Remove tasks that have already completed."""
62
65
  self.tasks = [task for task in self.tasks if not task.done()]
63
66
 
64
- @hookimpl # type: ignore[misc]
65
- def after_new_user_message(self, tracker: DialogueStateTracker) -> None:
66
- """Broadcasts tracker updates after a new user message."""
67
+ def _create_broadcast_task(self, tracker: DialogueStateTracker) -> None:
68
+ """Creates a task to broadcast tracker updates."""
67
69
  task = asyncio.create_task(self.inspector.on_tracker_updated(tracker))
68
70
  self.tasks.append(task)
69
71
  self._cleanup_completed_tasks()
70
72
 
73
+ @hookimpl # type: ignore[misc]
74
+ def after_new_user_message(self, tracker: DialogueStateTracker) -> None:
75
+ """Broadcasts tracker updates after a new user message."""
76
+ self._create_broadcast_task(tracker)
77
+
71
78
  @hookimpl # type: ignore[misc]
72
79
  def after_action_executed(self, tracker: DialogueStateTracker) -> None:
73
80
  """Broadcasts tracker updates after an action is executed."""
74
- task = asyncio.create_task(self.inspector.on_tracker_updated(tracker))
75
- self.tasks.append(task)
76
- self._cleanup_completed_tasks()
81
+ self._create_broadcast_task(tracker)
77
82
 
78
83
  @hookimpl # type: ignore[misc]
79
84
  def after_server_stop(self) -> None:
@@ -93,8 +98,9 @@ class DevelopmentInspectProxy(InputChannel):
93
98
  super().__init__()
94
99
  self.underlying = underlying
95
100
  self.is_voice = is_voice
96
- self.processor = None
101
+ self.processor: Optional[MessageProcessor] = None
97
102
  self.tracker_stream = TrackerStream(get_tracker=self.get_tracker_state)
103
+ self._turn_start_times: Dict[Text, float] = {}
98
104
  # Register the plugin to get tracker updates
99
105
  plugin_manager().register(DevelopmentInspectorPlugin(self))
100
106
 
@@ -124,34 +130,61 @@ class DevelopmentInspectProxy(InputChannel):
124
130
 
125
131
  return pkg_resources.resource_filename(__name__, INSPECT_TEMPLATE_PATH)
126
132
 
127
- async def get_tracker_state(self, sender_id: str) -> str:
128
- """Returns the state of the tracker as a json string."""
133
+ async def _get_tracker(self, sender_id: Text) -> DialogueStateTracker:
134
+ """Returns the tracker for the given sender ID."""
129
135
  if not self.processor:
130
136
  structlogger.error(
131
- "development_inspector.get_tracker_state.agent_not_initialized"
137
+ "development_inspector._get_tracker.agent_not_initialized"
132
138
  )
133
- return ""
139
+ raise ValueError("Agent processor is not initialized.")
140
+ return await self.processor.get_tracker(sender_id)
134
141
 
135
- tracker = await self.processor.get_tracker(sender_id)
142
+ async def get_tracker_state(self, sender_id: str) -> str:
143
+ """Returns the state of the tracker as a json string."""
144
+ tracker = await self._get_tracker(sender_id)
136
145
  state = tracker.current_state(EventVerbosity.AFTER_RESTART)
137
146
  return orjson.dumps(state, option=orjson.OPT_SERIALIZE_NUMPY).decode("utf-8")
138
147
 
139
- async def on_tracker_updated(self, tracker: DialogueStateTracker) -> None:
148
+ async def on_tracker_updated(
149
+ self, tracker: DialogueStateTracker, latency: Optional[float] = None
150
+ ) -> None:
140
151
  """Notifies all clients about tracker updates in real-time."""
141
152
  if self.tracker_stream and tracker.sender_id:
142
153
  state = tracker.current_state(EventVerbosity.AFTER_RESTART)
154
+ if latency is not None:
155
+ state["latency"] = {"rasa_processing_latency_ms": latency}
156
+
143
157
  tracker_dump = orjson.dumps(
144
158
  state, option=orjson.OPT_SERIALIZE_NUMPY
145
159
  ).decode("utf-8")
146
160
  await self.tracker_stream.broadcast(tracker_dump)
147
161
 
162
+ def _record_turn_start_time(self, sender_id: Text) -> None:
163
+ """Records the start time of a new turn."""
164
+ self._turn_start_times[sender_id] = time.time()
165
+
166
+ async def _broadcast_latency(self, sender_id: Text) -> None:
167
+ """Broadcasts the tracker with latency of the current turn to all clients."""
168
+ if sender_id not in self._turn_start_times:
169
+ return None
170
+
171
+ latency = (time.time() - self._turn_start_times[sender_id]) * 1000
172
+ # The turn is over, so we can remove the start time
173
+ del self._turn_start_times[sender_id]
174
+
175
+ # broadcast tracker update with latency
176
+ tracker = await self._get_tracker(sender_id)
177
+ await self.on_tracker_updated(tracker, latency)
178
+
148
179
  async def on_message_proxy(
149
180
  self,
150
181
  on_new_message: Callable[["UserMessage"], Awaitable[Any]],
151
182
  message: "UserMessage",
152
183
  ) -> None:
153
184
  """Proxies the on_new_message call to the underlying channel."""
185
+ self._record_turn_start_time(message.sender_id)
154
186
  await on_new_message(message)
187
+ await self._broadcast_latency(message.sender_id)
155
188
 
156
189
  @classmethod
157
190
  async def serve_inspect_html(cls) -> HTTPResponse:
@@ -197,7 +230,7 @@ class DevelopmentInspectProxy(InputChannel):
197
230
  class TrackerStream:
198
231
  """Stream tracker state to connected clients."""
199
232
 
200
- def __init__(self, get_tracker: Callable[[str], Awaitable[Dict[str, Any]]]) -> None:
233
+ def __init__(self, get_tracker: Callable[[str], Awaitable[str]]) -> None:
201
234
  """Initializes the TrackerStream."""
202
235
  self._connected_clients: Set[Websocket] = set()
203
236
  self.get_tracker = get_tracker
@@ -1 +1 @@
1
- import{w as ln,c as H}from"./path-53f90ab3.js";import{aw as an,ax as V,ay as D,az as rn,aA as y,V as on,aB as K,aC as _,aD as un,aE as t,aF as sn,aG as tn,aH as fn}from"./index-cce6f8a1.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function xn(l,h,z,E,v,A,I,a){var B=z-l,i=E-h,n=I-v,m=a-A,r=m*B-n*i;if(!(r*r<y))return r=(n*(h-A)-m*(l-v))/r,[l+r*B,h+r*i]}function W(l,h,z,E,v,A,I){var a=l-z,B=h-E,i=(I?A:-A)/K(a*a+B*B),n=i*B,m=-i*a,r=l+n,s=h+m,f=z+n,c=E+m,O=(r+f)/2,o=(s+c)/2,p=f-r,g=c-s,R=p*p+g*g,T=v-A,w=r*c-f*s,C=(g<0?-1:1)*K(fn(0,T*T*R-w*w)),F=(w*g-p*C)/R,G=(-w*p-g*C)/R,P=(w*g+p*C)/R,x=(-w*p+g*C)/R,d=F-O,e=G-o,u=P-O,S=x-o;return d*d+e*e>u*u+S*S&&(F=P,G=x),{cx:F,cy:G,x01:-n,y01:-m,x11:F*(v/T-1),y11:G*(v/T-1)}}function vn(){var l=cn,h=yn,z=H(0),E=null,v=gn,A=mn,I=pn,a=null,B=ln(i);function i(){var n,m,r=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-rn,c=A.apply(this,arguments)-rn,O=un(c-f),o=c>f;if(a||(a=n=B()),s<r&&(m=s,s=r,r=m),!(s>y))a.moveTo(0,0);else if(O>on-y)a.moveTo(s*V(f),s*D(f)),a.arc(0,0,s,f,c,!o),r>y&&(a.moveTo(r*V(c),r*D(c)),a.arc(0,0,r,c,f,o));else{var p=f,g=c,R=f,T=c,w=O,C=O,F=I.apply(this,arguments)/2,G=F>y&&(E?+E.apply(this,arguments):K(r*r+s*s)),P=_(un(s-r)/2,+z.apply(this,arguments)),x=P,d=P,e,u;if(G>y){var S=sn(G/r*D(F)),L=sn(G/s*D(F));(w-=S*2)>y?(S*=o?1:-1,R+=S,T-=S):(w=0,R=T=(f+c)/2),(C-=L*2)>y?(L*=o?1:-1,p+=L,g-=L):(C=0,p=g=(f+c)/2)}var j=s*V(p),J=s*D(p),M=r*V(T),N=r*D(T);if(P>y){var Q=s*V(g),U=s*D(g),X=r*V(R),Y=r*D(R),q;if(O<an)if(q=xn(j,J,X,Y,Q,U,M,N)){var Z=j-q[0],$=J-q[1],k=Q-q[0],b=U-q[1],nn=1/D(tn((Z*k+$*b)/(K(Z*Z+$*$)*K(k*k+b*b)))/2),en=K(q[0]*q[0]+q[1]*q[1]);x=_(P,(r-en)/(nn-1)),d=_(P,(s-en)/(nn+1))}else x=d=0}C>y?d>y?(e=W(X,Y,j,J,s,d,o),u=W(Q,U,M,N,s,d,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),d<P?a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),a.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(a.moveTo(j,J),a.arc(0,0,s,p,g,!o)):a.moveTo(j,J),!(r>y)||!(w>y)?a.lineTo(M,N):x>y?(e=W(M,N,Q,U,r,-x,o),u=W(j,J,X,Y,r,-x,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),x<P?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,r,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),a.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):a.arc(0,0,r,T,R,o)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[V(m)*n,D(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:H(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:H(+n),i):h},i.cornerRadius=function(n){return arguments.length?(z=typeof n=="function"?n:H(+n),i):z},i.padRadius=function(n){return arguments.length?(E=n==null?null:typeof n=="function"?n:H(+n),i):E},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:H(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:H(+n),i):A},i.padAngle=function(n){return arguments.length?(I=typeof n=="function"?n:H(+n),i):I},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{vn as a};
1
+ import{w as ln,c as H}from"./path-53f90ab3.js";import{aw as an,ax as V,ay as D,az as rn,aA as y,V as on,aB as K,aC as _,aD as un,aE as t,aF as sn,aG as tn,aH as fn}from"./index-a003633f.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function xn(l,h,z,E,v,A,I,a){var B=z-l,i=E-h,n=I-v,m=a-A,r=m*B-n*i;if(!(r*r<y))return r=(n*(h-A)-m*(l-v))/r,[l+r*B,h+r*i]}function W(l,h,z,E,v,A,I){var a=l-z,B=h-E,i=(I?A:-A)/K(a*a+B*B),n=i*B,m=-i*a,r=l+n,s=h+m,f=z+n,c=E+m,O=(r+f)/2,o=(s+c)/2,p=f-r,g=c-s,R=p*p+g*g,T=v-A,w=r*c-f*s,C=(g<0?-1:1)*K(fn(0,T*T*R-w*w)),F=(w*g-p*C)/R,G=(-w*p-g*C)/R,P=(w*g+p*C)/R,x=(-w*p+g*C)/R,d=F-O,e=G-o,u=P-O,S=x-o;return d*d+e*e>u*u+S*S&&(F=P,G=x),{cx:F,cy:G,x01:-n,y01:-m,x11:F*(v/T-1),y11:G*(v/T-1)}}function vn(){var l=cn,h=yn,z=H(0),E=null,v=gn,A=mn,I=pn,a=null,B=ln(i);function i(){var n,m,r=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-rn,c=A.apply(this,arguments)-rn,O=un(c-f),o=c>f;if(a||(a=n=B()),s<r&&(m=s,s=r,r=m),!(s>y))a.moveTo(0,0);else if(O>on-y)a.moveTo(s*V(f),s*D(f)),a.arc(0,0,s,f,c,!o),r>y&&(a.moveTo(r*V(c),r*D(c)),a.arc(0,0,r,c,f,o));else{var p=f,g=c,R=f,T=c,w=O,C=O,F=I.apply(this,arguments)/2,G=F>y&&(E?+E.apply(this,arguments):K(r*r+s*s)),P=_(un(s-r)/2,+z.apply(this,arguments)),x=P,d=P,e,u;if(G>y){var S=sn(G/r*D(F)),L=sn(G/s*D(F));(w-=S*2)>y?(S*=o?1:-1,R+=S,T-=S):(w=0,R=T=(f+c)/2),(C-=L*2)>y?(L*=o?1:-1,p+=L,g-=L):(C=0,p=g=(f+c)/2)}var j=s*V(p),J=s*D(p),M=r*V(T),N=r*D(T);if(P>y){var Q=s*V(g),U=s*D(g),X=r*V(R),Y=r*D(R),q;if(O<an)if(q=xn(j,J,X,Y,Q,U,M,N)){var Z=j-q[0],$=J-q[1],k=Q-q[0],b=U-q[1],nn=1/D(tn((Z*k+$*b)/(K(Z*Z+$*$)*K(k*k+b*b)))/2),en=K(q[0]*q[0]+q[1]*q[1]);x=_(P,(r-en)/(nn-1)),d=_(P,(s-en)/(nn+1))}else x=d=0}C>y?d>y?(e=W(X,Y,j,J,s,d,o),u=W(Q,U,M,N,s,d,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),d<P?a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),a.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(a.moveTo(j,J),a.arc(0,0,s,p,g,!o)):a.moveTo(j,J),!(r>y)||!(w>y)?a.lineTo(M,N):x>y?(e=W(M,N,Q,U,r,-x,o),u=W(j,J,X,Y,r,-x,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),x<P?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,r,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),a.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):a.arc(0,0,r,T,R,o)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[V(m)*n,D(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:H(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:H(+n),i):h},i.cornerRadius=function(n){return arguments.length?(z=typeof n=="function"?n:H(+n),i):z},i.padRadius=function(n){return arguments.length?(E=n==null?null:typeof n=="function"?n:H(+n),i):E},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:H(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:H(+n),i):A},i.padAngle=function(n){return arguments.length?(I=typeof n=="function"?n:H(+n),i):I},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{vn as a};
@@ -1,4 +1,4 @@
1
- import{c as he,_ as se,h as H,i as Ee,l as S,E as ye,B as we,j as De,o as ve}from"./index-cce6f8a1.js";import{c as Ne}from"./clone-fdf164e2.js";import{i as ke,c as Ie,b as Oe,d as Te,a as ge,p as ze}from"./edges-e0da2a9e-f837ca8a.js";import{G as Ce}from"./graph-0d0a2c10.js";import{o as Ae}from"./ordinal-ba9b4969.js";import{s as Re}from"./Tableau10-1b767f5e.js";import{c as Be}from"./channel-f1efda17.js";import"./createText-2e5e7dd3-ca47fd38.js";import"./line-f1c817d3.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";import"./init-77b53fdd.js";var le,oe,ee=function(){var e=function(D,o,s,i){for(s=s||{},i=D.length;i--;s[D[i]]=o);return s},a=[1,7],d=[1,13],c=[1,14],n=[1,15],g=[1,19],l=[1,16],f=[1,17],b=[1,18],p=[8,30],x=[8,21,28,29,30,31,32,40,44,47],E=[1,23],T=[1,24],v=[8,15,16,21,28,29,30,31,32,40,44,47],N=[8,15,16,21,27,28,29,30,31,32,40,44,47],y=[1,49],L={trace:function(){},yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:function(o,s,i,u,h,t,m){var r=t.length-1;switch(h){case 4:u.getLogger().debug("Rule: separator (NL) ");break;case 5:u.getLogger().debug("Rule: separator (Space) ");break;case 6:u.getLogger().debug("Rule: separator (EOF) ");break;case 7:u.getLogger().debug("Rule: hierarchy: ",t[r-1]),u.setHierarchy(t[r-1]);break;case 8:u.getLogger().debug("Stop NL ");break;case 9:u.getLogger().debug("Stop EOF ");break;case 10:u.getLogger().debug("Stop NL2 ");break;case 11:u.getLogger().debug("Stop EOF2 ");break;case 12:u.getLogger().debug("Rule: statement: ",t[r]),typeof t[r].length=="number"?this.$=t[r]:this.$=[t[r]];break;case 13:u.getLogger().debug("Rule: statement #2: ",t[r-1]),this.$=[t[r-1]].concat(t[r]);break;case 14:u.getLogger().debug("Rule: link: ",t[r],o),this.$={edgeTypeStr:t[r],label:""};break;case 15:u.getLogger().debug("Rule: LABEL link: ",t[r-3],t[r-1],t[r]),this.$={edgeTypeStr:t[r],label:t[r-1]};break;case 18:const R=parseInt(t[r]),Y=u.generateId();this.$={id:Y,type:"space",label:"",width:R,children:[]};break;case 23:u.getLogger().debug("Rule: (nodeStatement link node) ",t[r-2],t[r-1],t[r]," typestr: ",t[r-1].edgeTypeStr);const F=u.edgeStrToEdgeData(t[r-1].edgeTypeStr);this.$=[{id:t[r-2].id,label:t[r-2].label,type:t[r-2].type,directions:t[r-2].directions},{id:t[r-2].id+"-"+t[r].id,start:t[r-2].id,end:t[r].id,label:t[r-1].label,type:"edge",directions:t[r].directions,arrowTypeEnd:F,arrowTypeStart:"arrow_open"},{id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions}];break;case 24:u.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[r-1],t[r]),this.$={id:t[r-1].id,label:t[r-1].label,type:u.typeStr2Type(t[r-1].typeStr),directions:t[r-1].directions,widthInColumns:parseInt(t[r],10)};break;case 25:u.getLogger().debug("Rule: nodeStatement (node) ",t[r]),this.$={id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions,widthInColumns:1};break;case 26:u.getLogger().debug("APA123",this?this:"na"),u.getLogger().debug("COLUMNS: ",t[r]),this.$={type:"column-setting",columns:t[r]==="auto"?-1:parseInt(t[r])};break;case 27:u.getLogger().debug("Rule: id-block statement : ",t[r-2],t[r-1]),u.generateId(),this.$={...t[r-2],type:"composite",children:t[r-1]};break;case 28:u.getLogger().debug("Rule: blockStatement : ",t[r-2],t[r-1],t[r]);const C=u.generateId();this.$={id:C,type:"composite",label:"",children:t[r-1]};break;case 29:u.getLogger().debug("Rule: node (NODE_ID separator): ",t[r]),this.$={id:t[r]};break;case 30:u.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[r-1],t[r]),this.$={id:t[r-1],label:t[r].label,typeStr:t[r].typeStr,directions:t[r].directions};break;case 31:u.getLogger().debug("Rule: dirList: ",t[r]),this.$=[t[r]];break;case 32:u.getLogger().debug("Rule: dirList: ",t[r-1],t[r]),this.$=[t[r-1]].concat(t[r]);break;case 33:u.getLogger().debug("Rule: nodeShapeNLabel: ",t[r-2],t[r-1],t[r]),this.$={typeStr:t[r-2]+t[r],label:t[r-1]};break;case 34:u.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[r-3],t[r-2]," #3:",t[r-1],t[r]),this.$={typeStr:t[r-3]+t[r],label:t[r-2],directions:t[r-1]};break;case 35:case 36:this.$={type:"classDef",id:t[r-1].trim(),css:t[r].trim()};break;case 37:this.$={type:"applyClass",id:t[r-1].trim(),styleClass:t[r].trim()};break;case 38:this.$={type:"applyStyles",id:t[r-1].trim(),stylesStr:t[r].trim()};break}},table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{8:[1,20]},e(p,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:a,28:d,29:c,31:n,32:g,40:l,44:f,47:b}),e(x,[2,16],{14:22,15:E,16:T}),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),e(x,[2,21]),e(x,[2,22]),e(v,[2,25],{27:[1,25]}),e(x,[2,26]),{19:26,26:12,32:g},{11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(N,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(p,[2,13]),{26:35,32:g},{32:[2,14]},{17:[1,36]},e(v,[2,24]),{11:37,13:4,14:22,15:E,16:T,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(N,[2,30]),{18:[1,43]},{18:[1,44]},e(v,[2,23]),{18:[1,45]},{30:[1,46]},e(x,[2,28]),e(x,[2,35]),e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{37:[1,47]},{34:48,35:y},{15:[1,50]},e(x,[2,27]),e(N,[2,33]),{39:[1,51]},{34:52,35:y,39:[2,31]},{32:[2,15]},e(N,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:function(o,s){if(s.recoverable)this.trace(o);else{var i=new Error(o);throw i.hash=s,i}},parse:function(o){var s=this,i=[0],u=[],h=[null],t=[],m=this.table,r="",R=0,Y=0,F=2,C=1,Le=t.slice.call(arguments,1),w=Object.create(this.lexer),K={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(K.yy[Z]=this.yy[Z]);w.setInput(o,K.yy),K.yy.lexer=w,K.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var J=w.yylloc;t.push(J);var me=w.options&&w.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(){var P;return P=u.pop()||w.lex()||C,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}for(var I,M,z,Q,W={},X,B,ae,G;;){if(M=i[i.length-1],this.defaultActions[M]?z=this.defaultActions[M]:((I===null||typeof I>"u")&&(I=_e()),z=m[M]&&m[M][I]),typeof z>"u"||!z.length||!z[0]){var $="";G=[];for(X in m[M])this.terminals_[X]&&X>F&&G.push("'"+this.terminals_[X]+"'");w.showPosition?$="Parse error on line "+(R+1)+`:
1
+ import{c as he,_ as se,h as H,i as Ee,l as S,E as ye,B as we,j as De,o as ve}from"./index-a003633f.js";import{c as Ne}from"./clone-26177ddb.js";import{i as ke,c as Ie,b as Oe,d as Te,a as ge,p as ze}from"./edges-e0da2a9e-812a729d.js";import{G as Ce}from"./graph-46fad2ba.js";import{o as Ae}from"./ordinal-ba9b4969.js";import{s as Re}from"./Tableau10-1b767f5e.js";import{c as Be}from"./channel-59f6d54b.js";import"./createText-2e5e7dd3-c111213b.js";import"./line-219ab7ae.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";import"./init-77b53fdd.js";var le,oe,ee=function(){var e=function(D,o,s,i){for(s=s||{},i=D.length;i--;s[D[i]]=o);return s},a=[1,7],d=[1,13],c=[1,14],n=[1,15],g=[1,19],l=[1,16],f=[1,17],b=[1,18],p=[8,30],x=[8,21,28,29,30,31,32,40,44,47],E=[1,23],T=[1,24],v=[8,15,16,21,28,29,30,31,32,40,44,47],N=[8,15,16,21,27,28,29,30,31,32,40,44,47],y=[1,49],L={trace:function(){},yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:function(o,s,i,u,h,t,m){var r=t.length-1;switch(h){case 4:u.getLogger().debug("Rule: separator (NL) ");break;case 5:u.getLogger().debug("Rule: separator (Space) ");break;case 6:u.getLogger().debug("Rule: separator (EOF) ");break;case 7:u.getLogger().debug("Rule: hierarchy: ",t[r-1]),u.setHierarchy(t[r-1]);break;case 8:u.getLogger().debug("Stop NL ");break;case 9:u.getLogger().debug("Stop EOF ");break;case 10:u.getLogger().debug("Stop NL2 ");break;case 11:u.getLogger().debug("Stop EOF2 ");break;case 12:u.getLogger().debug("Rule: statement: ",t[r]),typeof t[r].length=="number"?this.$=t[r]:this.$=[t[r]];break;case 13:u.getLogger().debug("Rule: statement #2: ",t[r-1]),this.$=[t[r-1]].concat(t[r]);break;case 14:u.getLogger().debug("Rule: link: ",t[r],o),this.$={edgeTypeStr:t[r],label:""};break;case 15:u.getLogger().debug("Rule: LABEL link: ",t[r-3],t[r-1],t[r]),this.$={edgeTypeStr:t[r],label:t[r-1]};break;case 18:const R=parseInt(t[r]),Y=u.generateId();this.$={id:Y,type:"space",label:"",width:R,children:[]};break;case 23:u.getLogger().debug("Rule: (nodeStatement link node) ",t[r-2],t[r-1],t[r]," typestr: ",t[r-1].edgeTypeStr);const F=u.edgeStrToEdgeData(t[r-1].edgeTypeStr);this.$=[{id:t[r-2].id,label:t[r-2].label,type:t[r-2].type,directions:t[r-2].directions},{id:t[r-2].id+"-"+t[r].id,start:t[r-2].id,end:t[r].id,label:t[r-1].label,type:"edge",directions:t[r].directions,arrowTypeEnd:F,arrowTypeStart:"arrow_open"},{id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions}];break;case 24:u.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[r-1],t[r]),this.$={id:t[r-1].id,label:t[r-1].label,type:u.typeStr2Type(t[r-1].typeStr),directions:t[r-1].directions,widthInColumns:parseInt(t[r],10)};break;case 25:u.getLogger().debug("Rule: nodeStatement (node) ",t[r]),this.$={id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions,widthInColumns:1};break;case 26:u.getLogger().debug("APA123",this?this:"na"),u.getLogger().debug("COLUMNS: ",t[r]),this.$={type:"column-setting",columns:t[r]==="auto"?-1:parseInt(t[r])};break;case 27:u.getLogger().debug("Rule: id-block statement : ",t[r-2],t[r-1]),u.generateId(),this.$={...t[r-2],type:"composite",children:t[r-1]};break;case 28:u.getLogger().debug("Rule: blockStatement : ",t[r-2],t[r-1],t[r]);const C=u.generateId();this.$={id:C,type:"composite",label:"",children:t[r-1]};break;case 29:u.getLogger().debug("Rule: node (NODE_ID separator): ",t[r]),this.$={id:t[r]};break;case 30:u.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[r-1],t[r]),this.$={id:t[r-1],label:t[r].label,typeStr:t[r].typeStr,directions:t[r].directions};break;case 31:u.getLogger().debug("Rule: dirList: ",t[r]),this.$=[t[r]];break;case 32:u.getLogger().debug("Rule: dirList: ",t[r-1],t[r]),this.$=[t[r-1]].concat(t[r]);break;case 33:u.getLogger().debug("Rule: nodeShapeNLabel: ",t[r-2],t[r-1],t[r]),this.$={typeStr:t[r-2]+t[r],label:t[r-1]};break;case 34:u.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[r-3],t[r-2]," #3:",t[r-1],t[r]),this.$={typeStr:t[r-3]+t[r],label:t[r-2],directions:t[r-1]};break;case 35:case 36:this.$={type:"classDef",id:t[r-1].trim(),css:t[r].trim()};break;case 37:this.$={type:"applyClass",id:t[r-1].trim(),styleClass:t[r].trim()};break;case 38:this.$={type:"applyStyles",id:t[r-1].trim(),stylesStr:t[r].trim()};break}},table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{8:[1,20]},e(p,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:a,28:d,29:c,31:n,32:g,40:l,44:f,47:b}),e(x,[2,16],{14:22,15:E,16:T}),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),e(x,[2,21]),e(x,[2,22]),e(v,[2,25],{27:[1,25]}),e(x,[2,26]),{19:26,26:12,32:g},{11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(N,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(p,[2,13]),{26:35,32:g},{32:[2,14]},{17:[1,36]},e(v,[2,24]),{11:37,13:4,14:22,15:E,16:T,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(N,[2,30]),{18:[1,43]},{18:[1,44]},e(v,[2,23]),{18:[1,45]},{30:[1,46]},e(x,[2,28]),e(x,[2,35]),e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{37:[1,47]},{34:48,35:y},{15:[1,50]},e(x,[2,27]),e(N,[2,33]),{39:[1,51]},{34:52,35:y,39:[2,31]},{32:[2,15]},e(N,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:function(o,s){if(s.recoverable)this.trace(o);else{var i=new Error(o);throw i.hash=s,i}},parse:function(o){var s=this,i=[0],u=[],h=[null],t=[],m=this.table,r="",R=0,Y=0,F=2,C=1,Le=t.slice.call(arguments,1),w=Object.create(this.lexer),K={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(K.yy[Z]=this.yy[Z]);w.setInput(o,K.yy),K.yy.lexer=w,K.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var J=w.yylloc;t.push(J);var me=w.options&&w.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(){var P;return P=u.pop()||w.lex()||C,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}for(var I,M,z,Q,W={},X,B,ae,G;;){if(M=i[i.length-1],this.defaultActions[M]?z=this.defaultActions[M]:((I===null||typeof I>"u")&&(I=_e()),z=m[M]&&m[M][I]),typeof z>"u"||!z.length||!z[0]){var $="";G=[];for(X in m[M])this.terminals_[X]&&X>F&&G.push("'"+this.terminals_[X]+"'");w.showPosition?$="Parse error on line "+(R+1)+`:
2
2
  `+w.showPosition()+`
3
3
  Expecting `+G.join(", ")+", got '"+(this.terminals_[I]||I)+"'":$="Parse error on line "+(R+1)+": Unexpected "+(I==C?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError($,{text:w.match,token:this.terminals_[I]||I,line:w.yylineno,loc:J,expected:G})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+I);switch(z[0]){case 1:i.push(I),h.push(w.yytext),t.push(w.yylloc),i.push(z[1]),I=null,Y=w.yyleng,r=w.yytext,R=w.yylineno,J=w.yylloc;break;case 2:if(B=this.productions_[z[1]][1],W.$=h[h.length-B],W._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},me&&(W._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(W,[r,Y,R,K.yy,z[1],h,t].concat(Le)),typeof Q<"u")return Q;B&&(i=i.slice(0,-1*B*2),h=h.slice(0,-1*B),t=t.slice(0,-1*B)),i.push(this.productions_[z[1]][0]),h.push(W.$),t.push(W._$),ae=m[i[i.length-2]][i[i.length-1]],i.push(ae);break;case 3:return!0}}return!0}},A=function(){var D={EOF:1,parseError:function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},setInput:function(o,s){return this.yy=s||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var s=o.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},unput:function(o){var s=o.length,i=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(o){this.unput(this.match.slice(o))},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var o=this.pastInput(),s=new Array(o.length+1).join("-");return o+this.upcomingInput()+`