Spaces:
Running
Running
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
Browse filesReusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy main.
Files: 1043 Pruned: 0
Derived from Dockerfile COPY sources (NO hand-maintained allowlist).
Signed-off-by: SZL Holdings <noreply@szlholdings.ai>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- pages/sovereign.html +94 -0
pages/sovereign.html
CHANGED
|
@@ -103,6 +103,29 @@
|
|
| 103 |
.fednote{color:var(--mute);font-size:10.5px;margin:0 0 12px;line-height:1.5}
|
| 104 |
.fedwrap .strip{margin-bottom:12px}
|
| 105 |
.fedwrap .lamps{margin-bottom:0}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
</style>
|
| 108 |
</head>
|
|
@@ -126,6 +149,20 @@
|
|
| 126 |
<div class="lamps" id="fedlamps"></div>
|
| 127 |
</section>
|
| 128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
<section class="khipu"><div id="khipu"></div></section>
|
| 130 |
<div class="lgd">
|
| 131 |
<span><i style="background:#3af4c8"></i>live / intact</span>
|
|
@@ -311,6 +348,63 @@
|
|
| 311 |
'<text x="'+cx+'" y="'+(TOP+140)+'" text-anchor="middle" font-family="ui-monospace,Menlo,monospace" font-size="10.5" fill="#6f8c9c">'+esc(text)+'</text></g>';
|
| 312 |
}
|
| 313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
// ---------- tick ----------
|
| 315 |
function tick(){
|
| 316 |
Promise.all([
|
|
|
|
| 103 |
.fednote{color:var(--mute);font-size:10.5px;margin:0 0 12px;line-height:1.5}
|
| 104 |
.fedwrap .strip{margin-bottom:12px}
|
| 105 |
.fedwrap .lamps{margin-bottom:0}
|
| 106 |
+
/* governed frontier console */
|
| 107 |
+
.frin,.frta{width:100%;background:rgba(8,12,20,.7);border:1px solid var(--line);color:var(--ink);
|
| 108 |
+
font-family:var(--mono);font-size:12px;border-radius:9px;padding:9px 10px;outline:none;box-sizing:border-box}
|
| 109 |
+
.frin:focus,.frta:focus{border-color:var(--teal-dim)}
|
| 110 |
+
.frta{resize:vertical;min-height:40px;line-height:1.5}
|
| 111 |
+
.frrow{display:flex;gap:8px;align-items:flex-start;margin:8px 0}
|
| 112 |
+
.frbtn{white-space:nowrap;background:var(--teal);color:#04241d;border:none;font-weight:700;
|
| 113 |
+
font-family:var(--mono);font-size:11.5px;letter-spacing:.04em;padding:9px 14px;border-radius:9px;cursor:pointer}
|
| 114 |
+
.frbtn.ghost{background:transparent;color:var(--teal-dim);border:1px solid var(--teal-dim);font-weight:600}
|
| 115 |
+
.frbtn:disabled{opacity:.45;cursor:default}
|
| 116 |
+
.frout{margin-top:6px}
|
| 117 |
+
.frchips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
|
| 118 |
+
.chip{font-family:var(--mono);font-size:10px;letter-spacing:.04em;padding:3px 8px;border-radius:20px;
|
| 119 |
+
border:1px solid var(--line);color:var(--mute);background:rgba(8,12,20,.5)}
|
| 120 |
+
.chip.ok{border-color:var(--teal-dim);color:var(--teal);background:rgba(58,244,200,.08)}
|
| 121 |
+
.chip.bad{border-color:#ff5470;color:#ff5470;background:rgba(255,84,112,.08)}
|
| 122 |
+
.chip.amber{border-color:#f5a623;color:#f5a623;background:rgba(245,166,35,.08)}
|
| 123 |
+
.franswer{white-space:pre-wrap;font-size:13px;line-height:1.55;color:var(--ink);background:rgba(8,12,20,.5);
|
| 124 |
+
border:1px solid var(--line);border-radius:10px;padding:11px 12px;margin:6px 0}
|
| 125 |
+
.frraw{margin-top:6px}
|
| 126 |
+
.frraw summary{cursor:pointer;color:var(--mute);font-family:var(--mono);font-size:10.5px;letter-spacing:.04em}
|
| 127 |
+
.frraw pre{white-space:pre-wrap;word-break:break-all;font-family:var(--mono);font-size:10px;color:var(--mute);
|
| 128 |
+
background:rgba(8,12,20,.6);border:1px solid var(--line);border-radius:8px;padding:10px;margin:6px 0 0;max-height:220px;overflow:auto}
|
| 129 |
|
| 130 |
</style>
|
| 131 |
</head>
|
|
|
|
| 149 |
<div class="lamps" id="fedlamps"></div>
|
| 150 |
</section>
|
| 151 |
|
| 152 |
+
<section class="fedwrap frontier">
|
| 153 |
+
<div class="fedttl"><span class="badge">GOVERNED</span> Frontier Console — one capped call, receipt verified locally <span class="fedsrc" id="frstate">—</span></div>
|
| 154 |
+
<div class="fednote">operator-gated · model pinned · max 256 tokens · 8s cooldown · 50/day · the box router meters & kill-switches every call. a11oy verifies the DSSE / ECDSA-P256 receipt against a <b>pinned</b> key — the router is never trusted, the math is checked here.</div>
|
| 155 |
+
<div class="frrow">
|
| 156 |
+
<input id="frop" class="frin" type="password" autocomplete="off" spellcheck="false" placeholder="operator token (kept only in this browser)"/>
|
| 157 |
+
<button id="frsave" class="frbtn ghost" type="button">remember</button>
|
| 158 |
+
</div>
|
| 159 |
+
<div class="frrow">
|
| 160 |
+
<textarea id="frprompt" class="frta" rows="2" maxlength="600" placeholder="Ask the sovereign router something… (governed, capped, receipted · ⌘/Ctrl+Enter)"></textarea>
|
| 161 |
+
<button id="frask" class="frbtn" type="button">Ask →</button>
|
| 162 |
+
</div>
|
| 163 |
+
<div id="frout" class="frout"></div>
|
| 164 |
+
</section>
|
| 165 |
+
|
| 166 |
<section class="khipu"><div id="khipu"></div></section>
|
| 167 |
<div class="lgd">
|
| 168 |
<span><i style="background:#3af4c8"></i>live / intact</span>
|
|
|
|
| 348 |
'<text x="'+cx+'" y="'+(TOP+140)+'" text-anchor="middle" font-family="ui-monospace,Menlo,monospace" font-size="10.5" fill="#6f8c9c">'+esc(text)+'</text></g>';
|
| 349 |
}
|
| 350 |
|
| 351 |
+
// ---------- governed frontier console ----------
|
| 352 |
+
var FR_KEY="szl_frontier_op";
|
| 353 |
+
function frToken(){ try{return localStorage.getItem(FR_KEY)||"";}catch(e){return "";} }
|
| 354 |
+
function frChip(label,cls){ return '<span class="chip '+(cls||"")+'">'+esc(label)+'</span>'; }
|
| 355 |
+
function frRender(d){
|
| 356 |
+
var out=$("frout"), st=$("frstate");
|
| 357 |
+
if(!d){ out.innerHTML='<div class="franswer">the console could not reach a11oy (network).</div>'; st.textContent="\u2014"; return; }
|
| 358 |
+
var s=d.state||"?";
|
| 359 |
+
var label={verified:"RECEIPT VERIFIED",verify_failed:"VERIFY FAILED",receipt_unsigned:"UNSIGNED",receipt_missing:"NO RECEIPT",receipt_unparseable:"BAD RECEIPT",not_configured:"NOT CONFIGURED",unauthorized:"UNAUTHORIZED",bad_request:"BAD REQUEST",unreachable:"ROUTER UNREACHABLE",cooldown:"COOLDOWN",daily_cap:"DAILY CAP",busy:"BUSY"}[s]||String(s).toUpperCase();
|
| 360 |
+
var cls=(s==="verified")?"ok":((s==="verify_failed"||s==="unauthorized"||s==="unreachable")?"bad":"amber");
|
| 361 |
+
st.innerHTML=frChip(label,cls);
|
| 362 |
+
if(s==="not_configured"){ out.innerHTML='<div class="franswer">Frontier edge/operator not provisioned yet.</div>'; return; }
|
| 363 |
+
if(s==="unauthorized"){ out.innerHTML='<div class="franswer">Operator token rejected. Paste your token above and try again.</div>'; return; }
|
| 364 |
+
if(s==="cooldown"){ out.innerHTML='<div class="franswer">Cooling down — retry in '+esc(d.retry_after_s)+'s (governance).</div>'; return; }
|
| 365 |
+
if(s==="daily_cap"){ out.innerHTML='<div class="franswer">Daily governed-call cap reached ('+esc(d.daily_cap)+').</div>'; return; }
|
| 366 |
+
if(s==="busy"){ out.innerHTML='<div class="franswer">A governed call is already in flight — one at a time.</div>'; return; }
|
| 367 |
+
if(s==="unreachable"){ out.innerHTML='<div class="franswer">Box router did not answer (http '+esc(d.http_status)+').</div>'; return; }
|
| 368 |
+
if(s==="bad_request"){ out.innerHTML='<div class="franswer">'+esc(d.detail||"bad request")+'</div>'; return; }
|
| 369 |
+
var html="";
|
| 370 |
+
if(d.answer){ html+='<div class="franswer">'+esc(d.answer)+'</div>'; }
|
| 371 |
+
var r=d.receipt||{}, p=d.provenance||{}, u=d.usage||{};
|
| 372 |
+
var chips="";
|
| 373 |
+
chips+=frChip((r.verified?"\u2713 ":"\u2717 ")+"DSSE "+(r.verified?"verified":(r.reason||"unverified")), r.verified?"ok":"bad");
|
| 374 |
+
if(p.tier) chips+=frChip("tier "+p.tier,"");
|
| 375 |
+
if(p.served_by) chips+=frChip("via "+p.served_by,"");
|
| 376 |
+
if(p.upstream_model||p.model) chips+=frChip("model "+(p.upstream_model||p.model),"");
|
| 377 |
+
if(p.amount_usd!=null) chips+=frChip((p.estimated?"~":"")+(money6(p.amount_usd)||"$0.00")+" this call","amber");
|
| 378 |
+
if(u.total_tokens!=null) chips+=frChip(u.total_tokens+" tok","");
|
| 379 |
+
if(r.keyid) chips+=frChip("keyid "+String(r.keyid).slice(0,12),"");
|
| 380 |
+
if(r.organ) chips+=frChip("organ "+r.organ,"");
|
| 381 |
+
if(p.request_digest) chips+=frChip("req "+String(p.request_digest).slice(0,10),"");
|
| 382 |
+
html+='<div class="frchips">'+chips+'</div>';
|
| 383 |
+
if(d.envelope){ html+='<details class="frraw"><summary>raw DSSE receipt — verify it yourself</summary><pre>'+esc(JSON.stringify(d.envelope,null,2))+'</pre></details>'; }
|
| 384 |
+
out.innerHTML=html;
|
| 385 |
+
}
|
| 386 |
+
function frAsk(){
|
| 387 |
+
var tok=(($("frop").value||"")||frToken()).trim();
|
| 388 |
+
var prompt=($("frprompt").value||"").trim();
|
| 389 |
+
var btn=$("frask");
|
| 390 |
+
if(!prompt){ $("frprompt").focus(); return; }
|
| 391 |
+
btn.disabled=true; $("frstate").innerHTML='<span class="chip amber">calling\u2026</span>';
|
| 392 |
+
$("frout").innerHTML='<div class="franswer">routing one governed call\u2026</div>';
|
| 393 |
+
fetch("/api/a11oy/v1/frontier/ask",{method:"POST",cache:"no-store",
|
| 394 |
+
headers:{"content-type":"application/json","accept":"application/json","x-szl-operator":tok},
|
| 395 |
+
body:JSON.stringify({prompt:prompt})})
|
| 396 |
+
.then(function(r){ return r.json().catch(function(){return null;}); })
|
| 397 |
+
.then(function(d){ frRender(d); })
|
| 398 |
+
.catch(function(){ frRender(null); })
|
| 399 |
+
.then(function(){ btn.disabled=false; });
|
| 400 |
+
}
|
| 401 |
+
(function frInit(){
|
| 402 |
+
var op=$("frop"); if(op){ var t=frToken(); if(t) op.value=t; }
|
| 403 |
+
var save=$("frsave"); if(save) save.addEventListener("click",function(){ try{ localStorage.setItem(FR_KEY,($("frop").value||"").trim()); save.textContent="saved"; setTimeout(function(){save.textContent="remember";},1200);}catch(e){} });
|
| 404 |
+
var ask=$("frask"); if(ask) ask.addEventListener("click",frAsk);
|
| 405 |
+
var pr=$("frprompt"); if(pr) pr.addEventListener("keydown",function(e){ if((e.metaKey||e.ctrlKey)&&e.key==="Enter"){ e.preventDefault(); frAsk(); } });
|
| 406 |
+
})();
|
| 407 |
+
|
| 408 |
// ---------- tick ----------
|
| 409 |
function tick(){
|
| 410 |
Promise.all([
|