diff --git a/dist/assets/index-BTLTjBAR.js b/dist/assets/index-Dkva_nfv.js
similarity index 95%
rename from dist/assets/index-BTLTjBAR.js
rename to dist/assets/index-Dkva_nfv.js
index 10a7320..991f240 100644
--- a/dist/assets/index-BTLTjBAR.js
+++ b/dist/assets/index-Dkva_nfv.js
@@ -131,51 +131,6 @@ const buildBody = () => {
}
return b;
};
-async function streamLocal(body, onDelta, signal) {
- const { USER: USER2, localDemoReply: localDemoReply2 } = window;
- const apiKey = USER2.apiKeyOpenRouter;
- if (!apiKey) {
- onDelta(localDemoReply2(), true);
- return;
- }
- try {
- const r = await fetch("https://openrouter.ai/api/v1/chat/completions", { method: "POST", headers: { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json", "HTTP-Referer": "https://sune.chat", "X-Title": "Sune" }, body: JSON.stringify(body), signal });
- if (!r.ok) throw new Error(`HTTP ${r.status}`);
- const reader = r.body.getReader(), dec = new TextDecoder();
- let buf = "";
- while (true) {
- const { done, value } = await reader.read();
- if (done) break;
- buf += dec.decode(value, { stream: true });
- const lines = buf.split("\n");
- buf = lines.pop();
- for (const line of lines) {
- if (line.startsWith("data: ")) {
- const d = line.slice(6);
- if (d === "[DONE]") {
- onDelta("", true);
- return;
- }
- try {
- const j = JSON.parse(d);
- const delta = j.choices?.[0]?.delta?.content || "";
- const reasoning = j.choices?.[0]?.delta?.reasoning;
- const imgs = j.choices?.[0]?.delta?.images;
- if (reasoning && body.reasoning?.exclude !== true) onDelta(reasoning, false);
- if (delta) onDelta(delta, false);
- if (imgs) onDelta("", false, imgs);
- } catch {
- }
- }
- }
- }
- onDelta("", true);
- } catch (e) {
- if (e.name !== "AbortError") onDelta(`
-
-Error: ${e.message}`, true);
- }
-}
async function streamORP(body, onDelta, streamId) {
const { USER: USER2, SUNE: SUNE2, state: state2, gid: gid2, cacheStore: cacheStore2 } = window;
const model = SUNE2.model, provider = model.startsWith("oai:") ? "openai" : model.startsWith("g:") ? "google" : model.startsWith("cla:") ? "claude" : model.startsWith("cf:") ? "cloudflare" : model.startsWith("or:") ? "openrouter" : USER2.provider;
@@ -228,15 +183,7 @@ async function streamORP(body, onDelta, streamId) {
return { ok: true, rid: r.rid };
}
async function streamChat(onDelta, streamId) {
- const { USER: USER2, state: state2 } = window;
const body = buildBody();
- if (!USER2.donor) {
- const c = new AbortController();
- state2.controller = c;
- await streamLocal(body, onDelta, c.signal);
- state2.controller = null;
- return { ok: true, rid: null };
- }
return await streamORP(body, onDelta, streamId);
}
(() => {
@@ -249,8 +196,8 @@ async function streamChat(onDelta, streamId) {
o != k && ((k = o) ? (history.pushState({ k: 1 }, ""), addEventListener("popstate", f)) : (removeEventListener("popstate", f), history.state?.k && history.back()));
};
})();
-const DEFAULT_MODEL = "google/gemini-3-pro-preview", DEFAULT_API_KEY = "";
-const el = window.el = Object.fromEntries(["topbar", "chat", "messages", "composer", "input", "sendBtn", "suneBtnTop", "suneModal", "suneURL", "settingsForm", "closeSettings", "cancelSettings", "tabModel", "tabPrompt", "tabScript", "panelModel", "panelPrompt", "panelScript", "set_model", "set_temperature", "set_top_p", "set_top_k", "set_frequency_penalty", "set_repetition_penalty", "set_min_p", "set_top_a", "set_verbosity", "set_reasoning_effort", "set_system_prompt", "set_hide_composer", "set_include_thoughts", "set_json_output", "set_img_output", "set_aspect_ratio", "set_image_size", "aspectRatioContainer", "set_ignore_master_prompt", "deleteSuneBtn", "sidebarLeft", "sidebarOverlayLeft", "sidebarBtnLeft", "suneList", "newSuneBtn", "userMenuBtn", "userMenu", "accountSettingsOption", "sunesImportOption", "sunesExportOption", "threadsImportOption", "importInput", "sidebarBtnRight", "sidebarRight", "sidebarOverlayRight", "threadList", "closeThreads", "threadPopover", "sunePopover", "footer", "attachBtn", "attachBadge", "fileInput", "htmlEditor", "extensionHtmlEditor", "jsonSchemaEditor", "htmlTab_index", "htmlTab_extension", "suneHtml", "accountSettingsModal", "accountSettingsForm", "closeAccountSettings", "cancelAccountSettings", "set_master_prompt", "set_provider", "set_api_key_or", "set_api_key_oai", "set_api_key_g", "set_api_key_claude", "set_api_key_cf", "set_title_model", "copySystemPrompt", "pasteSystemPrompt", "copyHTML", "pasteHTML", "accountTabGeneral", "accountTabAPI", "accountPanelGeneral", "accountPanelAPI", "set_gh_token", "gcpSAInput", "gcpSAUploadBtn", "importAccountSettings", "exportAccountSettings", "importAccountSettingsInput", "accountTabUser", "accountPanelUser", "set_user_name", "userAvatarPreview", "setUserAvatarBtn", "userAvatarInput", "set_donor", "threadRepoInput", "threadBackBtn", "threadFolderBtn", "threadSyncBtn"].map((id) => [id, $("#" + id)[0]]));
+const DEFAULT_API_KEY = "";
+const el = window.el = Object.fromEntries(["topbar", "chat", "messages", "composer", "input", "sendBtn", "suneBtnTop", "suneModal", "suneURL", "settingsForm", "closeSettings", "cancelSettings", "tabModel", "tabPrompt", "tabScript", "panelModel", "panelPrompt", "panelScript", "set_model", "set_temperature", "set_top_p", "set_top_k", "set_frequency_penalty", "set_repetition_penalty", "set_min_p", "set_top_a", "set_verbosity", "set_reasoning_effort", "set_system_prompt", "set_hide_composer", "set_include_thoughts", "set_json_output", "set_img_output", "set_aspect_ratio", "set_image_size", "aspectRatioContainer", "set_ignore_master_prompt", "deleteSuneBtn", "sidebarLeft", "sidebarOverlayLeft", "sidebarBtnLeft", "suneList", "newSuneBtn", "userMenuBtn", "userMenu", "accountSettingsOption", "sunesImportOption", "sunesExportOption", "threadsImportOption", "importInput", "sidebarBtnRight", "sidebarRight", "sidebarOverlayRight", "threadList", "closeThreads", "threadPopover", "sunePopover", "footer", "attachBtn", "attachBadge", "fileInput", "htmlEditor", "extensionHtmlEditor", "jsonSchemaEditor", "htmlTab_index", "htmlTab_extension", "suneHtml", "accountSettingsModal", "accountSettingsForm", "closeAccountSettings", "cancelAccountSettings", "set_master_prompt", "set_provider", "set_api_key_or", "set_api_key_oai", "set_api_key_g", "set_api_key_claude", "set_api_key_cf", "set_title_model", "copySystemPrompt", "pasteSystemPrompt", "copyHTML", "pasteHTML", "accountTabGeneral", "accountTabAPI", "accountPanelGeneral", "accountPanelAPI", "set_gh_token", "gcpSAInput", "gcpSAUploadBtn", "importAccountSettings", "exportAccountSettings", "importAccountSettingsInput", "accountTabUser", "accountPanelUser", "set_user_name", "userAvatarPreview", "setUserAvatarBtn", "userAvatarInput", "threadRepoInput", "threadBackBtn", "threadFolderBtn", "threadSyncBtn"].map((id) => [id, $("#" + id)[0]]));
const icons = () => window.lucide && lucide.createIcons();
const haptic = () => /android/i.test(navigator.userAgent) && navigator.vibrate?.(1);
const clamp = (v, min, max) => Math.max(min, Math.min(max, v)), num = (v, d) => v == null || v === "" || isNaN(+v) ? d : +v, int = (v, d) => v == null || v === "" || isNaN(parseInt(v)) ? d : parseInt(v), gid = () => Math.random().toString(36).slice(2, 9), esc = (s) => String(s).replace(/[&<>'"`]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`" })[c]), positionPopover = (a, p) => {
@@ -315,8 +262,6 @@ const su = { key: "sunes_v1", activeKey: "active_sune_id", load() {
}, setActiveId(id) {
localStorage.setItem(this.activeKey, id || "");
} };
-const defaultSettings = { model: DEFAULT_MODEL, temperature: "", top_p: "", top_k: "", frequency_penalty: "", repetition_penalty: "", min_p: "", top_a: "", verbosity: "", reasoning_effort: "default", system_prompt: "", html: "", extension_html: "
Or you can prefix model names with or:, oai:, g:, or cla: to override.
Stored locally.
Used for auto-generating thread titles.
When enabled, streams go through a proxy which makes it possible to background the mobile app or tab while streaming and not lose your chat upon foregrounding.
-