@cognigy/rest-api-client 2025.24.0 → 2026.1.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/apigroups/ResourcesAPIGroup_2_0.js +14 -0
  3. package/build/apigroups/SimulationAPIGroup_2_0.js +15 -1
  4. package/build/authentication/AuthenticationAPI.js +1 -0
  5. package/build/shared/charts/createNodeDescriptor.js +1 -0
  6. package/build/shared/charts/descriptors/analytics/overwriteAnalytics.js +14 -0
  7. package/build/shared/charts/descriptors/analytics/updateProfile.js +5 -0
  8. package/build/shared/charts/descriptors/connectionNodes/smtp/emailNotification.js +7 -0
  9. package/build/shared/charts/descriptors/connectionNodes/smtp/sendEmail.js +9 -0
  10. package/build/shared/charts/descriptors/index.js +7 -1
  11. package/build/shared/charts/descriptors/message/question/question.js +5 -0
  12. package/build/shared/charts/descriptors/message/say.js +3 -0
  13. package/build/shared/charts/descriptors/placeholder.js +3 -0
  14. package/build/shared/charts/descriptors/service/agentTools/executeWorkflowTool.js +239 -0
  15. package/build/shared/charts/descriptors/service/agentTools/handoverToAiAgentTool.js +192 -0
  16. package/build/shared/charts/descriptors/service/agentTools/handoverToHumanAgentTool.js +783 -0
  17. package/build/shared/charts/descriptors/service/agentTools/sendEmailTool.js +272 -0
  18. package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +23 -20
  19. package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobCallMCPTool.js +4 -2
  20. package/build/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +3 -1
  21. package/build/shared/charts/descriptors/service/aiAgent/helpers/parseMcpHeaders.js +26 -0
  22. package/build/shared/charts/descriptors/service/cxone/knowledgehub/CXoneKnowledgehub.js +198 -0
  23. package/build/shared/charts/descriptors/service/cxone/knowledgehub/CXoneKnowledgehubConnection.js +16 -0
  24. package/build/shared/charts/descriptors/service/cxone/knowledgehub/CXoneKnowledgehubForm.js +300 -0
  25. package/build/shared/charts/descriptors/service/cxone/knowledgehub/CXoneKnowledgehubProviderModule.js +16 -0
  26. package/build/shared/charts/descriptors/service/handoverV2.js +1 -1
  27. package/build/shared/charts/descriptors/service/httpRequest.js +3 -0
  28. package/build/shared/charts/descriptors/service/index.js +9 -1
  29. package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +11 -4
  30. package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +29 -27
  31. package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +5 -5
  32. package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +2 -2
  33. package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +13 -4
  34. package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +4 -4
  35. package/build/shared/constants.js +2 -1
  36. package/build/shared/interfaces/IOrganisation.js +1 -0
  37. package/build/shared/interfaces/amqpInterface.js +1 -0
  38. package/build/shared/interfaces/cxone/knowledgehub/CXoneKnowledgehubAPI.js +3 -0
  39. package/build/shared/interfaces/messageAPI/endpoints.js +1 -1
  40. package/build/shared/interfaces/resources/IAuditEvent.js +1 -0
  41. package/build/shared/interfaces/resources/IChart.js +10 -1
  42. package/build/shared/interfaces/resources/IChartNode.js +32 -4
  43. package/build/shared/interfaces/resources/IEndpoint.js +1 -0
  44. package/build/shared/interfaces/resources/INodeDescriptorSet.js +8 -0
  45. package/build/shared/interfaces/resources/TResourceType.js +1 -0
  46. package/build/shared/interfaces/resources/chart/IChartExecutableNode.js +10 -1
  47. package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeConnector.js +49 -0
  48. package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeSource.js +1 -1
  49. package/build/shared/interfaces/restAPI/administration/user/v2.0/IExchangeCXoneTokenRest_2_0.js +3 -0
  50. package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/ICreateKnowledgeConnectorRest_2_0.js +3 -0
  51. package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IDeleteKnowledgeConnectorRest_2_0.js +3 -0
  52. package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IIndexKnowledgeConnectorsRest_2_0.js +3 -0
  53. package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IKnowledgeConnector_2_0.js +3 -0
  54. package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IReadKnowledgeConnectorRest_2_0.js +3 -0
  55. package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IUpdateKnowledgeConnectorRest_2_0.js +3 -0
  56. package/build/shared/interfaces/restAPI/simulation/scheduler/ICreateSchedulerRest_2_0.js +3 -0
  57. package/build/shared/interfaces/restAPI/simulation/scheduler/IGetSchedulerRest_2_0.js +3 -0
  58. package/build/shared/interfaces/restAPI/simulation/scheduler/ISchedulerRest_2_0.js +12 -0
  59. package/build/shared/interfaces/restAPI/simulation/scheduler/IUpdateSchedulerRest_2_0.js +3 -0
  60. package/build/shared/interfaces/restAPI/simulation/simulationRun/ISimulationRunRest_2_0.js +15 -1
  61. package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/ISimulationRunBatchRest_2_0.js +6 -1
  62. package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +14 -0
  63. package/dist/esm/apigroups/SimulationAPIGroup_2_0.js +15 -1
  64. package/dist/esm/authentication/AuthenticationAPI.js +1 -0
  65. package/dist/esm/shared/charts/createNodeDescriptor.js +1 -0
  66. package/dist/esm/shared/charts/descriptors/analytics/overwriteAnalytics.js +14 -0
  67. package/dist/esm/shared/charts/descriptors/analytics/updateProfile.js +5 -0
  68. package/dist/esm/shared/charts/descriptors/connectionNodes/smtp/emailNotification.js +7 -0
  69. package/dist/esm/shared/charts/descriptors/connectionNodes/smtp/sendEmail.js +9 -0
  70. package/dist/esm/shared/charts/descriptors/index.js +6 -1
  71. package/dist/esm/shared/charts/descriptors/message/question/question.js +5 -0
  72. package/dist/esm/shared/charts/descriptors/message/say.js +3 -0
  73. package/dist/esm/shared/charts/descriptors/placeholder.js +3 -0
  74. package/dist/esm/shared/charts/descriptors/service/agentTools/executeWorkflowTool.js +237 -0
  75. package/dist/esm/shared/charts/descriptors/service/agentTools/handoverToAiAgentTool.js +190 -0
  76. package/dist/esm/shared/charts/descriptors/service/agentTools/handoverToHumanAgentTool.js +770 -0
  77. package/dist/esm/shared/charts/descriptors/service/agentTools/sendEmailTool.js +270 -0
  78. package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +23 -20
  79. package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJobCallMCPTool.js +4 -2
  80. package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +3 -1
  81. package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/parseMcpHeaders.js +25 -0
  82. package/dist/esm/shared/charts/descriptors/service/cxone/knowledgehub/CXoneKnowledgehub.js +196 -0
  83. package/dist/esm/shared/charts/descriptors/service/cxone/knowledgehub/CXoneKnowledgehubConnection.js +13 -0
  84. package/dist/esm/shared/charts/descriptors/service/cxone/knowledgehub/CXoneKnowledgehubForm.js +297 -0
  85. package/dist/esm/shared/charts/descriptors/service/cxone/knowledgehub/CXoneKnowledgehubProviderModule.js +13 -0
  86. package/dist/esm/shared/charts/descriptors/service/handoverV2.js +1 -1
  87. package/dist/esm/shared/charts/descriptors/service/httpRequest.js +3 -0
  88. package/dist/esm/shared/charts/descriptors/service/index.js +4 -0
  89. package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +11 -4
  90. package/dist/esm/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +29 -27
  91. package/dist/esm/shared/charts/descriptors/voice/mappers/transfer.mapper.js +5 -5
  92. package/dist/esm/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +2 -2
  93. package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +13 -4
  94. package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/transfer.js +4 -4
  95. package/dist/esm/shared/constants.js +1 -0
  96. package/dist/esm/shared/interfaces/IOrganisation.js +1 -0
  97. package/dist/esm/shared/interfaces/amqpInterface.js +1 -0
  98. package/dist/esm/shared/interfaces/cxone/knowledgehub/CXoneKnowledgehubAPI.js +2 -0
  99. package/dist/esm/shared/interfaces/messageAPI/endpoints.js +1 -1
  100. package/dist/esm/shared/interfaces/resources/IAuditEvent.js +1 -0
  101. package/dist/esm/shared/interfaces/resources/IChart.js +10 -1
  102. package/dist/esm/shared/interfaces/resources/IChartNode.js +32 -4
  103. package/dist/esm/shared/interfaces/resources/IEndpoint.js +1 -0
  104. package/dist/esm/shared/interfaces/resources/INodeDescriptorSet.js +8 -0
  105. package/dist/esm/shared/interfaces/resources/TResourceType.js +1 -0
  106. package/dist/esm/shared/interfaces/resources/chart/IChartExecutableNode.js +10 -1
  107. package/dist/esm/shared/interfaces/resources/knowledgeStore/IKnowledgeConnector.js +46 -0
  108. package/dist/esm/shared/interfaces/resources/knowledgeStore/IKnowledgeSource.js +1 -1
  109. package/dist/esm/shared/interfaces/restAPI/administration/user/v2.0/IExchangeCXoneTokenRest_2_0.js +2 -0
  110. package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/ICreateKnowledgeConnectorRest_2_0.js +2 -0
  111. package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IDeleteKnowledgeConnectorRest_2_0.js +2 -0
  112. package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IIndexKnowledgeConnectorsRest_2_0.js +2 -0
  113. package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IKnowledgeConnector_2_0.js +2 -0
  114. package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IReadKnowledgeConnectorRest_2_0.js +2 -0
  115. package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/connector/IUpdateKnowledgeConnectorRest_2_0.js +2 -0
  116. package/dist/esm/shared/interfaces/restAPI/simulation/scheduler/ICreateSchedulerRest_2_0.js +2 -0
  117. package/dist/esm/shared/interfaces/restAPI/simulation/scheduler/IGetSchedulerRest_2_0.js +2 -0
  118. package/dist/esm/shared/interfaces/restAPI/simulation/scheduler/ISchedulerRest_2_0.js +9 -0
  119. package/dist/esm/shared/interfaces/restAPI/simulation/scheduler/IUpdateSchedulerRest_2_0.js +2 -0
  120. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRun/ISimulationRunRest_2_0.js +14 -0
  121. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/ISimulationRunBatchRest_2_0.js +5 -0
  122. package/package.json +1 -1
  123. package/types/index.d.ts +727 -29
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 2026.1.0
2
+ Released: January 19th, 2026
3
+
4
+ Released state of package up to date with Cognigy.AI v2026.1.0
5
+
6
+ # 2025.25.0
7
+ Released: December 09th, 2025
8
+
9
+ Released state of package up to date with Cognigy.AI v2025.25.0
10
+
1
11
  # 2025.24.0
