@hanzo/bot 2026.3.9 → 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/{accounts-C2vo5fEt.js → accounts-B4Cft76I.js} +2 -2
- package/dist/{accounts-DNligSyz.js → accounts-C_LXSS3x.js} +2 -2
- package/dist/{accounts-B-9Bhdn6.js → accounts-Cp7zE1zb.js} +17 -17
- package/dist/{active-listener-zLV9i9LQ.js → active-listener-BR7vpJxr.js} +2 -2
- package/dist/{api-key-rotation-BENZC8ep.js → api-key-rotation-iYITGuLK.js} +2 -2
- package/dist/{audio-preflight-D_s-peid.js → audio-preflight-BnfuyvxO.js} +4 -4
- package/dist/{audio-preflight-Bd44yEnM.js → audio-preflight-CpAXC_Ct.js} +32 -32
- package/dist/{audio-transcription-runner-CsXaWVup.js → audio-transcription-runner-CAOjjGxN.js} +12 -12
- package/dist/{audio-transcription-runner-BePCnZfw.js → audio-transcription-runner-GcMnO6sT.js} +1 -1
- package/dist/{audit-membership-runtime-BJ149bTU.js → audit-membership-runtime-CVVxrZ7j.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-DO-d_jr4.js → channel-activity-DR4SiHcg.js} +3 -3
- package/dist/{chrome-B24-8NDM.js → chrome--CFg5C_H.js} +8 -8
- package/dist/{chrome-hkgY24uS.js → chrome-jCt9JCU8.js} +18 -18
- package/dist/{cloud-connect-CknfBF39.js → cloud-connect-6kdj8st_.js} +1 -1
- package/dist/{commands-registry-C6INZSSX.js → commands-registry-Ce7SJnAP.js} +4 -4
- package/dist/{deliver-B1PE5Kmq.js → deliver-BVtVDxwX.js} +21 -21
- package/dist/{deliver-DudaV86i.js → deliver-DmfS4khs.js} +1 -1
- package/dist/deliver-runtime-G0G5orrZ.js +36 -0
- package/dist/{deliver-runtime-qDmQqiF-.js → deliver-runtime-PxJvVUhh.js} +3 -3
- package/dist/deps-send-discord.runtime-BM3uHet5.js +26 -0
- package/dist/deps-send-imessage.runtime-CBlUhUeN.js +25 -0
- package/dist/deps-send-signal.runtime-DnH0lazO.js +24 -0
- package/dist/deps-send-slack.runtime-Dmq0lsvR.js +22 -0
- package/dist/deps-send-telegram.runtime-33sbp3Ol.js +27 -0
- package/dist/deps-send-whatsapp.runtime-8bLqjmui.js +60 -0
- package/dist/{deps-send-whatsapp.runtime-Cq-TLsJw.js → deps-send-whatsapp.runtime-CrzuaVhC.js} +7 -7
- package/dist/{diagnostic-Do7hUiao.js → diagnostic-D1IbJfJM.js} +2 -2
- package/dist/entry.js +1 -1
- package/dist/{errors-DDrhcWHi.js → errors-CHd6Q-vF.js} +1 -1
- package/dist/extensionAPI.js +6 -6
- package/dist/{fetch-BETRLmK8.js → fetch-C6doVJxZ.js} +5 -5
- package/dist/{fetch-guard-pwJ-F5aP.js → fetch-guard-C-neMX4E.js} +2 -2
- package/dist/{frontmatter-BFHzrAY7.js → frontmatter-B6XNqDx2.js} +3 -3
- package/dist/{fs-safe-CeZ_BXcn.js → fs-safe-DmeSz0Nd.js} +4 -4
- package/dist/{github-copilot-token-D13V9YBz.js → github-copilot-token-BDioPmd6.js} +7 -7
- package/dist/{image-nUHQF6BX.js → image-BdZcUz8M.js} +1 -1
- package/dist/{image-DJo3nF6e.js → image-DSK1hSSV.js} +6 -6
- package/dist/{image-ops-CLQ9abCf.js → image-ops-C-QWxnVw.js} +2 -2
- package/dist/{image-runtime-B5M_-diF.js → image-runtime-ueqmfx1a.js} +3 -3
- package/dist/image-runtime-xqxW2PQA.js +29 -0
- package/dist/{ir-9Bn85Mqy.js → ir-B0iARYlT.js} +8 -8
- package/dist/{legacy-names-Bkl4tjN-.js → legacy-names-DZdACm3t.js} +1 -1
- package/dist/llm-slug-generator.js +51 -51
- package/dist/{local-launch-C2RER-G3.js → local-launch-BJpBAIR5.js} +37 -33
- package/dist/{logger-D4RcXHR-.js → logger-LCC1m_20.js} +7 -7
- package/dist/{login-nNeuyFrd.js → login-BbBqhgOM.js} +5 -5
- package/dist/{login-qr-BEawmd_E.js → login-qr-AAX0vgZR.js} +10 -10
- package/dist/{manager-Bq6y1TH8.js → manager-BOyc7q1-.js} +13 -13
- package/dist/manager-runtime-20Upetpf.js +18 -0
- package/dist/{model-selection-DQ5NblsF.js → model-selection-BNMWRHZu.js} +43 -43
- package/dist/{outbound-CPL9ID8o.js → outbound-C72ULCcI.js} +6 -6
- package/dist/{outbound-attachment-BmiVeNLr.js → outbound-attachment-BF1JVcCB.js} +2 -2
- package/dist/{path-alias-guards-DBVdJRcc.js → path-alias-guards-BCv18tKc.js} +1 -1
- package/dist/{paths-C6TxBCvO.js → paths-Cvc9EM8Y.js} +5 -5
- package/dist/{paths-Cgd1FfOW.js → paths-l8GkNRRD.js} +4 -4
- package/dist/{pi-embedded-BYfpUcIY.js → pi-embedded-DBn841N-.js} +159 -159
- package/dist/{pi-embedded-DvWHP6Nn.js → pi-embedded-DYc6emwb.js} +24 -24
- package/dist/{pi-embedded-helpers-_OL4yNw0.js → pi-embedded-helpers-BtnBVL-4.js} +52 -52
- package/dist/{pi-embedded-helpers-Ck1qEeMH.js → pi-embedded-helpers-DLm1Mtr2.js} +3 -3
- package/dist/{pi-model-discovery-DANpv7pw.js → pi-model-discovery-Cucu_uXw.js} +7 -7
- package/dist/pi-model-discovery-runtime-BcJAGnf4.js +11 -0
- package/dist/{pi-tools.before-tool-call.runtime-CLb1M0uM.js → pi-tools.before-tool-call.runtime-DQ2d5nM_.js} +9 -9
- 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/discord.js +6 -6
- 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/{proxy-fetch-ChfJDZwG.js → plugin-sdk/proxy-fetch-sX3-xzX1.js} +1 -1
- 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/{redact-DGz6yigq.js → plugin-sdk/redact-85H1J7mo.js} +1 -1
- 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/{target-errors-CxUP9L6c.js → plugin-sdk/target-errors-0DW3k-Ae.js} +2 -2
- package/dist/plugin-sdk/thinking-DE2FCBnv.js +1209 -0
- package/dist/{tokens-Cyi-NbsV.js → plugin-sdk/tokens-C2tJ8uXs.js} +1 -1
- 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/{plugins-CeflwBVL.js → plugins-YJZX7mvv.js} +13 -13
- package/dist/{proxy-env-zUD967XQ.js → proxy-env-CreSu2Ej.js} +1 -1
- package/dist/proxy-fetch-lxJGuoUa.js +38 -0
- package/dist/{pw-ai-DweqbnMJ.js → pw-ai-C-Sy12jT.js} +1 -1
- package/dist/{pw-ai-yR5naMge.js → pw-ai-pJMhS79V.js} +14 -14
- package/dist/{qmd-manager-CWAXF3Vk.js → qmd-manager-5C5L5YNn.js} +10 -10
- package/dist/{query-expansion-Cbd21KuP.js → query-expansion-BeRz7_bo.js} +6 -6
- package/dist/redact-DqlKR0-n.js +319 -0
- package/dist/{run-main-CgFUs81l.js → run-main-JI9-1g4u.js} +2 -2
- package/dist/{run-with-concurrency-kEFC1Fle.js → run-with-concurrency-ffnO0KnQ.js} +4 -4
- package/dist/runtime-whatsapp-login.runtime-BcbYtLph.js +13 -0
- package/dist/runtime-whatsapp-outbound.runtime-MIKcURpN.js +22 -0
- package/dist/{send-DKjV2v4c.js → send-BXQ1U9Zk.js} +5 -5
- package/dist/{send-C4kartXc.js → send-BrlM68Dd.js} +6 -6
- package/dist/{send-DqQOo6dv.js → send-CKIMBFLs.js} +8 -8
- package/dist/{send-Bi_r7Hno.js → send-CmVj590_.js} +7 -7
- package/dist/{send-CisFoCif.js → send-Cp6dmr2f.js} +28 -28
- package/dist/{session-U4Hk8Woy.js → session-DoD05Mm8.js} +8 -8
- package/dist/{skill-commands-BN9qtrxT.js → skill-commands-DGy6Juvb.js} +9 -9
- package/dist/{skills-DgwotBrr.js → skills-BDJUqEFI.js} +22 -22
- package/dist/slash-commands.runtime-2kptrdDi.js +16 -0
- package/dist/slash-dispatch.runtime-DLP2IeNv.js +56 -0
- package/dist/{slash-dispatch.runtime-DzpJjr3K.js → slash-dispatch.runtime-Vp6IDoCc.js} +6 -6
- package/dist/slash-skill-commands.runtime-6jUbSMOW.js +20 -0
- package/dist/{store-CNWtYorN.js → store-cJlS-gR6.js} +2 -2
- package/dist/{subagent-registry-runtime-a7xfwPB8.js → subagent-registry-runtime-BlAI3eqU.js} +6 -6
- package/dist/subagent-registry-runtime-COKZwsHd.js +56 -0
- package/dist/{subsystem-W834z9Wa.js → subsystem-CdFYjh2k.js} +14 -14
- package/dist/{tables-DBZFzS9x.js → tables-CgcFNr6G.js} +1 -1
- package/dist/target-errors-DPj6Es2y.js +195 -0
- package/dist/{thinking-Xlbm5WNq.js → thinking-C3b10cHs.js} +7 -7
- package/dist/tokens-mtgzW7UN.js +52 -0
- package/dist/{tool-images-D217wDXi.js → tool-images-D9pdW1gE.js} +2 -2
- package/dist/{web-o9PMPEDK.js → web-BEuMJbx-.js} +55 -55
- package/dist/{web-IBqHOVI2.js → web-BvId86u4.js} +6 -6
- package/dist/{whatsapp-actions-DmKZmCkz.js → whatsapp-actions-nZnQ4BwK.js} +21 -21
- package/dist/{workspace-CPNwHoy5.js → workspace-BC5WA0Th.js} +20 -20
- 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 +5 -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 +5 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +5 -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 +5 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +5 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +5 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +5 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/dist/deliver-runtime-L42k3QaI.js +0 -36
- package/dist/deps-send-discord.runtime-DSqcSnN3.js +0 -26
- package/dist/deps-send-imessage.runtime-Ch2ZcE2r.js +0 -25
- package/dist/deps-send-signal.runtime-c-v7bD8y.js +0 -24
- package/dist/deps-send-slack.runtime-xA-JRpSq.js +0 -22
- package/dist/deps-send-telegram.runtime-CO2npp7q.js +0 -27
- package/dist/deps-send-whatsapp.runtime-wvdxQphB.js +0 -60
- package/dist/image-runtime-Bd2-_2Fa.js +0 -29
- package/dist/manager-runtime-DNkH2nza.js +0 -18
- package/dist/pi-model-discovery-runtime-Dr5-MM2j.js +0 -11
- package/dist/runtime-whatsapp-login.runtime-BKnJdTKn.js +0 -13
- package/dist/runtime-whatsapp-outbound.runtime-DZYgfcRc.js +0 -22
- package/dist/slash-commands.runtime-iBi9rbmg.js +0 -16
- package/dist/slash-dispatch.runtime-8okSdt7k.js +0 -56
- package/dist/slash-skill-commands.runtime-a4qnxIQp.js +0 -20
- package/dist/subagent-registry-runtime-C4H5Ofm0.js +0 -56
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { b as detectMime } from "./image-ops-C-QWxnVw.js";
|
|
2
|
+
import { r as sanitizeToolResultImages } from "./tool-images-D9pdW1gE.js";
|
|
3
|
+
import fs from "node:fs/promises";
|
|
4
|
+
|
|
5
|
+
//#region src/agents/tools/common.ts
|
|
6
|
+
var ToolInputError = class extends Error {
|
|
7
|
+
constructor(message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.status = 400;
|
|
10
|
+
this.name = "ToolInputError";
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var ToolAuthorizationError = class extends ToolInputError {
|
|
14
|
+
constructor(message) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.status = 403;
|
|
17
|
+
this.name = "ToolAuthorizationError";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function createActionGate(actions) {
|
|
21
|
+
return (key, defaultValue = true) => {
|
|
22
|
+
const value = actions?.[key];
|
|
23
|
+
if (value === void 0) return defaultValue;
|
|
24
|
+
return value !== false;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function toSnakeCaseKey(key) {
|
|
28
|
+
return key.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
|
|
29
|
+
}
|
|
30
|
+
function readParamRaw(params, key) {
|
|
31
|
+
if (Object.hasOwn(params, key)) return params[key];
|
|
32
|
+
const snakeKey = toSnakeCaseKey(key);
|
|
33
|
+
if (snakeKey !== key && Object.hasOwn(params, snakeKey)) return params[snakeKey];
|
|
34
|
+
}
|
|
35
|
+
function readStringParam(params, key, options = {}) {
|
|
36
|
+
const { required = false, trim = true, label = key, allowEmpty = false } = options;
|
|
37
|
+
const raw = readParamRaw(params, key);
|
|
38
|
+
if (typeof raw !== "string") {
|
|
39
|
+
if (required) throw new ToolInputError(`${label} required`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const value = trim ? raw.trim() : raw;
|
|
43
|
+
if (!value && !allowEmpty) {
|
|
44
|
+
if (required) throw new ToolInputError(`${label} required`);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
function readStringOrNumberParam(params, key, options = {}) {
|
|
50
|
+
const { required = false, label = key } = options;
|
|
51
|
+
const raw = readParamRaw(params, key);
|
|
52
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
|
|
53
|
+
if (typeof raw === "string") {
|
|
54
|
+
const value = raw.trim();
|
|
55
|
+
if (value) return value;
|
|
56
|
+
}
|
|
57
|
+
if (required) throw new ToolInputError(`${label} required`);
|
|
58
|
+
}
|
|
59
|
+
function readNumberParam(params, key, options = {}) {
|
|
60
|
+
const { required = false, label = key, integer = false, strict = false } = options;
|
|
61
|
+
const raw = readParamRaw(params, key);
|
|
62
|
+
let value;
|
|
63
|
+
if (typeof raw === "number" && Number.isFinite(raw)) value = raw;
|
|
64
|
+
else if (typeof raw === "string") {
|
|
65
|
+
const trimmed = raw.trim();
|
|
66
|
+
if (trimmed) {
|
|
67
|
+
const parsed = strict ? Number(trimmed) : Number.parseFloat(trimmed);
|
|
68
|
+
if (Number.isFinite(parsed)) value = parsed;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (value === void 0) {
|
|
72
|
+
if (required) throw new ToolInputError(`${label} required`);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
return integer ? Math.trunc(value) : value;
|
|
76
|
+
}
|
|
77
|
+
function readStringArrayParam(params, key, options = {}) {
|
|
78
|
+
const { required = false, label = key } = options;
|
|
79
|
+
const raw = readParamRaw(params, key);
|
|
80
|
+
if (Array.isArray(raw)) {
|
|
81
|
+
const values = raw.filter((entry) => typeof entry === "string").map((entry) => entry.trim()).filter(Boolean);
|
|
82
|
+
if (values.length === 0) {
|
|
83
|
+
if (required) throw new ToolInputError(`${label} required`);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
return values;
|
|
87
|
+
}
|
|
88
|
+
if (typeof raw === "string") {
|
|
89
|
+
const value = raw.trim();
|
|
90
|
+
if (!value) {
|
|
91
|
+
if (required) throw new ToolInputError(`${label} required`);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
return [value];
|
|
95
|
+
}
|
|
96
|
+
if (required) throw new ToolInputError(`${label} required`);
|
|
97
|
+
}
|
|
98
|
+
function readReactionParams(params, options) {
|
|
99
|
+
const emojiKey = options.emojiKey ?? "emoji";
|
|
100
|
+
const removeKey = options.removeKey ?? "remove";
|
|
101
|
+
const remove = typeof params[removeKey] === "boolean" ? params[removeKey] : false;
|
|
102
|
+
const emoji = readStringParam(params, emojiKey, {
|
|
103
|
+
required: true,
|
|
104
|
+
allowEmpty: true
|
|
105
|
+
});
|
|
106
|
+
if (remove && !emoji) throw new ToolInputError(options.removeErrorMessage);
|
|
107
|
+
return {
|
|
108
|
+
emoji,
|
|
109
|
+
remove,
|
|
110
|
+
isEmpty: !emoji
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function jsonResult(payload) {
|
|
114
|
+
return {
|
|
115
|
+
content: [{
|
|
116
|
+
type: "text",
|
|
117
|
+
text: JSON.stringify(payload, null, 2)
|
|
118
|
+
}],
|
|
119
|
+
details: payload
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
async function imageResult(params) {
|
|
123
|
+
return await sanitizeToolResultImages({
|
|
124
|
+
content: [{
|
|
125
|
+
type: "text",
|
|
126
|
+
text: params.extraText ?? `MEDIA:${params.path}`
|
|
127
|
+
}, {
|
|
128
|
+
type: "image",
|
|
129
|
+
data: params.base64,
|
|
130
|
+
mimeType: params.mimeType
|
|
131
|
+
}],
|
|
132
|
+
details: {
|
|
133
|
+
path: params.path,
|
|
134
|
+
...params.details
|
|
135
|
+
}
|
|
136
|
+
}, params.label, params.imageSanitization);
|
|
137
|
+
}
|
|
138
|
+
async function imageResultFromFile(params) {
|
|
139
|
+
const buf = await fs.readFile(params.path);
|
|
140
|
+
const mimeType = await detectMime({ buffer: buf.slice(0, 256) }) ?? "image/png";
|
|
141
|
+
return await imageResult({
|
|
142
|
+
label: params.label,
|
|
143
|
+
path: params.path,
|
|
144
|
+
base64: buf.toString("base64"),
|
|
145
|
+
mimeType,
|
|
146
|
+
extraText: params.extraText,
|
|
147
|
+
details: params.details,
|
|
148
|
+
imageSanitization: params.imageSanitization
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Validate and parse an `availableTags` parameter from untrusted input.
|
|
153
|
+
* Returns `undefined` when the value is missing or not an array.
|
|
154
|
+
* Entries that lack a string `name` are silently dropped.
|
|
155
|
+
*/
|
|
156
|
+
function parseAvailableTags(raw) {
|
|
157
|
+
if (raw === void 0 || raw === null) return;
|
|
158
|
+
if (!Array.isArray(raw)) return;
|
|
159
|
+
const result = raw.filter((t) => typeof t === "object" && t !== null && typeof t.name === "string").map((t) => ({
|
|
160
|
+
...t.id !== void 0 && typeof t.id === "string" ? { id: t.id } : {},
|
|
161
|
+
name: t.name,
|
|
162
|
+
...typeof t.moderated === "boolean" ? { moderated: t.moderated } : {},
|
|
163
|
+
...t.emoji_id === null || typeof t.emoji_id === "string" ? { emoji_id: t.emoji_id } : {},
|
|
164
|
+
...t.emoji_name === null || typeof t.emoji_name === "string" ? { emoji_name: t.emoji_name } : {}
|
|
165
|
+
}));
|
|
166
|
+
return result.length ? result : void 0;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/infra/outbound/target-errors.ts
|
|
171
|
+
function missingTargetMessage(provider, hint) {
|
|
172
|
+
return `Delivering to ${provider} requires target${formatTargetHint(hint)}`;
|
|
173
|
+
}
|
|
174
|
+
function missingTargetError(provider, hint) {
|
|
175
|
+
return new Error(missingTargetMessage(provider, hint));
|
|
176
|
+
}
|
|
177
|
+
function ambiguousTargetMessage(provider, raw, hint) {
|
|
178
|
+
return `Ambiguous target "${raw}" for ${provider}. Provide a unique name or an explicit id.${formatTargetHint(hint, true)}`;
|
|
179
|
+
}
|
|
180
|
+
function ambiguousTargetError(provider, raw, hint) {
|
|
181
|
+
return new Error(ambiguousTargetMessage(provider, raw, hint));
|
|
182
|
+
}
|
|
183
|
+
function unknownTargetMessage(provider, raw, hint) {
|
|
184
|
+
return `Unknown target "${raw}" for ${provider}.${formatTargetHint(hint, true)}`;
|
|
185
|
+
}
|
|
186
|
+
function unknownTargetError(provider, raw, hint) {
|
|
187
|
+
return new Error(unknownTargetMessage(provider, raw, hint));
|
|
188
|
+
}
|
|
189
|
+
function formatTargetHint(hint, withLabel = false) {
|
|
190
|
+
if (!hint) return "";
|
|
191
|
+
return withLabel ? ` Hint: ${hint}` : ` ${hint}`;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
//#endregion
|
|
195
|
+
export { ToolInputError as a, imageResultFromFile as c, readNumberParam as d, readReactionParams as f, readStringParam as h, ToolAuthorizationError as i, jsonResult as l, readStringOrNumberParam as m, missingTargetError as n, createActionGate as o, readStringArrayParam as p, unknownTargetError as r, imageResult as s, ambiguousTargetError as t, parseAvailableTags as u };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { G as normalizeAccountId } from "./workspace-
|
|
2
|
-
import { h as normalizeE164, u as escapeRegExp } from "./logger-
|
|
3
|
-
import { Qt as requireActivePluginRegistry, Ut as CHAT_CHANNEL_ORDER, Wt as getChatChannelMeta } from "./model-selection-
|
|
4
|
-
import { g as resolveAccountEntry, n as resolveWhatsAppAccount } from "./accounts-
|
|
5
|
-
import { S as inspectDiscordAccount, _ as resolveSlackAccount, a as normalizeWhatsAppTarget, g as inspectSlackAccount, o as inspectTelegramAccount, v as resolveSlackReplyToMode } from "./plugins-
|
|
6
|
-
import { n as resolveSignalAccount } from "./accounts-
|
|
7
|
-
import { t as resolveIMessageAccount } from "./accounts-
|
|
1
|
+
import { G as normalizeAccountId } from "./workspace-BC5WA0Th.js";
|
|
2
|
+
import { h as normalizeE164, u as escapeRegExp } from "./logger-LCC1m_20.js";
|
|
3
|
+
import { Qt as requireActivePluginRegistry, Ut as CHAT_CHANNEL_ORDER, Wt as getChatChannelMeta } from "./model-selection-BNMWRHZu.js";
|
|
4
|
+
import { g as resolveAccountEntry, n as resolveWhatsAppAccount } from "./accounts-Cp7zE1zb.js";
|
|
5
|
+
import { S as inspectDiscordAccount, _ as resolveSlackAccount, a as normalizeWhatsAppTarget, g as inspectSlackAccount, o as inspectTelegramAccount, v as resolveSlackReplyToMode } from "./plugins-YJZX7mvv.js";
|
|
6
|
+
import { n as resolveSignalAccount } from "./accounts-C_LXSS3x.js";
|
|
7
|
+
import { t as resolveIMessageAccount } from "./accounts-B4Cft76I.js";
|
|
8
8
|
|
|
9
9
|
//#region src/config/types.tools.ts
|
|
10
10
|
const TOOLS_BY_SENDER_KEY_TYPES = [
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { u as escapeRegExp } from "./logger-LCC1m_20.js";
|
|
2
|
+
|
|
3
|
+
//#region src/auto-reply/tokens.ts
|
|
4
|
+
const HEARTBEAT_TOKEN = "HEARTBEAT_OK";
|
|
5
|
+
const SILENT_REPLY_TOKEN = "NO_REPLY";
|
|
6
|
+
const silentExactRegexByToken = /* @__PURE__ */ new Map();
|
|
7
|
+
const silentTrailingRegexByToken = /* @__PURE__ */ new Map();
|
|
8
|
+
function getSilentExactRegex(token) {
|
|
9
|
+
const cached = silentExactRegexByToken.get(token);
|
|
10
|
+
if (cached) return cached;
|
|
11
|
+
const escaped = escapeRegExp(token);
|
|
12
|
+
const regex = new RegExp(`^\\s*${escaped}\\s*$`);
|
|
13
|
+
silentExactRegexByToken.set(token, regex);
|
|
14
|
+
return regex;
|
|
15
|
+
}
|
|
16
|
+
function getSilentTrailingRegex(token) {
|
|
17
|
+
const cached = silentTrailingRegexByToken.get(token);
|
|
18
|
+
if (cached) return cached;
|
|
19
|
+
const escaped = escapeRegExp(token);
|
|
20
|
+
const regex = new RegExp(`(?:^|\\s+|\\*+)${escaped}\\s*$`);
|
|
21
|
+
silentTrailingRegexByToken.set(token, regex);
|
|
22
|
+
return regex;
|
|
23
|
+
}
|
|
24
|
+
function isSilentReplyText(text, token = SILENT_REPLY_TOKEN) {
|
|
25
|
+
if (!text) return false;
|
|
26
|
+
return getSilentExactRegex(token).test(text);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Strip a trailing silent reply token from mixed-content text.
|
|
30
|
+
* Returns the remaining text with the token removed (trimmed).
|
|
31
|
+
* If the result is empty, the entire message should be treated as silent.
|
|
32
|
+
*/
|
|
33
|
+
function stripSilentToken(text, token = SILENT_REPLY_TOKEN) {
|
|
34
|
+
return text.replace(getSilentTrailingRegex(token), "").trim();
|
|
35
|
+
}
|
|
36
|
+
function isSilentReplyPrefixText(text, token = SILENT_REPLY_TOKEN) {
|
|
37
|
+
if (!text) return false;
|
|
38
|
+
const trimmed = text.trimStart();
|
|
39
|
+
if (!trimmed) return false;
|
|
40
|
+
if (trimmed !== trimmed.toUpperCase()) return false;
|
|
41
|
+
const normalized = trimmed.toUpperCase();
|
|
42
|
+
if (!normalized) return false;
|
|
43
|
+
if (normalized.length < 2) return false;
|
|
44
|
+
if (/[^A-Z_]/.test(normalized)) return false;
|
|
45
|
+
const tokenUpper = token.toUpperCase();
|
|
46
|
+
if (!tokenUpper.startsWith(normalized)) return false;
|
|
47
|
+
if (normalized.includes("_")) return true;
|
|
48
|
+
return tokenUpper === SILENT_REPLY_TOKEN && normalized === "NO";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { stripSilentToken as a, isSilentReplyText as i, SILENT_REPLY_TOKEN as n, isSilentReplyPrefixText as r, HEARTBEAT_TOKEN as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
2
|
-
import { i as getImageMetadata, n as buildImageResizeSideGrid, s as resizeToJpeg, t as IMAGE_REDUCE_QUALITY_STEPS } from "./image-ops-
|
|
1
|
+
import { t as createSubsystemLogger } from "./subsystem-CdFYjh2k.js";
|
|
2
|
+
import { i as getImageMetadata, n as buildImageResizeSideGrid, s as resizeToJpeg, t as IMAGE_REDUCE_QUALITY_STEPS } from "./image-ops-C-QWxnVw.js";
|
|
3
3
|
|
|
4
4
|
//#region src/media/base64.ts
|
|
5
5
|
function estimateBase64DecodedBytes(base64) {
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import "./run-with-concurrency-
|
|
2
|
-
import "./paths-
|
|
3
|
-
import { i as defaultRuntime, p as shouldLogVerbose, t as createSubsystemLogger, u as logVerbose, y as getChildLogger } from "./subsystem-
|
|
4
|
-
import { F as buildGroupHistoryKey, M as DEFAULT_MAIN_KEY, N as buildAgentMainSessionKey, R as normalizeAgentId } from "./workspace-
|
|
5
|
-
import { C as sleep, T as toWhatsappJid, h as normalizeE164, m as jidToE164, o as clamp, p as isSelfChatMode, v as resolveJidToE164 } from "./logger-
|
|
6
|
-
import { Z as loadConfig, fr as formatCliCommand } from "./model-selection-
|
|
7
|
-
import "./github-copilot-token-
|
|
8
|
-
import "./legacy-names-
|
|
9
|
-
import { h as resolveChannelGroupRequireMention, m as resolveChannelGroupPolicy } from "./thinking-
|
|
10
|
-
import "./tokens-
|
|
11
|
-
import { A as parseActivationCommand, B as buildMentionRegexes, D as createDedupeCache, E as formatInboundEnvelope, F as buildAgentSessionKey, I as resolveAgentRoute, L as finalizeInboundContext, M as sleepWithAbort, N as formatDurationPrecise, O as getReplyFromConfig, P as enqueueSystemEvent, R as hasControlCommand, S as dispatchReplyWithBufferedBlockDispatcher, T as resolveInboundDebounceMs, V as normalizeMentionText, X as resolveIdentityNamePrefix, Z as resolveMessagePrefix, _ as readStoreAllowFromForDmPolicy, a as resolveInboundSessionEnvelopeContext, b as resolvePinnedMainDmOwnerFromAllowlist, c as buildPairingReply, d as DEFAULT_GROUP_HISTORY_LIMIT, f as buildHistoryContextFromEntries, g as warnMissingProviderGroupPolicyFallbackOnce, h as resolveOpenProviderRuntimeGroupPolicy, j as computeBackoff, k as normalizeGroupActivation, l as resolveMentionGating, m as resolveDefaultGroupPolicy, p as recordPendingHistoryEntryIfEnabled, u as createReplyPrefixOptions, v as resolveDmGroupAccessWithCommandGate, w as createInboundDebouncer, x as shouldAckReactionForWhatsApp, y as resolveDmGroupAccessWithLists, z as shouldComputeCommandAuthorized } from "./pi-embedded-
|
|
12
|
-
import { a as logWebSelfId, c as pickWebChannel, i as getWebAuthAgeMs, m as webAuthExists, n as resolveWhatsAppAccount, r as WA_WEB_AUTH_DIR, u as readWebSelfId } from "./accounts-
|
|
13
|
-
import "./plugins-
|
|
14
|
-
import "./send-
|
|
15
|
-
import "./send-
|
|
16
|
-
import "./deliver-
|
|
17
|
-
import "./diagnostic-
|
|
18
|
-
import "./accounts-
|
|
19
|
-
import "./image-ops-
|
|
20
|
-
import { X as toLocationContext, Y as formatLocationText, et as upsertChannelPairingRequest } from "./send-
|
|
21
|
-
import "./pi-model-discovery-
|
|
22
|
-
import { At as resolveGroupSessionKey, K as recordSessionMetaFromInbound, W as loadSessionStore, q as updateLastRoute } from "./pi-embedded-helpers-
|
|
23
|
-
import "./chrome-
|
|
24
|
-
import "./frontmatter-
|
|
25
|
-
import "./skills-
|
|
26
|
-
import "./path-alias-guards-
|
|
27
|
-
import "./redact-
|
|
28
|
-
import "./errors-
|
|
29
|
-
import "./fs-safe-
|
|
30
|
-
import "./proxy-env-
|
|
31
|
-
import { i as saveMediaBuffer } from "./store-
|
|
32
|
-
import "./accounts-
|
|
33
|
-
import { s as resolveStorePath } from "./paths-
|
|
34
|
-
import "./tool-images-
|
|
35
|
-
import "./image-
|
|
36
|
-
import { h as registerUnhandledRejectionHandler } from "./audio-transcription-runner-
|
|
37
|
-
import { i as getAgentScopedMediaLocalRoots } from "./fetch-
|
|
38
|
-
import "./fetch-guard-
|
|
39
|
-
import "./api-key-rotation-
|
|
40
|
-
import "./proxy-fetch-
|
|
41
|
-
import { a as loadWebMedia, d as chunkMarkdownTextWithMode, h as resolveTextChunkLimit, m as resolveChunkMode, s as resolveMarkdownTableMode } from "./ir-
|
|
1
|
+
import "./run-with-concurrency-ffnO0KnQ.js";
|
|
2
|
+
import "./paths-Cvc9EM8Y.js";
|
|
3
|
+
import { i as defaultRuntime, p as shouldLogVerbose, t as createSubsystemLogger, u as logVerbose, y as getChildLogger } from "./subsystem-CdFYjh2k.js";
|
|
4
|
+
import { F as buildGroupHistoryKey, M as DEFAULT_MAIN_KEY, N as buildAgentMainSessionKey, R as normalizeAgentId } from "./workspace-BC5WA0Th.js";
|
|
5
|
+
import { C as sleep, T as toWhatsappJid, h as normalizeE164, m as jidToE164, o as clamp, p as isSelfChatMode, v as resolveJidToE164 } from "./logger-LCC1m_20.js";
|
|
6
|
+
import { Z as loadConfig, fr as formatCliCommand } from "./model-selection-BNMWRHZu.js";
|
|
7
|
+
import "./github-copilot-token-BDioPmd6.js";
|
|
8
|
+
import "./legacy-names-DZdACm3t.js";
|
|
9
|
+
import { h as resolveChannelGroupRequireMention, m as resolveChannelGroupPolicy } from "./thinking-C3b10cHs.js";
|
|
10
|
+
import "./tokens-mtgzW7UN.js";
|
|
11
|
+
import { A as parseActivationCommand, B as buildMentionRegexes, D as createDedupeCache, E as formatInboundEnvelope, F as buildAgentSessionKey, I as resolveAgentRoute, L as finalizeInboundContext, M as sleepWithAbort, N as formatDurationPrecise, O as getReplyFromConfig, P as enqueueSystemEvent, R as hasControlCommand, S as dispatchReplyWithBufferedBlockDispatcher, T as resolveInboundDebounceMs, V as normalizeMentionText, X as resolveIdentityNamePrefix, Z as resolveMessagePrefix, _ as readStoreAllowFromForDmPolicy, a as resolveInboundSessionEnvelopeContext, b as resolvePinnedMainDmOwnerFromAllowlist, c as buildPairingReply, d as DEFAULT_GROUP_HISTORY_LIMIT, f as buildHistoryContextFromEntries, g as warnMissingProviderGroupPolicyFallbackOnce, h as resolveOpenProviderRuntimeGroupPolicy, j as computeBackoff, k as normalizeGroupActivation, l as resolveMentionGating, m as resolveDefaultGroupPolicy, p as recordPendingHistoryEntryIfEnabled, u as createReplyPrefixOptions, v as resolveDmGroupAccessWithCommandGate, w as createInboundDebouncer, x as shouldAckReactionForWhatsApp, y as resolveDmGroupAccessWithLists, z as shouldComputeCommandAuthorized } from "./pi-embedded-DBn841N-.js";
|
|
12
|
+
import { a as logWebSelfId, c as pickWebChannel, i as getWebAuthAgeMs, m as webAuthExists, n as resolveWhatsAppAccount, r as WA_WEB_AUTH_DIR, u as readWebSelfId } from "./accounts-Cp7zE1zb.js";
|
|
13
|
+
import "./plugins-YJZX7mvv.js";
|
|
14
|
+
import "./send-BrlM68Dd.js";
|
|
15
|
+
import "./send-CKIMBFLs.js";
|
|
16
|
+
import "./deliver-BVtVDxwX.js";
|
|
17
|
+
import "./diagnostic-D1IbJfJM.js";
|
|
18
|
+
import "./accounts-C_LXSS3x.js";
|
|
19
|
+
import "./image-ops-C-QWxnVw.js";
|
|
20
|
+
import { X as toLocationContext, Y as formatLocationText, et as upsertChannelPairingRequest } from "./send-Cp6dmr2f.js";
|
|
21
|
+
import "./pi-model-discovery-Cucu_uXw.js";
|
|
22
|
+
import { At as resolveGroupSessionKey, K as recordSessionMetaFromInbound, W as loadSessionStore, q as updateLastRoute } from "./pi-embedded-helpers-BtnBVL-4.js";
|
|
23
|
+
import "./chrome-jCt9JCU8.js";
|
|
24
|
+
import "./frontmatter-B6XNqDx2.js";
|
|
25
|
+
import "./skills-BDJUqEFI.js";
|
|
26
|
+
import "./path-alias-guards-BCv18tKc.js";
|
|
27
|
+
import "./redact-DqlKR0-n.js";
|
|
28
|
+
import "./errors-CHd6Q-vF.js";
|
|
29
|
+
import "./fs-safe-DmeSz0Nd.js";
|
|
30
|
+
import "./proxy-env-CreSu2Ej.js";
|
|
31
|
+
import { i as saveMediaBuffer } from "./store-cJlS-gR6.js";
|
|
32
|
+
import "./accounts-B4Cft76I.js";
|
|
33
|
+
import { s as resolveStorePath } from "./paths-l8GkNRRD.js";
|
|
34
|
+
import "./tool-images-D9pdW1gE.js";
|
|
35
|
+
import "./image-DSK1hSSV.js";
|
|
36
|
+
import { h as registerUnhandledRejectionHandler } from "./audio-transcription-runner-CAOjjGxN.js";
|
|
37
|
+
import { i as getAgentScopedMediaLocalRoots } from "./fetch-C6doVJxZ.js";
|
|
38
|
+
import "./fetch-guard-C-neMX4E.js";
|
|
39
|
+
import "./api-key-rotation-iYITGuLK.js";
|
|
40
|
+
import "./proxy-fetch-lxJGuoUa.js";
|
|
41
|
+
import { a as loadWebMedia, d as chunkMarkdownTextWithMode, h as resolveTextChunkLimit, m as resolveChunkMode, s as resolveMarkdownTableMode } from "./ir-B0iARYlT.js";
|
|
42
42
|
import "./render-DW7AcFdD.js";
|
|
43
|
-
import "./target-errors-
|
|
44
|
-
import "./commands-registry-
|
|
45
|
-
import "./skill-commands-
|
|
43
|
+
import "./target-errors-DPj6Es2y.js";
|
|
44
|
+
import "./commands-registry-Ce7SJnAP.js";
|
|
45
|
+
import "./skill-commands-DGy6Juvb.js";
|
|
46
46
|
import "./fetch-BfuG8uZ8.js";
|
|
47
|
-
import { n as recordChannelActivity } from "./channel-activity-
|
|
48
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
49
|
-
import "./send-
|
|
50
|
-
import "./outbound-attachment-
|
|
51
|
-
import "./send-
|
|
52
|
-
import { r as setActiveWebListener } from "./active-listener-
|
|
47
|
+
import { n as recordChannelActivity } from "./channel-activity-DR4SiHcg.js";
|
|
48
|
+
import { t as convertMarkdownTables } from "./tables-CgcFNr6G.js";
|
|
49
|
+
import "./send-BXQ1U9Zk.js";
|
|
50
|
+
import "./outbound-attachment-BF1JVcCB.js";
|
|
51
|
+
import "./send-CmVj590_.js";
|
|
52
|
+
import { r as setActiveWebListener } from "./active-listener-BR7vpJxr.js";
|
|
53
53
|
import "./proxy-CecQTx_Z.js";
|
|
54
|
-
import "./manager-
|
|
55
|
-
import "./query-expansion-
|
|
56
|
-
import { i as markdownToWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./outbound-
|
|
57
|
-
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-
|
|
58
|
-
import { t as loginWeb } from "./login-
|
|
54
|
+
import "./manager-BOyc7q1-.js";
|
|
55
|
+
import "./query-expansion-BeRz7_bo.js";
|
|
56
|
+
import { i as markdownToWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./outbound-C72ULCcI.js";
|
|
57
|
+
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-DoD05Mm8.js";
|
|
58
|
+
import { t as loginWeb } from "./login-BbBqhgOM.js";
|
|
59
59
|
import { randomUUID } from "node:crypto";
|
|
60
60
|
import { DisconnectReason, downloadMediaMessage, extractMessageContent, getContentType, isJidGroup, normalizeMessageContent } from "@whiskeysockets/baileys";
|
|
61
61
|
|
|
@@ -2,7 +2,7 @@ import { G as buildAgentMainSessionKey, W as DEFAULT_MAIN_KEY, X as normalizeAge
|
|
|
2
2
|
import "./paths-CaA28K0s.js";
|
|
3
3
|
import { C as sleep, G as getChildLogger, L as logVerbose, O as createSubsystemLogger, T as toWhatsappJid, h as normalizeE164, j as defaultRuntime, m as jidToE164, o as clamp, p as isSelfChatMode, v as resolveJidToE164, z as shouldLogVerbose } from "./logger-03l-fZAz.js";
|
|
4
4
|
import { X as loadConfig, gr as formatCliCommand } from "./model-selection-fkPvwOlf.js";
|
|
5
|
-
import { A as sleepWithAbort, C as resolveInboundDebounceMs, D as normalizeGroupActivation, E as getReplyFromConfig, F as finalizeInboundContext, I as hasControlCommand, L as shouldComputeCommandAuthorized, M as enqueueSystemEvent, N as buildAgentSessionKey, O as parseActivationCommand, P as resolveAgentRoute, R as buildMentionRegexes, S as createInboundDebouncer, T as createDedupeCache, X as resolveIdentityNamePrefix, Z as resolveMessagePrefix, _ as resolveDmGroupAccessWithLists, a as resolveInboundSessionEnvelopeContext, b as dispatchReplyWithBufferedBlockDispatcher, c as createReplyPrefixOptions, d as recordPendingHistoryEntryIfEnabled, f as resolveDefaultGroupPolicy, g as resolveDmGroupAccessWithCommandGate, h as readStoreAllowFromForDmPolicy, j as formatDurationPrecise, k as computeBackoff, l as DEFAULT_GROUP_HISTORY_LIMIT, m as warnMissingProviderGroupPolicyFallbackOnce, o as buildPairingReply, p as resolveOpenProviderRuntimeGroupPolicy, s as resolveMentionGating, u as buildHistoryContextFromEntries, v as resolvePinnedMainDmOwnerFromAllowlist, w as formatInboundEnvelope, y as shouldAckReactionForWhatsApp, z as normalizeMentionText } from "./pi-embedded-
|
|
5
|
+
import { A as sleepWithAbort, C as resolveInboundDebounceMs, D as normalizeGroupActivation, E as getReplyFromConfig, F as finalizeInboundContext, I as hasControlCommand, L as shouldComputeCommandAuthorized, M as enqueueSystemEvent, N as buildAgentSessionKey, O as parseActivationCommand, P as resolveAgentRoute, R as buildMentionRegexes, S as createInboundDebouncer, T as createDedupeCache, X as resolveIdentityNamePrefix, Z as resolveMessagePrefix, _ as resolveDmGroupAccessWithLists, a as resolveInboundSessionEnvelopeContext, b as dispatchReplyWithBufferedBlockDispatcher, c as createReplyPrefixOptions, d as recordPendingHistoryEntryIfEnabled, f as resolveDefaultGroupPolicy, g as resolveDmGroupAccessWithCommandGate, h as readStoreAllowFromForDmPolicy, j as formatDurationPrecise, k as computeBackoff, l as DEFAULT_GROUP_HISTORY_LIMIT, m as warnMissingProviderGroupPolicyFallbackOnce, o as buildPairingReply, p as resolveOpenProviderRuntimeGroupPolicy, s as resolveMentionGating, u as buildHistoryContextFromEntries, v as resolvePinnedMainDmOwnerFromAllowlist, w as formatInboundEnvelope, y as shouldAckReactionForWhatsApp, z as normalizeMentionText } from "./pi-embedded-DYc6emwb.js";
|
|
6
6
|
import "./github-copilot-token-BWXANsA6.js";
|
|
7
7
|
import { h as resolveChannelGroupRequireMention, m as resolveChannelGroupPolicy } from "./thinking-CkhMQNNf.js";
|
|
8
8
|
import "./tokens-BNir7uMh.js";
|
|
@@ -10,14 +10,14 @@ import { a as logWebSelfId, c as pickWebChannel, i as getWebAuthAgeMs, m as webA
|
|
|
10
10
|
import "./plugins-DRylFNZC.js";
|
|
11
11
|
import "./send-AXsMHyHL.js";
|
|
12
12
|
import "./send-DrSesnuy.js";
|
|
13
|
-
import "./deliver-
|
|
13
|
+
import "./deliver-DmfS4khs.js";
|
|
14
14
|
import "./diagnostic-DV5ugeTF.js";
|
|
15
15
|
import "./accounts-CGE0qwJa.js";
|
|
16
16
|
import "./image-ops-CZyK9ORn.js";
|
|
17
17
|
import { X as toLocationContext, Y as formatLocationText, et as upsertChannelPairingRequest } from "./send-B9qE3uV_.js";
|
|
18
18
|
import "./pi-model-discovery-zcOSFl9m.js";
|
|
19
|
-
import { At as resolveGroupSessionKey, J as updateLastRoute, K as recordSessionMetaFromInbound, W as loadSessionStore } from "./pi-embedded-helpers-
|
|
20
|
-
import "./chrome
|
|
19
|
+
import { At as resolveGroupSessionKey, J as updateLastRoute, K as recordSessionMetaFromInbound, W as loadSessionStore } from "./pi-embedded-helpers-DLm1Mtr2.js";
|
|
20
|
+
import "./chrome--CFg5C_H.js";
|
|
21
21
|
import "./skills-CrM4sG5V.js";
|
|
22
22
|
import "./path-alias-guards-CJ-rXOZR.js";
|
|
23
23
|
import "./redact-BYyl-Ec1.js";
|
|
@@ -28,8 +28,8 @@ import { i as saveMediaBuffer } from "./store--iimBXGR.js";
|
|
|
28
28
|
import "./accounts-BAQCqsoB.js";
|
|
29
29
|
import { s as resolveStorePath } from "./paths-BtoBqtXI.js";
|
|
30
30
|
import "./tool-images-CH22eok3.js";
|
|
31
|
-
import "./image-
|
|
32
|
-
import { h as registerUnhandledRejectionHandler } from "./audio-transcription-runner-
|
|
31
|
+
import "./image-BdZcUz8M.js";
|
|
32
|
+
import { h as registerUnhandledRejectionHandler } from "./audio-transcription-runner-GcMnO6sT.js";
|
|
33
33
|
import { i as getAgentScopedMediaLocalRoots } from "./fetch-R5LnsL8v.js";
|
|
34
34
|
import "./fetch-guard-CFgB2KTx.js";
|
|
35
35
|
import "./api-key-rotation-Ce2ywCqB.js";
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import "./run-with-concurrency-
|
|
2
|
-
import "./paths-
|
|
3
|
-
import "./subsystem-
|
|
4
|
-
import "./workspace-
|
|
5
|
-
import "./logger-
|
|
6
|
-
import "./model-selection-
|
|
7
|
-
import "./github-copilot-token-
|
|
8
|
-
import "./legacy-names-
|
|
9
|
-
import { n as resolveWhatsAppAccount } from "./accounts-
|
|
10
|
-
import { a as normalizeWhatsAppTarget, i as isWhatsAppGroupJid } from "./plugins-
|
|
11
|
-
import "./image-ops-
|
|
12
|
-
import "./path-alias-guards-
|
|
13
|
-
import "./fs-safe-
|
|
14
|
-
import "./proxy-env-
|
|
15
|
-
import "./tool-images-
|
|
16
|
-
import "./fetch-
|
|
17
|
-
import "./fetch-guard-
|
|
18
|
-
import "./ir-
|
|
1
|
+
import "./run-with-concurrency-ffnO0KnQ.js";
|
|
2
|
+
import "./paths-Cvc9EM8Y.js";
|
|
3
|
+
import "./subsystem-CdFYjh2k.js";
|
|
4
|
+
import "./workspace-BC5WA0Th.js";
|
|
5
|
+
import "./logger-LCC1m_20.js";
|
|
6
|
+
import "./model-selection-BNMWRHZu.js";
|
|
7
|
+
import "./github-copilot-token-BDioPmd6.js";
|
|
8
|
+
import "./legacy-names-DZdACm3t.js";
|
|
9
|
+
import { n as resolveWhatsAppAccount } from "./accounts-Cp7zE1zb.js";
|
|
10
|
+
import { a as normalizeWhatsAppTarget, i as isWhatsAppGroupJid } from "./plugins-YJZX7mvv.js";
|
|
11
|
+
import "./image-ops-C-QWxnVw.js";
|
|
12
|
+
import "./path-alias-guards-BCv18tKc.js";
|
|
13
|
+
import "./fs-safe-DmeSz0Nd.js";
|
|
14
|
+
import "./proxy-env-CreSu2Ej.js";
|
|
15
|
+
import "./tool-images-D9pdW1gE.js";
|
|
16
|
+
import "./fetch-C6doVJxZ.js";
|
|
17
|
+
import "./fetch-guard-C-neMX4E.js";
|
|
18
|
+
import "./ir-B0iARYlT.js";
|
|
19
19
|
import "./render-DW7AcFdD.js";
|
|
20
|
-
import { f as readReactionParams, h as readStringParam, i as ToolAuthorizationError, l as jsonResult, n as missingTargetError, o as createActionGate } from "./target-errors-
|
|
21
|
-
import "./tables-
|
|
22
|
-
import { r as sendReactionWhatsApp } from "./outbound-
|
|
20
|
+
import { f as readReactionParams, h as readStringParam, i as ToolAuthorizationError, l as jsonResult, n as missingTargetError, o as createActionGate } from "./target-errors-DPj6Es2y.js";
|
|
21
|
+
import "./tables-CgcFNr6G.js";
|
|
22
|
+
import { r as sendReactionWhatsApp } from "./outbound-C72ULCcI.js";
|
|
23
23
|
|
|
24
24
|
//#region src/whatsapp/resolve-outbound-target.ts
|
|
25
25
|
function resolveWhatsAppOutboundTarget(params) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as resolveRequiredHomeDir } from "./paths-
|
|
2
|
-
import { c as danger, p as shouldLogVerbose } from "./subsystem-
|
|
3
|
-
import { g as pathExists$1, n as logError, t as logDebug, y as resolveUserPath } from "./logger-
|
|
1
|
+
import { d as resolveRequiredHomeDir } from "./paths-Cvc9EM8Y.js";
|
|
2
|
+
import { c as danger, p as shouldLogVerbose } from "./subsystem-CdFYjh2k.js";
|
|
3
|
+
import { g as pathExists$1, n as logError, t as logDebug, y as resolveUserPath } from "./logger-LCC1m_20.js";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import path from "node:path";
|
|
7
|
-
import
|
|
7
|
+
import fs$1 from "node:fs";
|
|
8
8
|
import { promisify } from "node:util";
|
|
9
9
|
import { execFile, spawn } from "node:child_process";
|
|
10
10
|
import process$1 from "node:process";
|
|
@@ -560,7 +560,7 @@ function resolveBoundaryPathLexicalSync(params) {
|
|
|
560
560
|
rootCanonicalPath: params.rootCanonicalPath,
|
|
561
561
|
resolveParams: params.params,
|
|
562
562
|
absolutePath: params.absolutePath,
|
|
563
|
-
read: (cursor) =>
|
|
563
|
+
read: (cursor) => fs$1.lstatSync(cursor)
|
|
564
564
|
});
|
|
565
565
|
if (isPromiseLike(maybeStat)) throw new Error("Unexpected async lexical stat");
|
|
566
566
|
const stat = maybeStat;
|
|
@@ -706,15 +706,15 @@ function resolvePathViaExistingAncestorSync(targetPath) {
|
|
|
706
706
|
const normalized = path.resolve(targetPath);
|
|
707
707
|
let cursor = normalized;
|
|
708
708
|
const missingSuffix = [];
|
|
709
|
-
while (!isFilesystemRoot(cursor) && !
|
|
709
|
+
while (!isFilesystemRoot(cursor) && !fs$1.existsSync(cursor)) {
|
|
710
710
|
missingSuffix.unshift(path.basename(cursor));
|
|
711
711
|
const parent = path.dirname(cursor);
|
|
712
712
|
if (parent === cursor) break;
|
|
713
713
|
cursor = parent;
|
|
714
714
|
}
|
|
715
|
-
if (!
|
|
715
|
+
if (!fs$1.existsSync(cursor)) return normalized;
|
|
716
716
|
try {
|
|
717
|
-
const resolvedAncestor = path.resolve(
|
|
717
|
+
const resolvedAncestor = path.resolve(fs$1.realpathSync(cursor));
|
|
718
718
|
if (missingSuffix.length === 0) return resolvedAncestor;
|
|
719
719
|
return path.resolve(resolvedAncestor, ...missingSuffix);
|
|
720
720
|
} catch {
|
|
@@ -739,7 +739,7 @@ function getPathKindSync(absolutePath, preserveFinalSymlink) {
|
|
|
739
739
|
try {
|
|
740
740
|
return {
|
|
741
741
|
exists: true,
|
|
742
|
-
kind: toResolvedKind(preserveFinalSymlink ?
|
|
742
|
+
kind: toResolvedKind(preserveFinalSymlink ? fs$1.lstatSync(absolutePath) : fs$1.statSync(absolutePath))
|
|
743
743
|
};
|
|
744
744
|
} catch (error) {
|
|
745
745
|
if (isNotFoundPathError(error)) return {
|
|
@@ -799,10 +799,10 @@ async function resolveSymlinkHopPath(symlinkPath) {
|
|
|
799
799
|
}
|
|
800
800
|
function resolveSymlinkHopPathSync(symlinkPath) {
|
|
801
801
|
try {
|
|
802
|
-
return path.resolve(
|
|
802
|
+
return path.resolve(fs$1.realpathSync(symlinkPath));
|
|
803
803
|
} catch (error) {
|
|
804
804
|
if (!isNotFoundPathError(error)) throw error;
|
|
805
|
-
const linkTarget =
|
|
805
|
+
const linkTarget = fs$1.readlinkSync(symlinkPath);
|
|
806
806
|
return resolvePathViaExistingAncestorSync(path.resolve(path.dirname(symlinkPath), linkTarget));
|
|
807
807
|
}
|
|
808
808
|
}
|
|
@@ -828,7 +828,7 @@ function sameFileIdentity(left, right) {
|
|
|
828
828
|
return sameFileIdentity$1(left, right);
|
|
829
829
|
}
|
|
830
830
|
function openVerifiedFileSync(params) {
|
|
831
|
-
const ioFs = params.ioFs ??
|
|
831
|
+
const ioFs = params.ioFs ?? fs$1;
|
|
832
832
|
const allowedType = params.allowedType ?? "file";
|
|
833
833
|
const openReadFlags = ioFs.constants.O_RDONLY | (typeof ioFs.constants.O_NOFOLLOW === "number" ? ioFs.constants.O_NOFOLLOW : 0);
|
|
834
834
|
let fd = null;
|
|
@@ -905,7 +905,7 @@ function canUseBoundaryFileOpen(ioFs) {
|
|
|
905
905
|
return typeof ioFs.openSync === "function" && typeof ioFs.closeSync === "function" && typeof ioFs.fstatSync === "function" && typeof ioFs.lstatSync === "function" && typeof ioFs.realpathSync === "function" && typeof ioFs.readFileSync === "function" && typeof ioFs.constants === "object" && ioFs.constants !== null;
|
|
906
906
|
}
|
|
907
907
|
function openBoundaryFileSync(params) {
|
|
908
|
-
const ioFs = params.ioFs ??
|
|
908
|
+
const ioFs = params.ioFs ?? fs$1;
|
|
909
909
|
const resolved = resolveBoundaryFilePathGeneric({
|
|
910
910
|
absolutePath: params.absolutePath,
|
|
911
911
|
resolve: (absolutePath) => resolveBoundaryPathSync({
|
|
@@ -956,7 +956,7 @@ function finalizeBoundaryFileOpen(params) {
|
|
|
956
956
|
});
|
|
957
957
|
}
|
|
958
958
|
async function openBoundaryFile(params) {
|
|
959
|
-
const ioFs = params.ioFs ??
|
|
959
|
+
const ioFs = params.ioFs ?? fs$1;
|
|
960
960
|
const maybeResolved = resolveBoundaryFilePathGeneric({
|
|
961
961
|
absolutePath: params.absolutePath,
|
|
962
962
|
resolve: (absolutePath) => resolveBoundaryPath({
|
|
@@ -1105,7 +1105,7 @@ function resolveNpmArgvForWindows(argv) {
|
|
|
1105
1105
|
if (!cliName) return null;
|
|
1106
1106
|
const nodeDir = path.dirname(process$1.execPath);
|
|
1107
1107
|
const cliPath = path.join(nodeDir, "node_modules", "npm", "bin", cliName);
|
|
1108
|
-
if (!
|
|
1108
|
+
if (!fs$1.existsSync(cliPath)) return null;
|
|
1109
1109
|
return [
|
|
1110
1110
|
process$1.execPath,
|
|
1111
1111
|
cliPath,
|
|
@@ -1307,7 +1307,7 @@ async function readPackageName(dir) {
|
|
|
1307
1307
|
}
|
|
1308
1308
|
function readPackageNameSync(dir) {
|
|
1309
1309
|
try {
|
|
1310
|
-
const raw =
|
|
1310
|
+
const raw = fs$1.readFileSync(path.join(dir, "package.json"), "utf-8");
|
|
1311
1311
|
const parsed = JSON.parse(raw);
|
|
1312
1312
|
return typeof parsed.name === "string" ? parsed.name : null;
|
|
1313
1313
|
} catch {
|
|
@@ -1341,7 +1341,7 @@ function candidateDirsFromArgv1(argv1) {
|
|
|
1341
1341
|
const normalized = path.resolve(argv1);
|
|
1342
1342
|
const candidates = [path.dirname(normalized)];
|
|
1343
1343
|
try {
|
|
1344
|
-
const resolved =
|
|
1344
|
+
const resolved = fs$1.realpathSync(normalized);
|
|
1345
1345
|
if (resolved !== normalized) candidates.push(path.dirname(resolved));
|
|
1346
1346
|
} catch {}
|
|
1347
1347
|
const parts = normalized.split(path.sep);
|
|
@@ -1453,14 +1453,14 @@ async function readWorkspaceFileWithGuards(params) {
|
|
|
1453
1453
|
const identity = workspaceFileIdentity(opened.stat, opened.path);
|
|
1454
1454
|
const cached = workspaceFileCache.get(params.filePath);
|
|
1455
1455
|
if (cached && cached.identity === identity) {
|
|
1456
|
-
|
|
1456
|
+
fs$1.closeSync(opened.fd);
|
|
1457
1457
|
return {
|
|
1458
1458
|
ok: true,
|
|
1459
1459
|
content: cached.content
|
|
1460
1460
|
};
|
|
1461
1461
|
}
|
|
1462
1462
|
try {
|
|
1463
|
-
const content =
|
|
1463
|
+
const content = fs$1.readFileSync(opened.fd, "utf-8");
|
|
1464
1464
|
workspaceFileCache.set(params.filePath, {
|
|
1465
1465
|
content,
|
|
1466
1466
|
identity
|
|
@@ -1477,7 +1477,7 @@ async function readWorkspaceFileWithGuards(params) {
|
|
|
1477
1477
|
error
|
|
1478
1478
|
};
|
|
1479
1479
|
} finally {
|
|
1480
|
-
|
|
1480
|
+
fs$1.closeSync(opened.fd);
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
1483
|
function stripFrontMatter(content) {
|