retell-utils 0.4.5 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/flow.d.ts CHANGED
@@ -673,6 +673,349 @@ export declare const FlowComponentSchema: z.ZodObject<{
673
673
  y: z.ZodNumber;
674
674
  }, z.core.$strip>>>;
675
675
  }, z.core.$strip>;
676
+ /** Zod schema for a shared conversation flow component response from the API. */
677
+ export declare const ConversationFlowComponentResponseSchema: z.ZodObject<{
678
+ conversation_flow_component_id: z.ZodString;
679
+ user_modified_timestamp: z.ZodNumber;
680
+ linked_conversation_flow_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
681
+ name: z.ZodOptional<z.ZodString>;
682
+ nodes: z.ZodOptional<z.ZodArray<z.ZodObject<{
683
+ id: z.ZodOptional<z.ZodString>;
684
+ name: z.ZodOptional<z.ZodString>;
685
+ type: z.ZodOptional<z.ZodEnum<{
686
+ function: "function";
687
+ conversation: "conversation";
688
+ end: "end";
689
+ transfer_call: "transfer_call";
690
+ press_digit: "press_digit";
691
+ branch: "branch";
692
+ sms: "sms";
693
+ extract_dynamic_variables: "extract_dynamic_variables";
694
+ agent_swap: "agent_swap";
695
+ mcp: "mcp";
696
+ component: "component";
697
+ }>>;
698
+ instruction: z.ZodOptional<z.ZodObject<{
699
+ type: z.ZodOptional<z.ZodEnum<{
700
+ prompt: "prompt";
701
+ static_text: "static_text";
702
+ }>>;
703
+ text: z.ZodOptional<z.ZodString>;
704
+ }, z.core.$strip>>;
705
+ display_position: z.ZodOptional<z.ZodNullable<z.ZodObject<{
706
+ x: z.ZodNumber;
707
+ y: z.ZodNumber;
708
+ }, z.core.$strip>>>;
709
+ edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
710
+ id: z.ZodOptional<z.ZodString>;
711
+ destination_node_id: z.ZodOptional<z.ZodString>;
712
+ transition_condition: z.ZodOptional<z.ZodObject<{
713
+ type: z.ZodOptional<z.ZodEnum<{
714
+ prompt: "prompt";
715
+ equation: "equation";
716
+ }>>;
717
+ prompt: z.ZodOptional<z.ZodString>;
718
+ equations: z.ZodOptional<z.ZodArray<z.ZodObject<{
719
+ left: z.ZodString;
720
+ operator: z.ZodEnum<{
721
+ "==": "==";
722
+ "!=": "!=";
723
+ ">": ">";
724
+ ">=": ">=";
725
+ "<": "<";
726
+ "<=": "<=";
727
+ contains: "contains";
728
+ not_contains: "not_contains";
729
+ exists: "exists";
730
+ not_exist: "not_exist";
731
+ }>;
732
+ right: z.ZodOptional<z.ZodString>;
733
+ }, z.core.$strip>>>;
734
+ operator: z.ZodOptional<z.ZodEnum<{
735
+ "||": "||";
736
+ "&&": "&&";
737
+ }>>;
738
+ }, z.core.$strip>>;
739
+ }, z.core.$strip>>>;
740
+ edge: z.ZodOptional<z.ZodObject<{
741
+ id: z.ZodOptional<z.ZodString>;
742
+ destination_node_id: z.ZodOptional<z.ZodString>;
743
+ transition_condition: z.ZodOptional<z.ZodObject<{
744
+ type: z.ZodOptional<z.ZodEnum<{
745
+ prompt: "prompt";
746
+ equation: "equation";
747
+ }>>;
748
+ prompt: z.ZodOptional<z.ZodString>;
749
+ equations: z.ZodOptional<z.ZodArray<z.ZodObject<{
750
+ left: z.ZodString;
751
+ operator: z.ZodEnum<{
752
+ "==": "==";
753
+ "!=": "!=";
754
+ ">": ">";
755
+ ">=": ">=";
756
+ "<": "<";
757
+ "<=": "<=";
758
+ contains: "contains";
759
+ not_contains: "not_contains";
760
+ exists: "exists";
761
+ not_exist: "not_exist";
762
+ }>;
763
+ right: z.ZodOptional<z.ZodString>;
764
+ }, z.core.$strip>>>;
765
+ operator: z.ZodOptional<z.ZodEnum<{
766
+ "||": "||";
767
+ "&&": "&&";
768
+ }>>;
769
+ }, z.core.$strip>>;
770
+ }, z.core.$strip>>;
771
+ else_edge: z.ZodOptional<z.ZodObject<{
772
+ id: z.ZodOptional<z.ZodString>;
773
+ destination_node_id: z.ZodOptional<z.ZodString>;
774
+ transition_condition: z.ZodOptional<z.ZodObject<{
775
+ type: z.ZodOptional<z.ZodEnum<{
776
+ prompt: "prompt";
777
+ equation: "equation";
778
+ }>>;
779
+ prompt: z.ZodOptional<z.ZodString>;
780
+ equations: z.ZodOptional<z.ZodArray<z.ZodObject<{
781
+ left: z.ZodString;
782
+ operator: z.ZodEnum<{
783
+ "==": "==";
784
+ "!=": "!=";
785
+ ">": ">";
786
+ ">=": ">=";
787
+ "<": "<";
788
+ "<=": "<=";
789
+ contains: "contains";
790
+ not_contains: "not_contains";
791
+ exists: "exists";
792
+ not_exist: "not_exist";
793
+ }>;
794
+ right: z.ZodOptional<z.ZodString>;
795
+ }, z.core.$strip>>>;
796
+ operator: z.ZodOptional<z.ZodEnum<{
797
+ "||": "||";
798
+ "&&": "&&";
799
+ }>>;
800
+ }, z.core.$strip>>;
801
+ }, z.core.$strip>>;
802
+ skip_response_edge: z.ZodOptional<z.ZodObject<{
803
+ id: z.ZodOptional<z.ZodString>;
804
+ destination_node_id: z.ZodOptional<z.ZodString>;
805
+ transition_condition: z.ZodOptional<z.ZodObject<{
806
+ type: z.ZodOptional<z.ZodEnum<{
807
+ prompt: "prompt";
808
+ equation: "equation";
809
+ }>>;
810
+ prompt: z.ZodOptional<z.ZodString>;
811
+ equations: z.ZodOptional<z.ZodArray<z.ZodObject<{
812
+ left: z.ZodString;
813
+ operator: z.ZodEnum<{
814
+ "==": "==";
815
+ "!=": "!=";
816
+ ">": ">";
817
+ ">=": ">=";
818
+ "<": "<";
819
+ "<=": "<=";
820
+ contains: "contains";
821
+ not_contains: "not_contains";
822
+ exists: "exists";
823
+ not_exist: "not_exist";
824
+ }>;
825
+ right: z.ZodOptional<z.ZodString>;
826
+ }, z.core.$strip>>>;
827
+ operator: z.ZodOptional<z.ZodEnum<{
828
+ "||": "||";
829
+ "&&": "&&";
830
+ }>>;
831
+ }, z.core.$strip>>;
832
+ }, z.core.$strip>>;
833
+ always_edge: z.ZodOptional<z.ZodObject<{
834
+ id: z.ZodOptional<z.ZodString>;
835
+ destination_node_id: z.ZodOptional<z.ZodString>;
836
+ transition_condition: z.ZodOptional<z.ZodObject<{
837
+ type: z.ZodOptional<z.ZodEnum<{
838
+ prompt: "prompt";
839
+ equation: "equation";
840
+ }>>;
841
+ prompt: z.ZodOptional<z.ZodString>;
842
+ equations: z.ZodOptional<z.ZodArray<z.ZodObject<{
843
+ left: z.ZodString;
844
+ operator: z.ZodEnum<{
845
+ "==": "==";
846
+ "!=": "!=";
847
+ ">": ">";
848
+ ">=": ">=";
849
+ "<": "<";
850
+ "<=": "<=";
851
+ contains: "contains";
852
+ not_contains: "not_contains";
853
+ exists: "exists";
854
+ not_exist: "not_exist";
855
+ }>;
856
+ right: z.ZodOptional<z.ZodString>;
857
+ }, z.core.$strip>>>;
858
+ operator: z.ZodOptional<z.ZodEnum<{
859
+ "||": "||";
860
+ "&&": "&&";
861
+ }>>;
862
+ }, z.core.$strip>>;
863
+ }, z.core.$strip>>;
864
+ start_speaker: z.ZodOptional<z.ZodEnum<{
865
+ user: "user";
866
+ agent: "agent";
867
+ }>>;
868
+ interruption_sensitivity: z.ZodOptional<z.ZodNumber>;
869
+ global_node_setting: z.ZodOptional<z.ZodObject<{
870
+ condition: z.ZodOptional<z.ZodString>;
871
+ positive_finetune_examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
872
+ id: z.ZodOptional<z.ZodString>;
873
+ destination_node_id: z.ZodOptional<z.ZodString>;
874
+ transcript: z.ZodOptional<z.ZodArray<z.ZodObject<{
875
+ role: z.ZodString;
876
+ content: z.ZodOptional<z.ZodString>;
877
+ }, z.core.$strip>>>;
878
+ }, z.core.$strip>>>;
879
+ negative_finetune_examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
880
+ id: z.ZodOptional<z.ZodString>;
881
+ destination_node_id: z.ZodOptional<z.ZodString>;
882
+ transcript: z.ZodOptional<z.ZodArray<z.ZodObject<{
883
+ role: z.ZodString;
884
+ content: z.ZodOptional<z.ZodString>;
885
+ }, z.core.$strip>>>;
886
+ }, z.core.$strip>>>;
887
+ cool_down: z.ZodOptional<z.ZodNumber>;
888
+ }, z.core.$strip>>;
889
+ finetune_transition_examples: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
890
+ id: z.ZodOptional<z.ZodString>;
891
+ destination_node_id: z.ZodOptional<z.ZodString>;
892
+ transcript: z.ZodOptional<z.ZodArray<z.ZodObject<{
893
+ role: z.ZodString;
894
+ content: z.ZodOptional<z.ZodString>;
895
+ }, z.core.$strip>>>;
896
+ }, z.core.$strip>>>>;
897
+ finetune_conversation_examples: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
898
+ id: z.ZodOptional<z.ZodString>;
899
+ destination_node_id: z.ZodOptional<z.ZodString>;
900
+ transcript: z.ZodOptional<z.ZodArray<z.ZodObject<{
901
+ role: z.ZodString;
902
+ content: z.ZodOptional<z.ZodString>;
903
+ }, z.core.$strip>>>;
904
+ }, z.core.$strip>>>>;
905
+ tool_id: z.ZodOptional<z.ZodString>;
906
+ tool_type: z.ZodOptional<z.ZodString>;
907
+ speak_during_execution: z.ZodOptional<z.ZodBoolean>;
908
+ wait_for_result: z.ZodOptional<z.ZodBoolean>;
909
+ transfer_destination: z.ZodOptional<z.ZodObject<{
910
+ type: z.ZodOptional<z.ZodString>;
911
+ prompt: z.ZodOptional<z.ZodString>;
912
+ number: z.ZodOptional<z.ZodString>;
913
+ extension: z.ZodOptional<z.ZodString>;
914
+ }, z.core.$strip>>;
915
+ transfer_option: z.ZodOptional<z.ZodObject<{
916
+ type: z.ZodOptional<z.ZodString>;
917
+ option: z.ZodOptional<z.ZodObject<{
918
+ type: z.ZodOptional<z.ZodString>;
919
+ prompt: z.ZodOptional<z.ZodString>;
920
+ }, z.core.$strip>>;
921
+ public_handoff_option: z.ZodOptional<z.ZodObject<{
922
+ type: z.ZodOptional<z.ZodString>;
923
+ prompt: z.ZodOptional<z.ZodString>;
924
+ }, z.core.$strip>>;
925
+ private_handoff_option: z.ZodOptional<z.ZodObject<{
926
+ type: z.ZodOptional<z.ZodString>;
927
+ prompt: z.ZodOptional<z.ZodString>;
928
+ }, z.core.$strip>>;
929
+ on_hold_music: z.ZodOptional<z.ZodString>;
930
+ opt_out_initial_message: z.ZodOptional<z.ZodBoolean>;
931
+ opt_out_human_detection: z.ZodOptional<z.ZodBoolean>;
932
+ agent_detection_timeout_ms: z.ZodOptional<z.ZodNumber>;
933
+ show_transferee_as_caller: z.ZodOptional<z.ZodBoolean>;
934
+ enable_bridge_audio_cue: z.ZodOptional<z.ZodBoolean>;
935
+ }, z.core.$strip>>;
936
+ }, z.core.$strip>>>;
937
+ tools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
938
+ type: z.ZodEnum<{
939
+ transfer_call: "transfer_call";
940
+ press_digit: "press_digit";
941
+ agent_swap: "agent_swap";
942
+ mcp: "mcp";
943
+ end_call: "end_call";
944
+ check_availability_cal: "check_availability_cal";
945
+ book_appointment_cal: "book_appointment_cal";
946
+ custom: "custom";
947
+ extract_dynamic_variable: "extract_dynamic_variable";
948
+ send_sms: "send_sms";
949
+ }>;
950
+ name: z.ZodOptional<z.ZodString>;
951
+ description: z.ZodOptional<z.ZodString>;
952
+ tool_id: z.ZodOptional<z.ZodString>;
953
+ url: z.ZodOptional<z.ZodString>;
954
+ method: z.ZodOptional<z.ZodEnum<{
955
+ GET: "GET";
956
+ POST: "POST";
957
+ PATCH: "PATCH";
958
+ PUT: "PUT";
959
+ DELETE: "DELETE";
960
+ }>>;
961
+ parameter_type: z.ZodOptional<z.ZodEnum<{
962
+ json: "json";
963
+ form: "form";
964
+ }>>;
965
+ parameters: z.ZodOptional<z.ZodUnknown>;
966
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
967
+ query_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
968
+ args_at_root: z.ZodOptional<z.ZodBoolean>;
969
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
970
+ response_variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
971
+ speak_during_execution: z.ZodOptional<z.ZodBoolean>;
972
+ speak_after_execution: z.ZodOptional<z.ZodBoolean>;
973
+ execution_message_description: z.ZodOptional<z.ZodString>;
974
+ transfer_destination: z.ZodOptional<z.ZodObject<{
975
+ type: z.ZodOptional<z.ZodString>;
976
+ prompt: z.ZodOptional<z.ZodString>;
977
+ number: z.ZodOptional<z.ZodString>;
978
+ extension: z.ZodOptional<z.ZodString>;
979
+ }, z.core.$strip>>;
980
+ transfer_option: z.ZodOptional<z.ZodObject<{
981
+ type: z.ZodOptional<z.ZodString>;
982
+ option: z.ZodOptional<z.ZodObject<{
983
+ type: z.ZodOptional<z.ZodString>;
984
+ prompt: z.ZodOptional<z.ZodString>;
985
+ }, z.core.$strip>>;
986
+ public_handoff_option: z.ZodOptional<z.ZodObject<{
987
+ type: z.ZodOptional<z.ZodString>;
988
+ prompt: z.ZodOptional<z.ZodString>;
989
+ }, z.core.$strip>>;
990
+ private_handoff_option: z.ZodOptional<z.ZodObject<{
991
+ type: z.ZodOptional<z.ZodString>;
992
+ prompt: z.ZodOptional<z.ZodString>;
993
+ }, z.core.$strip>>;
994
+ on_hold_music: z.ZodOptional<z.ZodString>;
995
+ opt_out_initial_message: z.ZodOptional<z.ZodBoolean>;
996
+ opt_out_human_detection: z.ZodOptional<z.ZodBoolean>;
997
+ agent_detection_timeout_ms: z.ZodOptional<z.ZodNumber>;
998
+ show_transferee_as_caller: z.ZodOptional<z.ZodBoolean>;
999
+ enable_bridge_audio_cue: z.ZodOptional<z.ZodBoolean>;
1000
+ }, z.core.$strip>>;
1001
+ custom_sip_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1002
+ cal_api_key: z.ZodOptional<z.ZodString>;
1003
+ event_type_id: z.ZodOptional<z.ZodNumber>;
1004
+ timezone: z.ZodOptional<z.ZodString>;
1005
+ }, z.core.$strip>>>>;
1006
+ mcps: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1007
+ name: z.ZodString;
1008
+ url: z.ZodString;
1009
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1010
+ query_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1011
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
1012
+ }, z.core.$strip>>>>;
1013
+ start_node_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1014
+ begin_tag_display_position: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1015
+ x: z.ZodNumber;
1016
+ y: z.ZodNumber;
1017
+ }, z.core.$strip>>>;
1018
+ }, z.core.$strip>;
676
1019
  /** Zod schema for a conversation flow response from the Retell API. */
