@nyaruka/temba-components 0.129.9 → 0.129.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/demo/data/flows/sample-flow.json +96 -56
- package/demo/test-colorpicker.html +30 -0
- package/dist/temba-components.js +896 -934
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/events.js.map +1 -1
- package/out-tsc/src/flow/Editor.js +9 -6
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_channel.js +1 -1
- package/out-tsc/src/flow/actions/set_contact_channel.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_field.js +1 -1
- package/out-tsc/src/flow/actions/set_contact_field.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_language.js +1 -1
- package/out-tsc/src/flow/actions/set_contact_language.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_status.js +1 -1
- package/out-tsc/src/flow/actions/set_contact_status.js.map +1 -1
- package/out-tsc/src/flow/config.js +2 -8
- package/out-tsc/src/flow/config.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_llm.js +101 -0
- package/out-tsc/src/flow/nodes/split_by_llm.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js +4 -89
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_subflow.js +123 -3
- package/out-tsc/src/flow/nodes/split_by_subflow.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_ticket.js +115 -13
- package/out-tsc/src/flow/nodes/split_by_ticket.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_webhook.js +160 -12
- package/out-tsc/src/flow/nodes/split_by_webhook.js.map +1 -1
- package/out-tsc/src/form/ArrayEditor.js +45 -56
- package/out-tsc/src/form/ArrayEditor.js.map +1 -1
- package/out-tsc/src/form/BaseListEditor.js +4 -3
- package/out-tsc/src/form/BaseListEditor.js.map +1 -1
- package/out-tsc/src/form/Checkbox.js +77 -24
- package/out-tsc/src/form/Checkbox.js.map +1 -1
- package/out-tsc/src/form/ColorPicker.js +28 -40
- package/out-tsc/src/form/ColorPicker.js.map +1 -1
- package/out-tsc/src/form/Completion.js +44 -53
- package/out-tsc/src/form/Completion.js.map +1 -1
- package/out-tsc/src/form/Compose.js +7 -8
- package/out-tsc/src/form/Compose.js.map +1 -1
- package/out-tsc/src/form/ContactSearch.js +3 -4
- package/out-tsc/src/form/ContactSearch.js.map +1 -1
- package/out-tsc/src/form/DatePicker.js +29 -36
- package/out-tsc/src/form/DatePicker.js.map +1 -1
- package/out-tsc/src/form/{FormField.js → FieldElement.js} +78 -50
- package/out-tsc/src/form/FieldElement.js.map +1 -0
- package/out-tsc/src/form/FieldRenderer.js +2 -1
- package/out-tsc/src/form/FieldRenderer.js.map +1 -1
- package/out-tsc/src/form/ImagePicker.js +122 -126
- package/out-tsc/src/form/ImagePicker.js.map +1 -1
- package/out-tsc/src/form/KeyValueEditor.js +41 -37
- package/out-tsc/src/form/KeyValueEditor.js.map +1 -1
- package/out-tsc/src/form/MessageEditor.js +55 -63
- package/out-tsc/src/form/MessageEditor.js.map +1 -1
- package/out-tsc/src/form/TembaSlider.js +3 -3
- package/out-tsc/src/form/TembaSlider.js.map +1 -1
- package/out-tsc/src/form/TemplateEditor.js +3 -3
- package/out-tsc/src/form/TemplateEditor.js.map +1 -1
- package/out-tsc/src/form/TextInput.js +22 -26
- package/out-tsc/src/form/TextInput.js.map +1 -1
- package/out-tsc/src/form/select/Select.js +9 -15
- package/out-tsc/src/form/select/Select.js.map +1 -1
- package/out-tsc/src/form/select/UserSelect.js +8 -9
- package/out-tsc/src/form/select/UserSelect.js.map +1 -1
- package/out-tsc/src/form/select/WorkspaceSelect.js +7 -8
- package/out-tsc/src/form/select/WorkspaceSelect.js.map +1 -1
- package/out-tsc/src/live/ContactChat.js +73 -99
- package/out-tsc/src/live/ContactChat.js.map +1 -1
- package/out-tsc/src/live/ContactFieldEditor.js.map +1 -1
- package/out-tsc/src/utils.js +115 -0
- package/out-tsc/src/utils.js.map +1 -1
- package/out-tsc/temba-modules.js +3 -2
- package/out-tsc/temba-modules.js.map +1 -1
- package/out-tsc/test/nodes/split_by_llm.test.js +174 -0
- package/out-tsc/test/nodes/split_by_llm.test.js.map +1 -0
- package/out-tsc/test/temba-checkbox.test.js +16 -0
- package/out-tsc/test/temba-checkbox.test.js.map +1 -1
- package/out-tsc/test/temba-integration-markdown.test.js +2 -4
- package/out-tsc/test/temba-integration-markdown.test.js.map +1 -1
- package/out-tsc/test/temba-slider.test.js +0 -1
- package/out-tsc/test/temba-slider.test.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/actions/add_contact_groups/editor/descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/long-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/multiple-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/single-group.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/information-extraction.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/sentiment-analysis.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/summarization.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/translation-task.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/cleanup-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/long-descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/multiple-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/remove-from-all-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/single-group.png +0 -0
- package/screenshots/truth/actions/send_email/editor/complex-business-email.png +0 -0
- package/screenshots/truth/actions/send_email/editor/empty-body.png +0 -0
- package/screenshots/truth/actions/send_email/editor/empty-subject.png +0 -0
- package/screenshots/truth/actions/send_email/editor/long-subject.png +0 -0
- package/screenshots/truth/actions/send_email/editor/multiline-body.png +0 -0
- package/screenshots/truth/actions/send_email/editor/multiple-recipients.png +0 -0
- package/screenshots/truth/actions/send_email/editor/simple-email.png +0 -0
- package/screenshots/truth/actions/send_email/editor/with-expressions.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/long-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/multiline-text-with-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/simple-text.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-linebreaks.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-many-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-without-quick-replies.png +0 -0
- package/screenshots/truth/checkbox/checkbox-label-background-hover.png +0 -0
- package/screenshots/truth/checkbox/checkbox-no-label-no-background-hover.png +0 -0
- package/screenshots/truth/checkbox/checkbox-whitespace-label-no-background-hover.png +0 -0
- package/screenshots/truth/checkbox/checkbox-with-help-text.png +0 -0
- package/screenshots/truth/checkbox/checked.png +0 -0
- package/screenshots/truth/checkbox/default.png +0 -0
- package/screenshots/truth/colorpicker/default.png +0 -0
- package/screenshots/truth/colorpicker/focused.png +0 -0
- package/screenshots/truth/colorpicker/initialized.png +0 -0
- package/screenshots/truth/colorpicker/selected.png +0 -0
- package/screenshots/truth/compose/attachments-tab.png +0 -0
- package/screenshots/truth/compose/attachments-with-files.png +0 -0
- package/screenshots/truth/compose/intial-text.png +0 -0
- package/screenshots/truth/compose/no-counter.png +0 -0
- package/screenshots/truth/compose/wraps-text-and-spaces.png +0 -0
- package/screenshots/truth/compose/wraps-text-and-url.png +0 -0
- package/screenshots/truth/compose/wraps-text-no-spaces.png +0 -0
- package/screenshots/truth/contacts/chat-failure.png +0 -0
- package/screenshots/truth/contacts/chat-for-active-contact.png +0 -0
- package/screenshots/truth/contacts/chat-sends-attachments-only.png +0 -0
- package/screenshots/truth/contacts/chat-sends-text-and-attachments.png +0 -0
- package/screenshots/truth/contacts/chat-sends-text-only.png +0 -0
- package/screenshots/truth/counter/summary.png +0 -0
- package/screenshots/truth/counter/text.png +0 -0
- package/screenshots/truth/counter/unicode-variables.png +0 -0
- package/screenshots/truth/counter/unicode.png +0 -0
- package/screenshots/truth/counter/variable.png +0 -0
- package/screenshots/truth/datepicker/date-truncated-time.png +0 -0
- package/screenshots/truth/datepicker/date.png +0 -0
- package/screenshots/truth/datepicker/initial-timezone.png +0 -0
- package/screenshots/truth/datepicker/range-picker-editing-start.png +0 -0
- package/screenshots/truth/datepicker/updated-keyboard-date.png +0 -0
- package/screenshots/truth/dialog/focused.png +0 -0
- package/screenshots/truth/dropdown/right-edge-collision.png +0 -0
- package/screenshots/truth/editor/router.png +0 -0
- package/screenshots/truth/editor/send_msg.png +0 -0
- package/screenshots/truth/editor/set_contact_language.png +0 -0
- package/screenshots/truth/editor/set_contact_name.png +0 -0
- package/screenshots/truth/editor/set_run_result.png +0 -0
- package/screenshots/truth/editor/wait.png +0 -0
- package/screenshots/truth/field-renderer/checkbox-checked.png +0 -0
- package/screenshots/truth/field-renderer/checkbox-unchecked.png +0 -0
- package/screenshots/truth/field-renderer/checkbox-with-errors.png +0 -0
- package/screenshots/truth/field-renderer/context-comparison.png +0 -0
- package/screenshots/truth/field-renderer/key-value-with-label.png +0 -0
- package/screenshots/truth/field-renderer/message-editor-with-label.png +0 -0
- package/screenshots/truth/field-renderer/select-multi.png +0 -0
- package/screenshots/truth/field-renderer/select-no-label.png +0 -0
- package/screenshots/truth/field-renderer/select-with-label.png +0 -0
- package/screenshots/truth/field-renderer/text-evaluated.png +0 -0
- package/screenshots/truth/field-renderer/text-no-label.png +0 -0
- package/screenshots/truth/field-renderer/text-with-errors.png +0 -0
- package/screenshots/truth/field-renderer/text-with-label.png +0 -0
- package/screenshots/truth/field-renderer/textarea-evaluated.png +0 -0
- package/screenshots/truth/field-renderer/textarea-with-label.png +0 -0
- package/screenshots/truth/integration/checkbox-markdown-errors.png +0 -0
- package/screenshots/truth/list/fields-dragging.png +0 -0
- package/screenshots/truth/list/fields-filtered.png +0 -0
- package/screenshots/truth/list/fields-hovered.png +0 -0
- package/screenshots/truth/list/fields.png +0 -0
- package/screenshots/truth/list/items-selected.png +0 -0
- package/screenshots/truth/list/items-updated.png +0 -0
- package/screenshots/truth/list/items.png +0 -0
- package/screenshots/truth/menu/menu-focused-with items.png +0 -0
- package/screenshots/truth/menu/menu-refresh-1.png +0 -0
- package/screenshots/truth/menu/menu-refresh-2.png +0 -0
- package/screenshots/truth/menu/menu-submenu.png +0 -0
- package/screenshots/truth/menu/menu-tasks-nextup.png +0 -0
- package/screenshots/truth/menu/menu-tasks.png +0 -0
- package/screenshots/truth/message-editor/autogrow-initial-content.png +0 -0
- package/screenshots/truth/message-editor/default.png +0 -0
- package/screenshots/truth/message-editor/drag-highlight.png +0 -0
- package/screenshots/truth/message-editor/filtered-attachments.png +0 -0
- package/screenshots/truth/message-editor/with-completion.png +0 -0
- package/screenshots/truth/message-editor/with-properties.png +0 -0
- package/screenshots/truth/modax/form.png +0 -0
- package/screenshots/truth/modax/simple.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/information-extraction.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/sentiment-analysis.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/summarization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/editor/translation-task.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/information-extraction.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/sentiment-analysis.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/summarization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/translation-task.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/basic-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/custom-input-and-result-name.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/feedback-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/many-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/minimal-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/ab-test-multiple-variants.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/sampling-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/three-way-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/two-bucket-split.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/basic-digits-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/phone-number-collection.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/single-digit-with-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/verification-code.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/short-timeout.png +0 -0
- package/screenshots/truth/omnibox/selected.png +0 -0
- package/screenshots/truth/options/block.png +0 -0
- package/screenshots/truth/run-list/basic.png +0 -0
- package/screenshots/truth/select/disabled-multi-selection.png +0 -0
- package/screenshots/truth/select/disabled-selection.png +0 -0
- package/screenshots/truth/select/disabled.png +0 -0
- package/screenshots/truth/select/embedded.png +0 -0
- package/screenshots/truth/select/empty-options.png +0 -0
- package/screenshots/truth/select/expression-selected.png +0 -0
- package/screenshots/truth/select/expressions.png +0 -0
- package/screenshots/truth/select/functions.png +0 -0
- package/screenshots/truth/select/local-options.png +0 -0
- package/screenshots/truth/select/multi-with-endpoint.png +0 -0
- package/screenshots/truth/select/multiple-initial-values.png +0 -0
- package/screenshots/truth/select/remote-options.png +0 -0
- package/screenshots/truth/select/search-enabled.png +0 -0
- package/screenshots/truth/select/search-multi-no-matches.png +0 -0
- package/screenshots/truth/select/search-selected-focus.png +0 -0
- package/screenshots/truth/select/search-selected.png +0 -0
- package/screenshots/truth/select/search-with-selected.png +0 -0
- package/screenshots/truth/select/searching.png +0 -0
- package/screenshots/truth/select/selected-multi-maxitems-reached.png +0 -0
- package/screenshots/truth/select/selected-multi.png +0 -0
- package/screenshots/truth/select/selected-single.png +0 -0
- package/screenshots/truth/select/selection-clearable.png +0 -0
- package/screenshots/truth/select/static-initial-value.png +0 -0
- package/screenshots/truth/select/static-initial-via-selected.png +0 -0
- package/screenshots/truth/select/truncated-selection.png +0 -0
- package/screenshots/truth/select/with-placeholder.png +0 -0
- package/screenshots/truth/select/without-placeholder.png +0 -0
- package/screenshots/truth/slider/update-slider-on-circle-dragged.png +0 -0
- package/screenshots/truth/templates/default.png +0 -0
- package/screenshots/truth/templates/unapproved.png +0 -0
- package/screenshots/truth/textinput/autogrow-initial.png +0 -0
- package/screenshots/truth/textinput/input-disabled.png +0 -0
- package/screenshots/truth/textinput/input-focused.png +0 -0
- package/screenshots/truth/textinput/input-form.png +0 -0
- package/screenshots/truth/textinput/input-inserted.png +0 -0
- package/screenshots/truth/textinput/input-placeholder.png +0 -0
- package/screenshots/truth/textinput/input-updated.png +0 -0
- package/screenshots/truth/textinput/input.png +0 -0
- package/screenshots/truth/textinput/textarea-focused.png +0 -0
- package/screenshots/truth/textinput/textarea.png +0 -0
- package/src/events.ts +9 -8
- package/src/flow/Editor.ts +6 -3
- package/src/flow/actions/set_contact_channel.ts +1 -1
- package/src/flow/actions/set_contact_field.ts +1 -1
- package/src/flow/actions/set_contact_language.ts +1 -1
- package/src/flow/actions/set_contact_status.ts +1 -1
- package/src/flow/config.ts +2 -8
- package/src/flow/nodes/split_by_llm.ts +119 -0
- package/src/flow/nodes/split_by_llm_categorize.ts +13 -116
- package/src/flow/nodes/split_by_subflow.ts +153 -3
- package/src/flow/nodes/split_by_ticket.ts +135 -12
- package/src/flow/nodes/split_by_webhook.ts +187 -12
- package/src/form/ArrayEditor.ts +45 -57
- package/src/form/BaseListEditor.ts +4 -4
- package/src/form/Checkbox.ts +81 -24
- package/src/form/ColorPicker.ts +31 -43
- package/src/form/Completion.ts +49 -56
- package/src/form/Compose.ts +8 -8
- package/src/form/ContactSearch.ts +3 -4
- package/src/form/DatePicker.ts +32 -38
- package/src/form/{FormField.ts → FieldElement.ts} +105 -52
- package/src/form/FieldRenderer.ts +2 -1
- package/src/form/ImagePicker.ts +107 -110
- package/src/form/KeyValueEditor.ts +43 -39
- package/src/form/MessageEditor.ts +61 -67
- package/src/form/TembaSlider.ts +3 -3
- package/src/form/TemplateEditor.ts +3 -3
- package/src/form/TextInput.ts +25 -28
- package/src/form/select/Select.ts +12 -17
- package/src/form/select/UserSelect.ts +10 -11
- package/src/form/select/WorkspaceSelect.ts +9 -10
- package/src/live/ContactChat.ts +81 -92
- package/src/live/ContactFieldEditor.ts +2 -2
- package/src/store/flow-definition.d.ts +2 -1
- package/src/utils.ts +192 -0
- package/temba-modules.ts +3 -2
- package/test/nodes/split_by_llm.test.ts +232 -0
- package/test/temba-checkbox.test.ts +26 -0
- package/test/temba-integration-markdown.test.ts +2 -4
- package/test/temba-slider.test.ts +0 -1
- package/test-assets/contacts/history.json +7 -20
- package/test-assets/style.css +36 -234
- package/web-dev-server.config.mjs +26 -0
- package/web-test-runner.config.mjs +1 -1
- package/out-tsc/src/flow/actions/call_llm.js +0 -64
- package/out-tsc/src/flow/actions/call_llm.js.map +0 -1
- package/out-tsc/src/flow/actions/call_webhook.js +0 -131
- package/out-tsc/src/flow/actions/call_webhook.js.map +0 -1
- package/out-tsc/src/flow/actions/enter_flow.js +0 -14
- package/out-tsc/src/flow/actions/enter_flow.js.map +0 -1
- package/out-tsc/src/flow/actions/open_ticket.js +0 -73
- package/out-tsc/src/flow/actions/open_ticket.js.map +0 -1
- package/out-tsc/src/form/FormElement.js +0 -67
- package/out-tsc/src/form/FormElement.js.map +0 -1
- package/out-tsc/src/form/FormField.js.map +0 -1
- package/out-tsc/test/actions/call_llm.test.js +0 -103
- package/out-tsc/test/actions/call_llm.test.js.map +0 -1
- package/out-tsc/test/temba-formfield.test.js +0 -94
- package/out-tsc/test/temba-formfield.test.js.map +0 -1
- package/src/flow/actions/call_llm.ts +0 -66
- package/src/flow/actions/call_webhook.ts +0 -143
- package/src/flow/actions/enter_flow.ts +0 -15
- package/src/flow/actions/open_ticket.ts +0 -83
- package/src/form/FormElement.ts +0 -69
- package/test/actions/call_llm.test.ts +0 -137
- package/test/temba-formfield.test.ts +0 -121
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/screenshots/truth/nodes/split_by_llm_categorize/editor/custom-input-and-result-name.png
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/events.ts
CHANGED
|
@@ -30,8 +30,10 @@ export interface ChannelEvent extends ContactEvent {
|
|
|
30
30
|
|
|
31
31
|
export interface ContactLanguageChangedEvent extends ContactEvent {
|
|
32
32
|
language: string;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ContactStatusChangedEvent extends ContactEvent {
|
|
36
|
+
status: string;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export interface OptInEvent extends ContactEvent {
|
|
@@ -42,12 +44,16 @@ export interface OptInEvent extends ContactEvent {
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export interface CallEvent extends ContactEvent {
|
|
45
|
-
call
|
|
47
|
+
call?: {
|
|
46
48
|
uuid: string;
|
|
47
49
|
urn: string;
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
|
|
53
|
+
export interface ChatStartedEvent extends ContactEvent {
|
|
54
|
+
params?: object;
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
export interface MsgEvent extends ContactEvent {
|
|
52
58
|
msg: Msg;
|
|
53
59
|
status: string;
|
|
@@ -59,11 +65,6 @@ export interface MsgEvent extends ContactEvent {
|
|
|
59
65
|
optin?: ObjectReference;
|
|
60
66
|
}
|
|
61
67
|
|
|
62
|
-
export interface FlowEvent extends ContactEvent {
|
|
63
|
-
flow: ObjectReference;
|
|
64
|
-
status: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
68
|
export interface RunEvent extends ContactEvent {
|
|
68
69
|
flow: ObjectReference;
|
|
69
70
|
status: string;
|
package/src/flow/Editor.ts
CHANGED
|
@@ -653,7 +653,7 @@ export class Editor extends RapidElement {
|
|
|
653
653
|
this.definition?.nodes.forEach((node) => {
|
|
654
654
|
const nodeElement = this.querySelector(`[id="${node.uuid}"]`);
|
|
655
655
|
if (nodeElement) {
|
|
656
|
-
const position = this.definition._ui
|
|
656
|
+
const position = this.definition._ui?.nodes[node.uuid]?.position;
|
|
657
657
|
if (position) {
|
|
658
658
|
const rect = nodeElement.getBoundingClientRect();
|
|
659
659
|
const canvasRect =
|
|
@@ -1085,8 +1085,11 @@ export class Editor extends RapidElement {
|
|
|
1085
1085
|
this.definition.nodes,
|
|
1086
1086
|
(node) => node.uuid,
|
|
1087
1087
|
(node) => {
|
|
1088
|
-
const position =
|
|
1089
|
-
|
|
1088
|
+
const position = this.definition._ui?.nodes[node.uuid]
|
|
1089
|
+
?.position || {
|
|
1090
|
+
left: 0,
|
|
1091
|
+
top: 0
|
|
1092
|
+
};
|
|
1090
1093
|
|
|
1091
1094
|
const dragging =
|
|
1092
1095
|
this.isDragging &&
|
|
@@ -3,7 +3,7 @@ import { ActionConfig, COLORS } from '../types';
|
|
|
3
3
|
import { Node, SetContactChannel } from '../../store/flow-definition';
|
|
4
4
|
|
|
5
5
|
export const set_contact_channel: ActionConfig = {
|
|
6
|
-
name: 'Update Contact
|
|
6
|
+
name: 'Update Contact',
|
|
7
7
|
color: COLORS.update,
|
|
8
8
|
render: (_node: Node, action: SetContactChannel) => {
|
|
9
9
|
return html`<div>
|
|
@@ -3,7 +3,7 @@ import { ActionConfig, COLORS } from '../types';
|
|
|
3
3
|
import { Node, SetContactField } from '../../store/flow-definition';
|
|
4
4
|
|
|
5
5
|
export const set_contact_field: ActionConfig = {
|
|
6
|
-
name: 'Update Contact
|
|
6
|
+
name: 'Update Contact',
|
|
7
7
|
color: COLORS.update,
|
|
8
8
|
render: (_node: Node, action: SetContactField) => {
|
|
9
9
|
return html`<div>
|
|
@@ -3,7 +3,7 @@ import { ActionConfig, COLORS } from '../types';
|
|
|
3
3
|
import { Node, SetContactLanguage } from '../../store/flow-definition';
|
|
4
4
|
|
|
5
5
|
export const set_contact_language: ActionConfig = {
|
|
6
|
-
name: 'Update Contact
|
|
6
|
+
name: 'Update Contact',
|
|
7
7
|
color: COLORS.update,
|
|
8
8
|
render: (_node: Node, action: SetContactLanguage) => {
|
|
9
9
|
return html`<div>Set contact language to <b>${action.language}</b></div>`;
|
|
@@ -3,7 +3,7 @@ import { ActionConfig, COLORS } from '../types';
|
|
|
3
3
|
import { Node, SetContactStatus } from '../../store/flow-definition';
|
|
4
4
|
|
|
5
5
|
export const set_contact_status: ActionConfig = {
|
|
6
|
-
name: 'Update Contact
|
|
6
|
+
name: 'Update Contact',
|
|
7
7
|
color: COLORS.update,
|
|
8
8
|
render: (_node: Node, action: SetContactStatus) => {
|
|
9
9
|
return html`<div>Set contact status to <b>${action.status}</b></div>`;
|
package/src/flow/config.ts
CHANGED
|
@@ -14,11 +14,8 @@ import { set_run_result } from './actions/set_run_result';
|
|
|
14
14
|
import { send_msg } from './actions/send_msg';
|
|
15
15
|
import { send_email } from './actions/send_email';
|
|
16
16
|
import { start_session } from './actions/start_session';
|
|
17
|
-
import { open_ticket } from './actions/open_ticket';
|
|
18
|
-
import { call_webhook } from './actions/call_webhook';
|
|
19
17
|
import { call_classifier } from './actions/call_classifier';
|
|
20
18
|
import { call_resthook } from './actions/call_resthook';
|
|
21
|
-
import { call_llm } from './actions/call_llm';
|
|
22
19
|
import { transfer_airtime } from './actions/transfer_airtime';
|
|
23
20
|
import { set_contact_name } from './actions/set_contact_name';
|
|
24
21
|
import { add_contact_groups } from './actions/add_contact_groups';
|
|
@@ -26,7 +23,6 @@ import { remove_contact_groups } from './actions/remove_contact_groups';
|
|
|
26
23
|
import { request_optin } from './actions/request_optin';
|
|
27
24
|
import { say_msg } from './actions/say_msg';
|
|
28
25
|
import { play_audio } from './actions/play_audio';
|
|
29
|
-
import { enter_flow } from './actions/enter_flow';
|
|
30
26
|
|
|
31
27
|
// Import all node configurations
|
|
32
28
|
import { execute_actions } from './nodes/execute_actions';
|
|
@@ -40,6 +36,7 @@ import { split_by_scheme } from './nodes/split_by_scheme';
|
|
|
40
36
|
import { split_by_subflow } from './nodes/split_by_subflow';
|
|
41
37
|
import { split_by_ticket } from './nodes/split_by_ticket';
|
|
42
38
|
import { split_by_webhook } from './nodes/split_by_webhook';
|
|
39
|
+
import { split_by_llm } from './nodes/split_by_llm';
|
|
43
40
|
import { split_by_llm_categorize } from './nodes/split_by_llm_categorize';
|
|
44
41
|
import { wait_for_audio } from './nodes/wait_for_audio';
|
|
45
42
|
import { wait_for_digits } from './nodes/wait_for_digits';
|
|
@@ -63,12 +60,8 @@ export const ACTION_CONFIG: {
|
|
|
63
60
|
send_msg,
|
|
64
61
|
send_email,
|
|
65
62
|
start_session,
|
|
66
|
-
open_ticket,
|
|
67
|
-
call_webhook,
|
|
68
63
|
call_classifier,
|
|
69
64
|
call_resthook,
|
|
70
|
-
call_llm,
|
|
71
|
-
enter_flow,
|
|
72
65
|
transfer_airtime,
|
|
73
66
|
set_contact_name,
|
|
74
67
|
add_contact_groups,
|
|
@@ -86,6 +79,7 @@ export const NODE_CONFIG: {
|
|
|
86
79
|
split_by_contact_field,
|
|
87
80
|
split_by_expression,
|
|
88
81
|
split_by_groups,
|
|
82
|
+
split_by_llm,
|
|
89
83
|
split_by_llm_categorize,
|
|
90
84
|
split_by_random,
|
|
91
85
|
split_by_run_result,
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { COLORS, NodeConfig } from '../types';
|
|
2
|
+
import { CallLLM, Node } from '../../store/flow-definition';
|
|
3
|
+
import { generateUUID, createSuccessFailureRouter } from '../../utils';
|
|
4
|
+
import { html } from 'lit';
|
|
5
|
+
|
|
6
|
+
export const split_by_llm: NodeConfig = {
|
|
7
|
+
type: 'split_by_llm',
|
|
8
|
+
name: 'Call AI',
|
|
9
|
+
color: COLORS.call,
|
|
10
|
+
form: {
|
|
11
|
+
llm: {
|
|
12
|
+
type: 'select',
|
|
13
|
+
label: 'LLM',
|
|
14
|
+
required: true,
|
|
15
|
+
options: [],
|
|
16
|
+
endpoint: '/test-assets/select/llms.json',
|
|
17
|
+
searchable: true,
|
|
18
|
+
valueKey: 'uuid',
|
|
19
|
+
nameKey: 'name',
|
|
20
|
+
placeholder: 'Select an LLM...'
|
|
21
|
+
},
|
|
22
|
+
input: {
|
|
23
|
+
type: 'text',
|
|
24
|
+
label: 'Input',
|
|
25
|
+
helpText: 'The input the AI will process',
|
|
26
|
+
required: true,
|
|
27
|
+
evaluated: true,
|
|
28
|
+
placeholder: '@input'
|
|
29
|
+
},
|
|
30
|
+
instructions: {
|
|
31
|
+
type: 'textarea',
|
|
32
|
+
label: 'Instructions',
|
|
33
|
+
helpText:
|
|
34
|
+
'Tell the AI what to do with the input. The result can be referenced as **`@locals._llm_output`**',
|
|
35
|
+
required: true,
|
|
36
|
+
evaluated: true,
|
|
37
|
+
placeholder: 'Enter instructions for the AI model...',
|
|
38
|
+
minHeight: 130
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
layout: ['llm', 'input', 'instructions'],
|
|
42
|
+
render: (node: Node) => {
|
|
43
|
+
const callLlmAction = node.actions?.find(
|
|
44
|
+
(action) => action.type === 'call_llm'
|
|
45
|
+
) as CallLLM;
|
|
46
|
+
return html`
|
|
47
|
+
<div
|
|
48
|
+
class="body"
|
|
49
|
+
style="word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; max-width: 180px; max-height: 90px; margin-bottom:10px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical;"
|
|
50
|
+
>
|
|
51
|
+
${callLlmAction?.instructions || 'Configure AI instructions'}
|
|
52
|
+
</div>
|
|
53
|
+
`;
|
|
54
|
+
},
|
|
55
|
+
toFormData: (node: Node) => {
|
|
56
|
+
// Extract data from the existing node structure
|
|
57
|
+
const callLlmAction = node.actions?.find(
|
|
58
|
+
(action) => action.type === 'call_llm'
|
|
59
|
+
) as CallLLM;
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
uuid: node.uuid,
|
|
63
|
+
llm: callLlmAction?.llm
|
|
64
|
+
? [{ value: callLlmAction.llm.uuid, name: callLlmAction.llm.name }]
|
|
65
|
+
: [],
|
|
66
|
+
input: callLlmAction?.input || '@input',
|
|
67
|
+
instructions: callLlmAction?.instructions || ''
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
fromFormData: (formData: any, originalNode: Node): Node => {
|
|
71
|
+
// Get LLM selection
|
|
72
|
+
const llmSelection =
|
|
73
|
+
Array.isArray(formData.llm) && formData.llm.length > 0
|
|
74
|
+
? formData.llm[0]
|
|
75
|
+
: null;
|
|
76
|
+
|
|
77
|
+
// Find existing call_llm action to preserve its UUID
|
|
78
|
+
const existingCallLlmAction = originalNode.actions?.find(
|
|
79
|
+
(action) => action.type === 'call_llm'
|
|
80
|
+
);
|
|
81
|
+
const callLlmUuid = existingCallLlmAction?.uuid || generateUUID();
|
|
82
|
+
|
|
83
|
+
// Create call_llm action
|
|
84
|
+
const callLlmAction: CallLLM = {
|
|
85
|
+
type: 'call_llm',
|
|
86
|
+
uuid: callLlmUuid,
|
|
87
|
+
llm: llmSelection
|
|
88
|
+
? { uuid: llmSelection.value, name: llmSelection.name }
|
|
89
|
+
: { uuid: '', name: '' },
|
|
90
|
+
input: formData.input || '@input',
|
|
91
|
+
instructions: formData.instructions || '',
|
|
92
|
+
output_local: '_llm_output'
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// Create categories and exits for Success and Failure
|
|
96
|
+
const existingCategories = originalNode.router?.categories || [];
|
|
97
|
+
const existingExits = originalNode.exits || [];
|
|
98
|
+
const existingCases = originalNode.router?.cases || [];
|
|
99
|
+
|
|
100
|
+
const { router, exits } = createSuccessFailureRouter(
|
|
101
|
+
'@locals._llm_output',
|
|
102
|
+
{
|
|
103
|
+
type: 'has_text',
|
|
104
|
+
arguments: []
|
|
105
|
+
},
|
|
106
|
+
existingCategories,
|
|
107
|
+
existingExits,
|
|
108
|
+
existingCases
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
// Return the complete node
|
|
112
|
+
return {
|
|
113
|
+
uuid: originalNode.uuid,
|
|
114
|
+
actions: [callLlmAction],
|
|
115
|
+
router: router,
|
|
116
|
+
exits: exits
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
};
|