@@ -1,13 +1,13 @@
( function ( ) { let e = document . createElement ( ` link ` ) . relList ; if ( e && e . supports && e . supports ( ` modulepreload ` ) ) return ; for ( let e of document . querySelectorAll ( ` link[rel="modulepreload"] ` ) ) n ( e ) ; new MutationObserver ( e => { for ( let t of e ) if ( t . type === ` childList ` ) for ( let e of t . addedNodes ) e . tagName === ` LINK ` && e . rel === ` modulepreload ` && n ( e ) } ) . observe ( document , { childList : ! 0 , subtree : ! 0 } ) ; function t ( e ) { let t = { } ; return e . integrity && ( t . integrity = e . integrity ) , e . referrerPolicy && ( t . referrerPolicy = e . referrerPolicy ) , t . credentials = e . crossOrigin === ` use-credentials ` ? ` include ` : e . crossOrigin === ` anonymous ` ? ` omit ` : ` same-origin ` , t } function n ( e ) { if ( e . ep ) return ; e . ep = ! 0 ; let n = t ( e ) ; fetch ( e . href , n ) } } ) ( ) ; function e ( e = globalThis . crypto ) { if ( typeof e ? . randomUUID == ` function ` ) return e . randomUUID ( ) ; let t = new Uint8Array ( 16 ) ; if ( typeof e ? . getRandomValues == ` function ` ) e . getRandomValues ( t ) ; else for ( let e = 0 ; e < t . length ; e += 1 ) t [ e ] = Math . floor ( Math . random ( ) * 256 ) ; t [ 6 ] = t [ 6 ] & 15 | 64 , t [ 8 ] = t [ 8 ] & 63 | 128 ; let n = Array . from ( t , e => e . toString ( 16 ) . padStart ( 2 , ` 0 ` ) ) ; return ` ${ n . slice ( 0 , 4 ) . join ( ` ` ) } - ${ n . slice ( 4 , 6 ) . join ( ` ` ) } - ${ n . slice ( 6 , 8 ) . join ( ` ` ) } - ${ n . slice ( 8 , 10 ) . join ( ` ` ) } - ${ n . slice ( 10 ) . join ( ` ` ) } ` } async function t ( e ) { let t = await fetch ( e , { headers : { Accept : ` application/json ` } , signal : AbortSignal . timeout ( 15e3 ) } ) ; if ( t . status === 401 ) throw new i ( ` unauthorised ` , 401 ) ; if ( ! t . ok ) throw new i ( ` ${ t . status } ${ t . statusText } ` , t . status ) ; return t . json ( ) } function n ( e ) { let t = new URLSearchParams ; for ( let [ n , r ] of Object . entries ( e || { } ) ) r !== ` ` && r != null && t . set ( n , r ) ; let n = t . toString ( ) ; return n ? ` ? ${ n } ` : ` ` } async function r ( e ) { try { let t = ( await e . text ( ) ) . trim ( ) ; if ( t ) return t . split ( `
` )[0].slice(0,200)}catch{}return ` $ { e . status } $ { e . statusText } ` }var i=class extends Error{constructor(e,t){super(e),this.status=t}},a={summary:()=>t( ` / api / summary ` ),tasks:()=>t( ` / api / tasks ` ),taskMeta:()=>t( ` / api / task - meta ` ),task:e=>t( ` / api / tasks / $ { e } ` ),taskAction:async(e,t)=>{let n=await fetch( ` / api / tasks / $ { e } / action ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify({action:t}),signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new i(await r(n),n.status);return n.json()},setup:()=>t( ` / api / setup ` ),workflows:()=>t( ` / api / workflows ` ),workRequest:async e=>{let t=await fetch( ` / api / work - requests ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify(e),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},skills:()=>t( ` / api / skills ` ),channels:()=>t( ` / api / channels ` ),channelReload:async e=>{let t=await fetch( ` / api / channels / $ { encodeURIComponent ( e ) } / reload ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body: ` { } ` ,signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},config:()=>t( ` / api / config ` ),version:()=>t( ` / api / version ` ),configUpdate:async e=>{let t=await fetch( ` / api / config ` ,{method: ` PATCH ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify({updates:e}),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},configReset:async e=>{let t=await fetch( ` / api / config / reset ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify({key:e}),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},logs:e=>t( ` / api / logs ` +n(e)),captures:e=>t( ` / api / captures ` +n({limit:e})),mappings:()=>t( ` / api / mappings ` ),mappingCreate:async e=>{let t=await fetch( ` / api / mappings ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify(e),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},mappingUpdate:async(e,t)=>{let n=await fetch( ` / api / mappings / $ { e } ` ,{method: ` PATCH ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify(t),signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new i(await r(n),n.status);return n.json()},mappingDelete:async e=>{let t=await fetch( ` / api / mappings / $ { e } ` ,{method: ` DELETE ` ,headers:{Accept: ` application / json ` ,"X-Archie-CSRF": ` 1 ` },signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status)},mappingPreview:async(e,t)=>{let n=await fetch( ` / api / mappings / preview ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify({capture_id:e,fields:t}),signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new i(await r(n),n.status);return n.json()},memory:()=>t( ` / api / memory ` ),chatSessions:()=>t( ` / api / chat / sessions ` ),chatMessages:e=>t( ` / api / chat / sessions / $ { encodeURIComponent ( e ) } / messages ` ),chatTurns:e=>t( ` / api / chat / sessions / $ { encodeURIComponent ( e ) } / turns ` ),chatCancel:async e=>{let t=await fetch( ` / api / chat / cancel ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({session_id:e}),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},chatMessage:async(t,n)=>{let a=await fetch( ` / api / chat / message ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({channel_id:t,source_id:e(),text:n,page:location.hash.slice(1)|| ` / ` }),signal:AbortSignal.timeout(15e3)});if(!a.ok)throw new i(await r(a),a.status);return a.json()},chatPersona:async(e,t)=>{let n=await fetch( ` / api / chat / persona ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({session_id:e,name:t}),signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new i(await r(n),n.status);return n.json()},chatUpdate:()=>t( ` / api / chat / update ` ),chatUpdateDefer:async e=>{let t=await fetch( ` / api / chat / update / defer ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({snapshot:e}),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},chatUpdateInstall:async e=>{let t=await fetch( ` / api / chat / update / install ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({snapshot:e}),signal:AbortSignal.timeout(12e4)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},chatDangerous:()=>t( ` / api / chat / dangerous ` ),chatDangerousRequest:async(e,t)=>{let n=await fetch( ` / api / chat / dangerous / $ { encodeURIComponent ( e ) } ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type":
Line truncated
` )[0].slice(0,200)}catch{}return ` $ { e . status } $ { e . statusText } ` }var i=class extends Error{constructor(e,t){super(e),this.status=t}},a={summary:()=>t( ` / api / summary ` ),tasks:()=>t( ` / api / tasks ` ),taskMeta:()=>t( ` / api / task - meta ` ),task:e=>t( ` / api / tasks / $ { e } ` ),taskAction:async(e,t)=>{let n=await fetch( ` / api / tasks / $ { e } / action ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify({action:t}),signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new i(await r(n),n.status);return n.json()},setup:()=>t( ` / api / setup ` ),workflows:()=>t( ` / api / workflows ` ),workRequest:async e=>{let t=await fetch( ` / api / work - requests ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify(e),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},skills:()=>t( ` / api / skills ` ),channels:()=>t( ` / api / channels ` ),curators:()=>t( ` / api / curators ` ),channelReload:async e=>{let t=await fetch( ` / api / channels / $ { encodeURIComponent ( e ) } / reload ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body: ` { } ` ,signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},config:()=>t( ` / api / config ` ),version:()=>t( ` / api / version ` ),configUpdate:async e=>{let t=await fetch( ` / api / config ` ,{method: ` PATCH ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify({updates:e}),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},configReset:async e=>{let t=await fetch( ` / api / config / reset ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify({key:e}),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},logs:e=>t( ` / api / logs ` +n(e)),captures:e=>t( ` / api / captures ` +n({limit:e})),mappings:()=>t( ` / api / mappings ` ),mappingCreate:async e=>{let t=await fetch( ` / api / mappings ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify(e),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},mappingUpdate:async(e,t)=>{let n=await fetch( ` / api / mappings / $ { e } ` ,{method: ` PATCH ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify(t),signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new i(await r(n),n.status);return n.json()},mappingDelete:async e=>{let t=await fetch( ` / api / mappings / $ { e } ` ,{method: ` DELETE ` ,headers:{Accept: ` application / json ` ,"X-Archie-CSRF": ` 1 ` },signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status)},mappingPreview:async(e,t)=>{let n=await fetch( ` / api / mappings / preview ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` ,"X-Archie-CSRF": ` 1 ` },body:JSON.stringify({capture_id:e,fields:t}),signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new i(await r(n),n.status);return n.json()},memory:()=>t( ` / api / memory ` ),chatSessions:()=>t( ` / api / chat / sessions ` ),chatMessages:e=>t( ` / api / chat / sessions / $ { encodeURIComponent ( e ) } / messages ` ),chatTurns:e=>t( ` / api / chat / sessions / $ { encodeURIComponent ( e ) } / turns ` ),chatCancel:async e=>{let t=await fetch( ` / api / chat / cancel ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({session_id:e}),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},chatMessage:async(t,n)=>{let a=await fetch( ` / api / chat / message ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({channel_id:t,source_id:e(),text:n,page:location.hash.slice(1)|| ` / ` }),signal:AbortSignal.timeout(15e3)});if(!a.ok)throw new i(await r(a),a.status);return a.json()},chatPersona:async(e,t)=>{let n=await fetch( ` / api / chat / persona ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({session_id:e,name:t}),signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new i(await r(n),n.status);return n.json()},chatUpdate:()=>t( ` / api / chat / update ` ),chatUpdateDefer:async e=>{let t=await fetch( ` / api / chat / update / defer ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({snapshot:e}),signal:AbortSignal.timeout(15e3)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},chatUpdateInstall:async e=>{let t=await fetch( ` / api / chat / update / install ` ,{method: ` POST ` ,headers:{Accept: ` application / json ` ,"Content-Type": ` application / json ` },body:JSON.stringify({snapshot:e}),signal:AbortSignal.timeout(12e4)});if(!t.ok)throw new i(await r(t),t.status);return t.json()},chatDangerous:()=>t( ` / api / chat / dangerous ` ),chatDangerousRequest:async(e,t)=>{let n=await fetch( ` / api / chat / dangerous / $ { encodeURIComponent ( e ) } ` ,{method: ` POST ` ,headers:{Accept: ` a Line truncated
<path d=" ${ c ( 150 , 240 ) } " fill="none" stroke="var(--border)"
stroke-width="12" stroke-linecap="round"/>
<path d=" ${ c ( 150 , 240 ) } " fill="none" stroke=" ${ i } "
stroke-width="12" stroke-linecap="round"
stroke-dasharray=" ${ s } "
stroke-dashoffset=" ${ s * ( 1 - r / 100 ) } "
class = "gauge-value" / > ` ,y( ` div . gauge - wrap ` ,l,y( ` div . gauge - center ` ,y( ` div . gauge - pct ` , ` $ { Math . round ( r ) } % ` ),y( ` div . gauge - label ` ,t)))}function j(e){let t=e.reduce((e,t)=>e+(t.value||0),0)||1;return y( ` div ` ,y( ` div . segbar ` ,...e.filter(e=>e.value>0).map(e=>y( ` span ` ,{class: ` segbar - part segbar - $ { e . kind || ` idle ` } ` ,style: ` width : $ { ( e . value / t * 100 ) . toFixed ( 1 ) } % ` ,title: ` $ { e . label } : $ { e . value } ` }))),y( ` div . segbar - legend ` ,...e.map(e=>y( ` span . segbar - key ` ,y( ` span ` ,{class: ` segbar - dot segbar - $ { e . kind || ` idle ` } ` }),e.label))))}var M= ` archie . setup - complete . dismissed . v1 ` ;function N(e,t=globalThis.localStorage){if(!e?.steps?.length)return{kind: ` omit ` ,remaining:[]};let n=e.steps.filter(e=>!e.done);return n.length?(t?.removeItem?.(M),{kind: ` incomplete ` ,remaining:n}):t?.getItem?.( ` archie . setup - complete . dismissed . v1 ` )=== ` 1 ` ?{kind: ` dismissed ` ,remaining:[]}:{kind: ` complete ` ,remaining:[]}}function P(e=globalThis.localStorage){e?.setItem?.(M, ` 1 ` )}var F=new Set([ ` waiting _human ` , ` parked ` ]);function I(e=[]){let t=e.filter(e=>F.has(e.status)),n=e.filter(e=>e.status=== ` running ` );return{attention:{count:t.length,href:t.length===1? ` # / tasks ? task = $ { encodeURIComponent ( t [ 0 ] . id ) } ` : ` # / tasks ? status = needs _you ` },running:{count:n.length,href: ` # / tasks ? status = running ` }}}function L(){let e=y( ` div ` ),t=y( ` tbody ` ),n=y( ` div . grid . grid - 4 ` ),r=y( ` div ` ),i=y( ` div ` ),s=y( ` div . dash - top ` ,r,i),c=y( ` div ` ),l=y( ` div . hero - actions - inner ` ),u=y( ` h1 . hero - title ` ,B()),d=S( ` connecting ` , ` idle ` ),f=[],p=new Map;h(),_();let m=o(e=>{f.unshift(e),f.splice(50),g()},e=>{d.className= ` pill pill - $ { e === ` live ` ? ` ok ` : ` warn ` } ` ,d.textContent=e});e.addEventListener( ` archie : teardown ` ,m);function h(){x(e,y( ` div . hero ` ,y( ` div ` ,u,y( ` p . hero - sub ` , ` Your agent ' s control room — what it is working on , what needs you , and what it is spending . ` )),y( ` div . hero - actions ` ,l)),y( ` div . dash - section ` ,y( ` div . dash - section - head ` ,y( ` h2 . dash - section - title ` , ` Health ` )),s),y( ` div . dash - section ` ,y( ` div . dash - section - head ` ,y( ` h2 . dash - section - title ` , ` Throughput ` ),y( ` span . dash - section - note ` , ` Across all repositories ` )),n),y( ` div . dash - section ` ,y( ` div . dash - section - head ` ,y( ` h2 . dash - section - title ` , ` Right now ` )),y( ` div . dash - split ` ,c,y( ` div . card ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` , ` Live activity ` ),y( ` p . card - sub ` , ` Last 50 , newest first ` )),d),y( ` div . table - scroll ` ,y( ` table . table ` ,y( ` thead ` ,y( ` tr ` ,...[ ` Event ` , ` Task ` , ` Detail ` , ` When ` ].map(e=>y( ` th ` ,e)))),t)))))),g()}function g(){if(!f.length){x(t,y( ` tr ` ,y( ` td ` ,{colspan:4},T( ` Waiting for activity ` , ` Events appear here as Archie works . ` ))));return}x(t,...f.map(e=>R(e,p)))}async function _(){try{let[e,t,n,r]=await Promise.all([a.summary(),a.setup().catch(()=>null),a.workflows().catch(()=>null),a.tasks().catch(()=>[])]);p.clear();for(let e of r)e.owner&&e.repo&&e.issue_number&&p.set( ` $ { e . owner } / $ { e . repo } # $ { e . issue _number } ` ,e.id);g(),v(r),u.textContent=t?.operator? ` $ { B ( ) } , $ { t . operator } ` :B(),b(e),C(t),E(e,n),k(e)}catch(e){x(n,y( ` div . card ` ,T( ` Cannot reach archied ` ,String(e.message||e)))),x(l,y( ` button . btn . btn - primary ` ,{onclick:_},D( ` refresh ` ,{size:15}), ` Retry ` ))}}function v(e){let t=I(e),n=t.attention.count,r=t.running.count;x(l,n>0&&y( ` a . btn . btn - attention ` ,{href:t.attention.href},D( ` tasks ` ,{size:15}), ` $ { n } need$ { n === 1 ? ` s ` : ` ` } you ` ),r>0&&y( ` a . btn ` ,{href:t.running.href},D( ` workflows ` ,{size:15}), ` $ { r } running ` ),y( ` a . btn ` ,{href: ` # / logs ` },D( ` logs ` ,{size:15}), ` Logs ` ),y( ` button . btn . btn - primary ` ,{onclick:_},D( ` refresh ` ,{size:15}), ` Refresh ` ))}function b(e){let t=e?.statuses||{},r=(t.merged||0)+(t.pr_open||0),i=(t.parked||0)+(t.waiting_human||0),a=Object.values(t).reduce((e,t)=>e+t,0),o=e?.tokens_by_day||[];x(n,O({label: ` Working now ` ,value:t.running||0,compare: ` $ { t . queued || 0 } waiting to start ` ,series:o.map(e=>e.tokens||0)}),O({label: ` Needs you ` ,value:i,compare:i? ` Parked or awaiting a reply ` : ` Nothing is blocked ` ,goodDirection: ` down ` }),O({label: ` Delivered ` ,value:r,compare:a? ` $ { Math . round ( r / a * 100 ) } % of all tasks ` : ` No tasks yet ` }),O({label: ` Tokens used ` ,value:w(o.reduce((e,t)=>e+(t.tokens||0),0)),compare: ` Across $ { o . length || 0 } days ` ,trend:ee(o.map(e=>e.tokens||0)),goodDirection: ` down ` ,series:o.map(e=>e.tokens||0)}))}function C(e){let t=N(e),n=t.kind=== ` omit ` ||t.kind=== ` dismissed ` ;if(s.classList.toggle( ` dash - top - standalone ` ,n),n)return x(r);let i=t.remaining;if(i.length){let t=Math.round((e.steps.length-i.length)/e.steps.length*100);x(r,y( ` div . card . setup ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` , ` Finish setting up ` ),y( ` p . card - sub ` , ` Archie needs these before it can work on its own . ` )),y( ` span . setup - pct ` , ` $ { t } % ` )),y( ` div . setup - bar ` ,y( ` div . setup - bar - fill ` ,{style: ` width : $ { t } % ` })),y( ` ul . setup - list ` ,...e.steps.map(A))));return}x(r,y( ` div . card . setup . setup - done ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` , ` Setup complete ` ),y( ` p . card - sub ` , ` Archie is configured and ready to work . ` )),y( ` div . setup - complete - actions ` ,y( ` span . setup - pct ` ,D( ` check ` ,{size:16})),y( ` button . icon - btn . setup - dismiss ` ,{type: ` button ` ,title: ` Dismiss setup complete ` ,"aria-label": ` Dismiss setup complete ` ,onclick:()=>{P(),C(e)}}, ` × ` )))))}function
Line truncated
` )},y( ` td . strong ` ,e.label||e.id),y( ` td . mono ` ,e.install_type|| ` — ` ),y( ` td . mono ` ,e.running_version|| ` — ` ),y( ` td . mono ` ,e.latest_available|| ` — ` ),y( ` td ` ,S(xe[e.status]||e.status,Se[e.status]|| ` idle ` )))))))):we( ` How each component is deployed , and whether what 's running matches what' s installed . ` ,T( ` No components reported ` , ` The configured update - check command returned nothing . ` ))}function we(e,...t){return y( ` div . card . cfg - section ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` , ` Update status ` ),y( ` p . card - sub ` ,e))),...t)}function Te(){let e=y( ` div . cfg - page ` ),t=y( ` div ` ),n=y( ` div ` ),r=y( ` div ` );i(),o(),s(),c();function i(){x(e,y( ` div . page - head ` ,y( ` div ` ,y( ` h1 . page - title ` , ` Configuration ` ),y( ` p . page - sub ` , ` What archied is actually running with right now . ` )),y( ` div . page - actions ` ,y( ` button . btn ` ,{onclick:()=>{o(),s(),c()}}, ` Refresh ` ))),n,r,t)}async function o(){try{l(await a.config(),o)}catch(e){x(t,y( ` div . card ` ,T( ` Cannot reach archied ` ,String(e.message||e))))}}async function s(){try{let e=await a.version();x(n,Ce(e?.components||[]))}catch(e){if(e?.status===501){x(n);return}x(n,y( ` div . card ` ,T( ` Update status unavailable ` ,String(e.message||e))))}}async function c(){try{let e=await a.taskMeta();x(r,De(e))}catch(e){x(r,J( ` Work lifecycle ` , ` The task statuses and operator actions archied ships . ` ,T( ` Lifecycle unavailable ` ,String(e.message||e))))}}function l(e,n){if(!e||Object.keys(e).length===0){x(t,y( ` div . card ` ,T( ` No configuration loaded ` , ` archied is running without a config file wired into the dashboard , so there is nothing to show . ` )));return}let r={locked:e.locked||{},overridden:e.overridden||[],onSaved:n},i=[e.reload?.overlay_unavailable&&y( ` div . card . cfg - notice ` ,y( ` p ` , ` The runtime config overlay is not in effect : $ { e . reload . overlay _unavailable } ` )),e.reload?.last_error&&y( ` div . card . cfg - notice ` ,y( ` p ` , ` The last config reload failed ; the running config is unchanged : $ { e . reload . last _error } ` ))];x(t,...i,je(e.identity,r),Me(e.repositories),Pe(e.models,e.providers),Ie(e.budgets,r),Le(e.storage,e.containers,r),ze(e.web,r),Ee(e.provenance))}return e}function Ee(e){return e?.length?J( ` Configuration sources ` , ` Applied from top to bottom ; later entries take precedence over earlier ones . ` ,y( ` div . kv - list ` ,...e.map(e=>q( ` $ { e . layer } $ { e . role } $ { e . feature ? ` ( ${ e . feature } ) ` : ` ` } ` ,e.path)))):J( ` Configuration sources ` , ` The files that supplied the running configuration . ` ,T( ` Source provenance is unavailable . ` ))}function J(e,t,...n){return y( ` div . card . cfg - section ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` ,e),y( ` p . card - sub ` ,t))),...n)}function De(e){let t=e?.statuses||[],n=e?.actions||[],r=t.length?y( ` div . kv - list ` ,...t.map(e=>Oe(e))):T( ` No statuses reported ` , ` The server did not return any lifecycle statuses . ` ),i=n.length?y( ` div . kv - list ` ,...n.map(e=>ke(e))):T( ` No actions reported ` , ` The server did not return any operator actions . ` );return J( ` Work lifecycle ` , ` The task statuses and operator actions archied ships . Add one on the backend and it appears here without a frontend change . ` ,y( ` h3 . cfg - subhead ` , ` Statuses ` ),r,y( ` h3 . cfg - subhead ` , ` Actions ` ),i)}function Oe(e){let t=e.label??m(e.id),n=e.kind??h(e.id);return y( ` div . kv ` ,y( ` span . kv - label ` ,e.id),y( ` span . kv - value ` ,S(t,n)))}function ke(e){let t=e.label??e.id,n=Ae(e.kind),r=n? ` button . btn . btn - small . $ { n } ` : ` button . btn . btn - small ` ;return y( ` div . kv ` ,y( ` span . kv - label ` ,e.id),y( ` span . kv - value ` ,y(r,{type: ` button ` ,disabled:!0},t)))}function Ae(e){return e=== ` quiet ` ? ` btn - quiet ` :e=== ` danger ` ? ` btn - danger ` : ` ` }function je(e,t){return e?J( ` Identity ` , ` Who Archie is on the forge , and how it addresses commits and comments . ` ,y( ` div . kv - list ` ,q( ` Bot account ` ,e.bot_user,{key: ` bot _user ` ,type: ` string ` ,raw:e.bot_user,...t}),q( ` Commit author email ` ,e.bot_email,{key: ` bot _email ` ,type: ` string ` ,raw:e.bot_email,...t}),q( ` Pickup label ` ,e.label,{key: ` label ` ,type: ` string ` ,raw:e.label,...t}),q( ` Forge type ` ,e.forge_type,{key: ` forge . type ` ,type: ` string ` ,raw:e.forge_type,...t}),q( ` Forge host ` ,e.forge_host,{key: ` forge . host ` ,type: ` string ` ,raw:e.forge_host,...t}),q( ` Max diff size ( lines ) ` ,e.diff_cap_lines|| ` Unlimited ` ,{key: ` diff _cap _lines ` ,type: ` int ` ,raw:e.diff_cap_lines,...t}))):J( ` Identity ` , ` Who Archie is on the forge . ` ,T( ` Not available ` ))}function Me(e){return e?.length?J( ` Repositories ` , ` Each repository Archie polls , and the quality gate a change must pass before it opens a pull request . ` ,y( ` div . table - scroll ` ,y( ` table . table ` ,y( ` thead ` ,y( ` tr ` ,...[ ` Repository ` , ` Base branch ` , ` Ecosystem ` , ` Quality gate ` , ` Protected paths ` ].map(e=>y( ` th ` ,e)))),y( ` tbody ` ,...e.map(e=>y( ` tr ` ,y( ` td . strong ` , ` $ { e . owner } / $ { e . name } ` ),y( ` td . mono ` ,e.base),y( ` td ` ,e.ecosystem|| ` go ` ),y( ` td . mono ` ,Ne(e.gate)),y( ` td . mono ` ,e.protect?.length?e.protect.join( ` , ` ): ` — ` ))))))):J( ` Repositories ` , ` The repositories Archie polls for work . ` ,T( ` No repositories configured ` , ` Add a [ [ repos ] ] entry in config . toml so Archie has somewhere to work . ` ))}function Ne(e){return e?.length?e.map(e=>e.join( ` ` )).join( ` → ` ): ` — ` }function Pe(e,t){let n=Object.entries(e||{}),r=Object.entries(t||{}),i=n.length?y( ` Line truncated
class = "gauge-value" / > ` ,y( ` div . gauge - wrap ` ,l,y( ` div . gauge - center ` ,y( ` div . gauge - pct ` , ` $ { Math . round ( r ) } % ` ),y( ` div . gauge - label ` ,t)))}function j(e){let t=e.reduce((e,t)=>e+(t.value||0),0)||1;return y( ` div ` ,y( ` div . segbar ` ,...e.filter(e=>e.value>0).map(e=>y( ` span ` ,{class: ` segbar - part segbar - $ { e . kind || ` idle ` } ` ,style: ` width : $ { ( e . value / t * 100 ) . toFixed ( 1 ) } % ` ,title: ` $ { e . label } : $ { e . value } ` }))),y( ` div . segbar - legend ` ,...e.map(e=>y( ` span . segbar - key ` ,y( ` span ` ,{class: ` segbar - dot segbar - $ { e . kind || ` idle ` } ` }),e.label))))}var M= ` archie . setup - complete . dismissed . v1 ` ;function N(e,t=globalThis.localStorage){if(!e?.steps?.length)return{kind: ` omit ` ,remaining:[]};let n=e.steps.filter(e=>!e.done);return n.length?(t?.removeItem?.(M),{kind: ` incomplete ` ,remaining:n}):t?.getItem?.( ` archie . setup - complete . dismissed . v1 ` )=== ` 1 ` ?{kind: ` dismissed ` ,remaining:[]}:{kind: ` complete ` ,remaining:[]}}function P(e=globalThis.localStorage){e?.setItem?.(M, ` 1 ` )}var F=new Set([ ` waiting _human ` , ` parked ` ]);function I(e=[]){let t=e.filter(e=>F.has(e.status)),n=e.filter(e=>e.status=== ` running ` );return{attention:{count:t.length,href:t.length===1? ` # / tasks ? task = $ { encodeURIComponent ( t [ 0 ] . id ) } ` : ` # / tasks ? status = needs _you ` },running:{count:n.length,href: ` # / tasks ? status = running ` }}}function L(){let e=y( ` div ` ),t=y( ` tbody ` ),n=y( ` div . grid . grid - 4 ` ),r=y( ` div ` ),i=y( ` div ` ),s=y( ` div . dash - top ` ,r,i),c=y( ` div ` ),l=y( ` div . hero - actions - inner ` ),u=y( ` h1 . hero - title ` ,B()),d=S( ` connecting ` , ` idle ` ),f=[],p=new Map;h(),_();let m=o(e=>{f.unshift(e),f.splice(50),g()},e=>{d.className= ` pill pill - $ { e === ` live ` ? ` ok ` : ` warn ` } ` ,d.textContent=e});e.addEventListener( ` archie : teardown ` ,m);function h(){x(e,y( ` div . hero ` ,y( ` div ` ,u,y( ` p . hero - sub ` , ` Your agent ' s control room — what it is working on , what needs you , and what it is spending . ` )),y( ` div . hero - actions ` ,l)),y( ` div . dash - section ` ,y( ` div . dash - section - head ` ,y( ` h2 . dash - section - title ` , ` Health ` )),s),y( ` div . dash - section ` ,y( ` div . dash - section - head ` ,y( ` h2 . dash - section - title ` , ` Throughput ` ),y( ` span . dash - section - note ` , ` Across all repositories ` )),n),y( ` div . dash - section ` ,y( ` div . dash - section - head ` ,y( ` h2 . dash - section - title ` , ` Right now ` )),y( ` div . dash - split ` ,c,y( ` div . card ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` , ` Live activity ` ),y( ` p . card - sub ` , ` Last 50 , newest first ` )),d),y( ` div . table - scroll ` ,y( ` table . table ` ,y( ` thead ` ,y( ` tr ` ,...[ ` Event ` , ` Task ` , ` Detail ` , ` When ` ].map(e=>y( ` th ` ,e)))),t)))))),g()}function g(){if(!f.length){x(t,y( ` tr ` ,y( ` td ` ,{colspan:4},T( ` Waiting for activity ` , ` Events appear here as Archie works . ` ))));return}x(t,...f.map(e=>R(e,p)))}async function _(){try{let[e,t,n,r]=await Promise.all([a.summary(),a.setup().catch(()=>null),a.workflows().catch(()=>null),a.tasks().catch(()=>[])]);p.clear();for(let e of r)e.owner&&e.repo&&e.issue_number&&p.set( ` $ { e . owner } / $ { e . repo } # $ { e . issue _number } ` ,e.id);g(),v(r),u.textContent=t?.operator? ` $ { B ( ) } , $ { t . operator } ` :B(),b(e),C(t),E(e,n),k(e)}catch(e){x(n,y( ` div . card ` ,T( ` Cannot reach archied ` ,String(e.message||e)))),x(l,y( ` button . btn . btn - primary ` ,{onclick:_},D( ` refresh ` ,{size:15}), ` Retry ` ))}}function v(e){let t=I(e),n=t.attention.count,r=t.running.count;x(l,n>0&&y( ` a . btn . btn - attention ` ,{href:t.attention.href},D( ` tasks ` ,{size:15}), ` $ { n } need$ { n === 1 ? ` s ` : ` ` } you ` ),r>0&&y( ` a . btn ` ,{href:t.running.href},D( ` workflows ` ,{size:15}), ` $ { r } running ` ),y( ` a . btn ` ,{href: ` # / logs ` },D( ` logs ` ,{size:15}), ` Logs ` ),y( ` button . btn . btn - primary ` ,{onclick:_},D( ` refresh ` ,{size:15}), ` Refresh ` ))}function b(e){let t=e?.statuses||{},r=(t.merged||0)+(t.pr_open||0),i=(t.parked||0)+(t.waiting_human||0),a=Object.values(t).reduce((e,t)=>e+t,0),o=e?.tokens_by_day||[];x(n,O({label: ` Working now ` ,value:t.running||0,compare: ` $ { t . queued || 0 } waiting to start ` ,series:o.map(e=>e.tokens||0)}),O({label: ` Needs you ` ,value:i,compare:i? ` Parked or awaiting a reply ` : ` Nothing is blocked ` ,goodDirection: ` down ` }),O({label: ` Delivered ` ,value:r,compare:a? ` $ { Math . round ( r / a * 100 ) } % of all tasks ` : ` No tasks yet ` }),O({label: ` Tokens used ` ,value:w(o.reduce((e,t)=>e+(t.tokens||0),0)),compare: ` Across $ { o . length || 0 } days ` ,trend:ee(o.map(e=>e.tokens||0)),goodDirection: ` down ` ,series:o.map(e=>e.tokens||0)}))}function C(e){let t=N(e),n=t.kind=== ` omit ` ||t.kind=== ` dismissed ` ;if(s.classList.toggle( ` dash - top - standalone ` ,n),n)return x(r);let i=t.remaining;if(i.length){let t=Math.round((e.steps.length-i.length)/e.steps.length*100);x(r,y( ` div . card . setup ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` , ` Finish setting up ` ),y( ` p . card - sub ` , ` Archie needs these before it can work on its own . ` )),y( ` span . setup - pct ` , ` $ { t } % ` )),y( ` div . setup - bar ` ,y( ` div . setup - bar - fill ` ,{style: ` width : $ { t } % ` })),y( ` ul . setup - list ` ,...e.steps.map(A))));return}x(r,y( ` div . card . setup . setup - done ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` , ` Setup complete ` ),y( ` p . card - sub ` , ` Archie is configured and ready to work . ` )),y( ` div . setup - complete - actions ` ,y( ` span . setup - pct ` ,D( ` check ` ,{size:16})),y( ` button . icon - btn . setup - dismiss ` ,{type: ` button ` ,title: ` Dismiss setup complete ` ,"aria-label": ` Dismiss setup complete ` ,onclick:()=>{P(),C(e)}}, ` × ` )))))}function
Line truncated
` )},y( ` td . strong ` ,e.label||e.id),y( ` td . mono ` ,e.install_type|| ` — ` ),y( ` td . mono ` ,e.running_version|| ` — ` ),y( ` td . mono ` ,e.latest_available|| ` — ` ),y( ` td ` ,S(Se[e.status]||e.status,Ce[e.status]|| ` idle ` )))))))):Te( ` How each component is deployed , and whether what 's running matches what' s installed . ` ,T( ` No components reported ` , ` The configured update - check command returned nothing . ` ))}function Te(e,...t){return y( ` div . card . cfg - section ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` , ` Update status ` ),y( ` p . card - sub ` ,e))),...t)}function Ee(){let e=y( ` div . cfg - page ` ),t=y( ` div ` ),n=y( ` div ` ),r=y( ` div ` );i(),o(),s(),c();function i(){x(e,y( ` div . page - head ` ,y( ` div ` ,y( ` h1 . page - title ` , ` Configuration ` ),y( ` p . page - sub ` , ` What archied is actually running with right now . ` )),y( ` div . page - actions ` ,y( ` button . btn ` ,{onclick:()=>{o(),s(),c()}}, ` Refresh ` ))),n,r,t)}async function o(){try{l(await a.config(),o)}catch(e){x(t,y( ` div . card ` ,T( ` Cannot reach archied ` ,String(e.message||e))))}}async function s(){try{let e=await a.version();x(n,we(e?.components||[]))}catch(e){if(e?.status===501){x(n);return}x(n,y( ` div . card ` ,T( ` Update status unavailable ` ,String(e.message||e))))}}async function c(){try{let e=await a.taskMeta();x(r,Oe(e))}catch(e){x(r,J( ` Work lifecycle ` , ` The task statuses and operator actions archied ships . ` ,T( ` Lifecycle unavailable ` ,String(e.message||e))))}}function l(e,n){if(!e||Object.keys(e).length===0){x(t,y( ` div . card ` ,T( ` No configuration loaded ` , ` archied is running without a config file wired into the dashboard , so there is nothing to show . ` )));return}let r={locked:e.locked||{},overridden:e.overridden||[],onSaved:n},i=[e.reload?.overlay_unavailable&&y( ` div . card . cfg - notice ` ,y( ` p ` , ` The runtime config overlay is not in effect : $ { e . reload . overlay _unavailable } ` )),e.reload?.last_error&&y( ` div . card . cfg - notice ` ,y( ` p ` , ` The last config reload failed ; the running config is unchanged : $ { e . reload . last _error } ` ))];x(t,...i,Me(e.identity,r),Ne(e.repositories),Fe(e.models,e.providers),Le(e.budgets,r),Re(e.storage,e.containers,r),Be(e.web,r),De(e.provenance))}return e}function De(e){return e?.length?J( ` Configuration sources ` , ` Applied from top to bottom ; later entries take precedence over earlier ones . ` ,y( ` div . kv - list ` ,...e.map(e=>q( ` $ { e . layer } $ { e . role } $ { e . feature ? ` ( ${ e . feature } ) ` : ` ` } ` ,e.path)))):J( ` Configuration sources ` , ` The files that supplied the running configuration . ` ,T( ` Source provenance is unavailable . ` ))}function J(e,t,...n){return y( ` div . card . cfg - section ` ,y( ` div . card - head ` ,y( ` div ` ,y( ` h2 . card - title ` ,e),y( ` p . card - sub ` ,t))),...n)}function Oe(e){let t=e?.statuses||[],n=e?.actions||[],r=t.length?y( ` div . kv - list ` ,...t.map(e=>ke(e))):T( ` No statuses reported ` , ` The server did not return any lifecycle statuses . ` ),i=n.length?y( ` div . kv - list ` ,...n.map(e=>Ae(e))):T( ` No actions reported ` , ` The server did not return any operator actions . ` );return J( ` Work lifecycle ` , ` The task statuses and operator actions archied ships . Add one on the backend and it appears here without a frontend change . ` ,y( ` h3 . cfg - subhead ` , ` Statuses ` ),r,y( ` h3 . cfg - subhead ` , ` Actions ` ),i)}function ke(e){let t=e.label??m(e.id),n=e.kind??h(e.id);return y( ` div . kv ` ,y( ` span . kv - label ` ,e.id),y( ` span . kv - value ` ,S(t,n)))}function Ae(e){let t=e.label??e.id,n=je(e.kind),r=n? ` button . btn . btn - small . $ { n } ` : ` button . btn . btn - small ` ;return y( ` div . kv ` ,y( ` span . kv - label ` ,e.id),y( ` span . kv - value ` ,y(r,{type: ` button ` ,disabled:!0},t)))}function je(e){return e=== ` quiet ` ? ` btn - quiet ` :e=== ` danger ` ? ` btn - danger ` : ` ` }function Me(e,t){return e?J( ` Identity ` , ` Who Archie is on the forge , and how it addresses commits and comments . ` ,y( ` div . kv - list ` ,q( ` Bot account ` ,e.bot_user,{key: ` bot _user ` ,type: ` string ` ,raw:e.bot_user,...t}),q( ` Commit author email ` ,e.bot_email,{key: ` bot _email ` ,type: ` string ` ,raw:e.bot_email,...t}),q( ` Pickup label ` ,e.label,{key: ` label ` ,type: ` string ` ,raw:e.label,...t}),q( ` Forge type ` ,e.forge_type,{key: ` forge . type ` ,type: ` string ` ,raw:e.forge_type,...t}),q( ` Forge host ` ,e.forge_host,{key: ` forge . host ` ,type: ` string ` ,raw:e.forge_host,...t}),q( ` Max diff size ( lines ) ` ,e.diff_cap_lines|| ` Unlimited ` ,{key: ` diff _cap _lines ` ,type: ` int ` ,raw:e.diff_cap_lines,...t}))):J( ` Identity ` , ` Who Archie is on the forge . ` ,T( ` Not available ` ))}function Ne(e){return e?.length?J( ` Repositories ` , ` Each repository Archie polls , and the quality gate a change must pass before it opens a pull request . ` ,y( ` div . table - scroll ` ,y( ` table . table ` ,y( ` thead ` ,y( ` tr ` ,...[ ` Repository ` , ` Base branch ` , ` Ecosystem ` , ` Quality gate ` , ` Protected paths ` ].map(e=>y( ` th ` ,e)))),y( ` tbody ` ,...e.map(e=>y( ` tr ` ,y( ` td . strong ` , ` $ { e . owner } / $ { e . name } ` ),y( ` td . mono ` ,e.base),y( ` td ` ,e.ecosystem|| ` go ` ),y( ` td . mono ` ,Pe(e.gate)),y( ` td . mono ` ,e.protect?.length?e.protect.join( ` , ` ): ` — ` ))))))):J( ` Repositories ` , ` The repositories Archie polls for work . ` ,T( ` No repositories configured ` , ` Add a [ [ repos ] ] entry in config . toml so Archie has somewhere to work . ` ))}function Pe(e){return e?.length?e.map(e=>e.join( ` ` )).join( ` → ` ): ` — ` }function Fe(e,t){let n=Object.entries(e||{}),r=Object.entries(t||{}),i=n.length?y( ` Line truncated
<div class="chat-page-content">
<header class="chat-topbar">
<div><span class="chat-kicker">ARCHIE WORKSPACE</span><h1 class="page-title">Chat</h1></div>
@@ -72,10 +72,10 @@
</div>
</div>
</div>
` ; function pt ( ) { let e = document . createElement ( ` template ` ) ; e . innerHTML = ft . trim ( ) ; let t = e . content . firstElementChild , n = { } ; for ( let e of t . querySelectorAll ( ` [data-chat-ref] ` ) ) n [ e . dataset . chatRef ] = e ; return { root : t , refs : n } } function Y ( e ) { let t = document . createDocumentFragment ( ) , n = /(~~[^~]+~~|\*\*[^*]+\*\*|__[^_]+__|`[^`]+`|\[[^\]]+\]\(https?:\/\/[^\s)]+\)|\*[^*]+\*|_[^_]+_)/g , r = 0 ; for ( let i of e . matchAll ( n ) ) { i . index > r && t . append ( document . createTextNode ( e . slice ( r , i . index ) ) ) ; let n = i [ 0 ] ; if ( n . startsWith ( ` ~~ ` ) ) t . append ( y ( ` del ` , n . slice ( 2 , - 2 ) ) ) ; else if ( n . startsWith ( ` ** ` ) || n . startsWith ( ` __ ` ) ) t . append ( y ( ` strong ` , n . slice ( 2 , - 2 ) ) ) ; else if ( n . startsWith ( "`" ) ) t . append ( y ( ` code ` , n . slice ( 1 , - 1 ) ) ) ; else if ( n . startsWith ( ` [ ` ) ) { let e = n . match ( /^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/ ) ; t . append ( y ( ` a ` , { href : e [ 2 ] , target : ` _blank ` , rel : ` noreferrer ` } , e [ 1 ] ) ) } else t . append ( y ( ` em ` , n . slice ( 1 , - 1 ) ) ) ; r = i . index + n . length } return r < e . length && t . append ( document . createTextNode ( e . slice ( r ) ) ) , t } function mt ( e ) { let t = y ( ` div.chat-bubble-text ` ) , n = String ( e || ` ` ) . split ( `
` ; function mt ( ) { let e = document . createElement ( ` template ` ) ; e . innerHTML = pt . trim ( ) ; let t = e . content . firstElementChild , n = { } ; for ( let e of t . querySelectorAll ( ` [data-chat-ref] ` ) ) n [ e . dataset . chatRef ] = e ; return { root : t , refs : n } } function Y ( e ) { let t = document . createDocumentFragment ( ) , n = /(~~[^~]+~~|\*\*[^*]+\*\*|__[^_]+__|`[^`]+`|\[[^\]]+\]\(https?:\/\/[^\s)]+\)|\*[^*]+\*|_[^_]+_)/g , r = 0 ; for ( let i of e . matchAll ( n ) ) { i . index > r && t . append ( document . createTextNode ( e . slice ( r , i . index ) ) ) ; let n = i [ 0 ] ; if ( n . startsWith ( ` ~~ ` ) ) t . append ( y ( ` del ` , n . slice ( 2 , - 2 ) ) ) ; else if ( n . startsWith ( ` ** ` ) || n . startsWith ( ` __ ` ) ) t . append ( y ( ` strong ` , n . slice ( 2 , - 2 ) ) ) ; else if ( n . startsWith ( "`" ) ) t . append ( y ( ` code ` , n . slice ( 1 , - 1 ) ) ) ; else if ( n . startsWith ( ` [ ` ) ) { let e = n . match ( /^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/ ) ; t . append ( y ( ` a ` , { href : e [ 2 ] , target : ` _blank ` , rel : ` noreferrer ` } , e [ 1 ] ) ) } else t . append ( y ( ` em ` , n . slice ( 1 , - 1 ) ) ) ; r = i . index + n . length } return r < e . length && t . append ( document . createTextNode ( e . slice ( r ) ) ) , t } function ht ( e ) { let t = y ( ` div.chat-bubble-text ` ) , n = String ( e || ` ` ) . split ( `
` ) , r = [ ] , i = null , a = null , o = ( ) => { r . length && ( t . append ( y ( ` p ` , Y ( r . join ( ` ` ) ) ) ) , r = [ ] ) } , s = ( ) => { i && t . append ( i ) , i = null } ; for ( let e = 0 ; e < n . length ; e ++ ) { let c = n [ e ] ; if ( c . startsWith ( "```" ) ) { o ( ) , s ( ) , a ? ( t . append ( y ( ` pre ` , y ( ` code ` , a . join ( `
` ) ) ) ) , a = null ) : a = [ ] ; continue } if ( a ) { a . push ( c ) ; continue } let l = ht ( c ) , u = e + 1 < n . length ? ht ( n [ e + 1 ] ) : null ; if ( l && u && gt ( u ) && l . length === u . length ) { o ( ) , s ( ) ; let r = [ ] ; for ( e += 2 ; e < n . length ; e ++ ) { let t = ht ( n [ e ] ) ; if ( ! t || t . length !== l . length ) { e -- ; break } r . push ( t ) } let i = y ( ` tbody ` ) ; for ( let e of r ) i . append ( y ( ` tr ` , ... e . map ( e => y ( ` td ` , Y ( e ) ) ) ) ) ; t . append ( y ( ` table ` , y ( ` thead ` , y ( ` tr ` , ... l . map ( e => y ( ` th ` , Y ( e ) ) ) ) ) , i ) ) ; continue } if ( ! c . trim ( ) ) { o ( ) , s ( ) ; continue } let d = c . match ( /^(#{1,3})\s+(.+)$/ ) ; if ( d ) { o ( ) , s ( ) , t . append ( y ( ` h ${ d [ 1 ] . length } ` , Y ( d [ 2 ] ) ) ) ; continue } let f = c . match ( /^\s*[-*]\s+(.+)$/ ) , p = c . match ( /^\s*\d+[.)]\s+(.+)$/ ) ; if ( f || p ) { o ( ) ; let e = p ? ` ol ` : ` ul ` ; ( ! i || i . tagName . toLowerCase ( ) !== e ) && ( s ( ) , i = y ( e ) ) , i . append ( y ( ` li ` , Y ( ( f || p ) [ 1 ] ) ) ) ; continue } if ( c . startsWith ( ` > ` ) ) { o ( ) , s ( ) , t . append ( y ( ` blockquote ` , Y ( c . replace ( /^>\s?/ , ` ` ) ) ) ) ; continue } r . push ( c ) } return o ( ) , s ( ) , a && t . append ( y ( ` pre ` , y ( ` code ` , a . join ( `
` )))),t}function ht(e){let t=String(e|| ` ` ).trim();if(!t.includes( ` | ` ))return null;let n=t.replace(/^ \| /, ` ` ).replace(/ \| $ /, ` ` ).split( ` | ` ).map(e=>e.trim());return n.length>1&&n.every(e=>e!== ` ` )?n:null}function gt(e){return e.every(e=>/^:?-{3,}:? $ /.test(e))}function _t(e){return e.title||e.branch_name|| ` Conversation $ { e . session _id . slice ( 0 , 8 ) } ` }function vt(){return y( ` div . chat - bubble - row . assistant ` ,y( ` div . chat - bubble ` ,y( ` div . chat - bubble - meta ` , ` Archie ` ),y( ` div . chat - tools ` ),y( ` div . chat - bubble - text ` )))}function yt(e){let t=e.from??e.From?? ` ` ,n=e.text??e.Text?? ` ` ,r=t!== ` web ` ;return y( ` div . chat - bubble - row . $ { r ? ` assistant ` : ` user ` } ` ,y( ` div . chat - bubble ` ,y( ` div . chat - bubble - meta ` ,r? ` Archie ` : ` You ` ),r?bt(e,n):y( ` div . chat - bubble - text ` ,n)))}function bt(e,t){let n=e.tool_calls||e.ToolCalls||[],r=[y( ` div . chat - tools ` )];for(let e of n){let t=!!(e.err||e.Err);r[0].append(y( ` div . chat - tool ` +(t? ` . failed ` : ` ` ),y( ` span . chat - tool - icon ` , ` 🔧 ` ),y( ` span . chat - tool - name ` ,e.name||e.Name|| ` tool ` ),y( ` span . chat - tool - summary ` ,e.summary||e.Summary||e.err||e.Err|| ` done ` )))}return r.push(mt(t)),r}function X(e,t){let n=mt(t);return typeof e?.replaceWith== ` function ` ?e.replaceWith(n):e?.parentNode&&e.parentNode.replaceChild(n,e),n}function xt(e,t){let n=t?.tool?? ` ` ;if(!e||!n)return null;let r=t.parameters?? ` ` ,i=t.text?? ` ` ,a=y( ` div . chat - tool ` ,y( ` span . chat - tool - icon ` , ` 🔧 ` ),y( ` span . chat - tool - name ` ,n),r&&y( ` code . chat - tool - parameters ` ,r),y( ` span . chat - tool - summary ` ,i));return t.failed&&(a.className= ` chat - tool failed ` ),St(e).append(a),a}function St(e){let t=e.querySelector( ` . chat - tools ` );if(t)return t;let n=y( ` div . chat - tools ` );return e.append(n),n}function Ct(e,t){let n=t?.path?? ` ` ,r=t?.label||n;if(!e||!n)return null;let i=y( ` a . chat - nav - chip ` ,{href: ` # ` +n,title: ` Go to ` +r,"aria-label": ` Go to ` +r},y( ` span . chat - nav - chip - icon ` ,{"aria-hidden": ` true ` }, ` ↗ ` ),y( ` span . chat - nav - chip - label ` ,r));return St(e).append(i),i}var wt= ` archie . web . chat . channel ` ;function Z(){let t=localStorage.getItem(wt);return t||(t=e(),localStorage.setItem(wt,t)),t}function Tt(t){return{text:t,sourceID:e()}}function Et(e){return{...e}}function Dt(e,t){let n=!!(e&&typeof e== ` object ` &&e.turn&&typeof e.turn.text== ` string ` ),r=n?e.turn.text:t.trim();return{text:r,turn:n?Et(e.turn):Tt(r),isRetry:n}}function Ot({sessionList:e,sessionTools:t,sessions:n,currentSession:r,onSelect:i}){if(e.replaceChildren(),t.hidden=!r,!n.length){e.append(y( ` div . chat - empty ` , ` Your conversations will appear here . ` ));return}for(let t of n)e.append(y( ` button . chat - session ` ,{class:r===t.session_id? ` active ` : ` ` ,onclick:()=>i(t.session_id)},y( ` strong ` ,_t(t)),y( ` span ` ,new Date(t.last_active_at).toLocaleString())))}function kt(e,t,n){e.persona.replaceChildren(y( ` option ` ,{value: ` ` }, ` Personality ` ));for(let n of t.personas||[])e.persona.append(y( ` option ` ,{value:n},n));e.persona.value=t.active_persona|| ` ` ;let r=t.providers||[];e.provider.hidden=r.length===0,e.provider.replaceChildren(y( ` option ` ,{value: ` ` }, ` Provider ` ));for(let t of r)e.provider.append(y( ` option ` ,{value:t},t));e.provider.value=t.active_provider||r[0]|| ` ` ,At(e,t,e.provider.value),e.restart.hidden=!t.restart_available,e.dangerousPanel.hidden=!t.dangerous_available,t.dangerous_available&&n()}function At(e,t,n){let r=t.models_by_provider||{},i=n&&r[n]?r[n]:t.models||[];e.model.replaceChildren(y( ` option ` ,{value: ` ` }, ` Model ` ));for(let t of i)e.model.append(y( ` option ` ,{value:t},t));e.model.value=t.active_model|| ` ` }function jt(e,t){let n=(t||[]).map(e=>typeof e== ` string ` ?{command:e,usage:e,description: ` ` }:e),r=y( ` div . chat - command - list ` );n.length||r.append(y( ` span ` , ` Send a message to begin . ` ));for(let e of n)r.append(y( ` div . chat - command - item ` ,y( ` code ` ,e.usage||e.command),y( ` span ` ,e.description|| ` ` )));return e.replaceChildren(y( ` summary ` , ` Available commands ( $ { n . length } ) ` ),r),n}function Mt(e,t,{onDefer:n,onInstall:r}){e.replaceChildren();let i=t?.snapshot||null,a=t?.available||[];if(!a.length){e.append(y( ` span ` ,i?.deferred? ` Update deferred . ` : ` Archie is up to date . ` ));return}e.append(y( ` div ` ,y( ` strong ` , ` Update available ` ),y( ` span ` ,a.map(e=> ` $ { e . Label || e . label } : $ { e . Available || e . available } ` ).join( ` · ` ))),y( ` div . chat - update - actions ` ,y( ` button . btn ` ,{onclick:n}, ` Defer ` ),t.can_install?y( ` button . btn . btn - primary ` ,{onclick:r}, ` Install update ` ):null))}function Nt(e,t,{onRequest:n,onDecision:r}){e.replaceChildren();let i=t?.checkpoints||[],a=t?.pending||[],o=y( ` select . chat - select ` ,{"aria-label": ` Checkpoint ` },y( ` option ` ,{value: ` ` }, ` Select checkpoint ` ),...i.map(e=>y( ` option ` ,{value:e.Number??e.number}, ` $ { e . Number ? ? e . number } — $ { e . Label ? ? e . label ? ? ` checkpoint ` } ` ))),s=y( ` input . chat - dangerous - input ` ,{placeholder: ` Process name or id ` ,"aria-label": ` Process name or id ` }),c=(e,t)=>()=>n(e,String(t.value||t).trim()),l=(e,t,n)=>y( ` button . btn ` ,{onclick:()=>r(e,t)},n),u=a.length?a.map(e=>y( ` div . chat - dangerous - pending ` ,y( ` span ` ,e.description),y( ` div . chat - update - actions ` ,l(e.id, ` approve ` , ` Approve ` ),l(e.id, ` permanent ` , ` Approve for 24 h ` ),l(e.id, ` deny ` , ` Deny ` )))):[y( ` span . chat - hint ` , ` No pending dangerous Line truncated
` ) ) ) ) , a = null ) : a = [ ] ; continue } if ( a ) { a . push ( c ) ; continue } let l = gt ( c ) , u = e + 1 < n . length ? gt ( n [ e + 1 ] ) : null ; if ( l && u && _t ( u ) && l . length === u . length ) { o ( ) , s ( ) ; let r = [ ] ; for ( e += 2 ; e < n . length ; e ++ ) { let t = gt ( n [ e ] ) ; if ( ! t || t . length !== l . length ) { e -- ; break } r . push ( t ) } let i = y ( ` tbody ` ) ; for ( let e of r ) i . append ( y ( ` tr ` , ... e . map ( e => y ( ` td ` , Y ( e ) ) ) ) ) ; t . append ( y ( ` table ` , y ( ` thead ` , y ( ` tr ` , ... l . map ( e => y ( ` th ` , Y ( e ) ) ) ) ) , i ) ) ; continue } if ( ! c . trim ( ) ) { o ( ) , s ( ) ; continue } let d = c . match ( /^(#{1,3})\s+(.+)$/ ) ; if ( d ) { o ( ) , s ( ) , t . append ( y ( ` h ${ d [ 1 ] . length } ` , Y ( d [ 2 ] ) ) ) ; continue } let f = c . match ( /^\s*[-*]\s+(.+)$/ ) , p = c . match ( /^\s*\d+[.)]\s+(.+)$/ ) ; if ( f || p ) { o ( ) ; let e = p ? ` ol ` : ` ul ` ; ( ! i || i . tagName . toLowerCase ( ) !== e ) && ( s ( ) , i = y ( e ) ) , i . append ( y ( ` li ` , Y ( ( f || p ) [ 1 ] ) ) ) ; continue } if ( c . startsWith ( ` > ` ) ) { o ( ) , s ( ) , t . append ( y ( ` blockquote ` , Y ( c . replace ( /^>\s?/ , ` ` ) ) ) ) ; continue } r . push ( c ) } return o ( ) , s ( ) , a && t . append ( y ( ` pre ` , y ( ` code ` , a . join ( `
` )))),t}function gt(e){let t=String(e|| ` ` ).trim();if(!t.includes( ` | ` ))return null;let n=t.replace(/^ \| /, ` ` ).replace(/ \| $ /, ` ` ).split( ` | ` ).map(e=>e.trim());return n.length>1&&n.every(e=>e!== ` ` )?n:null}function _t(e){return e.every(e=>/^:?-{3,}:? $ /.test(e))}function vt(e){return e.title||e.branch_name|| ` Conversation $ { e . session _id . slice ( 0 , 8 ) } ` }function yt(){return y( ` div . chat - bubble - row . assistant ` ,y( ` div . chat - bubble ` ,y( ` div . chat - bubble - meta ` , ` Archie ` ),y( ` div . chat - tools ` ),y( ` div . chat - bubble - text ` )))}function bt(e){let t=e.from??e.From?? ` ` ,n=e.text??e.Text?? ` ` ,r=t!== ` web ` ;return y( ` div . chat - bubble - row . $ { r ? ` assistant ` : ` user ` } ` ,y( ` div . chat - bubble ` ,y( ` div . chat - bubble - meta ` ,r? ` Archie ` : ` You ` ),r?xt(e,n):y( ` div . chat - bubble - text ` ,n)))}function xt(e,t){let n=e.tool_calls||e.ToolCalls||[],r=[y( ` div . chat - tools ` )];for(let e of n){let t=!!(e.err||e.Err);r[0].append(y( ` div . chat - tool ` +(t? ` . failed ` : ` ` ),y( ` span . chat - tool - icon ` , ` 🔧 ` ),y( ` span . chat - tool - name ` ,e.name||e.Name|| ` tool ` ),y( ` span . chat - tool - summary ` ,e.summary||e.Summary||e.err||e.Err|| ` done ` )))}return r.push(ht(t)),r}function X(e,t){let n=ht(t);return typeof e?.replaceWith== ` function ` ?e.replaceWith(n):e?.parentNode&&e.parentNode.replaceChild(n,e),n}function St(e,t){let n=t?.tool?? ` ` ;if(!e||!n)return null;let r=t.parameters?? ` ` ,i=t.text?? ` ` ,a=y( ` div . chat - tool ` ,y( ` span . chat - tool - icon ` , ` 🔧 ` ),y( ` span . chat - tool - name ` ,n),r&&y( ` code . chat - tool - parameters ` ,r),y( ` span . chat - tool - summary ` ,i));return t.failed&&(a.className= ` chat - tool failed ` ),Ct(e).append(a),a}function Ct(e){let t=e.querySelector( ` . chat - tools ` );if(t)return t;let n=y( ` div . chat - tools ` );return e.append(n),n}function wt(e,t){let n=t?.path?? ` ` ,r=t?.label||n;if(!e||!n)return null;let i=y( ` a . chat - nav - chip ` ,{href: ` # ` +n,title: ` Go to ` +r,"aria-label": ` Go to ` +r},y( ` span . chat - nav - chip - icon ` ,{"aria-hidden": ` true ` }, ` ↗ ` ),y( ` span . chat - nav - chip - label ` ,r));return Ct(e).append(i),i}var Tt= ` archie . web . chat . channel ` ;function Z(){let t=localStorage.getItem(Tt);return t||(t=e(),localStorage.setItem(Tt,t)),t}function Et(t){return{text:t,sourceID:e()}}function Dt(e){return{...e}}function Ot(e,t){let n=!!(e&&typeof e== ` object ` &&e.turn&&typeof e.turn.text== ` string ` ),r=n?e.turn.text:t.trim();return{text:r,turn:n?Dt(e.turn):Et(r),isRetry:n}}function kt({sessionList:e,sessionTools:t,sessions:n,currentSession:r,onSelect:i}){if(e.replaceChildren(),t.hidden=!r,!n.length){e.append(y( ` div . chat - empty ` , ` Your conversations will appear here . ` ));return}for(let t of n)e.append(y( ` button . chat - session ` ,{class:r===t.session_id? ` active ` : ` ` ,onclick:()=>i(t.session_id)},y( ` strong ` ,vt(t)),y( ` span ` ,new Date(t.last_active_at).toLocaleString())))}function At(e,t,n){e.persona.replaceChildren(y( ` option ` ,{value: ` ` }, ` Personality ` ));for(let n of t.personas||[])e.persona.append(y( ` option ` ,{value:n},n));e.persona.value=t.active_persona|| ` ` ;let r=t.providers||[];e.provider.hidden=r.length===0,e.provider.replaceChildren(y( ` option ` ,{value: ` ` }, ` Provider ` ));for(let t of r)e.provider.append(y( ` option ` ,{value:t},t));e.provider.value=t.active_provider||r[0]|| ` ` ,jt(e,t,e.provider.value),e.restart.hidden=!t.restart_available,e.dangerousPanel.hidden=!t.dangerous_available,t.dangerous_available&&n()}function jt(e,t,n){let r=t.models_by_provider||{},i=n&&r[n]?r[n]:t.models||[];e.model.replaceChildren(y( ` option ` ,{value: ` ` }, ` Model ` ));for(let t of i)e.model.append(y( ` option ` ,{value:t},t));e.model.value=t.active_model|| ` ` }function Mt(e,t){let n=(t||[]).map(e=>typeof e== ` string ` ?{command:e,usage:e,description: ` ` }:e),r=y( ` div . chat - command - list ` );n.length||r.append(y( ` span ` , ` Send a message to begin . ` ));for(let e of n)r.append(y( ` div . chat - command - item ` ,y( ` code ` ,e.usage||e.command),y( ` span ` ,e.description|| ` ` )));return e.replaceChildren(y( ` summary ` , ` Available commands ( $ { n . length } ) ` ),r),n}function Nt(e,t,{onDefer:n,onInstall:r}){e.replaceChildren();let i=t?.snapshot||null,a=t?.available||[];if(!a.length){e.append(y( ` span ` ,i?.deferred? ` Update deferred . ` : ` Archie is up to date . ` ));return}e.append(y( ` div ` ,y( ` strong ` , ` Update available ` ),y( ` span ` ,a.map(e=> ` $ { e . Label || e . label } : $ { e . Available || e . available } ` ).join( ` · ` ))),y( ` div . chat - update - actions ` ,y( ` button . btn ` ,{onclick:n}, ` Defer ` ),t.can_install?y( ` button . btn . btn - primary ` ,{onclick:r}, ` Install update ` ):null))}function Pt(e,t,{onRequest:n,onDecision:r}){e.replaceChildren();let i=t?.checkpoints||[],a=t?.pending||[],o=y( ` select . chat - select ` ,{"aria-label": ` Checkpoint ` },y( ` option ` ,{value: ` ` }, ` Select checkpoint ` ),...i.map(e=>y( ` option ` ,{value:e.Number??e.number}, ` $ { e . Number ? ? e . number } — $ { e . Label ? ? e . label ? ? ` checkpoint ` } ` ))),s=y( ` input . chat - dangerous - input ` ,{placeholder: ` Process name or id ` ,"aria-label": ` Process name or id ` }),c=(e,t)=>()=>n(e,String(t.value||t).trim()),l=(e,t,n)=>y( ` button . btn ` ,{onclick:()=>r(e,t)},n),u=a.length?a.map(e=>y( ` div . chat - dangerous - pending ` ,y( ` span ` ,e.description),y( ` div . chat - update - actions ` ,l(e.id, ` approve ` , ` Approve ` ),l(e.id, ` permanent ` , ` Approve for 24 h ` ),l(e.id, ` deny ` , ` Deny ` )))):[y( ` span . chat - hint ` , ` No pending dangerous Line truncated
` ) ; i = a . pop ( ) || ` ` ; for ( let e of a ) { let t = e . split ( `
` ).find(e=>e.startsWith( ` data : ` ));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(S=n.session_id),n.type=== ` delta ` &&(d+=n.text,u=X(u,d)),n.type=== ` tool ` &&xt(l.querySelector( ` . chat - bubble ` )??l,n),n.type=== ` navigate ` &&Ct(l.querySelector( ` . chat - bubble ` )??l,n),n.type=== ` done ` &&(f=!0,d||(d=n.text,u=X(u,d))),n.type=== ` error ` )throw Error(n.text)}if(n)break}if(!f)throw Error( ` chat stream ended before completion ` );u.isConnected&&(u=X(u,d)),c.textContent= ` Ready ` ,await R()}catch(e){if(e.name=== ` AbortError ` &&!p)u=X(u, ` Turn stopped . ` ),c.textContent= ` Stopped ` ;else{u=X(u, ` Unable to complete that turn : $ { e . message || e } ` );let t=Et(n),r=y( ` button . btn . chat - retry ` ,{type: ` button ` ,onclick:()=>H({turn:t,replyBubble:l})}, ` Retry ` );l.append(r),c.textContent= ` Error — retry available ` }}finally{clearTimeout(m),T=null,w=!1,o.disabled=!1,s.disabled=!0,i.disabled=!1,i.focus()}}o.onclick=()=>H(),s.onclick=()=>{let e=S;c.textContent= ` Stopping … ` ,e&&a.chatCancel(e).catch(()=>{}),T?.abort()},i.oninput=P,i.onkeydown=e=>{if(!g.hidden&&k.length){if(e.key=== ` Enter ` &&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&k.some(e=>e.command===i.value.trim())){e.preventDefault(),N(),H();return}if(e.key=== ` ArrowDown ` ){e.preventDefault(),A=(A+1)%k.length,P();return}if(e.key=== ` ArrowUp ` ){e.preventDefault(),A=(A+k.length-1)%k.length,P();return}if(e.key=== ` Enter ` &&!e.shiftKey&&!e.ctrlKey&&!e.metaKey){e.preventDefault(),F(A);return}if(e.key=== ` Escape ` ){e.preventDefault(),N();return}}e.key=== ` Enter ` &&!e.shiftKey&&(e.preventDefault(),H())},l.onchange=async()=>{!S||!l.value||(await a.chatPersona(S,l.value),D.active_personas={...D.active_personas||{},[S]:l.value},c.textContent= ` Personality : $ { l . value } ` )},u.onchange=async()=>{At({model:d},D,u.value),u.value&&await ee( ` / model -- provider $ { u . value } ` )},d.onchange=async()=>{d.value&&await ee( ` / model $ { d . value } ` )};async function ee(e){try{let t=await a.chatMessage(Z(),e);c.textContent=t.reply|| ` Model updated ` ,await R()}catch(e){c.textContent= ` Model update failed : $ { e . message || e } ` }}b.onclick=I;let te={retry:()=>z( ` / retry ` ),undo:()=>z( ` / undo ` ),title:()=>B( ` / title ` , ` Session title ` ),branch:()=>B( ` / branch ` , ` Branch name ( optional ) ` ),compress:()=>z( ` / compress -- preview ` )};for(let t of e.querySelectorAll( ` [ data - chat - action ] ` ))t.onclick=te[t.dataset.chatAction];return R().catch(e=>{c.textContent=e.message|| ` Chat unavailable ` }),I(),e}var Q=[{path: ` / ` ,label: ` Dashboard ` ,icon: ` dashboard ` ,view:L},{path: ` / chat ` ,label: ` Chat ` ,icon: ` chat ` ,view:It},{path: ` / tasks ` ,label: ` Tasks ` ,icon: ` tasks ` ,view:le},{path: ` / logs ` ,label: ` Logs ` ,icon: ` logs ` ,view:He},{path: ` / captures ` ,label: ` Event inspector ` ,icon: ` captures ` ,view: $ e},{path: ` / mappings ` ,label: ` Field mappings ` ,icon: ` mappings ` ,view:ct},{path: ` / skills ` ,label: ` Skills ` ,icon: ` skills ` ,view:ue},{path: ` / workflows ` ,label: ` Workflows ` ,icon: ` workflows ` ,view:pe},{path: ` / memory ` ,label: ` Memory ` ,icon: ` memory ` ,view:lt},{path: ` / channels ` ,label: ` Channels ` ,icon: ` channels ` ,view:me},{path: ` / settings ` ,label: ` Configuration ` ,icon: ` settings ` ,view:Te}],Lt= ` archie . theme ` ;function Rt(e){document.documentElement.dataset.theme=e,localStorage.setItem(Lt,e)}function $ (){return localStorage.getItem(Lt)|| ` dark ` }function zt(e,t){let n=new Map,r=y( ` nav . nav ` ,...[null].flatMap(()=>[...Q.map(t=>{let r=y( ` a . nav - item ` ,{href: ` # $ { t . path } ` ,onclick:n=>{t.soon?n.preventDefault():e(t.path)},"aria-disabled":t.soon||void 0,title:t.soon? ` Coming soon ` :void 0},D(t.icon),y( ` span . nav - label ` ,t.label),t.soon&&y( ` span . nav - soon ` , ` soon ` ));return n.set(t.path,r),r})])),i=y( ` button . icon - btn ` ,{title: ` Toggle light and dark ` ,"aria-label": ` Toggle light and dark ` ,onclick:()=>{Rt( $ ()=== ` dark ` ? ` light ` : ` dark ` ),x(i,D( $ ()=== ` dark ` ? ` moon ` : ` sun ` ))}});x(i,D( $ ()=== ` dark ` ? ` moon ` : ` sun ` ));let a,o=()=>{a?.classList.remove( ` is - open ` ),s.setAttribute( ` aria - expanded ` , ` false ` )},s=y( ` button . icon - btn . mobile - search - toggle ` ,{type: ` button ` ,"aria-label": ` Open Jump to navigation ` ,"aria-expanded": ` false ` ,onclick:()=>{a.classList.add( ` is - open ` ),s.setAttribute( ` aria - expanded ` , ` true ` ),c.focus()}},D( ` search ` ,{size:15})),c=y( ` input ` ,{type: ` search ` ,placeholder: ` Jump to … ` ,"aria-label": ` Jump to a section ` ,onkeydown:t=>{if(t.key=== ` Escape ` ){t.preventDefault(),o(),t.target.blur();return}if(t.key!== ` Enter ` )return;let n=t.target.value.trim().toLowerCase(),r=Q.find(e=>!e.soon&&e.label.toLowerCase().startsWith(n));r&&(e(r.path),t.target.value= ` ` ,t.target.blur(),o())}});return a=y( ` div . topbar - search ` ,y( ` span . topbar - search - icon ` ,{"aria-hidden": ` true ` },D( ` search ` ,{size:15})),s,c),{node:y( ` header . topbar ` ,y( ` div . brand ` ,y( ` span . brand - mark ` , ` A ` ), ` Archie ` ),r,y( ` div . topbar - end ` ,a,y( ` button . icon - btn . icon - btn - chat ` ,{"aria-label": ` Open chat ` ,title: ` Chat with Archie ` ,"aria-expanded": ` false ` ,onclick:()=>t?.()},D( ` chat ` )),y( ` button . icon - btn ` ,{title: ` Documentation ` ,"aria-label": ` Documentation ` },D( ` help ` )),i,y( ` div . avatar ` ,{title: ` Signed in locally ` }, ` A ` ))),highlight(e){for(let[t,r]of n)t===e?r.setAttribute( ` aria - current ` , ` page ` ):r.removeAttribute( ` aria - current ` )}}}function Bt(){Rt( $ ());let e=y( ` main . main ` ),t=y
Line truncated
` ).find(e=>e.startsWith( ` data : ` ));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(S=n.session_id),n.type=== ` delta ` &&(d+=n.text,u=X(u,d)),n.type=== ` tool ` &&St(l.querySelector( ` . chat - bubble ` )??l,n),n.type=== ` navigate ` &&wt(l.querySelector( ` . chat - bubble ` )??l,n),n.type=== ` done ` &&(f=!0,d||(d=n.text,u=X(u,d))),n.type=== ` error ` )throw Error(n.text)}if(n)break}if(!f)throw Error( ` chat stream ended before completion ` );u.isConnected&&(u=X(u,d)),c.textContent= ` Ready ` ,await R()}catch(e){if(e.name=== ` AbortError ` &&!p)u=X(u, ` Turn stopped . ` ),c.textContent= ` Stopped ` ;else{u=X(u, ` Unable to complete that turn : $ { e . message || e } ` );let t=Dt(n),r=y( ` button . btn . chat - retry ` ,{type: ` button ` ,onclick:()=>H({turn:t,replyBubble:l})}, ` Retry ` );l.append(r),c.textContent= ` Error — retry available ` }}finally{clearTimeout(m),T=null,w=!1,o.disabled=!1,s.disabled=!0,i.disabled=!1,i.focus()}}o.onclick=()=>H(),s.onclick=()=>{let e=S;c.textContent= ` Stopping … ` ,e&&a.chatCancel(e).catch(()=>{}),T?.abort()},i.oninput=P,i.onkeydown=e=>{if(!g.hidden&&k.length){if(e.key=== ` Enter ` &&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&k.some(e=>e.command===i.value.trim())){e.preventDefault(),N(),H();return}if(e.key=== ` ArrowDown ` ){e.preventDefault(),A=(A+1)%k.length,P();return}if(e.key=== ` ArrowUp ` ){e.preventDefault(),A=(A+k.length-1)%k.length,P();return}if(e.key=== ` Enter ` &&!e.shiftKey&&!e.ctrlKey&&!e.metaKey){e.preventDefault(),F(A);return}if(e.key=== ` Escape ` ){e.preventDefault(),N();return}}e.key=== ` Enter ` &&!e.shiftKey&&(e.preventDefault(),H())},l.onchange=async()=>{!S||!l.value||(await a.chatPersona(S,l.value),D.active_personas={...D.active_personas||{},[S]:l.value},c.textContent= ` Personality : $ { l . value } ` )},u.onchange=async()=>{jt({model:d},D,u.value),u.value&&await ee( ` / model -- provider $ { u . value } ` )},d.onchange=async()=>{d.value&&await ee( ` / model $ { d . value } ` )};async function ee(e){try{let t=await a.chatMessage(Z(),e);c.textContent=t.reply|| ` Model updated ` ,await R()}catch(e){c.textContent= ` Model update failed : $ { e . message || e } ` }}b.onclick=I;let te={retry:()=>z( ` / retry ` ),undo:()=>z( ` / undo ` ),title:()=>B( ` / title ` , ` Session title ` ),branch:()=>B( ` / branch ` , ` Branch name ( optional ) ` ),compress:()=>z( ` / compress -- preview ` )};for(let t of e.querySelectorAll( ` [ data - chat - action ] ` ))t.onclick=te[t.dataset.chatAction];return R().catch(e=>{c.textContent=e.message|| ` Chat unavailable ` }),I(),e}var Q=[{path: ` / ` ,label: ` Dashboard ` ,icon: ` dashboard ` ,view:L},{path: ` / chat ` ,label: ` Chat ` ,icon: ` chat ` ,view:Lt},{path: ` / tasks ` ,label: ` Tasks ` ,icon: ` tasks ` ,view:le},{path: ` / logs ` ,label: ` Logs ` ,icon: ` logs ` ,view:Ue},{path: ` / captures ` ,label: ` Event inspector ` ,icon: ` captures ` ,view:et},{path: ` / mappings ` ,label: ` Field mappings ` ,icon: ` mappings ` ,view:lt},{path: ` / skills ` ,label: ` Skills ` ,icon: ` skills ` ,view:ue},{path: ` / workflows ` ,label: ` Workflows ` ,icon: ` workflows ` ,view:pe},{path: ` / memory ` ,label: ` Memory ` ,icon: ` memory ` ,view:ut},{path: ` / curators ` ,label: ` Curators ` ,icon: ` curators ` ,view:ge},{path: ` / channels ` ,label: ` Channels ` ,icon: ` channels ` ,view:me},{path: ` / settings ` ,label: ` Configuration ` ,icon: ` settings ` ,view:Ee}],Rt= ` archie . theme ` ;function zt(e){document.documentElement.dataset.theme=e,localStorage.setItem(Rt,e)}function $ (){return localStorage.getItem(Rt)|| ` dark ` }function Bt(e,t){let n=new Map,r=y( ` nav . nav ` ,...[null].flatMap(()=>[...Q.map(t=>{let r=y( ` a . nav - item ` ,{href: ` # $ { t . path } ` ,onclick:n=>{t.soon?n.preventDefault():e(t.path)},"aria-disabled":t.soon||void 0,title:t.soon? ` Coming soon ` :void 0},D(t.icon),y( ` span . nav - label ` ,t.label),t.soon&&y( ` span . nav - soon ` , ` soon ` ));return n.set(t.path,r),r})])),i=y( ` button . icon - btn ` ,{title: ` Toggle light and dark ` ,"aria-label": ` Toggle light and dark ` ,onclick:()=>{zt( $ ()=== ` dark ` ? ` light ` : ` dark ` ),x(i,D( $ ()=== ` dark ` ? ` moon ` : ` sun ` ))}});x(i,D( $ ()=== ` dark ` ? ` moon ` : ` sun ` ));let a,o=()=>{a?.classList.remove( ` is - open ` ),s.setAttribute( ` aria - expanded ` , ` false ` )},s=y( ` button . icon - btn . mobile - search - toggle ` ,{type: ` button ` ,"aria-label": ` Open Jump to navigation ` ,"aria-expanded": ` false ` ,onclick:()=>{a.classList.add( ` is - open ` ),s.setAttribute( ` aria - expanded ` , ` true ` ),c.focus()}},D( ` search ` ,{size:15})),c=y( ` input ` ,{type: ` search ` ,placeholder: ` Jump to … ` ,"aria-label": ` Jump to a section ` ,onkeydown:t=>{if(t.key=== ` Escape ` ){t.preventDefault(),o(),t.target.blur();return}if(t.key!== ` Enter ` )return;let n=t.target.value.trim().toLowerCase(),r=Q.find(e=>!e.soon&&e.label.toLowerCase().startsWith(n));r&&(e(r.path),t.target.value= ` ` ,t.target.blur(),o())}});return a=y( ` div . topbar - search ` ,y( ` span . topbar - search - icon ` ,{"aria-hidden": ` true ` },D( ` search ` ,{size:15})),s,c),{node:y( ` header . topbar ` ,y( ` div . brand ` ,y( ` span . brand - mark ` , ` A ` ), ` Archie ` ),r,y( ` div . topbar - end ` ,a,y( ` button . icon - btn . icon - btn - chat ` ,{"aria-label": ` Open chat ` ,title: ` Chat with Archie ` ,"aria-expanded": ` false ` ,onclick:()=>t?.()},D( ` chat ` )),y( ` button . icon - btn ` ,{title: ` Documentation ` ,"aria-label": ` Documentation ` },D( ` help ` )),i,y( ` div . avatar ` ,{title: ` Signed in locally ` }, ` A ` ))),highlight(e){for(let[t,r]of n)t===e?r.setAttribute( ` aria - current ` , ` page ` ):r.removeAttribute( ` ari Line truncated