Spaces:
Running
Running
drift-heal: sync console assets (A11oyCodeChat js, khipu app.js) to canonical GitHub main bytes
Browse files
console/assets/A11oyCodeChat-CLGElxYs.js
CHANGED
|
@@ -63,7 +63,7 @@ import{i as g,r as i,k as t,C as pe,S as ye}from"./index-BVfpSx5Q.js";import{m a
|
|
| 63 |
*
|
| 64 |
* This source code is licensed under the ISC license.
|
| 65 |
* See the LICENSE file in the root directory of this source tree.
|
| 66 |
-
*/const te=g("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]),e={bg:"#0a0a0a",surface:"rgba(255,255,255,0.025)",surfaceStrong:"rgba(255,255,255,0.045)",border:"rgba(255,255,255,0.08)",borderStrong:"rgba(255,255,255,0.12)",text:"#f5f5f5",dim:"#8a8a8a",muted:"#5e5e5e",accent:"#c9b787",ok:"#6dba6d",warn:"#d6a84e",crit:"#d66a6a",info:"#6a9fd6",mono:"var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)"},P="/api/a11oy/code",ee="You are a11oy.code — the SZL Holdings conversational orchestrator. You answer at Opus-4.8 quality: precise, structured, with working code and honest uncertainty. You can call tools to orchestrate the Amaru / Sentra / Rosie / Killinchu flagships and reach GitHub, Hugging Face, the web, the sandboxed shell/filesystem, and the Killinchu drone fleet. Every action is PURIQ-gated and Khipu-receipted. Stream your reasoning concisely. Prefer markdown, mermaid diagrams, and KaTeX where it clarifies.",_={};function T(a,r){return _[a]||(_[a]=new Promise(c=>{if(r&&window[r])return c();const p=document.createElement("script");p.src=a,p.async=!0,p.onload=()=>c(),p.onerror=()=>c(),document.head.appendChild(p)})),_[a]}function Me(a){if(document.querySelector(`link[href="${a}"]`))return;const r=document.createElement("link");r.rel="stylesheet",r.href=a,document.head.appendChild(r)}function U(a){return a.replace(/&/g,
|
| 67 |
|
| 68 |
`);N=G.pop()||"";for(const me of G){let q="";const Q=[];for(const u of me.split(`
|
| 69 |
`)){const z=u.trimEnd();z.startsWith("event:")?q=z.slice(6).trim():z.startsWith("data:")&&Q.push(z.slice(5).trim())}const D=Q.join(`
|
|
|
|
| 63 |
*
|
| 64 |
* This source code is licensed under the ISC license.
|
| 65 |
* See the LICENSE file in the root directory of this source tree.
|
| 66 |
+
*/const te=g("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]),e={bg:"#0a0a0a",surface:"rgba(255,255,255,0.025)",surfaceStrong:"rgba(255,255,255,0.045)",border:"rgba(255,255,255,0.08)",borderStrong:"rgba(255,255,255,0.12)",text:"#f5f5f5",dim:"#8a8a8a",muted:"#5e5e5e",accent:"#c9b787",ok:"#6dba6d",warn:"#d6a84e",crit:"#d66a6a",info:"#6a9fd6",mono:"var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)"},P="/api/a11oy/code",ee="You are a11oy.code — the SZL Holdings conversational orchestrator. You answer at Opus-4.8 quality: precise, structured, with working code and honest uncertainty. You can call tools to orchestrate the Amaru / Sentra / Rosie / Killinchu flagships and reach GitHub, Hugging Face, the web, the sandboxed shell/filesystem, and the Killinchu drone fleet. Every action is PURIQ-gated and Khipu-receipted. Stream your reasoning concisely. Prefer markdown, mermaid diagrams, and KaTeX where it clarifies.",_={};function T(a,r){return _[a]||(_[a]=new Promise(c=>{if(r&&window[r])return c();const p=document.createElement("script");p.src=a,p.async=!0,p.onload=()=>c(),p.onerror=()=>c(),document.head.appendChild(p)})),_[a]}function Me(a){if(document.querySelector(`link[href="${a}"]`))return;const r=document.createElement("link");r.rel="stylesheet",r.href=a,document.head.appendChild(r)}function U(a){return a.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/"/g,""").replace(/'/g,"'")}async function Ce(a){await T("https://cdn.jsdelivr.net/npm/marked/marked.min.js","marked");const r=window.marked;if(!r)return`<div style="white-space:pre-wrap">${U(a)}</div>`;try{return r.parse(a,{breaks:!0,gfm:!0})}catch{return`<div style="white-space:pre-wrap">${U(a)}</div>`}}async function Re(a){Me("https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css"),await T("https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js","katex"),await T("https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js","renderMathInElement");const r=window.renderMathInElement;if(r)try{r(a,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}],throwOnError:!1})}catch{}}let Ee=0;async function He(a){await T("https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js","mermaid");const r=window.mermaid;if(r)try{r.initialize({startOnLoad:!1,theme:"dark",securityLevel:"loose"});const c=Array.from(a.querySelectorAll("code.language-mermaid, pre code.language-mermaid"));for(const p of c){const b=p.textContent||"",k=p.closest("pre")||p;try{const{svg:j}=await r.render(`mmd-${Ee++}`,b),M=document.createElement("div");M.innerHTML=j,k.replaceWith(M)}catch{}}}catch{}}function _e({content:a,live:r}){const c=i.useRef(null),[p,b]=i.useState("");return i.useEffect(()=>{let k=!1;return Ce(a).then(j=>{k||b(j)}),()=>{k=!0}},[a]),i.useEffect(()=>{r||!c.current||!p||(Re(c.current),He(c.current))},[p,r]),t.jsx("div",{ref:c,className:"a11oy-md",style:{fontSize:14,lineHeight:1.6,color:e.text},dangerouslySetInnerHTML:{__html:p||(r?"":U(a))}})}function Te({m:a}){const r=[];return a.model&&r.push({icon:xe,label:a.model,color:e.accent}),a.tier&&r.push({icon:te,label:a.tier,color:e.info}),typeof a.latency_ms=="number"&&r.push({icon:fe,label:`${a.latency_ms} ms`,color:e.dim}),typeof a.cost_usd=="number"&&r.push({icon:ge,label:`$${a.cost_usd.toFixed(5)}`,color:e.dim}),typeof a.yuyay13=="number"&&r.push({icon:ye,label:`Yuyay-13 ${a.yuyay13.toFixed(2)}`,color:a.yuyay13>=.62?e.ok:e.warn}),a.khipu&&r.push({icon:ke,label:`khipu ${a.khipu.slice(0,10)}`,color:e.muted}),r.length?t.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:r.map((c,p)=>{const b=c.icon;return t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5",style:{fontSize:10,fontFamily:e.mono,background:e.surface,border:`1px solid ${e.border}`,color:c.color},title:c.label,children:[t.jsx(b,{size:11})," ",c.label]},p)})}):null}function Fe({tools:a}){return a!=null&&a.length?t.jsx("div",{className:"mt-2 space-y-1.5",children:a.map(r=>{const c=r.status==="denied"?e.crit:r.status==="done"?e.ok:e.warn;return t.jsxs("div",{className:"rounded-md px-2.5 py-1.5",style:{background:e.surface,border:`1px solid ${e.border}`,fontSize:11,fontFamily:e.mono},children:[t.jsxs("div",{className:"flex items-center gap-1.5",style:{color:c},children:[t.jsx(te,{size:11}),t.jsx("span",{style:{fontWeight:600},children:r.name}),t.jsxs("span",{style:{color:e.muted},children:["· ",r.status]}),r.gate&&t.jsxs("span",{style:{color:r.gate.allow?e.ok:e.crit},children:["· PURIQ ",r.gate.score.toFixed(2)," ",r.gate.allow?"allow":"deny"]})]}),r.args&&t.jsx("pre",{style:{color:e.dim,margin:"4px 0 0",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(r.args).slice(0,300)}),r.result!==void 0&&t.jsx("pre",{style:{color:e.dim,margin:"4px 0 0",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(typeof r.result=="string"?r.result:JSON.stringify(r.result)).slice(0,400)})]},r.id)})}):null}function qe(){const[a,r]=i.useState([]),[c,p]=i.useState(""),[b,k]=i.useState(!1),[j,M]=i.useState(ee),[B,oe]=i.useState(!1),[ae,re]=i.useState([{id:"router",label:"router picks (auto)"}]),[R,ne]=i.useState("router"),[v,F]=i.useState([]),[I,K]=i.useState(!1),[E]=i.useState(()=>{const o="a11oy_code_user";let l=localStorage.getItem(o);return l||(l="founder-"+Math.random().toString(36).slice(2,8),localStorage.setItem(o,l)),l}),[$,Ie]=i.useState(()=>"conv-"+Math.random().toString(36).slice(2,10)),H=i.useRef(null),L=i.useRef(null),W=i.useRef(null),O=i.useRef([]),Y=i.useRef(null);i.useEffect(()=>{fetch(`${P}/models`).then(o=>o.ok?o.json():null).then(o=>{if(!o)return;const l=(o.models||o.data||[]).map(n=>({id:n.id||n.model||n.name,label:`${n.id||n.name}${n.tier?` · ${n.tier}`:""}`,tier:n.tier,license:n.license}));re([{id:"router",label:"router picks (auto)"},...l])}).catch(()=>{})},[]),i.useEffect(()=>{var o;(o=L.current)==null||o.scrollTo({top:L.current.scrollHeight,behavior:"smooth"})},[a,b]);const se=i.useCallback(()=>{var o;(o=H.current)==null||o.abort(),H.current=null,k(!1)},[]),J=i.useCallback(async()=>{var h;const o=c.trim();if(!o&&!v.length||b)return;const l={role:"user",content:o,images:v.length?[...v]:void 0},n={role:"assistant",content:"",tools:[]},m=[...a,l];r([...m,n]),p(""),F([]),k(!0);const x=new AbortController;H.current=x;const f=[{role:"system",content:j}];for(const d of m)(h=d.images)!=null&&h.length?f.push({role:d.role,content:[{type:"text",text:d.content},...d.images.map(w=>({type:"image_url",image_url:{url:w}}))]}):f.push({role:d.role,content:d.content});const y=d=>r(w=>{const S=[...w],N={...S[S.length-1]};return d(N),S[S.length-1]=N,S});try{const d=await fetch(`${P}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:f,model:R==="router"?void 0:R,user_id:E,conversation_id:$,stream:!0,tools:"auto"}),signal:x.signal});if(!d.ok||!d.body){y(A=>{A.content=`⚠️ Backend error ${d.status}. ${d.status===503?"No inference credential available — see GAP CHECK.":""}`}),k(!1);return}const w=d.body.getReader(),S=new TextDecoder;let N="";for(;;){const{done:A,value:ue}=await w.read();if(A)break;N+=S.decode(ue,{stream:!0});const G=N.split(`
|
| 67 |
|
| 68 |
`);N=G.pop()||"";for(const me of G){let q="";const Q=[];for(const u of me.split(`
|
| 69 |
`)){const z=u.trimEnd();z.startsWith("event:")?q=z.slice(6).trim():z.startsWith("data:")&&Q.push(z.slice(5).trim())}const D=Q.join(`
|
console/static/viz/khipu/app.js
CHANGED
|
@@ -14,9 +14,9 @@ const SZL_REDUCED = SZLMobileControls.prefersReducedMotion();
|
|
| 14 |
// ---- Kanchay flagship registry + REAL endpoints (HATUN_WILLAY_PER_FLAGSHIP) ----
|
| 15 |
const FLAGSHIPS = [
|
| 16 |
{ id:'a11oy', color:0x34aaa4, base:'https://szlholdings-a11oy.hf.space/api/a11oy' },
|
| 17 |
-
{ id:'amaru', color:0x1f9d57, base:'https://szlholdings-amaru.hf.space/api/amaru' },
|
| 18 |
-
{ id:'sentra', color:0xc0392b, base:'https://szlholdings-sentra.hf.space/api/sentra' },
|
| 19 |
-
{ id:'rosie', color:0xc78aff, base:'https://szlholdings-rosie.hf.space/api/rosie' },
|
| 20 |
{ id:'vessels', color:0xc08f2f, base:'https://szlholdings-vessels.hf.space/api/vessels' },
|
| 21 |
{ id:'killinchu', color:0x5cc4bf, base:'https://szlholdings-killinchu.hf.space/api/killinchu' },
|
| 22 |
];
|
|
@@ -266,7 +266,7 @@ async function boot(){
|
|
| 266 |
const ft = document.getElementById('flagToggles');
|
| 267 |
FLAGSHIPS.forEach(f=>{
|
| 268 |
const b=document.createElement('button');
|
| 269 |
-
b.textContent=f.id; b.setAttribute('aria-pressed','true');
|
| 270 |
b.style.color = '#'+f.color.toString(16).padStart(6,'0');
|
| 271 |
b.onclick=()=>{ if(enabled.has(f.id)){enabled.delete(f.id);b.setAttribute('aria-pressed','false');}
|
| 272 |
else{enabled.add(f.id);b.setAttribute('aria-pressed','true');} rebuild(); };
|
|
|
|
| 14 |
// ---- Kanchay flagship registry + REAL endpoints (HATUN_WILLAY_PER_FLAGSHIP) ----
|
| 15 |
const FLAGSHIPS = [
|
| 16 |
{ id:'a11oy', color:0x34aaa4, base:'https://szlholdings-a11oy.hf.space/api/a11oy' },
|
| 17 |
+
{ id:'amaru', label:'Reasoning tier (Memory)', color:0x1f9d57, base:'https://szlholdings-amaru.hf.space/api/amaru' },
|
| 18 |
+
{ id:'sentra', label:'Sentinel (Immune)', color:0xc0392b, base:'https://szlholdings-sentra.hf.space/api/sentra' },
|
| 19 |
+
{ id:'rosie', label:'Operator (Companion)', color:0xc78aff, base:'https://szlholdings-rosie.hf.space/api/rosie' },
|
| 20 |
{ id:'vessels', color:0xc08f2f, base:'https://szlholdings-vessels.hf.space/api/vessels' },
|
| 21 |
{ id:'killinchu', color:0x5cc4bf, base:'https://szlholdings-killinchu.hf.space/api/killinchu' },
|
| 22 |
];
|
|
|
|
| 266 |
const ft = document.getElementById('flagToggles');
|
| 267 |
FLAGSHIPS.forEach(f=>{
|
| 268 |
const b=document.createElement('button');
|
| 269 |
+
b.textContent=f.label||f.id; b.setAttribute('aria-pressed','true');
|
| 270 |
b.style.color = '#'+f.color.toString(16).padStart(6,'0');
|
| 271 |
b.onclick=()=>{ if(enabled.has(f.id)){enabled.delete(f.id);b.setAttribute('aria-pressed','false');}
|
| 272 |
else{enabled.add(f.id);b.setAttribute('aria-pressed','true');} rebuild(); };
|