@cognigy/rest-api-client 2025.12.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 (55) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/build/apigroups/ResourcesAPIGroup_2_0.js +4 -0
  3. package/build/shared/charts/descriptors/analytics/trackGoal.js +3 -1
  4. package/build/shared/charts/descriptors/index.js +5 -0
  5. package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +4 -2
  6. package/build/shared/charts/descriptors/message/question/question.js +12 -1
  7. package/build/shared/charts/descriptors/service/GPTPrompt.js +15 -1
  8. package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +32 -173
  9. package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobTool.js +2 -2
  10. package/build/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +175 -0
  11. package/build/shared/charts/descriptors/service/aiAgent/loadAiAgent.js +194 -0
  12. package/build/shared/charts/descriptors/service/handoverV2.js +1 -1
  13. package/build/shared/charts/descriptors/service/index.js +11 -1
  14. package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +922 -0
  15. package/build/shared/charts/descriptors/service/llmPrompt/llmPromptDefault.js +31 -0
  16. package/build/shared/charts/descriptors/service/llmPrompt/llmPromptMCPTool.js +196 -0
  17. package/build/shared/charts/descriptors/service/llmPrompt/llmPromptTool.js +139 -0
  18. package/build/shared/constants.js +1 -5
  19. package/build/shared/interfaces/debugEvents/IGoalCompletedEventPayload.js +3 -0
  20. package/build/shared/interfaces/debugEvents/TDebugEventType.js +1 -0
  21. package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +12 -1
  22. package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeChunk.js +2 -1
  23. package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +5 -18
  24. package/build/shared/interfaces/restAPI/operations/generateOutput/v2.0/index.js +3 -0
  25. package/build/shared/interfaces/security/IPermission.js +2 -0
  26. package/build/shared/interfaces/security/IRole.js +3 -1
  27. package/build/shared/interfaces/security/index.js +1 -1
  28. package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +4 -0
  29. package/dist/esm/shared/charts/descriptors/analytics/trackGoal.js +3 -1
  30. package/dist/esm/shared/charts/descriptors/index.js +6 -1
  31. package/dist/esm/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +4 -2
  32. package/dist/esm/shared/charts/descriptors/message/question/question.js +12 -1
  33. package/dist/esm/shared/charts/descriptors/service/GPTPrompt.js +15 -1
  34. package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +33 -174
  35. package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJobTool.js +2 -2
  36. package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +172 -0
  37. package/dist/esm/shared/charts/descriptors/service/aiAgent/loadAiAgent.js +192 -0
  38. package/dist/esm/shared/charts/descriptors/service/handoverV2.js +1 -1
  39. package/dist/esm/shared/charts/descriptors/service/index.js +5 -0
  40. package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +909 -0
  41. package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptDefault.js +28 -0
  42. package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptMCPTool.js +193 -0
  43. package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptTool.js +136 -0
  44. package/dist/esm/shared/constants.js +1 -5
  45. package/dist/esm/shared/interfaces/debugEvents/IGoalCompletedEventPayload.js +2 -0
  46. package/dist/esm/shared/interfaces/debugEvents/TDebugEventType.js +1 -0
  47. package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +12 -1
  48. package/dist/esm/shared/interfaces/resources/knowledgeStore/IKnowledgeChunk.js +2 -1
  49. package/dist/esm/shared/interfaces/resources/settings/IGenerativeAISettings.js +4 -17
  50. package/dist/esm/shared/interfaces/restAPI/operations/generateOutput/v2.0/index.js +2 -0
  51. package/dist/esm/shared/interfaces/security/IPermission.js +2 -0
  52. package/dist/esm/shared/interfaces/security/IRole.js +3 -1
  53. package/dist/esm/shared/interfaces/security/index.js +1 -1
  54. package/package.json +1 -1
  55. package/types/index.d.ts +83 -42
