openclaw-multi-auto 1.6.2 → 1.6.6
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/{accounts-L9ByEpnP.js → accounts-C9HcPI9h.js} +2 -2
- package/dist/{accounts-BOzyfwW4.js → accounts-C_lW3Ag9.js} +2 -2
- package/dist/{accounts-yfBeCZtS.js → accounts-Tgelvk0C.js} +17 -17
- package/dist/{active-listener-D1yqT1cw.js → active-listener-BEdprTkn.js} +2 -2
- package/dist/{api-key-rotation-DtsNS2Nb.js → api-key-rotation-BJpKWXy0.js} +2 -2
- package/dist/{audio-preflight-DoPfNXDz.js → audio-preflight-BMvgEQ5j.js} +32 -32
- package/dist/{audio-transcription-runner-CzjuH3uL.js → audio-transcription-runner-gLFfz8fr.js} +12 -12
- package/dist/{audit-membership-runtime-DWyHWAHM.js → audit-membership-runtime-Dntemq07.js} +4 -4
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +51 -51
- package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +51 -51
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-xHOMiarp.js → channel-activity-BDnjYF7B.js} +3 -3
- package/dist/{chrome-DlhJHqj8.js → chrome-DxxEKrY7.js} +26 -26
- package/dist/{commands-registry-V1zZ5pPC.js → commands-registry-D5qXbFJn.js} +4 -4
- package/dist/{deliver-CApVJA_l.js → deliver-DbdywYJE.js} +21 -21
- package/dist/deliver-runtime-BFs7iAZF.js +36 -0
- package/dist/deps-send-discord.runtime-DZUccI6Z.js +26 -0
- package/dist/deps-send-imessage.runtime-CF3OpoqY.js +25 -0
- package/dist/deps-send-signal.runtime-Cw4-ozeO.js +24 -0
- package/dist/deps-send-slack.runtime-BDsDhS1P.js +22 -0
- package/dist/deps-send-telegram.runtime-D_4xVasO.js +27 -0
- package/dist/deps-send-whatsapp.runtime-DK8jqd14.js +60 -0
- package/dist/{diagnostic-Bn4PZjMZ.js → diagnostic-Co6Kghr-.js} +2 -2
- package/dist/{errors-CCLeFWAg.js → errors-xt401nuk.js} +1 -1
- package/dist/{fetch-BlJWzEP6.js → fetch-DuraYswo.js} +5 -5
- package/dist/{fetch-guard-ChYBwfiy.js → fetch-guard-DWr0d00H.js} +2 -2
- package/dist/{frontmatter-CvaMP376.js → frontmatter-BkTfEZ93.js} +3 -3
- package/dist/{fs-safe-0jAo_Whb.js → fs-safe-CTYUrIgQ.js} +4 -4
- package/dist/{github-copilot-token-D13V9YBz.js → github-copilot-token-BDioPmd6.js} +7 -7
- package/dist/{image-B3Mz7N5I.js → image-eT7Y-nP5.js} +6 -6
- package/dist/{image-ops-CehkHxmW.js → image-ops-BuUnEOE0.js} +2 -2
- package/dist/image-runtime-BcAK3n8a.js +29 -0
- package/dist/{ir-DAP-B-Xw.js → ir-B83looB-.js} +8 -8
- package/dist/{legacy-names-TyzbVqa_.js → legacy-names-DOC03BkU.js} +1 -1
- package/dist/llm-slug-generator.js +51 -51
- package/dist/{logger-DMZQQtxK.js → logger-BfjWMCSD.js} +7 -7
- package/dist/{login-DiCctRo1.js → login-CrIwcrVI.js} +5 -5
- package/dist/{login-qr-MUbXgjtd.js → login-qr-BpPDZdl_.js} +10 -10
- package/dist/{manager-BW_NSIMl.js → manager-1bvuGrNR.js} +13 -13
- package/dist/manager-runtime-FO1Sx3W8.js +18 -0
- package/dist/{model-selection-idoqPmw0.js → model-selection-Dna0Gz1k.js} +43 -43
- package/dist/{outbound-C2kanETZ.js → outbound-ChDjtuD6.js} +6 -6
- package/dist/{outbound-attachment-DBrYWX8h.js → outbound-attachment-DqHlD21U.js} +2 -2
- package/dist/{path-alias-guards-DqXRZmsL.js → path-alias-guards-BzvdLvTI.js} +1 -1
- package/dist/{paths-CCxysrzL.js → paths-Bkr-BCxW.js} +4 -4
- package/dist/{paths-C6TxBCvO.js → paths-Cvc9EM8Y.js} +5 -5
- package/dist/{pi-embedded-bcjMe3wj.js → pi-embedded-BQQa91aA.js} +167 -167
- package/dist/{pi-embedded-helpers-D5yyGEvA.js → pi-embedded-helpers-CLXm10bV.js} +52 -52
- package/dist/{plugin-sdk/pi-model-discovery-v-XPUOOf.js → pi-model-discovery-Dymwdjt0.js} +2 -2
- package/dist/pi-model-discovery-runtime-BeY4EUPp.js +11 -0
- package/dist/{pi-tools.before-tool-call.runtime-BuLxSyx9.js → pi-tools.before-tool-call.runtime-Cwab_5W1.js} +9 -9
- package/dist/plugin-sdk/compat.js +50 -50
- package/dist/plugin-sdk/discord.js +6 -6
- package/dist/plugin-sdk/slack.js +2 -2
- package/dist/{plugins-CWkRQYDj.js → plugins-4Rj4OjLY.js} +11 -11
- package/dist/{proxy-env-Cq5gdrbj.js → proxy-env-DlmzDx8x.js} +1 -1
- package/dist/{proxy-fetch-CCjEYbFm.js → proxy-fetch-B2pEfjbR.js} +1 -1
- package/dist/{pw-ai-CDQDCfUa.js → pw-ai-DNMjFMqH.js} +14 -14
- package/dist/{qmd-manager-BsYsO9Ii.js → qmd-manager-BtIKUaO9.js} +10 -10
- package/dist/{query-expansion-DtLc3wjL.js → query-expansion-CX-1fS52.js} +6 -6
- package/dist/{plugin-sdk/redact-DjVX-1N3.js → redact-COik8ET1.js} +1 -1
- package/dist/{run-with-concurrency-D_ZpbgEG.js → run-with-concurrency-BgYfgkXT.js} +4 -4
- package/dist/runtime-whatsapp-login.runtime-DUb55byQ.js +13 -0
- package/dist/runtime-whatsapp-outbound.runtime-Bii_xSfI.js +22 -0
- package/dist/{send-Dx2RkUOZ.js → send-6lz6rNVP.js} +6 -6
- package/dist/{send-vmONuVgL.js → send-BHTiZcH3.js} +26 -26
- package/dist/{send-Bj776ESJ.js → send-L7gRiwyd.js} +7 -7
- package/dist/{send-DcxmcFi_.js → send-PE6cwoTe.js} +8 -8
- package/dist/{send-BQERFNyo.js → send-dfu6_rgf.js} +5 -5
- package/dist/{session-A4QhBRvH.js → session-D8ImowSs.js} +8 -8
- package/dist/{skill-commands-CMzBZKG2.js → skill-commands-DNqJ-kwn.js} +9 -9
- package/dist/{skills-CE_iqvM5.js → skills-7ODkHQYp.js} +22 -22
- package/dist/slash-commands.runtime-CVw6566g.js +16 -0
- package/dist/slash-dispatch.runtime-B9Ygtzi4.js +56 -0
- package/dist/slash-skill-commands.runtime-DxZ4z5h6.js +20 -0
- package/dist/{store--eR1R_UX.js → store-D89wDcz9.js} +2 -2
- package/dist/subagent-registry-runtime-DL1Wv7nA.js +56 -0
- package/dist/{subsystem-Di1z8l0Z.js → subsystem-B45WV3qB.js} +14 -14
- package/dist/{tables-d739Y1xW.js → tables-mE4cJBN2.js} +1 -1
- package/dist/{plugin-sdk/target-errors-Blia4S69.js → target-errors-mnlwhAjP.js} +2 -2
- package/dist/{thinking-DXYisHiZ.js → thinking-BeGmb5k6.js} +7 -7
- package/dist/{tokens-DxnY9ui_.js → tokens-q32vI39c.js} +1 -1
- package/dist/{tool-images-2cBx1W8h.js → tool-images-RZdHiZcG.js} +2 -2
- package/dist/{web-NWKn8ABz.js → web-Btj-e8kN.js} +55 -55
- package/dist/{whatsapp-actions-iEArE_Ez.js → whatsapp-actions-BHbJJyqw.js} +21 -21
- package/dist/{workspace-CUVC6GX1.js → workspace-U-DyR64O.js} +20 -20
- package/package.json +1 -1
- package/scripts/create-instance.sh +93 -96
- package/dist/deliver-runtime-D1z-h5eg.js +0 -36
- package/dist/deps-send-discord.runtime-DnbhTFX9.js +0 -26
- package/dist/deps-send-imessage.runtime-BOiQ6mDx.js +0 -25
- package/dist/deps-send-signal.runtime-CTcl388M.js +0 -24
- package/dist/deps-send-slack.runtime-CCqBz4Kg.js +0 -22
- package/dist/deps-send-telegram.runtime-DGSKTCpH.js +0 -27
- package/dist/deps-send-whatsapp.runtime-Dz_4fi2D.js +0 -60
- package/dist/image-runtime-DWjhow2W.js +0 -29
- package/dist/manager-runtime-BN6VevdC.js +0 -18
- package/dist/pi-model-discovery-BGgOlX8N.js +0 -134
- package/dist/pi-model-discovery-runtime-Bwmi4Ev8.js +0 -11
- package/dist/plugin-sdk/accounts-CJWOBzwB.js +0 -35
- package/dist/plugin-sdk/accounts-DP1-L-QS.js +0 -288
- package/dist/plugin-sdk/accounts-DZhWlEg3.js +0 -46
- package/dist/plugin-sdk/active-listener-B_sLJTXM.js +0 -50
- package/dist/plugin-sdk/api-key-rotation-BRE4X2tf.js +0 -181
- package/dist/plugin-sdk/audio-preflight-DGEUDxxR.js +0 -69
- package/dist/plugin-sdk/audio-transcription-runner-DkoPNPYt.js +0 -2176
- package/dist/plugin-sdk/audit-membership-runtime-DSBHHw7o.js +0 -58
- package/dist/plugin-sdk/channel-activity-F3d0yUwy.js +0 -94
- package/dist/plugin-sdk/channel-web-QF7EpjeP.js +0 -2256
- package/dist/plugin-sdk/chrome-BXoCyCkY.js +0 -2415
- package/dist/plugin-sdk/commands-registry-t7cXBTfN.js +0 -1125
- package/dist/plugin-sdk/config-BkEnz2Po.js +0 -17913
- package/dist/plugin-sdk/deliver-B6AG_l67.js +0 -1694
- package/dist/plugin-sdk/deliver-runtime-D585kJZc.js +0 -32
- package/dist/plugin-sdk/deps-send-discord.runtime-a_OKY2js.js +0 -23
- package/dist/plugin-sdk/deps-send-imessage.runtime-Baxy9TD4.js +0 -22
- package/dist/plugin-sdk/deps-send-signal.runtime-BwXoCrFl.js +0 -21
- package/dist/plugin-sdk/deps-send-slack.runtime-CLmKjgso.js +0 -19
- package/dist/plugin-sdk/deps-send-telegram.runtime-BKfdBKnZ.js +0 -24
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-BOTwkbx_.js +0 -57
- package/dist/plugin-sdk/diagnostic-CsP-lEkI.js +0 -319
- package/dist/plugin-sdk/errors-DaiAM-yU.js +0 -54
- package/dist/plugin-sdk/fetch-guard-DETCcJzQ.js +0 -156
- package/dist/plugin-sdk/fs-safe-B8y811FR.js +0 -352
- package/dist/plugin-sdk/image-DjTEkYZE.js +0 -2310
- package/dist/plugin-sdk/image-ops-BSiMpAw4.js +0 -584
- package/dist/plugin-sdk/image-runtime-6xPp8m5a.js +0 -25
- package/dist/plugin-sdk/ir-DQ7_HbvK.js +0 -1296
- package/dist/plugin-sdk/local-roots-BUP4YBmR.js +0 -186
- package/dist/plugin-sdk/logger-CZY9KIoY.js +0 -1163
- package/dist/plugin-sdk/login-BxEKLlCo.js +0 -57
- package/dist/plugin-sdk/login-qr-BQIpMPr9.js +0 -320
- package/dist/plugin-sdk/manager-I6KbPihW.js +0 -3917
- package/dist/plugin-sdk/manager-runtime-CFfYYWIQ.js +0 -15
- package/dist/plugin-sdk/outbound-NS6UHnB6.js +0 -212
- package/dist/plugin-sdk/outbound-attachment-Dy6fyf6H.js +0 -19
- package/dist/plugin-sdk/path-alias-guards-DBjLbIX_.js +0 -43
- package/dist/plugin-sdk/paths-vTM3Lh3X.js +0 -166
- package/dist/plugin-sdk/pi-embedded-helpers-1R1gu7eX.js +0 -9627
- package/dist/plugin-sdk/pi-model-discovery-runtime-Do9o-dUd.js +0 -8
- package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-D4sFsIks.js +0 -354
- package/dist/plugin-sdk/plugins-DeBZB9l_.js +0 -864
- package/dist/plugin-sdk/proxy-fetch-ChxOhWF4.js +0 -38
- package/dist/plugin-sdk/pw-ai-DEOmCSSC.js +0 -1938
- package/dist/plugin-sdk/qmd-manager-HyYKoEch.js +0 -1448
- package/dist/plugin-sdk/query-expansion-CeyKUeDW.js +0 -1011
- package/dist/plugin-sdk/reply-DAo_Jt8K.js +0 -97916
- package/dist/plugin-sdk/resolve-outbound-target-B42qgQS9.js +0 -40
- package/dist/plugin-sdk/run-with-concurrency-Bt_ks0Qa.js +0 -1994
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-B6W989eF.js +0 -10
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-c_GDFy37.js +0 -19
- package/dist/plugin-sdk/send-CQpMudwO.js +0 -2587
- package/dist/plugin-sdk/send-DQHLzVyO.js +0 -414
- package/dist/plugin-sdk/send-DTB24bEF.js +0 -3135
- package/dist/plugin-sdk/send-DfHadjZ_.js +0 -503
- package/dist/plugin-sdk/send-XXlW2iny.js +0 -540
- package/dist/plugin-sdk/session-6TF6MyaC.js +0 -169
- package/dist/plugin-sdk/skill-commands-CkGeFUMl.js +0 -342
- package/dist/plugin-sdk/skills-CBkHBYPq.js +0 -1428
- package/dist/plugin-sdk/slash-commands.runtime-CxliuGaP.js +0 -13
- package/dist/plugin-sdk/slash-dispatch.runtime-DFaeYlJQ.js +0 -52
- package/dist/plugin-sdk/slash-skill-commands.runtime-0M0OLCxq.js +0 -16
- package/dist/plugin-sdk/ssrf-cFtplYtS.js +0 -202
- package/dist/plugin-sdk/store-5nyxY3WU.js +0 -81
- package/dist/plugin-sdk/subagent-registry-runtime-DCtmDwna.js +0 -52
- package/dist/plugin-sdk/tables-C47P4GTN.js +0 -55
- package/dist/plugin-sdk/thinking-Bo2eosVa.js +0 -1206
- package/dist/plugin-sdk/tokens-DgNRBwIg.js +0 -52
- package/dist/plugin-sdk/tool-images-Gk_-0y2N.js +0 -274
- package/dist/plugin-sdk/web-CVxZbXyH.js +0 -56
- package/dist/plugin-sdk/whatsapp-actions-Bw0H9g-n.js +0 -80
- package/dist/redact-ClbcYG1J.js +0 -319
- package/dist/runtime-whatsapp-login.runtime-IeylZEl4.js +0 -13
- package/dist/runtime-whatsapp-outbound.runtime-ClBRuLsq.js +0 -22
- package/dist/slash-commands.runtime-Cpn2tYW4.js +0 -16
- package/dist/slash-dispatch.runtime-CWbpp23S.js +0 -56
- package/dist/slash-skill-commands.runtime-DKMvvdDW.js +0 -20
- package/dist/subagent-registry-runtime-DEVpAaAP.js +0 -56
- package/dist/target-errors-CBI2Ga0y.js +0 -195
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import "./paths-MKyEVmEb.js";
|
|
2
|
-
import { y as isRecord } from "./logger-CZY9KIoY.js";
|
|
3
|
-
import { n as fetchWithTimeout } from "./fetch-timeout-D455O27U.js";
|
|
4
|
-
import { t as makeProxyFetch } from "./proxy-fetch-ChxOhWF4.js";
|
|
5
|
-
import "./proxy-BKdNrmWL.js";
|
|
6
|
-
|
|
7
|
-
//#region src/telegram/audit-membership-runtime.ts
|
|
8
|
-
const TELEGRAM_API_BASE = "https://api.telegram.org";
|
|
9
|
-
async function auditTelegramGroupMembershipImpl(params) {
|
|
10
|
-
const fetcher = params.proxyUrl ? makeProxyFetch(params.proxyUrl) : fetch;
|
|
11
|
-
const base = `${TELEGRAM_API_BASE}/bot${params.token}`;
|
|
12
|
-
const groups = [];
|
|
13
|
-
for (const chatId of params.groupIds) try {
|
|
14
|
-
const res = await fetchWithTimeout(`${base}/getChatMember?chat_id=${encodeURIComponent(chatId)}&user_id=${encodeURIComponent(String(params.botId))}`, {}, params.timeoutMs, fetcher);
|
|
15
|
-
const json = await res.json();
|
|
16
|
-
if (!res.ok || !isRecord(json) || !json.ok) {
|
|
17
|
-
const desc = isRecord(json) && !json.ok && typeof json.description === "string" ? json.description : `getChatMember failed (${res.status})`;
|
|
18
|
-
groups.push({
|
|
19
|
-
chatId,
|
|
20
|
-
ok: false,
|
|
21
|
-
status: null,
|
|
22
|
-
error: desc,
|
|
23
|
-
matchKey: chatId,
|
|
24
|
-
matchSource: "id"
|
|
25
|
-
});
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
const status = isRecord(json.result) ? json.result.status ?? null : null;
|
|
29
|
-
const ok = status === "creator" || status === "administrator" || status === "member";
|
|
30
|
-
groups.push({
|
|
31
|
-
chatId,
|
|
32
|
-
ok,
|
|
33
|
-
status,
|
|
34
|
-
error: ok ? null : "bot not in group",
|
|
35
|
-
matchKey: chatId,
|
|
36
|
-
matchSource: "id"
|
|
37
|
-
});
|
|
38
|
-
} catch (err) {
|
|
39
|
-
groups.push({
|
|
40
|
-
chatId,
|
|
41
|
-
ok: false,
|
|
42
|
-
status: null,
|
|
43
|
-
error: err instanceof Error ? err.message : String(err),
|
|
44
|
-
matchKey: chatId,
|
|
45
|
-
matchSource: "id"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
ok: groups.every((g) => g.ok),
|
|
50
|
-
checkedGroups: groups.length,
|
|
51
|
-
unresolvedGroups: 0,
|
|
52
|
-
hasWildcardUnmentionedGroups: false,
|
|
53
|
-
groups
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
export { auditTelegramGroupMembershipImpl };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Un as resolveRetryConfig, Wn as retryAsync } from "./config-BkEnz2Po.js";
|
|
2
|
-
import { a as createSubsystemLogger } from "./logger-CZY9KIoY.js";
|
|
3
|
-
import { r as formatErrorMessage } from "./errors-DaiAM-yU.js";
|
|
4
|
-
import { RateLimitError } from "@buape/carbon";
|
|
5
|
-
|
|
6
|
-
//#region src/infra/retry-policy.ts
|
|
7
|
-
const DISCORD_RETRY_DEFAULTS = {
|
|
8
|
-
attempts: 3,
|
|
9
|
-
minDelayMs: 500,
|
|
10
|
-
maxDelayMs: 3e4,
|
|
11
|
-
jitter: .1
|
|
12
|
-
};
|
|
13
|
-
const TELEGRAM_RETRY_DEFAULTS = {
|
|
14
|
-
attempts: 3,
|
|
15
|
-
minDelayMs: 400,
|
|
16
|
-
maxDelayMs: 3e4,
|
|
17
|
-
jitter: .1
|
|
18
|
-
};
|
|
19
|
-
const TELEGRAM_RETRY_RE = /429|timeout|connect|reset|closed|unavailable|temporarily/i;
|
|
20
|
-
const log = createSubsystemLogger("retry-policy");
|
|
21
|
-
function getTelegramRetryAfterMs(err) {
|
|
22
|
-
if (!err || typeof err !== "object") return;
|
|
23
|
-
const candidate = "parameters" in err && err.parameters && typeof err.parameters === "object" ? err.parameters.retry_after : "response" in err && err.response && typeof err.response === "object" && "parameters" in err.response ? err.response.parameters?.retry_after : "error" in err && err.error && typeof err.error === "object" && "parameters" in err.error ? err.error.parameters?.retry_after : void 0;
|
|
24
|
-
return typeof candidate === "number" && Number.isFinite(candidate) ? candidate * 1e3 : void 0;
|
|
25
|
-
}
|
|
26
|
-
function createDiscordRetryRunner(params) {
|
|
27
|
-
const retryConfig = resolveRetryConfig(DISCORD_RETRY_DEFAULTS, {
|
|
28
|
-
...params.configRetry,
|
|
29
|
-
...params.retry
|
|
30
|
-
});
|
|
31
|
-
return (fn, label) => retryAsync(fn, {
|
|
32
|
-
...retryConfig,
|
|
33
|
-
label,
|
|
34
|
-
shouldRetry: (err) => err instanceof RateLimitError,
|
|
35
|
-
retryAfterMs: (err) => err instanceof RateLimitError ? err.retryAfter * 1e3 : void 0,
|
|
36
|
-
onRetry: params.verbose ? (info) => {
|
|
37
|
-
const labelText = info.label ?? "request";
|
|
38
|
-
const maxRetries = Math.max(1, info.maxAttempts - 1);
|
|
39
|
-
log.warn(`discord ${labelText} rate limited, retry ${info.attempt}/${maxRetries} in ${info.delayMs}ms`);
|
|
40
|
-
} : void 0
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
function createTelegramRetryRunner(params) {
|
|
44
|
-
const retryConfig = resolveRetryConfig(TELEGRAM_RETRY_DEFAULTS, {
|
|
45
|
-
...params.configRetry,
|
|
46
|
-
...params.retry
|
|
47
|
-
});
|
|
48
|
-
const shouldRetry = params.shouldRetry ? (err) => params.shouldRetry?.(err) || TELEGRAM_RETRY_RE.test(formatErrorMessage(err)) : (err) => TELEGRAM_RETRY_RE.test(formatErrorMessage(err));
|
|
49
|
-
return (fn, label) => retryAsync(fn, {
|
|
50
|
-
...retryConfig,
|
|
51
|
-
label,
|
|
52
|
-
shouldRetry,
|
|
53
|
-
retryAfterMs: getTelegramRetryAfterMs,
|
|
54
|
-
onRetry: params.verbose ? (info) => {
|
|
55
|
-
const maxRetries = Math.max(1, info.maxAttempts - 1);
|
|
56
|
-
log.warn(`telegram send retry ${info.attempt}/${maxRetries} for ${info.label ?? label ?? "request"} in ${info.delayMs}ms: ${formatErrorMessage(info.err)}`);
|
|
57
|
-
} : void 0
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/infra/channel-activity.ts
|
|
63
|
-
const activity = /* @__PURE__ */ new Map();
|
|
64
|
-
function keyFor(channel, accountId) {
|
|
65
|
-
return `${channel}:${accountId || "default"}`;
|
|
66
|
-
}
|
|
67
|
-
function ensureEntry(channel, accountId) {
|
|
68
|
-
const key = keyFor(channel, accountId);
|
|
69
|
-
const existing = activity.get(key);
|
|
70
|
-
if (existing) return existing;
|
|
71
|
-
const created = {
|
|
72
|
-
inboundAt: null,
|
|
73
|
-
outboundAt: null
|
|
74
|
-
};
|
|
75
|
-
activity.set(key, created);
|
|
76
|
-
return created;
|
|
77
|
-
}
|
|
78
|
-
function recordChannelActivity(params) {
|
|
79
|
-
const at = typeof params.at === "number" ? params.at : Date.now();
|
|
80
|
-
const accountId = params.accountId?.trim() || "default";
|
|
81
|
-
const entry = ensureEntry(params.channel, accountId);
|
|
82
|
-
if (params.direction === "inbound") entry.inboundAt = at;
|
|
83
|
-
if (params.direction === "outbound") entry.outboundAt = at;
|
|
84
|
-
}
|
|
85
|
-
function getChannelActivity(params) {
|
|
86
|
-
const accountId = params.accountId?.trim() || "default";
|
|
87
|
-
return activity.get(keyFor(params.channel, accountId)) ?? {
|
|
88
|
-
inboundAt: null,
|
|
89
|
-
outboundAt: null
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
//#endregion
|
|
94
|
-
export { createTelegramRetryRunner as i, recordChannelActivity as n, createDiscordRetryRunner as r, getChannelActivity as t };
|