squidclaw 3.0.19 → 3.0.20

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 (209) hide show
  1. package/dist/{agents-DL8uYsUq.js → agents-BOS_wASV.js} +4 -4
  2. package/dist/{agents.config-B4KAAVvR.js → agents.config-ChUZBohP.js} +1 -1
  3. package/dist/{agents.config-D93fF1eJ.js → agents.config-Dfsl4jNF.js} +1 -1
  4. package/dist/{audio-preflight-Bzo_zN4j.js → audio-preflight-lT9iRnYi.js} +4 -4
  5. package/dist/{audio-transcription-runner-Cp_lkLCv.js → audio-transcription-runner-YiR1ym3a.js} +1 -1
  6. package/dist/{auth-choice-Ba4AEm_k.js → auth-choice-B_pvWO2S.js} +1 -1
  7. package/dist/{auth-choice-ziFj5bXd.js → auth-choice-kUm2JAky.js} +1 -1
  8. package/dist/{banner-DDih2slD.js → banner-4LItBqCV.js} +1 -1
  9. package/dist/build-info.json +2 -2
  10. package/dist/bundled/boot-md/handler.js +1 -1
  11. package/dist/bundled/session-memory/handler.js +1 -1
  12. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  13. package/dist/{channel-options-DTDfU0R6.js → channel-options-DA-4IR6h.js} +1 -1
  14. package/dist/{channel-options-BBSsevyl.js → channel-options-DQeQl3Rk.js} +1 -1
  15. package/dist/{channel-web-BXl9jCKV.js → channel-web--dAjVoio.js} +1 -1
  16. package/dist/{channel-web-SF18oYqo.js → channel-web-DJ21CAFF.js} +1 -1
  17. package/dist/{channels-cli-BDLabpWH.js → channels-cli-DviJtKuS.js} +6 -6
  18. package/dist/{channels-cli-BiuWJpJu.js → channels-cli-QvrLGt6C.js} +6 -6
  19. package/dist/{chrome-CZQnp4VH.js → chrome-CuBHInKC.js} +8 -8
  20. package/dist/{cli-CfgDCCuC.js → cli-aCubMdJg.js} +1 -1
  21. package/dist/{cli-DAZ1MKrJ.js → cli-q7seQ2Xx.js} +1 -1
  22. package/dist/{command-registry-DkjNuW8w.js → command-registry-C_YMaVul.js} +9 -9
  23. package/dist/{completion-cli-DbNma3J9.js → completion-cli-CyKEJDPO.js} +1 -1
  24. package/dist/{completion-cli-Du8H92bM.js → completion-cli-w4XQjhDI.js} +2 -2
  25. package/dist/{config-cli-D16tlTWa.js → config-cli-BfhjWCvB.js} +1 -1
  26. package/dist/{config-cli-CQhQ8Bcc.js → config-cli-BhQXEuBv.js} +1 -1
  27. package/dist/{configure-B4TiK50K.js → configure-0xkYrQ0e.js} +3 -3
  28. package/dist/{configure-B9b3cQTC.js → configure-Dsg_0ymU.js} +3 -3
  29. package/dist/{deliver-B4WWPQvt.js → deliver-6zfT7daI.js} +1 -1
  30. package/dist/{deliver-runtime-CeE1X9si.js → deliver-runtime-MBexxUuG.js} +3 -3
  31. package/dist/{deps-send-whatsapp.runtime-Cw7U9orE.js → deps-send-whatsapp.runtime-B7GC68Cu.js} +2 -2
  32. package/dist/{deps-send-whatsapp.runtime-CFnZsKW0.js → deps-send-whatsapp.runtime-BGDIgEzh.js} +3 -3
  33. package/dist/{deps-send-whatsapp.runtime-B9uivfkM.js → deps-send-whatsapp.runtime-BNAJe11S.js} +3 -3
  34. package/dist/{deps-send-whatsapp.runtime-miTfQkK9.js → deps-send-whatsapp.runtime-qBpqM2k9.js} +7 -7
  35. package/dist/{doctor-completion-CEiVFPte.js → doctor-completion-BCQdm02b.js} +1 -1
  36. package/dist/{doctor-completion-ujZ_JdIz.js → doctor-completion-BlkbgU5h.js} +1 -1
  37. package/dist/entry.js +2 -2
  38. package/dist/extensionAPI.js +6 -6
  39. package/dist/{gateway-cli-NXeo-J8r.js → gateway-cli-tFwyE4a3.js} +8 -8
  40. package/dist/{gateway-cli-2jaWM_Ci.js → gateway-cli-uWj08vdf.js} +8 -8
  41. package/dist/{health-BPZALM__.js → health-BwC4Qe5W.js} +1 -1
  42. package/dist/{health-DFZKMrW2.js → health-DS3reqch.js} +1 -1
  43. package/dist/{hooks-cli-B3rkhWcT.js → hooks-cli-oei5kRQM.js} +2 -2
  44. package/dist/{hooks-cli-BO_gZJVD.js → hooks-cli-tp5LchRL.js} +2 -2
  45. package/dist/{image-DKkuLtZ4.js → image-VgwN31FZ.js} +1 -1
  46. package/dist/{image-runtime-BMavqm9n.js → image-runtime-CwMuTYvd.js} +3 -3
  47. package/dist/index.js +6 -6
  48. package/dist/llm-slug-generator.js +1 -1
  49. package/dist/{models-Bb-GYqHr.js → models-D9X4EUlY.js} +2 -2
  50. package/dist/{models-cli-CAIJM1Wh.js → models-cli-C1PLBYF7.js} +2 -2
  51. package/dist/{models-cli-DffAz0ji.js → models-cli-LGp-Tok9.js} +3 -3
  52. package/dist/{npm-resolution-D2_zGJM-.js → npm-resolution-BUvQm-e-.js} +1 -1
  53. package/dist/{npm-resolution-D5pBCkUw.js → npm-resolution-Dtkh26DG.js} +1 -1
  54. package/dist/{onboard-dhG2YBez.js → onboard-B0padonr.js} +2 -2
  55. package/dist/{onboard-DcVsL9Jx.js → onboard-DDD6GX8E.js} +2 -2
  56. package/dist/{onboard-channels-mNXKTvFs.js → onboard-channels-9My16AOy.js} +1 -1
  57. package/dist/{onboard-channels-C-cQFUBH.js → onboard-channels-Bm_NXV3z.js} +1 -1
  58. package/dist/{onboarding-B3-IwkNi.js → onboarding-dES4q9RV.js} +3 -3
  59. package/dist/{onboarding-Cl6kW_iq.js → onboarding-o-id7p0-.js} +3 -3
  60. package/dist/{onboarding.finalize-BZqsNG2H.js → onboarding.finalize-BFtOLT7n.js} +6 -6
  61. package/dist/{onboarding.finalize-CCU-ykTR.js → onboarding.finalize-dpgNgUt5.js} +5 -5
  62. package/dist/{pi-embedded-C5U8Qxn6.js → pi-embedded-B_4NAHxA.js} +4 -40
  63. package/dist/{pi-embedded-B79nZERv.js → pi-embedded-BpHQIzjg.js} +24 -60
  64. package/dist/{pi-embedded-helpers-CEHpGDRs.js → pi-embedded-helpers-A9VYPVCH.js} +3 -3
  65. package/dist/{plugin-registry-CB47SSz1.js → plugin-registry-CCeUDvxY.js} +1 -1
  66. package/dist/{plugin-registry-Gy_VByyf.js → plugin-registry-CCkpP8-I.js} +1 -1
  67. package/dist/plugin-sdk/{channel-web-vB3Dcd8-.js → channel-web-BQE2gJ5U.js} +1 -1
  68. package/dist/plugin-sdk/{channel-web-BrhP6FQO.js → channel-web-BtNgAS1G.js} +1 -1
  69. package/dist/plugin-sdk/compat.js +50 -50
  70. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-CuxKhIE0.js → deps-send-whatsapp.runtime-DPZSTh1j.js} +3 -3
  71. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-Ce4Gzz-J.js → deps-send-whatsapp.runtime-V0Jfat5S.js} +3 -3
  72. package/dist/plugin-sdk/index.js +2 -2
  73. package/dist/plugin-sdk/mattermost.js +3 -3
  74. package/dist/plugin-sdk/nextcloud-talk.js +2 -2
  75. package/dist/plugin-sdk/{reply-DxvpiQBp.js → reply-DJYA4ZNu.js} +4 -40
  76. package/dist/plugin-sdk/{reply-sFKB3ofA.js → reply-DeKKmUDh.js} +4 -40
  77. package/dist/plugin-sdk/{slash-dispatch.runtime-C7u7mlny.js → slash-dispatch.runtime-E6j8gkO2.js} +1 -1
  78. package/dist/plugin-sdk/{slash-dispatch.runtime-Dyb_EkUt.js → slash-dispatch.runtime-k8xSVYOI.js} +1 -1
  79. package/dist/plugin-sdk/{subagent-registry-runtime-B6l6PxqP.js → subagent-registry-runtime-Cca50Qld.js} +1 -1
  80. package/dist/plugin-sdk/{subagent-registry-runtime-hdnabonI.js → subagent-registry-runtime-D6cTAG2k.js} +1 -1
  81. package/dist/plugin-sdk/{web-Bnn82S4u.js → web-Be4JS3z8.js} +2 -2
  82. package/dist/plugin-sdk/{web-D9LAdsuU.js → web-DkbCMgLG.js} +2 -2
  83. package/dist/plugin-sdk/whatsapp.js +2 -2
  84. package/dist/{plugins-cli-gtgkmDcv.js → plugins-cli-CZCadI9y.js} +2 -2
  85. package/dist/{plugins-cli-BYnoJwF1.js → plugins-cli-DFpHU_xo.js} +2 -2
  86. package/dist/{program-BGlgDpHI.js → program-B4_o5EDH.js} +7 -7
  87. package/dist/{program-context-M4FTWqqg.js → program-context-CkfdLtpp.js} +17 -17
  88. package/dist/{prompt-select-styled-AL5Tm3yO.js → prompt-select-styled-C1DFrYuk.js} +4 -4
  89. package/dist/{prompt-select-styled-BVC2byQV.js → prompt-select-styled-CZJJ2rPA.js} +4 -4
  90. package/dist/{provider-auth-helpers-DDgrFku5.js → provider-auth-helpers-BlYwNWkq.js} +1 -1
  91. package/dist/{provider-auth-helpers-Q7aIhDgv.js → provider-auth-helpers-C5taJG0R.js} +1 -1
  92. package/dist/{push-apns-FyGbUyh2.js → push-apns-Bhk1_5ut.js} +1 -1
  93. package/dist/{push-apns-Ga8xvhkh.js → push-apns-Dkjfalec.js} +1 -1
  94. package/dist/{pw-ai-Du22SYoO.js → pw-ai-CM87tQwG.js} +1 -1
  95. package/dist/{register.agent-zP8a-sNB.js → register.agent-DOp4lbyc.js} +7 -7
  96. package/dist/{register.agent-koAXw1ay.js → register.agent-s2PqcoIS.js} +6 -6
  97. package/dist/{register.configure-CYrmyjlf.js → register.configure-BGfourxZ.js} +7 -7
  98. package/dist/{register.configure-CUuP5J8W.js → register.configure-DABoMBBf.js} +7 -7
  99. package/dist/{register.maintenance-BZuEljPU.js → register.maintenance-Bdr3bSAF.js} +8 -8
  100. package/dist/{register.maintenance-ByEQ2CVH.js → register.maintenance-DmP8sVxb.js} +7 -7
  101. package/dist/{register.message-BkSXhv9I.js → register.message-DF0InVCv.js} +2 -2
  102. package/dist/{register.message-CgHfmDHm.js → register.message-gz8DaAc1.js} +2 -2
  103. package/dist/{register.onboard-HcQwPAEK.js → register.onboard-Do14cwDQ.js} +2 -2
  104. package/dist/{register.onboard-4ke40MNP.js → register.onboard-auVLfmF3.js} +2 -2
  105. package/dist/{register.setup-xAb7Cvzy.js → register.setup-B3aVuPyo.js} +2 -2
  106. package/dist/{register.setup-B41xZb1r.js → register.setup-ZyGJlYOD.js} +2 -2
  107. package/dist/{register.status-health-sessions-CcOVL0x8.js → register.status-health-sessions-C-1HE5oP.js} +3 -3
  108. package/dist/{register.status-health-sessions-BbHAAKwv.js → register.status-health-sessions-vFpvdVS1.js} +3 -3
  109. package/dist/{register.subclis-_uSASnfC.js → register.subclis-BYiAuTiK.js} +9 -9
  110. package/dist/{reply-BFTOdZcK.js → reply-BaVB3YlN.js} +4 -40
  111. package/dist/{run-main-C1eZrW-5.js → run-main-DW-JR8hB.js} +14 -14
  112. package/dist/{server-node-events-DbS1jJ5j.js → server-node-events-D-EmiDyc.js} +2 -2
  113. package/dist/{server-node-events-pYrJmi9w.js → server-node-events-rumcq7j0.js} +2 -2
  114. package/dist/{slash-dispatch.runtime-BGXbtMX6.js → slash-dispatch.runtime-BeltKAMm.js} +6 -6
  115. package/dist/{slash-dispatch.runtime-DqZVfX4H.js → slash-dispatch.runtime-C7rHRQFg.js} +1 -1
  116. package/dist/{slash-dispatch.runtime-DmFVOi3w.js → slash-dispatch.runtime-DPRwMKXk.js} +1 -1
  117. package/dist/{slash-dispatch.runtime-PX9_08Hm.js → slash-dispatch.runtime-sVHNrSL1.js} +1 -1
  118. package/dist/{status-DtiapFqq.js → status-BeSD1NDD.js} +2 -2
  119. package/dist/{status-B4eVRJcO.js → status-DGF_ROMC.js} +2 -2
  120. package/dist/{subagent-registry-Ctrhw4X-.js → subagent-registry-CgUBOyi3.js} +4 -40
  121. package/dist/{subagent-registry-runtime-Cy7dsGqF.js → subagent-registry-runtime-BYpjZwjA.js} +1 -1
  122. package/dist/{subagent-registry-runtime-BIKGAzgI.js → subagent-registry-runtime-Bm5UEB8c.js} +1 -1
  123. package/dist/{subagent-registry-runtime-CezPaX9P.js → subagent-registry-runtime-Bxc5DYZt.js} +6 -6
  124. package/dist/{subagent-registry-runtime-CTjx4TK5.js → subagent-registry-runtime-Cx5vPpG8.js} +1 -1
  125. package/dist/{update-cli-DLOWRdjv.js → update-cli-BSIF-OEa.js} +8 -8
  126. package/dist/{update-cli-_FsTRdQZ.js → update-cli-Duy8S3Bj.js} +7 -7
  127. package/dist/{update-runner-BY3l7ytB.js → update-runner-CMpruPN8.js} +1 -1
  128. package/dist/{update-runner-BKWHnVYI.js → update-runner-D_nDdx7d.js} +1 -1
  129. package/dist/{web-BNfDYvlW.js → web-Bnr4YuWJ.js} +2 -2
  130. package/dist/{web-BdZ3mX3p.js → web-C-5RPkV9.js} +2 -2
  131. package/dist/{web-1D0d1RHD.js → web-C0xcHURK.js} +1 -1
  132. package/dist/{web-B46aOGK0.js → web-CKY0tK0k.js} +6 -6
  133. package/package.json +1 -1
  134. package/dist/plugin-sdk/accounts-CUEuUR3C.js +0 -46
  135. package/dist/plugin-sdk/accounts-D0W2pELU.js +0 -288
  136. package/dist/plugin-sdk/accounts-ucj0odJq.js +0 -35
  137. package/dist/plugin-sdk/active-listener-BO7eBEG_.js +0 -50
  138. package/dist/plugin-sdk/agents/agent-tier.d.ts +0 -13
  139. package/dist/plugin-sdk/api-key-rotation-C4C_mDsg.js +0 -181
  140. package/dist/plugin-sdk/audio-preflight-Cqdo0JKm.js +0 -69
  141. package/dist/plugin-sdk/audio-transcription-runner-DnEooIyE.js +0 -2176
  142. package/dist/plugin-sdk/audit-membership-runtime-B9b-zRwg.js +0 -58
  143. package/dist/plugin-sdk/channel-activity-BMWLw4o2.js +0 -94
  144. package/dist/plugin-sdk/channel-web-D9WdAFlv.js +0 -2256
  145. package/dist/plugin-sdk/chrome-CV-q0Lmc.js +0 -2415
  146. package/dist/plugin-sdk/commands-registry-e7YoqrbP.js +0 -1125
  147. package/dist/plugin-sdk/config-B2B64aX0.js +0 -17911
  148. package/dist/plugin-sdk/deliver-BkyBtcLR.js +0 -1694
  149. package/dist/plugin-sdk/deliver-runtime-O4lwAWMw.js +0 -32
  150. package/dist/plugin-sdk/deps-send-discord.runtime-BAeeBldY.js +0 -23
  151. package/dist/plugin-sdk/deps-send-imessage.runtime-EL-CfikZ.js +0 -22
  152. package/dist/plugin-sdk/deps-send-signal.runtime-BeemHeUu.js +0 -21
  153. package/dist/plugin-sdk/deps-send-slack.runtime-DTttkC0N.js +0 -19
  154. package/dist/plugin-sdk/deps-send-telegram.runtime-Dsf9Cnka.js +0 -24
  155. package/dist/plugin-sdk/deps-send-whatsapp.runtime-CCS71r77.js +0 -57
  156. package/dist/plugin-sdk/diagnostic-DPRVoKTk.js +0 -319
  157. package/dist/plugin-sdk/errors-B8oJXuCF.js +0 -54
  158. package/dist/plugin-sdk/fetch-guard-F0Fnqisy.js +0 -156
  159. package/dist/plugin-sdk/fs-safe-Dqmpk-Fr.js +0 -352
  160. package/dist/plugin-sdk/image-cBW8L8pp.js +0 -2310
  161. package/dist/plugin-sdk/image-ops-BP8ix1GC.js +0 -584
  162. package/dist/plugin-sdk/image-runtime-9xkgSlNz.js +0 -25
  163. package/dist/plugin-sdk/ir-DWEc6zOp.js +0 -1296
  164. package/dist/plugin-sdk/local-roots-BIPT8uAO.js +0 -186
  165. package/dist/plugin-sdk/logger-DDdrdbDu.js +0 -1163
  166. package/dist/plugin-sdk/login-BMTiGutN.js +0 -57
  167. package/dist/plugin-sdk/login-qr-BFxqYUkc.js +0 -320
  168. package/dist/plugin-sdk/manager-BD-aYaZ8.js +0 -3917
  169. package/dist/plugin-sdk/manager-runtime-C5bRwUlz.js +0 -15
  170. package/dist/plugin-sdk/outbound-Bm07xvO6.js +0 -212
  171. package/dist/plugin-sdk/outbound-attachment-DLsaxDsc.js +0 -19
  172. package/dist/plugin-sdk/path-alias-guards-gBhrAn14.js +0 -43
  173. package/dist/plugin-sdk/paths-C6W4VHoa.js +0 -166
  174. package/dist/plugin-sdk/pi-embedded-helpers-BExwPvTh.js +0 -9627
  175. package/dist/plugin-sdk/pi-model-discovery-DdctvBeX.js +0 -134
  176. package/dist/plugin-sdk/pi-model-discovery-runtime-DrtpLJjk.js +0 -8
  177. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-rgTz3FBl.js +0 -354
  178. package/dist/plugin-sdk/plugins-BN64HHZA.js +0 -864
  179. package/dist/plugin-sdk/proxy-fetch-ZPEvp58f.js +0 -38
  180. package/dist/plugin-sdk/pw-ai-DBm3RdBK.js +0 -1938
  181. package/dist/plugin-sdk/qmd-manager-6bozlfFg.js +0 -1448
  182. package/dist/plugin-sdk/query-expansion-eeVz_aEm.js +0 -1011
  183. package/dist/plugin-sdk/redact-BoNEjbpF.js +0 -319
  184. package/dist/plugin-sdk/reply-CqXMy3Yd.js +0 -98731
  185. package/dist/plugin-sdk/resolve-outbound-target-DXfjGlZQ.js +0 -40
  186. package/dist/plugin-sdk/run-with-concurrency-5DMu9szx.js +0 -1994
  187. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-D2hkJBa-.js +0 -10
  188. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-C06I4adi.js +0 -19
  189. package/dist/plugin-sdk/send-B9xnwtQ-.js +0 -540
  190. package/dist/plugin-sdk/send-BxySs-Cu.js +0 -2587
  191. package/dist/plugin-sdk/send-D9THKp_J.js +0 -414
  192. package/dist/plugin-sdk/send-DCuaaP2w.js +0 -503
  193. package/dist/plugin-sdk/send-Dm_-_xje.js +0 -3135
  194. package/dist/plugin-sdk/session-DDzIZHxt.js +0 -169
  195. package/dist/plugin-sdk/skill-commands-DRvqtuFC.js +0 -342
  196. package/dist/plugin-sdk/skills-BWwlfbVj.js +0 -1428
  197. package/dist/plugin-sdk/slash-commands.runtime-BzYsaTST.js +0 -13
  198. package/dist/plugin-sdk/slash-dispatch.runtime-BC3IAF-I.js +0 -52
  199. package/dist/plugin-sdk/slash-skill-commands.runtime-sg98L8BK.js +0 -16
  200. package/dist/plugin-sdk/ssrf-DOBwjFow.js +0 -202
  201. package/dist/plugin-sdk/store-BKDR_-Qk.js +0 -81
  202. package/dist/plugin-sdk/subagent-registry-runtime-Ceu7AzWi.js +0 -52
  203. package/dist/plugin-sdk/tables-GIj79us5.js +0 -55
  204. package/dist/plugin-sdk/target-errors-jlLHihbX.js +0 -195
  205. package/dist/plugin-sdk/thinking-BgdUnMZ2.js +0 -1206
  206. package/dist/plugin-sdk/tokens-CTIYTLWu.js +0 -52
  207. package/dist/plugin-sdk/tool-images-GSlvf6RP.js +0 -274
  208. package/dist/plugin-sdk/web-BK2-uaOo.js +0 -56
  209. package/dist/plugin-sdk/whatsapp-actions-DQpK_5Ds.js +0 -80
