@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.
Files changed (161) hide show
  1. package/dist/{audio-preflight-D_s-peid.js → audio-preflight-BnfuyvxO.js} +4 -4
  2. package/dist/{audio-preflight-BEc8i-bS.js → audio-preflight-CpAXC_Ct.js} +4 -4
  3. package/dist/{audio-transcription-runner-X1KzI7dF.js → audio-transcription-runner-CAOjjGxN.js} +1 -1
  4. package/dist/{audio-transcription-runner-BePCnZfw.js → audio-transcription-runner-GcMnO6sT.js} +1 -1
  5. package/dist/build-info.json +3 -3
  6. package/dist/bundled/boot-md/handler.js +6 -6
  7. package/dist/bundled/session-memory/handler.js +6 -6
  8. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  9. package/dist/{chrome-B24-8NDM.js → chrome--CFg5C_H.js} +8 -8
  10. package/dist/{chrome-C7OwLtx9.js → chrome-jCt9JCU8.js} +8 -8
  11. package/dist/{cloud-connect-CknfBF39.js → cloud-connect-6kdj8st_.js} +1 -1
  12. package/dist/{deliver-D8dBbzpu.js → deliver-BVtVDxwX.js} +1 -1
  13. package/dist/{deliver-DudaV86i.js → deliver-DmfS4khs.js} +1 -1
  14. package/dist/{deliver-runtime-C76IMU4W.js → deliver-runtime-G0G5orrZ.js} +3 -3
  15. package/dist/{deliver-runtime-qDmQqiF-.js → deliver-runtime-PxJvVUhh.js} +3 -3
  16. package/dist/{deps-send-whatsapp.runtime-Cv_awFtm.js → deps-send-whatsapp.runtime-8bLqjmui.js} +7 -7
  17. package/dist/{deps-send-whatsapp.runtime-Cq-TLsJw.js → deps-send-whatsapp.runtime-CrzuaVhC.js} +7 -7
  18. package/dist/entry.js +15 -8
  19. package/dist/extensionAPI.js +6 -6
  20. package/dist/{image-nUHQF6BX.js → image-BdZcUz8M.js} +1 -1
  21. package/dist/{image-BOybyCis.js → image-DSK1hSSV.js} +1 -1
  22. package/dist/{image-runtime-B5M_-diF.js → image-runtime-ueqmfx1a.js} +3 -3
  23. package/dist/{image-runtime-y4msd5bn.js → image-runtime-xqxW2PQA.js} +3 -3
  24. package/dist/llm-slug-generator.js +6 -6
  25. package/dist/{local-launch-C2RER-G3.js → local-launch-BJpBAIR5.js} +37 -33
  26. package/dist/{pi-embedded-BHXPs-Ix.js → pi-embedded-DBn841N-.js} +24 -24
  27. package/dist/{pi-embedded-DvWHP6Nn.js → pi-embedded-DYc6emwb.js} +24 -24
  28. package/dist/{pi-embedded-helpers-xIXwvwuE.js → pi-embedded-helpers-BtnBVL-4.js} +3 -3
  29. package/dist/{pi-embedded-helpers-Ck1qEeMH.js → pi-embedded-helpers-DLm1Mtr2.js} +3 -3
  30. package/dist/plugin-sdk/accounts-B8qv93DH.js +35 -0
  31. package/dist/plugin-sdk/accounts-D2p8t4UO.js +288 -0
  32. package/dist/plugin-sdk/accounts-D96D1U9M.js +46 -0
  33. package/dist/plugin-sdk/active-listener-Mha1rAbh.js +50 -0
  34. package/dist/plugin-sdk/api-key-rotation-D0aZfxXH.js +181 -0
  35. package/dist/plugin-sdk/audio-preflight-D3y8mHJa.js +69 -0
  36. package/dist/plugin-sdk/audio-transcription-runner-j0mQXKSH.js +2205 -0
  37. package/dist/plugin-sdk/audit-membership-runtime-D-Ni2WDc.js +58 -0
  38. package/dist/plugin-sdk/channel-activity-VpA3MxPb.js +94 -0
  39. package/dist/plugin-sdk/channel-web-BP3vDdim.js +2256 -0
  40. package/dist/plugin-sdk/chrome-5jJIDTj0.js +2447 -0
  41. package/dist/plugin-sdk/commands-registry-BVKCdwN_.js +1125 -0
  42. package/dist/plugin-sdk/config-CudVTZDi.js +18200 -0
  43. package/dist/plugin-sdk/deliver-4NrmrRKu.js +1744 -0
  44. package/dist/plugin-sdk/deliver-runtime-CB4wXMTH.js +32 -0
  45. package/dist/plugin-sdk/deps-send-discord.runtime-Di8ELKED.js +23 -0
  46. package/dist/plugin-sdk/deps-send-imessage.runtime-CWWtApbz.js +22 -0
  47. package/dist/plugin-sdk/deps-send-signal.runtime-C6BGyoIY.js +21 -0
  48. package/dist/plugin-sdk/deps-send-slack.runtime-DgtITBuc.js +19 -0
  49. package/dist/plugin-sdk/deps-send-telegram.runtime-DyY4XRxh.js +24 -0
  50. package/dist/plugin-sdk/deps-send-whatsapp.runtime-LKiQNFcF.js +57 -0
  51. package/dist/plugin-sdk/diagnostic-DCPixRez.js +319 -0
  52. package/dist/plugin-sdk/errors-D5bA02--.js +54 -0
  53. package/dist/plugin-sdk/fetch-guard-n0LVdzZL.js +156 -0
  54. package/dist/plugin-sdk/fs-safe-IQ0H7rVD.js +352 -0
  55. package/dist/plugin-sdk/image-n-R2HcNg.js +2314 -0
  56. package/dist/plugin-sdk/image-ops-BpYDXC6N.js +584 -0
  57. package/dist/plugin-sdk/image-runtime-CbCl82B8.js +25 -0
  58. package/dist/plugin-sdk/index.js +50 -50
  59. package/dist/plugin-sdk/ir-DsMX3GcS.js +1296 -0
  60. package/dist/plugin-sdk/local-roots-DR-lR22p.js +186 -0
  61. package/dist/plugin-sdk/logger-2A0UE34q.js +1163 -0
  62. package/dist/plugin-sdk/login-CxFTtHEi.js +57 -0
  63. package/dist/plugin-sdk/login-qr-BCkrf1Zx.js +320 -0
  64. package/dist/plugin-sdk/manager-ClUgSFkG.js +3943 -0
  65. package/dist/plugin-sdk/manager-runtime-MWzYCRyH.js +15 -0
  66. package/dist/plugin-sdk/outbound-Dqs8L8QW.js +212 -0
  67. package/dist/plugin-sdk/outbound-attachment-CPfpUcdI.js +19 -0
  68. package/dist/plugin-sdk/path-alias-guards-LILr7Hrs.js +43 -0
  69. package/dist/plugin-sdk/paths-CfGmXu9A.js +166 -0
  70. package/dist/plugin-sdk/pi-embedded-helpers-CeC8GbRi.js +9731 -0
  71. package/dist/plugin-sdk/pi-model-discovery-DycOMKYh.js +134 -0
  72. package/dist/plugin-sdk/pi-model-discovery-runtime-C64BYe5F.js +8 -0
  73. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-C-HNtPSw.js +354 -0
  74. package/dist/plugin-sdk/plugins-2gQWMmUN.js +1205 -0
  75. package/dist/plugin-sdk/proxy-fetch-sX3-xzX1.js +38 -0
  76. package/dist/plugin-sdk/pw-ai-D7FTxM3C.js +1938 -0
  77. package/dist/plugin-sdk/qmd-manager-Da3Jq30m.js +1608 -0
  78. package/dist/plugin-sdk/query-expansion-B5Z0In1U.js +1014 -0
  79. package/dist/plugin-sdk/redact-85H1J7mo.js +319 -0
  80. package/dist/plugin-sdk/reply-DmCyOPxV.js +102224 -0
  81. package/dist/plugin-sdk/resolve-outbound-target-y0Sp7gsM.js +40 -0
  82. package/dist/plugin-sdk/run-with-concurrency-CFRxflYW.js +1994 -0
  83. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-fgm84Rdh.js +10 -0
  84. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-DpMuLd_h.js +19 -0
  85. package/dist/plugin-sdk/send-BQvcPd54.js +3135 -0
  86. package/dist/plugin-sdk/send-Bplfz7UW.js +540 -0
  87. package/dist/plugin-sdk/send-C8gdhoLP.js +414 -0
  88. package/dist/plugin-sdk/send-CTOVZqmi.js +2602 -0
  89. package/dist/plugin-sdk/send-Cld7xlxq.js +503 -0
  90. package/dist/plugin-sdk/session-D4k86ARy.js +169 -0
  91. package/dist/plugin-sdk/signal.js +2 -2
  92. package/dist/plugin-sdk/skill-commands-BfHvtJx2.js +353 -0
  93. package/dist/plugin-sdk/skills-BrE5Yb5o.js +1428 -0
  94. package/dist/plugin-sdk/slash-commands.runtime-UpSrdY-a.js +13 -0
  95. package/dist/plugin-sdk/slash-dispatch.runtime-C-Ymizf2.js +52 -0
  96. package/dist/plugin-sdk/slash-skill-commands.runtime-Bb9wo3w0.js +16 -0
  97. package/dist/plugin-sdk/ssrf-CbvrROKN.js +202 -0
  98. package/dist/plugin-sdk/store-8XS_isi_.js +81 -0
  99. package/dist/plugin-sdk/subagent-registry-runtime-Cl3jJKM1.js +52 -0
  100. package/dist/plugin-sdk/tables-BhfDBQ58.js +55 -0
  101. package/dist/plugin-sdk/target-errors-0DW3k-Ae.js +195 -0
  102. package/dist/plugin-sdk/thinking-DE2FCBnv.js +1209 -0
  103. package/dist/plugin-sdk/tokens-C2tJ8uXs.js +52 -0
  104. package/dist/plugin-sdk/tool-images-B1I6LEp7.js +274 -0
  105. package/dist/plugin-sdk/web-BHzDLmns.js +56 -0
  106. package/dist/plugin-sdk/whatsapp-actions-BoAH0BAS.js +80 -0
  107. package/dist/{pw-ai-DweqbnMJ.js → pw-ai-C-Sy12jT.js} +1 -1
  108. package/dist/{pw-ai-DsYmOxCp.js → pw-ai-pJMhS79V.js} +1 -1
  109. package/dist/{run-main-CgFUs81l.js → run-main-JI9-1g4u.js} +2 -2
  110. package/dist/{slash-dispatch.runtime-D28-UnsO.js → slash-dispatch.runtime-DLP2IeNv.js} +6 -6
  111. package/dist/{slash-dispatch.runtime-DzpJjr3K.js → slash-dispatch.runtime-Vp6IDoCc.js} +6 -6
  112. package/dist/{subagent-registry-runtime-a7xfwPB8.js → subagent-registry-runtime-BlAI3eqU.js} +6 -6
  113. package/dist/{subagent-registry-runtime-Bt-LYyrB.js → subagent-registry-runtime-COKZwsHd.js} +6 -6
  114. package/dist/{web-CREcqhe9.js → web-BEuMJbx-.js} +6 -6
  115. package/dist/{web-IBqHOVI2.js → web-BvId86u4.js} +6 -6
  116. package/extensions/acpx/package.json +1 -1
  117. package/extensions/bluebubbles/package.json +1 -1
  118. package/extensions/ci-fix-loop/package.json +1 -1
  119. package/extensions/continuous-learning/package.json +1 -1
  120. package/extensions/copilot-proxy/package.json +1 -1
  121. package/extensions/diagnostics-otel/package.json +1 -1
  122. package/extensions/diffs/package.json +1 -1
  123. package/extensions/discord/package.json +1 -1
  124. package/extensions/feishu/package.json +1 -1
  125. package/extensions/flow/package.json +1 -1
  126. package/extensions/google-antigravity-auth/package.json +1 -1
  127. package/extensions/google-gemini-cli-auth/package.json +1 -1
  128. package/extensions/googlechat/package.json +1 -1
  129. package/extensions/imessage/package.json +1 -1
  130. package/extensions/irc/package.json +1 -1
  131. package/extensions/line/package.json +1 -1
  132. package/extensions/llm-task/package.json +1 -1
  133. package/extensions/lobster/package.json +1 -1
  134. package/extensions/matrix/CHANGELOG.md +10 -0
  135. package/extensions/matrix/package.json +1 -1
  136. package/extensions/mattermost/package.json +1 -1
  137. package/extensions/memory-core/package.json +1 -1
  138. package/extensions/memory-lancedb/package.json +1 -1
  139. package/extensions/minimax-portal-auth/package.json +1 -1
  140. package/extensions/msteams/CHANGELOG.md +10 -0
  141. package/extensions/msteams/package.json +1 -1
  142. package/extensions/nextcloud-talk/package.json +1 -1
  143. package/extensions/nostr/CHANGELOG.md +10 -0
  144. package/extensions/nostr/package.json +1 -1
  145. package/extensions/open-prose/package.json +1 -1
  146. package/extensions/self-improvement/package.json +1 -1
  147. package/extensions/signal/package.json +1 -1
  148. package/extensions/slack/package.json +1 -1
  149. package/extensions/synology-chat/package.json +1 -1
  150. package/extensions/telegram/package.json +1 -1
  151. package/extensions/tlon/package.json +1 -1
  152. package/extensions/twitch/CHANGELOG.md +10 -0
  153. package/extensions/twitch/package.json +1 -1
  154. package/extensions/voice-call/CHANGELOG.md +10 -0
  155. package/extensions/voice-call/package.json +1 -1
  156. package/extensions/whatsapp/package.json +1 -1
  157. package/extensions/zalo/CHANGELOG.md +10 -0
  158. package/extensions/zalo/package.json +1 -1
  159. package/extensions/zalouser/CHANGELOG.md +10 -0
  160. package/extensions/zalouser/package.json +1 -1
  161. package/package.json +2 -1
