sliccy 3.36.0 → 3.37.0
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/{adobe-cxXajJ1A.js → adobe-D0eU7otw.js} +1 -1
- package/dist/ui/assets/{adobe-BDx0xZZN.js → adobe-DzguSJcB.js} +2 -2
- package/dist/ui/assets/{agent-bridge-DyKUTtuo.js → agent-bridge-BV8pPxQ4.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-Bi5-2WlC.js → agent-message-to-chat-CcIv-92Q.js} +1 -1
- package/dist/ui/assets/{anthropic-DhlxlRUi.js → anthropic-BOCAZdKT.js} +1 -1
- package/dist/ui/assets/{anthropic-BLr6vgjL.js → anthropic-C-nJktDH.js} +1 -1
- package/dist/ui/assets/{apps-CMXlIt7l.js → apps-CazRdlWW.js} +1 -1
- package/dist/ui/assets/{azure-openai-D6erH762.js → azure-openai-DtL1o6ZD.js} +1 -1
- package/dist/ui/assets/{azure-openai-BemTM7cG.js → azure-openai-_invOtXk.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-BCdijGeI.js → azure-openai-responses-CX0jRX76.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-Ckbzibre.js → azure-openai-responses-GhzNMInJ.js} +1 -1
- package/dist/ui/assets/{biome_wasm-DcVkLcac.js → biome_wasm-D8VQSIIi.js} +1 -1
- package/dist/ui/assets/{bsh-watchdog-C6PTBGjJ.js → bsh-watchdog-s4NmjDWR.js} +1 -1
- package/dist/ui/assets/{cdp-84XjVz0a.js → cdp-BgM18pVP.js} +3 -3
- package/dist/ui/assets/{cdp-ws-page-bridge-Br3RDWMc.js → cdp-ws-page-bridge-B5tXWGhg.js} +1 -1
- package/dist/ui/assets/{common-Kgrp69uW.js → common-D2i3_-oc.js} +1 -1
- package/dist/ui/assets/{connect-surface-BPBamnV2.js → connect-surface-DHkIIf2i.js} +1 -1
- package/dist/ui/assets/cost-command-DFzH4zjf.js +1 -0
- package/dist/ui/assets/{dist-rL8usQYO.js → dist-BA9OCLxC.js} +1 -1
- package/dist/ui/assets/{dist-CoGx23Mh.js → dist-BNts4F1N.js} +1 -1
- package/dist/ui/assets/{dist-Cp7UAJid.js → dist-C5jJDZZZ.js} +1 -1
- package/dist/ui/assets/{dist-BwrS08So.js → dist-CVBUjlj6.js} +1 -1
- package/dist/ui/assets/{es-CPRTyRS4.js → es-BRyNbfCL.js} +1 -1
- package/dist/ui/assets/{follower-sprinkle-bridge-DvVGjC8f.js → follower-sprinkle-bridge-Dm4wCz3a.js} +1 -1
- package/dist/ui/assets/{github-copilot-ClJae8xc.js → github-copilot-CI7Dyzof.js} +2 -2
- package/dist/ui/assets/{github-copilot-904lM2o2.js → github-copilot-CNCUEMSl.js} +1 -1
- package/dist/ui/assets/{github-BIvONWqz.js → github-d7YH3T2H.js} +1 -1
- package/dist/ui/assets/{github-zokiXPzN.js → github-mHAjC7ey.js} +2 -2
- package/dist/ui/assets/{google-Doi2Ohn6.js → google-DKNB41Ym.js} +1 -1
- package/dist/ui/assets/{google-Cjha4joL.js → google-HRDDLoHP.js} +1 -1
- package/dist/ui/assets/{google-shared-BzEbof8A.js → google-shared-CYn7X0jS.js} +1 -1
- package/dist/ui/assets/{google-shared-CNKdXbm8.js → google-shared-DZAlfPPe.js} +1 -1
- package/dist/ui/assets/{google-vertex-B5vBchlU.js → google-vertex-5PWnpQrl.js} +1 -1
- package/dist/ui/assets/{google-vertex-OUoxkWRz.js → google-vertex-DlucBiuL.js} +1 -1
- package/dist/ui/assets/{hosted-config-apply-_WyR0PnY.js → hosted-config-apply-Drta_smD.js} +1 -1
- package/dist/ui/assets/{intercepted-oauth-E-RJ_38y.js → intercepted-oauth-CdfSST0X.js} +1 -1
- package/dist/ui/assets/{kernel-worker-jD7bcOG1.js → kernel-worker-Bogg0FsV.js} +21 -21
- package/dist/ui/assets/{lick-ws-bridge-Bu0447pg.js → lick-ws-bridge-DnC03d37.js} +1 -1
- package/dist/ui/assets/{local-llm-DTfJxIXt.js → local-llm-BBDP3qXX.js} +1 -1
- package/dist/ui/assets/{magick-wasm-Dilg8m3U.js → magick-wasm-DP5JW3P7.js} +1 -1
- package/dist/ui/assets/{main-BuR1AKEt.js → main-D7RTZNPJ.js} +10 -10
- package/dist/ui/assets/{main-cherry-DQ9DcLoo.js → main-cherry-CZuEEqNJ.js} +1 -1
- package/dist/ui/assets/{migration-run-EL8p-R1L.js → migration-run-kj6K_pt4.js} +1 -1
- package/dist/ui/assets/{mistral-CQpf9iQh.js → mistral-Bq4YKpQf.js} +1 -1
- package/dist/ui/assets/{mistral-BTJY2iBI.js → mistral-s6fpd_QE.js} +1 -1
- package/dist/ui/assets/{nodejs-Cl5Op5oH.js → nodejs--9YdGywN.js} +1 -1
- package/dist/ui/assets/{nuke-command-EsWO-99-.js → nuke-command-H4BPXVny.js} +1 -1
- package/dist/ui/assets/{oauth-COh1tidH.js → oauth-CYnFQHGN.js} +1 -1
- package/dist/ui/assets/{oauth-bootstrap-CnTMAvSf.js → oauth-bootstrap-Cm6Ey9BE.js} +2 -2
- package/dist/ui/assets/{oauth-service-DwylaCdf.js → oauth-service-DeRu3_2b.js} +1 -1
- package/dist/ui/assets/{oauth-service-CHFZzMAM.js → oauth-service-HJoLhTok.js} +1 -1
- package/dist/ui/assets/{offscreen-client-CY2P6ZpH.js → offscreen-client-BWBoGGE9.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-Dy5rLil-.js → onboarding-orchestrator-BgoWOzZj.js} +1 -1
- package/dist/ui/assets/{openai-codex-hQxy0wsX.js → openai-codex-DQRUGzWy.js} +1 -1
- package/dist/ui/assets/{openai-codex-CSExyJdK.js → openai-codex-LN-usMsc.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-YNMSm_9-.js → openai-codex-responses-Cfc781NG.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-BUfFqzRl.js → openai-codex-responses-CxdnjTbB.js} +1 -1
- package/dist/ui/assets/{openai-completions-jY0XduoF.js → openai-completions-C3xol3b4.js} +1 -1
- package/dist/ui/assets/{openai-responses-KsCBEvUD.js → openai-responses--a_zzMOQ.js} +1 -1
- package/dist/ui/assets/{openai-responses-KvO6yZ53.js → openai-responses-CztB_6j4.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-B8LvbBLm.js → openai-responses-shared-DiFBBpqL.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-BEfL_4Jo.js → openai-responses-shared-DzF78DKp.js} +1 -1
- package/dist/ui/assets/{openrouter-Bg9dnwH0.js → openrouter-BMdnzqF3.js} +1 -1
- package/dist/ui/assets/{openrouter-BDi20ID7.js → openrouter-aEehoTsE.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-BXEiLAAr.js → panel-rpc-handlers-DdqJW3No.js} +1 -1
- package/dist/ui/assets/{provider-CfArdY9x.js → provider-Bgu2Uv_T.js} +2 -2
- package/dist/ui/assets/{provider-DE_36sNg.js → provider-D4K2_mH-.js} +1 -1
- package/dist/ui/assets/provider-store-access-BFHCJwAC.js +1 -0
- package/dist/ui/assets/provider-store-access-DC3w8ZIP.js +1 -0
- package/dist/ui/assets/{proxied-fetch-CeUEVmxJ.js → proxied-fetch-C52RkD9o.js} +1 -1
- package/dist/ui/assets/{pyodide-1sA0caY8.js → pyodide-DuRrrZJD.js} +2 -2
- package/dist/ui/assets/{remote-terminal-view-CWAelr73.js → remote-terminal-view-Cudp1ErF.js} +1 -1
- package/dist/ui/assets/{remote-vfs-client-DccrPQK3.js → remote-vfs-client-Cu-MFwK4.js} +1 -1
- package/dist/ui/assets/{secret-env-CCuKboWk.js → secret-env-DEspXTwg.js} +1 -1
- package/dist/ui/assets/{slicc-editor-C91M-_Ki.js → slicc-editor-CwFr1Fs1.js} +1 -1
- package/dist/ui/assets/{spawn-BVUlR8PQ.js → spawn-BycKAdgK.js} +1 -1
- package/dist/ui/assets/{sql-wasm-C_8iNeNy.js → sql-wasm-DCJNFY_I.js} +1 -1
- package/dist/ui/assets/{src-Dt77-cQy.js → src-DiQH2ndF.js} +1 -1
- package/dist/ui/assets/{store-DhPN9ghF.js → store-h-tP5jnf.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-C9WjcJt7.js → tray-leave-runtime-CjxaeMI3.js} +1 -1
- package/dist/ui/assets/{typescript-CXc3cH84.js → typescript-1JVPsu0C.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-C8SKVajA.js → upgrade-detection-C2ZLSwM0.js} +1 -1
- package/dist/ui/assets/{web-CBnsPMLv.js → web-BqSerjuj.js} +1 -1
- package/dist/ui/assets/{writable-vfs-client-8kaPaUvR.js → writable-vfs-client-DzaIeN3A.js} +1 -1
- package/dist/ui/assets/{ws-subscribers-r7MB4Tl5.js → ws-subscribers-keoikw2x.js} +1 -1
- package/dist/ui/assets/{xai-grok-VZlQG8z0.js → xai-grok--KXEnye4.js} +1 -1
- package/dist/ui/assets/{xai-grok-DYhZ5bwG.js → xai-grok-u9YAsnWn.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/ui/packages/webapp/index.html +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/cost-command-BzwhcR5V.js +0 -1
- package/dist/ui/assets/provider-store-access-B6gI9Cfx.js +0 -1
- package/dist/ui/assets/provider-store-access-DK_UYwgf.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as e,dt as t,ft as n,k as r,v as i,w as a}from"./kernel-worker-
|
|
1
|
+
import{O as e,dt as t,ft as n,k as r,v as i,w as a}from"./kernel-worker-Bogg0FsV.js";import{getOAuthPageOrigin as o}from"./oauth-service-HJoLhTok.js";var s={clientId:``,scopes:`repo,read:user,user:email`};function c(){try{let e=localStorage.getItem(n);if(e)return e.replace(/\/$/,``)}catch{}return t}async function l(e){let t=`${c()}/oauth/token`,n=await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,code:e.code,redirect_uri:e.redirectUri})}),r;try{r=await n.json()}catch{throw Error(`Token exchange failed (HTTP ${n.status}): non-JSON response`)}if(!n.ok&&n.status!==200){let e=r.error_description??r.error??`Token exchange failed (HTTP ${n.status})`;throw Error(e)}if(r.error){let e=r.error_description??r.error;throw Error(e)}return r}async function u(e){let t=`${c()}/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})`)}}const d=Object.assign({"/packages/webapp/providers/github-config.json":s})[`/packages/webapp/providers/github-config.json`]??{clientId:``,scopes:`repo,read:user,user:email`};let f=null,p=null;function m(e){let{isExtension:t,isConnectMode:n,workerBaseUrl:r,pageOrigin:i,pageHref:a,extensionId:o,nonce:s}=e;if(t)return{redirectUri:`${r}/auth/callback`,state:{source:`extension`,extensionId:o,path:`/github`,nonce:s}};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:s}}}return{redirectUri:`${r}/auth/callback`,state:{source:`remote`,origin:e,path:`/auth/callback`,nonce:s}}}return{redirectUri:`${e.runtimeWorkerBaseUrl??i??``}/auth/callback`,state:{port:parseInt(new URL(a??i??`http://localhost:5710`).port||`5710`,10),path:`/auth/callback`,nonce:s}}}async function h(){if(f)return f;if(g){try{let e=await fetch(`${c()}/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return f=t.oauth.github,f}}catch{}return d.clientId}try{let e=await fetch(`/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return f=t.oauth.github,f;if(t.trayWorkerBaseUrl){p=t.trayWorkerBaseUrl;let e=await fetch(`${t.trayWorkerBaseUrl}/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return f=t.oauth.github,f}}}}catch{}return d.clientId}const g=typeof chrome<`u`&&!!chrome?.runtime?.id;function _(){return a().find(e=>e.providerId===`github`)}function v(e){try{return new URL(e).searchParams.get(`code`)}catch{return null}}async function y(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 b(e,t){return`${e}+${t}@users.noreply.github.com`}async function x(e){try{let{VirtualFS:t}=await import(`./kernel-worker-Bogg0FsV.js`).then(e=>e.C);await(await t.create({dbName:i})).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 S(){try{let{VirtualFS:e}=await import(`./kernel-worker-Bogg0FsV.js`).then(e=>e.C);await(await e.create({dbName:i})).rm(`/workspace/.git/github-token`),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`github-token-changed`))}catch{}}async function C(e){if(!(!e.login||e.id===void 0))try{let{VirtualFS:t}=await import(`./kernel-worker-Bogg0FsV.js`).then(e=>e.C),{readGlobalGitConfigValue:n,writeGlobalGitConfigValue:r}=await import(`./kernel-worker-Bogg0FsV.js`).then(e=>e._),a=await t.create({dbName:i}),o=e.name||e.login,s=b(e.id,e.login);!await n(a,`user.name`)&&o&&await r(a,`user.name`,o),await n(a,`user.email`)||await r(a,`user.email`,s)}catch(e){console.warn(`[github] Failed to seed git identity:`,e instanceof Error?e.message:String(e))}}async function w(){let e=_();if(!e?.accessToken)throw Error(`Not logged in to GitHub — please log in first`);return e.accessToken}const T={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(t,n,i)=>{let a=await h();if(!a)throw Error(`GitHub OAuth not configured — no client ID available`);let s=i?.scopes??d.scopes,u=g?null:await o(),f=crypto.randomUUID(),_=g?chrome.runtime.id:``,{redirectUri:b,state:w}=m({isExtension:g,isConnectMode:!!globalThis.__slicc_connect_mode,workerBaseUrl:c(),runtimeWorkerBaseUrl:p,pageOrigin:u?.origin??null,pageHref:u?.href??null,extensionId:_,nonce:f}),T=btoa(JSON.stringify(w)),E=f,D=new URLSearchParams({client_id:a,scope:s,redirect_uri:b});T&&D.set(`state`,T);let O=await t(`https://github.com/login/oauth/authorize?${D}`);if(!O)return;if(E)try{if(new URL(O).searchParams.get(`nonce`)!==E){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 k=v(O);if(!k){console.error(`[github] Could not extract authorization code from redirect URL`);return}let A=await l({provider:`github`,code:k,redirectUri:b}),j=await y(A.access_token);await r({providerId:`github`,accessToken:A.access_token,userName:j.name,userAvatar:j.avatar});let M=e(`github`)?.maskedValue;M?await x(M):await S(),await C(j),n()},onOAuthLogout:async()=>{let e=_();e?.accessToken&&await u({provider:`github`,accessToken:e.accessToken}).catch(e=>console.warn(`[github] Token revocation failed:`,e instanceof Error?e.message:String(e))),await S(),await r({providerId:`github`,accessToken:``})},getOAuthLogoutUrl:e=>`https://github.com/logout`};export{b as buildNoreplyEmail,T as config,v as extractCodeFromUrl,w as getValidAccessToken,m as resolveGithubOAuthRedirect,C as syncGitIdentityFromGitHub};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-
|
|
2
|
-
import{E as e,O as t,at as n,f as r,l as i,r as a}from"./main-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-D7RTZNPJ.js","assets/modulepreload-polyfill-Dezn_h7o.js","assets/main-D683Koa8.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{E as e,O as t,at as n,f as r,l as i,r as a}from"./main-D7RTZNPJ.js";import{getOAuthPageOrigin as o}from"./oauth-service-DeRu3_2b.js";import{t as s}from"./global-db-CbuLl-zx.js";var c={clientId:``,scopes:`repo,read:user,user:email`};function l(){try{let e=localStorage.getItem(t);if(e)return e.replace(/\/$/,``)}catch{}return e}async function u(e){let t=`${l()}/oauth/token`,n=await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,code:e.code,redirect_uri:e.redirectUri})}),r;try{r=await n.json()}catch{throw Error(`Token exchange failed (HTTP ${n.status}): non-JSON response`)}if(!n.ok&&n.status!==200){let e=r.error_description??r.error??`Token exchange failed (HTTP ${n.status})`;throw Error(e)}if(r.error){let e=r.error_description??r.error;throw Error(e)}return r}async function d(e){let t=`${l()}/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 f=Object.assign({"/packages/webapp/providers/github-config.json":c})[`/packages/webapp/providers/github-config.json`]??{clientId:``,scopes:`repo,read:user,user:email`},p=null,m=null;function h(e){let{isExtension:t,isConnectMode:n,workerBaseUrl:r,pageOrigin:i,pageHref:a,extensionId:o,nonce:s}=e;if(t)return{redirectUri:`${r}/auth/callback`,state:{source:`extension`,extensionId:o,path:`/github`,nonce:s}};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:s}}}return{redirectUri:`${r}/auth/callback`,state:{source:`remote`,origin:e,path:`/auth/callback`,nonce:s}}}return{redirectUri:`${e.runtimeWorkerBaseUrl??i??``}/auth/callback`,state:{port:parseInt(new URL(a??i??`http://localhost:5710`).port||`5710`,10),path:`/auth/callback`,nonce:s}}}async function g(){if(p)return p;if(_){try{let e=await fetch(`${l()}/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return p=t.oauth.github,p}}catch{}return f.clientId}try{let e=await fetch(`/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return p=t.oauth.github,p;if(t.trayWorkerBaseUrl){m=t.trayWorkerBaseUrl;let e=await fetch(`${t.trayWorkerBaseUrl}/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return p=t.oauth.github,p}}}}catch{}return f.clientId}var _=typeof chrome<`u`&&!!chrome?.runtime?.id;function v(){return a().find(e=>e.providerId===`github`)}function y(e){try{return new URL(e).searchParams.get(`code`)}catch{return null}}async function b(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 x(e,t){return`${e}+${t}@users.noreply.github.com`}async function S(e){try{let{VirtualFS:t}=await n(async()=>{let{VirtualFS:e}=await import(`./main-D7RTZNPJ.js`).then(e=>e.S);return{VirtualFS:e}},__vite__mapDeps([0,1,2]));await(await t.create({dbName:s})).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 C(){try{let{VirtualFS:e}=await n(async()=>{let{VirtualFS:e}=await import(`./main-D7RTZNPJ.js`).then(e=>e.S);return{VirtualFS:e}},__vite__mapDeps([0,1,2]));await(await e.create({dbName:s})).rm(`/workspace/.git/github-token`),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`github-token-changed`))}catch{}}async function w(e){if(!(!e.login||e.id===void 0))try{let{VirtualFS:t}=await n(async()=>{let{VirtualFS:e}=await import(`./main-D7RTZNPJ.js`).then(e=>e.S);return{VirtualFS:e}},__vite__mapDeps([0,1,2])),{readGlobalGitConfigValue:r,writeGlobalGitConfigValue:i}=await n(async()=>{let{readGlobalGitConfigValue:e,writeGlobalGitConfigValue:t}=await import(`./git-config-DLJIrKjL.js`);return{readGlobalGitConfigValue:e,writeGlobalGitConfigValue:t}},[]),a=await t.create({dbName:s}),o=e.name||e.login,c=x(e.id,e.login);!await r(a,`user.name`)&&o&&await i(a,`user.name`,o),await r(a,`user.email`)||await i(a,`user.email`,c)}catch(e){console.warn(`[github] Failed to seed git identity:`,e instanceof Error?e.message:String(e))}}async function T(){let e=v();if(!e?.accessToken)throw Error(`Not logged in to GitHub — please log in first`);return e.accessToken}var E={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(e,t,n)=>{let a=await g();if(!a)throw Error(`GitHub OAuth not configured — no client ID available`);let s=n?.scopes??f.scopes,c=_?null:await o(),d=crypto.randomUUID(),p=_?chrome.runtime.id:``,{redirectUri:v,state:x}=h({isExtension:_,isConnectMode:!!globalThis.__slicc_connect_mode,workerBaseUrl:l(),runtimeWorkerBaseUrl:m,pageOrigin:c?.origin??null,pageHref:c?.href??null,extensionId:p,nonce:d}),T=btoa(JSON.stringify(x)),E=d,D=new URLSearchParams({client_id:a,scope:s,redirect_uri:v});T&&D.set(`state`,T);let O=await e(`https://github.com/login/oauth/authorize?${D}`);if(!O)return;if(E)try{if(new URL(O).searchParams.get(`nonce`)!==E){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 k=y(O);if(!k){console.error(`[github] Could not extract authorization code from redirect URL`);return}let A=await u({provider:`github`,code:k,redirectUri:v}),j=await b(A.access_token);await r({providerId:`github`,accessToken:A.access_token,userName:j.name,userAvatar:j.avatar});let M=i(`github`)?.maskedValue;M?await S(M):await C(),await w(j),t()},onOAuthLogout:async()=>{let e=v();e?.accessToken&&await d({provider:`github`,accessToken:e.accessToken}).catch(e=>console.warn(`[github] Token revocation failed:`,e instanceof Error?e.message:String(e))),await C(),await r({providerId:`github`,accessToken:``})},getOAuthLogoutUrl:e=>`https://github.com/logout`};export{x as buildNoreplyEmail,E as config,y as extractCodeFromUrl,T as getValidAccessToken,h as resolveGithubOAuthRedirect,w as syncGitIdentityFromGitHub};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,Z as t,et as n,it as r,y as i}from"./main-
|
|
1
|
+
import{$ as e,Z as t,et as n,it as r,y as i}from"./main-D7RTZNPJ.js";import{t as a}from"./sanitize-unicode-DmIE6hZJ.js";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./google-shared-CYn7X0jS.js";var p=0,m=(n,i,a)=>{let o=new t;return(async()=>{let t={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 c=g(n,a?.apiKey||r(n.provider)||``,a?.headers),d=_(n,i,a),f=await a?.onPayload?.(d,n);f!==void 0&&(d=f);let m=await c.models.generateContentStream(d);o.push({type:`start`,partial:t});let h=null,v=t.content,y=()=>v.length-1;for await(let r of m){t.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let e of i.content.parts){if(e.text!==void 0){let n=u(e);(!h||n&&h.type!==`thinking`||!n&&h.type!==`text`)&&(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:v.length-1,content:h.text,partial:t}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:t})),n?(h={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(h),o.push({type:`thinking_start`,contentIndex:y(),partial:t})):(h={type:`text`,text:``},t.content.push(h),o.push({type:`text_start`,contentIndex:y(),partial:t}))),h.type===`thinking`?(h.thinking+=e.text,h.thinkingSignature=l(h.thinkingSignature,e.thoughtSignature),o.push({type:`thinking_delta`,contentIndex:y(),delta:e.text,partial:t})):(h.text+=e.text,h.textSignature=l(h.textSignature,e.thoughtSignature),o.push({type:`text_delta`,contentIndex:y(),delta:e.text,partial:t}))}if(e.functionCall){h&&=(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:t}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:t}),null);let n=e.functionCall.id,r={type:`toolCall`,id:!n||t.content.some(e=>e.type===`toolCall`&&e.id===n)?`${e.functionCall.name}_${Date.now()}_${++p}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),o.push({type:`toolcall_start`,contentIndex:y(),partial:t}),o.push({type:`toolcall_delta`,contentIndex:y(),delta:JSON.stringify(r.arguments),partial:t}),o.push({type:`toolcall_end`,contentIndex:y(),toolCall:r,partial:t})}}i?.finishReason&&(t.stopReason=s(i.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),r.usageMetadata&&(t.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,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},e(n,t.usage))}if(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:t}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:t})),a?.signal?.aborted)throw Error(`Request was aborted`);if(t.stopReason===`aborted`||t.stopReason===`error`)throw Error(`An unknown error occurred`);o.push({type:`done`,reason:t.stopReason,message:t}),o.end()}catch(e){for(let e of t.content)`index`in e&&delete e.index;t.stopReason=a?.signal?.aborted?`aborted`:`error`,t.errorMessage=e instanceof Error?e.message:JSON.stringify(e),o.push({type:`error`,reason:t.stopReason,error:t}),o.end()}})(),o},h=(e,t,a)=>{let o=a?.apiKey||r(e.provider);if(!o)throw Error(`No API key for provider: ${e.provider}`);let s=i(e,a,o);if(!a?.reasoning)return m(e,t,{...s,thinking:{enabled:!1}});let c=n(e,a.reasoning),l=c===`off`?`high`:c,u=e;return y(u)||b(u)||v(u)?m(e,t,{...s,thinking:{enabled:!0,level:S(l,u)}}):m(e,t,{...s,thinking:{enabled:!0,budgetTokens:C(u,l,a.thinkingBudgets)}})};function g(e,t,n){let r={};return e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``),(e.headers||n)&&(r.headers={...e.headers,...n}),new d({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function _(e,t,n={}){let r=f(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let s={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:c(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?s.toolConfig={functionCallingConfig:{mode:o(n.toolChoice)}}:s.toolConfig=void 0,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=x(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 v(e){return/gemma-?4/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function b(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function x(e){return y(e)?{thinkingLevel:`LOW`}:b(e)||v(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function S(e,t){if(y(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(v(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 C(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{m as streamGoogle,h as streamSimpleGoogle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as e,Q as t,Y as n,Z as r,nt as i,u as a}from"./kernel-worker-
|
|
1
|
+
import{P as e,Q as t,Y as n,Z as r,nt as i,u as a}from"./kernel-worker-Bogg0FsV.js";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./google-shared-DZAlfPPe.js";let p=0;const m=(e,t,a)=>{let o=new n;return(async()=>{let n={role:`assistant`,content:[],api:`google-generative-ai`,provider:e.provider,model:e.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 c=g(e,a?.apiKey||i(e.provider)||``,a?.headers),d=_(e,t,a),f=await a?.onPayload?.(d,e);f!==void 0&&(d=f);let m=await c.models.generateContentStream(d);o.push({type:`start`,partial:n});let h=null,v=n.content,y=()=>v.length-1;for await(let t of m){n.responseId||=t.responseId;let i=t.candidates?.[0];if(i?.content?.parts)for(let e of i.content.parts){if(e.text!==void 0){let t=u(e);(!h||t&&h.type!==`thinking`||!t&&h.type!==`text`)&&(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:v.length-1,content:h.text,partial:n}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:n})),t?(h={type:`thinking`,thinking:``,thinkingSignature:void 0},n.content.push(h),o.push({type:`thinking_start`,contentIndex:y(),partial:n})):(h={type:`text`,text:``},n.content.push(h),o.push({type:`text_start`,contentIndex:y(),partial:n}))),h.type===`thinking`?(h.thinking+=e.text,h.thinkingSignature=l(h.thinkingSignature,e.thoughtSignature),o.push({type:`thinking_delta`,contentIndex:y(),delta:e.text,partial:n})):(h.text+=e.text,h.textSignature=l(h.textSignature,e.thoughtSignature),o.push({type:`text_delta`,contentIndex:y(),delta:e.text,partial:n}))}if(e.functionCall){h&&=(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:n}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:n}),null);let t=e.functionCall.id,r={type:`toolCall`,id:!t||n.content.some(e=>e.type===`toolCall`&&e.id===t)?`${e.functionCall.name}_${Date.now()}_${++p}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};n.content.push(r),o.push({type:`toolcall_start`,contentIndex:y(),partial:n}),o.push({type:`toolcall_delta`,contentIndex:y(),delta:JSON.stringify(r.arguments),partial:n}),o.push({type:`toolcall_end`,contentIndex:y(),toolCall:r,partial:n})}}i?.finishReason&&(n.stopReason=s(i.finishReason),n.content.some(e=>e.type===`toolCall`)&&(n.stopReason=`toolUse`)),t.usageMetadata&&(n.usage={input:(t.usageMetadata.promptTokenCount||0)-(t.usageMetadata.cachedContentTokenCount||0),output:(t.usageMetadata.candidatesTokenCount||0)+(t.usageMetadata.thoughtsTokenCount||0),cacheRead:t.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:t.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},r(e,n.usage))}if(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:n}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:n})),a?.signal?.aborted)throw Error(`Request was aborted`);if(n.stopReason===`aborted`||n.stopReason===`error`)throw Error(`An unknown error occurred`);o.push({type:`done`,reason:n.stopReason,message:n}),o.end()}catch(e){for(let e of n.content)`index`in e&&delete e.index;n.stopReason=a?.signal?.aborted?`aborted`:`error`,n.errorMessage=e instanceof Error?e.message:JSON.stringify(e),o.push({type:`error`,reason:n.stopReason,error:n}),o.end()}})(),o},h=(n,r,a)=>{let o=a?.apiKey||i(n.provider);if(!o)throw Error(`No API key for provider: ${n.provider}`);let s=e(n,a,o);if(!a?.reasoning)return m(n,r,{...s,thinking:{enabled:!1}});let c=t(n,a.reasoning),l=c===`off`?`high`:c,u=n;return y(u)||b(u)||v(u)?m(n,r,{...s,thinking:{enabled:!0,level:S(l,u)}}):m(n,r,{...s,thinking:{enabled:!0,budgetTokens:C(u,l,a.thinkingBudgets)}})};function g(e,t,n){let r={};return e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``),(e.headers||n)&&(r.headers={...e.headers,...n}),new d({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function _(e,t,n={}){let r=f(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let s={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:c(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?s.toolConfig={functionCallingConfig:{mode:o(n.toolChoice)}}:s.toolConfig=void 0,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=x(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 v(e){return/gemma-?4/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function b(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function x(e){return y(e)?{thinkingLevel:`LOW`}:b(e)||v(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function S(e,t){if(y(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(v(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 C(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{m as streamGoogle,h as streamSimpleGoogle};
|