677
1020
  export declare const ConversationFlowResponseSchema: z.ZodObject<{
678
1021
  conversation_flow_id: z.ZodString;
package/dist/flow.js CHANGED
@@ -105,6 +105,21 @@ export const FlowComponentSchema = z.object({
105
105
  begin_tag_display_position: DisplayPositionSchema.nullable().optional(),
106
106
  });
107
107
  // ---------------------------------------------------------------------------
108
+ // Shared (account-level) flow component response
109
+ // ---------------------------------------------------------------------------
110
+ /** Zod schema for a shared conversation flow component response from the API. */
111
+ export const ConversationFlowComponentResponseSchema = z.object({
112
+ conversation_flow_component_id: z.string(),
113
+ user_modified_timestamp: z.number(),
114
+ linked_conversation_flow_ids: z.array(z.string()).optional(),
115
+ name: z.string().optional(),
116
+ nodes: z.array(FlowNodeSchema).optional(),
117
+ tools: z.array(LlmToolSchema).nullable().optional(),
118
+ mcps: z.array(McpConfigSchema).nullable().optional(),
119
+ start_node_id: z.string().nullable().optional(),
120
+ begin_tag_display_position: DisplayPositionSchema.nullable().optional(),
121
+ });
122
+ // ---------------------------------------------------------------------------
108
123
  // Model choice
109
124
  // ---------------------------------------------------------------------------
110
125
  /** Model selection configuration for conversation flows. */
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export { type ChatSchemaConfig, ChatSchemas, chatSchemaDefaults, createChatSchem
11
11
  export { WebhookSchemas, createWebhookSchemas } from "./webhook.js";
12
12
  export { ChatAgentResponseSchema, GuardrailConfigSchema, KbConfigSchema, McpConfigSchema, PiiConfigSchema, PostAnalysisFieldSchema, PronunciationEntrySchema, ResponseEngineConversationFlowSchema, ResponseEngineCustomLlmSchema, ResponseEngineRetellLlmSchema, ResponseEngineSchema, VoiceAgentResponseSchema, } from "./agent.js";
13
13
  export { LlmResponseSchema, LlmStateEdgeSchema, LlmStateSchema, LlmToolSchema, TransferDestinationSchema, TransferOptionSchema, } from "./llm.js";
14
- export { ConversationFlowResponseSchema, FlowComponentSchema, FlowEdgeSchema, FlowEquationSchema, FlowNodeSchema, FlowTransitionConditionSchema, } from "./flow.js";
14
+ export { ConversationFlowComponentResponseSchema, ConversationFlowResponseSchema, FlowComponentSchema, FlowEdgeSchema, FlowEquationSchema, FlowNodeSchema, FlowTransitionConditionSchema, } from "./flow.js";
15
15
  export { InputMatchRuleSchema, TestCaseDefinitionSchema, TestCaseResponseEngineSchema, ToolMockSchema, } from "./test-case.js";
16
16
  export { retellPagination } from "./pagination.js";
17
17
  export { pluralize, resolveFilePlaceholders, toSnakeCase } from "./utils.js";
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ export { ChatAgentResponseSchema, GuardrailConfigSchema, KbConfigSchema, McpConf
25
25
  // LLM config schemas
26
26
  export { LlmResponseSchema, LlmStateEdgeSchema, LlmStateSchema, LlmToolSchema, TransferDestinationSchema, TransferOptionSchema, } from "./llm.js";
27
27
  // Conversation flow config schemas
28
- export { ConversationFlowResponseSchema, FlowComponentSchema, FlowEdgeSchema, FlowEquationSchema, FlowNodeSchema, FlowTransitionConditionSchema, } from "./flow.js";
28
+ export { ConversationFlowComponentResponseSchema, ConversationFlowResponseSchema, FlowComponentSchema, FlowEdgeSchema, FlowEquationSchema, FlowNodeSchema, FlowTransitionConditionSchema, } from "./flow.js";
29
29
  // Test case schemas
30
30
  export { InputMatchRuleSchema, TestCaseDefinitionSchema, TestCaseResponseEngineSchema, ToolMockSchema, } from "./test-case.js";
31
31
  // Pagination utility
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retell-utils",
3
- "version": "0.4.5",
3
+ "version": "0.5.0",
4
4
  "description": "Type-safe Zod schemas for Retell AI API resources with lifecycle-aware discriminated unions and generic customization",
5
5
  "type": "module",
6
6
  "zshy": {