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.
- package/dist/{agents-DL8uYsUq.js → agents-BOS_wASV.js} +4 -4
- package/dist/{agents.config-B4KAAVvR.js → agents.config-ChUZBohP.js} +1 -1
- package/dist/{agents.config-D93fF1eJ.js → agents.config-Dfsl4jNF.js} +1 -1
- package/dist/{audio-preflight-Bzo_zN4j.js → audio-preflight-lT9iRnYi.js} +4 -4
- package/dist/{audio-transcription-runner-Cp_lkLCv.js → audio-transcription-runner-YiR1ym3a.js} +1 -1
- package/dist/{auth-choice-Ba4AEm_k.js → auth-choice-B_pvWO2S.js} +1 -1
- package/dist/{auth-choice-ziFj5bXd.js → auth-choice-kUm2JAky.js} +1 -1
- package/dist/{banner-DDih2slD.js → banner-4LItBqCV.js} +1 -1
- package/dist/build-info.json +2 -2
- package/dist/bundled/boot-md/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-DTDfU0R6.js → channel-options-DA-4IR6h.js} +1 -1
- package/dist/{channel-options-BBSsevyl.js → channel-options-DQeQl3Rk.js} +1 -1
- package/dist/{channel-web-BXl9jCKV.js → channel-web--dAjVoio.js} +1 -1
- package/dist/{channel-web-SF18oYqo.js → channel-web-DJ21CAFF.js} +1 -1
- package/dist/{channels-cli-BDLabpWH.js → channels-cli-DviJtKuS.js} +6 -6
- package/dist/{channels-cli-BiuWJpJu.js → channels-cli-QvrLGt6C.js} +6 -6
- package/dist/{chrome-CZQnp4VH.js → chrome-CuBHInKC.js} +8 -8
- package/dist/{cli-CfgDCCuC.js → cli-aCubMdJg.js} +1 -1
- package/dist/{cli-DAZ1MKrJ.js → cli-q7seQ2Xx.js} +1 -1
- package/dist/{command-registry-DkjNuW8w.js → command-registry-C_YMaVul.js} +9 -9
- package/dist/{completion-cli-DbNma3J9.js → completion-cli-CyKEJDPO.js} +1 -1
- package/dist/{completion-cli-Du8H92bM.js → completion-cli-w4XQjhDI.js} +2 -2
- package/dist/{config-cli-D16tlTWa.js → config-cli-BfhjWCvB.js} +1 -1
- package/dist/{config-cli-CQhQ8Bcc.js → config-cli-BhQXEuBv.js} +1 -1
- package/dist/{configure-B4TiK50K.js → configure-0xkYrQ0e.js} +3 -3
- package/dist/{configure-B9b3cQTC.js → configure-Dsg_0ymU.js} +3 -3
- package/dist/{deliver-B4WWPQvt.js → deliver-6zfT7daI.js} +1 -1
- package/dist/{deliver-runtime-CeE1X9si.js → deliver-runtime-MBexxUuG.js} +3 -3
- package/dist/{deps-send-whatsapp.runtime-Cw7U9orE.js → deps-send-whatsapp.runtime-B7GC68Cu.js} +2 -2
- package/dist/{deps-send-whatsapp.runtime-CFnZsKW0.js → deps-send-whatsapp.runtime-BGDIgEzh.js} +3 -3
- package/dist/{deps-send-whatsapp.runtime-B9uivfkM.js → deps-send-whatsapp.runtime-BNAJe11S.js} +3 -3
- package/dist/{deps-send-whatsapp.runtime-miTfQkK9.js → deps-send-whatsapp.runtime-qBpqM2k9.js} +7 -7
- package/dist/{doctor-completion-CEiVFPte.js → doctor-completion-BCQdm02b.js} +1 -1
- package/dist/{doctor-completion-ujZ_JdIz.js → doctor-completion-BlkbgU5h.js} +1 -1
- package/dist/entry.js +2 -2
- package/dist/extensionAPI.js +6 -6
- package/dist/{gateway-cli-NXeo-J8r.js → gateway-cli-tFwyE4a3.js} +8 -8
- package/dist/{gateway-cli-2jaWM_Ci.js → gateway-cli-uWj08vdf.js} +8 -8
- package/dist/{health-BPZALM__.js → health-BwC4Qe5W.js} +1 -1
- package/dist/{health-DFZKMrW2.js → health-DS3reqch.js} +1 -1
- package/dist/{hooks-cli-B3rkhWcT.js → hooks-cli-oei5kRQM.js} +2 -2
- package/dist/{hooks-cli-BO_gZJVD.js → hooks-cli-tp5LchRL.js} +2 -2
- package/dist/{image-DKkuLtZ4.js → image-VgwN31FZ.js} +1 -1
- package/dist/{image-runtime-BMavqm9n.js → image-runtime-CwMuTYvd.js} +3 -3
- package/dist/index.js +6 -6
- package/dist/llm-slug-generator.js +1 -1
- package/dist/{models-Bb-GYqHr.js → models-D9X4EUlY.js} +2 -2
- package/dist/{models-cli-CAIJM1Wh.js → models-cli-C1PLBYF7.js} +2 -2
- package/dist/{models-cli-DffAz0ji.js → models-cli-LGp-Tok9.js} +3 -3
- package/dist/{npm-resolution-D2_zGJM-.js → npm-resolution-BUvQm-e-.js} +1 -1
- package/dist/{npm-resolution-D5pBCkUw.js → npm-resolution-Dtkh26DG.js} +1 -1
- package/dist/{onboard-dhG2YBez.js → onboard-B0padonr.js} +2 -2
- package/dist/{onboard-DcVsL9Jx.js → onboard-DDD6GX8E.js} +2 -2
- package/dist/{onboard-channels-mNXKTvFs.js → onboard-channels-9My16AOy.js} +1 -1
- package/dist/{onboard-channels-C-cQFUBH.js → onboard-channels-Bm_NXV3z.js} +1 -1
- package/dist/{onboarding-B3-IwkNi.js → onboarding-dES4q9RV.js} +3 -3
- package/dist/{onboarding-Cl6kW_iq.js → onboarding-o-id7p0-.js} +3 -3
- package/dist/{onboarding.finalize-BZqsNG2H.js → onboarding.finalize-BFtOLT7n.js} +6 -6
- package/dist/{onboarding.finalize-CCU-ykTR.js → onboarding.finalize-dpgNgUt5.js} +5 -5
- package/dist/{pi-embedded-C5U8Qxn6.js → pi-embedded-B_4NAHxA.js} +4 -40
- package/dist/{pi-embedded-B79nZERv.js → pi-embedded-BpHQIzjg.js} +24 -60
- package/dist/{pi-embedded-helpers-CEHpGDRs.js → pi-embedded-helpers-A9VYPVCH.js} +3 -3
- package/dist/{plugin-registry-CB47SSz1.js → plugin-registry-CCeUDvxY.js} +1 -1
- package/dist/{plugin-registry-Gy_VByyf.js → plugin-registry-CCkpP8-I.js} +1 -1
- package/dist/plugin-sdk/{channel-web-vB3Dcd8-.js → channel-web-BQE2gJ5U.js} +1 -1
- package/dist/plugin-sdk/{channel-web-BrhP6FQO.js → channel-web-BtNgAS1G.js} +1 -1
- package/dist/plugin-sdk/compat.js +50 -50
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-CuxKhIE0.js → deps-send-whatsapp.runtime-DPZSTh1j.js} +3 -3
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-Ce4Gzz-J.js → deps-send-whatsapp.runtime-V0Jfat5S.js} +3 -3
- package/dist/plugin-sdk/index.js +2 -2
- package/dist/plugin-sdk/mattermost.js +3 -3
- package/dist/plugin-sdk/nextcloud-talk.js +2 -2
- package/dist/plugin-sdk/{reply-DxvpiQBp.js → reply-DJYA4ZNu.js} +4 -40
- package/dist/plugin-sdk/{reply-sFKB3ofA.js → reply-DeKKmUDh.js} +4 -40
- package/dist/plugin-sdk/{slash-dispatch.runtime-C7u7mlny.js → slash-dispatch.runtime-E6j8gkO2.js} +1 -1
- package/dist/plugin-sdk/{slash-dispatch.runtime-Dyb_EkUt.js → slash-dispatch.runtime-k8xSVYOI.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-B6l6PxqP.js → subagent-registry-runtime-Cca50Qld.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-hdnabonI.js → subagent-registry-runtime-D6cTAG2k.js} +1 -1
- package/dist/plugin-sdk/{web-Bnn82S4u.js → web-Be4JS3z8.js} +2 -2
- package/dist/plugin-sdk/{web-D9LAdsuU.js → web-DkbCMgLG.js} +2 -2
- package/dist/plugin-sdk/whatsapp.js +2 -2
- package/dist/{plugins-cli-gtgkmDcv.js → plugins-cli-CZCadI9y.js} +2 -2
- package/dist/{plugins-cli-BYnoJwF1.js → plugins-cli-DFpHU_xo.js} +2 -2
- package/dist/{program-BGlgDpHI.js → program-B4_o5EDH.js} +7 -7
- package/dist/{program-context-M4FTWqqg.js → program-context-CkfdLtpp.js} +17 -17
- package/dist/{prompt-select-styled-AL5Tm3yO.js → prompt-select-styled-C1DFrYuk.js} +4 -4
- package/dist/{prompt-select-styled-BVC2byQV.js → prompt-select-styled-CZJJ2rPA.js} +4 -4
- package/dist/{provider-auth-helpers-DDgrFku5.js → provider-auth-helpers-BlYwNWkq.js} +1 -1
- package/dist/{provider-auth-helpers-Q7aIhDgv.js → provider-auth-helpers-C5taJG0R.js} +1 -1
- package/dist/{push-apns-FyGbUyh2.js → push-apns-Bhk1_5ut.js} +1 -1
- package/dist/{push-apns-Ga8xvhkh.js → push-apns-Dkjfalec.js} +1 -1
- package/dist/{pw-ai-Du22SYoO.js → pw-ai-CM87tQwG.js} +1 -1
- package/dist/{register.agent-zP8a-sNB.js → register.agent-DOp4lbyc.js} +7 -7
- package/dist/{register.agent-koAXw1ay.js → register.agent-s2PqcoIS.js} +6 -6
- package/dist/{register.configure-CYrmyjlf.js → register.configure-BGfourxZ.js} +7 -7
- package/dist/{register.configure-CUuP5J8W.js → register.configure-DABoMBBf.js} +7 -7
- package/dist/{register.maintenance-BZuEljPU.js → register.maintenance-Bdr3bSAF.js} +8 -8
- package/dist/{register.maintenance-ByEQ2CVH.js → register.maintenance-DmP8sVxb.js} +7 -7
- package/dist/{register.message-BkSXhv9I.js → register.message-DF0InVCv.js} +2 -2
- package/dist/{register.message-CgHfmDHm.js → register.message-gz8DaAc1.js} +2 -2
- package/dist/{register.onboard-HcQwPAEK.js → register.onboard-Do14cwDQ.js} +2 -2
- package/dist/{register.onboard-4ke40MNP.js → register.onboard-auVLfmF3.js} +2 -2
- package/dist/{register.setup-xAb7Cvzy.js → register.setup-B3aVuPyo.js} +2 -2
- package/dist/{register.setup-B41xZb1r.js → register.setup-ZyGJlYOD.js} +2 -2
- package/dist/{register.status-health-sessions-CcOVL0x8.js → register.status-health-sessions-C-1HE5oP.js} +3 -3
- package/dist/{register.status-health-sessions-BbHAAKwv.js → register.status-health-sessions-vFpvdVS1.js} +3 -3
- package/dist/{register.subclis-_uSASnfC.js → register.subclis-BYiAuTiK.js} +9 -9
- package/dist/{reply-BFTOdZcK.js → reply-BaVB3YlN.js} +4 -40
- package/dist/{run-main-C1eZrW-5.js → run-main-DW-JR8hB.js} +14 -14
- package/dist/{server-node-events-DbS1jJ5j.js → server-node-events-D-EmiDyc.js} +2 -2
- package/dist/{server-node-events-pYrJmi9w.js → server-node-events-rumcq7j0.js} +2 -2
- package/dist/{slash-dispatch.runtime-BGXbtMX6.js → slash-dispatch.runtime-BeltKAMm.js} +6 -6
- package/dist/{slash-dispatch.runtime-DqZVfX4H.js → slash-dispatch.runtime-C7rHRQFg.js} +1 -1
- package/dist/{slash-dispatch.runtime-DmFVOi3w.js → slash-dispatch.runtime-DPRwMKXk.js} +1 -1
- package/dist/{slash-dispatch.runtime-PX9_08Hm.js → slash-dispatch.runtime-sVHNrSL1.js} +1 -1
- package/dist/{status-DtiapFqq.js → status-BeSD1NDD.js} +2 -2
- package/dist/{status-B4eVRJcO.js → status-DGF_ROMC.js} +2 -2
- package/dist/{subagent-registry-Ctrhw4X-.js → subagent-registry-CgUBOyi3.js} +4 -40
- package/dist/{subagent-registry-runtime-Cy7dsGqF.js → subagent-registry-runtime-BYpjZwjA.js} +1 -1
- package/dist/{subagent-registry-runtime-BIKGAzgI.js → subagent-registry-runtime-Bm5UEB8c.js} +1 -1
- package/dist/{subagent-registry-runtime-CezPaX9P.js → subagent-registry-runtime-Bxc5DYZt.js} +6 -6
- package/dist/{subagent-registry-runtime-CTjx4TK5.js → subagent-registry-runtime-Cx5vPpG8.js} +1 -1
- package/dist/{update-cli-DLOWRdjv.js → update-cli-BSIF-OEa.js} +8 -8
- package/dist/{update-cli-_FsTRdQZ.js → update-cli-Duy8S3Bj.js} +7 -7
- package/dist/{update-runner-BY3l7ytB.js → update-runner-CMpruPN8.js} +1 -1
- package/dist/{update-runner-BKWHnVYI.js → update-runner-D_nDdx7d.js} +1 -1
- package/dist/{web-BNfDYvlW.js → web-Bnr4YuWJ.js} +2 -2
- package/dist/{web-BdZ3mX3p.js → web-C-5RPkV9.js} +2 -2
- package/dist/{web-1D0d1RHD.js → web-C0xcHURK.js} +1 -1
- package/dist/{web-B46aOGK0.js → web-CKY0tK0k.js} +6 -6
- package/package.json +1 -1
- package/dist/plugin-sdk/accounts-CUEuUR3C.js +0 -46
- package/dist/plugin-sdk/accounts-D0W2pELU.js +0 -288
- package/dist/plugin-sdk/accounts-ucj0odJq.js +0 -35
- package/dist/plugin-sdk/active-listener-BO7eBEG_.js +0 -50
- package/dist/plugin-sdk/agents/agent-tier.d.ts +0 -13
- package/dist/plugin-sdk/api-key-rotation-C4C_mDsg.js +0 -181
- package/dist/plugin-sdk/audio-preflight-Cqdo0JKm.js +0 -69
- package/dist/plugin-sdk/audio-transcription-runner-DnEooIyE.js +0 -2176
- package/dist/plugin-sdk/audit-membership-runtime-B9b-zRwg.js +0 -58
- package/dist/plugin-sdk/channel-activity-BMWLw4o2.js +0 -94
- package/dist/plugin-sdk/channel-web-D9WdAFlv.js +0 -2256
- package/dist/plugin-sdk/chrome-CV-q0Lmc.js +0 -2415
- package/dist/plugin-sdk/commands-registry-e7YoqrbP.js +0 -1125
- package/dist/plugin-sdk/config-B2B64aX0.js +0 -17911
- package/dist/plugin-sdk/deliver-BkyBtcLR.js +0 -1694
- package/dist/plugin-sdk/deliver-runtime-O4lwAWMw.js +0 -32
- package/dist/plugin-sdk/deps-send-discord.runtime-BAeeBldY.js +0 -23
- package/dist/plugin-sdk/deps-send-imessage.runtime-EL-CfikZ.js +0 -22
- package/dist/plugin-sdk/deps-send-signal.runtime-BeemHeUu.js +0 -21
- package/dist/plugin-sdk/deps-send-slack.runtime-DTttkC0N.js +0 -19
- package/dist/plugin-sdk/deps-send-telegram.runtime-Dsf9Cnka.js +0 -24
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-CCS71r77.js +0 -57
- package/dist/plugin-sdk/diagnostic-DPRVoKTk.js +0 -319
- package/dist/plugin-sdk/errors-B8oJXuCF.js +0 -54
- package/dist/plugin-sdk/fetch-guard-F0Fnqisy.js +0 -156
- package/dist/plugin-sdk/fs-safe-Dqmpk-Fr.js +0 -352
- package/dist/plugin-sdk/image-cBW8L8pp.js +0 -2310
- package/dist/plugin-sdk/image-ops-BP8ix1GC.js +0 -584
- package/dist/plugin-sdk/image-runtime-9xkgSlNz.js +0 -25
- package/dist/plugin-sdk/ir-DWEc6zOp.js +0 -1296
- package/dist/plugin-sdk/local-roots-BIPT8uAO.js +0 -186
- package/dist/plugin-sdk/logger-DDdrdbDu.js +0 -1163
- package/dist/plugin-sdk/login-BMTiGutN.js +0 -57
- package/dist/plugin-sdk/login-qr-BFxqYUkc.js +0 -320
- package/dist/plugin-sdk/manager-BD-aYaZ8.js +0 -3917
- package/dist/plugin-sdk/manager-runtime-C5bRwUlz.js +0 -15
- package/dist/plugin-sdk/outbound-Bm07xvO6.js +0 -212
- package/dist/plugin-sdk/outbound-attachment-DLsaxDsc.js +0 -19
- package/dist/plugin-sdk/path-alias-guards-gBhrAn14.js +0 -43
- package/dist/plugin-sdk/paths-C6W4VHoa.js +0 -166
- package/dist/plugin-sdk/pi-embedded-helpers-BExwPvTh.js +0 -9627
- package/dist/plugin-sdk/pi-model-discovery-DdctvBeX.js +0 -134
- package/dist/plugin-sdk/pi-model-discovery-runtime-DrtpLJjk.js +0 -8
- package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-rgTz3FBl.js +0 -354
- package/dist/plugin-sdk/plugins-BN64HHZA.js +0 -864
- package/dist/plugin-sdk/proxy-fetch-ZPEvp58f.js +0 -38
- package/dist/plugin-sdk/pw-ai-DBm3RdBK.js +0 -1938
- package/dist/plugin-sdk/qmd-manager-6bozlfFg.js +0 -1448
- package/dist/plugin-sdk/query-expansion-eeVz_aEm.js +0 -1011
- package/dist/plugin-sdk/redact-BoNEjbpF.js +0 -319
- package/dist/plugin-sdk/reply-CqXMy3Yd.js +0 -98731
- package/dist/plugin-sdk/resolve-outbound-target-DXfjGlZQ.js +0 -40
- package/dist/plugin-sdk/run-with-concurrency-5DMu9szx.js +0 -1994
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-D2hkJBa-.js +0 -10
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-C06I4adi.js +0 -19
- package/dist/plugin-sdk/send-B9xnwtQ-.js +0 -540
- package/dist/plugin-sdk/send-BxySs-Cu.js +0 -2587
- package/dist/plugin-sdk/send-D9THKp_J.js +0 -414
- package/dist/plugin-sdk/send-DCuaaP2w.js +0 -503
- package/dist/plugin-sdk/send-Dm_-_xje.js +0 -3135
- package/dist/plugin-sdk/session-DDzIZHxt.js +0 -169
- package/dist/plugin-sdk/skill-commands-DRvqtuFC.js +0 -342
- package/dist/plugin-sdk/skills-BWwlfbVj.js +0 -1428
- package/dist/plugin-sdk/slash-commands.runtime-BzYsaTST.js +0 -13
- package/dist/plugin-sdk/slash-dispatch.runtime-BC3IAF-I.js +0 -52
- package/dist/plugin-sdk/slash-skill-commands.runtime-sg98L8BK.js +0 -16
- package/dist/plugin-sdk/ssrf-DOBwjFow.js +0 -202
- package/dist/plugin-sdk/store-BKDR_-Qk.js +0 -81
- package/dist/plugin-sdk/subagent-registry-runtime-Ceu7AzWi.js +0 -52
- package/dist/plugin-sdk/tables-GIj79us5.js +0 -55
- package/dist/plugin-sdk/target-errors-jlLHihbX.js +0 -195
- package/dist/plugin-sdk/thinking-BgdUnMZ2.js +0 -1206
- package/dist/plugin-sdk/tokens-CTIYTLWu.js +0 -52
- package/dist/plugin-sdk/tool-images-GSlvf6RP.js +0 -274
- package/dist/plugin-sdk/web-BK2-uaOo.js +0 -56
- 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 };
|