From a4a4495909d57d976821e7e70eac4a2094090808 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 26 Aug 2025 21:27:45 +0000 Subject: [PATCH] This build was committed by a bot. --- .gitignore | 1 - {docs => dist}/.nojekyll | 0 {docs => dist}/.well-known/assetlinks.json | 0 {docs => dist}/CNAME | 0 .../appstore_content/screenshot1.jpg | Bin .../appstore_content/screenshot2.jpg | Bin .../appstore_content/screenshot3.jpg | Bin .../appstore_content/screenshot4.jpg | Bin .../appstore_content/screenshot5.jpg | Bin .../appstore_content/screenshot6.jpg | Bin {docs => dist}/appstore_content/✺.png | Bin {docs => dist}/index.html | 6 +- {docs => dist}/manifest.webmanifest | 0 {docs => dist}/registerSW.js | 0 {docs => dist}/sw.js | 2 +- {docs => dist}/workbox-5ffe50d4.js | 0 {docs => dist}/✺.avif | Bin index.html | 100 ++++++------------ readme.md | 10 +- readme/FunctionCalling.md | 21 ---- vite.config.js | 2 +- 21 files changed, 45 insertions(+), 97 deletions(-) rename {docs => dist}/.nojekyll (100%) rename {docs => dist}/.well-known/assetlinks.json (100%) rename {docs => dist}/CNAME (100%) rename {docs => dist}/appstore_content/screenshot1.jpg (100%) rename {docs => dist}/appstore_content/screenshot2.jpg (100%) rename {docs => dist}/appstore_content/screenshot3.jpg (100%) rename {docs => dist}/appstore_content/screenshot4.jpg (100%) rename {docs => dist}/appstore_content/screenshot5.jpg (100%) rename {docs => dist}/appstore_content/screenshot6.jpg (100%) rename {docs => dist}/appstore_content/✺.png (100%) rename {docs => dist}/index.html (99%) rename {docs => dist}/manifest.webmanifest (100%) rename {docs => dist}/registerSW.js (100%) rename {docs => dist}/sw.js (80%) rename {docs => dist}/workbox-5ffe50d4.js (100%) rename {docs => dist}/✺.avif (100%) delete mode 100644 readme/FunctionCalling.md diff --git a/.gitignore b/.gitignore index b398d22..4f2a0d2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ pnpm-debug.log* lerna-debug.log* node_modules -dist dist-ssr *.local diff --git a/docs/.nojekyll b/dist/.nojekyll similarity index 100% rename from docs/.nojekyll rename to dist/.nojekyll diff --git a/docs/.well-known/assetlinks.json b/dist/.well-known/assetlinks.json similarity index 100% rename from docs/.well-known/assetlinks.json rename to dist/.well-known/assetlinks.json diff --git a/docs/CNAME b/dist/CNAME similarity index 100% rename from docs/CNAME rename to dist/CNAME diff --git a/docs/appstore_content/screenshot1.jpg b/dist/appstore_content/screenshot1.jpg similarity index 100% rename from docs/appstore_content/screenshot1.jpg rename to dist/appstore_content/screenshot1.jpg diff --git a/docs/appstore_content/screenshot2.jpg b/dist/appstore_content/screenshot2.jpg similarity index 100% rename from docs/appstore_content/screenshot2.jpg rename to dist/appstore_content/screenshot2.jpg diff --git a/docs/appstore_content/screenshot3.jpg b/dist/appstore_content/screenshot3.jpg similarity index 100% rename from docs/appstore_content/screenshot3.jpg rename to dist/appstore_content/screenshot3.jpg diff --git a/docs/appstore_content/screenshot4.jpg b/dist/appstore_content/screenshot4.jpg similarity index 100% rename from docs/appstore_content/screenshot4.jpg rename to dist/appstore_content/screenshot4.jpg diff --git a/docs/appstore_content/screenshot5.jpg b/dist/appstore_content/screenshot5.jpg similarity index 100% rename from docs/appstore_content/screenshot5.jpg rename to dist/appstore_content/screenshot5.jpg diff --git a/docs/appstore_content/screenshot6.jpg b/dist/appstore_content/screenshot6.jpg similarity index 100% rename from docs/appstore_content/screenshot6.jpg rename to dist/appstore_content/screenshot6.jpg diff --git a/docs/appstore_content/✺.png b/dist/appstore_content/✺.png similarity index 100% rename from docs/appstore_content/✺.png rename to dist/appstore_content/✺.png diff --git a/docs/index.html b/dist/index.html similarity index 99% rename from docs/index.html rename to dist/index.html index 306fc3f..7e47f6d 100644 --- a/docs/index.html +++ b/dist/index.html @@ -231,7 +231,7 @@ window.addEventListener('resize',()=>{hideHistoryMenu();hideSuneMenu()}) init() const WS_BASE='wss://orp.awww.workers.dev/ws' const buildBody=()=>{const msgs=[];if(store.masterPrompt)msgs.push({role:'system',content:[{type:'text',text:store.masterPrompt}]});if(store.system_prompt)msgs.push({role:'system',content:[{type:'text',text:store.system_prompt}]});msgs.push(...state.messages.filter(m=>m.role!=='system').map(m=>({role:m.role,content:m.content})));const b=payloadWithSampling({model:store.model,messages:msgs,stream:true});if(store.reasoning_effort&&store.reasoning_effort!=='default')b.reasoning={effort:store.reasoning_effort};if(store.verbosity)b.verbosity=store.verbosity;return b} -async function askOpenRouterStreaming(onDelta,streamId){if(!store.apiKey){const t=localDemoReply();onDelta(t,true);return {ok:true,rid:streamId||null}}const r={rid:streamId||gid(),seq:-1,done:false,signaled:false,ws:null};const signal=t=>{if(!r.signaled){r.signaled=true;onDelta(t||'',true)}};const ws=new WebSocket(WS_BASE+'?uid='+encodeURIComponent(r.rid));r.ws=ws;ws.onopen=()=>ws.send(JSON.stringify({type:'begin',rid:r.rid,provider:store.provider,apiKey:store.apiKey,or_body:buildBody()}));ws.onmessage=e=>{let m;try{m=JSON.parse(e.data)}catch{return}if(m.type==='delta'&&typeof m.seq==='number'&&m.seq>r.seq){r.seq=m.seq;onDelta(m.text||'',false)}else if(m.type==='done'){r.done=true;signal('');ws.close()}else if(m.type==='err'){r.done=true;signal('\n\n'+(m.message||'error'));ws.close()}};ws.onclose=()=>{};ws.onerror=()=>{};state.controller={abort:()=>{r.done=true;try{ws.send(JSON.stringify({type:'stop',rid:r.rid}))}catch{}try{ws.close()}catch{}signal('')}};return {ok:true,rid:r.rid}} +async function askOpenRouterStreaming(onDelta,streamId){if(!store.apiKey){const t=localDemoReply();onDelta(t,true);return {ok:true,rid:streamId||null}}const r={rid:streamId||gid(),seq:-1,done:false,signaled:false,ws:null};const signal=t=>{if(!r.signaled){r.signaled=true;onDelta(t||'',true)}};const ws=new WebSocket(WS_BASE+'?uid='+encodeURIComponent(r.rid));r.ws=ws;ws.onopen=()=>ws.send(JSON.stringify({type:'begin',rid:r.rid,provider:store.provider,apiKey:store.apiKey,or_body:buildBody()}));ws.onmessage=e=>{let m;try{m=JSON.parse(e.data)}catch{return}if(m.type==='delta'&&typeof m.seq==='number'&&m.seq>r.seq){r.seq=m.seq;onDelta(m.text||'',false)}else if(m.type==='done'){r.done=true;signal('');ws.close()}else if(m.type==='err'){r.done=true;signal('\n\n'+(m.message||'error'));ws.close()}};ws.onclose=()=>{};ws.onerror=()=>{};state.controller={abort:()=>{r.done=true;try{if(ws.readyState===1)ws.send(JSON.stringify({type:'stop',rid:r.rid}))}catch{}signal('')}};return {ok:true,rid:r.rid}} function openAccountSettings(){el.set_provider.value=store.provider||'openrouter';el.set_api_key_or.value=store.apiKeyOR||'';el.set_api_key_oai.value=store.apiKeyOAI||'';el.set_master_prompt.value=store.masterPrompt||'';el.accountSettingsModal.classList.remove('hidden')} function closeAccountSettings(){el.accountSettingsModal.classList.add('hidden')} el.accountSettingsOption.addEventListener('click',()=>{el.userMenu.classList.add('hidden');openAccountSettings()}) @@ -245,8 +245,8 @@ const lastAssistantId=()=>{const a=[...el.messages.querySelectorAll('.msg-bubble const getBubbleById=id=>el.messages.querySelector(`.msg-bubble[data-mid="${CSS.escape(id)}"]`) async function syncTranscript(){const id=lastAssistantId();if(!id)return false;const bubble=getBubbleById(id);if(!bubble)return false;const j=await fetchTranscript(id).catch(()=>null);if(!j||j.rid!==id){if(j&&j.error){setBtnSend();state.busy=false;const t=(bubble.textContent||'')+'\n\n'+j.error;renderMarkdown(bubble,t,{enhance:false});enhanceCodeBlocks(bubble,true);const i=state.messages.findIndex(m=>m.id===id);if(i>=0)state.messages[i].content=[{type:'text',text:t}];else state.messages.push({id,role:'assistant',content:[{type:'text',text:t}]});persistThread()}return false}const t=j.text||'';renderMarkdown(bubble,t,{enhance:false});if(j.error||j.done||j.phase==='done'){setBtnSend();state.busy=false;enhanceCodeBlocks(bubble,true);const i=state.messages.findIndex(m=>m.id===id);if(i>=0)state.messages[i].content=[{type:'text',text:t}];else state.messages.push({id,role:'assistant',content:[{type:'text',text:t}]});persistThread();return false}return true} let syncLoopRunning=false -const syncKick=r=>{if(document.visibilityState!=='hidden')setTimeout(()=>syncLoop(r),0)} -async function syncLoop(){if(syncLoopRunning)return;const id=lastAssistantId();if(!id)return;syncLoopRunning=true;try{for(;;){const cont=await syncTranscript().catch(()=>false);if(!cont)break;await new Promise(r=>setTimeout(r,1200))}}finally{syncLoopRunning=false}} +const syncKick=r=>{if(!state.busy||document.visibilityState==='hidden')return;setTimeout(()=>syncLoop(r),0)} +async function syncLoop(){if(!state.busy||syncLoopRunning)return;const id=lastAssistantId();if(!id)return;syncLoopRunning=true;try{for(;;){if(!state.busy)break;const cont=await syncTranscript().catch(()=>false);if(!cont)break;await new Promise(r=>setTimeout(r,1200))}}finally{syncLoopRunning=false}} ;['focus','pageshow'].forEach(ev=>window.addEventListener(ev,()=>syncKick(ev))) document.addEventListener('visibilitychange',()=>{if(document.visibilityState==='visible')syncKick('visible')}) el.copySystemPrompt.addEventListener('click',async()=>{try{await navigator.clipboard.writeText(el.set_system_prompt.value||'')}catch{}}) diff --git a/docs/manifest.webmanifest b/dist/manifest.webmanifest similarity index 100% rename from docs/manifest.webmanifest rename to dist/manifest.webmanifest diff --git a/docs/registerSW.js b/dist/registerSW.js similarity index 100% rename from docs/registerSW.js rename to dist/registerSW.js diff --git a/docs/sw.js b/dist/sw.js similarity index 80% rename from docs/sw.js rename to dist/sw.js index 80951b0..e329606 100644 --- a/docs/sw.js +++ b/dist/sw.js @@ -1 +1 @@ -if(!self.define){let e,i={};const t=(t,n)=>(t=new URL(t+".js",n).href,i[t]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=t,e.onload=i,document.head.appendChild(e)}else e=t,importScripts(t),i()}).then(()=>{let e=i[t];if(!e)throw new Error(`Module ${t} didn’t register its module`);return e}));self.define=(n,r)=>{const s=e||("document"in self?document.currentScript.src:"")||location.href;if(i[s])return;let o={};const c=e=>t(e,s),d={module:{uri:s},exports:o,require:c};i[s]=Promise.all(n.map(e=>d[e]||c(e))).then(e=>(r(...e),o))}}define(["./workbox-5ffe50d4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.html",revision:"806ca7b504dca47012ba05e0c3ddfc58"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); +if(!self.define){let e,i={};const t=(t,n)=>(t=new URL(t+".js",n).href,i[t]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=t,e.onload=i,document.head.appendChild(e)}else e=t,importScripts(t),i()}).then(()=>{let e=i[t];if(!e)throw new Error(`Module ${t} didn’t register its module`);return e}));self.define=(n,r)=>{const s=e||("document"in self?document.currentScript.src:"")||location.href;if(i[s])return;let o={};const d=e=>t(e,s),c={module:{uri:s},exports:o,require:d};i[s]=Promise.all(n.map(e=>c[e]||d(e))).then(e=>(r(...e),o))}}define(["./workbox-5ffe50d4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.html",revision:"6d99841722e382c2daa63eee681189df"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); diff --git a/docs/workbox-5ffe50d4.js b/dist/workbox-5ffe50d4.js similarity index 100% rename from docs/workbox-5ffe50d4.js rename to dist/workbox-5ffe50d4.js diff --git a/docs/✺.avif b/dist/✺.avif similarity index 100% rename from docs/✺.avif rename to dist/✺.avif diff --git a/index.html b/index.html index e372780..a0d1325 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@ - +
@@ -122,16 +122,7 @@

Stored locally.

Stored locally.

Stored locally.

-
-
- - -
-
- - -
-
+
@@ -141,27 +132,14 @@ diff --git a/readme.md b/readme.md index 9500c87..8d37dc5 100644 --- a/readme.md +++ b/readme.md @@ -1,18 +1,18 @@ -.![Main](./docs/appstore_content/screenshot1.jpg) +![Main](./public/appstore_content/screenshot1.jpg) > Each sune is like a module. You can have many. And share them. -![Sunes](./docs/appstore_content/screenshot6.jpg) +![Sunes](./public/appstore_content/screenshot6.jpg) -![Setting](./docs/appstore_content/screenshot3.jpg) +![Setting](./public/appstore_content/screenshot3.jpg) 💠 New! > You can have scripts which run on the page of each sune — either to function call or extend functionality of the app or sune. -![Scripting](./docs/appstore_content/screenshot4.jpg) +![Scripting](./public/appstore_content/screenshot4.jpg) Here is an example of some HTML/JS artwork. -![Art](./docs/appstore_content/screenshot5.jpg) +![Art](./public/appstore_content/screenshot5.jpg) ``` diff --git a/readme/FunctionCalling.md b/readme/FunctionCalling.md deleted file mode 100644 index 92baa14..0000000 --- a/readme/FunctionCalling.md +++ /dev/null @@ -1,21 +0,0 @@ -Sune function call (have Sunes attach files to their latest bubble) - -In your Sune script, call: -```js -await window.suneAttach(files, { toAPI: false, tree: true }) -``` -files can be File objects or simple objects like: -```js -{ name: 'report.pdf', mime: 'application/pdf', data: '', size: 123456 } -``` -`toAPI: true` adds an assistant message containing the actual file parts (so the API can consume them next turn). - -`tree: true` adds the separate Attachments tree bubble with clickable downloads. - - -Examples: -```js -await window.suneAttach([fileInput.files[0]]) -await window.suneAttach([{name:'cat.png',mime:'image/png',data:''}]) -``` -If you want only the tree bubble and not re-send data to the API, set {toAPI:false, tree:true}. diff --git a/vite.config.js b/vite.config.js index 8e53061..4706496 100644 --- a/vite.config.js +++ b/vite.config.js @@ -36,4 +36,4 @@ const html = createHtmlPlugin({ } }) -export default defineConfig({ build: { outDir: 'docs', minify: false }, plugins: [pwa, html] }) +export default defineConfig({ build: { minify: false }, plugins: [pwa, html] })