2
12
  Released: November 25th, 2025
3
13
 
@@ -630,6 +630,20 @@ const ResourcesAPIGroup_2_0 = (instance) => {
630
630
  var { knowledgeStoreId, sourceId, chunkId } = _a, args = __rest(_a, ["knowledgeStoreId", "sourceId", "chunkId"]);
631
631
  return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/knowledgestores/${knowledgeStoreId}/sources/${sourceId}/chunks/${chunkId}`, "PATCH", self)(args, options);
632
632
  },
633
+ indexKnowledgeConnectors: (_a, options) => {
634
+ var { knowledgeStoreId } = _a, args = __rest(_a, ["knowledgeStoreId"]);
635
+ return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/knowledgestores/${knowledgeStoreId}/connectors?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options);
636
+ },
637
+ createKnowledgeConnector: (_a, options) => {
638
+ var { knowledgeStoreId } = _a, args = __rest(_a, ["knowledgeStoreId"]);
639
+ return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/knowledgestores/${knowledgeStoreId}/connectors`, "POST", self)(args, options);
640
+ },
641
+ readKnowledgeConnector: ({ knowledgeStoreId, connectorId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/knowledgestores/${knowledgeStoreId}/connectors/${connectorId}`, "GET", self)(undefined, options),
642
+ updateKnowledgeConnector: (_a, options) => {
643
+ var { knowledgeStoreId, connectorId } = _a, args = __rest(_a, ["knowledgeStoreId", "connectorId"]);
644
+ return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/knowledgestores/${knowledgeStoreId}/connectors/${connectorId}`, "PATCH", self)(args, options);
645
+ },
646
+ deleteKnowledgeConnector: ({ knowledgeStoreId, connectorId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/knowledgestores/${knowledgeStoreId}/connectors/${connectorId}`, "DELETE", self)(undefined, options),
633
647
  uploadResumable: (args) => (0, GenericTusFn_1.GenericTusFn)("/new/v2.0/uploads", self)(args),
634
648
  generateNluScores: (_a) => {
635
649
  var { projectId } = _a, args = __rest(_a, ["projectId"]);
@@ -64,7 +64,21 @@ function SimulationAPIGroup_2_0(instance) {
64
64
  generatePersona: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/testing/beta/personas/generate", "POST", self)(args, options),
65
65
  regeneratePersonaField: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/testing/beta/personas/regenerate-field", "POST", self)(args, options),
66
66
  generateBulkPersona: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/testing/beta/personas/generate-bulk", "POST", self)(args, options),
67
- generatePersonaFromTranscript: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/testing/beta/personas/from-transcript", "POST", self)(args, options)
67
+ generatePersonaFromTranscript: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/testing/beta/personas/from-transcript", "POST", self)(args, options),
68
+ getScheduler: (_a, options) => {
69
+ var { simulationReference } = _a, args = __rest(_a, ["simulationReference"]);
70
+ return (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}/schedules?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options);
71
+ },
72
+ createScheduler: (_a, options) => {
73
+ var { simulationReference } = _a, args = __rest(_a, ["simulationReference"]);
74
+ return (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}/schedules`, "POST", self)(args, options);
75
+ },
76
+ updateScheduler: (_a, options) => {
77
+ var { simulationReference, schedulerId, projectId } = _a, args = __rest(_a, ["simulationReference", "schedulerId", "projectId"]);
78
+ return (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}/schedules/${schedulerId}?${(0, query_1.stringifyQuery)({
79
+ projectId
80
+ })}`, "PATCH", self)(args, options);
81
+ }
68
82
  };
69
83
  }
70
84
  exports.SimulationAPIGroup_2_0 = SimulationAPIGroup_2_0;
@@ -68,6 +68,7 @@ function AuthenticationAPI(instance) {
68
68
  var { loginToken } = _a, args = __rest(_a, ["loginToken"]);
69
69
  return (0, GenericAPIFn_1.GenericAPIFn)(`/auth/exchangetoken?${(0, rest_1.stringifyQuery)({ loginToken })}`, "GET", self)(args, Object.assign({ withAuthentication: false, withCredentials: true }, options));
70
70
  },
71
+ exchangeCXoneToken: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/auth/exchangetoken/cxone", "POST", self)(args, Object.assign({ withAuthentication: false, withCredentials: true }, options)),
71
72
  generateManagementUIAuthToken: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/management/auth/token", "POST", self)(args, options)
72
73
  };
73
74
  }
@@ -25,6 +25,7 @@ const createNodeDescriptor = (params) => {
25
25
  tags: tags || [],
26
26
  tokens: tokens || [],
27
27
  function: params.function || null,
28
+ mocking: params.mocking || { defaultMockCode: "" }
28
29
  };
29
30
  };
30
31
  exports.createNodeDescriptor = createNodeDescriptor;
@@ -194,6 +194,20 @@ exports.OVERWRITE_ANALYTICS = (0, createNodeDescriptor_1.createNodeDescriptor)({
194
194
  { type: "section", key: "defaultFields" }
195
195
  ],
196
196
  tags: ["analytics", "customize"],
197
+ mocking: {
198
+ defaultMockCode: `
199
+ analyticsdata.intent = 'intent override';
200
+ analyticsdata.inputText = 'inputText override';
201
+ analyticsdata.inputData = {data: 'inputData override'};
202
+ analyticsdata.intentScore = 0.8;
203
+ analyticsdata.slots = {
204
+ NUMBER: [
205
+ 1100
206
+ ]
207
+ };
208
+ analyticsdata.understood = true;
209
+ `
210
+ },
197
211
  function: async ({ cognigy, config }) => {
198
212
  const { api } = cognigy;
199
213
  let stringUpdateValue = "";
@@ -36,6 +36,11 @@ exports.UPDATE_PROFILE = (0, createNodeDescriptor_1.createNodeDescriptor)({
36
36
  type: "text"
37
37
  },
38
38
  tags: ["analytics", "profile"],
39
+ mocking: {
40
+ defaultMockCode: `
41
+ profile.name = "John Doe"
42
+ `
43
+ },
39
44
  function: async ({ cognigy, config }) => {
40
45
  const { key, value } = config;
41
46
  const { api } = cognigy;
@@ -10,6 +10,12 @@ exports.EMAIL_NOTIFICATION = (0, createNodeDescriptor_1.createNodeDescriptor)({
10
10
  defaultLabel: "Email Notification",
11
11
  summary: "UI__NODE_EDITOR__SMTP__EMAIL_NOTIFICATION__SUMMARY",
12
12
  fields: [
13
+ {
14
+ key: "senderName",
15
+ type: "cognigyText",
16
+ label: "UI__NODE_EDITOR__SMTP__EMAIL_NOTIFICATION__SENDER_NAME__LABEL",
17
+ description: "UI__NODE_EDITOR__SMTP__EMAIL_NOTIFICATION__SENDER_NAME__DESCRIPTION"
18
+ },
13
19
  {
14
20
  key: "recipient",
15
21
  type: "cognigyText",
@@ -162,6 +168,7 @@ exports.EMAIL_NOTIFICATION = (0, createNodeDescriptor_1.createNodeDescriptor)({
162
168
  },
163
169
  ],
164
170
  form: [
171
+ { key: "senderName", type: "field" },
165
172
  { key: "recipient", type: "field" },
166
173
  { key: "subject", type: "field" },
167
174
  { key: "message", type: "field" },
@@ -173,6 +173,15 @@ exports.SEND_EMAIL = (0, createNodeDescriptor_1.createNodeDescriptor)({
173
173
  label: "UI__NODE_EDITOR__SMTP__SEND_EMAIL__FROM__LABEL",
174
174
  description: "UI__NODE_EDITOR__SMTP__SEND_EMAIL__FROM__DESCRIPTION"
175
175
  },
176
+ {
177
+ key: "senderName",
178
+ type: "cognigyText",
179
+ label: "UI__NODE_EDITOR__SMTP__SEND_EMAIL__SENDER_NAME__LABEL",
180
+ description: "UI__NODE_EDITOR__SMTP__SEND_EMAIL__SENDER_NAME__DESCRIPTION",
181
+ params: {
182
+ required: true
183
+ }
184
+ },
176
185
  {
177
186
  key: "subject",
178
187
  type: "cognigyText",
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cognigyDocumentParserProviderModule = exports.cognigyTranslationProviderModule = exports.cognigySpeechProviderModule = exports.cognigyGenerativeAIProviderModule = exports.cognigyInternalStorageProviderModule = exports.cognigyVoiceGateway2Module = exports.cognigyMicrosoftModule = exports.cognigyVoiceGatewayModule = exports.cognigySMTPModule = exports.cognigySQLModule = exports.cognigyMongoDBModule = exports.cognigyBasicModule = void 0;
3
+ exports.niceCXoneKnowledgehubProviderModule = exports.cognigyDocumentParserProviderModule = exports.cognigyTranslationProviderModule = exports.cognigySpeechProviderModule = exports.cognigyGenerativeAIProviderModule = exports.cognigyInternalStorageProviderModule = exports.cognigyVoiceGateway2Module = exports.cognigyMicrosoftModule = exports.cognigyVoiceGatewayModule = exports.cognigySMTPModule = exports.cognigySQLModule = exports.cognigyMongoDBModule = exports.cognigyBasicModule = void 0;
4
4
  /* Custom modules */
5
5
  const createNodeDescriptor_1 = require("../createNodeDescriptor");
6
6
  /* Nodes */
@@ -150,6 +150,10 @@ if (process.env.DISABLE_FEATURE_TRANSCRIPT_MANAGER !== "true") {
150
150
  nodes.push(service_1.AI_AGENT_JOB_CALL_MCP_TOOL);
151
151
  nodes.push(service_1.AI_AGENT_TOOL_ANSWER);
152
152
  nodes.push(service_1.KNOWLEDGE_TOOL);
153
+ nodes.push(service_1.HANDOVER_TO_AI_AGENT_TOOL);
154
+ nodes.push(service_1.HANDOVER_TO_HUMAN_AGENT_TOOL);
155
+ nodes.push(service_1.SEND_EMAIL_TOOL);
156
+ nodes.push(service_1.EXECUTE_WORKFLOW_TOOL);
153
157
  nodes.push(service_1.AI_AGENT_HANDOVER);
154
158
  nodes.push(service_1.LOAD_AI_AGENT);
155
159
  }
@@ -200,4 +204,6 @@ var translationProviders_1 = require("./connectionNodes/translationProviders");
200
204
  Object.defineProperty(exports, "cognigyTranslationProviderModule", { enumerable: true, get: function () { return translationProviders_1.cognigyTranslationProviderModule; } });
201
205
  var documentParserProviders_1 = require("./connectionNodes/documentParserProviders");
202
206
  Object.defineProperty(exports, "cognigyDocumentParserProviderModule", { enumerable: true, get: function () { return documentParserProviders_1.cognigyDocumentParserProviderModule; } });
207
+ var CXoneKnowledgehubProviderModule_1 = require("./service/cxone/knowledgehub/CXoneKnowledgehubProviderModule");
208
+ Object.defineProperty(exports, "niceCXoneKnowledgehubProviderModule", { enumerable: true, get: function () { return CXoneKnowledgehubProviderModule_1.niceCXoneKnowledgehubProviderModule; } });
203
209
  //# sourceMappingURL=index.js.map
@@ -1826,6 +1826,11 @@ DO NOT talk about other topics. Do not offer general assistance.`,
1826
1826
  type: "sayNode",
1827
1827
  },
