wingbot 3.73.1 → 3.73.3
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/.babelrc +0 -0
- package/.github/workflows/deploy.yml +0 -0
- package/.github/workflows/pullRequest.yml +0 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/index.js +0 -0
- package/jsconfig.json +0 -0
- package/package.json +1 -1
- package/plugins/ai.wingbot.clearMessageSequences/plugin.js +0 -0
- package/plugins/ai.wingbot.conditionIfGoBackPossible/plugin.js +0 -0
- package/plugins/ai.wingbot.disambiguation/plugin.js +0 -0
- package/plugins/ai.wingbot.goBack/plugin.js +0 -0
- package/plugins/ai.wingbot.goToLastBreadcrumb/plugin.js +0 -0
- package/plugins/ai.wingbot.ifImageDetected/plugin.js +0 -0
- package/plugins/ai.wingbot.ifStickerDetected/plugin.js +0 -0
- package/plugins/ai.wingbot.jumpBack/plugin.js +0 -0
- package/plugins/ai.wingbot.jumpTo/plugin.js +0 -0
- package/plugins/ai.wingbot.keepInInteraction/plugin.js +0 -0
- package/plugins/ai.wingbot.keepInInteractionJustOnce/plugin.js +0 -0
- package/plugins/ai.wingbot.keepPreviousHandlers/plugin.js +0 -0
- package/plugins/ai.wingbot.keepPreviousHandlersJustOnce/plugin.js +0 -0
- package/plugins/ai.wingbot.oneTimeNotificationRequest/plugin.js +0 -0
- package/plugins/ai.wingbot.openai/plugin.js +0 -0
- package/plugins/ai.wingbot.passThreadToBot/plugin.js +0 -0
- package/plugins/ai.wingbot.persona/plugin.js +0 -0
- package/plugins/ai.wingbot.putABreadcrumb/plugin.js +0 -0
- package/plugins/ai.wingbot.regexp/plugin.js +0 -0
- package/plugins/ai.wingbot.setState/plugin.js +0 -0
- package/plugins/ai.wingbot.setStateFromInput/plugin.js +0 -0
- package/plugins/ai.wingbot.slotsContinue/plugin.js +0 -0
- package/plugins/ai.wingbot.slotsRegister/plugin.js +0 -0
- package/plugins/ai.wingbot.stopResponding/plugin.js +0 -0
- package/plugins/ai.wingbot.trackingEvent/plugin.js +0 -0
- package/plugins/ai.wingbot.upload/plugin.js +0 -0
- package/plugins/ai.wingbot.waitASecond/plugin.js +0 -0
- package/plugins/index.js +0 -0
- package/plugins/plugins.json +0 -0
- package/src/Ai.js +0 -0
- package/src/AiMatching.js +0 -0
- package/src/BatchConversationTester.js +0 -0
- package/src/BotApp.js +0 -0
- package/src/BuildRouter.js +0 -0
- package/src/CallbackAuditLog.js +0 -0
- package/src/ChatGpt.js +0 -0
- package/src/ConversationTester.js +0 -0
- package/src/LLM.js +0 -0
- package/src/LLMMockProvider.js +0 -0
- package/src/LLMSession.js +0 -0
- package/src/MockAiModel.js +0 -0
- package/src/OrchestratorClient.js +43 -0
- package/src/Plugins.js +0 -0
- package/src/Processor.js +0 -0
- package/src/ReducerWrapper.js +0 -0
- package/src/Request.js +0 -0
- package/src/Responder.js +3 -2
- package/src/ReturnSender.js +0 -0
- package/src/Router.js +0 -0
- package/src/RouterWrap.js +0 -0
- package/src/SecurityMiddleware.js +0 -0
- package/src/Tester.js +0 -0
- package/src/analytics/GA4.js +0 -0
- package/src/analytics/consts.js +0 -0
- package/src/analytics/onInteractionHandler.js +0 -0
- package/src/defaultResourceMap.js +0 -0
- package/src/features.js +0 -0
- package/src/flags.js +0 -0
- package/src/fuzzy/factoryFuzzySearch.js +0 -0
- package/src/fuzzy/fuzzyUtils.js +0 -0
- package/src/fuzzy/index.js +0 -0
- package/src/fuzzy/levenshtein.js +0 -0
- package/src/fuzzy/normalize.js +0 -0
- package/src/fuzzy/prepareFuzzyIndex.js +0 -0
- package/src/graphApi/WingbotApiConnector.js +0 -0
- package/src/graphApi/apiAuthorizer.js +0 -0
- package/src/graphApi/conversationTestApi.js +0 -0
- package/src/graphApi/conversationsApi.js +0 -0
- package/src/graphApi/index.js +0 -0
- package/src/graphApi/postBackApi.js +0 -0
- package/src/graphApi/schema.gql +0 -0
- package/src/graphApi/validateBotApi.js +0 -0
- package/src/notifications/Notifications.js +0 -0
- package/src/notifications/NotificationsStorage.js +0 -0
- package/src/notifications/api/index.js +0 -0
- package/src/notifications/api/notificationsApiFactory.js +0 -0
- package/src/notifications/index.js +0 -0
- package/src/resolvers/bounce.js +0 -0
- package/src/resolvers/button.js +0 -0
- package/src/resolvers/carousel.js +0 -0
- package/src/resolvers/contextMessage.js +0 -0
- package/src/resolvers/expected.js +0 -0
- package/src/resolvers/expectedInput.js +0 -0
- package/src/resolvers/hbs.js +0 -0
- package/src/resolvers/include.js +0 -0
- package/src/resolvers/index.js +0 -0
- package/src/resolvers/media.js +0 -0
- package/src/resolvers/message.js +0 -0
- package/src/resolvers/passThread.js +0 -0
- package/src/resolvers/path.js +0 -0
- package/src/resolvers/plugin.js +0 -0
- package/src/resolvers/postback.js +0 -0
- package/src/resolvers/resolverTags.js +0 -0
- package/src/resolvers/setState.js +0 -0
- package/src/resolvers/skip.js +0 -0
- package/src/resolvers/subscribtions.js +0 -0
- package/src/resolvers/utils.js +0 -0
- package/src/systemEntities/email.js +0 -0
- package/src/systemEntities/index.js +0 -0
- package/src/systemEntities/phone.js +0 -0
- package/src/systemEntities/regexps.js +0 -0
- package/src/templates/BaseTemplate.js +0 -0
- package/src/templates/ButtonTemplate.js +0 -0
- package/src/templates/GenericTemplate.js +0 -0
- package/src/templates/ListTemplate.js +0 -0
- package/src/templates/ReceiptTemplate.js +0 -0
- package/src/testTools/AnyResponseAssert.js +0 -0
- package/src/testTools/PromptAssert.js +0 -0
- package/src/testTools/ResponseAssert.js +0 -0
- package/src/testTools/asserts.js +0 -0
- package/src/testTools/index.js +0 -0
- package/src/tools/MemoryBotConfigStorage.js +0 -0
- package/src/tools/MemoryChatLogStorage.js +0 -0
- package/src/tools/MemoryStateStorage.js +0 -0
- package/src/tools/bufferloader.js +0 -0
- package/src/tools/index.js +0 -0
- package/src/tools/routeToEvents.js +0 -0
- package/src/transcript/extractText.js +0 -0
- package/src/transcript/textBodyFromTranscript.js +0 -0
- package/src/transcript/transcriptFromHistory.js +0 -0
- package/src/utils/ai.js +0 -0
- package/src/utils/compileWithState.js +0 -0
- package/src/utils/customCondition.js +0 -0
- package/src/utils/customFn.js +0 -0
- package/src/utils/datetime.js +0 -0
- package/src/utils/deepMapTools.js +0 -0
- package/src/utils/generateToken.js +0 -0
- package/src/utils/getCondition.js +0 -0
- package/src/utils/getUpdate.js +0 -0
- package/src/utils/headersToAuditMeta.js +0 -0
- package/src/utils/index.js +0 -0
- package/src/utils/pathUtils.js +0 -0
- package/src/utils/quickReplies.js +0 -0
- package/src/utils/slots.js +0 -0
- package/src/utils/stateData.js +0 -0
- package/src/utils/stateVariables.js +0 -0
- package/src/utils/tokenizer.js +0 -0
- package/src/utils/wrapPluginFunction.js +0 -0
- package/src/wingbot/CachedModel.js +0 -0
- package/src/wingbot/CustomEntityDetectionModel.js +0 -0
- package/src/wingbot/WingbotModel.js +0 -0
- package/src/wingbot/index.js +0 -0
package/.babelrc
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/index.js
CHANGED
|
File without changes
|
package/jsconfig.json
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/plugins/index.js
CHANGED
|
File without changes
|
package/plugins/plugins.json
CHANGED
|
File without changes
|
package/src/Ai.js
CHANGED
|
File without changes
|
package/src/AiMatching.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/BotApp.js
CHANGED
|
File without changes
|
package/src/BuildRouter.js
CHANGED
|
File without changes
|
package/src/CallbackAuditLog.js
CHANGED
|
File without changes
|
package/src/ChatGpt.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/LLM.js
CHANGED
|
File without changes
|
package/src/LLMMockProvider.js
CHANGED
|
File without changes
|
package/src/LLMSession.js
CHANGED
|
File without changes
|
package/src/MockAiModel.js
CHANGED
|
File without changes
|
|
@@ -18,6 +18,7 @@ const extractText = require('./transcript/extractText');
|
|
|
18
18
|
* @property {string} [pageId]
|
|
19
19
|
* @property {string} [appId]
|
|
20
20
|
* @property {Function} [fetch]
|
|
21
|
+
* @property {boolean} [mock]
|
|
21
22
|
*/
|
|
22
23
|
|
|
23
24
|
class OrchestratorClient {
|
|
@@ -32,6 +33,7 @@ class OrchestratorClient {
|
|
|
32
33
|
this._senderId = options.senderId;
|
|
33
34
|
this._pageId = options.pageId;
|
|
34
35
|
this._fetch = options.fetch || fetch;
|
|
36
|
+
this._mock = !!options.mock;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
/**
|
|
@@ -214,6 +216,47 @@ class OrchestratorClient {
|
|
|
214
216
|
* @param {object} payload
|
|
215
217
|
*/
|
|
216
218
|
async _send (payload) {
|
|
219
|
+
if (this._mock) {
|
|
220
|
+
const [, queryName] = payload.query.match(/^[a-z]+\s+([a-z]+)/i);
|
|
221
|
+
|
|
222
|
+
switch (queryName) {
|
|
223
|
+
case 'GetConversationToken':
|
|
224
|
+
return {
|
|
225
|
+
data: {
|
|
226
|
+
chat: {
|
|
227
|
+
conversationToken: 'mock-token'
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
case 'FetchHistory':
|
|
232
|
+
return {
|
|
233
|
+
data: {
|
|
234
|
+
chat: {
|
|
235
|
+
history: {
|
|
236
|
+
events: [
|
|
237
|
+
{
|
|
238
|
+
sender: {
|
|
239
|
+
id: this._senderId || 'sender'
|
|
240
|
+
},
|
|
241
|
+
recipient: {
|
|
242
|
+
id: this._pageId || 'sender'
|
|
243
|
+
},
|
|
244
|
+
message: {
|
|
245
|
+
text: 'Hello'
|
|
246
|
+
},
|
|
247
|
+
timestamp: 1234567890123
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
default:
|
|
256
|
+
return {};
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
217
260
|
const body = JSON.stringify(payload);
|
|
218
261
|
|
|
219
262
|
const token = await BotAppSender.signBody(
|
package/src/Plugins.js
CHANGED
|
File without changes
|
package/src/Processor.js
CHANGED
|
File without changes
|
package/src/ReducerWrapper.js
CHANGED
|
File without changes
|
package/src/Request.js
CHANGED
|
File without changes
|
package/src/Responder.js
CHANGED
|
@@ -1235,10 +1235,11 @@ class Responder {
|
|
|
1235
1235
|
* Converts relative action to absolute action path
|
|
1236
1236
|
*
|
|
1237
1237
|
* @param {string} action - relative action to covert to absolute
|
|
1238
|
+
* @param {boolean} [forceStartingSlash=false]
|
|
1238
1239
|
* @returns {string} absolute action path
|
|
1239
1240
|
*/
|
|
1240
|
-
toAbsoluteAction (action) {
|
|
1241
|
-
return makeAbsolute(action, this.path);
|
|
1241
|
+
toAbsoluteAction (action, forceStartingSlash = false) {
|
|
1242
|
+
return makeAbsolute(action, this.path || (forceStartingSlash ? '/' : ''));
|
|
1242
1243
|
}
|
|
1243
1244
|
|
|
1244
1245
|
/**
|
package/src/ReturnSender.js
CHANGED
|
File without changes
|
package/src/Router.js
CHANGED
|
File without changes
|
package/src/RouterWrap.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/Tester.js
CHANGED
|
File without changes
|
package/src/analytics/GA4.js
CHANGED
|
File without changes
|
package/src/analytics/consts.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/features.js
CHANGED
|
File without changes
|
package/src/flags.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/fuzzy/fuzzyUtils.js
CHANGED
|
File without changes
|
package/src/fuzzy/index.js
CHANGED
|
File without changes
|
package/src/fuzzy/levenshtein.js
CHANGED
|
File without changes
|
package/src/fuzzy/normalize.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/graphApi/index.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/graphApi/schema.gql
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/resolvers/bounce.js
CHANGED
|
File without changes
|
package/src/resolvers/button.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/resolvers/hbs.js
CHANGED
|
File without changes
|
package/src/resolvers/include.js
CHANGED
|
File without changes
|
package/src/resolvers/index.js
CHANGED
|
File without changes
|
package/src/resolvers/media.js
CHANGED
|
File without changes
|
package/src/resolvers/message.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/resolvers/path.js
CHANGED
|
File without changes
|
package/src/resolvers/plugin.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/resolvers/skip.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/resolvers/utils.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/testTools/asserts.js
CHANGED
|
File without changes
|
package/src/testTools/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/tools/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/utils/ai.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/utils/customFn.js
CHANGED
|
File without changes
|
package/src/utils/datetime.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/utils/getUpdate.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/utils/index.js
CHANGED
|
File without changes
|
package/src/utils/pathUtils.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/utils/slots.js
CHANGED
|
File without changes
|
package/src/utils/stateData.js
CHANGED
|
File without changes
|
|
File without changes
|
package/src/utils/tokenizer.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/wingbot/index.js
CHANGED
|
File without changes
|