sliccy 5.73.3 → 5.73.4
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/ui/assets/account-store-DwSzwLW8.js +43 -0
- package/dist/ui/assets/account-store-DzwZMcTg.js +101 -0
- package/dist/ui/assets/{adobe-ufabHIuG.js → adobe-ChyPg00A.js} +1 -1
- package/dist/ui/assets/{adobe-lCsH7Lwq.js → adobe-h2gWq2z2.js} +1 -1
- package/dist/ui/assets/anthropic-messages-BFic5zKY.js +39 -0
- package/dist/ui/assets/anthropic-messages-C8dDJE2X.js +39 -0
- package/dist/ui/assets/{apps-Cz0oexXD.js → apps-C86xnKLs.js} +1 -1
- package/dist/ui/assets/{azure-openai-CMEdXGgc.js → azure-openai-CjkdyGG4.js} +1 -1
- package/dist/ui/assets/{azure-openai-DjIwn0QF.js → azure-openai-DMNa-Eup.js} +1 -1
- package/dist/ui/assets/azure-openai-responses-B_twhN44.js +1 -0
- package/dist/ui/assets/azure-openai-responses-CzG7X9qb.js +1 -0
- package/dist/ui/assets/bedrock-camp-BO4bvAKs.js +1 -0
- package/dist/ui/assets/{bedrock-camp-PMQ4Iu6f.js → bedrock-camp-CVignIdH.js} +1 -1
- package/dist/ui/assets/{cerebras-VrdMK4Tc.js → cerebras-B0gvSD27.js} +1 -1
- package/dist/ui/assets/{cerebras-BvFtCskg.js → cerebras-CvSC_Q2O.js} +1 -1
- package/dist/ui/assets/compat-aVSWLlYQ.js +2 -0
- package/dist/ui/assets/{connect-surface-ETqeSANr.js → connect-surface-3UvT0SF3.js} +1 -1
- package/dist/ui/assets/constrained-sampling-DafcjXU6.js +1 -0
- package/dist/ui/assets/{context-compaction-CW5AQ9bv.js → context-compaction-_UkD06XB.js} +1 -1
- package/dist/ui/assets/{fs-CgX9Ebib.js → fs-DC3MEAD4.js} +2 -2
- package/dist/ui/assets/{fs-C5GhaBCZ.js → fs-DgMOH-Zj.js} +1 -1
- package/dist/ui/assets/{github-DMFLbpJz.js → github-HKW-k0Oh.js} +1 -1
- package/dist/ui/assets/{github-copilot-CXnNPGCI.js → github-copilot-C7lsRXxS.js} +1 -1
- package/dist/ui/assets/{github-copilot-kOORCU_n.js → github-copilot-CBv0T4_S.js} +1 -1
- package/dist/ui/assets/{github-B85TuvhV.js → github-mH266f8L.js} +2 -2
- package/dist/ui/assets/google-generative-ai-4YtIu_sJ.js +1 -0
- package/dist/ui/assets/google-generative-ai-DzD1vsXe.js +1 -0
- package/dist/ui/assets/google-shared-BAKd3aSn.js +371 -0
- package/dist/ui/assets/google-shared-CCLlnqMF.js +11 -0
- package/dist/ui/assets/google-vertex-8lUayXF0.js +1 -0
- package/dist/ui/assets/google-vertex-oQOD3HKr.js +1 -0
- package/dist/ui/assets/{kernel-worker-HuBcjkoV.js → kernel-worker-CHs5yDJo.js} +587 -589
- package/dist/ui/assets/{legacy-api-aliases-CRTuRAqQ.js → legacy-api-aliases-IllWZ-uu.js} +1 -1
- package/dist/ui/assets/{legacy-api-aliases-CdGTJw-r.js → legacy-api-aliases-sqlB2uHc.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-BX-cBxCM.js → lick-ws-bridge-DbbdXQSp.js} +1 -1
- package/dist/ui/assets/{local-llm-DuNuGkgI.js → local-llm-DcKgaorK.js} +2 -2
- package/dist/ui/assets/{local-llm-qHC_HYck.js → local-llm-DpBDM1Dm.js} +1 -1
- package/dist/ui/assets/{main-BwSf9XOe.js → main-CBUfGcTh.js} +3 -3
- package/dist/ui/assets/mistral-conversations-C57IiFrP.js +8 -0
- package/dist/ui/assets/mistral-conversations-CzEm7KNl.js +7 -0
- package/dist/ui/assets/{mount-Dh0O4orp.js → mount-BHqxxbwU.js} +1 -1
- package/dist/ui/assets/{mount-CpyDRxP6.js → mount-BRSg0FIY.js} +2 -2
- package/dist/ui/assets/{mount-recovery-D687TLZv.js → mount-recovery-Beig7gzz.js} +1 -1
- package/dist/ui/assets/{new-session-EfIhjpHZ.js → new-session-UPnjrqyz.js} +2 -2
- package/dist/ui/assets/oauth-bootstrap-DUaR-il_.js +2 -0
- package/dist/ui/assets/{openai-codex-jK5ybbFx.js → openai-codex-CZit4W_R.js} +1 -1
- package/dist/ui/assets/openai-codex-D0W343kX.js +1 -0
- package/dist/ui/assets/openai-codex-responses-DRR6raXn.js +7 -0
- package/dist/ui/assets/openai-codex-responses-DU5CHdDQ.js +7 -0
- package/dist/ui/assets/openai-completions-B9S6450Q.js +5 -0
- package/dist/ui/assets/openai-completions-DhKgaAgM.js +5 -0
- package/dist/ui/assets/openai-responses-C4_jiYtu.js +1 -0
- package/dist/ui/assets/openai-responses-DmKhLxzV.js +1 -0
- package/dist/ui/assets/openai-responses-shared-CiIL52L-.js +10 -0
- package/dist/ui/assets/openai-responses-shared-IJFiSqdz.js +10 -0
- package/dist/ui/assets/{openrouter-DVFBhELg.js → openrouter-D4iz9RSI.js} +1 -1
- package/dist/ui/assets/{openrouter-C_pGnoz1.js → openrouter-XorTuzAh.js} +1 -1
- package/dist/ui/assets/openrouter-images-6_MxZkJZ.js +1 -0
- package/dist/ui/assets/openrouter-images-BixC5B6a.js +1 -0
- package/dist/ui/assets/{openrouter-models-DM9v24kQ.js → openrouter-models-Bu1Cy5AD.js} +1 -1
- package/dist/ui/assets/{openrouter-models-B8MWxzTa.js → openrouter-models-CfnkMx5-.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DdKdfU0P.js → openrouter-oauth-BGOdgzqm.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-CukjxICV.js → openrouter-oauth-BLGBWXoP.js} +1 -1
- package/dist/ui/assets/openrouter.models-DS1_VkCm.js +1 -0
- package/dist/ui/assets/openrouter.models-HnnH-abS.js +1 -0
- package/dist/ui/assets/{panel-rpc-handlers-UyWgyt3z.js → panel-rpc-handlers-BPMsj1iE.js} +2 -2
- package/dist/ui/assets/{provider-C-y-cI9Y.js → provider-DZ7x1aM4.js} +1 -1
- package/dist/ui/assets/{provider-B4WqwJf8.js → provider-YxK-lzhm.js} +2 -2
- package/dist/ui/assets/provider-retry-C8PJzY_l.js +1 -0
- package/dist/ui/assets/{provider-settings-C5o54NBg.js → provider-settings-CmJnFmK2.js} +1 -1
- package/dist/ui/assets/provider-settings-D6FC6-Ws.js +2 -0
- package/dist/ui/assets/{provider-store-access-B-0tnW1p.js → provider-store-access-Bqa_EvEK.js} +2 -2
- package/dist/ui/assets/provider-store-access-Dw2dlNIf.js +1 -0
- package/dist/ui/assets/{providers-BVNM94x0.js → providers-7r6dA4ra.js} +1 -1
- package/dist/ui/assets/{providers-BZHUuJkX.js → providers-Bklgdp4G.js} +2 -2
- package/dist/ui/assets/quick-llm-BHegEzYY.js +1 -0
- package/dist/ui/assets/{session-freezer-CVXiE5lj.js → session-freezer-oYKtZTY0.js} +3 -3
- package/dist/ui/assets/{setup-sudo-C8hl5UHa.js → setup-sudo-DGrMEyR3.js} +2 -2
- package/dist/ui/assets/{skills-XOQZdId1.js → skills-DkHenAsV.js} +1 -1
- package/dist/ui/assets/{store-BifrdU3S.js → store-DICK08O4.js} +1 -1
- package/dist/ui/assets/{sudo-CdCTvp3_.js → sudo-9mYhdwPD.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-B3uBpES8.js → upgrade-detection-B8LfSgMb.js} +1 -1
- package/dist/ui/assets/{wc-extension-Dnbc6pqX.js → wc-extension-grYSDyJN.js} +2 -2
- package/dist/ui/assets/{wc-follower-DgOR4hQ4.js → wc-follower-B6JesvuH.js} +3 -3
- package/dist/ui/assets/{wc-live-DZ6Z4ggE.js → wc-live-OHBNpb_A.js} +3 -3
- package/dist/ui/assets/{wc-nav-CpXNlZRT.js → wc-nav-DcxqwpAS.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-DMsV9vuN.js → wc-onboarding-t5pRxVjL.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-CNOsszW8.js → wc-placeholder-XW-qi_GD.js} +2 -2
- package/dist/ui/assets/{wc-settings-QlugO7SB.js → wc-settings-7Jj2UM15.js} +2 -2
- package/dist/ui/assets/{wc-shell-DZD-3K-u.js → wc-shell-CoYCAmK-.js} +2 -2
- package/dist/ui/assets/{wc-sprinkles-D38PuO87.js → wc-sprinkles-CFaUt2sb.js} +2 -2
- package/dist/ui/assets/{wc-tray-MAH8ntv2.js → wc-tray-C_yJiqov.js} +2 -2
- package/dist/ui/assets/xai-grok-CrEqywR8.js +1 -0
- package/dist/ui/assets/{xai-grok-BujeRcN4.js → xai-grok-QulUPZS-.js} +1 -1
- package/dist/ui/index.html +10 -10
- package/dist/ui/packages/webapp/index.html +10 -10
- package/package.json +1 -1
- package/dist/ui/assets/account-store-Dz-pna2J.js +0 -38
- package/dist/ui/assets/account-store-yyyfGfoQ.js +0 -94
- package/dist/ui/assets/amazon-bedrock-Cg62P8pR.json +0 -1
- package/dist/ui/assets/anthropic-4_qTN2Mu.json +0 -1
- package/dist/ui/assets/anthropic-messages-6XWFkWWy.js +0 -39
- package/dist/ui/assets/anthropic-messages-D42B1WVl.js +0 -39
- package/dist/ui/assets/azure-openai-responses-BvEv9lZE.js +0 -1
- package/dist/ui/assets/azure-openai-responses-DE9sINqp.json +0 -1
- package/dist/ui/assets/azure-openai-responses-DRSA640t.js +0 -1
- package/dist/ui/assets/bedrock-camp-D_7EbOFH.js +0 -1
- package/dist/ui/assets/cloudflare-ai-gateway-DDb7hKDm.json +0 -1
- package/dist/ui/assets/cloudflare-workers-ai-hYVOS3es.json +0 -1
- package/dist/ui/assets/compat-Spvv5tCW.js +0 -2
- package/dist/ui/assets/fireworks-B7kEGNCU.json +0 -1
- package/dist/ui/assets/github-copilot-K9C_HNHm.json +0 -1
- package/dist/ui/assets/google-F4XgvJ1y.json +0 -1
- package/dist/ui/assets/google-generative-ai-BqEHWDKc.js +0 -1
- package/dist/ui/assets/google-generative-ai-DOAY2Bef.js +0 -1
- package/dist/ui/assets/google-shared-2WQG4pNx.js +0 -11
- package/dist/ui/assets/google-shared-CGD-JGZx.js +0 -371
- package/dist/ui/assets/google-vertex-C-dQj0iH.js +0 -1
- package/dist/ui/assets/google-vertex-CiTExP0E.js +0 -1
- package/dist/ui/assets/huggingface-BjNadu0v.json +0 -1
- package/dist/ui/assets/mistral-CLEcIOtP.json +0 -1
- package/dist/ui/assets/mistral-conversations-BIHTMTfL.js +0 -7
- package/dist/ui/assets/mistral-conversations-CFKNSaPt.js +0 -8
- package/dist/ui/assets/moonshotai-8QShYhhE.json +0 -1
- package/dist/ui/assets/moonshotai-cn-7hHZff5z.json +0 -1
- package/dist/ui/assets/nvidia-dA6GzUPm.json +0 -1
- package/dist/ui/assets/oauth-bootstrap-DFYztLmR.js +0 -2
- package/dist/ui/assets/openai-BehvdaXx.json +0 -1
- package/dist/ui/assets/openai-codex-XS4icMCX.js +0 -1
- package/dist/ui/assets/openai-codex-responses-B7cFMjWk.js +0 -7
- package/dist/ui/assets/openai-codex-responses-DqxoDEwc.js +0 -7
- package/dist/ui/assets/openai-completions-Z1aRkqWe.js +0 -5
- package/dist/ui/assets/openai-completions-o78dOizF.js +0 -5
- package/dist/ui/assets/openai-responses-SPfzkTJm.js +0 -1
- package/dist/ui/assets/openai-responses-shared-BHsJFKuB.js +0 -10
- package/dist/ui/assets/openai-responses-shared-Dg5Ojqlw.js +0 -10
- package/dist/ui/assets/openai-responses-xSdsW9lw.js +0 -1
- package/dist/ui/assets/opencode-4chvZrBR.json +0 -1
- package/dist/ui/assets/opencode-go-Chp1OOUx.json +0 -1
- package/dist/ui/assets/openrouter-ZLTwKIjA.json +0 -1
- package/dist/ui/assets/openrouter-images-BrQDTa3_.js +0 -1
- package/dist/ui/assets/openrouter-images-DtvjLeGK.js +0 -1
- package/dist/ui/assets/openrouter.models-Bi9GV7Zn.js +0 -1
- package/dist/ui/assets/openrouter.models-D41M1z_D.js +0 -1
- package/dist/ui/assets/provider-settings-Bf4riFFt.js +0 -2
- package/dist/ui/assets/provider-store-access-DQ3Xz22u.js +0 -1
- package/dist/ui/assets/quick-llm-CTddYx3-.js +0 -1
- package/dist/ui/assets/qwen-token-plan-BpxmzamU.json +0 -1
- package/dist/ui/assets/qwen-token-plan-cn-CPhDR0u_.json +0 -1
- package/dist/ui/assets/together-CYZ-lBBF.json +0 -1
- package/dist/ui/assets/vercel-ai-gateway-ZtkcQH_C.json +0 -1
- package/dist/ui/assets/xai-grok-CgCHECRn.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/fs-
|
|
2
|
-
import{t as
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/fs-DC3MEAD4.js","assets/preload-helper-Czpn1I53.js","assets/logger-DDBAeTLF.js","assets/types-idfTVsM8.js","assets/backend-local-smcj-_Ox.js","assets/tool-ui-DfXu6quJ.js","assets/picker-approval-CdWaB1mR.js","assets/mount-picker-popup-Bs1o43Z5.js","assets/rolldown-runtime-aKtaBQYM.js","assets/picker-popup-BvzmBsGL.js","assets/runtime-env-DH4NDw4t.js","assets/mount-table-store-CfQUN_2R.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{R as e,S as t,d as n}from"./account-store-DwSzwLW8.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{i}from"./proxied-fetch-D5h5REZy.js";import{r as a,t as o}from"./tray-runtime-config-DquE2Rx9.js";import"./provider-settings-D6FC6-Ws.js";import{r as s,t as c}from"./silent-renew-backoff-Dzkpjjro.js";import{getOAuthPageOrigin as l}from"./oauth-service-lE9AyywH.js";import{t as u}from"./global-db-CbuLl-zx.js";var d={clientId:``,scopes:`repo,read:user,user:email`};function f(){try{let e=localStorage.getItem(a);if(e)return e.replace(/\/$/,``)}catch{}return o}async function p(e){let t;try{t=await e.json()}catch{throw Error(`Token exchange failed (HTTP ${e.status}): non-JSON response`)}if(!e.ok&&e.status!==200){let n=t.error_description??t.error??`Token exchange failed (HTTP ${e.status})`;throw Error(n)}if(t.error){let e=t.error_description??t.error;throw Error(e)}return t}async function m(e){let t=`${f()}/oauth/token`;return p(await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,code:e.code,redirect_uri:e.redirectUri})}))}async function h(e){let t=`${f()}/oauth/token`;return p(await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,refresh_token:e.refreshToken})}))}async function g(e){let t=`${f()}/oauth/revoke`,n=await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,access_token:e.accessToken})});if(!(n.status===204||n.ok)){if(n.status===400)try{if((await n.json()).error===`unsupported`)return}catch{}throw Error(`Token revocation failed (HTTP ${n.status})`)}}var _=Object.assign({"/packages/webapp/providers/github-config.json":d})[`/packages/webapp/providers/github-config.json`]??{clientId:``,scopes:`repo,read:user,user:email`},v=null,y=null;function b(e){let{isExtension:t,isConnectMode:n,workerBaseUrl:r,pageOrigin:i,pageHref:a,bridgeApiBaseUrl:o,extensionId:c,nonce:l}=e;if(t)return{redirectUri:`${r}/auth/callback`,state:{source:`extension`,extensionId:c,path:`/github`,nonce:l}};if(n){let e=i??``;if(/^https?:\/\/(localhost|127\.0\.0\.1):\d+$/.test(e)){let t=parseInt(new URL(a??e).port||`8790`,10);return{redirectUri:`${r}/auth/callback`,state:{source:`local`,port:t,path:`/auth/callback`,nonce:l}}}return{redirectUri:`${r}/auth/callback`,state:{source:`remote`,origin:e,path:`/auth/callback`,nonce:l}}}if(o&&a&&s(a)){let t=null;try{let e=new URL(o);(e.hostname===`localhost`||e.hostname===`127.0.0.1`)&&(t=parseInt(e.port||`5710`,10))}catch{t=null}if(t!==null&&!Number.isNaN(t))return{redirectUri:`${e.runtimeWorkerBaseUrl??r}/auth/callback`,state:{source:`local`,port:t,path:`/auth/callback`,nonce:l}}}return{redirectUri:`${e.runtimeWorkerBaseUrl??i??``}/auth/callback`,state:{port:parseInt(new URL(a??i??`http://localhost:5710`).port||`5710`,10),path:`/auth/callback`,nonce:l}}}async function x(){if(v)return v;if(S){try{let e=await fetch(`${f()}/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return v=t.oauth.github,v}}catch{}return _.clientId}try{let e=await fetch(`/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return v=t.oauth.github,t.trayWorkerBaseUrl&&(y=t.trayWorkerBaseUrl),v;if(t.trayWorkerBaseUrl){y=t.trayWorkerBaseUrl;let e=await fetch(`${t.trayWorkerBaseUrl}/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return v=t.oauth.github,v}}}}catch{}return _.clientId}var S=typeof globalThis<`u`&&typeof globalThis.chrome?.runtime?.id==`string`;function C(){return n().find(e=>e.providerId===`github`)}function w(e){try{return new URL(e).searchParams.get(`code`)}catch{return null}}async function T(e){try{let t=await fetch(`https://api.github.com/user`,{headers:{Authorization:`Bearer ${e}`,Accept:`application/vnd.github+json`}});if(t.ok){let e=await t.json();return{name:e.name||e.login,avatar:e.avatar_url,login:e.login,id:e.id}}}catch(e){console.warn(`[github] Failed to fetch user profile:`,e instanceof Error?e.message:String(e))}return{}}function E(e,t){return`${e}+${t}@users.noreply.github.com`}async function D(e){try{let{VirtualFS:t}=await r(async()=>{let{VirtualFS:e}=await import(`./fs-DC3MEAD4.js`);return{VirtualFS:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));await(await t.create({dbName:u})).writeFile(`/workspace/.git/github-token`,e),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`github-token-changed`))}catch(e){console.warn(`[github] Failed to write git token:`,e instanceof Error?e.message:String(e))}}async function O(){try{let{VirtualFS:e}=await r(async()=>{let{VirtualFS:e}=await import(`./fs-DC3MEAD4.js`);return{VirtualFS:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));await(await e.create({dbName:u})).rm(`/workspace/.git/github-token`),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`github-token-changed`))}catch{}}async function k(e){if(!(!e.login||e.id===void 0))try{let{VirtualFS:t}=await r(async()=>{let{VirtualFS:e}=await import(`./fs-DC3MEAD4.js`);return{VirtualFS:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),{readGlobalGitConfigValue:n,writeGlobalGitConfigValue:i}=await r(async()=>{let{readGlobalGitConfigValue:e,writeGlobalGitConfigValue:t}=await import(`./git-config-DLJIrKjL.js`);return{readGlobalGitConfigValue:e,writeGlobalGitConfigValue:t}},[]),a=await t.create({dbName:u}),o=e.name||e.login,s=E(e.id,e.login);!await n(a,`user.name`)&&o&&await i(a,`user.name`,o),await n(a,`user.email`)||await i(a,`user.email`,s)}catch(e){console.warn(`[github] Failed to seed git identity:`,e instanceof Error?e.message:String(e))}}var A=c();async function j(){try{let n=C();if(!n?.refreshToken)return null;let r=await h({provider:`github`,refreshToken:n.refreshToken});await e({providerId:`github`,accessToken:r.access_token,refreshToken:r.refresh_token,tokenExpiresAt:r.expires_in?Date.now()+r.expires_in*1e3:void 0,userName:n.userName,userAvatar:n.userAvatar});let i=t(`github`)?.maskedValue;return i?await D(i):await O(),r.access_token}catch(e){return console.warn(`[github] Silent renewal failed:`,e instanceof Error?e.message:String(e)),null}}async function M(){let e=C();if(!e?.accessToken)throw Error(`Not logged in to GitHub — please log in first`);if((e.tokenExpiresAt??1/0)-Date.now()>6e4)return e.accessToken;let t=await A.run(()=>j());if(t)return t;let n=C();if((n?.tokenExpiresAt??1/0)-Date.now()>0&&n?.accessToken)return n.accessToken;throw Error(`GitHub session expired — please log in again`)}var N={id:`github`,name:`GitHub`,description:"Sign in with GitHub for git authentication (push/pull/clone) and the `oauth-token github` shell command. Does not expose LLM models — use the GitHub Copilot provider for those.",requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,oauthTokenDomains:[`github.com`,`*.github.com`,`api.github.com`,`raw.githubusercontent.com`],getModelIds:()=>[],onOAuthLogin:async(n,r,a)=>{let o=await x();if(!o)throw Error(`GitHub OAuth not configured — no client ID available`);let s=a?.scopes??_.scopes,c=S?null:await l(),u=crypto.randomUUID(),d=S?chrome.runtime.id:``,{redirectUri:p,state:h}=b({isExtension:S,isConnectMode:!!globalThis.__slicc_connect_mode,workerBaseUrl:f(),runtimeWorkerBaseUrl:y,pageOrigin:c?.origin??null,pageHref:c?.href??null,bridgeApiBaseUrl:i(),extensionId:d,nonce:u}),g=btoa(JSON.stringify(h)),v=u,C=new URLSearchParams({client_id:o,scope:s,redirect_uri:p});g&&C.set(`state`,g);let E=await n(`https://github.com/login/oauth/authorize?${C}`);if(!E)return;if(v)try{if(new URL(E).searchParams.get(`nonce`)!==v){console.error(`[github] OAuth nonce mismatch — possible CSRF`);return}}catch(e){console.warn(`[github] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}let A=w(E);if(!A){console.error(`[github] Could not extract authorization code from redirect URL`);return}let j=await m({provider:`github`,code:A,redirectUri:p}),M=await T(j.access_token);await e({providerId:`github`,accessToken:j.access_token,refreshToken:j.refresh_token,tokenExpiresAt:j.expires_in?Date.now()+j.expires_in*1e3:void 0,userName:M.name,userAvatar:M.avatar});let N=t(`github`)?.maskedValue;N?await D(N):await O(),await k(M),r()},onSilentRenew:j,getValidAccessToken:M,onOAuthLogout:async()=>{let t=C();t?.accessToken&&await g({provider:`github`,accessToken:t.accessToken}).catch(e=>console.warn(`[github] Token revocation failed:`,e instanceof Error?e.message:String(e))),await O(),await e({providerId:`github`,accessToken:``})},getOAuthLogoutUrl:e=>`https://github.com/logout`};export{E as buildNoreplyEmail,N as config,w as extractCodeFromUrl,M as getValidAccessToken,b as resolveGithubOAuthRedirect,k as syncGitIdentityFromGitHub};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./event-stream-qbAZIAKV.js";import{n as t,t as n}from"./models-Bnh9VDA1.js";import{r}from"./transform-messages-wECJwtH0.js";import{n as i}from"./headers-CbDaTl3c.js";import{t as a}from"./sanitize-unicode-DmIE6hZJ.js";import{n as o,t as s}from"./error-body-C0EnfbdK.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./google-shared-CCLlnqMF.js";var g=0,_=(t,r,i)=>{let a=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-generative-ai`,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=i?.apiKey;if(!o)throw Error(`No API key for provider: ${t.provider}`);let s=y(t,o,i?.headers),c=b(t,r,i),l=await i?.onPayload?.(c,t);l!==void 0&&(c=l);let d=await s.models.generateContentStream(c);a.push({type:`start`,partial:e});let m=null,h=e.content,_=()=>h.length-1;for await(let r of d){e.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=p(t);(!m||n&&m.type!==`thinking`||!n&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:h.length-1,content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:e})):(m={type:`text`,text:``},e.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:e}))),m.type===`thinking`?(m.thinking+=t.text,m.thinkingSignature=f(m.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:t.text,partial:e})):(m.text+=t.text,m.textSignature=f(m.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:t.text,partial:e}))}if(t.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++g}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:_(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:_(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=u(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),r.usageMetadata&&(e.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:r.usageMetadata.thoughtsTokenCount||0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},n(t,e.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:e.stopReason,message:e}),a.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=i?.signal?.aborted?`aborted`:`error`,e.errorMessage=s(o(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},v=(e,n,i)=>{let a=i?.apiKey;if(!a)throw Error(`No API key for provider: ${e.provider}`);let o=r(e,n,i,a);if(!i?.reasoning)return _(e,n,{...o,thinking:{enabled:!1}});let s=t(e,i.reasoning),c=s===`off`?`high`:s,l=e;return S(l)||C(l)||x(l)?_(e,n,{...o,thinking:{enabled:!0,level:T(c,l)}}):_(e,n,{...o,thinking:{enabled:!0,budgetTokens:E(l,c,i.thinkingBudgets)}})};function y(e,t,n){let r={};e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``);let a=i({...e.headers,...n});return a&&(r.headers=a),new l({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function b(e,t,n={}){let r=h(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let o=t.tools?.length?c(t.tools,n.toolChoice,m(e.id)):void 0,s={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:d(t.tools)},...o!==void 0&&{toolConfig:{functionCallingConfig:{mode:o}}}};if(n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=n.thinking.level,s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=w(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);s.abortSignal=n.signal}return{model:e.id,contents:r,config:s}}function x(e){return/gemma-?4/.test(e.id.toLowerCase())}function S(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function C(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function w(e){return S(e)?{thinkingLevel:`LOW`}:C(e)||x(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function T(e,t){if(S(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(x(t))switch(e){case`minimal`:case`low`:return`MINIMAL`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function E(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{_ as stream,v as streamSimple};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./event-stream-qbAZIAKV.js";import{o as t,r as n,s as r}from"./transform-messages-Bp94o3FD.js";import{n as i}from"./headers-CbDaTl3c.js";import{t as a}from"./sanitize-unicode-DmIE6hZJ.js";import{n as o,t as s}from"./error-body-C0EnfbdK.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./google-shared-BAKd3aSn.js";let g=0;const _=(n,r,i)=>{let a=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-generative-ai`,provider:n.provider,model:n.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=i?.apiKey;if(!o)throw Error(`No API key for provider: ${n.provider}`);let s=y(n,o,i?.headers),c=b(n,r,i),l=await i?.onPayload?.(c,n);l!==void 0&&(c=l);let d=await s.models.generateContentStream(c);a.push({type:`start`,partial:e});let m=null,h=e.content,_=()=>h.length-1;for await(let r of d){e.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=p(t);(!m||n&&m.type!==`thinking`||!n&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:h.length-1,content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:e})):(m={type:`text`,text:``},e.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:e}))),m.type===`thinking`?(m.thinking+=t.text,m.thinkingSignature=f(m.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:t.text,partial:e})):(m.text+=t.text,m.textSignature=f(m.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:t.text,partial:e}))}if(t.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++g}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:_(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:_(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=u(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),r.usageMetadata&&(e.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:r.usageMetadata.thoughtsTokenCount||0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},t(n,e.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:e.stopReason,message:e}),a.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=i?.signal?.aborted?`aborted`:`error`,e.errorMessage=s(o(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},v=(e,t,i)=>{let a=i?.apiKey;if(!a)throw Error(`No API key for provider: ${e.provider}`);let o=n(e,t,i,a);if(!i?.reasoning)return _(e,t,{...o,thinking:{enabled:!1}});let s=r(e,i.reasoning),c=s===`off`?`high`:s,l=e;return S(l)||C(l)||x(l)?_(e,t,{...o,thinking:{enabled:!0,level:T(c,l)}}):_(e,t,{...o,thinking:{enabled:!0,budgetTokens:E(l,c,i.thinkingBudgets)}})};function y(e,t,n){let r={};e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``);let a=i({...e.headers,...n});return a&&(r.headers=a),new l({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function b(e,t,n={}){let r=h(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let o=t.tools?.length?c(t.tools,n.toolChoice,m(e.id)):void 0,s={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:d(t.tools)},...o!==void 0&&{toolConfig:{functionCallingConfig:{mode:o}}}};if(n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=n.thinking.level,s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=w(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);s.abortSignal=n.signal}return{model:e.id,contents:r,config:s}}function x(e){return/gemma-?4/.test(e.id.toLowerCase())}function S(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function C(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function w(e){return S(e)?{thinkingLevel:`LOW`}:C(e)||x(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function T(e,t){if(S(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(x(t))switch(e){case`minimal`:case`low`:return`MINIMAL`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function E(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{_ as stream,v as streamSimple};
|