1828
1828
  tags: ["basic", "message", "nlu"],
1829
+ mocking: {
1830
+ defaultMockCode: `
1831
+ context.result = "Mocked result";
1832
+ `
1833
+ },
1829
1834
  //#endregion DescriptorFields
1830
1835
  function: async ({ cognigy, nodeId, organisationId, config, inputOptions }) => {
1831
1836
  var _a, _b, _c;
@@ -88,6 +88,9 @@ exports.SAY = (0, createNodeDescriptor_1.createNodeDescriptor)({
88
88
  type: "sayNode",
89
89
  },
90
90
  tags: ["basic", "message"],
91
+ mocking: {
92
+ defaultMockCode: `api.say("Hello from Mock Code!");`
93
+ },
91
94
  function: async ({ cognigy, config, nodeId, organisationId, nodeType }) => {
92
95
  var _a, _b, _c, _d, _e, _f, _g;
93
96
  const { api } = cognigy;
@@ -19,6 +19,9 @@ exports.PLACEHOLDER = (0, createNodeDescriptor_1.createNodeDescriptor)({
19
19
  key: "text",
20
20
  label: "UI__NODE_EDITOR__PLACEHOLDER__FIELDS__TEXT__LABEL",
21
21
  type: "text",
22
+ params: {
23
+ multiline: true
24
+ },
22
25
  },
23
26
  {
24
27
  key: "data",
@@ -0,0 +1,239 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EXECUTE_WORKFLOW_TOOL = void 0;
4
+ /* Custom modules */
5
+ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
6
+ const transcripts_1 = require("../../../../interfaces/transcripts/transcripts");
7
+ exports.EXECUTE_WORKFLOW_TOOL = (0, createNodeDescriptor_1.createNodeDescriptor)({
8
+ type: "executeWorkflowTool",
9
+ defaultLabel: "Execute Workflow Tool",
10
+ parentType: ["aiAgentJob", "llmPromptV2"],
11
+ constraints: {
12
+ editable: true,
13
+ deletable: true,
14
+ collapsable: true,
15
+ creatable: true,
16
+ movable: true,
17
+ placement: {
18
+ predecessor: {
19
+ whitelist: []
20
+ }
21
+ },
22
+ childFlowCreatable: false
23
+ },
24
+ behavior: {
25
+ stopping: true
26
+ },
27
+ preview: {
28
+ type: "text",
29
+ key: "toolId"
30
+ },
31
+ fields: [
32
+ {
33
+ key: "toolId",
34
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__TOOL_ID__LABEL",
35
+ description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__TOOL_ID__DESCRIPTION",
36
+ type: "cognigyLLMText",
37
+ defaultValue: "execute_workflow",
38
+ params: {
39
+ required: true,
40
+ rows: 1,
41
+ multiline: false,
42
+ maxLength: 64,
43
+ }
44
+ },
45
+ {
46
+ key: "description",
47
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__DESCRIPTION__LABEL",
48
+ description: "UI__NODE_EDITOR__SERVICE__EXECUTE_WORKFLOW_TOOL__FIELDS__DESCRIPTION__DESCRIPTION",
49
+ type: "cognigyLLMText",
50
+ params: {
51
+ required: true,
52
+ rows: 5,
53
+ multiline: true,
54
+ placeholder: `Describe the action or functionality that the target Flow handles.\nFor example: "Update a booking", "Check order status", or "Start onboarding workflow". Be specific so the AI Agent knows exactly when to execute this Flow.`
55
+ }
56
+ },
57
+ {
58
+ key: "parameters",
59
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__PARAMETERS__LABEL",
60
+ description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__PARAMETERS__DESCRIPTION",
61
+ type: "toolParameters",
62
+ defaultValue: `{
63
+ "type": "object",
64
+ "properties": {
65
+ "execution_reason": {
66
+ "type": "string",
67
+ "description": "The reason for executing this workflow, including context from the conversation."
68
+ }
69
+ },
70
+ "required": ["execution_reason"],
71
+ "additionalProperties": false
72
+ }`,
73
+ params: {
74
+ required: false,
75
+ },
76
+ },
77
+ {
78
+ key: "flowNode",
79
+ type: "flowNode",
80
+ label: "UI__NODE_EDITOR__SERVICE__EXECUTE_WORKFLOW_TOOL__FIELDS__FLOW_NODE__LABEL",
81
+ params: {
82
+ required: true,
83
+ }
84
+ },
85
+ {
86
+ key: "parseIntents",
87
+ type: "toggle",
88
+ label: "UI__NODE_EDITOR__EXECUTE_FLOW__PARSE_INTENTS__LABEL",
89
+ description: "UI__NODE_EDITOR__EXECUTE_FLOW__PARSE_INTENTS__DESCRIPTION",
90
+ defaultValue: false
91
+ },
92
+ {
93
+ key: "parseKeyphrases",
94
+ type: "toggle",
95
+ label: "UI__NODE_EDITOR__EXECUTE_FLOW__PARSE_KEYPHRASES__LABEL",
96
+ description: "UI__NODE_EDITOR__EXECUTE_FLOW__PARSE_KEYPHRASES__DESCRIPTION",
97
+ defaultValue: false
98
+ },
99
+ {
100
+ key: "absorbContext",
101
+ type: "toggle",
102
+ label: "UI__NODE_EDITOR__EXECUTE_FLOW__ABSORB_CONTEXT__LABEL",
103
+ description: "UI__NODE_EDITOR__EXECUTE_FLOW__ABSORB_CONTEXT__DESCRIPTION",
104
+ defaultValue: false
105
+ },
106
+ {
107
+ key: "debugMessage",
108
+ type: "toggle",
109
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__DEBUG_MESSAGE__LABEL",
110
+ description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__DEBUG_MESSAGE__DESCRIPTION",
111
+ defaultValue: true,
112
+ },
113
+ {
114
+ key: "condition",
115
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__CONDITION__LABEL",
116
+ description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__CONDITION__DESCRIPTION",
117
+ type: "cognigyText",
118
+ defaultValue: "",
119
+ },
120
+ ],
121
+ sections: [
122
+ {
123
+ key: "debugging",
124
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_JOB__SECTIONS__DEBUG_SETTINGS__LABEL",
125
+ defaultCollapsed: true,
126
+ fields: [
127
+ "debugMessage",
128
+ ],
129
+ },
130
+ {
131
+ key: "advanced",
132
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_JOB__SECTIONS__ADVANCED__LABEL",
133
+ defaultCollapsed: true,
134
+ fields: [
135
+ "condition",
136
+ "parseIntents",
137
+ "parseKeyphrases",
138
+ "absorbContext",
139
+ ],
140
+ },
141
+ ],
142
+ form: [
143
+ { type: "field", key: "toolId" },
144
+ { type: "field", key: "description" },
145
+ { type: "field", key: "flowNode" },
146
+ { type: "section", key: "debugging" },
147
+ { type: "section", key: "advanced" },
148
+ ],
149
+ appearance: {
150
+ color: "white",
151
+ textColor: "#252525",
152
+ variant: "mini",
153
+ },
154
+ function: async ({ cognigy, config, nodeId: thisNodeId }) => {
155
+ var _a, _b, _c, _d, _e, _f, _g;
156
+ const { api } = cognigy;
157
+ const { debugMessage, flowNode: targetFlowNode, parseIntents, parseKeyphrases, absorbContext, } = config;
158
+ const sessionState = await api.loadSessionState();
159
+ const toolCall = (_a = sessionState.lastToolCall) === null || _a === void 0 ? void 0 : _a.toolCall;
160
+ const aiAgentJobNode = (_b = sessionState.lastToolCall) === null || _b === void 0 ? void 0 : _b.aiAgentJobNode;
161
+ if (!(toolCall === null || toolCall === void 0 ? void 0 : toolCall.id)) {
162
+ (_c = api.logDebugError) === null || _c === void 0 ? void 0 : _c.call(api, "UI__DEBUG_MODE__AI_AGENT_ANSWER__ERROR__MESSAGE");
163
+ }
164
+ if (!(targetFlowNode === null || targetFlowNode === void 0 ? void 0 : targetFlowNode.flow)) {
165
+ throw new Error("Flow is required for Execute Workflow Tool");
166
+ }
167
+ if (toolCall && aiAgentJobNode) {
168
+ if (!((_d = api.checkThink) === null || _d === void 0 ? void 0 : _d.call(api, thisNodeId))) {
169
+ const executionReason = ((_f = (_e = toolCall === null || toolCall === void 0 ? void 0 : toolCall.function) === null || _e === void 0 ? void 0 : _e.arguments) === null || _f === void 0 ? void 0 : _f.execution_reason) || "No reason provided";
170
+ // Optional Debug Message
171
+ if (debugMessage) {
172
+ (_g = api.logDebugMessage) === null || _g === void 0 ? void 0 : _g.call(api, JSON.stringify({
173
+ execution_reason: executionReason,
174
+ target_flow: targetFlowNode.flow,
175
+ target_node: targetFlowNode.node,
176
+ }, null, 2));
177
+ }
178
+ api.resetNextNodes();
179
+ // We add the return to the AI Agent Job node before the executeFlow of the target flow,
180
+ // because we want to return to the AI Agent Job node after the target flow has been executed
181
+ const { flow: thisFlow, node: thisNode } = aiAgentJobNode;
182
+ if (thisFlow && thisNode) {
183
+ await api.executeFlow({
184
+ flowNode: {
185
+ flow: thisFlow,
186
+ node: thisNode,
187
+ },
188
+ absorbContext: true,
189
+ });
190
+ }
191
+ else {
192
+ throw new Error("AI Agent Job Node is required for Execute Workflow Tool");
193
+ }
194
+ // Execute the target flow (mirrors executeFlow functionality)
195
+ await api.executeFlow({
196
+ flowNode: {
197
+ flow: targetFlowNode.flow,
198
+ node: targetFlowNode.node
199
+ },
200
+ absorbContext,
201
+ parseIntents,
202
+ parseKeyphrases
203
+ });
204
+ // Add Tool Call Message to Transcript
205
+ const toolCallTranscriptStep = {
206
+ role: transcripts_1.TranscriptRole.ASSISTANT,
207
+ type: transcripts_1.TranscriptEntryType.TOOL_CALL,
208
+ source: "system",
209
+ payload: {
210
+ name: toolCall.function.name,
211
+ id: toolCall.id,
212
+ input: toolCall.function.arguments,
213
+ }
214
+ };
215
+ await api.addTranscriptStep(toolCallTranscriptStep);
216
+ // Add Tool Answer Message to Transcript
217
+ const toolAnswer = {
218
+ role: transcripts_1.TranscriptRole.TOOL,
219
+ type: transcripts_1.TranscriptEntryType.TOOL_ANSWER,
220
+ source: "system",
221
+ payload: {
222
+ toolCallId: toolCall.id,
223
+ name: toolCall.function.name,
224
+ content: "Workflow executed",
225
+ }
226
+ };
227
+ await api.addTranscriptStep(toolAnswer);
228
+ // Clear the last tool call from session state
229
+ api.updateSessionStateValues({
230
+ lastToolCall: undefined
231
+ });
232
+ }
233
+ else {
234
+ throw new Error("Infinite Loop Detected");
235
+ }
236
+ }
237
+ }
238
+ });
239
+ //# sourceMappingURL=executeWorkflowTool.js.map
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HANDOVER_TO_AI_AGENT_TOOL = void 0;
4
+ /* Custom modules */
5
+ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
6
+ const transcripts_1 = require("../../../../interfaces/transcripts/transcripts");
7
+ exports.HANDOVER_TO_AI_AGENT_TOOL = (0, createNodeDescriptor_1.createNodeDescriptor)({
8
+ type: "handoverToAiAgentTool",
9
+ defaultLabel: "Handover to AI Agent Tool",
10
+ parentType: ["aiAgentJob", "llmPromptV2"],
11
+ constraints: {
12
+ editable: true,
13
+ deletable: true,
14
+ collapsable: true,
15
+ creatable: true,
16
+ movable: true,
17
+ placement: {
18
+ predecessor: {
19
+ whitelist: []
20
+ }
21
+ },
22
+ childFlowCreatable: false
23
+ },
24
+ behavior: {
25
+ stopping: true
26
+ },
27
+ preview: {
28
+ type: "text",
29
+ key: "toolId"
30
+ },
31
+ fields: [
32
+ {
33
+ key: "toolId",
34
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__TOOL_ID__LABEL",
35
+ description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__TOOL_ID__DESCRIPTION",
36
+ type: "cognigyLLMText",
37
+ defaultValue: "handover_to_ai_agent",
38
+ params: {
39
+ required: true,
40
+ rows: 1,
41
+ multiline: false,
42
+ maxLength: 64,
43
+ }
44
+ },
45
+ {
46
+ key: "description",
47
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__DESCRIPTION__LABEL",
48
+ description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__DESCRIPTION__DESCRIPTION",
49
+ type: "cognigyLLMText",
50
+ params: {
51
+ required: true,
52
+ rows: 5,
53
+ multiline: true,
54
+ placeholder: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AI_AGENT_TOOL__FIELDS__DESCRIPTION__PLACEHOLDER"
55
+ }
56
+ },
57
+ {
58
+ key: "parameters",
59
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__PARAMETERS__LABEL",
60
+ description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__PARAMETERS__DESCRIPTION",
61
+ type: "toolParameters",
62
+ defaultValue: `{
63
+ "type": "object",
64
+ "properties": {
65
+ "handover_reason": {
66
+ "type": "string",
67
+ "description": "The reason for handing over to the AI Agent, including context from the conversation."
68
+ }
69
+ },
70
+ "required": ["handover_reason"],
71
+ "additionalProperties": false
72
+ }`,
73
+ params: {
74
+ required: false,
75
+ },
76
+ },
77
+ {
78
+ key: "flowNode",
79
+ type: "flowNode",
80
+ label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AI_AGENT_TOOL__FIELDS__FLOW_NODE__LABEL",
81
+ params: {
82
+ required: true,
83
+ nodeTypeFilter: ["aiAgentJob"]
84
+ }
85
+ },
86
+ {
87
+ key: "debugMessage",
88
+ type: "toggle",
89
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__DEBUG_MESSAGE__LABEL",
90
+ description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__DEBUG_MESSAGE__DESCRIPTION",
91
+ defaultValue: true,
92
+ },
93
+ {
94
+ key: "condition",
95
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__CONDITION__LABEL",
96
+ description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__CONDITION__DESCRIPTION",
97
+ type: "cognigyText",
98
+ defaultValue: "",
99
+ },
100
+ ],
101
+ sections: [
102
+ {
103
+ key: "debugging",
104
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_JOB__SECTIONS__DEBUG_SETTINGS__LABEL",
105
+ defaultCollapsed: true,
106
+ fields: [
107
+ "debugMessage",
108
+ ],
109
+ },
110
+ {
111
+ key: "advanced",
112
+ label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_JOB__SECTIONS__ADVANCED__LABEL",
113
+ defaultCollapsed: true,
114
+ fields: [
115
+ "condition",
116
+ ],
117
+ },
118
+ ],
119
+ form: [
120
+ { type: "field", key: "toolId" },
121
+ { type: "field", key: "description" },
122
+ { type: "field", key: "flowNode" },
123
+ { type: "section", key: "debugging" },
124
+ { type: "section", key: "advanced" },
125
+ ],
126
+ appearance: {
127
+ color: "white",
128
+ textColor: "#252525",
129
+ variant: "mini",
130
+ },
131
+ function: async ({ cognigy, config, nodeId: thisNodeId }) => {
132
+ var _a, _b, _c, _d, _e, _f;
133
+ const { api } = cognigy;
134
+ const { debugMessage, flowNode } = config;
135
+ const sessionState = await api.loadSessionState();
136
+ const toolCall = (_a = sessionState.lastToolCall) === null || _a === void 0 ? void 0 : _a.toolCall;
137
+ if (!(toolCall === null || toolCall === void 0 ? void 0 : toolCall.id)) {
138
+ (_b = api.logDebugError) === null || _b === void 0 ? void 0 : _b.call(api, "UI__DEBUG_MODE__AI_AGENT_ANSWER__ERROR__MESSAGE");
139
+ }
140
+ if (!(flowNode === null || flowNode === void 0 ? void 0 : flowNode.flow) || !(flowNode === null || flowNode === void 0 ? void 0 : flowNode.node)) {
141
+ throw new Error("Flow Node is required for Handover to AI Agent Tool");
142
+ }
143
+ if (toolCall) {
144
+ if (!((_c = api.checkThink) === null || _c === void 0 ? void 0 : _c.call(api, thisNodeId))) {
145
+ const handoverReason = ((_e = (_d = toolCall === null || toolCall === void 0 ? void 0 : toolCall.function) === null || _d === void 0 ? void 0 : _d.arguments) === null || _e === void 0 ? void 0 : _e.handover_reason) || "Handover requested";
146
+ // Optional Debug Message
147
+ if (debugMessage) {
148
+ (_f = api.logDebugMessage) === null || _f === void 0 ? void 0 : _f.call(api, JSON.stringify({ handover_reason: handoverReason, target_flow: flowNode.flow, target_node: flowNode.node }, null, 2));
149
+ }
150
+ // Add Tool Call Message to Transcript
151
+ const toolCallTranscriptStep = {
152
+ role: transcripts_1.TranscriptRole.ASSISTANT,
153
+ type: transcripts_1.TranscriptEntryType.TOOL_CALL,
154
+ source: "system",
155
+ payload: {
156
+ name: toolCall.function.name,
157
+ id: toolCall.id,
158
+ input: toolCall.function.arguments,
159
+ }
160
+ };
161
+ await api.addTranscriptStep(toolCallTranscriptStep);
162
+ // Add Tool Answer Message to Transcript
163
+ const toolAnswer = {
164
+ role: transcripts_1.TranscriptRole.TOOL,
165
+ type: transcripts_1.TranscriptEntryType.TOOL_ANSWER,
166
+ source: "system",
167
+ payload: {
168
+ toolCallId: toolCall.id,
169
+ name: toolCall.function.name,
170
+ content: `Handover to AI Agent initiated. Reason: ${handoverReason}`,
171
+ }
172
+ };
173
+ await api.addTranscriptStep(toolAnswer);
174
+ api.resetNextNodes();
175
+ api.updateSessionStateValues({
176
+ lastToolCall: undefined
177
+ });
178
+ await api.executeFlow({
179
+ flowNode: {
180
+ flow: flowNode.flow,
181
+ node: flowNode.node,
182
+ },
183
+ absorbContext: true,
184
+ });
185
+ }
186
+ else {
187
+ throw new Error("Infinite Loop Detected");
188
+ }
189
+ }
190
+ }
191
+ });
192
+ //# sourceMappingURL=handoverToAiAgentTool.js.map