retell-sync-cli 3.14.0 → 3.14.1
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/cli.js +113 -33
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -113947,32 +113947,102 @@ var GlobalNodeSettingSchema = exports_external.object({
|
|
|
113947
113947
|
negative_finetune_examples: exports_external.array(FinetuneExampleSchema).optional(),
|
|
113948
113948
|
cool_down: exports_external.number().optional()
|
|
113949
113949
|
});
|
|
113950
|
-
var
|
|
113951
|
-
|
|
113952
|
-
|
|
113953
|
-
|
|
113954
|
-
|
|
113955
|
-
|
|
113956
|
-
|
|
113957
|
-
|
|
113958
|
-
|
|
113959
|
-
|
|
113960
|
-
|
|
113961
|
-
|
|
113962
|
-
|
|
113950
|
+
var InstructionSchema = exports_external.object({
|
|
113951
|
+
type: FlowInstructionTypeSchema,
|
|
113952
|
+
text: exports_external.string()
|
|
113953
|
+
});
|
|
113954
|
+
var baseNodeFields = {
|
|
113955
|
+
id: exports_external.string(),
|
|
113956
|
+
name: exports_external.string(),
|
|
113957
|
+
display_position: DisplayPositionSchema.default({ x: 0, y: 0 })
|
|
113958
|
+
};
|
|
113959
|
+
var ConversationNodeSchema = exports_external.object({
|
|
113960
|
+
...baseNodeFields,
|
|
113961
|
+
type: exports_external.literal("conversation"),
|
|
113962
|
+
instruction: InstructionSchema,
|
|
113963
|
+
edges: exports_external.array(FlowEdgeSchema),
|
|
113963
113964
|
always_edge: FlowEdgeSchema.optional(),
|
|
113965
|
+
skip_response_edge: FlowEdgeSchema.optional(),
|
|
113964
113966
|
start_speaker: StartSpeakerSchema.optional(),
|
|
113965
113967
|
interruption_sensitivity: exports_external.number().optional(),
|
|
113966
113968
|
global_node_setting: GlobalNodeSettingSchema.optional(),
|
|
113967
113969
|
finetune_transition_examples: exports_external.array(FinetuneExampleSchema).nullable().optional(),
|
|
113968
|
-
finetune_conversation_examples: exports_external.array(FinetuneExampleSchema).nullable().optional()
|
|
113969
|
-
|
|
113970
|
-
|
|
113971
|
-
|
|
113972
|
-
|
|
113973
|
-
|
|
113974
|
-
|
|
113970
|
+
finetune_conversation_examples: exports_external.array(FinetuneExampleSchema).nullable().optional()
|
|
113971
|
+
});
|
|
113972
|
+
var EndNodeSchema = exports_external.object({
|
|
113973
|
+
...baseNodeFields,
|
|
113974
|
+
type: exports_external.literal("end"),
|
|
113975
|
+
instruction: InstructionSchema.optional(),
|
|
113976
|
+
speak_during_execution: exports_external.boolean().default(false)
|
|
113977
|
+
});
|
|
113978
|
+
var FunctionNodeSchema = exports_external.object({
|
|
113979
|
+
...baseNodeFields,
|
|
113980
|
+
type: exports_external.literal("function"),
|
|
113981
|
+
instruction: InstructionSchema.optional(),
|
|
113982
|
+
tool_id: exports_external.string(),
|
|
113983
|
+
tool_type: exports_external.string(),
|
|
113984
|
+
speak_during_execution: exports_external.boolean().default(false),
|
|
113985
|
+
wait_for_result: exports_external.boolean(),
|
|
113986
|
+
edges: exports_external.array(FlowEdgeSchema),
|
|
113987
|
+
else_edge: FlowEdgeSchema.optional(),
|
|
113988
|
+
global_node_setting: GlobalNodeSettingSchema.optional()
|
|
113989
|
+
});
|
|
113990
|
+
var TransferCallNodeSchema = exports_external.object({
|
|
113991
|
+
...baseNodeFields,
|
|
113992
|
+
type: exports_external.literal("transfer_call"),
|
|
113993
|
+
instruction: InstructionSchema,
|
|
113994
|
+
transfer_destination: TransferDestinationSchema,
|
|
113995
|
+
transfer_option: TransferOptionSchema,
|
|
113996
|
+
speak_during_execution: exports_external.boolean().default(false),
|
|
113997
|
+
edge: FlowEdgeSchema
|
|
113975
113998
|
});
|
|
113999
|
+
var BranchNodeSchema = exports_external.object({
|
|
114000
|
+
...baseNodeFields,
|
|
114001
|
+
type: exports_external.literal("branch"),
|
|
114002
|
+
edges: exports_external.array(FlowEdgeSchema),
|
|
114003
|
+
else_edge: FlowEdgeSchema
|
|
114004
|
+
});
|
|
114005
|
+
var ComponentNodeSchema = exports_external.object({
|
|
114006
|
+
...baseNodeFields,
|
|
114007
|
+
type: exports_external.literal("component"),
|
|
114008
|
+
component_id: exports_external.string(),
|
|
114009
|
+
component_type: exports_external.string(),
|
|
114010
|
+
edges: exports_external.array(FlowEdgeSchema),
|
|
114011
|
+
else_edge: FlowEdgeSchema.optional()
|
|
114012
|
+
});
|
|
114013
|
+
var PressDigitNodeSchema = exports_external.looseObject({
|
|
114014
|
+
...baseNodeFields,
|
|
114015
|
+
type: exports_external.literal("press_digit")
|
|
114016
|
+
});
|
|
114017
|
+
var SmsNodeSchema = exports_external.looseObject({
|
|
114018
|
+
...baseNodeFields,
|
|
114019
|
+
type: exports_external.literal("sms")
|
|
114020
|
+
});
|
|
114021
|
+
var ExtractDynamicVariablesNodeSchema = exports_external.looseObject({
|
|
114022
|
+
...baseNodeFields,
|
|
114023
|
+
type: exports_external.literal("extract_dynamic_variables")
|
|
114024
|
+
});
|
|
114025
|
+
var AgentSwapNodeSchema = exports_external.looseObject({
|
|
114026
|
+
...baseNodeFields,
|
|
114027
|
+
type: exports_external.literal("agent_swap")
|
|
114028
|
+
});
|
|
114029
|
+
var McpNodeSchema = exports_external.looseObject({
|
|
114030
|
+
...baseNodeFields,
|
|
114031
|
+
type: exports_external.literal("mcp")
|
|
114032
|
+
});
|
|
114033
|
+
var FlowNodeSchema = exports_external.discriminatedUnion("type", [
|
|
114034
|
+
ConversationNodeSchema,
|
|
114035
|
+
EndNodeSchema,
|
|
114036
|
+
FunctionNodeSchema,
|
|
114037
|
+
TransferCallNodeSchema,
|
|
114038
|
+
BranchNodeSchema,
|
|
114039
|
+
ComponentNodeSchema,
|
|
114040
|
+
PressDigitNodeSchema,
|
|
114041
|
+
SmsNodeSchema,
|
|
114042
|
+
ExtractDynamicVariablesNodeSchema,
|
|
114043
|
+
AgentSwapNodeSchema,
|
|
114044
|
+
McpNodeSchema
|
|
114045
|
+
]);
|
|
113976
114046
|
var FlowComponentSchema = exports_external.object({
|
|
113977
114047
|
conversation_flow_component_id: exports_external.string().optional(),
|
|
113978
114048
|
name: exports_external.string().optional(),
|
|
@@ -133760,18 +133830,30 @@ function createFlowVisualization(current, previous, next) {
|
|
|
133760
133830
|
}
|
|
133761
133831
|
|
|
133762
133832
|
// src/lib/flow-helpers.ts
|
|
133833
|
+
function collectEdges(node) {
|
|
133834
|
+
switch (node.type) {
|
|
133835
|
+
case "conversation":
|
|
133836
|
+
return [
|
|
133837
|
+
...node.edges ?? [],
|
|
133838
|
+
...node.always_edge ? [node.always_edge] : []
|
|
133839
|
+
];
|
|
133840
|
+
case "function":
|
|
133841
|
+
case "branch":
|
|
133842
|
+
case "component":
|
|
133843
|
+
return node.edges ?? [];
|
|
133844
|
+
case "transfer_call":
|
|
133845
|
+
return node.edge ? [node.edge] : [];
|
|
133846
|
+
default:
|
|
133847
|
+
return [];
|
|
133848
|
+
}
|
|
133849
|
+
}
|
|
133763
133850
|
async function extractNodePrompts(nodes, dirPath, files) {
|
|
133764
133851
|
const nodeNameById = new Map;
|
|
133765
133852
|
const incomingEdges = new Map;
|
|
133766
133853
|
for (const n8 of nodes) {
|
|
133767
133854
|
if (n8.id && n8.name)
|
|
133768
133855
|
nodeNameById.set(n8.id, n8.name);
|
|
133769
|
-
const
|
|
133770
|
-
...n8.edges ?? [],
|
|
133771
|
-
...n8.edge ? [n8.edge] : [],
|
|
133772
|
-
...n8.always_edge ? [n8.always_edge] : []
|
|
133773
|
-
];
|
|
133774
|
-
for (const edge of allEdges) {
|
|
133856
|
+
for (const edge of collectEdges(n8)) {
|
|
133775
133857
|
const destId = edge.destination_node_id;
|
|
133776
133858
|
if (destId) {
|
|
133777
133859
|
if (!incomingEdges.has(destId))
|
|
@@ -133782,16 +133864,14 @@ async function extractNodePrompts(nodes, dirPath, files) {
|
|
|
133782
133864
|
}
|
|
133783
133865
|
}
|
|
133784
133866
|
for (const node of nodes) {
|
|
133785
|
-
if (node.
|
|
133867
|
+
if (node.type === "conversation" && node.id && node.instruction?.type === "prompt" && typeof node.instruction.text === "string" && !node.instruction.text.startsWith("file://")) {
|
|
133786
133868
|
const nodeHash = node.id.slice(-FILE_HASH_LENGTH);
|
|
133787
133869
|
const nodeName = node.name ? `${toSnakeCase(node.name)}_${nodeHash}` : `${node.type}_${nodeHash}`;
|
|
133788
133870
|
const nodeFileName = `nodes/${nodeName}.md`;
|
|
133789
|
-
const previous =
|
|
133790
|
-
const nodeEdges = node.edges;
|
|
133791
|
-
const nodeAlwaysEdge = node.always_edge;
|
|
133871
|
+
const previous = incomingEdges.get(node.id) ?? [];
|
|
133792
133872
|
const next = [
|
|
133793
|
-
...
|
|
133794
|
-
...
|
|
133873
|
+
...node.edges ?? [],
|
|
133874
|
+
...node.always_edge ? [node.always_edge] : []
|
|
133795
133875
|
].map((e31) => e31.destination_node_id ? nodeNameById.get(e31.destination_node_id) : undefined).filter((name) => !!name);
|
|
133796
133876
|
const flowViz = node.name ? createFlowVisualization(node.name, previous, next) : undefined;
|
|
133797
133877
|
files[path15.join(dirPath, nodeFileName)] = await writeMarkdown(node.instruction.text, { nodeId: node.id, flow: flowViz });
|
|
@@ -134393,7 +134473,7 @@ async function getLocalTestCases(agentDirPath) {
|
|
|
134393
134473
|
}
|
|
134394
134474
|
const metaContent = await metaFile.text();
|
|
134395
134475
|
const metadata = readJson2(metaContent, zod_default.object({
|
|
134396
|
-
response_engine: zod_default.
|
|
134476
|
+
response_engine: zod_default.looseObject({}),
|
|
134397
134477
|
test_cases: zod_default.array(zod_default.object({
|
|
134398
134478
|
id: zod_default.string(),
|
|
134399
134479
|
name: zod_default.string()
|