@@ -1,181 +0,0 @@
1
- import { jn as normalizeProviderId } from "./config-B2B64aX0.js";
2
- import { r as formatErrorMessage } from "./errors-B8oJXuCF.js";
3
-
4
- //#region src/infra/gemini-auth.ts
5
- /**
6
- * Shared Gemini authentication utilities.
7
- *
8
- * Supports both traditional API keys and OAuth JSON format.
9
- */
10
- /**
11
- * Parse Gemini API key and return appropriate auth headers.
12
- *
13
- * OAuth format: `{"token": "...", "projectId": "..."}`
14
- *
15
- * @param apiKey - Either a traditional API key string or OAuth JSON
16
- * @returns Headers object with appropriate authentication
17
- */
18
- function parseGeminiAuth(apiKey) {
19
- if (apiKey.startsWith("{")) try {
20
- const parsed = JSON.parse(apiKey);
21
- if (typeof parsed.token === "string" && parsed.token) return { headers: {
22
- Authorization: `Bearer ${parsed.token}`,
23
- "Content-Type": "application/json"
24
- } };
25
- } catch {}
26
- return { headers: {
27
- "x-goog-api-key": apiKey,
28
- "Content-Type": "application/json"
29
- } };
30
- }
31
-
32
- //#endregion
33
- //#region src/agents/live-auth-keys.ts
34
- const KEY_SPLIT_RE = /[\s,;]+/g;
35
- const GOOGLE_LIVE_SINGLE_KEY = "SQUIDCLAW_LIVE_GEMINI_KEY";
36
- const PROVIDER_PREFIX_OVERRIDES = {
37
- google: "GEMINI",
38
- "google-vertex": "GEMINI"
39
- };
40
- const PROVIDER_API_KEY_CONFIG = {
41
- anthropic: {
42
- liveSingle: "SQUIDCLAW_LIVE_ANTHROPIC_KEY",
43
- listVar: "SQUIDCLAW_LIVE_ANTHROPIC_KEYS",
44
- primaryVar: "ANTHROPIC_API_KEY",
45
- prefixedVar: "ANTHROPIC_API_KEY_"
46
- },
47
- google: {
48
- liveSingle: GOOGLE_LIVE_SINGLE_KEY,
49
- listVar: "GEMINI_API_KEYS",
50
- primaryVar: "GEMINI_API_KEY",
51
- prefixedVar: "GEMINI_API_KEY_"
52
- },
53
- "google-vertex": {
54
- liveSingle: GOOGLE_LIVE_SINGLE_KEY,
55
- listVar: "GEMINI_API_KEYS",
56
- primaryVar: "GEMINI_API_KEY",
57
- prefixedVar: "GEMINI_API_KEY_"
58
- },
59
- openai: {
60
- liveSingle: "SQUIDCLAW_LIVE_OPENAI_KEY",
61
- listVar: "OPENAI_API_KEYS",
62
- primaryVar: "OPENAI_API_KEY",
63
- prefixedVar: "OPENAI_API_KEY_"
64
- }
65
- };
66
- function parseKeyList(raw) {
67
- if (!raw) return [];
68
- return raw.split(KEY_SPLIT_RE).map((value) => value.trim()).filter(Boolean);
69
- }
70
- function collectEnvPrefixedKeys(prefix) {
71
- const keys = [];
72
- for (const [name, value] of Object.entries(process.env)) {
73
- if (!name.startsWith(prefix)) continue;
74
- const trimmed = value?.trim();
75
- if (!trimmed) continue;
76
- keys.push(trimmed);
77
- }
78
- return keys;
79
- }
80
- function resolveProviderApiKeyConfig(provider) {
81
- const normalized = normalizeProviderId(provider);
82
- const custom = PROVIDER_API_KEY_CONFIG[normalized];
83
- const base = PROVIDER_PREFIX_OVERRIDES[normalized] ?? normalized.toUpperCase().replace(/-/g, "_");
84
- const liveSingle = custom?.liveSingle ?? `SQUIDCLAW_LIVE_${base}_KEY`;
85
- const listVar = custom?.listVar ?? `${base}_API_KEYS`;
86
- const primaryVar = custom?.primaryVar ?? `${base}_API_KEY`;
87
- const prefixedVar = custom?.prefixedVar ?? `${base}_API_KEY_`;
88
- if (normalized === "google" || normalized === "google-vertex") return {
89
- liveSingle,
90
- listVar,
91
- primaryVar,
92
- prefixedVar,
93
- fallbackVars: ["GOOGLE_API_KEY"]
94
- };
95
- return {
96
- liveSingle,
97
- listVar,
98
- primaryVar,
99
- prefixedVar,
100
- fallbackVars: []
101
- };
102
- }
103
- function collectProviderApiKeys(provider) {
104
- const config = resolveProviderApiKeyConfig(provider);
105
- const forcedSingle = config.liveSingle ? process.env[config.liveSingle]?.trim() : void 0;
106
- if (forcedSingle) return [forcedSingle];
107
- const fromList = parseKeyList(config.listVar ? process.env[config.listVar] : void 0);
108
- const primary = config.primaryVar ? process.env[config.primaryVar]?.trim() : void 0;
109
- const fromPrefixed = config.prefixedVar ? collectEnvPrefixedKeys(config.prefixedVar) : [];
110
- const fallback = config.fallbackVars.map((envVar) => process.env[envVar]?.trim()).filter(Boolean);
111
- const seen = /* @__PURE__ */ new Set();
112
- const add = (value) => {
113
- if (!value) return;
114
- if (seen.has(value)) return;
115
- seen.add(value);
116
- };
117
- for (const value of fromList) add(value);
118
- add(primary);
119
- for (const value of fromPrefixed) add(value);
120
- for (const value of fallback) add(value);
121
- return Array.from(seen);
122
- }
123
- function isApiKeyRateLimitError(message) {
124
- const lower = message.toLowerCase();
125
- if (lower.includes("rate_limit")) return true;
126
- if (lower.includes("rate limit")) return true;
127
- if (lower.includes("429")) return true;
128
- if (lower.includes("quota exceeded") || lower.includes("quota_exceeded")) return true;
129
- if (lower.includes("resource exhausted") || lower.includes("resource_exhausted")) return true;
130
- if (lower.includes("too many requests")) return true;
131
- return false;
132
- }
133
-
134
- //#endregion
135
- //#region src/agents/api-key-rotation.ts
136
- function dedupeApiKeys(raw) {
137
- const seen = /* @__PURE__ */ new Set();
138
- const keys = [];
139
- for (const value of raw) {
140
- const apiKey = value.trim();
141
- if (!apiKey || seen.has(apiKey)) continue;
142
- seen.add(apiKey);
143
- keys.push(apiKey);
144
- }
145
- return keys;
146
- }
147
- function collectProviderApiKeysForExecution(params) {
148
- const { primaryApiKey, provider } = params;
149
- return dedupeApiKeys([primaryApiKey?.trim() ?? "", ...collectProviderApiKeys(provider)]);
150
- }
151
- async function executeWithApiKeyRotation(params) {
152
- const keys = dedupeApiKeys(params.apiKeys);
153
- if (keys.length === 0) throw new Error(`No API keys configured for provider "${params.provider}".`);
154
- let lastError;
155
- for (let attempt = 0; attempt < keys.length; attempt += 1) {
156
- const apiKey = keys[attempt];
157
- try {
158
- return await params.execute(apiKey);
159
- } catch (error) {
160
- lastError = error;
161
- const message = formatErrorMessage(error);
162
- if (!(params.shouldRetry ? params.shouldRetry({
163
- apiKey,
164
- error,
165
- attempt,
166
- message
167
- }) : isApiKeyRateLimitError(message)) || attempt + 1 >= keys.length) break;
168
- params.onRetry?.({
169
- apiKey,
170
- error,
171
- attempt,
172
- message
173
- });
174
- }
175
- }
176
- if (lastError === void 0) throw new Error(`Failed to run API request for ${params.provider}.`);
177
- throw lastError;
178
- }
179
-
180
- //#endregion
181
- export { executeWithApiKeyRotation as n, parseGeminiAuth as r, collectProviderApiKeysForExecution as t };
@@ -1,69 +0,0 @@
1
- import "./run-with-concurrency-5DMu9szx.js";
2
- import "./accounts-D0W2pELU.js";
3
- import "./paths-8xF5kDne.js";
4
- import "./github-copilot-token-Dy-0-Kh3.js";
5
- import "./config-B2B64aX0.js";
6
- import { L as logVerbose, z as shouldLogVerbose } from "./logger-DDdrdbDu.js";
7
- import "./thinking-BgdUnMZ2.js";
8
- import "./image-ops-BP8ix1GC.js";
9
- import "./pi-embedded-helpers-BExwPvTh.js";
10
- import "./plugins-BN64HHZA.js";
11
- import "./accounts-ucj0odJq.js";
12
- import "./accounts-CUEuUR3C.js";
13
- import "./paths-C6W4VHoa.js";
14
- import "./redact-BoNEjbpF.js";
15
- import "./errors-B8oJXuCF.js";
16
- import "./path-alias-guards-gBhrAn14.js";
17
- import "./fs-safe-Dqmpk-Fr.js";
18
- import "./ssrf-DOBwjFow.js";
19
- import "./fetch-guard-F0Fnqisy.js";
20
- import "./local-roots-BIPT8uAO.js";
21
- import "./tool-images-GSlvf6RP.js";
22
- import { f as isAudioAttachment, i as normalizeMediaAttachments, o as resolveMediaAttachmentLocalRoots, t as runAudioTranscription } from "./audio-transcription-runner-DnEooIyE.js";
23
- import "./skills-BWwlfbVj.js";
24
- import "./chrome-CV-q0Lmc.js";
25
- import "./store-BKDR_-Qk.js";
26
- import "./image-cBW8L8pp.js";
27
- import "./api-key-rotation-C4C_mDsg.js";
28
- import "./proxy-fetch-ZPEvp58f.js";
29
-
30
- //#region src/media-understanding/audio-preflight.ts
31
- /**
32
- * Transcribes the first audio attachment BEFORE mention checking.
33
- * This allows voice notes to be processed in group chats with requireMention: true.
34
- * Returns the transcript or undefined if transcription fails or no audio is found.
35
- */
36
- async function transcribeFirstAudio(params) {
37
- const { ctx, cfg } = params;
38
- const audioConfig = cfg.tools?.media?.audio;
39
- if (!audioConfig || audioConfig.enabled === false) return;
40
- const attachments = normalizeMediaAttachments(ctx);
41
- if (!attachments || attachments.length === 0) return;
42
- const firstAudio = attachments.find((att) => att && isAudioAttachment(att) && !att.alreadyTranscribed);
43
- if (!firstAudio) return;
44
- if (shouldLogVerbose()) logVerbose(`audio-preflight: transcribing attachment ${firstAudio.index} for mention check`);
45
- try {
46
- const { transcript } = await runAudioTranscription({
47
- ctx,
48
- cfg,
49
- attachments,
50
- agentDir: params.agentDir,
51
- providers: params.providers,
52
- activeModel: params.activeModel,
53
- localPathRoots: resolveMediaAttachmentLocalRoots({
54
- cfg,
55
- ctx
56
- })
57
- });
58
- if (!transcript) return;
59
- firstAudio.alreadyTranscribed = true;
60
- if (shouldLogVerbose()) logVerbose(`audio-preflight: transcribed ${transcript.length} chars from attachment ${firstAudio.index}`);
61
- return transcript;
62
- } catch (err) {
63
- if (shouldLogVerbose()) logVerbose(`audio-preflight: transcription failed: ${String(err)}`);
64
- return;
65
- }
66
- }
67
-
68
- //#endregion
69
- export { transcribeFirstAudio };