clisbot 0.1.53-beta.1 → 0.1.53-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +59 -11
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -76231,6 +76231,44 @@ function deriveConfiguredChannelConnection(params) {
|
|
|
76231
76231
|
}
|
|
76232
76232
|
return params.recordedConnection ?? "active";
|
|
76233
76233
|
}
|
|
76234
|
+
function resolveRuntimeSummaryDefaultBot(params) {
|
|
76235
|
+
const defaultBotId = params.providerConfig.defaults.defaultBotId || "default";
|
|
76236
|
+
const hasDefaultBot = Object.prototype.hasOwnProperty.call(params.providerConfig, defaultBotId);
|
|
76237
|
+
if (params.providerConfig.defaults.enabled || hasDefaultBot) {
|
|
76238
|
+
return params.resolveBotConfig(defaultBotId);
|
|
76239
|
+
}
|
|
76240
|
+
return {
|
|
76241
|
+
id: defaultBotId,
|
|
76242
|
+
enabled: false,
|
|
76243
|
+
allowBots: params.providerConfig.defaults.allowBots,
|
|
76244
|
+
dmPolicy: params.providerConfig.defaults.dmPolicy,
|
|
76245
|
+
groupPolicy: params.providerConfig.defaults.groupPolicy,
|
|
76246
|
+
agentPrompt: params.providerConfig.defaults.agentPrompt,
|
|
76247
|
+
commandPrefixes: params.providerConfig.defaults.commandPrefixes,
|
|
76248
|
+
streaming: params.providerConfig.defaults.streaming,
|
|
76249
|
+
response: params.providerConfig.defaults.response,
|
|
76250
|
+
responseMode: params.providerConfig.defaults.responseMode,
|
|
76251
|
+
additionalMessageMode: params.providerConfig.defaults.additionalMessageMode,
|
|
76252
|
+
surfaceNotifications: resolveRuntimeSummarySurfaceNotifications(params.providerConfig.defaults.surfaceNotifications),
|
|
76253
|
+
verbose: params.providerConfig.defaults.verbose,
|
|
76254
|
+
followUp: params.providerConfig.defaults.followUp,
|
|
76255
|
+
timezone: params.providerConfig.defaults.timezone,
|
|
76256
|
+
directMessages: params.providerConfig.defaults.directMessages,
|
|
76257
|
+
groups: params.providerConfig.defaults.groups
|
|
76258
|
+
};
|
|
76259
|
+
}
|
|
76260
|
+
function resolveRuntimeSummarySurfaceNotifications(value) {
|
|
76261
|
+
if (!value?.queueStart || !value.loopStart) {
|
|
76262
|
+
return;
|
|
76263
|
+
}
|
|
76264
|
+
return {
|
|
76265
|
+
queueStart: value.queueStart,
|
|
76266
|
+
loopStart: value.loopStart
|
|
76267
|
+
};
|
|
76268
|
+
}
|
|
76269
|
+
function resolveRuntimeSummaryDirectMessageConfig(botConfig) {
|
|
76270
|
+
return resolveChannelDirectMessageConfig(botConfig);
|
|
76271
|
+
}
|
|
76234
76272
|
|
|
76235
76273
|
// src/channels/slack/operator-inventory.ts
|
|
76236
76274
|
var SLACK_TOKEN_DOC_URL = "https://api.slack.com/apps";
|
|
@@ -76271,8 +76309,11 @@ var slackChannelOperatorInventory = {
|
|
|
76271
76309
|
order: 20,
|
|
76272
76310
|
buildInput: ({ loadedConfig, runtimeRunning, activities, runtimeHealth }) => {
|
|
76273
76311
|
const enabled = loadedConfig.raw.bots.slack.defaults.enabled;
|
|
76274
|
-
const defaultBot =
|
|
76275
|
-
|
|
76312
|
+
const defaultBot = resolveRuntimeSummaryDefaultBot({
|
|
76313
|
+
providerConfig: loadedConfig.raw.bots.slack,
|
|
76314
|
+
resolveBotConfig: (botId) => resolveSlackBotConfig(loadedConfig.raw.bots.slack, botId)
|
|
76315
|
+
});
|
|
76316
|
+
const defaultDmConfig = resolveRuntimeSummaryDirectMessageConfig(defaultBot);
|
|
76276
76317
|
return {
|
|
76277
76318
|
channel: "slack",
|
|
76278
76319
|
enabled,
|
|
@@ -79011,8 +79052,11 @@ var telegramChannelOperatorInventory = {
|
|
|
79011
79052
|
order: 10,
|
|
79012
79053
|
buildInput: ({ loadedConfig, runtimeRunning, activities, runtimeHealth }) => {
|
|
79013
79054
|
const enabled = loadedConfig.raw.bots.telegram.defaults.enabled;
|
|
79014
|
-
const defaultBot =
|
|
79015
|
-
|
|
79055
|
+
const defaultBot = resolveRuntimeSummaryDefaultBot({
|
|
79056
|
+
providerConfig: loadedConfig.raw.bots.telegram,
|
|
79057
|
+
resolveBotConfig: (botId) => resolveTelegramBotConfig(loadedConfig.raw.bots.telegram, botId)
|
|
79058
|
+
});
|
|
79059
|
+
const defaultDmConfig = resolveRuntimeSummaryDirectMessageConfig(defaultBot);
|
|
79016
79060
|
return {
|
|
79017
79061
|
channel: "telegram",
|
|
79018
79062
|
enabled,
|
|
@@ -80536,8 +80580,11 @@ var zaloBotChannelOperatorInventory = {
|
|
|
80536
80580
|
order: 30,
|
|
80537
80581
|
buildInput: ({ loadedConfig, runtimeRunning, activities, runtimeHealth }) => {
|
|
80538
80582
|
const enabled = loadedConfig.raw.bots.zaloBot.defaults.enabled;
|
|
80539
|
-
const defaultBot =
|
|
80540
|
-
|
|
80583
|
+
const defaultBot = resolveRuntimeSummaryDefaultBot({
|
|
80584
|
+
providerConfig: loadedConfig.raw.bots.zaloBot,
|
|
80585
|
+
resolveBotConfig: (botId) => resolveZaloBotConfig(loadedConfig.raw.bots.zaloBot, botId)
|
|
80586
|
+
});
|
|
80587
|
+
const defaultDmConfig = resolveRuntimeSummaryDirectMessageConfig(defaultBot);
|
|
80541
80588
|
return {
|
|
80542
80589
|
channel: "zalo-bot",
|
|
80543
80590
|
enabled,
|
|
@@ -88185,6 +88232,7 @@ async function getRunnerSessions(loadedConfig) {
|
|
|
88185
88232
|
}
|
|
88186
88233
|
}
|
|
88187
88234
|
function buildChannelSummary(params) {
|
|
88235
|
+
const health = params.enabled ? params.health : undefined;
|
|
88188
88236
|
return {
|
|
88189
88237
|
channel: params.channel,
|
|
88190
88238
|
enabled: params.enabled,
|
|
@@ -88203,12 +88251,12 @@ function buildChannelSummary(params) {
|
|
|
88203
88251
|
healthSummary: deriveHealthSummary({
|
|
88204
88252
|
channel: params.channel,
|
|
88205
88253
|
connection: params.connection,
|
|
88206
|
-
recordedSummary:
|
|
88254
|
+
recordedSummary: health?.summary
|
|
88207
88255
|
}),
|
|
88208
|
-
healthDetail:
|
|
88209
|
-
healthActions:
|
|
88210
|
-
healthInstances:
|
|
88211
|
-
healthUpdatedAt:
|
|
88256
|
+
healthDetail: health?.detail,
|
|
88257
|
+
healthActions: health?.actions ?? [],
|
|
88258
|
+
healthInstances: health?.instances ?? [],
|
|
88259
|
+
healthUpdatedAt: health?.updatedAt
|
|
88212
88260
|
};
|
|
88213
88261
|
}
|
|
88214
88262
|
async function getRuntimeOperatorSummary(params) {
|