mirror of
https://github.com/sune-org/store.git
synced 2026-01-13 16:17:58 +00:00
1 line
4.1 KiB
JSON
1 line
4.1 KiB
JSON
[{"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":{}}] |