Download operator_dashboard.html from AGofficial/Continous_Astra_Agent_V5: direct link, hf CLI and curl.
- Browser
- Download file 19 kB
-
https://huggingface.co/AGofficial/Continous_Astra_Agent_V5/resolve/main/operator_dashboard.html
- Command line
-
hf download hf://AGofficial/Continous_Astra_Agent_V5/operator_dashboard.html
-
curl -L -o operator_dashboard.html https://huggingface.co/AGofficial/Continous_Astra_Agent_V5/resolve/main/operator_dashboard.html
19 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> | |
| <title>Astra · Operator</title> | |
| <style> | |
| :root{color-scheme:dark;--bg:#0b1018;--panel:#111925;--line:#253043;--muted:#94a3b9;--ink:#e6edf7;--accent:#9fbaff;--green:#8fddbd;--red:#ffa6ab} | |
| *{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 system-ui,sans-serif}button,input,textarea,select{font:inherit}button{cursor:pointer;border:1px solid var(--line);border-radius:7px;background:#192335;color:var(--ink);padding:8px 12px}button:hover{border-color:var(--accent)}button:disabled{opacity:.45;cursor:default}.primary{background:#b5c9ff;color:#101b33;border:0;font-weight:650}.ghost{background:transparent}.danger{color:var(--red)}input,select{background:#0d1420;border:1px solid var(--line);border-radius:7px;color:var(--ink);padding:9px;width:100%}input:focus,textarea:focus,select:focus{outline:2px solid #6d8bcc;outline-offset:-2px} | |
| header{height:92px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:18px 26px;gap:16px}.brand{display:flex;align-items:center;gap:15px}.mark{height:43px;width:43px;border:1px solid #5b749d;border-radius:12px;display:grid;place-items:center;font:24px Georgia;color:var(--accent)}h1{font-size:22px;letter-spacing:-.6px;margin:0}header p{margin:2px 0 0;color:var(--muted);font-size:12px}.actions{display:flex;align-items:center;gap:9px}.badge{font-size:10px;letter-spacing:1.5px;color:var(--green);border:1px solid #2d4b44;border-radius:20px;padding:5px 10px}#dirty{color:var(--muted);font-size:12px;min-width:90px} | |
| .workspace{height:calc(100vh - 128px);display:grid;grid-template-columns:250px minmax(320px,1fr) minmax(340px,.92fr)}aside{border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}.nav{padding:16px;border-bottom:1px solid var(--line)}.nav select{margin-bottom:9px}#entryList{overflow:auto;padding:8px;flex:1}.entry{display:block;text-align:left;width:100%;border:1px solid transparent;background:transparent;margin:3px 0;padding:10px}.entry.selected{background:#1b2940;border-color:#354b6b}.entry strong{display:block;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entry span{display:block;font-size:11px;color:var(--muted);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entry.changed strong:before{content:'• ';color:var(--green)}.asideFoot{padding:10px 16px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;display:flex;gap:8px;align-items:center}.asideFoot button{font-size:11px;padding:5px 8px} | |
| .editor{display:flex;flex-direction:column;min-width:0;min-height:0;border-right:1px solid var(--line)}.paneHead{padding:19px 20px 15px;min-height:90px;border-bottom:1px solid var(--line)}.eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:1.6px;color:var(--accent);margin-bottom:5px}h2{font-size:16px;line-height:1.35;font-weight:600;margin:0 0 5px;overflow-wrap:anywhere}.sub{color:var(--muted);font-size:11px}.editorActions{display:flex;gap:8px;margin-top:12px}.editorActions button{font-size:11px;padding:5px 9px}textarea{resize:none;display:block;flex:1;min-height:0;width:100%;background:#0e1520;border:0;color:#d5e0ef;padding:22px;font:13px/1.75 Consolas,'Cascadia Code',monospace;tab-size:4}.editorFoot{padding:8px 18px;border-top:1px solid var(--line);font-size:11px;color:var(--muted);display:flex;justify-content:space-between} | |
| .preview{display:flex;flex-direction:column;min-height:0;min-width:0;background:#0e1622}.preview .paneHead{padding-bottom:13px}.previewControls{display:flex;gap:8px;margin-top:12px}.previewControls select{font-size:12px;padding:7px;flex:1}.previewControls button{font-size:11px}#previewText{white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto;flex:1;margin:0;padding:22px;font:12px/1.75 Consolas,monospace;color:#bfcfe6}#previewState{color:var(--green)}footer{height:36px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 20px;font-size:11px;color:var(--muted)}#status.error{color:var(--red)}#status.ok{color:var(--green)}.empty{padding:24px;color:var(--muted)}dialog{background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:12px;max-width:430px;width:90%;padding:24px}dialog::backdrop{background:#0009}dialog h2{margin-bottom:12px}dialog p{color:var(--muted);font-size:12px}dialog .actions{justify-content:flex-end;margin-top:18px}#contextDialog textarea{height:260px;min-height:260px;border:1px solid var(--line);margin-top:12px;padding:12px} | |
| @media(max-width:1100px){.workspace{grid-template-columns:210px minmax(300px,1fr) minmax(300px,.9fr)}header{padding:14px}.badge{display:none}}@media(max-width:850px){.workspace{height:auto;grid-template-columns:180px 1fr}.editor{height:70vh}.preview{grid-column:1/-1;height:60vh}aside{height:70vh}footer{position:sticky;bottom:0;background:var(--bg)}header{height:auto;flex-wrap:wrap}.actions{flex-wrap:wrap}#dirty{min-width:0}} | |
| </style> | |
| </head> | |
| <body> | |
| <header><div class="brand"><div class="mark">A</div><div><h1>Astra / Operator</h1><p>Text, context, and the instructions behind every wake.</p></div></div><div class="actions"><span class="badge">LOCAL · PRIVATE</span><span id="dirty">Loading</span><button class="ghost" id="export">Export draft</button><button class="primary" id="save" disabled>Save to codebase</button></div></header> | |
| <main class="workspace"> | |
| <aside><div class="nav"><select id="category" aria-label="Text category"><option>All text</option><option>System prompts</option><option>Skills</option><option>Tool text</option><option>Aegis documentation</option><option>Runtime text</option><option>Runtime templates</option><option>Virtual files</option></select><input id="search" placeholder="Search names or text…" aria-label="Search text"></div><div id="entryList"></div><div class="asideFoot"><span id="count"></span><button id="addFile" class="ghost">New virtual file</button></div></aside> | |
| <section class="editor"><div class="paneHead"><div class="eyebrow" id="editorCategory">Editor</div><h2 id="editorTitle">Choose a text block</h2><div class="sub" id="editorSource">Source text is edited directly, without changing executable logic.</div><div class="editorActions"><button id="undo" disabled>Revert this block</button><button id="deleteFile" class="danger" hidden>Delete virtual file</button><button id="discard" class="ghost">Discard all edits</button></div></div><textarea id="editor" aria-label="Text editor" spellcheck="false" disabled></textarea><div class="editorFoot"><span id="editorLength">0 characters</span><span>Unsaved edits stay in this browser session</span></div></section> | |
| <section class="preview"><div class="paneHead"><div class="eyebrow">Assembled preview</div><h2>Your draft, as Astra receives it</h2><div class="sub">Skills load through tools; they are shown separately from system instructions.</div><div class="previewControls"><select id="previewMode" aria-label="Preview type"><option value="main">Main system prompt</option><option value="subagent">Subagent system prompt</option><option value="tools">Main tool definitions</option><option value="subtools">Subagent tool definitions</option><option value="skills">Loaded skill texts</option><option value="docs">Aegis documentation result</option><option value="payload">Example API request</option></select><button id="context">Sample context</button><button id="refreshPreview">Refresh</button></div></div><pre id="previewText">Loading source…</pre><div class="editorFoot"><span id="previewState">Waiting</span><span id="previewLength"></span></div></section> | |
| </main> | |
| <footer><span id="status" role="status">Connecting to the local dashboard…</span><span>Save applies source edits. Astra is never started by this page.</span></footer> | |
| <dialog id="fileDialog"><h2>Create a virtual file</h2><p>These are the notes and scripts Astra can read, including memory.md, contacts.md and work_plan.md.</p><input id="fileName" placeholder="memory.md" aria-label="Virtual filename"><div class="actions"><button id="cancelFile">Cancel</button><button class="primary" id="createFile">Create</button></div></dialog> | |
| <dialog id="contextDialog"><h2>Sample wake context</h2><p>Preview only. This JSON is not saved as runtime state or sent to a model.</p><textarea id="contextInput" aria-label="Sample context JSON" spellcheck="false"></textarea><div class="actions"><button id="cancelContext">Cancel</button><button class="primary" id="applyContext">Use in preview</button></div></dialog> | |
| <script> | |
| const $=id=>document.getElementById(id); | |
| let token=new URLSearchParams(location.hash.slice(1)).get('token')||sessionStorage.getItem('astraOperatorToken'); | |
| if(token){sessionStorage.setItem('astraOperatorToken',token);history.replaceState(null,'',location.pathname);} | |
| let state=null,changes={},virtual={},selected=null,assembled=null,previewTimer,previewSerial=0,saving=false; | |
| let sampleContext={time:new Date().toISOString(),cycle:1,discord_messages:[],pending_emails:[],operator_instruction:null,virtual_files:[]}; | |
| const labels={ASTRA_PERSONA:'Identity & voice',PROMPT:'Main instructions',SUBAGENT_PROMPT:'Subagent instructions',_ASTRA_LORE:'Astra lore',_WHAT_TO_DO:'Autonomous work',_EMAIL_COMMUNICATION:'Email communication',_DISCORD_COMMUNICATION:'Discord communication'}; | |
| function status(text,error=false){$('status').textContent=text;$('status').className=error?'error':'ok';} | |
| async function api(path,data){const response=await fetch(path,{method:data?'POST':'GET',headers:{'X-Operator-Token':token||'','Content-Type':'application/json'},body:data?JSON.stringify(data):undefined});const result=await response.json();if(!response.ok)throw new Error(result.error||'Request failed');return result;} | |
| function payload(){return {revision:state.revision,changes,virtual_files:virtual};} | |
| function items(){return [...state.entries,...Object.keys(virtual).sort().map(name=>({id:'virtual:'+name,file:'sandbox/files.json',line:null,category:'Virtual files',label:name,value:virtual[name],virtual:true}))];} | |
| function displayName(item){return labels[item.label]||item.label;} | |
| function value(item){return item.virtual?virtual[item.label]:(changes[item.id]??item.value);} | |
| function changed(item){return item.virtual?state.virtual_files[item.label]!==virtual[item.label]:Object.hasOwn(changes,item.id);} | |
| function remember(){sessionStorage.setItem('astraOperatorDraft',JSON.stringify(payload()));updateDirty();} | |
| function updateDirty(){const virtualChanges=[...new Set([...Object.keys(virtual),...Object.keys(state.virtual_files)])].filter(name=>virtual[name]!==state.virtual_files[name]).length;const count=Object.keys(changes).length+virtualChanges;$('dirty').textContent=count?`${count} unsaved ${count===1?'edit':'edits'}`:'All changes saved';$('save').disabled=!count||saving;} | |
| function renderList(){const category=$('category').value,query=$('search').value.toLowerCase();const list=items().filter(item=>(category==='All text'||item.category===category)&&(!query||(item.label+' '+item.file+' '+value(item)).toLowerCase().includes(query)));$('entryList').replaceChildren();$('count').textContent=`${list.length} blocks`;for(const item of list){const button=document.createElement('button');button.className='entry'+(selected===item.id?' selected':'')+(changed(item)?' changed':'');const title=document.createElement('strong');title.textContent=displayName(item);const detail=document.createElement('span');detail.textContent=value(item).replace(/\s+/g,' ').slice(0,95);button.append(title,detail);button.title=item.file+(item.line?':'+item.line:'');button.addEventListener('click',()=>select(item.id));$('entryList').append(button);}if(!list.length){const empty=document.createElement('div');empty.className='empty';empty.textContent='No matching text blocks.';$('entryList').append(empty);}} | |
| function select(id){selected=id;const item=items().find(item=>item.id===id);if(!item)return;$('editorCategory').textContent=item.category;$('editorTitle').textContent=displayName(item);$('editorSource').textContent=item.file+(item.line?' · line '+item.line:'')+ (item.category==='Runtime templates'?' · Keep the f-string syntax and {fields}.':'');$('editor').disabled=false;$('editor').value=value(item);$('undo').disabled=!changed(item);$('deleteFile').hidden=!item.virtual;length();renderList();} | |
| function length(){$('editorLength').textContent=`${$('editor').value.length.toLocaleString()} characters`;} | |
| function queuePreview(){clearTimeout(previewTimer);previewTimer=setTimeout(preview,650);$('previewState').textContent='Draft changed';} | |
| async function preview(){if(!state)return;const serial=++previewSerial;$('previewState').textContent='Assembling…';try{const result=await api('/api/preview',payload());if(serial!==previewSerial)return;assembled=result;showPreview();$('previewState').textContent='Validated draft';}catch(error){if(serial!==previewSerial)return;$('previewState').textContent='Draft needs attention';status(error.message,true);}} | |
| function showPreview(){if(!assembled)return;const mode=$('previewMode').value;let output;if(mode==='main')output=assembled.main_prompt;else if(mode==='subagent')output=assembled.subagent_prompt;else if(mode==='tools')output=JSON.stringify(assembled.tools,null,2);else if(mode==='subtools')output=JSON.stringify(assembled.subagent_tools,null,2);else if(mode==='docs')output=JSON.stringify(assembled.aegis_documentation,null,2);else if(mode==='skills')output=Object.values(assembled.skills).map(skill=>`===== ${skill.name} =====\n${skill.description}\n\n${skill.text}`).join('\n\n');else output=JSON.stringify({model:assembled.model,instructions:assembled.main_prompt,input:[{role:'user',content:JSON.stringify({...sampleContext,virtual_files:Object.keys(virtual)})}],tools:assembled.tools,store:false,include:['reasoning.encrypted_content','web_search_call.action.sources'],max_output_tokens:12000},null,2);$('previewText').textContent=output;$('previewLength').textContent=`${output.length.toLocaleString()} characters`;} | |
| $('editor').addEventListener('input',()=>{const item=items().find(item=>item.id===selected);if(!item)return;const text=$('editor').value;if(item.virtual)virtual[item.label]=text;else if(text===item.value)delete changes[item.id];else changes[item.id]=text;$('undo').disabled=!changed(item);length();remember();queuePreview();}); | |
| $('editor').addEventListener('keydown',event=>{if(event.key==='Tab'){event.preventDefault();const box=event.target;box.setRangeText(' ',box.selectionStart,box.selectionEnd,'end');box.dispatchEvent(new Event('input'));}}); | |
| $('category').addEventListener('change',renderList);$('search').addEventListener('input',renderList);$('previewMode').addEventListener('change',showPreview);$('refreshPreview').addEventListener('click',preview); | |
| $('undo').addEventListener('click',()=>{const item=items().find(item=>item.id===selected);if(item.virtual){if(Object.hasOwn(state.virtual_files,item.label))virtual[item.label]=state.virtual_files[item.label];else delete virtual[item.label];}else delete changes[item.id];remember();select(items().some(i=>i.id===selected)?selected:state.entries[0].id);renderList();queuePreview();}); | |
| $('discard').addEventListener('click',()=>{if(!confirm('Discard every unsaved edit?'))return;changes={};virtual=structuredClone(state.virtual_files);remember();if(items().some(item=>item.id===selected))select(selected);else select(state.entries[0].id);queuePreview();}); | |
| $('deleteFile').addEventListener('click',()=>{const item=items().find(item=>item.id===selected);if(!item||!confirm('Delete '+item.label+' when you save?'))return;delete virtual[item.label];remember();select(state.entries[0].id);renderList();queuePreview();}); | |
| $('addFile').addEventListener('click',()=>{$('fileName').value='';$('fileDialog').showModal();$('fileName').focus();});$('cancelFile').addEventListener('click',()=>$('fileDialog').close());$('createFile').addEventListener('click',()=>{const name=$('fileName').value.trim();if(!name||name.length>240||Object.hasOwn(virtual,name)){status('Use a new virtual filename of 1–240 characters.',true);return;}virtual[name]='';$('fileDialog').close();$('category').value='Virtual files';remember();select('virtual:'+name);queuePreview();}); | |
| $('context').addEventListener('click',()=>{$('contextInput').value=JSON.stringify(sampleContext,null,2);$('contextDialog').showModal();});$('cancelContext').addEventListener('click',()=>$('contextDialog').close());$('applyContext').addEventListener('click',()=>{try{const value=JSON.parse($('contextInput').value);if(!value||typeof value!=='object'||Array.isArray(value))throw Error('Use a JSON object.');sampleContext=value;$('contextDialog').close();$('previewMode').value='payload';showPreview();}catch(error){status(error.message,true);}}); | |
| $('export').addEventListener('click',()=>{if(!state)return;const url=URL.createObjectURL(new Blob([JSON.stringify({...payload(),sample_context:sampleContext},null,2)],{type:'application/json'}));const link=document.createElement('a');link.href=url;link.download='astra-operator-draft.json';link.click();URL.revokeObjectURL(url);}); | |
| $('save').addEventListener('click',async()=>{if(saving)return;saving=true;updateDirty();status('Validating and saving…');try{const result=await api('/api/save',payload());const old=items().find(item=>item.id===selected);state=result.snapshot;changes={};virtual=structuredClone(state.virtual_files);assembled=state.preview;sessionStorage.removeItem('astraOperatorDraft');const item=items().find(item=>item.id===selected)||items().find(item=>old&&item.label===old.label&&item.file===old.file)||state.entries[0];select(item.id);showPreview();$('previewState').textContent='Saved assembly';status(result.saved_files.length?`Applied to ${result.saved_files.join(', ')}. Start Astra when ready.`:'Nothing changed.');}catch(error){status(error.message,true);}finally{saving=false;updateDirty();}}); | |
| document.addEventListener('keydown',event=>{if((event.ctrlKey||event.metaKey)&&event.key==='s'){event.preventDefault();if(!$('save').disabled)$('save').click();}}); | |
| async function load(){try{state=await api('/api/state');virtual=structuredClone(state.virtual_files);assembled=state.preview;const draft=JSON.parse(sessionStorage.getItem('astraOperatorDraft')||'null');if(draft&&draft.revision===state.revision){changes=draft.changes;virtual=draft.virtual_files;status('Restored your unsaved session draft.');}else status('Ready. Astra stays stopped.');select(state.entries.find(item=>item.label==='ASTRA_PERSONA').id);updateDirty();showPreview();$('previewState').textContent='Current source';if(Object.keys(changes).length)preview();}catch(error){status(error.message,true);$('previewText').textContent='Open the private launch link for this dashboard. No source text is exposed without its access token.';}} | |
| load(); | |
| </script> | |
| </body></html> | |