mirror of
https://github.com/sune-org/store.git
synced 2026-01-13 16:17:58 +00:00
Sync: Update sune 'Fetch Stream'
This commit is contained in:
@@ -1 +1 @@
|
|||||||
[{"id":"mpmar2o","name":"Fetch Stream","pinned":false,"avatar":"","url":"gh://sune-org/store@main/fetch-stream.sune","updatedAt":1757529704767,"settings":{"model":"openai/gpt-5","temperature":"","top_p":"","top_k":"","frequency_penalty":"","repetition_penalty":"","min_p":"","top_a":"","verbosity":"","reasoning_effort":"default","system_prompt":"","html":"<!-- Sune: Stream State Inspector -->\n<div id=\"sune_stream_inspector\">\n <!-- Trigger Button & UI -->\n <div class=\"p-2 flex justify-end items-center\">\n <button id=\"ssi_fetchBtn\" class=\"flex items-center gap-2 rounded-lg bg-slate-800/90 text-white px-3 py-1.5 text-xs font-medium shadow-md transition hover:bg-slate-700 active:scale-[0.98]\">\n <i data-lucide=\"binary\" class=\"h-4 w-4\"></i>\n <span>Inspect Last Stream</span>\n </button>\n </div>\n\n <!-- JSON Viewer Modal -->\n <div id=\"ssi_modal\" class=\"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/40 backdrop-blur-sm hidden\">\n <div id=\"ssi_modal_card\" class=\"relative w-full max-w-2xl rounded-2xl bg-white/80 backdrop-blur-xl border border-white/30 shadow-2xl flex flex-col max-h-[85vh]\">\n <!-- Soft UI Gradient Blob -->\n <div class=\"absolute top-0 right-0 w-64 h-64 bg-purple-400/50 rounded-full blur-3xl -z-10 -translate-y-1/2 translate-x-1/2\"></div>\n \n <!-- Header -->\n <div class=\"flex items-center justify-between p-4 border-b border-black/10\">\n <h3 class=\"font-semibold text-gray-800\">Stream State Viewer</h3>\n <button id=\"ssi_closeBtn\" class=\"p-1 rounded-md text-gray-500 hover:bg-black/10 hover:text-gray-800 transition\"><i data-lucide=\"x\" class=\"h-5 w-5\"></i></button>\n </div>\n\n <!-- Content -->\n <div class=\"p-1 flex-1 overflow-y-auto\">\n <pre class=\"h-full\"><code id=\"ssi_jsonContent\" class=\"block p-3 text-xs bg-gray-900/95 text-green-400 rounded-lg font-mono whitespace-pre-wrap break-all h-full\"></code></pre>\n </div>\n\n <!-- Footer -->\n <div class=\"p-2 text-right text-xs text-gray-400 border-t border-black/10\">\n v1.0.0\n </div>\n </div>\n </div>\n\n <script>\n (()=>{\n const d=document,\n btn=d.getElementById('ssi_fetchBtn'),\n modal=d.getElementById('ssi_modal'),\n closeBtn=d.getElementById('ssi_closeBtn'),\n jsonContent=d.getElementById('ssi_jsonContent'),\n originalBtnHTML=btn.innerHTML;\n\n const showModal=()=>{modal.classList.remove('hidden')},hideModal=()=>{modal.classList.add('hidden')};\n \n const fetchStreamState = async () => {\n if (!window.lastAssistantId) {\n alert('Master, the required function `lastAssistantId` is not available.');\n return;\n }\n \n const lastId = window.lastAssistantId();\n if (!lastId) {\n alert('No previous assistant response found to inspect.');\n return;\n }\n\n btn.disabled = true;\n btn.innerHTML = `<i data-lucide=\"loader-2\" class=\"h-4 w-4 animate-spin\"></i><span>Fetching...</span>`;\n lucide.createIcons();\n\n try {\n const res = await fetch(`https://orp.awww.workers.dev/ws?uid=${encodeURIComponent(lastId)}`);\n if (!res.ok) throw new Error(`HTTP Error: ${res.status} ${res.statusText}`);\n const data = await res.json();\n jsonContent.textContent = JSON.stringify(data, null, 2);\n } catch (err) {\n jsonContent.textContent = `Failed to fetch stream state.\\n\\nError: ${err.message}`;\n } finally {\n showModal();\n btn.disabled = false;\n btn.innerHTML = originalBtnHTML;\n lucide.createIcons();\n }\n };\n\n btn.addEventListener('click', fetchStreamState);\n closeBtn.addEventListener('click', hideModal);\n modal.addEventListener('click', e => { if (e.target === modal) hideModal(); });\n })();\n </script>\n</div>\n","extension_html":"<sune src='https://raw.githubusercontent.com/sune-org/store/refs/heads/main/sync.sune' private></sune>","hide_composer":false,"presence_penalty":"","max_tokens":""},"storage":{}}]
|
[{"id":"mpmar2o","name":"Fetch Stream","pinned":false,"avatar":"","url":"gh://sune-org/store@main/fetch-stream.sune","updatedAt":1767018713014,"settings":{"model":"openai/gpt-5","temperature":"","top_p":"","top_k":"","frequency_penalty":"","repetition_penalty":"","min_p":"","top_a":"","verbosity":"","reasoning_effort":"default","system_prompt":"","html":"<!-- Sune: Stream State Inspector v1.1.1 -->\n<div \n id=\"sune-ssi\" \n class=\"w-full p-4\" \n x-data=\"{ \n open: false, \n loading: false, \n data: '',\n async fetchState() {\n const tid = window.THREAD?.getLastAssistantMessageId?.();\n if (!tid) return alert('Meowster, no assistant message found.');\n \n this.loading = true;\n try {\n const base = window.HTTP_BASE || 'https://orp.aww.4ev.link/ws';\n const r = await fetch(`${base}?uid=${encodeURIComponent(tid)}`);\n if (!r.ok) throw new Error(`HTTP ${r.status}`);\n const j = await r.json();\n this.data = JSON.stringify(j, null, 2);\n localStorage.setItem(window.SUNE?.id || 'sune_cache', this.data);\n this.open = true;\n } catch (e) {\n alert('Master, error: ' + e.message);\n } finally {\n this.loading = false;\n this.$nextTick(() => lucide.createIcons());\n }\n },\n copy() {\n navigator.clipboard.writeText(this.data);\n alert('Copied, Meowster!');\n }\n }\"\n x-init=\"data = localStorage.getItem(window.SUNE?.id || 'sune_cache') || ''\"\n>\n <!-- Trigger -->\n <button \n @click=\"fetchState()\" \n :disabled=\"loading\"\n class=\"w-full flex items-center justify-between p-4 bg-slate-900 text-white rounded-2xl shadow-lg active:scale-95 transition-transform disabled:opacity-50\"\n >\n <div class=\"flex items-center gap-3\">\n <div class=\"p-2 bg-white/10 rounded-lg\">\n <i data-lucide=\"terminal\" class=\"w-5 h-5 text-indigo-400\" x-show=\"!loading\"></i>\n <i data-lucide=\"loader-2\" class=\"w-5 h-5 animate-spin\" x-show=\"loading\"></i>\n </div>\n <div class=\"text-left\">\n <p class=\"text-xs font-bold leading-none\">Inspect Last Stream</p>\n <p class=\"text-[10px] text-slate-400 mt-1 font-mono\">v1.1.1</p>\n </div>\n </div>\n <i data-lucide=\"chevron-right\" class=\"w-4 h-4 text-slate-500\"></i>\n </button>\n\n <!-- Modal -->\n <div \n x-show=\"open\" \n class=\"fixed inset-0 z-[60] flex items-end sm:items-center justify-center p-4 bg-black/60 backdrop-blur-sm\"\n x-transition.opacity\n @click.self=\"open = false\"\n >\n <div class=\"bg-white w-full max-w-lg rounded-t-3xl sm:rounded-3xl overflow-hidden flex flex-col max-h-[70vh] shadow-2xl mt-16\">\n <!-- Header -->\n <div class=\"flex items-center justify-between p-4 border-b border-gray-100\">\n <span class=\"text-xs font-black uppercase tracking-tighter text-slate-400\">Stream Debugger</span>\n <button @click=\"open = false\" class=\"p-2 bg-gray-100 rounded-full\"><i data-lucide=\"x\" class=\"w-4 h-4\"></i></button>\n </div>\n\n <!-- Code Area -->\n <div class=\"flex-1 overflow-auto bg-slate-950 p-4\">\n <pre class=\"text-[10px] text-emerald-400 font-mono leading-relaxed\" x-text=\"data\"></pre>\n </div>\n\n <!-- Actions -->\n <div class=\"p-4 bg-gray-50 flex gap-2\">\n <button @click=\"copy()\" class=\"flex-1 py-3 bg-slate-900 text-white text-xs font-bold rounded-xl active:scale-95 transition\">Copy JSON</button>\n <button @click=\"open = false\" class=\"px-6 py-3 bg-white border border-gray-200 text-xs font-bold rounded-xl\">Close</button>\n </div>\n </div>\n </div>\n\n <script>\n // Ensure icons are rendered on injection\n setTimeout(() => window.lucide?.createIcons(), 100);\n </script>\n</div>\n","extension_html":"<sune src='https://raw.githubusercontent.com/sune-org/store/refs/heads/main/sync.sune' private></sune>","hide_composer":false,"include_thoughts":false,"json_output":false,"img_output":false,"aspect_ratio":"1:1","ignore_master_prompt":false,"json_schema":"","presence_penalty":"","max_tokens":""},"storage":{}}]
|
||||||
Reference in New Issue
Block a user