chatbot-lex-design-builder 1.0.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/cjs/compile-graph-to-lex.d.ts +3 -0
- package/dist/cjs/compile-graph-to-lex.js +35 -0
- package/dist/cjs/compile-graph-to-lex.js.map +1 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +43 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types/edges/edge.d.ts +21 -0
- package/dist/cjs/types/edges/edge.js +12 -0
- package/dist/cjs/types/edges/edge.js.map +1 -0
- package/dist/cjs/types/edges/index.d.ts +1 -0
- package/dist/cjs/types/edges/index.js +18 -0
- package/dist/cjs/types/edges/index.js.map +1 -0
- package/dist/cjs/types/graph/graph.d.ts +2245 -0
- package/dist/cjs/types/graph/graph.js +11 -0
- package/dist/cjs/types/graph/graph.js.map +1 -0
- package/dist/cjs/types/graph/index.d.ts +1 -0
- package/dist/cjs/types/graph/index.js +18 -0
- package/dist/cjs/types/graph/index.js.map +1 -0
- package/dist/cjs/types/nodes/closing-response-node.d.ts +201 -0
- package/dist/cjs/types/nodes/closing-response-node.js +16 -0
- package/dist/cjs/types/nodes/closing-response-node.js.map +1 -0
- package/dist/cjs/types/nodes/codehook-node.d.ts +552 -0
- package/dist/cjs/types/nodes/codehook-node.js +20 -0
- package/dist/cjs/types/nodes/codehook-node.js.map +1 -0
- package/dist/cjs/types/nodes/condition-node.d.ts +525 -0
- package/dist/cjs/types/nodes/condition-node.js +22 -0
- package/dist/cjs/types/nodes/condition-node.js.map +1 -0
- package/dist/cjs/types/nodes/confirmation-node.d.ts +748 -0
- package/dist/cjs/types/nodes/confirmation-node.js +19 -0
- package/dist/cjs/types/nodes/confirmation-node.js.map +1 -0
- package/dist/cjs/types/nodes/end-of-conversation-node.d.ts +19 -0
- package/dist/cjs/types/nodes/end-of-conversation-node.js +12 -0
- package/dist/cjs/types/nodes/end-of-conversation-node.js.map +1 -0
- package/dist/cjs/types/nodes/fullfillment-node.d.ts +552 -0
- package/dist/cjs/types/nodes/fullfillment-node.js +20 -0
- package/dist/cjs/types/nodes/fullfillment-node.js.map +1 -0
- package/dist/cjs/types/nodes/go-to-intent-node.d.ts +34 -0
- package/dist/cjs/types/nodes/go-to-intent-node.js +14 -0
- package/dist/cjs/types/nodes/go-to-intent-node.js.map +1 -0
- package/dist/cjs/types/nodes/index.d.ts +10 -0
- package/dist/cjs/types/nodes/index.js +27 -0
- package/dist/cjs/types/nodes/index.js.map +1 -0
- package/dist/cjs/types/nodes/intent-node.d.ts +59 -0
- package/dist/cjs/types/nodes/intent-node.js +17 -0
- package/dist/cjs/types/nodes/intent-node.js.map +1 -0
- package/dist/cjs/types/nodes/node-type.d.ts +11 -0
- package/dist/cjs/types/nodes/node-type.js +16 -0
- package/dist/cjs/types/nodes/node-type.js.map +1 -0
- package/dist/cjs/types/nodes/node.d.ts +1788 -0
- package/dist/cjs/types/nodes/node.js +25 -0
- package/dist/cjs/types/nodes/node.js.map +1 -0
- package/dist/cjs/types/nodes/slot-node.d.ts +576 -0
- package/dist/cjs/types/nodes/slot-node.js +23 -0
- package/dist/cjs/types/nodes/slot-node.js.map +1 -0
- package/dist/cjs/types/others/bot-flow.d.ts +5839 -0
- package/dist/cjs/types/others/bot-flow.js +14 -0
- package/dist/cjs/types/others/bot-flow.js.map +1 -0
- package/dist/cjs/types/others/file-and-folder.d.ts +9 -0
- package/dist/cjs/types/others/file-and-folder.js +3 -0
- package/dist/cjs/types/others/file-and-folder.js.map +1 -0
- package/dist/cjs/types/others/flow-detail.d.ts +12 -0
- package/dist/cjs/types/others/flow-detail.js +3 -0
- package/dist/cjs/types/others/flow-detail.js.map +1 -0
- package/dist/cjs/types/others/index.d.ts +5 -0
- package/dist/cjs/types/others/index.js +22 -0
- package/dist/cjs/types/others/index.js.map +1 -0
- package/dist/cjs/types/others/lex-export-options.d.ts +4 -0
- package/dist/cjs/types/others/lex-export-options.js +3 -0
- package/dist/cjs/types/others/lex-export-options.js.map +1 -0
- package/dist/cjs/types/others/lex-exporter.d.ts +2 -0
- package/dist/cjs/types/others/lex-exporter.js +3 -0
- package/dist/cjs/types/others/lex-exporter.js.map +1 -0
- package/dist/cjs/types/responses/index.d.ts +4 -0
- package/dist/cjs/types/responses/index.js +21 -0
- package/dist/cjs/types/responses/index.js.map +1 -0
- package/dist/cjs/types/responses/message-type.d.ts +4 -0
- package/dist/cjs/types/responses/message-type.js +9 -0
- package/dist/cjs/types/responses/message-type.js.map +1 -0
- package/dist/cjs/types/responses/message.d.ts +60 -0
- package/dist/cjs/types/responses/message.js +11 -0
- package/dist/cjs/types/responses/message.js.map +1 -0
- package/dist/cjs/types/responses/text-message-button.d.ts +70 -0
- package/dist/cjs/types/responses/text-message-button.js +22 -0
- package/dist/cjs/types/responses/text-message-button.js.map +1 -0
- package/dist/cjs/types/responses/text-message.d.ts +16 -0
- package/dist/cjs/types/responses/text-message.js +14 -0
- package/dist/cjs/types/responses/text-message.js.map +1 -0
- package/dist/cjs/utils/compile-flow-to-flowdetail.d.ts +2 -0
- package/dist/cjs/utils/compile-flow-to-flowdetail.js +9 -0
- package/dist/cjs/utils/compile-flow-to-flowdetail.js.map +1 -0
- package/dist/cjs/utils/file-exporter.d.ts +8 -0
- package/dist/cjs/utils/file-exporter.js +37 -0
- package/dist/cjs/utils/file-exporter.js.map +1 -0
- package/dist/cjs/utils/find-first-fullfillment-node.d.ts +59 -0
- package/dist/cjs/utils/find-first-fullfillment-node.js +9 -0
- package/dist/cjs/utils/find-first-fullfillment-node.js.map +1 -0
- package/dist/cjs/utils/find-first-intent-node.d.ts +12 -0
- package/dist/cjs/utils/find-first-intent-node.js +9 -0
- package/dist/cjs/utils/find-first-intent-node.js.map +1 -0
- package/dist/cjs/utils/generate-response.d.ts +15 -0
- package/dist/cjs/utils/generate-response.js +14 -0
- package/dist/cjs/utils/generate-response.js.map +1 -0
- package/dist/cjs/utils/get-bfs-order.d.ts +333 -0
- package/dist/cjs/utils/get-bfs-order.js +18 -0
- package/dist/cjs/utils/get-bfs-order.js.map +1 -0
- package/dist/cjs/utils/get-end-of-conversation-node.d.ts +6 -0
- package/dist/cjs/utils/get-end-of-conversation-node.js +16 -0
- package/dist/cjs/utils/get-end-of-conversation-node.js.map +1 -0
- package/dist/cjs/utils/get-first-closing-response-node.d.ts +25 -0
- package/dist/cjs/utils/get-first-closing-response-node.js +9 -0
- package/dist/cjs/utils/get-first-closing-response-node.js.map +1 -0
- package/dist/cjs/utils/get-first-confirmation-node.d.ts +73 -0
- package/dist/cjs/utils/get-first-confirmation-node.js +9 -0
- package/dist/cjs/utils/get-first-confirmation-node.js.map +1 -0
- package/dist/cjs/utils/get-message.d.ts +12 -0
- package/dist/cjs/utils/get-message.js +16 -0
- package/dist/cjs/utils/get-message.js.map +1 -0
- package/dist/cjs/utils/get-next-step.d.ts +36 -0
- package/dist/cjs/utils/get-next-step.js +98 -0
- package/dist/cjs/utils/get-next-step.js.map +1 -0
- package/dist/cjs/utils/get-prompt-attempt-specification.d.ts +117 -0
- package/dist/cjs/utils/get-prompt-attempt-specification.js +99 -0
- package/dist/cjs/utils/get-prompt-attempt-specification.js.map +1 -0
- package/dist/cjs/utils/get-slot-nodes.d.ts +62 -0
- package/dist/cjs/utils/get-slot-nodes.js +9 -0
- package/dist/cjs/utils/get-slot-nodes.js.map +1 -0
- package/dist/cjs/utils/get-utterances.d.ts +3 -0
- package/dist/cjs/utils/get-utterances.js +12 -0
- package/dist/cjs/utils/get-utterances.js.map +1 -0
- package/dist/cjs/utils/index.d.ts +17 -0
- package/dist/cjs/utils/index.js +34 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/lex-zip-exporter.d.ts +2 -0
- package/dist/cjs/utils/lex-zip-exporter.js +3 -0
- package/dist/cjs/utils/lex-zip-exporter.js.map +1 -0
- package/dist/cjs/utils/node-builders/build-closing-response.d.ts +3 -0
- package/dist/cjs/utils/node-builders/build-closing-response.js +78 -0
- package/dist/cjs/utils/node-builders/build-closing-response.js.map +1 -0
- package/dist/cjs/utils/node-builders/build-confirmation.d.ts +3 -0
- package/dist/cjs/utils/node-builders/build-confirmation.js +204 -0
- package/dist/cjs/utils/node-builders/build-confirmation.js.map +1 -0
- package/dist/cjs/utils/node-builders/build-fullfillment.d.ts +3 -0
- package/dist/cjs/utils/node-builders/build-fullfillment.js +112 -0
- package/dist/cjs/utils/node-builders/build-fullfillment.js.map +1 -0
- package/dist/cjs/utils/node-builders/build-initial-response.d.ts +3 -0
- package/dist/cjs/utils/node-builders/build-initial-response.js +155 -0
- package/dist/cjs/utils/node-builders/build-initial-response.js.map +1 -0
- package/dist/cjs/utils/node-builders/build-intent.d.ts +60 -0
- package/dist/cjs/utils/node-builders/build-intent.js +73 -0
- package/dist/cjs/utils/node-builders/build-intent.js.map +1 -0
- package/dist/cjs/utils/node-builders/build-slot.d.ts +3 -0
- package/dist/cjs/utils/node-builders/build-slot.js +198 -0
- package/dist/cjs/utils/node-builders/build-slot.js.map +1 -0
- package/dist/cjs/utils/node-builders/index.d.ts +6 -0
- package/dist/cjs/utils/node-builders/index.js +23 -0
- package/dist/cjs/utils/node-builders/index.js.map +1 -0
- package/dist/cjs/utils/transform-flow-detail-to-file-and-folder.d.ts +4 -0
- package/dist/cjs/utils/transform-flow-detail-to-file-and-folder.js +141 -0
- package/dist/cjs/utils/transform-flow-detail-to-file-and-folder.js.map +1 -0
- package/dist/cjs/utils/validate-graph.d.ts +341 -0
- package/dist/cjs/utils/validate-graph.js +13 -0
- package/dist/cjs/utils/validate-graph.js.map +1 -0
- package/dist/esm/compile-graph-to-lex.d.ts +3 -0
- package/dist/esm/compile-graph-to-lex.js +28 -0
- package/dist/esm/compile-graph-to-lex.js.map +1 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types/edges/edge.d.ts +21 -0
- package/dist/esm/types/edges/edge.js +9 -0
- package/dist/esm/types/edges/edge.js.map +1 -0
- package/dist/esm/types/edges/index.d.ts +1 -0
- package/dist/esm/types/edges/index.js +2 -0
- package/dist/esm/types/edges/index.js.map +1 -0
- package/dist/esm/types/graph/graph.d.ts +2245 -0
- package/dist/esm/types/graph/graph.js +8 -0
- package/dist/esm/types/graph/graph.js.map +1 -0
- package/dist/esm/types/graph/index.d.ts +1 -0
- package/dist/esm/types/graph/index.js +2 -0
- package/dist/esm/types/graph/index.js.map +1 -0
- package/dist/esm/types/nodes/closing-response-node.d.ts +201 -0
- package/dist/esm/types/nodes/closing-response-node.js +13 -0
- package/dist/esm/types/nodes/closing-response-node.js.map +1 -0
- package/dist/esm/types/nodes/codehook-node.d.ts +552 -0
- package/dist/esm/types/nodes/codehook-node.js +17 -0
- package/dist/esm/types/nodes/codehook-node.js.map +1 -0
- package/dist/esm/types/nodes/condition-node.d.ts +525 -0
- package/dist/esm/types/nodes/condition-node.js +19 -0
- package/dist/esm/types/nodes/condition-node.js.map +1 -0
- package/dist/esm/types/nodes/confirmation-node.d.ts +748 -0
- package/dist/esm/types/nodes/confirmation-node.js +16 -0
- package/dist/esm/types/nodes/confirmation-node.js.map +1 -0
- package/dist/esm/types/nodes/end-of-conversation-node.d.ts +19 -0
- package/dist/esm/types/nodes/end-of-conversation-node.js +9 -0
- package/dist/esm/types/nodes/end-of-conversation-node.js.map +1 -0
- package/dist/esm/types/nodes/fullfillment-node.d.ts +552 -0
- package/dist/esm/types/nodes/fullfillment-node.js +17 -0
- package/dist/esm/types/nodes/fullfillment-node.js.map +1 -0
- package/dist/esm/types/nodes/go-to-intent-node.d.ts +34 -0
- package/dist/esm/types/nodes/go-to-intent-node.js +11 -0
- package/dist/esm/types/nodes/go-to-intent-node.js.map +1 -0
- package/dist/esm/types/nodes/index.d.ts +10 -0
- package/dist/esm/types/nodes/index.js +11 -0
- package/dist/esm/types/nodes/index.js.map +1 -0
- package/dist/esm/types/nodes/intent-node.d.ts +59 -0
- package/dist/esm/types/nodes/intent-node.js +14 -0
- package/dist/esm/types/nodes/intent-node.js.map +1 -0
- package/dist/esm/types/nodes/node-type.d.ts +11 -0
- package/dist/esm/types/nodes/node-type.js +13 -0
- package/dist/esm/types/nodes/node-type.js.map +1 -0
- package/dist/esm/types/nodes/node.d.ts +1788 -0
- package/dist/esm/types/nodes/node.js +22 -0
- package/dist/esm/types/nodes/node.js.map +1 -0
- package/dist/esm/types/nodes/slot-node.d.ts +576 -0
- package/dist/esm/types/nodes/slot-node.js +20 -0
- package/dist/esm/types/nodes/slot-node.js.map +1 -0
- package/dist/esm/types/others/bot-flow.d.ts +5839 -0
- package/dist/esm/types/others/bot-flow.js +12 -0
- package/dist/esm/types/others/bot-flow.js.map +1 -0
- package/dist/esm/types/others/file-and-folder.d.ts +9 -0
- package/dist/esm/types/others/file-and-folder.js +2 -0
- package/dist/esm/types/others/file-and-folder.js.map +1 -0
- package/dist/esm/types/others/flow-detail.d.ts +12 -0
- package/dist/esm/types/others/flow-detail.js +2 -0
- package/dist/esm/types/others/flow-detail.js.map +1 -0
- package/dist/esm/types/others/index.d.ts +5 -0
- package/dist/esm/types/others/index.js +6 -0
- package/dist/esm/types/others/index.js.map +1 -0
- package/dist/esm/types/others/lex-export-options.d.ts +4 -0
- package/dist/esm/types/others/lex-export-options.js +2 -0
- package/dist/esm/types/others/lex-export-options.js.map +1 -0
- package/dist/esm/types/others/lex-exporter.d.ts +2 -0
- package/dist/esm/types/others/lex-exporter.js +2 -0
- package/dist/esm/types/others/lex-exporter.js.map +1 -0
- package/dist/esm/types/responses/index.d.ts +4 -0
- package/dist/esm/types/responses/index.js +5 -0
- package/dist/esm/types/responses/index.js.map +1 -0
- package/dist/esm/types/responses/message-type.d.ts +4 -0
- package/dist/esm/types/responses/message-type.js +6 -0
- package/dist/esm/types/responses/message-type.js.map +1 -0
- package/dist/esm/types/responses/message.d.ts +60 -0
- package/dist/esm/types/responses/message.js +8 -0
- package/dist/esm/types/responses/message.js.map +1 -0
- package/dist/esm/types/responses/text-message-button.d.ts +70 -0
- package/dist/esm/types/responses/text-message-button.js +16 -0
- package/dist/esm/types/responses/text-message-button.js.map +1 -0
- package/dist/esm/types/responses/text-message.d.ts +16 -0
- package/dist/esm/types/responses/text-message.js +8 -0
- package/dist/esm/types/responses/text-message.js.map +1 -0
- package/dist/esm/utils/compile-flow-to-flowdetail.d.ts +2 -0
- package/dist/esm/utils/compile-flow-to-flowdetail.js +5 -0
- package/dist/esm/utils/compile-flow-to-flowdetail.js.map +1 -0
- package/dist/esm/utils/file-exporter.d.ts +8 -0
- package/dist/esm/utils/file-exporter.js +30 -0
- package/dist/esm/utils/file-exporter.js.map +1 -0
- package/dist/esm/utils/find-first-fullfillment-node.d.ts +59 -0
- package/dist/esm/utils/find-first-fullfillment-node.js +5 -0
- package/dist/esm/utils/find-first-fullfillment-node.js.map +1 -0
- package/dist/esm/utils/find-first-intent-node.d.ts +12 -0
- package/dist/esm/utils/find-first-intent-node.js +5 -0
- package/dist/esm/utils/find-first-intent-node.js.map +1 -0
- package/dist/esm/utils/generate-response.d.ts +15 -0
- package/dist/esm/utils/generate-response.js +10 -0
- package/dist/esm/utils/generate-response.js.map +1 -0
- package/dist/esm/utils/get-bfs-order.d.ts +333 -0
- package/dist/esm/utils/get-bfs-order.js +16 -0
- package/dist/esm/utils/get-bfs-order.js.map +1 -0
- package/dist/esm/utils/get-end-of-conversation-node.d.ts +6 -0
- package/dist/esm/utils/get-end-of-conversation-node.js +12 -0
- package/dist/esm/utils/get-end-of-conversation-node.js.map +1 -0
- package/dist/esm/utils/get-first-closing-response-node.d.ts +25 -0
- package/dist/esm/utils/get-first-closing-response-node.js +5 -0
- package/dist/esm/utils/get-first-closing-response-node.js.map +1 -0
- package/dist/esm/utils/get-first-confirmation-node.d.ts +73 -0
- package/dist/esm/utils/get-first-confirmation-node.js +5 -0
- package/dist/esm/utils/get-first-confirmation-node.js.map +1 -0
- package/dist/esm/utils/get-message.d.ts +12 -0
- package/dist/esm/utils/get-message.js +12 -0
- package/dist/esm/utils/get-message.js.map +1 -0
- package/dist/esm/utils/get-next-step.d.ts +36 -0
- package/dist/esm/utils/get-next-step.js +94 -0
- package/dist/esm/utils/get-next-step.js.map +1 -0
- package/dist/esm/utils/get-prompt-attempt-specification.d.ts +117 -0
- package/dist/esm/utils/get-prompt-attempt-specification.js +95 -0
- package/dist/esm/utils/get-prompt-attempt-specification.js.map +1 -0
- package/dist/esm/utils/get-slot-nodes.d.ts +62 -0
- package/dist/esm/utils/get-slot-nodes.js +5 -0
- package/dist/esm/utils/get-slot-nodes.js.map +1 -0
- package/dist/esm/utils/get-utterances.d.ts +3 -0
- package/dist/esm/utils/get-utterances.js +8 -0
- package/dist/esm/utils/get-utterances.js.map +1 -0
- package/dist/esm/utils/index.d.ts +17 -0
- package/dist/esm/utils/index.js +18 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/lex-zip-exporter.d.ts +2 -0
- package/dist/esm/utils/lex-zip-exporter.js +2 -0
- package/dist/esm/utils/lex-zip-exporter.js.map +1 -0
- package/dist/esm/utils/node-builders/build-closing-response.d.ts +3 -0
- package/dist/esm/utils/node-builders/build-closing-response.js +74 -0
- package/dist/esm/utils/node-builders/build-closing-response.js.map +1 -0
- package/dist/esm/utils/node-builders/build-confirmation.d.ts +3 -0
- package/dist/esm/utils/node-builders/build-confirmation.js +200 -0
- package/dist/esm/utils/node-builders/build-confirmation.js.map +1 -0
- package/dist/esm/utils/node-builders/build-fullfillment.d.ts +3 -0
- package/dist/esm/utils/node-builders/build-fullfillment.js +108 -0
- package/dist/esm/utils/node-builders/build-fullfillment.js.map +1 -0
- package/dist/esm/utils/node-builders/build-initial-response.d.ts +3 -0
- package/dist/esm/utils/node-builders/build-initial-response.js +151 -0
- package/dist/esm/utils/node-builders/build-initial-response.js.map +1 -0
- package/dist/esm/utils/node-builders/build-intent.d.ts +60 -0
- package/dist/esm/utils/node-builders/build-intent.js +65 -0
- package/dist/esm/utils/node-builders/build-intent.js.map +1 -0
- package/dist/esm/utils/node-builders/build-slot.d.ts +3 -0
- package/dist/esm/utils/node-builders/build-slot.js +194 -0
- package/dist/esm/utils/node-builders/build-slot.js.map +1 -0
- package/dist/esm/utils/node-builders/index.d.ts +6 -0
- package/dist/esm/utils/node-builders/index.js +7 -0
- package/dist/esm/utils/node-builders/index.js.map +1 -0
- package/dist/esm/utils/transform-flow-detail-to-file-and-folder.d.ts +4 -0
- package/dist/esm/utils/transform-flow-detail-to-file-and-folder.js +137 -0
- package/dist/esm/utils/transform-flow-detail-to-file-and-folder.js.map +1 -0
- package/dist/esm/utils/validate-graph.d.ts +341 -0
- package/dist/esm/utils/validate-graph.js +11 -0
- package/dist/esm/utils/validate-graph.js.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export declare function getPromptAttemptsSpecification(): {
|
|
2
|
+
Retry1: {
|
|
3
|
+
allowedInputTypes: {
|
|
4
|
+
allowAudioInput: boolean;
|
|
5
|
+
allowDTMFInput: boolean;
|
|
6
|
+
};
|
|
7
|
+
audioAndDTMFInputSpecification: {
|
|
8
|
+
dtmfSpecification: {
|
|
9
|
+
maxLength: number;
|
|
10
|
+
deletionCharacter: string;
|
|
11
|
+
endCharacter: string;
|
|
12
|
+
endTimeoutMs: number;
|
|
13
|
+
};
|
|
14
|
+
startTimeoutMs: number;
|
|
15
|
+
audioSpecification: {
|
|
16
|
+
maxLengthMs: number;
|
|
17
|
+
endTimeoutMs: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
allowInterrupt: boolean;
|
|
21
|
+
textInputSpecification: {
|
|
22
|
+
startTimeoutMs: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
Retry4: {
|
|
26
|
+
allowedInputTypes: {
|
|
27
|
+
allowAudioInput: boolean;
|
|
28
|
+
allowDTMFInput: boolean;
|
|
29
|
+
};
|
|
30
|
+
audioAndDTMFInputSpecification: {
|
|
31
|
+
dtmfSpecification: {
|
|
32
|
+
maxLength: number;
|
|
33
|
+
deletionCharacter: string;
|
|
34
|
+
endCharacter: string;
|
|
35
|
+
endTimeoutMs: number;
|
|
36
|
+
};
|
|
37
|
+
startTimeoutMs: number;
|
|
38
|
+
audioSpecification: {
|
|
39
|
+
maxLengthMs: number;
|
|
40
|
+
endTimeoutMs: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
allowInterrupt: boolean;
|
|
44
|
+
textInputSpecification: {
|
|
45
|
+
startTimeoutMs: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
Retry2: {
|
|
49
|
+
allowedInputTypes: {
|
|
50
|
+
allowAudioInput: boolean;
|
|
51
|
+
allowDTMFInput: boolean;
|
|
52
|
+
};
|
|
53
|
+
audioAndDTMFInputSpecification: {
|
|
54
|
+
dtmfSpecification: {
|
|
55
|
+
maxLength: number;
|
|
56
|
+
deletionCharacter: string;
|
|
57
|
+
endCharacter: string;
|
|
58
|
+
endTimeoutMs: number;
|
|
59
|
+
};
|
|
60
|
+
startTimeoutMs: number;
|
|
61
|
+
audioSpecification: {
|
|
62
|
+
maxLengthMs: number;
|
|
63
|
+
endTimeoutMs: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
allowInterrupt: boolean;
|
|
67
|
+
textInputSpecification: {
|
|
68
|
+
startTimeoutMs: number;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
Initial: {
|
|
72
|
+
allowedInputTypes: {
|
|
73
|
+
allowAudioInput: boolean;
|
|
74
|
+
allowDTMFInput: boolean;
|
|
75
|
+
};
|
|
76
|
+
audioAndDTMFInputSpecification: {
|
|
77
|
+
dtmfSpecification: {
|
|
78
|
+
maxLength: number;
|
|
79
|
+
deletionCharacter: string;
|
|
80
|
+
endCharacter: string;
|
|
81
|
+
endTimeoutMs: number;
|
|
82
|
+
};
|
|
83
|
+
startTimeoutMs: number;
|
|
84
|
+
audioSpecification: {
|
|
85
|
+
maxLengthMs: number;
|
|
86
|
+
endTimeoutMs: number;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
allowInterrupt: boolean;
|
|
90
|
+
textInputSpecification: {
|
|
91
|
+
startTimeoutMs: number;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
Retry3: {
|
|
95
|
+
allowedInputTypes: {
|
|
96
|
+
allowAudioInput: boolean;
|
|
97
|
+
allowDTMFInput: boolean;
|
|
98
|
+
};
|
|
99
|
+
audioAndDTMFInputSpecification: {
|
|
100
|
+
dtmfSpecification: {
|
|
101
|
+
maxLength: number;
|
|
102
|
+
deletionCharacter: string;
|
|
103
|
+
endCharacter: string;
|
|
104
|
+
endTimeoutMs: number;
|
|
105
|
+
};
|
|
106
|
+
startTimeoutMs: number;
|
|
107
|
+
audioSpecification: {
|
|
108
|
+
maxLengthMs: number;
|
|
109
|
+
endTimeoutMs: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
allowInterrupt: boolean;
|
|
113
|
+
textInputSpecification: {
|
|
114
|
+
startTimeoutMs: number;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export function getPromptAttemptsSpecification() {
|
|
2
|
+
return {
|
|
3
|
+
Retry1: {
|
|
4
|
+
allowedInputTypes: {
|
|
5
|
+
allowAudioInput: true,
|
|
6
|
+
allowDTMFInput: true,
|
|
7
|
+
},
|
|
8
|
+
audioAndDTMFInputSpecification: {
|
|
9
|
+
dtmfSpecification: {
|
|
10
|
+
maxLength: 513,
|
|
11
|
+
deletionCharacter: "*",
|
|
12
|
+
endCharacter: "#",
|
|
13
|
+
endTimeoutMs: 5000,
|
|
14
|
+
},
|
|
15
|
+
startTimeoutMs: 4000,
|
|
16
|
+
audioSpecification: { maxLengthMs: 15000, endTimeoutMs: 640 },
|
|
17
|
+
},
|
|
18
|
+
allowInterrupt: true,
|
|
19
|
+
textInputSpecification: { startTimeoutMs: 30000 },
|
|
20
|
+
},
|
|
21
|
+
Retry4: {
|
|
22
|
+
allowedInputTypes: {
|
|
23
|
+
allowAudioInput: true,
|
|
24
|
+
allowDTMFInput: true,
|
|
25
|
+
},
|
|
26
|
+
audioAndDTMFInputSpecification: {
|
|
27
|
+
dtmfSpecification: {
|
|
28
|
+
maxLength: 513,
|
|
29
|
+
deletionCharacter: "*",
|
|
30
|
+
endCharacter: "#",
|
|
31
|
+
endTimeoutMs: 5000,
|
|
32
|
+
},
|
|
33
|
+
startTimeoutMs: 4000,
|
|
34
|
+
audioSpecification: { maxLengthMs: 15000, endTimeoutMs: 640 },
|
|
35
|
+
},
|
|
36
|
+
allowInterrupt: true,
|
|
37
|
+
textInputSpecification: { startTimeoutMs: 30000 },
|
|
38
|
+
},
|
|
39
|
+
Retry2: {
|
|
40
|
+
allowedInputTypes: {
|
|
41
|
+
allowAudioInput: true,
|
|
42
|
+
allowDTMFInput: true,
|
|
43
|
+
},
|
|
44
|
+
audioAndDTMFInputSpecification: {
|
|
45
|
+
dtmfSpecification: {
|
|
46
|
+
maxLength: 513,
|
|
47
|
+
deletionCharacter: "*",
|
|
48
|
+
endCharacter: "#",
|
|
49
|
+
endTimeoutMs: 5000,
|
|
50
|
+
},
|
|
51
|
+
startTimeoutMs: 4000,
|
|
52
|
+
audioSpecification: { maxLengthMs: 15000, endTimeoutMs: 640 },
|
|
53
|
+
},
|
|
54
|
+
allowInterrupt: true,
|
|
55
|
+
textInputSpecification: { startTimeoutMs: 30000 },
|
|
56
|
+
},
|
|
57
|
+
Initial: {
|
|
58
|
+
allowedInputTypes: {
|
|
59
|
+
allowAudioInput: true,
|
|
60
|
+
allowDTMFInput: true,
|
|
61
|
+
},
|
|
62
|
+
audioAndDTMFInputSpecification: {
|
|
63
|
+
dtmfSpecification: {
|
|
64
|
+
maxLength: 513,
|
|
65
|
+
deletionCharacter: "*",
|
|
66
|
+
endCharacter: "#",
|
|
67
|
+
endTimeoutMs: 5000,
|
|
68
|
+
},
|
|
69
|
+
startTimeoutMs: 4000,
|
|
70
|
+
audioSpecification: { maxLengthMs: 15000, endTimeoutMs: 640 },
|
|
71
|
+
},
|
|
72
|
+
allowInterrupt: true,
|
|
73
|
+
textInputSpecification: { startTimeoutMs: 30000 },
|
|
74
|
+
},
|
|
75
|
+
Retry3: {
|
|
76
|
+
allowedInputTypes: {
|
|
77
|
+
allowAudioInput: true,
|
|
78
|
+
allowDTMFInput: true,
|
|
79
|
+
},
|
|
80
|
+
audioAndDTMFInputSpecification: {
|
|
81
|
+
dtmfSpecification: {
|
|
82
|
+
maxLength: 513,
|
|
83
|
+
deletionCharacter: "*",
|
|
84
|
+
endCharacter: "#",
|
|
85
|
+
endTimeoutMs: 5000,
|
|
86
|
+
},
|
|
87
|
+
startTimeoutMs: 4000,
|
|
88
|
+
audioSpecification: { maxLengthMs: 15000, endTimeoutMs: 640 },
|
|
89
|
+
},
|
|
90
|
+
allowInterrupt: true,
|
|
91
|
+
textInputSpecification: { startTimeoutMs: 30000 },
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=get-prompt-attempt-specification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-prompt-attempt-specification.js","sourceRoot":"","sources":["../../../utils/get-prompt-attempt-specification.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,8BAA8B;IAC5C,OAAO;QACL,MAAM,EAAE;YACN,iBAAiB,EAAE;gBACjB,eAAe,EAAE,IAAI;gBACrB,cAAc,EAAE,IAAI;aACrB;YACD,8BAA8B,EAAE;gBAC9B,iBAAiB,EAAE;oBACjB,SAAS,EAAE,GAAG;oBACd,iBAAiB,EAAE,GAAG;oBACtB,YAAY,EAAE,GAAG;oBACjB,YAAY,EAAE,IAAI;iBACnB;gBACD,cAAc,EAAE,IAAI;gBACpB,kBAAkB,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE;aAC9D;YACD,cAAc,EAAE,IAAI;YACpB,sBAAsB,EAAE,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AG,EAAE;aAC9D;YACD,cAAc,EAAE,IAAI;YACpB,sBAAsB,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE;SAClD;QACD,MAAM,EAAE;YACN,iBAAiB,EAAE;gBACjB,eAAe,EAAE,IAAI;gBACrB,cAAc,EAAE,IAAI;aACrB;YACD,8BAA8B,EAAE;gBAC9B,iBAAiB,EAAE;oBACjB,SAAS,EAAE,GAAG;oBACd,iBAAiB,EAAE,GAAG;oBACtB,YAAY,EAAE,GAAG;oBACjB,YAAY,EAAE,IAAI;iBACnB;gBACD,cAAc,EAAE,IAAI;gBACpB,kBAAkB,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE;aAC9D;YACD,cAAc,EAAE,IAAI;YACpB,sBAAsB,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE;SAClD;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Graph } from "../types/graph/graph";
|
|
2
|
+
import { NodeType } from "../types/nodes/node-type";
|
|
3
|
+
export declare const getSlotNodes: (graph: Graph) => {
|
|
4
|
+
type: NodeType.slotNode;
|
|
5
|
+
data: {
|
|
6
|
+
required: boolean | null;
|
|
7
|
+
type: string;
|
|
8
|
+
name: string;
|
|
9
|
+
label: string;
|
|
10
|
+
success: ({
|
|
11
|
+
type: import("../types/responses").MessageType.text;
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
} | {
|
|
15
|
+
type: import("../types/responses").MessageType.textWithButton;
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
buttons?: {
|
|
19
|
+
id: string;
|
|
20
|
+
value: string;
|
|
21
|
+
actionType: "url" | "post";
|
|
22
|
+
buttonTitle: string;
|
|
23
|
+
action?: string | null | undefined;
|
|
24
|
+
}[] | null | undefined;
|
|
25
|
+
})[];
|
|
26
|
+
prompt: ({
|
|
27
|
+
type: import("../types/responses").MessageType.text;
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
} | {
|
|
31
|
+
type: import("../types/responses").MessageType.textWithButton;
|
|
32
|
+
id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
buttons?: {
|
|
35
|
+
id: string;
|
|
36
|
+
value: string;
|
|
37
|
+
actionType: "url" | "post";
|
|
38
|
+
buttonTitle: string;
|
|
39
|
+
action?: string | null | undefined;
|
|
40
|
+
}[] | null | undefined;
|
|
41
|
+
})[];
|
|
42
|
+
description: string;
|
|
43
|
+
failure: ({
|
|
44
|
+
type: import("../types/responses").MessageType.text;
|
|
45
|
+
id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: import("../types/responses").MessageType.textWithButton;
|
|
49
|
+
id: string;
|
|
50
|
+
title: string;
|
|
51
|
+
buttons?: {
|
|
52
|
+
id: string;
|
|
53
|
+
value: string;
|
|
54
|
+
actionType: "url" | "post";
|
|
55
|
+
buttonTitle: string;
|
|
56
|
+
action?: string | null | undefined;
|
|
57
|
+
}[] | null | undefined;
|
|
58
|
+
})[];
|
|
59
|
+
utterances: string;
|
|
60
|
+
};
|
|
61
|
+
id: string;
|
|
62
|
+
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-slot-nodes.js","sourceRoot":"","sources":["../../../utils/get-slot-nodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAY,EAAE,EAAE;IAC3C,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,QAAQ,CAAe,CAAC;AAC/E,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-utterances.js","sourceRoot":"","sources":["../../../utils/get-utterances.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,MAAM,WAAW,GAAG,UAAU;SAC3B,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAClC,OAAO,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./compile-flow-to-flowdetail";
|
|
2
|
+
export * from "./file-exporter";
|
|
3
|
+
export * from "./find-first-fullfillment-node";
|
|
4
|
+
export * from "./find-first-intent-node";
|
|
5
|
+
export * from "./generate-response";
|
|
6
|
+
export * from "./get-bfs-order";
|
|
7
|
+
export * from "./get-end-of-conversation-node";
|
|
8
|
+
export * from "./get-first-closing-response-node";
|
|
9
|
+
export * from "./get-first-confirmation-node";
|
|
10
|
+
export * from "./get-message";
|
|
11
|
+
export * from "./get-next-step";
|
|
12
|
+
export * from "./get-prompt-attempt-specification";
|
|
13
|
+
export * from "./get-slot-nodes";
|
|
14
|
+
export * from "./get-utterances";
|
|
15
|
+
export * from "./lex-zip-exporter";
|
|
16
|
+
export * from "./transform-flow-detail-to-file-and-folder";
|
|
17
|
+
export * from "./validate-graph";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from "./compile-flow-to-flowdetail";
|
|
2
|
+
export * from "./file-exporter";
|
|
3
|
+
export * from "./find-first-fullfillment-node";
|
|
4
|
+
export * from "./find-first-intent-node";
|
|
5
|
+
export * from "./generate-response";
|
|
6
|
+
export * from "./get-bfs-order";
|
|
7
|
+
export * from "./get-end-of-conversation-node";
|
|
8
|
+
export * from "./get-first-closing-response-node";
|
|
9
|
+
export * from "./get-first-confirmation-node";
|
|
10
|
+
export * from "./get-message";
|
|
11
|
+
export * from "./get-next-step";
|
|
12
|
+
export * from "./get-prompt-attempt-specification";
|
|
13
|
+
export * from "./get-slot-nodes";
|
|
14
|
+
export * from "./get-utterances";
|
|
15
|
+
export * from "./lex-zip-exporter";
|
|
16
|
+
export * from "./transform-flow-detail-to-file-and-folder";
|
|
17
|
+
export * from "./validate-graph";
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lex-zip-exporter.js","sourceRoot":"","sources":["../../../utils/lex-zip-exporter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { NodeType } from "../../types/nodes/node-type";
|
|
2
|
+
import { generateResponse } from "../generate-response";
|
|
3
|
+
import { getEndOfConversationNode } from "../get-end-of-conversation-node";
|
|
4
|
+
import { getNextStep } from "../get-next-step";
|
|
5
|
+
export function buildClosingResponse(graph, closingResponseNode) {
|
|
6
|
+
let closingResponseDetails = generateBasicDetails(graph, closingResponseNode);
|
|
7
|
+
[getSuccessNode(graph, closingResponseNode)].forEach((scenario) => {
|
|
8
|
+
closingResponseDetails = Object.assign(Object.assign({}, closingResponseDetails), { [scenario.responseKey]: generateResponse(scenario.response), [scenario.nextStep]: getNextStep(graph, scenario.node) });
|
|
9
|
+
if (scenario.node.type === NodeType.conditionNode) {
|
|
10
|
+
const { conditionalBranches, defaultBranch } = buildConditional(graph, scenario.node);
|
|
11
|
+
closingResponseDetails = Object.assign(Object.assign({}, closingResponseDetails), { [scenario.condition]: {
|
|
12
|
+
isActive: true,
|
|
13
|
+
conditionalBranches,
|
|
14
|
+
defaultBranch,
|
|
15
|
+
} });
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return closingResponseDetails;
|
|
19
|
+
}
|
|
20
|
+
function getSuccessNode(graph, closingResponseNode) {
|
|
21
|
+
const edge = graph.edges.find((e) => e.source === closingResponseNode.id &&
|
|
22
|
+
e.sourceHandle === "closingResponseSource");
|
|
23
|
+
const node = graph.nodes.find((n) => n.id === (edge === null || edge === void 0 ? void 0 : edge.target)) ||
|
|
24
|
+
getEndOfConversationNode();
|
|
25
|
+
return {
|
|
26
|
+
node,
|
|
27
|
+
responseKey: "closingResponse",
|
|
28
|
+
response: closingResponseNode.data.response,
|
|
29
|
+
condition: "conditional",
|
|
30
|
+
nextStep: "nextStep",
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function generateBasicDetails(graph, closingResponseNode) {
|
|
34
|
+
return {
|
|
35
|
+
isActive: true,
|
|
36
|
+
conditional: null,
|
|
37
|
+
nextStep: getNextStep(graph, getEndOfConversationNode()),
|
|
38
|
+
closingResponse: null,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function buildConditional(graph, conditionalNode, onCodeHookNodeEncounter) {
|
|
42
|
+
const conditionalBranches = [];
|
|
43
|
+
conditionalNode.data.branches.forEach((b, i) => {
|
|
44
|
+
const nextEdge = graph.edges.find((e) => e.source === conditionalNode.id &&
|
|
45
|
+
e.sourceHandle === `conditionNodeBranch-${i}`);
|
|
46
|
+
const nextNode = graph.nodes.find((n) => n.id === (nextEdge === null || nextEdge === void 0 ? void 0 : nextEdge.target)) ||
|
|
47
|
+
getEndOfConversationNode();
|
|
48
|
+
if (nextNode.type === NodeType.codeHookNode) {
|
|
49
|
+
onCodeHookNodeEncounter && onCodeHookNodeEncounter(nextNode);
|
|
50
|
+
}
|
|
51
|
+
conditionalBranches.push({
|
|
52
|
+
name: b.name,
|
|
53
|
+
response: generateResponse(b.response),
|
|
54
|
+
condition: { expressionString: b.expression },
|
|
55
|
+
nextStep: getNextStep(graph, nextNode),
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
const nextEdge = graph.edges.find((e) => e.source === conditionalNode.id &&
|
|
59
|
+
e.sourceHandle === `conditionNodeFailureDefault`);
|
|
60
|
+
const nextNode = graph.nodes.find((n) => n.id === (nextEdge === null || nextEdge === void 0 ? void 0 : nextEdge.target)) ||
|
|
61
|
+
getEndOfConversationNode();
|
|
62
|
+
if (nextNode.type === NodeType.codeHookNode) {
|
|
63
|
+
onCodeHookNodeEncounter && onCodeHookNodeEncounter(nextNode);
|
|
64
|
+
}
|
|
65
|
+
const defaultBranch = {
|
|
66
|
+
response: generateResponse(conditionalNode.data.response),
|
|
67
|
+
nextStep: getNextStep(graph, nextNode),
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
conditionalBranches,
|
|
71
|
+
defaultBranch,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=build-closing-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-closing-response.js","sourceRoot":"","sources":["../../../../utils/node-builders/build-closing-response.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,M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AI;YACZ,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC;YACtC,SAAS,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,UAAU,EAAE;YAC7C,QAAQ,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC;SACvC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAC/B,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,MAAM,KAAK,eAAe,CAAC,EAAE;QAC/B,CAAC,CAAC,YAAY,KAAK,6BAA6B,CACnD,CAAC;IACF,MAAM,QAAQ,GACZ,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAK,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAA,CAAC;QAClD,wBAAwB,EAAE,CAAC;IAE7B,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,YAAY,EAAE,CAAC;QAC5C,uBAAuB,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,aAAa,GAAG;QACpB,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC;QACzD,QAAQ,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC;KACvC,CAAC;IAEF,OAAO;QACL,mBAAmB;QACnB,aAAa;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { NodeType } from "../../types/nodes/node-type";
|
|
2
|
+
import { generateResponse } from "../generate-response";
|
|
3
|
+
import { getEndOfConversationNode } from "../get-end-of-conversation-node";
|
|
4
|
+
import { getMessage } from "../get-message";
|
|
5
|
+
import { getNextStep } from "../get-next-step";
|
|
6
|
+
import { getPromptAttemptsSpecification } from "../get-prompt-attempt-specification";
|
|
7
|
+
export function buildConfirmation(graph, confirmationNode) {
|
|
8
|
+
let confirmationDetails = generateBasicDetails(graph, confirmationNode);
|
|
9
|
+
[
|
|
10
|
+
getConfirmationNode(graph, confirmationNode),
|
|
11
|
+
getFailureNode(graph, confirmationNode),
|
|
12
|
+
getDeclineNode(graph, confirmationNode),
|
|
13
|
+
].forEach((scenario) => {
|
|
14
|
+
confirmationDetails = Object.assign(Object.assign({}, (confirmationDetails || {})), { [scenario.responseKey]: generateResponse(scenario.response), [scenario.nextStep]: getNextStep(graph, scenario.node) });
|
|
15
|
+
if (scenario.node.type === NodeType.conditionNode) {
|
|
16
|
+
const { conditionalBranches, defaultBranch } = buildConditional(graph, scenario.node, (codeHookNode) => {
|
|
17
|
+
if (confirmationDetails.codeHook) {
|
|
18
|
+
console.warn("more than one codehook present , skipping new ones");
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const { postCodeHookSpecification } = buildCodeHook(graph, codeHookNode);
|
|
22
|
+
confirmationDetails = Object.assign(Object.assign({}, confirmationDetails), { codeHook: {
|
|
23
|
+
isActive: true,
|
|
24
|
+
enableCodeHookInvocation: true,
|
|
25
|
+
invocationLabel: codeHookNode.data.invocationLabel,
|
|
26
|
+
postCodeHookSpecification,
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
confirmationDetails = Object.assign(Object.assign({}, confirmationDetails), { [scenario.condition]: {
|
|
31
|
+
isActive: true,
|
|
32
|
+
conditionalBranches,
|
|
33
|
+
defaultBranch,
|
|
34
|
+
} });
|
|
35
|
+
}
|
|
36
|
+
if (scenario.node.type === NodeType.codeHookNode) {
|
|
37
|
+
if (confirmationDetails.codeHook) {
|
|
38
|
+
console.warn("more than one codehook present , skipping new ones");
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
const { postCodeHookSpecification } = buildCodeHook(graph, scenario.node);
|
|
42
|
+
confirmationDetails = Object.assign(Object.assign({}, confirmationDetails), { codeHook: {
|
|
43
|
+
isActive: true,
|
|
44
|
+
enableCodeHookInvocation: true,
|
|
45
|
+
invocationLabel: scenario.node.data.invocationLabel,
|
|
46
|
+
postCodeHookSpecification,
|
|
47
|
+
} });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return confirmationDetails;
|
|
52
|
+
}
|
|
53
|
+
function buildCodeHook(graph, codeHookNode) {
|
|
54
|
+
let postCodeHookSpecification = {};
|
|
55
|
+
[getSuccessScenario(), getFailureScenario(), getTimeoutScenario()].forEach((scenario) => {
|
|
56
|
+
postCodeHookSpecification = Object.assign(Object.assign({}, postCodeHookSpecification), { [scenario.responseKey]: generateResponse(scenario.response), [scenario.nextStep]: getNextStep(graph, scenario.node) });
|
|
57
|
+
if (scenario.node.type === NodeType.conditionNode) {
|
|
58
|
+
const { conditionalBranches, defaultBranch } = buildConditional(graph, scenario.node);
|
|
59
|
+
postCodeHookSpecification = Object.assign(Object.assign({}, postCodeHookSpecification), { [scenario.condition]: {
|
|
60
|
+
isActive: true,
|
|
61
|
+
conditionalBranches,
|
|
62
|
+
defaultBranch,
|
|
63
|
+
} });
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return { postCodeHookSpecification };
|
|
67
|
+
function getSuccessScenario() {
|
|
68
|
+
const edge = graph.edges.find((e) => e.source === codeHookNode.id && e.sourceHandle === "codeHookNodeSuccess");
|
|
69
|
+
const node = graph.nodes.find((n) => n.id === (edge === null || edge === void 0 ? void 0 : edge.target)) ||
|
|
70
|
+
getEndOfConversationNode();
|
|
71
|
+
return {
|
|
72
|
+
node,
|
|
73
|
+
responseKey: "successResponse",
|
|
74
|
+
condition: "successConditional",
|
|
75
|
+
nextStep: "successNextStep",
|
|
76
|
+
response: codeHookNode.data.success,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function getFailureScenario() {
|
|
80
|
+
const edge = graph.edges.find((e) => e.source === codeHookNode.id && e.sourceHandle === "codeHookNodeFailure");
|
|
81
|
+
const node = graph.nodes.find((n) => n.id === (edge === null || edge === void 0 ? void 0 : edge.target)) ||
|
|
82
|
+
getEndOfConversationNode();
|
|
83
|
+
return {
|
|
84
|
+
node,
|
|
85
|
+
responseKey: "failureResponse",
|
|
86
|
+
condition: "failureConditional",
|
|
87
|
+
nextStep: "failureNextStep",
|
|
88
|
+
response: codeHookNode.data.failure,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function getTimeoutScenario() {
|
|
92
|
+
const edge = graph.edges.find((e) => e.source === codeHookNode.id && e.sourceHandle === "codeHookNodeTimeout");
|
|
93
|
+
const node = graph.nodes.find((n) => n.id === (edge === null || edge === void 0 ? void 0 : edge.target)) ||
|
|
94
|
+
getEndOfConversationNode();
|
|
95
|
+
return {
|
|
96
|
+
node,
|
|
97
|
+
responseKey: "timeoutResponse",
|
|
98
|
+
condition: "timeoutConditional",
|
|
99
|
+
nextStep: "timeoutNextStep",
|
|
100
|
+
response: codeHookNode.data.timeout,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function buildConditional(graph, conditionalNode, onCodeHookNodeEncounter) {
|
|
105
|
+
const conditionalBranches = [];
|
|
106
|
+
conditionalNode.data.branches.forEach((b, i) => {
|
|
107
|
+
const nextEdge = graph.edges.find((e) => e.source === conditionalNode.id &&
|
|
108
|
+
e.sourceHandle === `conditionNodeBranch-${i}`);
|
|
109
|
+
const nextNode = graph.nodes.find((n) => n.id === (nextEdge === null || nextEdge === void 0 ? void 0 : nextEdge.target)) ||
|
|
110
|
+
getEndOfConversationNode();
|
|
111
|
+
if (nextNode.type === NodeType.codeHookNode) {
|
|
112
|
+
onCodeHookNodeEncounter && onCodeHookNodeEncounter(nextNode);
|
|
113
|
+
}
|
|
114
|
+
conditionalBranches.push({
|
|
115
|
+
name: b.name,
|
|
116
|
+
response: generateResponse(b.response),
|
|
117
|
+
condition: { expressionString: b.expression },
|
|
118
|
+
nextStep: getNextStep(graph, nextNode),
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
const nextEdge = graph.edges.find((e) => e.source === conditionalNode.id &&
|
|
122
|
+
e.sourceHandle === `conditionNodeFailureDefault`);
|
|
123
|
+
const nextNode = graph.nodes.find((n) => n.id === (nextEdge === null || nextEdge === void 0 ? void 0 : nextEdge.target)) ||
|
|
124
|
+
getEndOfConversationNode();
|
|
125
|
+
if (nextNode.type === NodeType.codeHookNode) {
|
|
126
|
+
onCodeHookNodeEncounter && onCodeHookNodeEncounter(nextNode);
|
|
127
|
+
}
|
|
128
|
+
const defaultBranch = {
|
|
129
|
+
response: generateResponse(conditionalNode.data.response),
|
|
130
|
+
nextStep: getNextStep(graph, nextNode),
|
|
131
|
+
};
|
|
132
|
+
return {
|
|
133
|
+
conditionalBranches,
|
|
134
|
+
defaultBranch,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function getConfirmationNode(graph, confirmationNode) {
|
|
138
|
+
const edge = graph.edges.find((e) => e.source === confirmationNode.id &&
|
|
139
|
+
e.sourceHandle === "confirmationNodeConfirm");
|
|
140
|
+
const node = graph.nodes.find((n) => n.id === (edge === null || edge === void 0 ? void 0 : edge.target)) ||
|
|
141
|
+
getEndOfConversationNode();
|
|
142
|
+
return {
|
|
143
|
+
node,
|
|
144
|
+
responseKey: "confirmationResponse",
|
|
145
|
+
response: confirmationNode.data.success,
|
|
146
|
+
condition: "confirmationConditional",
|
|
147
|
+
nextStep: "confirmationNextStep",
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function getDeclineNode(graph, ConfirmationNode) {
|
|
151
|
+
const edge = graph.edges.find((e) => e.source === ConfirmationNode.id &&
|
|
152
|
+
e.sourceHandle === "confirmationNodeDecline");
|
|
153
|
+
const node = graph.nodes.find((n) => n.id === (edge === null || edge === void 0 ? void 0 : edge.target)) ||
|
|
154
|
+
getEndOfConversationNode();
|
|
155
|
+
return {
|
|
156
|
+
node,
|
|
157
|
+
responseKey: "declinationResponse",
|
|
158
|
+
response: ConfirmationNode.data.decline,
|
|
159
|
+
condition: "declinationConditional",
|
|
160
|
+
nextStep: "declinationNextStep",
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function getFailureNode(graph, ConfirmationNode) {
|
|
164
|
+
const edge = graph.edges.find((e) => e.source === ConfirmationNode.id &&
|
|
165
|
+
e.sourceHandle === "confirmationNodeFailure");
|
|
166
|
+
const node = graph.nodes.find((n) => n.id === (edge === null || edge === void 0 ? void 0 : edge.target)) ||
|
|
167
|
+
getEndOfConversationNode();
|
|
168
|
+
return {
|
|
169
|
+
node,
|
|
170
|
+
responseKey: "failureResponse",
|
|
171
|
+
response: ConfirmationNode.data.failure,
|
|
172
|
+
condition: "failureConditional",
|
|
173
|
+
nextStep: "failureNextStep",
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function generateBasicDetails(graph, confirmationNode) {
|
|
177
|
+
return {
|
|
178
|
+
isActive: true,
|
|
179
|
+
codeHook: null,
|
|
180
|
+
promptSpecification: {
|
|
181
|
+
messageGroupsList: [getMessage(confirmationNode.data.prompt)],
|
|
182
|
+
maxRetries: 4,
|
|
183
|
+
allowInterrupt: true,
|
|
184
|
+
messageSelectionStrategy: "Random",
|
|
185
|
+
promptAttemptsSpecification: getPromptAttemptsSpecification(),
|
|
186
|
+
},
|
|
187
|
+
declinationResponse: null,
|
|
188
|
+
failureNextStep: getNextStep(graph, getEndOfConversationNode()),
|
|
189
|
+
elicitationCodeHook: {
|
|
190
|
+
enableCodeHookInvocation: false,
|
|
191
|
+
invocationLabel: null,
|
|
192
|
+
},
|
|
193
|
+
confirmationResponse: null,
|
|
194
|
+
confirmationNextStep: getNextStep(graph, getEndOfConversationNode()),
|
|
195
|
+
confirmationConditional: null,
|
|
196
|
+
declinationNextStep: getNextStep(graph, getEndOfConversationNode()),
|
|
197
|
+
declinationConditional: null,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=build-confirmation.js.map
|