From b47bcf0fe3bf234621c23ceb9df441b4b60892b2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 22:41:16 +0000 Subject: [PATCH] This build was committed by a bot. --- .../{index-DiYgOCm5.js => index-ZFLC2W_P.js} | 40 ++++++++++++------- dist/index.html | 2 +- dist/sw.js | 2 +- 3 files changed, 28 insertions(+), 16 deletions(-) rename dist/assets/{index-DiYgOCm5.js => index-ZFLC2W_P.js} (99%) diff --git a/dist/assets/index-DiYgOCm5.js b/dist/assets/index-ZFLC2W_P.js similarity index 99% rename from dist/assets/index-DiYgOCm5.js rename to dist/assets/index-ZFLC2W_P.js index 5e2065a..0e9ff00 100644 --- a/dist/assets/index-DiYgOCm5.js +++ b/dist/assets/index-ZFLC2W_P.js @@ -274,7 +274,18 @@ const imgToWebp = (f, D = 128, q = 80) => new Promise((r, j) => { i.src = URL.createObjectURL(f); }); const b64 = (x) => x.split(",")[1] || ""; -const utob = (s) => btoa(unescape(encodeURIComponent(s))); +const utob = (s) => btoa(unescape(encodeURIComponent(s))), btou = (s) => decodeURIComponent(escape(atob(s.replace(/\s/g, "")))); +const ghApi = async (path, method = "GET", body = null) => { + const t = USER.githubToken; + if (!t) throw new Error("No GH token"); + const r = await fetch(`https://api.github.com/repos/${path}`, { method, headers: { "Authorization": `token ${t}`, "Accept": "application/vnd.github.v3+json", "Content-Type": "application/json" }, body: body ? JSON.stringify(body) : null }); + if (!r.ok && r.status !== 404) throw new Error(`GH API ${r.status}`); + return r.status === 404 ? null : r.json(); +}; +const parseGhUrl = (u) => { + const p = u.substring(5).split("/"), owner = p[0], repoPart = p[1] || "", branch = repoPart.includes("@") ? repoPart.split("@")[1] : "main", repo = repoPart.split("@")[0], path = p.slice(2).join("/").replace(/\/$/, ""); + return { owner, repo, branch, path, apiPath: `${owner}/${repo}/contents${path ? "/" + path : ""}` }; +}; const su = { key: "sunes_v1", activeKey: "active_sune_id", load() { try { return JSON.parse(localStorage.getItem(this.key) || "[]"); @@ -773,7 +784,18 @@ $(el.threadList).on("click", async (e) => { state.currentThreadId = id; clearChat(); const u = el.threadRepoInput.value.trim(), prefix = u.startsWith("gh://") ? "rem_t_" : "t_"; - const msgs = await localforage.getItem(prefix + id); + let msgs = await localforage.getItem(prefix + id); + if (!msgs && u.startsWith("gh://")) { + try { + const info = parseGhUrl(u), fileName = serializeThreadName(th), res = await ghApi(`${info.apiPath}/${fileName}?ref=${info.branch}`); + if (res && res.content) { + msgs = JSON.parse(btou(res.content)); + await localforage.setItem(prefix + id, msgs); + } + } catch (e2) { + console.error("Remote fetch failed", e2); + } + } state.messages = Array.isArray(msgs) ? [...msgs] : []; for (const m of state.messages) { const b = msgRow(m); @@ -1379,17 +1401,6 @@ el.htmlTab_index.textContent = "index.html"; el.htmlTab_extension.textContent = "extension.html"; el.htmlTab_index.onclick = () => showHtmlTab("index"); el.htmlTab_extension.onclick = () => showHtmlTab("extension"); -const ghApi = async (path, method = "GET", body = null) => { - const t = USER.githubToken; - if (!t) throw new Error("No GH token"); - const r = await fetch(`https://api.github.com/repos/${path}`, { method, headers: { "Authorization": `token ${t}`, "Accept": "application/vnd.github.v3+json", "Content-Type": "application/json" }, body: body ? JSON.stringify(body) : null }); - if (!r.ok && r.status !== 404) throw new Error(`GH API ${r.status}`); - return r.status === 404 ? null : r.json(); -}; -const parseGhUrl = (u) => { - const p = u.substring(5).split("/"), owner = p[0], repoPart = p[1] || "", branch = repoPart.includes("@") ? repoPart.split("@")[1] : "main", repo = repoPart.split("@")[0], path = p.slice(2).join("/").replace(/\/$/, ""); - return { owner, repo, branch, path, apiPath: `${owner}/${repo}/contents${path ? "/" + path : ""}` }; -}; $(el.threadRepoInput).on("change", async () => { const u = el.threadRepoInput.value.trim(); localStorage.setItem("thread_repo_url", u); @@ -1409,6 +1420,7 @@ $(el.threadBackBtn).on("click", () => { if (p.length > 3) { p.pop(); el.threadRepoInput.value = p.join("/"); + el.threadRepoInput.value = p.join("/"); el.threadRepoInput.dispatchEvent(new Event("change")); } }); @@ -1711,4 +1723,4 @@ $(el.pasteHTML).on("click", async () => { } catch { } }); -Object.assign(window, { icons, haptic, clamp, num, int, gid, esc, positionPopover, sid, fmtSize, asDataURL, b64, makeSune, getModelShort, resolveSuneSrc, processSuneIncludes, renderSuneHTML, reflectActiveSune, suneRow, enhanceCodeBlocks, getSuneLabel, _createMessageRow, msgRow, partsToText, addSuneBubbleStreaming, clearChat, payloadWithSampling, setBtnStop, setBtnSend, localDemoReply, titleFrom, serializeThreadName, deserializeThreadName, ensureThreadOnFirstUser, generateTitleWithAI, threadRow, renderThreads, hideThreadPopover, showThreadPopover, hideSunePopover, showSunePopover, updateAttachBadge, toAttach, ensureJars, openSettings, closeSettings, showTab, dl, ts, kbUpdate, kbBind, activeMeta, init, showHtmlTab, showAccountTab, openAccountSettings, closeAccountSettings, getBubbleById, syncActiveThread, syncWhileBusy, onForeground, getActiveHtmlParts, imgToWebp, cacheStore }); +Object.assign(window, { icons, haptic, clamp, num, int, gid, esc, positionPopover, sid, fmtSize, asDataURL, b64, makeSune, getModelShort, resolveSuneSrc, processSuneIncludes, renderSuneHTML, reflectActiveSune, suneRow, enhanceCodeBlocks, getSuneLabel, _createMessageRow, msgRow, partsToText, addSuneBubbleStreaming, clearChat, payloadWithSampling, setBtnStop, setBtnSend, localDemoReply, titleFrom, serializeThreadName, deserializeThreadName, ensureThreadOnFirstUser, generateTitleWithAI, threadRow, renderThreads, hideThreadPopover, showThreadPopover, hideSunePopover, showSunePopover, updateAttachBadge, toAttach, ensureJars, openSettings, closeSettings, showTab, dl, ts, kbUpdate, kbBind, activeMeta, init, showHtmlTab, showAccountTab, openAccountSettings, closeAccountSettings, getBubbleById, syncActiveThread, syncWhileBusy, onForeground, getActiveHtmlParts, imgToWebp, cacheStore, ghApi, parseGhUrl }); diff --git a/dist/index.html b/dist/index.html index d2b28c8..0ebdd15 100644 --- a/dist/index.html +++ b/dist/index.html @@ -12,7 +12,7 @@ - + diff --git a/dist/sw.js b/dist/sw.js index 384ab35..c21b026 100644 --- a/dist/sw.js +++ b/dist/sw.js @@ -1 +1 @@ -if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(i[t])return;let o={};const c=e=>s(e,t),l={module:{uri:t},exports:o,require:c};i[t]=Promise.all(n.map(e=>l[e]||c(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"0bdb9c92bc46620107f6d34ba6a9bbae"},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"assets/index-DiYgOCm5.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const d=e=>i(e,t),l={module:{uri:t},exports:o,require:d};s[t]=Promise.all(n.map(e=>l[e]||d(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"ee3a0cbe5bf8b1e5b886dbed2223626d"},{url:"assets/index-ZFLC2W_P.js",revision:null},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});