mirror of
https://github.com/multipleof4/sune.git
synced 2026-02-04 10:08:00 +00:00
This build was committed by a bot.
This commit is contained in:
@@ -424,7 +424,7 @@ if (!sunes.length) {
|
|||||||
const def = SUNE.create({ name: "Default" });
|
const def = SUNE.create({ name: "Default" });
|
||||||
SUNE.setActive(def.id);
|
SUNE.setActive(def.id);
|
||||||
}
|
}
|
||||||
const state = window.state = { messages: [], busy: false, controller: null, currentThreadId: null, abortRequested: false, attachments: [], stream: { rid: null, bubble: null, meta: null, text: "", done: false }, viewingFile: false };
|
const state = window.state = { messages: [], busy: false, controller: null, currentThreadId: null, abortRequested: false, attachments: [], stream: { rid: null, bubble: null, meta: null, text: "", done: false } };
|
||||||
const getModelShort = (m) => {
|
const getModelShort = (m) => {
|
||||||
const mm = m || SUNE.model || "";
|
const mm = m || SUNE.model || "";
|
||||||
return mm.includes("/") ? mm.split("/").pop() : mm;
|
return mm.includes("/") ? mm.split("/").pop() : mm;
|
||||||
@@ -480,7 +480,7 @@ const reflectActiveSune = async () => {
|
|||||||
const a = SUNE.active;
|
const a = SUNE.active;
|
||||||
el.suneBtnTop.title = `Settings — ${a.name}`;
|
el.suneBtnTop.title = `Settings — ${a.name}`;
|
||||||
el.suneBtnTop.innerHTML = a.avatar ? `<img src="${esc(a.avatar)}" alt="" class="h-8 w-8 rounded-full object-cover"/>` : "✺";
|
el.suneBtnTop.innerHTML = a.avatar ? `<img src="${esc(a.avatar)}" alt="" class="h-8 w-8 rounded-full object-cover"/>` : "✺";
|
||||||
el.footer.classList.toggle("hidden", !!a.settings.hide_composer || state.viewingFile);
|
el.footer.classList.toggle("hidden", !!a.settings.hide_composer);
|
||||||
await renderSuneHTML();
|
await renderSuneHTML();
|
||||||
icons();
|
icons();
|
||||||
};
|
};
|
||||||
@@ -588,8 +588,6 @@ const clearChat = () => {
|
|||||||
state.attachments = [];
|
state.attachments = [];
|
||||||
updateAttachBadge();
|
updateAttachBadge();
|
||||||
el.fileInput.value = "";
|
el.fileInput.value = "";
|
||||||
state.viewingFile = false;
|
|
||||||
el.footer.classList.toggle("hidden", !!SUNE.active?.settings?.hide_composer);
|
|
||||||
};
|
};
|
||||||
const payloadWithSampling = (b) => {
|
const payloadWithSampling = (b) => {
|
||||||
const o = Object.assign({}, b), s = SUNE, p = { temperature: num(s.temperature, null), top_p: num(s.top_p, null), top_k: int(s.top_k, null), frequency_penalty: num(s.frequency_penalty, null), repetition_penalty: num(s.repetition_penalty, null), min_p: num(s.min_p, null), top_a: num(s.top_a, null) };
|
const o = Object.assign({}, b), s = SUNE, p = { temperature: num(s.temperature, null), top_p: num(s.top_p, null), top_k: int(s.top_k, null), frequency_penalty: num(s.frequency_penalty, null), repetition_penalty: num(s.repetition_penalty, null), min_p: num(s.min_p, null), top_a: num(s.top_a, null) };
|
||||||
@@ -733,7 +731,7 @@ ${sysPrompt}` }], max_tokens: 20, temperature: 0.2 }) });
|
|||||||
};
|
};
|
||||||
const threadRow = (t) => {
|
const threadRow = (t) => {
|
||||||
const icon = t.type === "folder" ? "folder" : t.type === "file" ? "file-text" : "";
|
const icon = t.type === "folder" ? "folder" : t.type === "file" ? "file-text" : "";
|
||||||
return `<div class="relative flex items-center gap-2 px-3 py-2 ${t.pinned ? "bg-yellow-50" : ""}"><button data-open-thread="${t.id}" data-type="${t.type || "thread"}" class="flex-1 text-left truncate flex items-center gap-2">${icon ? `<i data-lucide="${icon}" class="h-4 w-4"></i>` : ""}${t.pinned ? "📌 " : ""}${esc(t.title || "Untitled")}${t.status === "modified" ? "*" : t.status === "new" ? "+" : ""}</button>${t.type === "folder" ? "" : `<button data-thread-menu="${t.id}" class="h-8 w-8 rounded hover:bg-gray-100 flex items-center justify-center" title="More"><i data-lucide="more-horizontal" class="h-4 w-4"></i></button>`}</div>`;
|
return `<div class="relative flex items-center gap-2 px-3 py-2 ${t.pinned ? "bg-yellow-50" : ""}"><button data-open-thread="${t.id}" data-type="${t.type || "thread"}" class="flex-1 text-left truncate flex items-center gap-2">${icon ? `<i data-lucide="${icon}" class="h-4 w-4"></i>` : ""}${t.pinned ? "📌 " : ""}${esc(t.title || "Untitled")}${t.status === "modified" ? "*" : t.status === "new" ? "+" : ""}</button>${t.type === "file" ? "" : `<button data-thread-menu="${t.id}" class="h-8 w-8 rounded hover:bg-gray-100 flex items-center justify-center" title="More"><i data-lucide="more-horizontal" class="h-4 w-4"></i></button>`}</div>`;
|
||||||
};
|
};
|
||||||
let sortedThreads = [], isAddingThreads = false;
|
let sortedThreads = [], isAddingThreads = false;
|
||||||
const THREAD_PAGE_SIZE = 50;
|
const THREAD_PAGE_SIZE = 50;
|
||||||
@@ -775,25 +773,16 @@ $(el.threadList).on("click", async (e) => {
|
|||||||
if (openBtn) {
|
if (openBtn) {
|
||||||
const id = openBtn.getAttribute("data-open-thread"), type = openBtn.getAttribute("data-type");
|
const id = openBtn.getAttribute("data-open-thread"), type = openBtn.getAttribute("data-type");
|
||||||
if (type === "file") {
|
if (type === "file") {
|
||||||
if (id.toLowerCase().endsWith(".md")) {
|
const u2 = el.threadRepoInput.value.trim();
|
||||||
const u2 = el.threadRepoInput.value.trim();
|
if (u2.startsWith("gh://")) {
|
||||||
if (u2.startsWith("gh://")) {
|
const info = parseGhUrl(u2);
|
||||||
const info = parseGhUrl(u2);
|
try {
|
||||||
try {
|
await navigator.clipboard.writeText(`${info.owner}/${info.repo}/${id}`);
|
||||||
const res = await ghApi(`${info.apiPath}/${id}?ref=${info.branch}`);
|
const old = openBtn.innerHTML;
|
||||||
if (res && res.content) {
|
openBtn.innerHTML = '<i data-lucide="check" class="h-4 w-4 text-green-500"></i> Copied Path';
|
||||||
const content = btou(res.content);
|
icons();
|
||||||
clearChat();
|
setTimeout(() => (openBtn.innerHTML = old, icons()), 1200);
|
||||||
state.viewingFile = true;
|
} catch {
|
||||||
el.footer.classList.add("hidden");
|
|
||||||
addMessage({ role: "system", content: [{ type: "text", text: content }], sune_name: "File Preview", model: id });
|
|
||||||
el.sidebarRight.classList.add("translate-x-full");
|
|
||||||
el.sidebarOverlayRight.classList.add("hidden");
|
|
||||||
hideThreadPopover();
|
|
||||||
}
|
|
||||||
} catch (e2) {
|
|
||||||
console.error("File fetch failed", e2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -870,24 +859,8 @@ $(el.threadPopover).on("click", async (e) => {
|
|||||||
const act = e.target.closest("[data-action]")?.getAttribute("data-action");
|
const act = e.target.closest("[data-action]")?.getAttribute("data-action");
|
||||||
if (!act || !menuThreadId) return;
|
if (!act || !menuThreadId) return;
|
||||||
const th = THREAD.get(menuThreadId);
|
const th = THREAD.get(menuThreadId);
|
||||||
const u = el.threadRepoInput.value.trim(), prefix = u.startsWith("gh://") ? "rem_t_" : "t_";
|
|
||||||
if (act === "copy_path") {
|
|
||||||
if (u.startsWith("gh://")) {
|
|
||||||
const info = parseGhUrl(u);
|
|
||||||
try {
|
|
||||||
await navigator.clipboard.writeText(`${info.owner}/${info.repo}@${info.branch}/${menuThreadId}`);
|
|
||||||
const btn = e.target.closest("[data-action]");
|
|
||||||
const old = btn.innerHTML;
|
|
||||||
btn.innerHTML = '<i data-lucide="check" class="h-4 w-4 text-green-500"></i><span>Copied!</span>';
|
|
||||||
icons();
|
|
||||||
setTimeout(() => (btn.innerHTML = old, icons()), 1200);
|
|
||||||
} catch {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
hideThreadPopover();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!th) return;
|
if (!th) return;
|
||||||
|
const u = el.threadRepoInput.value.trim(), prefix = u.startsWith("gh://") ? "rem_t_" : "t_";
|
||||||
if (act === "pin") {
|
if (act === "pin") {
|
||||||
th.pinned = !th.pinned;
|
th.pinned = !th.pinned;
|
||||||
if (u.startsWith("gh://") && th.status !== "new") th.status = "modified";
|
if (u.startsWith("gh://") && th.status !== "new") th.status = "modified";
|
||||||
4
dist/index.html
vendored
4
dist/index.html
vendored
@@ -12,7 +12,7 @@
|
|||||||
<script defer src="https://cdn.jsdelivr.net/npm/cash-dom/dist/cash.min.js"></script>
|
<script defer src="https://cdn.jsdelivr.net/npm/cash-dom/dist/cash.min.js"></script>
|
||||||
<script defer src="//unpkg.com/alpinejs"></script>
|
<script defer src="//unpkg.com/alpinejs"></script>
|
||||||
|
|
||||||
<script type="module" crossorigin src="/assets/index-DlMcCiOg.js"></script>
|
<script type="module" crossorigin src="/assets/index-zttrb_rF.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-JLEDB1oP.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-JLEDB1oP.css">
|
||||||
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
||||||
<body class="bg-white text-gray-900 selection:bg-black/10" x-data @click.window="if($event.target.closest('button')) haptic(); if(!document.getElementById('threadPopover').contains($event.target)&&!$event.target.closest('[data-thread-menu]')) hideThreadPopover(); if(!document.getElementById('sunePopover').contains($event.target)&&!$event.target.closest('[data-sune-menu]')) hideSunePopover(); if(!document.getElementById('userMenu').contains($event.target)&&!document.getElementById('userMenuBtn').contains($event.target)) document.getElementById('userMenu').classList.add('hidden')">
|
<body class="bg-white text-gray-900 selection:bg-black/10" x-data @click.window="if($event.target.closest('button')) haptic(); if(!document.getElementById('threadPopover').contains($event.target)&&!$event.target.closest('[data-thread-menu]')) hideThreadPopover(); if(!document.getElementById('sunePopover').contains($event.target)&&!$event.target.closest('[data-sune-menu]')) hideSunePopover(); if(!document.getElementById('userMenu').contains($event.target)&&!document.getElementById('userMenuBtn').contains($event.target)) document.getElementById('userMenu').classList.add('hidden')">
|
||||||
@@ -72,7 +72,6 @@
|
|||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<div id="threadPopover" class="menu-card hidden">
|
<div id="threadPopover" class="menu-card hidden">
|
||||||
<button data-action="copy_path" class="menu-item"><i data-lucide="link" class="h-4 w-4"></i><span>Copy file path</span></button>
|
|
||||||
<button data-action="pin" class="menu-item"><i data-lucide="pin" class="h-4 w-4"></i><span>Pin to top</span></button>
|
<button data-action="pin" class="menu-item"><i data-lucide="pin" class="h-4 w-4"></i><span>Pin to top</span></button>
|
||||||
<button data-action="rename" class="menu-item"><i data-lucide="edit-3" class="h-4 w-4"></i><span>Rename</span></button>
|
<button data-action="rename" class="menu-item"><i data-lucide="edit-3" class="h-4 w-4"></i><span>Rename</span></button>
|
||||||
<button data-action="duplicate" class="menu-item"><i data-lucide="copy" class="h-4 w-4"></i><span>Duplicate</span></button>
|
<button data-action="duplicate" class="menu-item"><i data-lucide="copy" class="h-4 w-4"></i><span>Duplicate</span></button>
|
||||||
@@ -195,6 +194,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input id="importAccountSettingsInput" type="file" class="hidden" accept="application/json,.json">
|
<input id="importAccountSettingsInput" type="file" class="hidden" accept="application/json,.json">
|
||||||
|
|
||||||
|
|
||||||
<script src="https://unpkg.com/lucide@latest"></script>
|
<script src="https://unpkg.com/lucide@latest"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/markdown-it@14.1.0/dist/markdown-it.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/markdown-it@14.1.0/dist/markdown-it.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
|
||||||
|
|||||||
2
dist/sw.js
vendored
2
dist/sw.js
vendored
@@ -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 l=e=>s(e,t),c={module:{uri:t},exports:o,require:l};i[t]=Promise.all(n.map(e=>c[e]||l(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:"a0a7a57f36d4eef4c193f0a58a3f6299"},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"assets/index-DlMcCiOg.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 c=e=>i(e,t),l={module:{uri:t},exports:o,require:c};s[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:"6c855cd336a940f88841eea571238a2d"},{url:"assets/index-zttrb_rF.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")))});
|
||||||
|
|||||||
Reference in New Issue
Block a user