@hanzo/bot 2026.3.8 → 2026.3.10
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/{audio-preflight-D_s-peid.js → audio-preflight-BnfuyvxO.js} +4 -4
- package/dist/{audio-preflight-BEc8i-bS.js → audio-preflight-CpAXC_Ct.js} +4 -4
- package/dist/{audio-transcription-runner-X1KzI7dF.js → audio-transcription-runner-CAOjjGxN.js} +1 -1
- package/dist/{audio-transcription-runner-BePCnZfw.js → audio-transcription-runner-GcMnO6sT.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +6 -6
- package/dist/bundled/session-memory/handler.js +6 -6
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{chrome-B24-8NDM.js → chrome--CFg5C_H.js} +8 -8
- package/dist/{chrome-C7OwLtx9.js → chrome-jCt9JCU8.js} +8 -8
- package/dist/{cloud-connect-CknfBF39.js → cloud-connect-6kdj8st_.js} +1 -1
- package/dist/{deliver-D8dBbzpu.js → deliver-BVtVDxwX.js} +1 -1
- package/dist/{deliver-DudaV86i.js → deliver-DmfS4khs.js} +1 -1
- package/dist/{deliver-runtime-C76IMU4W.js → deliver-runtime-G0G5orrZ.js} +3 -3
- package/dist/{deliver-runtime-qDmQqiF-.js → deliver-runtime-PxJvVUhh.js} +3 -3
- package/dist/{deps-send-whatsapp.runtime-Cv_awFtm.js → deps-send-whatsapp.runtime-8bLqjmui.js} +7 -7
- package/dist/{deps-send-whatsapp.runtime-Cq-TLsJw.js → deps-send-whatsapp.runtime-CrzuaVhC.js} +7 -7
- package/dist/entry.js +15 -8
- package/dist/extensionAPI.js +6 -6
- package/dist/{image-nUHQF6BX.js → image-BdZcUz8M.js} +1 -1
- package/dist/{image-BOybyCis.js → image-DSK1hSSV.js} +1 -1
- package/dist/{image-runtime-B5M_-diF.js → image-runtime-ueqmfx1a.js} +3 -3
- package/dist/{image-runtime-y4msd5bn.js → image-runtime-xqxW2PQA.js} +3 -3
- package/dist/llm-slug-generator.js +6 -6
- package/dist/{local-launch-C2RER-G3.js → local-launch-BJpBAIR5.js} +37 -33
- package/dist/{pi-embedded-BHXPs-Ix.js → pi-embedded-DBn841N-.js} +24 -24
- package/dist/{pi-embedded-DvWHP6Nn.js → pi-embedded-DYc6emwb.js} +24 -24
- package/dist/{pi-embedded-helpers-xIXwvwuE.js → pi-embedded-helpers-BtnBVL-4.js} +3 -3
- package/dist/{pi-embedded-helpers-Ck1qEeMH.js → pi-embedded-helpers-DLm1Mtr2.js} +3 -3
- package/dist/plugin-sdk/accounts-B8qv93DH.js +35 -0
- package/dist/plugin-sdk/accounts-D2p8t4UO.js +288 -0
- package/dist/plugin-sdk/accounts-D96D1U9M.js +46 -0
- package/dist/plugin-sdk/active-listener-Mha1rAbh.js +50 -0
- package/dist/plugin-sdk/api-key-rotation-D0aZfxXH.js +181 -0
- package/dist/plugin-sdk/audio-preflight-D3y8mHJa.js +69 -0
- package/dist/plugin-sdk/audio-transcription-runner-j0mQXKSH.js +2205 -0
- package/dist/plugin-sdk/audit-membership-runtime-D-Ni2WDc.js +58 -0
- package/dist/plugin-sdk/channel-activity-VpA3MxPb.js +94 -0
- package/dist/plugin-sdk/channel-web-BP3vDdim.js +2256 -0
- package/dist/plugin-sdk/chrome-5jJIDTj0.js +2447 -0
- package/dist/plugin-sdk/commands-registry-BVKCdwN_.js +1125 -0
- package/dist/plugin-sdk/config-CudVTZDi.js +18200 -0
- package/dist/plugin-sdk/deliver-4NrmrRKu.js +1744 -0
- package/dist/plugin-sdk/deliver-runtime-CB4wXMTH.js +32 -0
- package/dist/plugin-sdk/deps-send-discord.runtime-Di8ELKED.js +23 -0
- package/dist/plugin-sdk/deps-send-imessage.runtime-CWWtApbz.js +22 -0
- package/dist/plugin-sdk/deps-send-signal.runtime-C6BGyoIY.js +21 -0
- package/dist/plugin-sdk/deps-send-slack.runtime-DgtITBuc.js +19 -0
- package/dist/plugin-sdk/deps-send-telegram.runtime-DyY4XRxh.js +24 -0
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-LKiQNFcF.js +57 -0
- package/dist/plugin-sdk/diagnostic-DCPixRez.js +319 -0
- package/dist/plugin-sdk/errors-D5bA02--.js +54 -0
- package/dist/plugin-sdk/fetch-guard-n0LVdzZL.js +156 -0
- package/dist/plugin-sdk/fs-safe-IQ0H7rVD.js +352 -0
- package/dist/plugin-sdk/image-n-R2HcNg.js +2314 -0
- package/dist/plugin-sdk/image-ops-BpYDXC6N.js +584 -0
- package/dist/plugin-sdk/image-runtime-CbCl82B8.js +25 -0
- package/dist/plugin-sdk/index.js +50 -50
- package/dist/plugin-sdk/ir-DsMX3GcS.js +1296 -0
- package/dist/plugin-sdk/local-roots-DR-lR22p.js +186 -0
- package/dist/plugin-sdk/logger-2A0UE34q.js +1163 -0
- package/dist/plugin-sdk/login-CxFTtHEi.js +57 -0
- package/dist/plugin-sdk/login-qr-BCkrf1Zx.js +320 -0
- package/dist/plugin-sdk/manager-ClUgSFkG.js +3943 -0
- package/dist/plugin-sdk/manager-runtime-MWzYCRyH.js +15 -0
- package/dist/plugin-sdk/outbound-Dqs8L8QW.js +212 -0
- package/dist/plugin-sdk/outbound-attachment-CPfpUcdI.js +19 -0
- package/dist/plugin-sdk/path-alias-guards-LILr7Hrs.js +43 -0
- package/dist/plugin-sdk/paths-CfGmXu9A.js +166 -0
- package/dist/plugin-sdk/pi-embedded-helpers-CeC8GbRi.js +9731 -0
- package/dist/plugin-sdk/pi-model-discovery-DycOMKYh.js +134 -0
- package/dist/plugin-sdk/pi-model-discovery-runtime-C64BYe5F.js +8 -0
- package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-C-HNtPSw.js +354 -0
- package/dist/plugin-sdk/plugins-2gQWMmUN.js +1205 -0
- package/dist/plugin-sdk/proxy-fetch-sX3-xzX1.js +38 -0
- package/dist/plugin-sdk/pw-ai-D7FTxM3C.js +1938 -0
- package/dist/plugin-sdk/qmd-manager-Da3Jq30m.js +1608 -0
- package/dist/plugin-sdk/query-expansion-B5Z0In1U.js +1014 -0
- package/dist/plugin-sdk/redact-85H1J7mo.js +319 -0
- package/dist/plugin-sdk/reply-DmCyOPxV.js +102224 -0
- package/dist/plugin-sdk/resolve-outbound-target-y0Sp7gsM.js +40 -0
- package/dist/plugin-sdk/run-with-concurrency-CFRxflYW.js +1994 -0
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-fgm84Rdh.js +10 -0
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-DpMuLd_h.js +19 -0
- package/dist/plugin-sdk/send-BQvcPd54.js +3135 -0
- package/dist/plugin-sdk/send-Bplfz7UW.js +540 -0
- package/dist/plugin-sdk/send-C8gdhoLP.js +414 -0
- package/dist/plugin-sdk/send-CTOVZqmi.js +2602 -0
- package/dist/plugin-sdk/send-Cld7xlxq.js +503 -0
- package/dist/plugin-sdk/session-D4k86ARy.js +169 -0
- package/dist/plugin-sdk/signal.js +2 -2
- package/dist/plugin-sdk/skill-commands-BfHvtJx2.js +353 -0
- package/dist/plugin-sdk/skills-BrE5Yb5o.js +1428 -0
- package/dist/plugin-sdk/slash-commands.runtime-UpSrdY-a.js +13 -0
- package/dist/plugin-sdk/slash-dispatch.runtime-C-Ymizf2.js +52 -0
- package/dist/plugin-sdk/slash-skill-commands.runtime-Bb9wo3w0.js +16 -0
- package/dist/plugin-sdk/ssrf-CbvrROKN.js +202 -0
- package/dist/plugin-sdk/store-8XS_isi_.js +81 -0
- package/dist/plugin-sdk/subagent-registry-runtime-Cl3jJKM1.js +52 -0
- package/dist/plugin-sdk/tables-BhfDBQ58.js +55 -0
- package/dist/plugin-sdk/target-errors-0DW3k-Ae.js +195 -0
- package/dist/plugin-sdk/thinking-DE2FCBnv.js +1209 -0
- package/dist/plugin-sdk/tokens-C2tJ8uXs.js +52 -0
- package/dist/plugin-sdk/tool-images-B1I6LEp7.js +274 -0
- package/dist/plugin-sdk/web-BHzDLmns.js +56 -0
- package/dist/plugin-sdk/whatsapp-actions-BoAH0BAS.js +80 -0
- package/dist/{pw-ai-DweqbnMJ.js → pw-ai-C-Sy12jT.js} +1 -1
- package/dist/{pw-ai-DsYmOxCp.js → pw-ai-pJMhS79V.js} +1 -1
- package/dist/{run-main-CgFUs81l.js → run-main-JI9-1g4u.js} +2 -2
- package/dist/{slash-dispatch.runtime-D28-UnsO.js → slash-dispatch.runtime-DLP2IeNv.js} +6 -6
- package/dist/{slash-dispatch.runtime-DzpJjr3K.js → slash-dispatch.runtime-Vp6IDoCc.js} +6 -6
- package/dist/{subagent-registry-runtime-a7xfwPB8.js → subagent-registry-runtime-BlAI3eqU.js} +6 -6
- package/dist/{subagent-registry-runtime-Bt-LYyrB.js → subagent-registry-runtime-COKZwsHd.js} +6 -6
- package/dist/{web-CREcqhe9.js → web-BEuMJbx-.js} +6 -6
- package/dist/{web-IBqHOVI2.js → web-BvId86u4.js} +6 -6
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/ci-fix-loop/package.json +1 -1
- package/extensions/continuous-learning/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/diffs/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/flow/package.json +1 -1
- package/extensions/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +10 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +10 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +10 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/self-improvement/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +10 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +10 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +10 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +10 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import "./paths-MKyEVmEb.js";
|
|
2
|
+
import { y as isRecord } from "./logger-2A0UE34q.js";
|
|
3
|
+
import { n as fetchWithTimeout } from "./fetch-timeout-D455O27U.js";
|
|
4
|
+
import { t as makeProxyFetch } from "./proxy-fetch-sX3-xzX1.js";
|
|
5
|
+
import "./proxy-BFm9FJeW.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 };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Gn as resolveRetryConfig, Kn as retryAsync } from "./config-CudVTZDi.js";
|
|
2
|
+
import { a as createSubsystemLogger } from "./logger-2A0UE34q.js";
|
|
3
|
+
import { r as formatErrorMessage } from "./errors-D5bA02--.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 };
|