@@ -0,0 +1,13 @@
1
+ import "./run-with-concurrency-CFRxflYW.js";
2
+ import "./accounts-D2p8t4UO.js";
3
+ import "./paths-MKyEVmEb.js";
4
+ import "./github-copilot-token-D5fdS6xD.js";
5
+ import "./config-CudVTZDi.js";
6
+ import "./logger-2A0UE34q.js";
7
+ import "./thinking-DE2FCBnv.js";
8
+ import "./plugins-2gQWMmUN.js";
9
+ import "./accounts-B8qv93DH.js";
10
+ import "./accounts-D96D1U9M.js";
11
+ import { f as resolveCommandArgMenu, n as findCommandByNativeName, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as parseCommandArgs } from "./commands-registry-BVKCdwN_.js";
12
+
13
+ export { buildCommandTextFromArgs, findCommandByNativeName, listNativeCommandSpecsForConfig, parseCommandArgs, resolveCommandArgMenu };
@@ -0,0 +1,52 @@
1
+ import "./run-with-concurrency-CFRxflYW.js";
2
+ import "./accounts-D2p8t4UO.js";
3
+ import { I as resolveAgentRoute, L as finalizeInboundContext, T as dispatchReplyWithDispatcher, d as recordInboundSessionMetaSafe, et as createReplyPrefixOptions, m as deliverSlackSlashReplies } from "./reply-DmCyOPxV.js";
4
+ import "./paths-MKyEVmEb.js";
5
+ import "./github-copilot-token-D5fdS6xD.js";
6
+ import "./config-CudVTZDi.js";
7
+ import "./logger-2A0UE34q.js";
8
+ import "./thinking-DE2FCBnv.js";
9
+ import "./image-ops-BpYDXC6N.js";
10
+ import { rn as resolveConversationLabel } from "./pi-embedded-helpers-CeC8GbRi.js";
11
+ import "./plugins-2gQWMmUN.js";
12
+ import "./accounts-B8qv93DH.js";
13
+ import "./accounts-D96D1U9M.js";
14
+ import "./send-BQvcPd54.js";
15
+ import "./paths-CfGmXu9A.js";
16
+ import "./fetch-Bv4TQOMH.js";
17
+ import "./redact-85H1J7mo.js";
18
+ import "./errors-D5bA02--.js";
19
+ import "./channel-activity-VpA3MxPb.js";
20
+ import "./path-alias-guards-LILr7Hrs.js";
21
+ import "./fs-safe-IQ0H7rVD.js";
22
+ import "./ssrf-CbvrROKN.js";
23
+ import "./fetch-guard-n0LVdzZL.js";
24
+ import "./local-roots-DR-lR22p.js";
25
+ import { d as resolveChunkMode, i as resolveMarkdownTableMode } from "./ir-DsMX3GcS.js";
26
+ import "./render-HmipMDlP.js";
27
+ import "./tables-BhfDBQ58.js";
28
+ import "./send-Cld7xlxq.js";
29
+ import "./send-CTOVZqmi.js";
30
+ import "./tool-images-B1I6LEp7.js";
31
+ import "./target-errors-0DW3k-Ae.js";
32
+ import "./send-C8gdhoLP.js";
33
+ import "./audio-transcription-runner-j0mQXKSH.js";
34
+ import "./tokens-C2tJ8uXs.js";
35
+ import "./skill-commands-BfHvtJx2.js";
36
+ import "./skills-BrE5Yb5o.js";
37
+ import "./chrome-5jJIDTj0.js";
38
+ import "./deliver-4NrmrRKu.js";
39
+ import "./diagnostic-DCPixRez.js";
40
+ import "./store-8XS_isi_.js";
41
+ import "./commands-registry-BVKCdwN_.js";
42
+ import "./image-n-R2HcNg.js";
43
+ import "./api-key-rotation-D0aZfxXH.js";
44
+ import "./proxy-fetch-sX3-xzX1.js";
45
+ import "./pi-model-discovery-DycOMKYh.js";
46
+ import "./send-Bplfz7UW.js";
47
+ import "./outbound-attachment-CPfpUcdI.js";
48
+ import "./proxy-BFm9FJeW.js";
49
+ import "./manager-ClUgSFkG.js";
50
+ import "./query-expansion-B5Z0In1U.js";
51
+
52
+ export { createReplyPrefixOptions, deliverSlackSlashReplies, dispatchReplyWithDispatcher, finalizeInboundContext, recordInboundSessionMetaSafe, resolveAgentRoute, resolveChunkMode, resolveConversationLabel, resolveMarkdownTableMode };
@@ -0,0 +1,16 @@
1
+ import "./run-with-concurrency-CFRxflYW.js";
2
+ import "./accounts-D2p8t4UO.js";
3
+ import "./paths-MKyEVmEb.js";
4
+ import "./github-copilot-token-D5fdS6xD.js";
5
+ import "./config-CudVTZDi.js";
6
+ import "./logger-2A0UE34q.js";
7
+ import "./thinking-DE2FCBnv.js";
8
+ import "./plugins-2gQWMmUN.js";
9
+ import "./accounts-B8qv93DH.js";
10
+ import "./accounts-D96D1U9M.js";
11
+ import "./path-alias-guards-LILr7Hrs.js";
12
+ import { n as listSkillCommandsForAgents } from "./skill-commands-BfHvtJx2.js";
13
+ import "./skills-BrE5Yb5o.js";
14
+ import "./commands-registry-BVKCdwN_.js";
15
+
16
+ export { listSkillCommandsForAgents };
@@ -0,0 +1,202 @@
1
+ import { $ as parseCanonicalIpAddress, G as isBlockedSpecialUseIpv4Address, J as isIpv4Address, K as isBlockedSpecialUseIpv6Address, W as extractEmbeddedIpv4FromIpv6, Y as isLegacyIpv4Literal, et as parseLooseIpAddress, q as isCanonicalDottedDecimalIPv4 } from "./config-CudVTZDi.js";
2
+ import { Agent } from "undici";
3
+ import { lookup } from "node:dns";
4
+ import { lookup as lookup$1 } from "node:dns/promises";
5
+
6
+ //#region src/infra/net/proxy-env.ts
7
+ const PROXY_ENV_KEYS = [
8
+ "HTTP_PROXY",
9
+ "HTTPS_PROXY",
10
+ "ALL_PROXY",
11
+ "http_proxy",
12
+ "https_proxy",
13
+ "all_proxy"
14
+ ];
15
+ function hasProxyEnvConfigured(env = process.env) {
16
+ for (const key of PROXY_ENV_KEYS) {
17
+ const value = env[key];
18
+ if (typeof value === "string" && value.trim().length > 0) return true;
19
+ }
20
+ return false;
21
+ }
22
+
23
+ //#endregion
24
+ //#region src/infra/net/hostname.ts
25
+ function normalizeHostname(hostname) {
26
+ const normalized = hostname.trim().toLowerCase().replace(/\.$/, "");
27
+ if (normalized.startsWith("[") && normalized.endsWith("]")) return normalized.slice(1, -1);
28
+ return normalized;
29
+ }
30
+
31
+ //#endregion
32
+ //#region src/infra/net/ssrf.ts
33
+ var SsrFBlockedError = class extends Error {
34
+ constructor(message) {
35
+ super(message);
36
+ this.name = "SsrFBlockedError";
37
+ }
38
+ };
39
+ const BLOCKED_HOSTNAMES = new Set([
40
+ "localhost",
41
+ "localhost.localdomain",
42
+ "metadata.google.internal"
43
+ ]);
44
+ function normalizeHostnameSet(values) {
45
+ if (!values || values.length === 0) return /* @__PURE__ */ new Set();
46
+ return new Set(values.map((value) => normalizeHostname(value)).filter(Boolean));
47
+ }
48
+ function normalizeHostnameAllowlist(values) {
49
+ if (!values || values.length === 0) return [];
50
+ return Array.from(new Set(values.map((value) => normalizeHostname(value)).filter((value) => value !== "*" && value !== "*." && value.length > 0)));
51
+ }
52
+ function isPrivateNetworkAllowedByPolicy(policy) {
53
+ return policy?.dangerouslyAllowPrivateNetwork === true || policy?.allowPrivateNetwork === true;
54
+ }
55
+ function resolveIpv4SpecialUseBlockOptions(policy) {
56
+ return { allowRfc2544BenchmarkRange: policy?.allowRfc2544BenchmarkRange === true };
57
+ }
58
+ function isHostnameAllowedByPattern(hostname, pattern) {
59
+ if (pattern.startsWith("*.")) {
60
+ const suffix = pattern.slice(2);
61
+ if (!suffix || hostname === suffix) return false;
62
+ return hostname.endsWith(`.${suffix}`);
63
+ }
64
+ return hostname === pattern;
65
+ }
66
+ function matchesHostnameAllowlist(hostname, allowlist) {
67
+ if (allowlist.length === 0) return true;
68
+ return allowlist.some((pattern) => isHostnameAllowedByPattern(hostname, pattern));
69
+ }
70
+ function looksLikeUnsupportedIpv4Literal(address) {
71
+ const parts = address.split(".");
72
+ if (parts.length === 0 || parts.length > 4) return false;
73
+ if (parts.some((part) => part.length === 0)) return true;
74
+ return parts.every((part) => /^[0-9]+$/.test(part) || /^0x/i.test(part));
75
+ }
76
+ function isPrivateIpAddress(address, policy) {
77
+ let normalized = address.trim().toLowerCase();
78
+ if (normalized.startsWith("[") && normalized.endsWith("]")) normalized = normalized.slice(1, -1);
79
+ if (!normalized) return false;
80
+ const blockOptions = resolveIpv4SpecialUseBlockOptions(policy);
81
+ const strictIp = parseCanonicalIpAddress(normalized);
82
+ if (strictIp) {
83
+ if (isIpv4Address(strictIp)) return isBlockedSpecialUseIpv4Address(strictIp, blockOptions);
84
+ if (isBlockedSpecialUseIpv6Address(strictIp)) return true;
85
+ const embeddedIpv4 = extractEmbeddedIpv4FromIpv6(strictIp);
86
+ if (embeddedIpv4) return isBlockedSpecialUseIpv4Address(embeddedIpv4, blockOptions);
87
+ return false;
88
+ }
89
+ if (normalized.includes(":") && !parseLooseIpAddress(normalized)) return true;
90
+ if (!isCanonicalDottedDecimalIPv4(normalized) && isLegacyIpv4Literal(normalized)) return true;
91
+ if (looksLikeUnsupportedIpv4Literal(normalized)) return true;
92
+ return false;
93
+ }
94
+ function isBlockedHostname(hostname) {
95
+ const normalized = normalizeHostname(hostname);
96
+ if (!normalized) return false;
97
+ return isBlockedHostnameNormalized(normalized);
98
+ }
99
+ function isBlockedHostnameNormalized(normalized) {
100
+ if (BLOCKED_HOSTNAMES.has(normalized)) return true;
101
+ return normalized.endsWith(".localhost") || normalized.endsWith(".local") || normalized.endsWith(".internal");
102
+ }
103
+ function isBlockedHostnameOrIp(hostname, policy) {
104
+ const normalized = normalizeHostname(hostname);
105
+ if (!normalized) return false;
106
+ return isBlockedHostnameNormalized(normalized) || isPrivateIpAddress(normalized, policy);
107
+ }
108
+ const BLOCKED_HOST_OR_IP_MESSAGE = "Blocked hostname or private/internal/special-use IP address";
109
+ const BLOCKED_RESOLVED_IP_MESSAGE = "Blocked: resolves to private/internal/special-use IP address";
110
+ function assertAllowedHostOrIpOrThrow(hostnameOrIp, policy) {
111
+ if (isBlockedHostnameOrIp(hostnameOrIp, policy)) throw new SsrFBlockedError(BLOCKED_HOST_OR_IP_MESSAGE);
112
+ }
113
+ function assertAllowedResolvedAddressesOrThrow(results, policy) {
114
+ for (const entry of results) if (isBlockedHostnameOrIp(entry.address, policy)) throw new SsrFBlockedError(BLOCKED_RESOLVED_IP_MESSAGE);
115
+ }
116
+ function createPinnedLookup(params) {
117
+ const normalizedHost = normalizeHostname(params.hostname);
118
+ const fallback = params.fallback ?? lookup;
119
+ const fallbackLookup = fallback;
120
+ const fallbackWithOptions = fallback;
121
+ const records = params.addresses.map((address) => ({
122
+ address,
123
+ family: address.includes(":") ? 6 : 4
124
+ }));
125
+ let index = 0;
126
+ return ((host, options, callback) => {
127
+ const cb = typeof options === "function" ? options : callback;
128
+ if (!cb) return;
129
+ const normalized = normalizeHostname(host);
130
+ if (!normalized || normalized !== normalizedHost) {
131
+ if (typeof options === "function" || options === void 0) return fallbackLookup(host, cb);
132
+ return fallbackWithOptions(host, options, cb);
133
+ }
134
+ const opts = typeof options === "object" && options !== null ? options : {};
135
+ const requestedFamily = typeof options === "number" ? options : typeof opts.family === "number" ? opts.family : 0;
136
+ const candidates = requestedFamily === 4 || requestedFamily === 6 ? records.filter((entry) => entry.family === requestedFamily) : records;
137
+ const usable = candidates.length > 0 ? candidates : records;
138
+ if (opts.all) {
139
+ cb(null, usable);
140
+ return;
141
+ }
142
+ const chosen = usable[index % usable.length];
143
+ index += 1;
144
+ cb(null, chosen.address, chosen.family);
145
+ });
146
+ }
147
+ function dedupeAndPreferIpv4(results) {
148
+ const seen = /* @__PURE__ */ new Set();
149
+ const ipv4 = [];
150
+ const otherFamilies = [];
151
+ for (const entry of results) {
152
+ if (seen.has(entry.address)) continue;
153
+ seen.add(entry.address);
154
+ if (entry.family === 4) {
155
+ ipv4.push(entry.address);
156
+ continue;
157
+ }
158
+ otherFamilies.push(entry.address);
159
+ }
160
+ return [...ipv4, ...otherFamilies];
161
+ }
162
+ async function resolvePinnedHostnameWithPolicy(hostname, params = {}) {
163
+ const normalized = normalizeHostname(hostname);
164
+ if (!normalized) throw new Error("Invalid hostname");
165
+ const allowPrivateNetwork = isPrivateNetworkAllowedByPolicy(params.policy);
166
+ const allowedHostnames = normalizeHostnameSet(params.policy?.allowedHostnames);
167
+ const hostnameAllowlist = normalizeHostnameAllowlist(params.policy?.hostnameAllowlist);
168
+ const isExplicitAllowed = allowedHostnames.has(normalized);
169
+ const skipPrivateNetworkChecks = allowPrivateNetwork || isExplicitAllowed;
170
+ if (!matchesHostnameAllowlist(normalized, hostnameAllowlist)) throw new SsrFBlockedError(`Blocked hostname (not in allowlist): ${hostname}`);
171
+ if (!skipPrivateNetworkChecks) assertAllowedHostOrIpOrThrow(normalized, params.policy);
172
+ const results = await (params.lookupFn ?? lookup$1)(normalized, { all: true });
173
+ if (results.length === 0) throw new Error(`Unable to resolve hostname: ${hostname}`);
174
+ if (!skipPrivateNetworkChecks) assertAllowedResolvedAddressesOrThrow(results, params.policy);
175
+ const addresses = dedupeAndPreferIpv4(results);
176
+ if (addresses.length === 0) throw new Error(`Unable to resolve hostname: ${hostname}`);
177
+ return {
178
+ hostname: normalized,
179
+ addresses,
180
+ lookup: createPinnedLookup({
181
+ hostname: normalized,
182
+ addresses
183
+ })
184
+ };
185
+ }
186
+ function createPinnedDispatcher(pinned) {
187
+ return new Agent({ connect: { lookup: pinned.lookup } });
188
+ }
189
+ async function closeDispatcher(dispatcher) {
190
+ if (!dispatcher) return;
191
+ const candidate = dispatcher;
192
+ try {
193
+ if (typeof candidate.close === "function") {
194
+ await candidate.close();
195
+ return;
196
+ }
197
+ if (typeof candidate.destroy === "function") candidate.destroy();
198
+ } catch {}
199
+ }
200
+
201
+ //#endregion
202
+ export { isBlockedHostnameOrIp as a, resolvePinnedHostnameWithPolicy as c, isBlockedHostname as i, normalizeHostname as l, closeDispatcher as n, isPrivateIpAddress as o, createPinnedDispatcher as r, isPrivateNetworkAllowedByPolicy as s, SsrFBlockedError as t, hasProxyEnvConfigured as u };
@@ -0,0 +1,81 @@
1
+ import { w as resolveConfigDir } from "./logger-2A0UE34q.js";
2
+ import { c as detectMime, l as extensionForMime } from "./image-ops-BpYDXC6N.js";
3
+ import { createWriteStream } from "node:fs";
4
+ import path from "node:path";
5
+ import fs$1 from "node:fs/promises";
6
+ import crypto from "node:crypto";
7
+ import { pipeline } from "node:stream/promises";
8
+ import { request } from "node:https";
9
+
10
+ //#region src/media/store.ts
11
+ const resolveMediaDir = () => path.join(resolveConfigDir(), "media");
12
+ const MEDIA_MAX_BYTES = 5 * 1024 * 1024;
13
+ const MAX_BYTES = MEDIA_MAX_BYTES;
14
+ const DEFAULT_TTL_MS = 120 * 1e3;
15
+ const MEDIA_FILE_MODE = 420;
16
+ /**
17
+ * Sanitize a filename for cross-platform safety.
18
+ * Removes chars unsafe on Windows/SharePoint/all platforms.
19
+ * Keeps: alphanumeric, dots, hyphens, underscores, Unicode letters/numbers.
20
+ */
21
+ function sanitizeFilename(name) {
22
+ const trimmed = name.trim();
23
+ if (!trimmed) return "";
24
+ return trimmed.replace(/[^\p{L}\p{N}._-]+/gu, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").slice(0, 60);
25
+ }
26
+ /**
27
+ * Extract original filename from path if it matches the embedded format.
28
+ * Pattern: {original}---{uuid}.{ext} → returns "{original}.{ext}"
29
+ * Falls back to basename if no pattern match, or "file.bin" if empty.
30
+ */
31
+ function extractOriginalFilename(filePath) {
32
+ const basename = path.basename(filePath);
33
+ if (!basename) return "file.bin";
34
+ const ext = path.extname(basename);
35
+ const match = path.basename(basename, ext).match(/^(.+)---[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i);
36
+ if (match?.[1]) return `${match[1]}${ext}`;
37
+ return basename;
38
+ }
39
+ function getMediaDir() {
40
+ return resolveMediaDir();
41
+ }
42
+ async function ensureMediaDir() {
43
+ const mediaDir = resolveMediaDir();
44
+ await fs$1.mkdir(mediaDir, {
45
+ recursive: true,
46
+ mode: 448
47
+ });
48
+ return mediaDir;
49
+ }
50
+ async function saveMediaBuffer(buffer, contentType, subdir = "inbound", maxBytes = MAX_BYTES, originalFilename) {
51
+ if (buffer.byteLength > maxBytes) throw new Error(`Media exceeds ${(maxBytes / (1024 * 1024)).toFixed(0)}MB limit`);
52
+ const dir = path.join(resolveMediaDir(), subdir);
53
+ await fs$1.mkdir(dir, {
54
+ recursive: true,
55
+ mode: 448
56
+ });
57
+ const uuid = crypto.randomUUID();
58
+ const headerExt = extensionForMime(contentType?.split(";")[0]?.trim() ?? void 0);
59
+ const mime = await detectMime({
60
+ buffer,
61
+ headerMime: contentType
62
+ });
63
+ const ext = headerExt ?? extensionForMime(mime) ?? "";
64
+ let id;
65
+ if (originalFilename) {
66
+ const base = path.parse(originalFilename).name;
67
+ const sanitized = sanitizeFilename(base);
68
+ id = sanitized ? `${sanitized}---${uuid}${ext}` : `${uuid}${ext}`;
69
+ } else id = ext ? `${uuid}${ext}` : uuid;
70
+ const dest = path.join(dir, id);
71
+ await fs$1.writeFile(dest, buffer, { mode: MEDIA_FILE_MODE });
72
+ return {
73
+ id,
74
+ path: dest,
75
+ size: buffer.byteLength,
76
+ contentType: mime
77
+ };
78
+ }
79
+
80
+ //#endregion
81
+ export { saveMediaBuffer as a, getMediaDir as i, ensureMediaDir as n, extractOriginalFilename as r, MEDIA_MAX_BYTES as t };
@@ -0,0 +1,52 @@
1
+ import "./run-with-concurrency-CFRxflYW.js";
2
+ import "./accounts-D2p8t4UO.js";
3
+ import { a as isSubagentSessionRunActive, c as resolveRequesterForChildSession, i as countPendingDescendantRunsExcludingRun, l as shouldIgnorePostCompletionAnnounceForSession, n as countActiveDescendantRuns, o as listSubagentRunsForRequester, r as countPendingDescendantRuns, s as replaceSubagentRunAfterSteer } from "./reply-DmCyOPxV.js";
4
+ import "./paths-MKyEVmEb.js";
5
+ import "./github-copilot-token-D5fdS6xD.js";
6
+ import "./config-CudVTZDi.js";
7
+ import "./logger-2A0UE34q.js";
8
+ import "./thinking-DE2FCBnv.js";
9
+ import "./image-ops-BpYDXC6N.js";
10
+ import "./pi-embedded-helpers-CeC8GbRi.js";
11
+ import "./plugins-2gQWMmUN.js";
12
+ import "./accounts-B8qv93DH.js";
13
+ import "./accounts-D96D1U9M.js";
14
+ import "./send-BQvcPd54.js";
15
+ import "./paths-CfGmXu9A.js";
16
+ import "./fetch-Bv4TQOMH.js";
17
+ import "./redact-85H1J7mo.js";
18
+ import "./errors-D5bA02--.js";
19
+ import "./channel-activity-VpA3MxPb.js";
20
+ import "./path-alias-guards-LILr7Hrs.js";
21
+ import "./fs-safe-IQ0H7rVD.js";
22
+ import "./ssrf-CbvrROKN.js";
23
+ import "./fetch-guard-n0LVdzZL.js";
24
+ import "./local-roots-DR-lR22p.js";
25
+ import "./ir-DsMX3GcS.js";
26
+ import "./render-HmipMDlP.js";
27
+ import "./tables-BhfDBQ58.js";
28
+ import "./send-Cld7xlxq.js";
29
+ import "./send-CTOVZqmi.js";
30
+ import "./tool-images-B1I6LEp7.js";
31
+ import "./target-errors-0DW3k-Ae.js";
32
+ import "./send-C8gdhoLP.js";
33
+ import "./audio-transcription-runner-j0mQXKSH.js";
34
+ import "./tokens-C2tJ8uXs.js";
35
+ import "./skill-commands-BfHvtJx2.js";
36
+ import "./skills-BrE5Yb5o.js";
37
+ import "./chrome-5jJIDTj0.js";
38
+ import "./deliver-4NrmrRKu.js";
39
+ import "./diagnostic-DCPixRez.js";
40
+ import "./store-8XS_isi_.js";
41
+ import "./commands-registry-BVKCdwN_.js";
42
+ import "./image-n-R2HcNg.js";
43
+ import "./api-key-rotation-D0aZfxXH.js";
44
+ import "./proxy-fetch-sX3-xzX1.js";
45
+ import "./pi-model-discovery-DycOMKYh.js";
46
+ import "./send-Bplfz7UW.js";
47
+ import "./outbound-attachment-CPfpUcdI.js";
48
+ import "./proxy-BFm9FJeW.js";
49
+ import "./manager-ClUgSFkG.js";
50
+ import "./query-expansion-B5Z0In1U.js";
51
+
52
+ export { countActiveDescendantRuns, countPendingDescendantRuns, countPendingDescendantRunsExcludingRun, isSubagentSessionRunActive, listSubagentRunsForRequester, replaceSubagentRunAfterSteer, resolveRequesterForChildSession, shouldIgnorePostCompletionAnnounceForSession };
@@ -0,0 +1,55 @@
1
+ import { r as markdownToIRWithMeta } from "./ir-DsMX3GcS.js";
2
+ import { t as renderMarkdownWithMarkers } from "./render-HmipMDlP.js";
3
+
4
+ //#region src/markdown/tables.ts
5
+ const MARKDOWN_STYLE_MARKERS = {
6
+ bold: {
7
+ open: "**",
8
+ close: "**"
9
+ },
10
+ italic: {
11
+ open: "_",
12
+ close: "_"
13
+ },
14
+ strikethrough: {
15
+ open: "~~",
16
+ close: "~~"
17
+ },
18
+ code: {
19
+ open: "`",
20
+ close: "`"
21
+ },
22
+ code_block: {
23
+ open: "```\n",
24
+ close: "```"
25
+ }
26
+ };
27
+ function convertMarkdownTables(markdown, mode) {
28
+ if (!markdown || mode === "off") return markdown;
29
+ const { ir, hasTables } = markdownToIRWithMeta(markdown, {
30
+ linkify: false,
31
+ autolink: false,
32
+ headingStyle: "none",
33
+ blockquotePrefix: "",
34
+ tableMode: mode
35
+ });
36
+ if (!hasTables) return markdown;
37
+ return renderMarkdownWithMarkers(ir, {
38
+ styleMarkers: MARKDOWN_STYLE_MARKERS,
39
+ escapeText: (text) => text,
40
+ buildLink: (link, text) => {
41
+ const href = link.href.trim();
42
+ if (!href) return null;
43
+ if (!text.slice(link.start, link.end)) return null;
44
+ return {
45
+ start: link.start,
46
+ end: link.end,
47
+ open: "[",
48
+ close: `](${href})`
49
+ };
50
+ }
51
+ });
52
+ }
53
+
54
+ //#endregion
55
+ export { convertMarkdownTables as t };
@@ -0,0 +1,195 @@
1
+ import { c as detectMime } from "./image-ops-BpYDXC6N.js";
2
+ import { r as sanitizeToolResultImages } from "./tool-images-B1I6LEp7.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 };