sliccy 6.154.7 → 6.156.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/README.md +4 -0
- package/dist/node-server/hostfs.d.ts +6 -1
- package/dist/node-server/hostfs.js +32 -0
- package/dist/ui/.vite/manifest.json +201 -195
- package/dist/ui/assets/SKILL-B--riEXN.js +1 -0
- package/dist/ui/assets/{SKILL-C947OHCv.js → SKILL-CkA461kX.js} +1 -1
- package/dist/ui/assets/{account-store-CuTDBQ6V.js → account-store-dtzxuWeC.js} +1 -1
- package/dist/ui/assets/{account-store-Bv7LV6_A.js → account-store-kmVkSbCR.js} +1 -1
- package/dist/ui/assets/{adobe-yrm9KfZU.js → adobe-CnRG7JPQ.js} +1 -1
- package/dist/ui/assets/{adobe-Bld04yf4.js → adobe-lTfW3SWI.js} +1 -1
- package/dist/ui/assets/{agent-bridge-BOK0bK1-.js → agent-bridge-C_Nj4jdv.js} +1 -1
- package/dist/ui/assets/{agent-panels-JSKGPWny.js → agent-panels-CuPOC-fc.js} +1 -1
- package/dist/ui/assets/{apply-layout-Dol4QpYX.js → apply-layout-6vcopgzZ.js} +1 -1
- package/dist/ui/assets/{apps-DdAoo50J.js → apps-Dikr6XSa.js} +1 -1
- package/dist/ui/assets/{auto-mount-table-BDyGIOIb.js → auto-mount-table-Bj59hmjV.js} +1 -1
- package/dist/ui/assets/{azure-openai-CROWb3eo.js → azure-openai-BTFDrrWf.js} +1 -1
- package/dist/ui/assets/{azure-openai-D16OgVVX.js → azure-openai-BzpXFJz8.js} +1 -1
- package/dist/ui/assets/backend-hostfs-De2Zrx7a.js +1 -0
- package/dist/ui/assets/backend-hostfs-n_0O1LVt.js +1 -0
- package/dist/ui/assets/{budget-usage-source-CiFTPdLG.js → budget-usage-source-BBJSsrkZ.js} +1 -1
- package/dist/ui/assets/{cdp-ChTjN36Y.js → cdp-Be4w4xKY.js} +1 -1
- package/dist/ui/assets/{cerebras-DEjugWgo.js → cerebras-DIJe1DYg.js} +1 -1
- package/dist/ui/assets/{cerebras-BGd53Y6O.js → cerebras-DRFKeC8d.js} +1 -1
- package/dist/ui/assets/{composer-speech-BvDGMHRN.js → composer-speech-Bm0dHfES.js} +1 -1
- package/dist/ui/assets/{connect-surface-BxeM6wzG.js → connect-surface-R4sCU4sU.js} +1 -1
- package/dist/ui/assets/{directed-approval-DAIXE0nO.js → directed-approval--OxXt3UP.js} +1 -1
- package/dist/ui/assets/dist-BCg-GYyx.js +2 -0
- package/dist/ui/assets/dist-ByarBBEi.js +2 -0
- package/dist/ui/assets/{dist-BPPG9gF6.js → dist-CtH2hxRt.js} +9 -9
- package/dist/ui/assets/{dist-BnmWpUNI.js → dist-VS1DwNvU.js} +10 -10
- package/dist/ui/assets/{extension-ops-B05mAXsq.js → extension-ops-DcLzcAwt.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer--a4fMghf.js → frozen-archive-writer-Df5805od.js} +1 -1
- package/dist/ui/assets/fs-CETHxfDK.js +1 -0
- package/dist/ui/assets/fs-tGax5N7s.js +2 -0
- package/dist/ui/assets/{github-Bc1z9Z3b.js → github-BAAXjX_F.js} +1 -1
- package/dist/ui/assets/github-DVm0U0mK.js +2 -0
- package/dist/ui/assets/{github-auth-BPlvszS_.js → github-auth-DmHyyx5B.js} +1 -1
- package/dist/ui/assets/{github-copilot-BQU9xIRH.js → github-copilot-0y8bGZg_.js} +1 -1
- package/dist/ui/assets/{github-copilot-CtFddSBT.js → github-copilot-C-nezZQy.js} +1 -1
- package/dist/ui/assets/{github-install-BUmd5jOm.js → github-install--Sj58Qzh.js} +1 -1
- package/dist/ui/assets/{github-zip-BbIUjzA4.js → github-zip-CXiagkZF.js} +1 -1
- package/dist/ui/assets/{hear-CYy8tVN1.js → hear-CI9hCYc0.js} +1 -1
- package/dist/ui/assets/{help-C1vcRsvu.js → help-BNaovbY_.js} +1 -1
- package/dist/ui/assets/isomorphic-git-DRUhmZ5u.js +84 -0
- package/dist/ui/assets/{js-realm-worker-JtICkZ9q.js → js-realm-worker-BMCyKyav.js} +1 -1
- package/dist/ui/assets/kernel-worker-8NClboR3.js +4948 -0
- package/dist/ui/assets/{live-session-snapshot-CpwRZg6K.js → live-session-snapshot-BP6rxBrE.js} +1 -1
- package/dist/ui/assets/{local-llm-_OhXJtNu.js → local-llm-C9Pn8yB9.js} +1 -1
- package/dist/ui/assets/{local-llm-CJWLILc_.js → local-llm-DXYnLBn-.js} +1 -1
- package/dist/ui/assets/{main-CpKPiVl7.js → main-BsKv75d6.js} +3 -3
- package/dist/ui/assets/{main-cherry-D8WCpwBV.js → main-cherry-K2rdb2tR.js} +1 -1
- package/dist/ui/assets/{memory-curation-seam-BxXS_BMa.js → memory-curation-seam-Da8y7PL1.js} +1 -1
- package/dist/ui/assets/{mount-B-qjx7RD.js → mount-BnqsJz07.js} +2 -2
- package/dist/ui/assets/{mount-CIGA8r4q.js → mount-Bvhkqfvq.js} +3 -3
- package/dist/ui/assets/{mount-bridge-client-DQaM1wCj.js → mount-bridge-client-DphjpUJQ.js} +1 -1
- package/dist/ui/assets/{mount-bridge-client-DWY67yip.js → mount-bridge-client-wfM0sGs5.js} +1 -1
- package/dist/ui/assets/{mount-index-D9w_zMSm.js → mount-index-DLLlduW0.js} +1 -1
- package/dist/ui/assets/{mount-recovery-DNUbi0Ni.js → mount-recovery-TMd9CRjk.js} +1 -1
- package/dist/ui/assets/mv-DUh51uEl.js +2 -0
- package/dist/ui/assets/{new-session-Bat4OTXx.js → new-session-Cio_KBeZ.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-D2j6OHaC.js → oauth-bootstrap-VrNUDJjU.js} +2 -2
- package/dist/ui/assets/{onboarding-orchestrator-Za4dEXZ8.js → onboarding-orchestrator-BB1zNdKC.js} +1 -1
- package/dist/ui/assets/{openai-codex-f1f3Poo1.js → openai-codex-BT5FTBS6.js} +1 -1
- package/dist/ui/assets/{openai-codex-CcJ89ggy.js → openai-codex-BgqTW2m7.js} +1 -1
- package/dist/ui/assets/{openrouter-B52C9XuH.js → openrouter-C_K6V7Gb.js} +1 -1
- package/dist/ui/assets/{openrouter-DN9cM8UA.js → openrouter-DRW30NNq.js} +1 -1
- package/dist/ui/assets/{openrouter-free-CiLvReDo.js → openrouter-free-BuW6IASB.js} +1 -1
- package/dist/ui/assets/{openrouter-free--eNgGfax.js → openrouter-free-pIEnU1rf.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-Iv8iz92e.js → openrouter-oauth-B2EDW69J.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DOQfi9TX.js → openrouter-oauth-CIKXwi1m.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-DtxsALXP.js → panel-rpc-handlers-BWB6oIBZ.js} +2 -2
- package/dist/ui/assets/{panelize-shell-Dk8A0fzt.js → panelize-shell-D_vKNVde.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-BVNON_7G.js → pi-edit-execution-CotHks9m.js} +1 -1
- package/dist/ui/assets/probe-info-CjsoArwT.js +2 -0
- package/dist/ui/assets/{provider-jRSVQQyi.js → provider-XTsGHN9L.js} +1 -1
- package/dist/ui/assets/provider-hpokNxOX.js +2 -0
- package/dist/ui/assets/provider-settings-Bb94woDn.js +1 -0
- package/dist/ui/assets/provider-store-access-C6h1lyTo.js +1 -0
- package/dist/ui/assets/provider-store-access-Caku0E5t.js +1 -0
- package/dist/ui/assets/{providers-CkE3X7zj.js → providers-76aUL-6g.js} +2 -2
- package/dist/ui/assets/{providers-DsDlOFZz.js → providers-C4pBG_9R.js} +1 -1
- package/dist/ui/assets/{quick-llm-hedJ8LEL.js → quick-llm-B4_UPPHO.js} +1 -1
- package/dist/ui/assets/{recovery-screen-DU8WFnpT.js → recovery-screen-dOYd3v8f.js} +1 -1
- package/dist/ui/assets/{remote-sprinkle-vfs-BY9A-xsx.js → remote-sprinkle-vfs-C_-TfGu3.js} +1 -1
- package/dist/ui/assets/{remote-terminal-view-BXjdqm7-.js → remote-terminal-view-D4Ah4AQY.js} +1 -1
- package/dist/ui/assets/{remote-vfs-client-Dt3CesOI.js → remote-vfs-client-BvSUDbgj.js} +1 -1
- package/dist/ui/assets/rename-via-fs-ckVY1Ljv.js +1 -0
- package/dist/ui/assets/{run-DTXbRzQ6.js → run-4b9___NI.js} +1 -1
- package/dist/ui/assets/{run-C-InHvWx.js → run-9EqZ2jqr.js} +2 -2
- package/dist/ui/assets/{run-dk5KyxT2.js → run-T3Ym76it.js} +1 -1
- package/dist/ui/assets/same-file-identity-C_JKwIh_.js +1 -0
- package/dist/ui/assets/{session-command-memory-CkF1Wu0O.js → session-command-memory-CzJDf01Z.js} +2 -2
- package/dist/ui/assets/{session-jsonl-eMNv3Qki.js → session-jsonl-BwqaD3jQ.js} +1 -1
- package/dist/ui/assets/{session-jsonl-CpQqgq2a.js → session-jsonl-CRmpR-ZS.js} +1 -1
- package/dist/ui/assets/{session-search-index-D2VtAM_Q.js → session-search-index-D6zcG95Z.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-DJTSDAP-.js → setup-feature-flags-remote-FiSp3Nvm.js} +1 -1
- package/dist/ui/assets/sidecar-repair-DRdpqqyR.js +1 -0
- package/dist/ui/assets/{silent-renew-backoff-pEjTpf6Y.js → silent-renew-backoff-47RpYn6p.js} +1 -1
- package/dist/ui/assets/{skills-D1r_dXXN.js → skills-BDuUK1WA.js} +1 -1
- package/dist/ui/assets/slicc-version-BYYOm54y.js +1 -0
- package/dist/ui/assets/{snapshot-jBfySyLF.js → snapshot-YCnvgdlH.js} +1 -1
- package/dist/ui/assets/{snapshot-features-Bn7BtW7K.js → snapshot-features-nRfZ6d0i.js} +1 -1
- package/dist/ui/assets/{soundscape-gtJZ30qF.js → soundscape-Bc7wltLS.js} +1 -1
- package/dist/ui/assets/{speak-D6N7JGfl.js → speak-BCp379KY.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-Bgirnz_O.js → sprinkle-manager-CS0dEr4q.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-CpbS9Pze.js → sprinkle-renderer-iBSrfvqA.js} +1 -1
- package/dist/ui/assets/{state-gI8eLPCJ.js → state-C8-iGrWm.js} +5 -5
- package/dist/ui/assets/{store-CJoMqbUo.js → store-BxfsyfVG.js} +1 -1
- package/dist/ui/assets/{store-CoFkhkC_.js → store-DJgYFIn0.js} +1 -1
- package/dist/ui/assets/{sudo-CdUi7Bt1.js → sudo-Bc7aWsHw.js} +1 -1
- package/dist/ui/assets/{sync-dialog-uCJmhtr8.js → sync-dialog-XvRaTsTt.js} +1 -1
- package/dist/ui/assets/{transformers-env-GrfzOgRv.js → transformers-env-Bv-23qhN.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-B_1w3n4t.js → tray-sidecar-DR8GUSFa.js} +1 -1
- package/dist/ui/assets/types-Bgy4zvr3.js +1 -0
- package/dist/ui/assets/{upgrade-detection-L60JNTNb.js → upgrade-detection-CG7k5pse.js} +1 -1
- package/dist/ui/assets/{upskill-lick-skip-Jcllnh6l.js → upskill-lick-skip-DFarl0_a.js} +1 -1
- package/dist/ui/assets/{voice-reply-DqNiHN6M.js → voice-reply-BPgcJXai.js} +1 -1
- package/dist/ui/assets/{wc-attach-8_xsR0qy.js → wc-attach-CyWVu1te.js} +2 -2
- package/dist/ui/assets/{wc-extension-oYf2HrE6.js → wc-extension-BH735oQw.js} +2 -2
- package/dist/ui/assets/wc-follower-C0Smt7ns.js +17 -0
- package/dist/ui/assets/{wc-follower-oauth-CljtR185.js → wc-follower-oauth-ZRjgkmat.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-CP4serB8.js → wc-gelatiere-CBgXShc6.js} +1 -1
- package/dist/ui/assets/{wc-live-CkxSC9Ez.js → wc-live-TIbmNyZ5.js} +5 -5
- package/dist/ui/assets/{wc-nav-XvRTYo98.js → wc-nav-D2xv4g-l.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-iCoaOIma.js → wc-onboarding-Biz5eTLA.js} +2 -2
- package/dist/ui/assets/{wc-permissions-brfCnfZb.js → wc-permissions-BsGMi4OQ.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-em6OiHpb.js → wc-placeholder-D9hDHuFw.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-BjM8NPKG.js → wc-secret-request-Gvt5KV_e.js} +1 -1
- package/dist/ui/assets/{wc-settings-BtBwNeN8.js → wc-settings-C5HGZFjz.js} +3 -3
- package/dist/ui/assets/wc-shell-D5oHtJzq.js +125 -0
- package/dist/ui/assets/{wc-shortcut-config-BEsAGNLx.js → wc-shortcut-config-CXSWzus2.js} +1 -1
- package/dist/ui/assets/{wc-shortcuts-CETptwt9.js → wc-shortcuts-CXTn5ep9.js} +1 -1
- package/dist/ui/assets/{wc-sprinkles-DLNH0Ist.js → wc-sprinkles-Dj4XOXZd.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-CidB32Dc.js → wc-transcript-export-qh3DWzfR.js} +2 -2
- package/dist/ui/assets/{wc-tray-BbFFd7U-.js → wc-tray-C2HCJKvD.js} +4 -4
- package/dist/ui/assets/welcome-detection-DkZYug9E.js +1 -0
- package/dist/ui/assets/{whisper-session-BvALr1gE.js → whisper-session-CX7d_-d1.js} +2 -2
- package/dist/ui/assets/{writable-vfs-client-C4pTXDFX.js → writable-vfs-client-CzJBYzhR.js} +1 -1
- package/dist/ui/assets/{xai-grok-Ht4qQwUs.js → xai-grok-C1jqSoQB.js} +1 -1
- package/dist/ui/assets/{xai-grok-DWDEwZSo.js → xai-grok-CsF-8ZL7.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/ui/packages/webapp/index.html +3 -3
- package/package.json +2 -2
- package/dist/ui/assets/SKILL-CLF3MdfR.js +0 -1
- package/dist/ui/assets/backend-hostfs-BH8uwRZG.js +0 -1
- package/dist/ui/assets/backend-hostfs-BJU2QL9q.js +0 -1
- package/dist/ui/assets/dist-CFI3XeIO.js +0 -2
- package/dist/ui/assets/dist-Ciikigd5.js +0 -2
- package/dist/ui/assets/fs-BEbWmRDq.js +0 -2
- package/dist/ui/assets/fs-CjgMvwqK.js +0 -1
- package/dist/ui/assets/github-D6e0X_mv.js +0 -2
- package/dist/ui/assets/kernel-worker-JOBY7Wxs.js +0 -5021
- package/dist/ui/assets/provider-BEV4Nyb0.js +0 -2
- package/dist/ui/assets/provider-settings-Dc0Uksht.js +0 -1
- package/dist/ui/assets/provider-store-access-BYCBOZrX.js +0 -1
- package/dist/ui/assets/provider-store-access-CcCQNG5q.js +0 -1
- package/dist/ui/assets/sidecar-repair-CPDaW6WS.js +0 -1
- package/dist/ui/assets/slicc-version-Do_Qzxe9.js +0 -1
- package/dist/ui/assets/types-Dgm4REV3.js +0 -1
- package/dist/ui/assets/wc-follower-BYsj_5x0.js +0 -17
- package/dist/ui/assets/wc-shell-DC9WMYcH.js +0 -125
- package/dist/ui/assets/welcome-detection-DW2ROqam.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/fs-BEbWmRDq.js","assets/preload-helper-Czpn1I53.js","assets/logger-DDBAeTLF.js","assets/path-utils-DNJG-zQf.js","assets/bounded-walk-BjxKWNqp.js","assets/types-Dgm4REV3.js","assets/virtual-device-paths-D45tpPP6.js","assets/mount-table-store-dY2IfQ5S.js","assets/rolldown-runtime-Dd_uD5pT.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{G as e,f as t,u as n}from"./account-store-CuTDBQ6V.js";import{t as r}from"./preload-helper-Czpn1I53.js";import"./proxied-fetch-DyBveeCl.js";import{m as i,t as a}from"./tray-runtime-config-B9jN9kUJ.js";import{i as o}from"./api-endpoint-DGxXvrur.js";import"./main-CpKPiVl7.js";import{r as s,t as c}from"./silent-renew-backoff-pEjTpf6Y.js";import{getOAuthPageOrigin as l,resolveOAuthDelegation as u}from"./oauth-service-BsW9nY_u.js";import{t as d}from"./global-db-CbuLl-zx.js";var f={clientId:``,scopes:`repo,read:user,user:email`};function p(){try{let e=localStorage.getItem(i);if(e)return e.replace(/\/$/,``)}catch{}return a}function m(e){return{access_token:e.access_token,token_type:e.token_type,scope:e.scope,refresh_token:e.refresh_token,expires_in:e.expires_in}}async function h(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 m(t)}async function g(e){let t=`${p()}/oauth/token`;return h(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 _(e){let t=`${p()}/oauth/token`;return h(await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e.provider,refresh_token:e.refreshToken})}))}async function v(e){let t=`${p()}/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 y=Object.assign({"/packages/webapp/providers/github-config.json":f})[`/packages/webapp/providers/github-config.json`]??{clientId:``,scopes:`repo,read:user,user:email`},b=null,x=null;function S(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(e.delegated)return{redirectUri:`${e.runtimeWorkerBaseUrl??r}/auth/callback`,state:{source:`opener`,path:`/auth/callback`,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 C(){if(b)return b;if(w){try{let e=await fetch(`${p()}/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return b=t.oauth.github,b}}catch{}return y.clientId}try{let e=await fetch(`/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return b=t.oauth.github,t.trayWorkerBaseUrl&&(x=t.trayWorkerBaseUrl),b;if(t.trayWorkerBaseUrl){x=t.trayWorkerBaseUrl;let e=await fetch(`${t.trayWorkerBaseUrl}/api/runtime-config`);if(e.ok){let t=await e.json();if(t.oauth?.github)return b=t.oauth.github,b}}}}catch{}return y.clientId}var w=typeof globalThis<`u`&&typeof globalThis.chrome?.runtime?.id==`string`;function T(){return t().find(e=>e.providerId===`github`)}function E(e){try{return new URL(e).searchParams.get(`code`)}catch{return null}}async function D(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 O(e,t){return`${e}+${t}@users.noreply.github.com`}async function k(e){try{let{VirtualFS:t}=await r(async()=>{let{VirtualFS:e}=await import(`./fs-BEbWmRDq.js`);return{VirtualFS:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]));await(await t.create({dbName:d})).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 A(){try{let{VirtualFS:e}=await r(async()=>{let{VirtualFS:e}=await import(`./fs-BEbWmRDq.js`);return{VirtualFS:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]));await(await e.create({dbName:d})).rm(`/workspace/.git/github-token`),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`github-token-changed`))}catch{}}async function j(e){let t=await n(`github`);if(t.maskedValue){await k(t.maskedValue);return}e?.clearOnFailure&&await A()}async function M(e){if(!(!e.login||e.id===void 0))try{let{VirtualFS:t}=await r(async()=>{let{VirtualFS:e}=await import(`./fs-BEbWmRDq.js`);return{VirtualFS:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])),{readGlobalGitConfigValue:n,writeGlobalGitConfigValue:i}=await r(async()=>{let{readGlobalGitConfigValue:e,writeGlobalGitConfigValue:t}=await import(`./git-config-D2u6LGfT.js`);return{readGlobalGitConfigValue:e,writeGlobalGitConfigValue:t}},[]),a=await t.create({dbName:d}),o=e.name||e.login,s=O(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 N=c();async function P(){try{let t=T();if(!t?.refreshToken)return null;let n=await _({provider:`github`,refreshToken:t.refreshToken});return await e({providerId:`github`,accessToken:n.access_token,refreshToken:n.refresh_token,tokenExpiresAt:n.expires_in?Date.now()+n.expires_in*1e3:void 0,userName:t.userName,userAvatar:t.userAvatar,scopes:n.scope??t.scopes}),await j({clearOnFailure:!0}),n.access_token}catch(e){return console.warn(`[github] Silent renewal failed:`,e instanceof Error?e.message:String(e)),null}}var F=1e4;async function I(){let e=T()?.accessToken;if(!e)return{status:`unknown`,detail:`no stored token`};try{let t=await fetch(`https://api.github.com/user`,{headers:{Authorization:`Bearer ${e}`,Accept:`application/vnd.github+json`},signal:AbortSignal.timeout(F)});if(t.ok){let e=await t.json().catch(()=>({}));return{status:`accepted`,userName:e.name||e.login}}return L(t)}catch(e){return{status:`unknown`,detail:e instanceof Error?e.message:String(e)}}}function L(e){let t=`HTTP ${e.status}${e.statusText?` ${e.statusText}`:``}`;return e.status===401?{status:`rejected`,detail:t}:e.status===403&&R(e)?{status:`unknown`,detail:`${t} (rate limited)`}:{status:`unknown`,detail:t}}function R(e){return e.headers.get(`x-ratelimit-remaining`)===`0`||e.headers.has(`retry-after`)}async function z(){await j()}async function B(){let e=T();if(!e?.accessToken)throw Error(`Not logged in to GitHub — please log in first`);if((e.tokenExpiresAt??1/0)-Date.now()>6e4)return await z(),e.accessToken;let t=await N.run(()=>P());if(t)return t;let n=T();if((n?.tokenExpiresAt??1/0)-Date.now()>0&&n?.accessToken)return await z(),n.accessToken;throw Error(`GitHub session expired — please log in again`)}var V={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,r)=>{let i=await C();if(!i)throw Error(`GitHub OAuth not configured — no client ID available`);let a=r?.scopes??y.scopes,s=w?null:await l(),c=!w&&await u(),d=crypto.randomUUID(),f=w?chrome.runtime.id:``,{redirectUri:m,state:h}=S({isExtension:w,isConnectMode:!!globalThis.__slicc_connect_mode,workerBaseUrl:p(),runtimeWorkerBaseUrl:x,pageOrigin:s?.origin??null,pageHref:s?.href??null,bridgeApiBaseUrl:o(),delegated:c,extensionId:f,nonce:d}),_=btoa(JSON.stringify(h)),v=d,b=new URLSearchParams({client_id:i,scope:a,redirect_uri:m});_&&b.set(`state`,_);let T=await t(`https://github.com/login/oauth/authorize?${b}`);if(!T)return;if(v)try{if(new URL(T).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 O=E(T);if(!O){console.error(`[github] Could not extract authorization code from redirect URL`);return}let k=await g({provider:`github`,code:O,redirectUri:m}),A=await D(k.access_token);await e({providerId:`github`,accessToken:k.access_token,refreshToken:k.refresh_token,tokenExpiresAt:k.expires_in?Date.now()+k.expires_in*1e3:void 0,userName:A.name,userAvatar:A.avatar,scopes:k.scope}),await j({clearOnFailure:!0}),await M(A),n()},onSilentRenew:P,onValidateToken:I,getValidAccessToken:B,onOAuthLogout:async()=>{let t=T();t?.accessToken&&await v({provider:`github`,accessToken:t.accessToken}).catch(e=>console.warn(`[github] Token revocation failed:`,e instanceof Error?e.message:String(e))),await A(),await e({providerId:`github`,accessToken:``})},getOAuthLogoutUrl:e=>`https://github.com/logout`};export{O as buildNoreplyEmail,V as config,E as extractCodeFromUrl,B as getValidAccessToken,S as resolveGithubOAuthRedirect,M as syncGitIdentityFromGitHub};
|