@cognigy/rest-api-client 2025.11.0 → 2025.13.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 (103) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/RestAPIClient.js +7 -0
  3. package/build/apigroups/ResourcesAPIGroup_2_0.js +4 -0
  4. package/build/apigroups/SimulationAPIGroup_2_0.js +58 -0
  5. package/build/apigroups/index.js +3 -1
  6. package/build/shared/charts/descriptors/analytics/trackGoal.js +3 -1
  7. package/build/shared/charts/descriptors/index.js +7 -1
  8. package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +4 -2
  9. package/build/shared/charts/descriptors/message/question/question.js +24 -5
  10. package/build/shared/charts/descriptors/service/GPTPrompt.js +15 -1
  11. package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +32 -173
  12. package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobTool.js +2 -2
  13. package/build/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +175 -0
  14. package/build/shared/charts/descriptors/service/aiAgent/loadAiAgent.js +194 -0
  15. package/build/shared/charts/descriptors/service/aiOpsCenterConnection.js +12 -0
  16. package/build/shared/charts/descriptors/service/handoverV2.js +1 -1
  17. package/build/shared/charts/descriptors/service/index.js +13 -1
  18. package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +922 -0
  19. package/build/shared/charts/descriptors/service/llmPrompt/llmPromptDefault.js +31 -0
  20. package/build/shared/charts/descriptors/service/llmPrompt/llmPromptMCPTool.js +196 -0
  21. package/build/shared/charts/descriptors/service/llmPrompt/llmPromptTool.js +139 -0
  22. package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +2 -2
  23. package/build/shared/constants.js +1 -5
  24. package/build/shared/interfaces/debugEvents/IGoalCompletedEventPayload.js +3 -0
  25. package/build/shared/interfaces/debugEvents/TDebugEventType.js +1 -0
  26. package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +12 -1
  27. package/build/shared/interfaces/resources/IAuditEvent.js +3 -0
  28. package/build/shared/interfaces/resources/ILargeLanguageModel.js +1 -0
  29. package/build/shared/interfaces/resources/TResourceType.js +2 -0
  30. package/build/shared/interfaces/resources/TRestChannelType.js +5 -0
  31. package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeChunk.js +2 -1
  32. package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +5 -18
  33. package/build/shared/interfaces/restAPI/operations/generateOutput/v2.0/index.js +3 -0
  34. package/build/shared/interfaces/restAPI/opsCenter/observationConfig/IOpsCenterObservationConfig.js +1 -1
  35. package/build/shared/interfaces/restAPI/simulation/simulation/ICreateSimulationRest_2_0.js +3 -0
  36. package/build/shared/interfaces/restAPI/simulation/simulation/IDeleteSimulationRest_2_0.js +3 -0
  37. package/build/shared/interfaces/restAPI/simulation/simulation/IIndexSimulationRest_2_0.js +3 -0
  38. package/build/shared/interfaces/restAPI/simulation/simulation/IReadSimulationRest_2_0.js +3 -0
  39. package/build/shared/interfaces/restAPI/simulation/simulation/IScheduleSimulationRest_2_0.js +3 -0
  40. package/build/shared/interfaces/restAPI/simulation/simulation/ISimulationRest_2_0.js +9 -0
  41. package/build/shared/interfaces/restAPI/simulation/simulation/IUpdateSimulationRest_2_0.js +3 -0
  42. package/build/shared/interfaces/restAPI/simulation/simulationRun/IIndexSimulationRunRest_2_0.js +3 -0
  43. package/build/shared/interfaces/restAPI/simulation/simulationRun/IReadSimulationRunRest_2_0.js +3 -0
  44. package/build/shared/interfaces/restAPI/simulation/simulationRun/ISimulationRunRest_2_0.js +19 -0
  45. package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/IGetAllSimulationRunBatchRest_2_0.js +3 -0
  46. package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/IIndexSimulationRunBatchRest_2_0.js +3 -0
  47. package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/IReadSimulationRunBatchRest_2_0.js +3 -0
  48. package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/ISimulationRunBatchRest_2_0.js +9 -0
  49. package/build/shared/interfaces/security/IPermission.js +2 -0
  50. package/build/shared/interfaces/security/IRole.js +3 -1
  51. package/build/shared/interfaces/security/index.js +1 -1
  52. package/dist/esm/RestAPIClient.js +7 -0
  53. package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +4 -0
  54. package/dist/esm/apigroups/SimulationAPIGroup_2_0.js +44 -0
  55. package/dist/esm/apigroups/index.js +1 -0
  56. package/dist/esm/shared/charts/descriptors/analytics/trackGoal.js +3 -1
  57. package/dist/esm/shared/charts/descriptors/index.js +8 -2
  58. package/dist/esm/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +4 -2
  59. package/dist/esm/shared/charts/descriptors/message/question/question.js +24 -5
  60. package/dist/esm/shared/charts/descriptors/service/GPTPrompt.js +15 -1
  61. package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +33 -174
  62. package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJobTool.js +2 -2
  63. package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +172 -0
  64. package/dist/esm/shared/charts/descriptors/service/aiAgent/loadAiAgent.js +192 -0
  65. package/dist/esm/shared/charts/descriptors/service/aiOpsCenterConnection.js +9 -0
  66. package/dist/esm/shared/charts/descriptors/service/handoverV2.js +1 -1
  67. package/dist/esm/shared/charts/descriptors/service/index.js +6 -0
  68. package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +909 -0
  69. package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptDefault.js +28 -0
  70. package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptMCPTool.js +193 -0
  71. package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptTool.js +136 -0
  72. package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +2 -2
  73. package/dist/esm/shared/constants.js +1 -5
  74. package/dist/esm/shared/interfaces/debugEvents/IGoalCompletedEventPayload.js +2 -0
  75. package/dist/esm/shared/interfaces/debugEvents/TDebugEventType.js +1 -0
  76. package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +12 -1
  77. package/dist/esm/shared/interfaces/resources/IAuditEvent.js +3 -0
  78. package/dist/esm/shared/interfaces/resources/ILargeLanguageModel.js +1 -0
  79. package/dist/esm/shared/interfaces/resources/TResourceType.js +2 -0
  80. package/dist/esm/shared/interfaces/resources/TRestChannelType.js +5 -0
  81. package/dist/esm/shared/interfaces/resources/knowledgeStore/IKnowledgeChunk.js +2 -1
  82. package/dist/esm/shared/interfaces/resources/settings/IGenerativeAISettings.js +4 -17
  83. package/dist/esm/shared/interfaces/restAPI/operations/generateOutput/v2.0/index.js +2 -0
  84. package/dist/esm/shared/interfaces/restAPI/opsCenter/observationConfig/IOpsCenterObservationConfig.js +1 -1
  85. package/dist/esm/shared/interfaces/restAPI/simulation/simulation/ICreateSimulationRest_2_0.js +2 -0
  86. package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IDeleteSimulationRest_2_0.js +2 -0
  87. package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IIndexSimulationRest_2_0.js +2 -0
  88. package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IReadSimulationRest_2_0.js +2 -0
  89. package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IScheduleSimulationRest_2_0.js +2 -0
  90. package/dist/esm/shared/interfaces/restAPI/simulation/simulation/ISimulationRest_2_0.js +6 -0
  91. package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IUpdateSimulationRest_2_0.js +2 -0
  92. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRun/IIndexSimulationRunRest_2_0.js +2 -0
  93. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRun/IReadSimulationRunRest_2_0.js +2 -0
  94. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRun/ISimulationRunRest_2_0.js +16 -0
  95. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/IGetAllSimulationRunBatchRest_2_0.js +2 -0
  96. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/IIndexSimulationRunBatchRest_2_0.js +2 -0
  97. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/IReadSimulationRunBatchRest_2_0.js +2 -0
  98. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/ISimulationRunBatchRest_2_0.js +6 -0
  99. package/dist/esm/shared/interfaces/security/IPermission.js +2 -0
  100. package/dist/esm/shared/interfaces/security/IRole.js +3 -1
  101. package/dist/esm/shared/interfaces/security/index.js +1 -1
  102. package/package.json +1 -1
  103. package/types/index.d.ts +394 -45
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IReadSimulationRunBatchRest_2_0.js.map
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationRunBatchStatus = void 0;
4
+ exports.SimulationRunBatchStatus = [
5
+ "IN_PROGRESS",
6
+ "COMPLETED",
7
+ "FAILED"
8
+ ];
9
+ //# sourceMappingURL=ISimulationRunBatchRest_2_0.js.map
@@ -74,6 +74,7 @@ exports.organisationWidePermissions = [
74
74
  * - functions
75
75
  * - yesNoIntents
76
76
  * - dataPrivacySettings
77
+ * - simulator
77
78
  */
78
79
  exports.projectWidePermissions = [
79
80
  "agentAssistConfigs",
@@ -113,6 +114,7 @@ exports.projectWidePermissions = [
113
114
  "tokens",
114
115
  "yesNoIntents",
115
116
  "dataPrivacySettings",
117
+ "simulator"
116
118
  ];
117
119
  exports.availablePermissions = [
118
120
  ...exports.organisationWidePermissions,
@@ -88,6 +88,7 @@ exports.organisationWideRoles = [
88
88
  * - tokenEditor
89
89
  * - function_admin
90
90
  * - function_editor
91
+ * - simulator_admin
91
92
  */
92
93
  exports.projectWideRoles = [
93
94
  "agentAssistConfigAdmin",
@@ -129,7 +130,8 @@ exports.projectWideRoles = [
129
130
  "tokenEditor",
130
131
  "data_privacy_admin",
131
132
  "data_privacy_editor",
132
- "data_privacy_viewer"
133
+ "data_privacy_viewer",
134
+ "simulator_admin"
133
135
  ];
134
136
  exports.availableRoles = [
135
137
  ...exports.organisationWideRoles,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.identityProviderSchema = exports.oidcIdentityProviderDataSchema = exports.samlIdentityProviderDataSchema = exports.operations = exports.availableRoles = exports.projectWideRoles = exports.organisationWideRoles = exports.availablePermissions = exports.COMPUTED_ACL_HASH_VERSION = void 0;
4
- exports.COMPUTED_ACL_HASH_VERSION = "v19";
4
+ exports.COMPUTED_ACL_HASH_VERSION = "v20";
5
5
  var IPermission_1 = require("./IPermission");
6
6
  Object.defineProperty(exports, "availablePermissions", { enumerable: true, get: function () { return IPermission_1.availablePermissions; } });
7
7
  var IRole_1 = require("./IRole");
@@ -15,6 +15,7 @@ import { ResourcesAPIGroup_2_0 } from "./apigroups/ResourcesAPIGroup_2_0";
15
15
  import { SessionsAPIGroup_2_0 } from "./apigroups/SessionsAPIGroup_2_0";
16
16
  import { setLogger } from "./shared/helper/logger";
17
17
  import { AIOpsCenterAPIGroup_2_0 } from "./apigroups/AIOpsCenterAPIGroup_2_0";
18
+ import { SimulationAPIGroup_2_0 } from "./apigroups/SimulationAPIGroup_2_0";
18
19
  export const RestAPIClient = function (config) {
19
20
  var _a;
20
21
  if (!(this instanceof RestAPIClient)) {
@@ -89,6 +90,12 @@ export const RestAPIClient = function (config) {
89
90
  plugins.push(AIOpsCenterAPIGroup_2_0);
90
91
  break;
91
92
  }
93
+ switch (config.versions.simulation) {
94
+ default:
95
+ case "2.0":
96
+ plugins.push(SimulationAPIGroup_2_0);
97
+ break;
98
+ }
92
99
  const Client = Base.plugin(plugins);
93
100
  Client.config = config;
94
101
  Client.prototype.getHttpAdapter = () => {
@@ -615,6 +615,10 @@ export const ResourcesAPIGroup_2_0 = (instance) => {
615
615
  generateNluScores: (_a) => {
616
616
  var { projectId } = _a, args = __rest(_a, ["projectId"]);
617
617
  return GenericAPIFn(`/new/v2.0/projects/${projectId}/nlu/scores`, "POST", self)(args);
618
+ },
619
+ generateDesignTimeLLMOutput: (_a) => {
620
+ var { projectId } = _a, args = __rest(_a, ["projectId"]);
621
+ return GenericAPIFn(`/new/v2.0/projects/${projectId}/generate-output/design-time-llm`, "POST", self)(args);
618
622
  }
619
623
  };
620
624
  };
@@ -0,0 +1,44 @@
1
+ import { __rest } from "tslib";
2
+ import { GenericAPIFn } from "../GenericAPIFn";
3
+ import { stringifyQuery } from "../shared/helper/rest/query";
4
+ export function SimulationAPIGroup_2_0(instance) {
5
+ const self = instance;
6
+ return {
7
+ indexSimulations: (args, options) => GenericAPIFn(`/testing/beta/simulations?${stringifyQuery(args)}`, "GET", self)(undefined, options),
8
+ createSimulation: (args, options) => GenericAPIFn("/testing/beta/simulations", "POST", self)(args, options),
9
+ updateSimulation: (_a, options) => {
10
+ var { simulationReference, projectId } = _a, args = __rest(_a, ["simulationReference", "projectId"]);
11
+ return GenericAPIFn(`/testing/beta/simulations/${simulationReference}?${stringifyQuery({
12
+ projectId
13
+ })}`, "PATCH", self)(args, options);
14
+ },
15
+ deleteSimulation: ({ simulationReference, projectId }, options) => GenericAPIFn(`/testing/beta/simulations/${simulationReference}?${stringifyQuery({
16
+ projectId
17
+ })}`, "DELETE", self)(undefined, options),
18
+ readSimulation: ({ simulationReference, projectId }, options) => GenericAPIFn(`/testing/beta/simulations/${simulationReference}?${stringifyQuery({
19
+ projectId
20
+ })}`, "GET", self)(undefined, options),
21
+ scheduleSimulation: (_a, options) => {
22
+ var { simulationReference } = _a, args = __rest(_a, ["simulationReference"]);
23
+ return GenericAPIFn(`/testing/beta/simulations/${simulationReference}/schedule`, "POST", self)(args, options);
24
+ },
25
+ indexSimulationRunBatches: (args, options) => GenericAPIFn(`/testing/beta/simulations/batches?${stringifyQuery(args)}`, "GET", self)(undefined, options),
26
+ getAllSimulationRunBatches: (_a, options) => {
27
+ var { simulationReference } = _a, args = __rest(_a, ["simulationReference"]);
28
+ return GenericAPIFn(`/testing/beta/simulations/${simulationReference}/batches?${stringifyQuery(args)}`, "GET", self)(undefined, options);
29
+ },
30
+ readSimulationRunBatch: (_a, options) => {
31
+ var { simulationReference, simulationRunBatchReference } = _a, args = __rest(_a, ["simulationReference", "simulationRunBatchReference"]);
32
+ return GenericAPIFn(`/testing/beta/simulations/${simulationReference}/batches/${simulationRunBatchReference}?${stringifyQuery(args)}`, "GET", self)(undefined, options);
33
+ },
34
+ indexSimulationRuns: (_a, options) => {
35
+ var { simulationReference, simulationRunBatchReference } = _a, args = __rest(_a, ["simulationReference", "simulationRunBatchReference"]);
36
+ return GenericAPIFn(`/testing/beta/simulations/${simulationReference}/batches/${simulationRunBatchReference}/runs?${stringifyQuery(args)}`, "GET", self)(undefined, options);
37
+ },
38
+ readSimulationRun: (_a, options) => {
39
+ var { simulationReference, simulationRunBatchReference, simulationRunReference } = _a, args = __rest(_a, ["simulationReference", "simulationRunBatchReference", "simulationRunReference"]);
40
+ return GenericAPIFn(`/testing/beta/simulations/${simulationReference}/batches/${simulationRunBatchReference}/runs/${simulationRunReference}?${stringifyQuery(args)}`, "GET", self)(undefined, options);
41
+ }
42
+ };
43
+ }
44
+ //# sourceMappingURL=SimulationAPIGroup_2_0.js.map
@@ -11,4 +11,5 @@ export { ResourcesAPIGroup_2_0 } from "./ResourcesAPIGroup_2_0";
11
11
  export { SessionsAPIGroup_2_0 } from "./SessionsAPIGroup_2_0";
12
12
  export { AnalyticsAPIGroup_2_0 } from "./AnalyticsAPIGroup_2_0";
13
13
  export { AIOpsCenterAPIGroup_2_0 } from "./AIOpsCenterAPIGroup_2_0";
14
+ export { SimulationAPIGroup_2_0 } from "./SimulationAPIGroup_2_0";
14
15
  //# sourceMappingURL=index.js.map
@@ -45,7 +45,7 @@ export const TRACK_GOAL = createNodeDescriptor({
45
45
  return;
46
46
  }
47
47
  const sessionState = api.getSessionStateCopy();
48
- const { selectedSteps, version, name, goalId, } = config.goal;
48
+ const { selectedSteps, referenceId, version, name, goalId, } = config.goal;
49
49
  const activeCycleIds = ((_a = sessionState.analytics) === null || _a === void 0 ? void 0 : _a.goalCycleIds) || {};
50
50
  let cycleId = activeCycleIds[goalId];
51
51
  const hasStartStep = selectedSteps.some(step => step.type === "start");
@@ -73,10 +73,12 @@ export const TRACK_GOAL = createNodeDescriptor({
73
73
  organisationId,
74
74
  sessionId,
75
75
  version,
76
+ referenceId,
76
77
  timestamp: new Date(),
77
78
  goalCycleId: cycleId,
78
79
  goalId,
79
80
  stepId: step.stepId,
81
+ stepType: step.type,
80
82
  endpointUrlToken,
81
83
  endpointName,
82
84
  endpointType,
@@ -11,7 +11,7 @@ import { REGEX_SLOT_FILLER, EXECUTE_COGNIGY_NLU, ADD_LEXICON_KEYPHRASE, FUZZY_SE
11
11
  import { KNOWLEDGE_SEARCH, KNOWLEDGE_SEARCH_V2, SEARCH_EXTRACT_OUTPUT } from "./knowledgeSearch";
12
12
  import { CONTINUOUS_ASR, DTMF, HANG_UP, PLAY, TRANSFER_VOICE, SESSION_SPEECH_PARAMETERS, USER_INPUT_TIMEOUT, SEND_METADATA, BARGE_IN, MUTE_SPEECH_INPUT, } from "./voice";
13
13
  import { ACTIVATE_PROFILE, COMPLETE_GOAL, DEACTIVATE_PROFILE, DELETE_PROFILE, MERGE_PROFILE, UPDATE_PROFILE, ADD_MEMORY, BLIND_MODE, OVERWRITE_ANALYTICS, SET_RATING, REQUEST_RATING, TRACK_GOAL, } from "./analytics";
14
- import { HANDOVER, HANDOVER_V2, CHECK_AGENT_AVAILABILITY, HTTP_REQUEST, HTTP_CONNECTION_BASIC, HTTP_CONNECTION_APIKEYAUTHKEY, HTTP_CONNECTION_APIKEYXKEY, HTTP_CONNECTION_OAUTH2, JWT_SECRET_CONNECTION, TRIGGER_FUNCTION, ON_SCHEDULING_ERROR, ON_SCHEDULED, GPT_PROMPT, CLOSE_HANDOVER, HANDOVER_INACTIVITY_TIMER, GPT_CONVERSATION, GPT_CONVERSATION_SUMMARY, LLM_ENTITY_EXTRACT, AI_AGENT_JOB, AI_AGENT_JOB_DEFAULT, AI_AGENT_JOB_TOOL, AI_AGENT_JOB_MCP_TOOL, AI_AGENT_JOB_CALL_MCP_TOOL, AI_AGENT_TOOL_ANSWER, AI_AGENT_HANDOVER, LIVE_AGENT_CONNECTION, RINGCENTRAL_ENGAGE_CONNECTION, CHATWOOT_CONNECTION, EIGHT_BY_EIGHT_CONNECTION, GENESYS_CLOUD_CONNECTION, GENESYS_CLOUD_CONNECTION_OM, LLM_MODERATE, NICECXONEAAH_AUTHENTICATION_CONNECTION } from "./service";
14
+ import { HANDOVER, HANDOVER_V2, CHECK_AGENT_AVAILABILITY, HTTP_REQUEST, HTTP_CONNECTION_BASIC, HTTP_CONNECTION_APIKEYAUTHKEY, HTTP_CONNECTION_APIKEYXKEY, HTTP_CONNECTION_OAUTH2, JWT_SECRET_CONNECTION, TRIGGER_FUNCTION, ON_SCHEDULING_ERROR, ON_SCHEDULED, GPT_PROMPT, LLM_PROMPT_V2, LLM_PROMPT_DEFAULT, LLM_PROMPT_MCP_TOOL, LLM_PROMPT_TOOL, CLOSE_HANDOVER, HANDOVER_INACTIVITY_TIMER, GPT_CONVERSATION, GPT_CONVERSATION_SUMMARY, LLM_ENTITY_EXTRACT, AI_AGENT_JOB, AI_AGENT_JOB_DEFAULT, AI_AGENT_JOB_TOOL, AI_AGENT_JOB_MCP_TOOL, AI_AGENT_JOB_CALL_MCP_TOOL, AI_AGENT_TOOL_ANSWER, AI_AGENT_HANDOVER, LIVE_AGENT_CONNECTION, RINGCENTRAL_ENGAGE_CONNECTION, CHATWOOT_CONNECTION, EIGHT_BY_EIGHT_CONNECTION, GENESYS_CLOUD_CONNECTION, GENESYS_CLOUD_CONNECTION_OM, LLM_MODERATE, NICECXONEAAH_AUTHENTICATION_CONNECTION, LOAD_AI_AGENT, AIOPS_CENTER_WEBHOOKS_CONNECTION } from "./service";
15
15
  import { INIT_APP_SESSION, GET_APP_SESSION_PIN, SET_HTML_APP_STATE, SET_ADAPTIVE_CARD_APP_STATE, } from "./apps";
16
16
  import { SET_IFRAME_TILE, SET_HTML_TILE, SEND_TILE_DATA, SET_SECURE_FORMS_TILE, SET_ADAPTIVE_CARD_TILE, SET_AGENT_ASSIST_GRID, NEXT_ACTION_ASSIST, SENTIMENT_ASSIST, TRANSCRIPT_ASSIST, IDENTITY_ASSIST, KNOWLEDGE_ASSIST, } from "./agentAssist";
17
17
  import { ASSIST_INFO } from "./liveAgent";
@@ -88,6 +88,10 @@ const nodes = [
88
88
  CHECK_AGENT_AVAILABILITY,
89
89
  HTTP_REQUEST,
90
90
  GPT_PROMPT,
91
+ LLM_PROMPT_V2,
92
+ LLM_PROMPT_DEFAULT,
93
+ LLM_PROMPT_MCP_TOOL,
94
+ LLM_PROMPT_TOOL,
91
95
  GPT_CONVERSATION,
92
96
  GPT_CONVERSATION_SUMMARY,
93
97
  LLM_ENTITY_EXTRACT,
@@ -143,6 +147,7 @@ if (process.env.DISABLE_FEATURE_TRANSCRIPT_MANAGER !== "true") {
143
147
  nodes.push(AI_AGENT_JOB_CALL_MCP_TOOL);
144
148
  nodes.push(AI_AGENT_TOOL_ANSWER);
145
149
  nodes.push(AI_AGENT_HANDOVER);
150
+ nodes.push(LOAD_AI_AGENT);
146
151
  }
147
152
  if (process.env.FEATURE_USE_COGNIGY_LIVE_AGENT === "true") {
148
153
  nodes.push(ASSIST_INFO);
@@ -164,7 +169,8 @@ export const cognigyBasicModule = createExtension({
164
169
  EIGHT_BY_EIGHT_CONNECTION,
165
170
  GENESYS_CLOUD_CONNECTION,
166
171
  GENESYS_CLOUD_CONNECTION_OM,
167
- NICECXONEAAH_AUTHENTICATION_CONNECTION
172
+ NICECXONEAAH_AUTHENTICATION_CONNECTION,
173
+ AIOPS_CENTER_WEBHOOKS_CONNECTION,
168
174
  ],
169
175
  });
170
176
  export { cognigyMongoDBModule } from "./connectionNodes/mongoDB";
@@ -582,10 +582,12 @@ export const SEARCH_EXTRACT_OUTPUT = createNodeDescriptor({
582
582
  // as it doesn't make sense to check for follow ups in the first execution
583
583
  if (input.execution > 1) {
584
584
  // always remember the last thing the user said (needed later)
585
- lastRoundTrip = (_b = cognigy.lastConversationEntries) === null || _b === void 0 ? void 0 : _b.slice(1, 3).reverse().map(entry => "- " + (entry.source === "user" ? "USER: " : "BOT: ") + entry.text).join("\n");
585
+ lastRoundTrip = (_b = cognigy
586
+ .lastConversationEntries) === null || _b === void 0 ? void 0 : _b.slice(1, followUpDetectionSteps + 1).reverse().map(entry => "- " + (entry.source === "user" ? "USER: " : "BOT: ") + entry.text).join("\n");
586
587
  // if follow up detection is set to 2 or more, we use the conversation transcript
587
588
  // as reference. Start at the second entry, because the first one is the current
588
- const recentConversation = (_c = cognigy.lastConversationEntries) === null || _c === void 0 ? void 0 : _c.slice(1, followUpDetectionSteps + 1).reverse().map(entry => "- " + (entry.source === "user" ? "USER: " : "BOT: ") + entry.text).join("\n");
589
+ const recentConversation = (_c = cognigy
590
+ .lastConversationEntries) === null || _c === void 0 ? void 0 : _c.slice(1, followUpDetectionSteps + 1).reverse().map(entry => "- " + (entry.source === "user" ? "USER: " : "BOT: ") + entry.text).join("\n");
589
591
  prompt = `Below is the transcript of a conversation:
590
592
  ${recentConversation}
591
593
  USER: ${searchString}
@@ -307,7 +307,7 @@ export const QUESTION = createNodeDescriptor({
307
307
  },
308
308
  {
309
309
  key: "repromptLLMPrompt",
310
- type: "cognigyText",
310
+ type: "cognigyLLMText",
311
311
  label: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__REPROMPT_LLM_PROMPT__LABEL",
312
312
  description: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__REPROMPT_LLM_PROMPT__DESCRIPTION",
313
313
  defaultValue: `You are a chatbot that helps a user.
@@ -740,6 +740,17 @@ DO NOT talk about other topics. Do not offer general assistance.`,
740
740
  },
741
741
  defaultValue: true,
742
742
  },
743
+ {
744
+ key: "escalateAnswersRepeatHandoverMessage",
745
+ type: "toggle",
746
+ label: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__ESCALATE_ANSWERS_REPEAT_HANDOVER_MESSAGE__LABEL",
747
+ description: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__ESCALATE_ANSWERS_REPEAT_HANDOVER_MESSAGE__DESCRIPTION",
748
+ defaultValue: false,
749
+ condition: {
750
+ key: "escalateAnswersAction",
751
+ value: "handover"
752
+ }
753
+ },
743
754
  {
744
755
  key: "escalateAnswersHandoverCancelIntent",
745
756
  type: "cognigyText",
@@ -2407,6 +2418,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2407
2418
  api.logDebugMessage(`UI__DEBUG_MODE__QUESTION__MESSAGE_5`, "Skipping Reprompt Message");
2408
2419
  sayReprompt = false;
2409
2420
  }
2421
+ let nodeType = "question";
2410
2422
  // We will only output a reprompt if the user is not in the first execution
2411
2423
  // and no skip condition is true
2412
2424
  if ((validationMessage || repromptType) && !isFirstExecution && sayReprompt) {
@@ -2417,9 +2429,13 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2417
2429
  rephraseWithAIParams.question = say.text[0];
2418
2430
  rephraseWithAIParams.answer = input.text;
2419
2431
  if (sayReprompt) {
2432
+ nodeType = "question.reprompt";
2420
2433
  switch (repromptType) {
2421
2434
  case "say":
2422
- yield SAY.function(Object.assign({ nodeType: "question.reprompt", cognigy, childConfigs: [], nodeId, organisationId, config: { preventTranscript, say: repromptSay } }, rephraseWithAIParams));
2435
+ if ((input === null || input === void 0 ? void 0 : input.channel) === "voiceGateway2" && !validationRepeat) {
2436
+ nodeType = "question";
2437
+ }
2438
+ yield SAY.function(Object.assign({ nodeType, cognigy, childConfigs: [], nodeId, organisationId, config: { preventTranscript, say: repromptSay } }, rephraseWithAIParams));
2423
2439
  break;
2424
2440
  case "execute":
2425
2441
  // if a question reprompt is set to execute flow and we have just executed
@@ -2468,11 +2484,14 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2468
2484
  }
2469
2485
  const repromptMessage = yield api.runGenerativeAIPrompt(data, "gptPromptNode");
2470
2486
  if (!repromptLLMStream) {
2471
- yield SAY.function({ nodeType: "question.reprompt", cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [repromptMessage] } }, rephraseWithAIParams) });
2487
+ yield SAY.function({ nodeType, cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [repromptMessage] } }, rephraseWithAIParams) });
2472
2488
  }
2473
2489
  break;
2474
2490
  default: // this is also "text"
2475
- yield SAY.function({ nodeType: "question.reprompt", cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [validationMessage] } }, rephraseWithAIParams) });
2491
+ if ((input === null || input === void 0 ? void 0 : input.channel) === "voiceGateway2" && !validationRepeat) {
2492
+ nodeType = "question";
2493
+ }
2494
+ yield SAY.function({ nodeType, cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [validationMessage] } }, rephraseWithAIParams) });
2476
2495
  }
2477
2496
  }
2478
2497
  /* If repeat toggle is on, also output question (and maybe datepicker) again */
@@ -2497,7 +2516,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2497
2516
  rephraseWithAIParams.promptType = "question";
2498
2517
  rephraseWithAIParams.questionType = config.type;
2499
2518
  yield SAY.function({
2500
- nodeType: "question.initial",
2519
+ nodeType,
2501
2520
  cognigy,
2502
2521
  childConfigs: [],
2503
2522
  nodeId,
@@ -5,9 +5,10 @@ import { GO_TO } from "../logic";
5
5
  import { randomUUID } from 'crypto';
6
6
  import { createLastConverationString, createLastConversationChatObject, createLastUserInputString, writeLLMDebugLogs } from "../nlu/generativeSlotFiller/prompt";
7
7
  import { InternalServerError } from "../../../errors";
8
+ import { TranscriptEntryType, TranscriptRole } from "../../../interfaces/transcripts/transcripts";
8
9
  export const GPT_PROMPT = createNodeDescriptor({
9
10
  type: "completeText",
10
- defaultLabel: "LLM Prompt",
11
+ defaultLabel: "LLM Prompt (legacy)",
11
12
  summary: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__DESCRIPTION",
12
13
  fields: [
13
14
  {
@@ -643,6 +644,7 @@ export const GPT_PROMPT = createNodeDescriptor({
643
644
  api.output(text, {
644
645
  _cognigy: {
645
646
  _messageId,
647
+ _preventTranscript: true
646
648
  }
647
649
  });
648
650
  }
@@ -700,6 +702,18 @@ export const GPT_PROMPT = createNodeDescriptor({
700
702
  const resultToOutput = typeof ((response === null || response === void 0 ? void 0 : response.result) || response) === "object" ? JSON.stringify((response === null || response === void 0 ? void 0 : response.result) || response, undefined, 2) : (response === null || response === void 0 ? void 0 : response.result) || response;
701
703
  yield api.output(resultToOutput, null);
702
704
  }
705
+ else if (storeLocation === "stream") {
706
+ const transcriptContent = {
707
+ role: TranscriptRole.ASSISTANT,
708
+ type: TranscriptEntryType.OUTPUT,
709
+ source: "assistant",
710
+ payload: {
711
+ text: ((response === null || response === void 0 ? void 0 : response.result) || response),
712
+ data: {},
713
+ }
714
+ };
715
+ yield api.addTranscriptStep(transcriptContent);
716
+ }
703
717
  if (storeLocation === "stream" && responseToStore.finishReason) {
704
718
  // send the finishReason as last output for a stream
705
719
  (_a = api.output) === null || _a === void 0 ? void 0 : _a.call(api, "", {