@@ -0,0 +1,192 @@
1
+ import { __awaiter } from "tslib";
2
+ /* Custom modules */
3
+ import { createNodeDescriptor } from "../../../createNodeDescriptor";
4
+ /**
5
+ * Node name: 'loadAiAigent'
6
+ *
7
+ * Purpose:
8
+ * Loads the AI Agent configuration and stores it to context/input.
9
+ */
10
+ export const LOAD_AI_AGENT = createNodeDescriptor({
11
+ type: "loadAiAigent",
12
+ defaultLabel: "Load AI Agent",
13
+ summary: "UI__NODE_EDITOR__LOAD_AI_AGENT__SUMMARY",
14
+ appearance: {
15
+ showIcon: false
16
+ },
17
+ fields: [
18
+ {
19
+ key: "aiAgent",
20
+ type: "aiAgentSelect",
21
+ label: "UI__NODE_EDITOR__LOAD_AI_AGENT__AI_AGENT_SELECTOR__LABEL",
22
+ description: "UI__NODE_EDITOR__AI_AGENT__AI_AGENT_SELECTOR__DESCRIPTION",
23
+ params: {
24
+ required: true
25
+ },
26
+ },
27
+ {
28
+ key: "storeLocation",
29
+ type: "select",
30
+ label: "UI__NODE_EDITOR__LOAD_AI_AGENT__FIELDS__STORE_LOCATION__LABEL",
31
+ description: "UI__NODE_EDITOR__LOAD_AI_AGENT__FIELDS__STORE_LOCATION__DESCRIPTION",
32
+ defaultValue: "context",
33
+ params: {
34
+ options: [
35
+ {
36
+ label: "UI__NODE_EDITOR__LOAD_AI_AGENT__FIELDS__STORE_LOCATION__OPTIONS__INPUT__LABEL",
37
+ value: "input"
38
+ },
39
+ {
40
+ label: "UI__NODE_EDITOR__LOAD_AI_AGENT__FIELDS__STORE_LOCATION__OPTIONS__CONTEXT__LABEL",
41
+ value: "context"
42
+ }
43
+ ],
44
+ required: true
45
+ },
46
+ },
47
+ {
48
+ key: "inputKey",
49
+ type: "cognigyText",
50
+ label: "UI__NODE_EDITOR__LOAD_AI_AGENT__FIELDS__INPUT_KEY__LABEL",
51
+ description: "UI__NODE_EDITOR__LOAD_AI_AGENT__FIELDS__INPUT_KEY__DESCRIPTION",
52
+ defaultValue: "aiAgentConfiguration",
53
+ condition: {
54
+ or: [
55
+ {
56
+ key: "storeLocation",
57
+ value: "input",
58
+ }
59
+ ]
60
+ }
61
+ },
62
+ {
63
+ key: "contextKey",
64
+ type: "cognigyText",
65
+ label: "UI__NODE_EDITOR__LOAD_AI_AGENT__FIELDS__CONTEXT_KEY__LABEL",
66
+ description: "UI__NODE_EDITOR__LOAD_AI_AGENT__FIELDS__CONTEXT_KEY__DESCRIPTION",
67
+ defaultValue: "aiAgentConfiguration",
68
+ condition: {
69
+ key: "storeLocation",
70
+ value: "context",
71
+ }
72
+ },
73
+ {
74
+ key: "keyWarning",
75
+ type: "description",
76
+ label: " ",
77
+ params: {
78
+ text: "UI__NODE_EDITOR__LOAD_AI_AGENT__FIELDS__KEY_WARNING__TEXT"
79
+ },
80
+ condition: {
81
+ or: [
82
+ {
83
+ and: [
84
+ {
85
+ key: "storeLocation",
86
+ value: "input",
87
+ },
88
+ {
89
+ key: "inputKey",
90
+ value: "aiAgentConfiguration",
91
+ negate: true
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ and: [
97
+ {
98
+ key: "storeLocation",
99
+ value: "context",
100
+ },
101
+ {
102
+ key: "contextKey",
103
+ value: "aiAgentConfiguration",
104
+ negate: true
105
+ }
106
+ ]
107
+ }
108
+ ]
109
+ }
110
+ }
111
+ ],
112
+ preview: {
113
+ key: "storeLocation",
114
+ type: "text",
115
+ },
116
+ form: [
117
+ { type: "field", key: "aiAgent" },
118
+ { type: "field", key: "storeLocation" },
119
+ { type: "field", key: "inputKey" },
120
+ { type: "field", key: "contextKey" },
121
+ { type: "field", key: "keyWarning" }
122
+ ],
123
+ tags: ["ai", "aiagent", "llm"],
124
+ tokens: [
125
+ {
126
+ label: "AI Agent Reference ID",
127
+ type: "input",
128
+ script: "(input.aiAgentConfiguration || context.aiAgentConfiguration)?.referenceId",
129
+ },
130
+ {
131
+ label: "AI Agent Name",
132
+ type: "input",
133
+ script: "(input.aiAgentConfiguration || context.aiAgentConfiguration)?.name",
134
+ },
135
+ {
136
+ label: "AI Agent Description",
137
+ type: "input",
138
+ script: "(input.aiAgentConfiguration || context.aiAgentConfiguration)?.description",
139
+ },
140
+ {
141
+ label: "AI Agent Instructions",
142
+ type: "input",
143
+ script: "(input.aiAgentConfiguration || context.aiAgentConfiguration)?.instructions",
144
+ },
145
+ {
146
+ label: "AI Agent Image URL",
147
+ type: "input",
148
+ script: "(input.aiAgentConfiguration || context.aiAgentConfiguration)?.image",
149
+ },
150
+ {
151
+ label: "AI Agent Knowledge Store ID",
152
+ type: "input",
153
+ script: "(input.aiAgentConfiguration || context.aiAgentConfiguration)?.knowledgeReferenceId",
154
+ },
155
+ ],
156
+ function: ({ cognigy, config }) => __awaiter(void 0, void 0, void 0, function* () {
157
+ const { api } = cognigy;
158
+ const { aiAgent, storeLocation, contextKey, inputKey } = config;
159
+ if (storeLocation === "input" && !inputKey) {
160
+ throw new Error("Unable to add value to input. No input key was defined.");
161
+ }
162
+ if (storeLocation === "context" && !contextKey) {
163
+ throw new Error("Unable to add value to context. No context key was defined.");
164
+ }
165
+ if (!aiAgent) {
166
+ throw new Error("Unable to load AI Agent values. No AI agent was defined.");
167
+ }
168
+ const aiAgentData = {
169
+ referenceId: aiAgent.referenceId,
170
+ name: aiAgent.name,
171
+ description: aiAgent.description,
172
+ instructions: aiAgent.instructions,
173
+ image: aiAgent.image,
174
+ speakingStyle: aiAgent.speakingStyle,
175
+ safetySettings: aiAgent.safetySettings,
176
+ contactProfilesOption: aiAgent.contactProfilesOption,
177
+ contactProfilesSelected: aiAgent.contactProfilesSelected,
178
+ knowledgeReferenceId: aiAgent.knowledgeReferenceId,
179
+ enableVoiceConfigs: aiAgent.enableVoiceConfigs,
180
+ voiceConfigs: aiAgent.voiceConfigs,
181
+ };
182
+ switch (storeLocation) {
183
+ case "context":
184
+ // @ts-ignore
185
+ api.addToContext(contextKey, aiAgentData, "simple");
186
+ break;
187
+ default:
188
+ api.addToInput(inputKey, aiAgentData);
189
+ }
190
+ })
191
+ });
192
+ //# sourceMappingURL=loadAiAgent.js.map
@@ -84,7 +84,7 @@ export const HANDOVER_V2 = createNodeDescriptor({
84
84
  label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__HANDOVER_PROVIDER__LABEL",
85
85
  type: "json",
86
86
  description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__HANDOVER_PROVIDER__DESCRIPTION",
87
- defaultValue: {},
87
+ defaultValue: { liveAgentPriority: "none" },
88
88
  params: {
89
89
  required: true,
90
90
  },
@@ -11,6 +11,10 @@ export { TRIGGER_FUNCTION } from "./triggerFunction/triggerFunction";
11
11
  export { ON_SCHEDULED } from "./triggerFunction/onScheduled";
12
12
  export { ON_SCHEDULING_ERROR } from "./triggerFunction/onSchedulingError";
13
13
  export { GPT_PROMPT } from "./GPTPrompt";
14
+ export { LLM_PROMPT_V2 } from "./llmPrompt/LLMPromptV2";
15
+ export { LLM_PROMPT_DEFAULT } from "./llmPrompt/llmPromptDefault";
16
+ export { LLM_PROMPT_MCP_TOOL } from "./llmPrompt/llmPromptMCPTool";
17
+ export { LLM_PROMPT_TOOL } from "./llmPrompt/llmPromptTool";
14
18
  export { CLOSE_HANDOVER } from "./closeHandover";
15
19
  export { HANDOVER_INACTIVITY_TIMER } from "./handoverInactivityTimer";
16
20
  export { GPT_CONVERSATION } from "./GPTConversation";
@@ -24,6 +28,7 @@ export { AI_AGENT_JOB_MCP_TOOL } from "./aiAgent/aiAgentJobMCPTool";
24
28
  export { AI_AGENT_TOOL_ANSWER } from "./aiAgent/aiAgentToolAnswer";
25
29
  export { AI_AGENT_HANDOVER } from "./aiAgent/aiAgentHandover";
26
30
  export { AI_AGENT_JOB_CALL_MCP_TOOL } from "./aiAgent/aiAgentJobCallMCPTool";
31
+ export { LOAD_AI_AGENT } from "./aiAgent/loadAiAgent";
27
32
  export { LIVE_AGENT_CONNECTION, RINGCENTRAL_ENGAGE_CONNECTION, CHATWOOT_CONNECTION, EIGHT_BY_EIGHT_CONNECTION, GENESYS_CLOUD_CONNECTION, GENESYS_CLOUD_CONNECTION_OM } from "./handoverConnections";
28
33
  export { NICECXONEAAH_AUTHENTICATION_CONNECTION } from "./niceCXOneAAHAuthenticationConnection";
29
34
  export { AIOPS_CENTER_WEBHOOKS_CONNECTION } from "./aiOpsCenterConnection";