@contraagent/ui 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contraagent-ui.js +167 -167
- package/dist/locales/ja.d.ts +1 -0
- package/dist/locales/ja.d.ts.map +1 -1
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ja.js.map +1 -1
- package/dist/words/rests.d.ts +2 -1
- package/dist/words/rests.d.ts.map +1 -1
- package/dist/words/rests.js +8 -1
- package/dist/words/rests.js.map +1 -1
- package/package.json +3 -3
- package/src/locales/ja.ts +1 -0
- package/src/words/rests.ts +9 -2
package/dist/contraagent-ui.js
CHANGED
|
@@ -2,7 +2,7 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
|
|
|
2
2
|
`)}\n\n${this.trendPanelNames().join(`
|
|
3
3
|
`)}`}trendPanelNames(){return this.snap.info.panels.filter(e=>e.scope===`trends`).map(e=>e.name)}async loadTrends(e){let t=this.snap.trends&&JSON.stringify(this.snap.trends.query)===JSON.stringify(e);this.trendsQuery=e,this.set({trends:{query:e,data:t?this.snap.trends.data:this.snap.trends?.data??null,panels:t?this.snap.trends.panels:{},loading:!0,error:null}}),await this.fetchTrends(e)}closeTrends(){this.trendsQuery=null}async fetchTrends(e){let t=++this.trendsAsked;this.trendsOver=this.trendsKey();let n=()=>t!==this.trendsAsked||this.stopped?null:this.snap.trends,r=this.trendPanelNames(),i=this.client.trends(e).then(t=>{let r=n();r&&this.set({trends:{...r,query:e,data:t,loading:!1,error:null}})},t=>{let r=n();r&&this.set({trends:{...r,query:e,loading:!1,error:ve(t,`${this.client.baseUrl}/api/trends`)}})}),a=(e,t)=>{let r=n();r&&this.set({trends:{...r,panels:{...r.panels,[e]:t}}})},o=r.map(t=>this.client.trendsPanel(t,e).then(e=>a(t,e),e=>a(t,{error:String(e)})));await Promise.allSettled([i,...o])}async loadInfo(){try{let e=this.panelNames(),t=await this.client.info();if(this.stopped)return;this.infoLoaded=!0,this.infoError=null,this.set({info:t}),this.snap.run&&this.panelNames()!==e&&this.reopen()}catch(e){this.infoError=ve(e,`${this.client.baseUrl}/api/info`)}}async refreshRuns(){let[e,t]=await Promise.allSettled([this.client.runs(),this.snap.info.hosts?this.client.hosts():Promise.resolve(null)]);if(this.stopped)return;let n={};e.status===`fulfilled`?(n.runs=e.value,n.runsLoaded=!0,this.runsError=null):this.runsError=ve(e.reason,`${this.client.baseUrl}/api/runs`),t.status===`fulfilled`?(n.hosts=t.value,this.hostsError=null):this.hostsError=ve(t.reason,`${this.client.baseUrl}/api/hosts`);let r=this.infoError??this.runsError??this.hostsError;r?.message!==this.snap.error?.message&&(n.error=r),Object.keys(n).length&&this.set(n)}panelNames(){return this.snap.info.panels.filter(ge).map(e=>e.name).join(`
|
|
4
4
|
`)}reopen(){let e=this.snap.run;this.closeFeed?.(),this.closeFeed=null,this.selectRun(e)}selectRun(e){if(e===this.snap.run&&(this.closeFeed||!e)||(this.closeFeed?.(),this.closeFeed=null,this.queue=[],this.set({run:e,state:{journal:[],procs:null,plan:{nodes:[],groups:[],flow_calls:[]},outputs:{contracts:[],tally:{valid:0,invalid:0,refused:0,pending:0,failed:0,running:0}},cursor:null,panels:{},ready:!1},connected:!1,fresh:new Set}),!e))return;let t=this.snap.info.panels.filter(ge).map(e=>e.name),n={open:()=>{this.push({event:`connected`}),this.set({connected:!0})},error:()=>this.set({connected:!1}),message:e=>this.push(e)};this.closeFeed=this.opts.openRunFeed?this.opts.openRunFeed(e,t,n):function(e,t,n,r={}){let i=[...o,...t.map(e=>`panel:${e}`)];return s(`${l(r)}/events?run=${c(e)}`,i,n,r)}(e,t,n,{...this.opts.baseUrl===void 0?{}:{baseUrl:this.opts.baseUrl},...this.opts.feed})}stop(){this.stopped=!0,this.closeFeed?.(),this.closeFeed=null,this.pollTimer&&clearTimeout(this.pollTimer),this.pollTimer=null,this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=null}push(e){this.queue.push(e),this.flushTimer??=setTimeout(()=>this.flush(),this.opts.batchMs)}flush(){this.flushTimer=null;let e=this.queue;this.queue=[];let t=this.snap.state.ready,n=[];for(let r of e)r.event===`connected`?t=!1:r.event===`ready`?t=!0:r.event===`journal`&&t&&n.push(r.data);let r=function(e,t){let n=e,r=null,i=()=>{if(!r)return;let e=n.journal.concat(r);n={...n,journal:e.length>4e3?e.slice(e.length-4e3):e},r=null};for(let e of t)if(e.event!==`journal`)switch(i(),e.event){case`connected`:n={...n,journal:[],ready:!1};break;case`ready`:n={...n,ready:!0};break;case`procs`:n={...n,procs:e.data};break;case`plan`:n={...n,plan:e.data};break;case`outputs`:n={...n,outputs:e.data};break;case`cursor`:n={...n,cursor:e.data};break;default:n={...n,panels:{...n.panels,[e.event.slice(6)]:e.data}}}else(r??=[]).push(e.data);return i(),n}(this.snap.state,e);if(!n.length)return void this.set({state:r});let i=new Set(this.snap.fresh);for(let e of n)i.add(ue(e));this.set({state:r,fresh:i});for(let e of n)for(let t of this.rowListeners)t(e);setTimeout(()=>{let e=new Set(this.snap.fresh);for(let t of n)e.delete(ue(t));this.set({fresh:e})},this.opts.freshMs)}set(e){this.snap={...this.snap,...e};for(let e of this.listeners)e(this.snap)}},be=encodeURIComponent;function xe(e){let t=Array.from(e,e=>/^[\p{L}\p{N}._-]$/u.test(e)?e:`_`).join(``).replace(/\.\.+/g,e=>`_`.repeat(e.length));return t.startsWith(`.`)?`_${t.slice(1)}`:t||`_`}var Se=e=>Object.keys(e).length>0;function Ce(e){return(t,n,r)=>{let i=!1;return(async()=>{try{let[a,o,s,c,l]=await Promise.all([e.journal(t),e.file(`runs/${be(t)}/plan.json`),e.file(`runs/${be(t)}/outputs.json`),e.file(`runs/${be(t)}/cursor.json`),Promise.all(n.map(n=>e.panel(t,n).catch(e=>({error:String(e)}))))]);if(i)return;r.open?.();let u=e=>!i&&r.message(e);for(let e of a.entries)u({event:`journal`,data:e});u({event:`plan`,data:o}),u({event:`outputs`,data:s}),u({event:`cursor`,data:Se(c)?c:null}),n.forEach((e,t)=>u({event:`panel:${e}`,data:l[t]??{}})),u({event:`ready`,data:{journal:a.total}})}catch{i||r.error?.()}})(),()=>{i=!0}}}var we=()=>({input:0,output:0,cache_read:0,cache_creation:0,calls:0,cost:null,reported:0}),Te=e=>e.input+e.output+e.cache_read+e.cache_creation;function Ee(e,t){let n=t.usage;return n||t.cost_usd!==null&&t.cost_usd!==void 0?(n&&(e.input+=n.input??0,e.output+=n.output??0,e.cache_read+=n.cache_read??0,e.cache_creation+=n.cache_creation??0,e.calls+=n.calls??0),t.cost_usd!==null&&t.cost_usd!==void 0&&(e.cost=(e.cost??0)+t.cost_usd),e.reported++,e):e}function De(e){let t={input:0,output:0,cache_read:0,cache_creation:0,calls:0,cost:null,reported:0};for(let n of e)Ee(t,n);return t.reported?t:null}function Oe(e,t){let n=new Map,r={input:0,output:0,cache_read:0,cache_creation:0,calls:0,cost:null,reported:0};for(let i of e){Ee(r,i);let e=t(i),a=n.get(e);a||n.set(e,a={id:e,kind:i.kind,unit:i.unit??``,spend:we(),share:null}),Ee(a.spend,i)}let i=[...n.values()].filter(e=>e.spend.reported);for(let e of i)e.share=r.cost?(e.spend.cost??0)/r.cost:null;return i.sort((e,t)=>(t.spend.cost??0)-(e.spend.cost??0)||Te(t.spend)-Te(e.spend))}var ke=e=>Oe(e,e=>e.kind).map(e=>({...e,unit:``})),Ae=e=>(e.input??0)+(e.output??0)+(e.cache_read??0)+(e.cache_creation??0);function je(e,t){switch(t){case`cost`:return e.cost_usd??null;case`tokens`:return Ae(e);case`time`:return e.wall_s??0;case`sessions`:return e.sessions}}var Me=e=>[`cost`,`tokens`,`time`,`sessions`].filter(t=>e.some(e=>(je(e,t)??0)>0)),Ne=e=>Date.parse(e.observed_at??``),Pe=e=>!Number.isNaN(Ne(e))&&(e.five_hour_pct!=null||e.seven_day_pct!=null);function Fe(e){let t=[];for(let n of e)for(let e of n.quota??[])Pe(e)&&t.push({reading:e,key:n.key,attempt:n.attempt??0});return t.sort((e,t)=>Ne(e.reading)-Ne(t.reading))}var Ie=e=>`${e.credential??``}\0${e.account??``}`;function Le(e){let t=new Map;for(let{reading:n}of Fe(e)){let e=Ie(n),r=t.get(e);r||t.set(e,r=[]),r.push(n)}let n=[];for(let e of t.values()){let t=e[0],r=e[e.length-1];t&&r&&n.push({credential:r.credential??``,account:r.account??``,first:t,last:r})}return n.sort((e,t)=>(t.last.seven_day_pct??0)-(e.last.seven_day_pct??0))}function Re(e,t){let n=(e.quota??[]).filter(Pe).sort((e,t)=>Ne(e)-Ne(t)),r=Date.parse(e.ts),i=n[0]??null,a=i===null?``:Ie(i);return{start:i,next:(i===null||Number.isNaN(r)?void 0:t.find(e=>Ne(e.reading)>r&&Ie(e.reading)===a))?.reading??null}}function ze(e){let t=/^invalid input:\s*(.*)$/s.exec(e||``);if(!t)return[];let n=[];for(let e of(t[1]??``).split(`; `)){let t=/^input from (\S+) is missing: (\S+)/.exec(e);t?n.push({path:t[2]??``,producer:t[1]??``,problem:`missing`}):(t=/^input from (\S+) ended \S+: (\S+)/.exec(e),t?n.push({path:t[2]??``,producer:t[1]??``,problem:`failed`}):(t=/^(\S+?): required input is missing/.exec(e),t?n.push({path:t[1]??``,producer:``,problem:`missing`}):(t=/^(\S+?): /.exec(e),t&&!n.some(e=>e.path===t?.[1])&&n.push({path:t[1]??``,producer:``,problem:`checks`}))))}return n}function w(e,t){if(!e||!t)return e??``;let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return e.replace(RegExp(`(?:/[^\\s:'"]*)?/${n}/`,`g`),``)}var Be=`lit-localize-status`,T=(e,...t)=>({strTag:!0,strings:e,values:t}),Ve=(e,t,n)=>{let r=e[0];for(let i=1;i<e.length;i++)r+=t[n?n[i-1]:i-1],r+=e[i];return r},He=e=>{return typeof(t=e)!=`string`&&`strTag`in t?Ve(e.strings,e.values):e;var t},E=He,Ue=!1,We=class{constructor(e){this.__litLocalizeEventHandler=e=>{e.detail.status===`ready`&&this.host.requestUpdate()},this.host=e}hostConnected(){window.addEventListener(Be,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(Be,this.__litLocalizeEventHandler)}},Ge=e=>e.addController(new We(e)),D=()=>(e,t)=>(e.addInitializer(Ge),e),Ke=class{constructor(){this.settled=!1,this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){this.settled=!0,this._resolve(e)}reject(e){this.settled=!0,this._reject(e)}},qe=[];for(let e=0;e<256;e++)qe[e]=(e>>4&15).toString(16)+(15&e).toString(16);var Je=new WeakMap,Ye=new Map;function Xe(e){window.dispatchEvent(new CustomEvent(Be,{detail:e}))}var Ze,Qe,$e,et,tt,nt=``,rt=new Ke;rt.resolve();var it=0,at=e=>(function(){if(Ue)throw Error(`lit-localize can only be configured once`);E=(e,t)=>function(e,t,n){if(e){let r=e[n?.id??function(e){let t=typeof e==`string`?e:e.strings,n=Ye.get(t);return n===void 0&&(n=function(e,t){return(t?`h`:`s`)+function(e){let t=0,n=8997,r=0,i=33826,a=0,o=40164,s=0,c=52210;for(let l=0;l<e.length;l++)n^=e.charCodeAt(l),t=435*n,r=435*i,a=435*o,s=435*c,a+=n<<8,s+=i<<8,r+=t>>>16,n=65535&t,a+=r>>>16,i=65535&r,c=s+(a>>>16)&65535,o=65535&a;return qe[c>>8]+qe[255&c]+qe[o>>8]+qe[255&o]+qe[i>>8]+qe[255&i]+qe[n>>8]+qe[255&n]}(typeof e==`string`?e:e.join(``))}(t,typeof e!=`string`&&!(`strTag`in e)),Ye.set(t,n)),n}(t)];if(r){if(typeof r==`string`)return r;if(`strTag`in r)return Ve(r.strings,t.values,r.values);{let e=Je.get(r);return e===void 0&&(e=r.values,Je.set(r,e)),{...r,values:e.map(e=>t.values[e])}}}}return He(t)}(tt,e,t),Ue=!0}(),nt=Qe=e.sourceLocale,($e=new Set(e.targetLocales)).add(e.sourceLocale),et=e.loadLocale,{getLocale:ot,setLocale:st}),ot=()=>nt,st=e=>{if(e===(Ze??nt))return rt.promise;if(!$e||!et)throw Error(`Internal error`);if(!$e.has(e))throw Error(`Invalid locale code`);let t=++it;return Ze=e,rt.settled&&(rt=new Ke),Xe({status:`loading`,loadingLocale:e}),(e===Qe?Promise.resolve({templates:void 0}):et(e)).then(n=>{it===t&&(nt=e,Ze=void 0,tt=n.templates,Xe({status:`ready`,readyLocale:e}),rt.resolve())},n=>{it===t&&(Xe({status:`error`,errorLocale:e,errorMessage:n.toString()}),rt.reject(n))}),rt.promise},ct=globalThis,lt=ct.ShadowRoot&&(ct.ShadyCSS===void 0||ct.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,ut=Symbol(),dt=new WeakMap,ft=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==ut)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(lt&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=dt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&dt.set(t,e))}return e}toString(){return this.cssText}},pt=e=>new ft(typeof e==`string`?e:e+``,void 0,ut),O=(e,...t)=>new ft(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,ut),mt=(e,t)=>{if(lt)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=ct.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},ht=lt?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return pt(t)})(e):e,{is:gt,defineProperty:_t,getOwnPropertyDescriptor:vt,getOwnPropertyNames:yt,getOwnPropertySymbols:bt,getPrototypeOf:xt}=Object,St=globalThis,Ct=St.trustedTypes,wt=Ct?Ct.emptyScript:``,Tt=St.reactiveElementPolyfillSupport,Et=(e,t)=>e,Dt={toAttribute(e,t){switch(t){case Boolean:e=e?wt:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},Ot=(e,t)=>!gt(e,t),kt={attribute:!0,type:String,converter:Dt,reflect:!1,useDefault:!1,hasChanged:Ot};Symbol.metadata??=Symbol(`metadata`),St.litPropertyMetadata??=new WeakMap;var At=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=kt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&_t(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=vt(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??kt}static _$Ei(){if(this.hasOwnProperty(Et(`elementProperties`)))return;let e=xt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Et(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Et(`properties`))){let e=this.properties,t=[...yt(e),...bt(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(ht(e))}else e!==void 0&&t.push(ht(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return mt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?Dt:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?Dt:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??Ot)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};At.elementStyles=[],At.shadowRootOptions={mode:`open`},At[Et(`elementProperties`)]=new Map,At[Et(`finalized`)]=new Map,Tt?.({ReactiveElement:At}),(St.reactiveElementVersions??=[]).push(`2.1.2`);var jt=globalThis,Mt=e=>e,Nt=jt.trustedTypes,Pt=Nt?Nt.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,Ft=`$lit$`,It=`lit$${Math.random().toFixed(9).slice(2)}$`,Lt=`?`+It,Rt=`<${Lt}>`,zt=document,Bt=()=>zt.createComment(``),Vt=e=>e===null||typeof e!=`object`&&typeof e!=`function`,Ht=Array.isArray,Ut=e=>Ht(e)||typeof e?.[Symbol.iterator]==`function`,Wt=`[
|
|
5
|
-
\f\r]`,Gt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Kt=/-->/g,qt=/>/g,Jt=RegExp(`>|${Wt}(?:([^\\s"'>=/]+)(${Wt}*=${Wt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),Yt=/'/g,Xt=/"/g,Zt=/^(?:script|style|textarea|title)$/i,Qt=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),k=Qt(1),A=Qt(2),$t=Symbol.for(`lit-noChange`),j=Symbol.for(`lit-nothing`),en=new WeakMap,tn=zt.createTreeWalker(zt,129);function nn(e,t){if(!Ht(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return Pt===void 0?t:Pt.createHTML(t)}var rn=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=Gt;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===Gt?c[1]===`!--`?o=Kt:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=Jt):(Zt.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=Jt):o=qt:o===Jt?c[0]===`>`?(o=i??Gt,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?Jt:c[3]===`"`?Xt:Yt):o===Xt||o===Yt?o=Jt:o===Kt||o===qt?o=Gt:(o=Jt,i=void 0);let d=o===Jt&&e[t+1].startsWith(`/>`)?` `:``;a+=o===Gt?n+Rt:l>=0?(r.push(s),n.slice(0,l)+Ft+n.slice(l)+It+d):n+It+(l===-2?t:d)}return[nn(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},an=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=rn(t,n);if(this.el=e.createElement(l,r),tn.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=tn.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(Ft)){let t=u[o++],n=i.getAttribute(e).split(It),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?un:r[1]===`?`?dn:r[1]===`@`?fn:ln}),i.removeAttribute(e)}else e.startsWith(It)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Zt.test(i.tagName)){let e=i.textContent.split(It),t=e.length-1;if(t>0){i.textContent=Nt?Nt.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],Bt()),tn.nextNode(),c.push({type:2,index:++a});i.append(e[t],Bt())}}}else if(i.nodeType===8){if(i.data===Lt)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(It,e+1))!==-1;)c.push({type:7,index:a}),e+=It.length-1}}a++}}static createElement(e,t){let n=zt.createElement(`template`);return n.innerHTML=e,n}};function on(e,t,n=e,r){if(t===$t)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=Vt(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=on(e,i._$AS(e,t.values),i,r)),t}var sn=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??zt).importNode(t,!0);tn.currentNode=r;let i=tn.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new cn(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new pn(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=tn.nextNode(),a++)}return tn.currentNode=zt,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},cn=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=on(this,e,t),Vt(e)?e===j||e==null||e===``?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==$t&&this._(e):e._$litType$===void 0?e.nodeType===void 0?Ut(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==j&&Vt(this._$AH)?this._$AA.nextSibling.data=e:this.T(zt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=an.createElement(nn(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new sn(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=en.get(e.strings);return t===void 0&&en.set(e.strings,t=new an(e)),t}k(t){Ht(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(Bt()),this.O(Bt()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=Mt(e).nextSibling;Mt(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ln=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=j,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=j}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=on(this,e,t,0),a=!Vt(e)||e!==this._$AH&&e!==$t,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=on(this,r[n+o],t,o),s===$t&&(s=this._$AH[o]),a||=!Vt(s)||s!==this._$AH[o],s===j?e=j:e!==j&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},un=class extends ln{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}},dn=class extends ln{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==j)}},fn=class extends ln{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=on(this,e,t,0)??j)===$t)return;let n=this._$AH,r=e===j&&n!==j||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==j&&(n===j||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},pn=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){on(this,e)}},mn={M:Ft,P:It,A:Lt,C:1,L:rn,R:sn,D:Ut,V:on,I:cn,H:ln,N:dn,U:fn,B:un,F:pn},hn=jt.litHtmlPolyfillSupport;hn?.(an,cn),(jt.litHtmlVersions??=[]).push(`3.3.3`);var gn=globalThis,M=class extends At{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new cn(t.insertBefore(Bt(),e),e,void 0,n??{})}return i._$AI(e),i})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return $t}};M._$litElement$=!0,M.finalized=!0,gn.litElementHydrateSupport?.({LitElement:M});var _n=gn.litElementPolyfillSupport;_n?.({LitElement:M}),(gn.litElementVersions??=[]).push(`4.2.2`);var N=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},vn={attribute:!0,type:String,converter:Dt,reflect:!1,hasChanged:Ot},yn=(e=vn,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function P(e){return(t,n)=>typeof n==`object`?yn(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function F(e){return P({...e,state:!0,attribute:!1})}var bn=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function xn(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return bn(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return bn(n,r,{get(){return a(this)}})}}var Sn,Cn=t({templates:()=>wn}),wn=function(e){let t=new Map;return new Proxy(e,{get(e,n){if(typeof n==`string`){if(!t.has(n)){let r;for(let t=1;t<=n.length&&r===void 0;t++){let i=n.slice(0,t);Object.hasOwn(e,i)&&(r=e[i])}t.set(n,r)}return t.get(n)}}})}({c:`実行`,d:`出力`,h0:k`JSON Lines(1 行ごとに JSON オブジェクト、スキーマ ${0})`,h5:k`${0} の出力`,h6:k`JSON オブジェクト(スキーマ ${0})`,h87:k`依存先タスク ${0}`,h8e:k`この実行には階層 <code>${0}</code> がありません`,ha:k`ファイルなし | Python コードで定義(<code>TaskAdapter</code>)`,hc:k`実行中 ${0}${1}`,hf:k`${0} の出力から`,"no-":`実行はまだありません`,non:`なし`,"outcome-d":`完了`,"outcome-p":`一部のみ完了`,s000:`実行履歴の未実行のタスク`,s00c:T`HTTP ステータス ${0}`,s02f7:`実行されず`,s02f9:T`アカウント: ${0}`,s030:T`カスタムビュー ${0} はありません`,s037:`完了`,s0382:T`${0}: ${1}`,s038b:`ページ`,s03b:`タブ`,s03e:`タスク`,s03f:T`古い試行 ${0} 件は非表示`,s041:T`ほか ${0} 件`,s042:`タスクが宣言したパターンの下で、試行が作成・変更・削除したファイル(changes)`,s044:T`一部のみ完了 ${0} 件`,s04f:`停止した部分`,s051:`実行中のエージェントのセッション`,s055:`選択中の項目`,s061:`OutputContract`,s062:`トランスクリプト`,s0668:`ユニットごとのステージとステップ(CursorStore)`,s066d:`出力`,s06a5:`Esc: 1 つ上の階層`,s06ac:`依存先`,s06b0:`実行中ではありません`,s06bf:`中を表示`,s077:`テキストフィルター(/)`,s079:T`キャッシュ ${0}`,s07d:`関数`,s07e:T`+${0}`,s087:T`${0}%`,s08b1:T`${0}(認証情報が休止中)`,s08b3:`いいえ`,s08c:`稼働中`,s08f:T`依存先: ${0}`,s0932:`出力の検証: OK`,s0935:`終了日`,s094:`最初のエージェントのセッションの前に終了`,s09b:`プロンプトなし`,s0b0:T`作成元: ${0}`,s0b2:`エージェントのセッション開始時のサブスクリプション利用率(アカウント全体)`,s0b3:`OK`,s0b7:`実行前からあるファイル`,s0bf:T`${0} 周目`,s0c:T`モデル切り替えのあったタスク ${0} 件`,s0d7:T`キャッシュ書き込み ${0}`,s0df:`依存先タスクが登録されなかった`,s0e6:`問題`,s0ea:`プラグインディレクトリ`,s0ef:`すべてのホスト`,s0f0:`一部省略`,s0f1:`リセット済み`,s0f2:T`最初の API 呼び出しの入力: ${0}`,s0f8:T`出力ファイル ${0} 件`,s103:`再開カーソル`,s104:`昇順に並べ替え`,s107:`種別の最初のタスクの開始時に記録(definitions/<kind>.json)`,s108:T`${0} の実装`,s114:T`${0} 型の JSON 値`,s115:`過去 24 時間`,s123:`待機中`,s125:T`要素 ${0} 個`,s12c:`型の不一致`,s13:T`最終報告 ${0}`,s14:`コーディングエージェントが報告した値`,s150:`出力`,s156:`なし(任意)`,s158:T`週の利用率 ${0}`,s159:`このタスクが代わりに出力ファイルを書く種別(output_of)`,s163:`検証対象のファイルなし`,s165:T`${0} 回目で完了 | 失敗 1 回`,s168:`検証のタイミング`,s170:T`実行されず ${0} 件`,s179:`アカウントごと、最初の値 → 最後の値`,s17d:`利用率のルール`,s17e:`書き込み待ち(タスクが待機中)`,s18:T`ループ内の ${0}`,s197:`利用できるモデルなし`,s19e:`上限: max_concurrent`,s1a2:T`スキップ ${0} 件`,s1a3:`種別 · ユニット`,s1a4:`モデルごとの、エージェントのセッションの使用量。モデル切り替えの前後は別々に集計(Plan.models)`,s1ac8:`エディタのテーマ`,s1acc:`書き込まれていない出力 1 件(タスクが未実行)`,s1b2:T`種別 ${0}`,s1bb:`すべてのタスクが開始済み`,s1bf:`実行中のプロセスなし`,s1c0:`パラメータ`,s1c2:`タスクが選択されていません`,s1c4:T`セッション開始時の利用率(アカウント全体): ${0}`,s1c7:`実行に登録されたすべてのタスク(種別ごと、plan.jsonl)`,s1cc:`実行中の Python タスク`,s1db:`API エラー`,s1dc:T`試行 ${0} 回`,s1dd:`実行中のタスクなし`,s1e9:T`プロンプト(${0} 文字、ほか ${1} 文字は未保存)`,s1eb:`入力`,s1f2:`削除`,s1f5:T`所要時間 ${0}`,s204:`安全分類器による停止`,s20e:T`リセットまで ${0}`,s20f9:`依存先タスクが実行されなかった`,s20fd:`ホストなし`,s217:`あり`,s21a:`発生したらリトライする例外(retry_on)`,s221:`JSON ではありません`,s224:`ツール実行中に中止`,s230:`スキーマにないフィールド`,s234:`終了した試行はまだありません`,s236:`拡大`,s23b:T`${0} 回の試行がすべて失敗: ${1}`,s23f:`定義はまだありません`,s24:T`完了 ${0}`,s25:`OutputContract・InputContract を宣言したタスクはありません`,s260:`API 呼び出し 1 回`,s26ba:`ユニットなし`,s26bb:`実行した試行の回数(リトライを含む、journal.jsonl)`,s26e:T`API 呼び出し ${0} 回`,s27a:`最後のメッセージから`,s27b:T`ユニット: ${0}`,s27d:`フローの構成`,s28a2:`リプレイ`,s28ad:`曜日と時刻ごと(期間のタイムゾーン)`,s28f:`InputContract`,s29:T`最大コンテキスト: ${0}`,s2a:`現在`,s2c8:`リトライ`,s2cd:`モデルの利用可否`,s2dd:`試行の結果(stop)`,s2df:`割合`,s2e3:T`ほかの出力 ${0} 件`,s2e4:`周`,s2f34:T`${0} 周`,s2f3c:`問題なし`,s2f4:`すべての出力`,s2f5:`定義なし`,s2fa:T`5 時間枠の利用率 ${0}(リセット ${1})`,s2fe3:`ツール`,s2fea:T`修正依頼 ${0}`,s31:`終了(未実行のタスク 1 件)`,s321:`余分なフィールド`,s326:T`キャッシュ読み込み ${0}`,s32d:`最大コンテキスト`,s33:`パイプラインの階層`,s343:`新しいイベント 1 件を表示`,s34b:`終了`,s34e:`降順に並べ替え`,s351:`終了した試行なし`,s352:`ファイル全体`,s355:`入力ファイルに検証エラー`,s366:`週`,s367:`料金`,s368:`コピー`,s36d:T`この書き出しに含まれないもの: ${0}`,s36e:T`所要時間 ${0}`,s3700:`Web 検索 1 回`,s370b:T`報告時刻 ${0}`,s378:`検証エラーの後に、同じエージェントのセッションで続けるラウンド(rounds)`,s37d:`スキーマ以外の検証(validators)`,s384:T`${0} を展開`,s387:T`検索結果 ${0} 件`,s38e65:`修正依頼のプロンプトに含めて送信`,s38e6a:`日ごとの料金`,s390:`JSON オブジェクトではありません`,s39e:`パイプライン`,s3a7:T`上限: ${0}`,s3aa:`出力ファイルなし`,s3b3:`プロセスツリー`,s3b9:T`${0} にモニター API がありません: ${1}`,s3bd:T`task_detail コールバックが失敗: ${0}`,s3c6:`実行した試行の回数`,s3cd:`実行中のエージェントのセッション 1 件`,s3d0:`エージェントのセッション`,s3d1:`概要`,s3d31:`利用できるモデルがなく、設定どおりのモデルで実行する種別(kept)`,s3d38:T`認証情報 ${0}`,s3d99:`検証エラー後の、同じエージェントのセッション`,s3d9b:`テキストファイル`,s3dd:`ネットワークエラーで応答なし`,s3f1:`各タスクが書き込むファイル`,s3f7:`修正依頼`,s3fd:`開始`,s407:T`${0}: 入力`,s408:`週の利用率`,s41:`Tab: 次のノード`,s42a:`フィールド`,s42c:`検証`,s438:`ハイライトを解除`,s43a:`入力ファイル`,s43e:`利用不可`,s451:`料金の高いタスク`,s454:T`${0} のループの各周`,s45d:T`${0}(カスタムビュー)`,s466:`モデル切り替えのあったタスク 1 件`,s467:T`1 周: ${0}`,s473:`キャッシュ読み込み`,s478:`検証対象のファイル(OutputContract、InputContract)`,s479:`締め切り`,s47a:T`このタスクの入力 ${0} 件`,s47b:`Python タスク`,s47c:`未対応のイベント`,s482:T`終了 ${0}`,s484:`テキストなし`,s48e:`所要時間`,s490:`モニターのサーバーに接続済み`,s491:T`${0} のループ`,s4a:T`${0} 日前`,s4d6:`検索結果 1 件`,s4d8:`モデル切り替え`,s4e7:T`修正依頼 ${0} 回で完了 | 最初の検証エラー: ${1}`,s4ef:`ループ`,s4f0a:`スキーマにない`,s4f0b:T`再開後に再実行: ${0}`,s4f9:T`ホスト ${0}`,s4fe:`エージェントタスク`,s501:T`${0}: ${1} → ${2}`,s504:`日付指定`,s5131:`そのモデルで始めたエージェントのセッションの数`,s5138:`入力・出力・キャッシュ読み込み・キャッシュ書き込みの合計`,s514:`実行が終了した`,s521:`1 ユニット`,s522:`安全分類器がエージェントのセッションの一部を止め、セッションはそのまま続いた(safety_stops)`,s525b:`失敗の後の、次のモデルでの新しいエージェントのセッション(Router のホップ)`,s525c:`記録から再生した試行(replayed)`,s529:T`上限 ${0}`,s52b:`このバージョンの contraagent が対応していないイベント種別(unread_events)`,s52c7:`次の周`,s52cc:T`${0} の締め切りと仕上げの猶予を過ぎた`,s52cf:`カスタムビュー`,s535:`種別`,s53c5:T`${0}: 未実行`,s53c8:`不可`,s541:`開始できず`,s543:`プロンプト`,s552:T`フロー呼び出し ${0}`,s555:`プラグインディレクトリ`,s558:`認証情報の不一致`,s5590:`項目`,s559f:`その他のモデル`,s55f:T`${0}(${1})`,s566:T`(ほか ${0} 文字は未保存)`,s567:`未実行(依存先タスクが失敗)`,s568:T`後続タスク: ${0}`,s571:T`入力 ${0} がありません(${1} が未実行)`,s574:T`キャッシュ書き込み ${0}`,s585:T`入力 ${0} がありません(${1} が失敗)`,s587:T`${0} 以降報告なし`,s58b:`モデルの置き換え`,s58c:`実行履歴`,s591:`5 時間枠`,s594:T`修正依頼 ${0} 回`,s59e:`上限に接近`,s5a3:`休止中`,s5a7:`ツール`,s5ab:`並び順`,s5b9:`種別ごとのトークンと料金`,s5bd:`フロー呼び出しごとの締め切り(time_box)`,s5c7:`サービスなし`,s5cd:T`エージェントのセッション ${0} 回`,s5cf:`値なし`,s5d0:`実行中にこのタスクが占有する名前(claims)`,s5d4:T`${0} 回目で完了 | 失敗 ${1} 回`,s5da:`モデル`,s5de:`依存先タスク`,s5e3:`書き込みなし(タスクが未実行)`,s5e6:`テキスト(JSON 文字列)`,s5f2:`ロールなし`,s5f31:`エージェント・モデル・認証情報`,s5f34:`エラー`,s5f40:`行なし`,s5f43:`ソース`,s5f7:`なし(必須)`,s5f8:T`認証情報 ${0} は休止中`,s5ff:`エージェントタスク`,s601:`実行中`,s605:T`未実行の後続タスク ${0} 件`,s620:`キャッシュ書き込み`,s629:`任意`,s647:`応答が JSON ではなく HTML`,s649:`後続タスク`,s64f:`変更禁止の箇所`,s652:T`ロック ${0} 件`,s653:`締め切りを過ぎた`,s65c:`中断`,s6645:`拡大(Ctrl + スクロール)`,s6647:`ファイルなし`,s664b:`ツール呼び出しが戻る前に実行が終了`,s670:T`${0} ユニット`,s673:`停止でエラー`,s680:`タイムライン`,s685:`修正依頼`,s688:`その他の検証`,s68d:T`仕上げの猶予 ${0}`,s695:`修正依頼 1 回`,s699:T`スキーマ ${0}`,s6a0:`1 ステップ完了`,s6a8:T`入力 ${0} がありません(${1} が未完了)`,s6aa:`未実行(入力ファイルなし)`,s6b0:`ホスト`,s6b8:T`同時実行 ${0}/${1}`,s6b9:`タスクなし`,s6c3:`依存先タスクなし`,s6c7:`実行の開始時刻`,s6c8:T`依存先タスク ${0} が失敗`,s6d7:T`${1} タスク中 ${0} 件完了`,s6db:T`${0} 文字`,s6e4:`未選択`,s6eb:`読み込み中…`,s6f1:`API 呼び出し`,s6f2:`出力ファイル 1 件`,s6fa:`フロー呼び出しがエラーで終了`,s700:`書き出しに含まれない`,s703:T`${0} まで休止`,s706:`実行グループ`,s70a7:T`タスク終了後の利用率: ${0}`,s70af:`種別`,s71:T`モデル切り替え: ${0}`,s721:`ホストからの報告なし`,s7233:`古い試行 1 件は非表示`,s7239:T`修正依頼のあったタスク ${0} 件`,s72dc:`ユニットごとの周回数`,s72dd:`キャッシュ読み込み`,s734:`スタブエージェント`,s737:`ループの周回数`,s73d:`未実行の後続タスク 1 件`,s755:T`プラグイン ${0}`,s758:`エージェントのセッションなし`,s75e:`実行を検索`,s767:T`${0} モニター`,s76d:`カスタム列(row_extras)`,s76f:`原因`,s771:T`入力 ${0} は失敗したタスク ${1} の出力`,s77e:T`未実行 ${0} 件`,s786:`トランスクリプト`,s78f:`トークン`,s797:`すべての中を隠す`,s79a:T`未対応のイベント: ${0}`,s79f:T`5 時間枠の利用率 ${0}`,s7a1:`エラーで終了したフロー呼び出し 1 件`,s7a3:`出力ファイル`,s7a4:`権限エラー`,s7b16:`入力ファイルなし`,s7b1c:`修正依頼のあった試行`,s7b3:`検索に一致する実行なし`,s7bf:T`最初のエージェントのセッションの前に各モデルへ送る 1 回のリクエスト(preflight, policy ${0})`,s7c0:T`ホストからの報告なし ${0} 件`,s7c9:`フィルター`,s7cd8:`このタスクの入力 1 件`,s7cd9:`利用できるモデルがなく、最初に応答したモデルで実行する種別(substitute)`,s7cf:`応答が JSON ではない`,s7da:`最終報告`,s7df:T`終了(未実行のタスク ${0} 件)`,s7e:T`ロール ${0}`,s7f:`表示形式`,s803:`ファイル`,s807:`実行 1 件`,s80c:`1 行`,s816:`モデル切り替えなし`,s817:`変更したファイル 1 件`,s822:T`以前の試行のモデル: ${0}`,s826:`エージェントのセッションが使ったモデル`,s827:`認証情報が休止中`,s83:T`書き込み ${0}`,s841:`たった今`,s843:T`修正依頼 ${0} 回後`,s84f:`リトライ`,s8512:T`テーマ: ${0}`,s851d:`ファイルの値`,s859:`実行中`,s85e:T`${0}: モデル切り替え`,s863:T`入力 ${0} がありません`,s864:`全体を表示`,s868:T`${2} 年 ${0}〜${1} | ${3}`,s86c:T`ホスト ${0} 台`,s874:T`${0} ステップ完了`,s877:T`${0} 回目の失敗後の、新しいエージェントのセッション`,s87a:`実行されず`,s87b:T`モデル切り替え後に完了: ${0}`,s87c:`修正依頼 1 回後`,s880:`全試行の合計`,s888:`入力`,s88b:`表で表示`,s88e:T`修正依頼 ${0}`,s892:T`入力 ${0}(${1} の出力)がありません`,s89e:`パラメータなし`,s8a56:`なし`,s8a59:T`PID ${0}`,s8ab:`コーディングエージェント`,s8ad:`周回数`,s8ae:T`${0} の記録から再生したエージェントのセッションと、そこに記録した新しいセッション(replay, record_missing)`,s8b1:`リトライしたタスク`,s8b4:`同じロックを持つタスクが共有する常駐の補助プロセス(services.jsonl)`,s8bb:`終了したすべての試行から集計(journal.jsonl)`,s8c:T`${0} 分前`,s8d3:`コーディングエージェントが使ったアカウントまたは API キー(credential)`,s8d4:`PID`,s8dd:T`キャッシュ読み込み ${0}`,s8de:`再開後の実行での、新しいエージェントのセッション`,s8df:`オブジェクト`,s8e3:`アシスタント`,s8e6:`Python コードで定義`,s8e9:T`ほか ${0} アカウント`,s8ea:`Tab: 次の行`,s8f1:`選択を解除`,s8f2:`ユニット`,s8f4:`入力と出力(全試行の合計)`,s8f5:`未実行`,s8fa:`未実行(入力ファイルなし、入力ファイルに検証エラー)`,s8fc:T`修正依頼 1 回で完了 | 最初の検証エラー: ${0}`,s900:`ビュー`,s901:`完了したタスク`,s906:`Python タスク`,s90c:T`コンテキストの上限 ${1} の ${0}%`,s90e:`ほかの種別が実装する種別(base_kind)`,s90f:`認証エラー`,s914:T`最大 ${0} 周`,s915:T`モデル ${0} 種類`,s919:T`${0}d ${1}h`,s924:T`モデル ${0}`,s92a:T`依存先タスク ${0} 件の出力待ち`,s92b:T`5 時間枠 ${0}`,s934:`試行 1 回`,s936:`キュー内で同順位のタスクの順序を決める値(priority)`,s93e:`リプレイ`,s941:T`1 日あたり ${0}`,s949:`書き出しの期間`,s94d:`認証情報`,s94e:T`最終更新 ${0}`,s94f0:`実行中のタスク`,s94fd:T`${0} を折りたたむ`,s967:T`失敗 ${0} 件`,s96a:`コンテキストの上限`,s96c:T`出力 ${0}`,s97:T`修正依頼 ${0} 回で完了`,s980:`テキストフィルター`,s9893d9:T`利用率のルール: ${0}`,s9893de:`ホスト 1 台`,s98b:`グループ`,s98f:`入力ファイルなし`,s99:T`${0} 日間`,s9a2:`すべてのプロセス`,s9a4:T`失敗: ${0}`,s9a6:T`Web 検索 ${0} 回`,s9aa:`API 呼び出し 1 回あたりの入力の最大値。キャッシュ読み込みとキャッシュ書き込みを含む(peak_context)`,s9b1a6:`実行中ではありません`,s9b1a9:T`仕上げの種別: ${0}`,s9b3:`報告間隔`,s9b7:`書き込みなし(タスクが失敗)`,s9bd:T`${0} 回目で完了 | 失敗 ${1} 回 | 最初の失敗: ${2}`,s9c3:T`上限を超えた利用: ${0}`,s9c5:T`${0} の出力`,s9c7:`すべての中を表示`,s9cb:`実装する種別`,s9d3:T`${0} 時点の書き出し`,s9d6:`最終応答なしで終了`,s9de:`モデル`,s9e0:T`状態: ${0}`,s9e8:`未実行(入力ファイルに検証エラー)`,s9f0:T`入力 ${0}`,s9f2:`一部のみ完了`,s9f7:`エラー`,s9f92:T`${0} の内部`,s9f97:`料金の上限`,s9fb:`実行`,s9fd:`タスクの開始前からあるファイルも有効`,s9ff:`モデル切り替え`,sa0:`出力を待つ`,sa1:`リプレイした試行`,sa23:`ターン数の上限`,sa24:T`${0} の締め切りまでに終わらない`,sa31:`行を折り返す`,sa33:`後続タスクなし`,sa358:`ロール`,sa35c:`試行`,sa36:`モデル別の内訳`,sa39:T`実行中のエージェントのセッションの新しいイベント ${0} 件を表示`,sa3c:`形式`,sa3d3:T`週の利用率 ${0}(リセット ${1})`,sa3de:`停止`,sa3e:`アカウント全体の値 | エージェントのセッション開始時に取得`,sa3f:`各タスクが読み込むファイル`,sa43:`作成元`,sa48:`コマンドライン`,sa4f:T`最大 ${0} 回`,sa508:`安全分類器による停止 1 件`,sa50a:`折りたたむ`,sa57:`権限エラーになったツール呼び出し`,sa58:`周回数`,sa62:T`${0}: トランスクリプト`,sa66:T`前の ${0} 行を表示`,sa6a:`開始日`,sa70:`項目なし`,sa71:`期待する型`,sa74:`縮小(Ctrl + スクロール)`,sa81:`システム設定に合わせる`,sa84:T`新しいイベント ${0} 件を表示`,sa86:T`${0} 時間前`,sa87:`ソースを表示`,sa88:T`${0} の入れ子のループ`,sa8b:`Shift + 矢印キー: 依存先タスク・後続タスク`,sa9b:`タスク詳細`,sa9d:`報告なし`,saa0:`書き込み待ち(タスクが実行中)`,saa2:`理由`,saaa:`5 時間枠の利用率`,saab:`テーマ`,sab5:T`${0} 行目`,sabd:`思考`,sac1:`モニターのサーバーに未接続`,sac7:T`${0} に利用できるモデルなし`,saca:`期間内の実行の合計`,sacc:`可`,sad1:T`ほかに休止中の認証情報 ${0} 件`,sad3:`状態`,sad9:`API リクエストを再送`,sae5:`必須`,sae6:`実行履歴のリトライしたタスク`,saee:`プロセス`,saf2:`すべてのモデルが利用可能`,saf8:`変更したファイルなし`,safd:T`${0} 回目が失敗: ${1}`,sb05:`エラー`,sb06:`実行履歴の修正依頼のあった試行`,sb0c:`サブスクリプションの利用率`,sb0f:`Python タスク 1 回`,sb105:T`未実行: ${0}`,sb106:`検索語`,sb108:`作成、試行の失敗後に削除`,sb14:T`報告なし ${0} 台`,sb16:T`${0} 行`,sb1f:`前の 1 行を表示`,sb26a:`登録順`,sb26f:`表示中の階層の外`,sb27:`Enter: 開く`,sb28:`キャッシュ書き込み`,sb31:T`プロンプト(${0} 文字)`,sb34:T`変更したファイル ${0} 件`,sb38:`ツール呼び出し`,sb45:`リトライしたタスク 1 件`,sb4d:`トランスクリプトなし`,sb51:`パイプラインのプロセス内`,sb53:`はい`,sb55:`コーディングエージェントが報告した値`,sb59:T`コンテキストの上限に接近(${0}%)`,sb5a:`未実行`,sb6:`タスク実行中の書き込みが必須`,sb7:T`${0} に停止`,sb8:`エージェントのセッション 1 回`,sb94:T`5 時間枠(${0})`,sb97:`コンテキストの上限に接近`,sb98:T`${0}: 完了`,sb99:`トークンと料金`,sb9c:T`Python タスク: ${0}`,sba3:`1 周`,sba7:`ほかの出力 1 件`,sba8:`検証を通るファイルを書き込む前に、タスクが失敗`,sbaf:`要素 1 個`,sbb0:T`このバージョンの contraagent が対応していないイベント種別(unread_events): ${0}`,sbb2:`開始時の利用率`,sbb7:T`${1} タスク中 ${0} 件が未完了`,sbb9:`終了`,sbc6:T`${0} 周: ${1}`,sbc9:T`以前の試行のモデル: ${0}`,sbca:`タスクの開始時`,sbcc:`依存先タスクが失敗`,sbd4:`実行を切り替え(r)`,sbd5:`停止の記録なし`,sbd9:`再開後`,sbdc:T`履歴にほか ${0} 件`,sbe2:`実行履歴の失敗した試行`,sbe4:T`${0} の記録から再生したエージェントのセッション(replay)`,sbe9:T`週(${0})`,sbea:`保存対象外(keep_transcripts = false)`,sbf18:`種別のロール`,sbf1d:T`ロック ${0}`,sbf2:`アクティビティなし`,sbf9:`スタブエージェントが台本どおりの応答で処理したタスク(stub)`,sc03:`それ以前`,sc07:`リトライ対象の例外`,sc15:`スキップ`,sc1a:T`待機中 ${0} 件`,sc1b:T`リトライしたタスク ${0} 件`,sc2:`ツール`,sc3:`この期間の実行はありません`,sc4:`タイムアウト`,sc53:`休止した認証情報`,sc54:T`${0} の締め切りを過ぎた`,sc57:T`入力 ${0} に検証エラー`,sc5b:`次のモデルでの新しいエージェントのセッション`,sc61:T`週 ${0}`,sc65:`縮小`,sc68:`日時`,sc6c:T`書き込まれていない出力 ${0} 件(タスクが未実行)`,sc6e:`締め切りまでに終わらない`,sc6f:T`エラーで終了したフロー呼び出し ${0} 件`,sc73:`開始`,sc75:T`全 ${1} 行のうち先頭 ${0} 行`,sc79:`タスク`,sc7d:`同時実行(上限)`,sc87a:T`警告のしきい値: ${0}`,sc87d:T`終了 ${0}`,sc92:`空き`,sc94:`全体`,sc97:`タイムゾーン`,sc9e:`その他`,sca4:`プロセスなし`,sca6:`プレビューを表示`,sca7:`ロール`,scb8:`終了(未完了のタスク 1 件)`,scb9:`最終試行の終了時刻`,scbd:`全文`,scca:T`最も高い種別: ${0}`,sccc:`モデルが応答を拒否`,scd1:`モデルの応答`,scd2:T`${0}: ${1} → 次のモデル`,scd94:`エージェントの所要時間`,scd9c:T`優先度 ${0}`,scdb:`Esc: 選択を解除`,scde:`ループ`,scf41:T`完了 ${0} 件`,scf43:T`入力 ${0} は失敗したタスクの出力`,scf70:`レート制限`,scf71:`失敗した試行の後の試行(retries)`,sd05:T`締め切り ${0}`,sd0e:`出来事`,sd17:`入力 / 出力 | キャッシュ読み込み / キャッシュ書き込み`,sd1f:`ファイルの検証に使うスキーマ`,sd2:T`${0} 件を同時実行`,sd34:T`${0} に開始(${1})`,sd38:`変更`,sd3c:`登録済みのタスクなし`,sd3e:T`終了(未完了のタスク ${0} 件)`,sd4:`ローカルの認証情報(ambient)`,sd58:`終了(失敗したタスク 1 件)`,sd5a:`実行がシグナルで停止された`,sd5d:T`トークン: 入力 ${0}、出力 ${1}、キャッシュ読み込み ${2}、キャッシュ書き込み ${3}`,sd5e:`所要時間の合計`,sd73:`失敗`,sd744:`検証対象のファイル`,sd747:`なし(任意)`,sd75:`検証エラー`,sd776:T`全体の ${0}%`,sd77d:`実行中のエージェントのセッションの新しいイベント 1 件を表示`,sd79:`結果を受けて作成`,sd7d:T`入力 ${0}(${1} の出力)に検証エラー`,sd82:`タスクの開始前からあるファイルは無効`,sd8a:T`${0} まで`,sd93:T`依存先タスク ${0} の出力待ち`,sd95:T`一部のみ完了: ${0}`,sd96:`中を隠す`,sda2:T`セッション開始時の利用率: ${0}`,sda80:T`すべて表示(${0} 文字)`,sda8d:`最大コンテキストが警告のしきい値を超えた(context_warned)`,sdb1:`入力`,sdb4:`イベントが途絶えた`,sdb8:`出力に検証エラー`,sdc:T`実行グループ ${0}`,sdd1:`モニターから応答がありません`,sdd4:`モデル 1 種類`,sdd8:`修正依頼なし`,sddf:`ビューを表示`,sde7:`履歴にほか 1 件`,sde8:T`アカウント ${0}`,sdf1:T`${0} 回目で完了 | 失敗 1 回 | 最初の失敗: ${1}`,sdf4:`リトライなし`,sdf9:`リトライ後に完了`,se0e6:T`${0} から休止中`,se0ed:T`実行されず: ${0}`,se17:T`必要な時間 ${0}`,se1a:`作成`,se21:`指標`,se27:`タスクを実行した CLI(claude、omp)`,se2b:T`キー ${0} 個: ${1}`,se2c:T`期待する型: ${0}`,se3:`キーボードショートカット`,se41:`作成、試行の失敗後も保持`,se4b:`修正依頼のあったタスク 1 件`,se55:`エージェントのセッションの所要時間の合計`,se5a:`モデル切り替え`,se5b:`推移`,se5d:`monitor.Panel`,se60:`ハイコントラスト`,se61:`パイプラインのプロセス内の関数`,se66:`1 タスク`,se6d:`下の階層あり`,se71:T`${0} 回目`,se75:`リプレイと新しいセッション`,se8:T`安全分類器による停止 ${0} 件`,se90:`認証情報`,se99d:`ロック`,se99f:T`終了(失敗したタスク ${0} 件)`,sea2:`期間`,sea4:`定義`,sea6:`矢印キー: マーク`,sea74:T`${0} タスク`,sea7b:`実行の一覧`,seac:`待機中`,seb0:`グラフで表示`,seb2:`締め切りと仕上げの猶予を過ぎた`,seba:`既定`,sec2:`すべての種別`,sec7:`コーディングエージェントが使ったエージェント定義(agents/<role>.md)`,secc:`上限に到達`,secf:T`${0}の利用率 ${1}`,sed05:`コーディングエージェントが報告した料金(試行が終わった日に計上)`,sed0a:`タスクごとに 1 つ(Backend.run)`,sed7:`種別または関数`,sed8:`合計`,sede:`ステージなし`,seea0:`結果`,seea1:`ホスト ID なし`,seee1:`スキップ`,seee3:`完了しなかった試行`,sef0:T`実行中 ${0} 件`,sefc:`言語`,ser:`稼働中`,sf03:`所要時間の中央値`,sf06:T`タスクは ${0} 回目で完了`,sf08:`すべてのエージェントのセッションの合計(同時に実行した分も含む)`,sf11:`終了時刻`,sf14:`最初のエージェントのセッション`,sf26:T`実行 ${0} 件`,sf2b:`トークンの報告なし`,sf2c:`すべての試行が完了`,sf2d:T`関数 ${0}`,sf2e:`定義`,sf39:`周回数`,sf3c:`ほか 1 アカウント`,sf3e:`カスタムビュー`,sf46:T`${0} 周目`,sf48:`終了後の利用率`,sf4d:`コピー済み`,sf55:`サービス`,sf56:`試行の終了後に、同じアカウントで最初に報告された値`,sf5d:`ユニットごとではなく、実行ごとに 1 回実行されるタスク`,sf6:`フロー呼び出し`,sf7b:T`不明(${0})`,sf7d:T`残り ${0}`,sf7e:`すべての実行グループ`,sf82:T`休止 ${0} → ${1}`,sf86:`内容不明`,sf93:`合計`,sf9b:`エージェントのセッションが始まらなかった`,sfa0:`テキスト`,sfa2:T`${0} 〜 ${1}`,sfa6:`フィルターに一致するタスクなし`,sfa8:`ツールのリクエスト`,sfad:`修正依頼 1 回で完了`,sfae:`ホスト一覧`,sfb3:`実行を切り替え`,sfb6:T`実行中のエージェントのセッション ${0} 件`,sfbb:`失敗した試行`,sfc:`再開カーソルなし`,sfd3:T`リトライ後に完了 ${0} 件`,sfd5:T`要素 ${0} 個: ${1}`,sfd7:`出力`,sfd85:`タスクの前から変わらない出力ファイルの箇所(preserve)`,sfd8b:`各日の最大値`,sfdd:`プロセス`,sfde:`ファイルにない必須フィールド`,sfe7:T`${0}: 入力と出力`,sfe9:T`プロセス ${0}`,sff6:`登録済みのタスクはまだありません`,sff8:T`${0} のタスク`,sffa:`定義なし`,sfff:T`Python タスク ${0} 回`,stag:`完了`,stat:`状態`,"stop-c":`完了`,"stop-i":`未実行`,"stop-p":`一部のみ完了`,tab:`タスク`,tas:`タスク`,tok:`出力`,too:`完了`,"trends-p":`一部のみ完了`,"trends-r":`実行`,"view-g":`グラフ`,"view-o":`出力`,"view-t":`表`}),Tn=`en`,En=[`ja`],Dn=[`en`,`ja`],On={en:`English`,ja:`日本語`},kn={ja:()=>Promise.resolve(Cn)};function An(){if(Sn===void 0)try{Sn=at({sourceLocale:Tn,targetLocales:En,loadLocale:e=>kn[e]()})}catch{Sn=null}return Sn!==null}var I=()=>Sn?.getLocale()??Tn;async function jn(e){An()&&await Sn.setLocale(e)}var Mn=`contraagent:locale`,Nn=e=>Dn.includes(e);function Pn(){try{let e=globalThis.localStorage?.getItem(Mn);if(Nn(e))return e}catch{}for(let e of globalThis.navigator?.languages??[]){let t=e.toLowerCase().split(`-`)[0];if(Nn(t))return t}return Tn}async function Fn(e){try{globalThis.localStorage?.setItem(Mn,e)}catch{}await jn(e)}var In=`contraagent`,Ln=null,Rn=``,zn=null,Bn=!1;function Vn(){let e=globalThis.history?.state;return e&&typeof e==`object`?e:{}}function Hn(){let e=Vn()[In];return e&&typeof e==`object`?e:{}}function Un(){zn&&clearTimeout(zn),zn=null;let e=Ln;Ln=null,e&&globalThis.history&&Hn().entry===Rn&&history.replaceState({...Vn(),[In]:{...Hn(),...e}},``)}function Wn(){Un()}var Gn={recall:function(e){if(globalThis.history)return Ln&&Rn===Hn().entry&&e in Ln?Ln[e]:Hn()[e]},remember:function(e,t){if(!globalThis.history)return;let n=function(){let e=Hn().entry;if(e)return e;let t=Math.random().toString(36).slice(2);return history.replaceState({...Vn(),[In]:{...Hn(),entry:t}},``),t}();Ln&&Rn!==n&&(Ln=null),Rn=n,(Ln??={})[e]=t,zn??=setTimeout(Un,200),Bn||(Bn=!0,globalThis.addEventListener?.(`pagehide`,Wn))}},Kn=class{constructor(){this.values=new Map}recall(e){return this.values.get(e)}remember(e,t){this.values.set(e,t)}},qn=new WeakMap;function Jn(e,t){t?qn.set(e,t):qn.delete(e)}function Yn(e){for(let t=e;t;t=t.parentNode??t.host){let e=qn.get(t);if(e)return e}return Gn}var Xn=class{constructor(e,t){this.id=e,this.from=t,this.items=null}get memory(){return Yn(this.from)}get loaded(){return this.items??=new Set(this.memory.recall(this.id)??[])}has(e){return this.loaded.has(e)}set(e,t){let n=this.loaded;t!==n.has(e)&&(t?n.add(e):n.delete(e),this.memory.remember(this.id,[...n]))}values(){return[...this.loaded]}clear(){this.loaded.size&&(this.loaded.clear(),this.memory.remember(this.id,[]))}},Zn=class{constructor(e){this.id=e;let t=null;try{t=JSON.parse(globalThis.sessionStorage?.getItem(`${In}:${e}`)??`null`)}catch{}this.items=new Set(Array.isArray(t)?t.filter(e=>typeof e==`string`):[])}has(e){return this.items.has(e)}set(e,t){if(t!==this.items.has(e)){t?this.items.add(e):this.items.delete(e);try{globalThis.sessionStorage?.setItem(`${In}:${this.id}`,JSON.stringify([...this.items]))}catch{}}}},Qn=[`wheel`,`touchstart`,`pointerdown`,`keydown`],$n=class{constructor(e,t=()=>Gn){this.id=e,this.memory=t,this.el=null,this.frame=0,this.restoring=!1,this.cancel=()=>{if(cancelAnimationFrame(this.frame),this.frame=0,this.restoring){this.restoring=!1;for(let e of Qn)this.el?.removeEventListener(e,this.cancel)}},this.onScroll=()=>{!this.restoring&&this.el&&this.memory().remember(this.id,Math.round(this.el.scrollTop))}}attach(e){this.el!==e&&(this.detach(),this.el=e,e.addEventListener(`scroll`,this.onScroll,{passive:!0}))}detach(){this.cancel(),this.el?.removeEventListener(`scroll`,this.onScroll),this.el=null}restore(){let e=this.el;if(!e)return;this.cancel();let t=this.memory().recall(this.id)??0;if(t<=0)return void(e.scrollTop=0);let n=performance.now()+6e3;this.restoring=!0;for(let t of Qn)e.addEventListener(t,this.cancel,{passive:!0,once:!0});let r=()=>{let i=e.scrollHeight-e.clientHeight;if(e.scrollTop=Math.min(t,i),i>=t||performance.now()>n)return this.cancel();this.frame=requestAnimationFrame(r)};r()}reset(){this.cancel(),this.el&&(this.el.scrollTop=0)}},er=[`overview`,`tasks`,`journal`,`outputs`,`definitions`,`procs`,`stream`],tr=[`transcript`,`input`,`output`,`definition`],nr=[7,14,30],rr={page:``,run:``,tab:`overview`,key:null,view:`transcript`,round:null,def:null,kind:``,stop:``,q:``,layer:``,unit:``,sel:``,days:14,from:``,to:``,tz:``,group:``,trendsTab:``},ir=e=>er.includes(e)||/^panel:.+/.test(e),ar=e=>tr.includes(e);function or(e){let t=new URLSearchParams(e),n=t.get(`tab`)??``,r=t.get(`view`)??``,i=Number(t.get(`round`)),a=t.get(`page`)===`hosts`?`hosts`:t.get(`page`)===`trends`?`trends`:``,o=t.get(`from`)??``,s=t.get(`to`)??``,c=/^\d{4}-\d{2}-\d{2}$/.test(o)&&/^\d{4}-\d{2}-\d{2}$/.test(s),l=Number(t.get(`days`));return{page:a,run:a?``:t.get(`run`)??``,tab:a!==`trends`&&ir(n)?n:`overview`,key:t.get(`key`)||null,view:ar(r)?r:`transcript`,round:Number.isInteger(i)&&i>0?i:null,def:t.get(`def`)||null,kind:t.get(`kind`)??``,stop:t.get(`stop`)??``,q:t.get(`q`)??``,layer:t.get(`layer`)??``,unit:t.get(`unit`)??``,sel:t.get(`sel`)??``,days:c?0:nr.includes(l)?l:rr.days,from:c?o:``,to:c?s:``,tz:t.get(`tz`)??``,group:t.get(`group`)??``,trendsTab:a===`trends`?t.get(`tab`)??``:``}}function sr(e){if(e.page===`hosts`)return`?page=hosts`;if(e.page===`trends`){let t=new URLSearchParams({page:`trends`});return e.days===0&&e.from&&e.to?(t.set(`from`,e.from),t.set(`to`,e.to)):e.days!==rr.days&&t.set(`days`,String(e.days)),e.tz&&t.set(`tz`,e.tz),e.group&&t.set(`group`,e.group),e.trendsTab&&t.set(`tab`,e.trendsTab),`?${t.toString()}`}let t=new URLSearchParams;e.run&&t.set(`run`,e.run),e.tab!==`overview`&&t.set(`tab`,e.tab),e.tab===`stream`&&(e.key&&t.set(`key`,e.key),e.view!==`transcript`&&t.set(`view`,e.view),e.round!=null&&t.set(`round`,String(e.round))),e.tab===`definitions`&&e.def&&t.set(`def`,e.def),e.tab===`overview`&&e.layer&&t.set(`layer`,e.layer),e.tab===`overview`&&e.unit&&t.set(`unit`,e.unit),e.tab===`overview`&&e.sel&&t.set(`sel`,e.sel);let n=e.tab===`tasks`||e.tab===`journal`;n&&e.kind&&t.set(`kind`,e.kind),e.tab===`journal`&&e.stop&&t.set(`stop`,e.stop),n&&e.q&&t.set(`q`,e.q);let r=t.toString();return r?`?${r}`:``}function cr(e,t){let n={...e,...t};return t.run!==void 0&&t.run!==e.run&&Object.assign(n,{key:null,def:null,round:null,layer:``,unit:``,sel:``,...t}),t.layer!==void 0&&t.layer!==e.layer&&t.sel===void 0&&(n.sel=``),t.key!==void 0&&t.key!==e.key&&(t.view===void 0&&(n.view=`transcript`),t.round===void 0&&(n.round=null)),n}function lr(e,t){let n=e=>sr({...e,kind:``,stop:``,q:``,unit:``,sel:``});return n(e)!==n(t)}var ur=class{constructor(e,t,n,r=()=>{}){this.mode=e,this.onChange=t,this.onLeave=r,this.onPop=()=>{this.current=or(location.search),this.onChange(this.current,`pop`)};let i=or(e===`url`?location.search:``);this.current=cr(i,n??{})}get viewRoute(){return this.current}start(){this.mode===`url`&&(history.scrollRestoration=`manual`,addEventListener(`popstate`,this.onPop)),this.onChange(this.current,`init`)}stop(){this.mode===`url`&&removeEventListener(`popstate`,this.onPop)}navigate(e,t={}){let n=cr(this.current,e);if(sr(n)===sr(this.current))return;let r=!t.replace&&lr(this.current,n);if(this.current=n,this.mode===`url`){let e=`${location.pathname}${sr(n)}${location.hash}`;r?(this.onLeave(),history.pushState({},``,e)):history.replaceState(history.state,``,e)}this.onChange(n,r?`push`:`replace`)}},dr=class{constructor(e,t){this.host=e,this.opts=t,this.ready=Promise.resolve(),e.addController(this)}hostConnected(){let e=this.opts.locale();this.ready=jn(Nn(e)?e:Pn()).catch(()=>{})}hostUpdated(){let e=this.opts.locale();e!==this.seen&&(this.seen=e,Nn(e)&&e!==I()&&jn(e)),this.opts.pageWide()&&(document.documentElement.lang=I()),this.host.lang=I()}},fr=class{constructor(e,t,n){this.host=e,this.onKey=t,this.scope=n,this.bound=null,this.boundScope=`off`,this.listener=e=>{let t=e;t.defaultPrevented||function(e){let t=e.composedPath()[0];return t instanceof HTMLElement&&(t.isContentEditable||t.matches(`input, select, textarea, [contenteditable]:not([contenteditable="false"])`))}(t)||t.metaKey||t.ctrlKey||t.altKey||this.onKey(t)},e.addController(this)}hostConnected(){this.bind()}hostUpdated(){this.scope()!==this.boundScope&&this.bind()}hostDisconnected(){this.unbind()}bind(){this.unbind();let e=this.scope();this.boundScope=e,this.bound=e===`page`?document:e===`element`?this.host:null,this.bound?.addEventListener(`keydown`,this.listener)}unbind(){this.bound?.removeEventListener(`keydown`,this.listener),this.bound=null,this.boundScope=`off`}},pr=[{name:`backdrop`,prop:`--ca-backdrop`},{name:`bg`,prop:`--ca-bg`},{name:`card`,prop:`--ca-card`},{name:`panel`,prop:`--ca-panel`},{name:`panel2`,prop:`--ca-panel2`},{name:`raise`,prop:`--ca-raise`},{name:`well`,prop:`--ca-well`},{name:`track`,prop:`--ca-track`},{name:`line`,prop:`--ca-line`},{name:`line2`,prop:`--ca-line2`},{name:`shadow`,prop:`--ca-shadow`},{name:`text`,prop:`--ca-text`},{name:`text-2`,prop:`--ca-text-secondary`},{name:`text-muted`,prop:`--ca-text-muted`},{name:`accent`,prop:`--ca-accent`},{name:`accent-bg`,prop:`--ca-accent-bg`,derive:`color-mix(in srgb, var(--accent) calc(var(--tint) + 1%), transparent)`},{name:`focus`,prop:`--ca-focus`},{name:`focus-width`,prop:`--ca-focus-width`},{name:`selection`,prop:`--ca-selection`},{name:`status-failed`,prop:`--ca-status-failed`},{name:`status-failed-bg`,prop:`--ca-status-failed-bg`,derive:`color-mix(in srgb, var(--status-failed) var(--tint), transparent)`},{name:`status-attention`,prop:`--ca-status-attention`},{name:`status-attention-bg`,prop:`--ca-status-attention-bg`,derive:`color-mix(in srgb, var(--status-attention) var(--tint), transparent)`},{name:`status-done`,prop:`--ca-status-done`},{name:`status-done-bg`,prop:`--ca-status-done-bg`,derive:`color-mix(in srgb, var(--status-done) var(--tint), transparent)`},{name:`status-running`,prop:`--ca-status-running`},{name:`status-running-bg`,prop:`--ca-status-running-bg`,derive:`color-mix(in srgb, var(--status-running) var(--tint), transparent)`},{name:`status-muted`,prop:`--ca-status-muted`},{name:`status-muted-bg`,prop:`--ca-status-muted-bg`,derive:`color-mix(in srgb, var(--status-muted) calc(var(--tint) - 1%), transparent)`},{name:`tint`,prop:`--ca-tint`},{name:`agent`,prop:`--ca-agent`},{name:`agent-bg`,prop:`--ca-agent-bg`,derive:`color-mix(in srgb, var(--agent) calc(var(--tint) + 2%), transparent)`},{name:`meter`,prop:`--ca-meter`},{name:`tok-input`,prop:`--ca-tok-input`},{name:`tok-cache-read`,prop:`--ca-tok-cache-read`},{name:`tok-cache-write`,prop:`--ca-tok-cache-write`},{name:`tok-output`,prop:`--ca-tok-output`},{name:`series-1`,prop:`--ca-series-1`},{name:`series-2`,prop:`--ca-series-2`},{name:`series-3`,prop:`--ca-series-3`},{name:`series-4`,prop:`--ca-series-4`},{name:`series-5`,prop:`--ca-series-5`},{name:`series-6`,prop:`--ca-series-6`},{name:`code-keyword`,prop:`--ca-code-keyword`},{name:`code-string`,prop:`--ca-code-string`},{name:`code-number`,prop:`--ca-code-number`},{name:`code-constant`,prop:`--ca-code-constant`},{name:`code-comment`,prop:`--ca-code-comment`},{name:`code-function`,prop:`--ca-code-function`},{name:`code-type`,prop:`--ca-code-type`},{name:`code-name`,prop:`--ca-code-name`},{name:`font-size-xs`,prop:`--ca-font-size-xs`,derive:`10px`},{name:`font-size-sm`,prop:`--ca-font-size-sm`,derive:`11px`},{name:`font-size-md`,prop:`--ca-font-size-md`,derive:`12px`},{name:`font-size-lg`,prop:`--ca-font-size-lg`,derive:`13px`},{name:`font-size-xl`,prop:`--ca-font-size-xl`,derive:`15px`},{name:`font-size-2xl`,prop:`--ca-font-size-2xl`,derive:`28px`},{name:`radius-sm`,prop:`--ca-radius-sm`,derive:`4px`},{name:`radius-md`,prop:`--ca-radius-md`,derive:`8px`},{name:`radius-lg`,prop:`--ca-radius-lg`,derive:`12px`},{name:`radius-pill`,prop:`--ca-radius-pill`,derive:`999px`}],mr=[`contraagent-dark`,`contraagent-light`,`github-dark`,`github-light`,`one-dark`,`nord`,`high-contrast`],hr=[`contraagent-dark`,`contraagent-light`,`system`,`github-dark`,`github-light`,`one-dark`,`nord`,`high-contrast`],gr=[`github-dark`,`github-light`,`one-dark`,`nord`,`high-contrast`],_r=`contraagent-dark`,vr={"contraagent-dark":{label:`contraagent Dark`,scheme:`dark`,tokens:{backdrop:`radial-gradient(1100px 520px at 8% -12%, #10203a 0%, transparent 62%), radial-gradient(900px 480px at 108% 4%, #1b1238 0%, transparent 58%), #060a11`,bg:`#060a11`,card:`#0f1724`,panel:`#0f1724`,panel2:`#142034`,raise:`#1a2740`,well:`#0a111c`,track:`#1b273b`,line:`#1d2940`,line2:`#2b3c58`,shadow:`#060a11`,text:`#e7edf5`,"text-2":`#bcc7d6`,"text-muted":`#909db2`,accent:`#7aa2ff`,focus:`#7aa2ff`,"focus-width":`2px`,selection:`#7aa2ff4d`,"status-failed":`#f87171`,"status-attention":`#fbbf24`,"status-done":`#34d399`,"status-running":`#22d3ee`,"status-muted":`#94a3b8`,tint:`13%`,agent:`#b597fb`,meter:`#7d8ba3`,"tok-input":`#7c86f5`,"tok-cache-read":`#3f4d63`,"tok-cache-write":`#8796ad`,"tok-output":`#d6b8ff`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#c4a5ff`,"code-string":`#7ee2a8`,"code-number":`#f5c26b`,"code-constant":`#ff9e64`,"code-comment":`#74839a`,"code-function":`#7dd3fc`,"code-type":`#ffd479`,"code-name":`#79b8ff`}},"contraagent-light":{label:`contraagent Light`,scheme:`light`,tokens:{backdrop:`radial-gradient(1100px 520px at 8% -12%, #dde7fb 0%, transparent 62%), radial-gradient(900px 480px at 108% 4%, #ebe3fa 0%, transparent 58%), #eef2f8`,bg:`#eef2f8`,card:`#ffffff`,panel:`#ffffff`,panel2:`#f7f9fc`,raise:`#e6ecf5`,well:`#f3f6fa`,track:`#e1e7f0`,line:`#d6dde8`,line2:`#b6c2d3`,shadow:`#0f172438`,text:`#0f1724`,"text-2":`#34415a`,"text-muted":`#556279`,accent:`#2f58d4`,focus:`#2f58d4`,"focus-width":`2px`,selection:`#2f58d42e`,"status-failed":`#b8132d`,"status-attention":`#6c4801`,"status-done":`#026b49`,"status-running":`#01525f`,"status-muted":`#56637a`,tint:`11%`,agent:`#6f45c0`,meter:`#8a97ab`,"tok-input":`#4d4cc8`,"tok-cache-read":`#cdd6e3`,"tok-cache-write":`#7d8aa0`,"tok-output":`#a07ad9`,"series-1":`#2a78d6`,"series-2":`#eb6834`,"series-3":`#1baf7a`,"series-4":`#eda100`,"series-5":`#e87ba4`,"series-6":`#008300`,"code-keyword":`#6f49a8`,"code-string":`#076b40`,"code-number":`#7b5605`,"code-constant":`#964605`,"code-comment":`#5d6b80`,"code-function":`#086586`,"code-type":`#785902`,"code-name":`#095ea8`}},"github-dark":{label:`GitHub Dark`,scheme:`dark`,tokens:{backdrop:`#010409`,bg:`#010409`,card:`#0d1117`,panel:`#0d1117`,panel2:`#151b23`,raise:`#212830`,well:`#010409`,track:`#262c36`,line:`#262c36`,line2:`#3d444d`,shadow:`#010409`,text:`#f0f6fc`,"text-2":`#d1d7e0`,"text-muted":`#9299a2`,accent:`#4796fb`,focus:`#1f6feb`,"focus-width":`2px`,selection:`#388bfd4d`,"status-failed":`#fc554d`,"status-attention":`#d29922`,"status-done":`#3fb950`,"status-running":`#39c5cf`,"status-muted":`#9198a1`,tint:`15%`,agent:`#ab7df8`,meter:`#656c76`,"tok-input":`#58a6ff`,"tok-cache-read":`#2f3742`,"tok-cache-write":`#656c76`,"tok-output":`#d2a8ff`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#ff7b72`,"code-string":`#a5d6ff`,"code-number":`#79c0ff`,"code-constant":`#79c0ff`,"code-comment":`#9198a1`,"code-function":`#d2a8ff`,"code-type":`#ffa657`,"code-name":`#7ee787`}},"github-light":{label:`GitHub Light`,scheme:`light`,tokens:{backdrop:`#f6f8fa`,bg:`#f6f8fa`,card:`#ffffff`,panel:`#ffffff`,panel2:`#ffffff`,raise:`#eff2f5`,well:`#f6f8fa`,track:`#e6eaef`,line:`#d1d9e0`,line2:`#b7c0ca`,shadow:`#1f232833`,text:`#1f2328`,"text-2":`#393f46`,"text-muted":`#59636e`,accent:`#0165d6`,focus:`#0165d6`,"focus-width":`2px`,selection:`#0969da33`,"status-failed":`#cd1e2b`,"status-attention":`#916103`,"status-done":`#147b33`,"status-running":`#10767d`,"status-muted":`#59636e`,tint:`8%`,agent:`#804ddc`,meter:`#818b98`,"tok-input":`#54aeff`,"tok-cache-read":`#d1d9e0`,"tok-cache-write":`#818b98`,"tok-output":`#a475f9`,"series-1":`#2a78d6`,"series-2":`#eb6834`,"series-3":`#1baf7a`,"series-4":`#eda100`,"series-5":`#e87ba4`,"series-6":`#008300`,"code-keyword":`#cf222e`,"code-string":`#0a3069`,"code-number":`#0550ae`,"code-constant":`#0550ae`,"code-comment":`#59636e`,"code-function":`#6639ba`,"code-type":`#953800`,"code-name":`#116329`}},"one-dark":{label:`One Dark`,scheme:`dark`,tokens:{backdrop:`#21252b`,bg:`#21252b`,card:`#282c34`,panel:`#282c34`,panel2:`#2c313a`,raise:`#2c313a`,well:`#21252b`,track:`#3a3f4b`,line:`#181a1f`,line2:`#4b5263`,shadow:`#0e1013`,text:`#d7dae0`,"text-2":`#abb2bf`,"text-muted":`#a7afbe`,accent:`#64b2f2`,focus:`#528bff`,"focus-width":`2px`,selection:`#3e4451`,"status-failed":`#fc858d`,"status-attention":`#e5c07b`,"status-done":`#98c379`,"status-running":`#57b7c3`,"status-muted":`#a7afbe`,tint:`12%`,agent:`#d788ee`,meter:`#5c6370`,"tok-input":`#61afef`,"tok-cache-read":`#3e4451`,"tok-cache-write":`#5c6370`,"tok-output":`#c678dd`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#c678dd`,"code-string":`#98c379`,"code-number":`#d19a66`,"code-constant":`#d19a66`,"code-comment":`#8f949e`,"code-function":`#61afef`,"code-type":`#e5c07b`,"code-name":`#e36e77`}},nord:{label:`Nord`,scheme:`dark`,tokens:{backdrop:`#2e3440`,bg:`#242933`,card:`#2e3440`,panel:`#2e3440`,panel2:`#323946`,raise:`#3b4252`,well:`#272c36`,track:`#3b4252`,line:`#3b4252`,line2:`#4c566a`,shadow:`#1d2129`,text:`#eceff4`,"text-2":`#d8dee9`,"text-muted":`#adbcd9`,accent:`#9dbedf`,focus:`#88c0d0`,"focus-width":`2px`,selection:`#4c566a`,"status-failed":`#fe9aa1`,"status-attention":`#ebcb8b`,"status-done":`#a5c18e`,"status-running":`#89c1d1`,"status-muted":`#adbcd9`,tint:`13%`,agent:`#d0a9c9`,meter:`#7b88a1`,"tok-input":`#5e81ac`,"tok-cache-read":`#4c566a`,"tok-cache-write":`#7b88a1`,"tok-output":`#b48ead`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#81a1c1`,"code-string":`#a3be8c`,"code-number":`#b790b0`,"code-constant":`#d38972`,"code-comment":`#8f9db8`,"code-function":`#88c0d0`,"code-type":`#8fbcbb`,"code-name":`#8fbcbb`}},"high-contrast":{label:`High contrast`,scheme:`dark`,tokens:{backdrop:`#010409`,bg:`#010409`,card:`#0a0c10`,panel:`#0a0c10`,panel2:`#0a0c10`,raise:`#1c2128`,well:`#010409`,track:`#272b33`,line:`#7a828e`,line2:`#9ea7b3`,shadow:`#000000`,text:`#ffffff`,"text-2":`#f0f3f6`,"text-muted":`#bdc4cc`,accent:`#7abbfe`,focus:`#7abbfe`,"focus-width":`3px`,selection:`#409eff66`,"status-failed":`#ffacb8`,"status-attention":`#fad209`,"status-done":`#0ef38e`,"status-running":`#62ceff`,"status-muted":`#bdc4cc`,tint:`12%`,agent:`#c299fe`,meter:`#9ea7b3`,"tok-input":`#409eff`,"tok-cache-read":`#525964`,"tok-cache-write":`#9ea7b3`,"tok-output":`#dbb7ff`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#ff9492`,"code-string":`#addcff`,"code-number":`#91cbff`,"code-constant":`#91cbff`,"code-comment":`#bdc4cc`,"code-function":`#dbb7ff`,"code-type":`#ffb757`,"code-name":`#72f088`}}},yr=Object.fromEntries(pr.map(e=>[e.name,e.prop])),br=e=>`:where([data-ca-theme="${e}"])`;function xr(e=br){return mr.map(t=>{let n=vr[t],r=Object.entries(n.tokens).map(([e,t])=>`${yr[e]}: ${t};`);return`${e(t)} { color-scheme: ${n.scheme}; --ca-color-scheme: ${n.scheme}; ${r.join(` `)} }`}).join(`
|
|
5
|
+
\f\r]`,Gt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Kt=/-->/g,qt=/>/g,Jt=RegExp(`>|${Wt}(?:([^\\s"'>=/]+)(${Wt}*=${Wt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),Yt=/'/g,Xt=/"/g,Zt=/^(?:script|style|textarea|title)$/i,Qt=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),k=Qt(1),A=Qt(2),$t=Symbol.for(`lit-noChange`),j=Symbol.for(`lit-nothing`),en=new WeakMap,tn=zt.createTreeWalker(zt,129);function nn(e,t){if(!Ht(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return Pt===void 0?t:Pt.createHTML(t)}var rn=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=Gt;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===Gt?c[1]===`!--`?o=Kt:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=Jt):(Zt.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=Jt):o=qt:o===Jt?c[0]===`>`?(o=i??Gt,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?Jt:c[3]===`"`?Xt:Yt):o===Xt||o===Yt?o=Jt:o===Kt||o===qt?o=Gt:(o=Jt,i=void 0);let d=o===Jt&&e[t+1].startsWith(`/>`)?` `:``;a+=o===Gt?n+Rt:l>=0?(r.push(s),n.slice(0,l)+Ft+n.slice(l)+It+d):n+It+(l===-2?t:d)}return[nn(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},an=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=rn(t,n);if(this.el=e.createElement(l,r),tn.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=tn.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(Ft)){let t=u[o++],n=i.getAttribute(e).split(It),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?un:r[1]===`?`?dn:r[1]===`@`?fn:ln}),i.removeAttribute(e)}else e.startsWith(It)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Zt.test(i.tagName)){let e=i.textContent.split(It),t=e.length-1;if(t>0){i.textContent=Nt?Nt.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],Bt()),tn.nextNode(),c.push({type:2,index:++a});i.append(e[t],Bt())}}}else if(i.nodeType===8){if(i.data===Lt)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(It,e+1))!==-1;)c.push({type:7,index:a}),e+=It.length-1}}a++}}static createElement(e,t){let n=zt.createElement(`template`);return n.innerHTML=e,n}};function on(e,t,n=e,r){if(t===$t)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=Vt(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=on(e,i._$AS(e,t.values),i,r)),t}var sn=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??zt).importNode(t,!0);tn.currentNode=r;let i=tn.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new cn(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new pn(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=tn.nextNode(),a++)}return tn.currentNode=zt,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},cn=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=on(this,e,t),Vt(e)?e===j||e==null||e===``?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==$t&&this._(e):e._$litType$===void 0?e.nodeType===void 0?Ut(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==j&&Vt(this._$AH)?this._$AA.nextSibling.data=e:this.T(zt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=an.createElement(nn(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new sn(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=en.get(e.strings);return t===void 0&&en.set(e.strings,t=new an(e)),t}k(t){Ht(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(Bt()),this.O(Bt()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=Mt(e).nextSibling;Mt(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ln=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=j,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=j}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=on(this,e,t,0),a=!Vt(e)||e!==this._$AH&&e!==$t,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=on(this,r[n+o],t,o),s===$t&&(s=this._$AH[o]),a||=!Vt(s)||s!==this._$AH[o],s===j?e=j:e!==j&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},un=class extends ln{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}},dn=class extends ln{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==j)}},fn=class extends ln{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=on(this,e,t,0)??j)===$t)return;let n=this._$AH,r=e===j&&n!==j||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==j&&(n===j||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},pn=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){on(this,e)}},mn={M:Ft,P:It,A:Lt,C:1,L:rn,R:sn,D:Ut,V:on,I:cn,H:ln,N:dn,U:fn,B:un,F:pn},hn=jt.litHtmlPolyfillSupport;hn?.(an,cn),(jt.litHtmlVersions??=[]).push(`3.3.3`);var gn=globalThis,M=class extends At{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new cn(t.insertBefore(Bt(),e),e,void 0,n??{})}return i._$AI(e),i})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return $t}};M._$litElement$=!0,M.finalized=!0,gn.litElementHydrateSupport?.({LitElement:M});var _n=gn.litElementPolyfillSupport;_n?.({LitElement:M}),(gn.litElementVersions??=[]).push(`4.2.2`);var N=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},vn={attribute:!0,type:String,converter:Dt,reflect:!1,hasChanged:Ot},yn=(e=vn,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function P(e){return(t,n)=>typeof n==`object`?yn(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function F(e){return P({...e,state:!0,attribute:!1})}var bn=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function xn(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return bn(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return bn(n,r,{get(){return a(this)}})}}var Sn,Cn=t({templates:()=>wn}),wn=function(e){let t=new Map;return new Proxy(e,{get(e,n){if(typeof n==`string`){if(!t.has(n)){let r;for(let t=1;t<=n.length&&r===void 0;t++){let i=n.slice(0,t);Object.hasOwn(e,i)&&(r=e[i])}t.set(n,r)}return t.get(n)}}})}({c:`実行`,d:`出力`,h0:k`JSON Lines(1 行ごとに JSON オブジェクト、スキーマ ${0})`,h5:k`${0} の出力`,h6:k`JSON オブジェクト(スキーマ ${0})`,h87:k`依存先タスク ${0}`,h8e:k`この実行には階層 <code>${0}</code> がありません`,ha:k`ファイルなし | Python コードで定義(<code>TaskAdapter</code>)`,hc:k`実行中 ${0}${1}`,hf:k`${0} の出力から`,"no-":`実行はまだありません`,non:`なし`,"outcome-d":`完了`,"outcome-p":`一部のみ完了`,s000:`実行履歴の未実行のタスク`,s00c:T`HTTP ステータス ${0}`,s02f7:`実行されず`,s02f9:T`アカウント: ${0}`,s030:T`カスタムビュー ${0} はありません`,s037:`完了`,s0382:T`${0}: ${1}`,s038b:`ページ`,s03b:`タブ`,s03e:`タスク`,s03f:T`古い試行 ${0} 件は非表示`,s041:T`ほか ${0} 件`,s042:`タスクが宣言したパターンの下で、試行が作成・変更・削除したファイル(changes)`,s044:T`一部のみ完了 ${0} 件`,s04f:`停止した部分`,s051:`実行中のエージェントのセッション`,s055:`選択中の項目`,s05f:`認証エラー`,s061:`OutputContract`,s062:`トランスクリプト`,s0668:`ユニットごとのステージとステップ(CursorStore)`,s066d:`出力`,s06a5:`Esc: 1 つ上の階層`,s06ac:`依存先`,s06b0:`実行中ではありません`,s06bf:`中を表示`,s077:`テキストフィルター(/)`,s079:T`キャッシュ ${0}`,s07d:`関数`,s07e:T`+${0}`,s087:T`${0}%`,s08b1:T`${0}(認証情報が休止中)`,s08b3:`いいえ`,s08c:`稼働中`,s08f:T`依存先: ${0}`,s0932:`出力の検証: OK`,s0935:`終了日`,s094:`最初のエージェントのセッションの前に終了`,s09b:`プロンプトなし`,s0b0:T`作成元: ${0}`,s0b2:`エージェントのセッション開始時のサブスクリプション利用率(アカウント全体)`,s0b3:`OK`,s0b7:`実行前からあるファイル`,s0bf:T`${0} 周目`,s0c:T`モデル切り替えのあったタスク ${0} 件`,s0d7:T`キャッシュ書き込み ${0}`,s0df:`依存先タスクが登録されなかった`,s0e6:`問題`,s0ea:`プラグインディレクトリ`,s0ef:`すべてのホスト`,s0f0:`一部省略`,s0f1:`リセット済み`,s0f2:T`最初の API 呼び出しの入力: ${0}`,s0f8:T`出力ファイル ${0} 件`,s103:`再開カーソル`,s104:`昇順に並べ替え`,s107:`種別の最初のタスクの開始時に記録(definitions/<kind>.json)`,s108:T`${0} の実装`,s114:T`${0} 型の JSON 値`,s115:`過去 24 時間`,s123:`待機中`,s125:T`要素 ${0} 個`,s12c:`型の不一致`,s13:T`最終報告 ${0}`,s14:`コーディングエージェントが報告した値`,s150:`出力`,s156:`なし(任意)`,s158:T`週の利用率 ${0}`,s159:`このタスクが代わりに出力ファイルを書く種別(output_of)`,s163:`検証対象のファイルなし`,s165:T`${0} 回目で完了 | 失敗 1 回`,s168:`検証のタイミング`,s170:T`実行されず ${0} 件`,s179:`アカウントごと、最初の値 → 最後の値`,s17d:`利用率のルール`,s17e:`書き込み待ち(タスクが待機中)`,s18:T`ループ内の ${0}`,s197:`利用できるモデルなし`,s19e:`上限: max_concurrent`,s1a2:T`スキップ ${0} 件`,s1a3:`種別 · ユニット`,s1a4:`モデルごとの、エージェントのセッションの使用量。モデル切り替えの前後は別々に集計(Plan.models)`,s1ac8:`エディタのテーマ`,s1acc:`書き込まれていない出力 1 件(タスクが未実行)`,s1b2:T`種別 ${0}`,s1bb:`すべてのタスクが開始済み`,s1bf:`実行中のプロセスなし`,s1c0:`パラメータ`,s1c2:`タスクが選択されていません`,s1c4:T`セッション開始時の利用率(アカウント全体): ${0}`,s1c7:`実行に登録されたすべてのタスク(種別ごと、plan.jsonl)`,s1cc:`実行中の Python タスク`,s1db:`API エラー`,s1dc:T`試行 ${0} 回`,s1dd:`実行中のタスクなし`,s1e9:T`プロンプト(${0} 文字、ほか ${1} 文字は未保存)`,s1eb:`入力`,s1f2:`削除`,s1f5:T`所要時間 ${0}`,s204:`安全分類器による停止`,s20e:T`リセットまで ${0}`,s20f9:`依存先タスクが実行されなかった`,s20fd:`ホストなし`,s217:`あり`,s21a:`発生したらリトライする例外(retry_on)`,s221:`JSON ではありません`,s224:`ツール実行中に中止`,s230:`スキーマにないフィールド`,s234:`終了した試行はまだありません`,s236:`拡大`,s23b:T`${0} 回の試行がすべて失敗: ${1}`,s23f:`定義はまだありません`,s24:T`完了 ${0}`,s25:`OutputContract・InputContract を宣言したタスクはありません`,s260:`API 呼び出し 1 回`,s26ba:`ユニットなし`,s26bb:`実行した試行の回数(リトライを含む、journal.jsonl)`,s26e:T`API 呼び出し ${0} 回`,s27a:`最後のメッセージから`,s27b:T`ユニット: ${0}`,s27d:`フローの構成`,s28a2:`リプレイ`,s28ad:`曜日と時刻ごと(期間のタイムゾーン)`,s28f:`InputContract`,s29:T`最大コンテキスト: ${0}`,s2a:`現在`,s2c8:`リトライ`,s2cd:`モデルの利用可否`,s2dd:`試行の結果(stop)`,s2df:`割合`,s2e3:T`ほかの出力 ${0} 件`,s2e4:`周`,s2f34:T`${0} 周`,s2f3c:`問題なし`,s2f4:`すべての出力`,s2f5:`定義なし`,s2fa:T`5 時間枠の利用率 ${0}(リセット ${1})`,s2fe3:`ツール`,s2fea:T`修正依頼 ${0}`,s31:`終了(未実行のタスク 1 件)`,s321:`余分なフィールド`,s326:T`キャッシュ読み込み ${0}`,s32d:`最大コンテキスト`,s33:`パイプラインの階層`,s343:`新しいイベント 1 件を表示`,s34b:`終了`,s34e:`降順に並べ替え`,s351:`終了した試行なし`,s352:`ファイル全体`,s355:`入力ファイルに検証エラー`,s366:`週`,s367:`料金`,s368:`コピー`,s36d:T`この書き出しに含まれないもの: ${0}`,s36e:T`所要時間 ${0}`,s3700:`Web 検索 1 回`,s370b:T`報告時刻 ${0}`,s378:`検証エラーの後に、同じエージェントのセッションで続けるラウンド(rounds)`,s37d:`スキーマ以外の検証(validators)`,s384:T`${0} を展開`,s387:T`検索結果 ${0} 件`,s38e65:`修正依頼のプロンプトに含めて送信`,s38e6a:`日ごとの料金`,s390:`JSON オブジェクトではありません`,s39e:`パイプライン`,s3a7:T`上限: ${0}`,s3aa:`出力ファイルなし`,s3b3:`プロセスツリー`,s3b9:T`${0} にモニター API がありません: ${1}`,s3bd:T`task_detail コールバックが失敗: ${0}`,s3c6:`実行した試行の回数`,s3cd:`実行中のエージェントのセッション 1 件`,s3d0:`エージェントのセッション`,s3d1:`概要`,s3d31:`利用できるモデルがなく、設定どおりのモデルで実行する種別(kept)`,s3d38:T`認証情報 ${0}`,s3d99:`検証エラー後の、同じエージェントのセッション`,s3d9b:`テキストファイル`,s3dd:`ネットワークエラーで応答なし`,s3f1:`各タスクが書き込むファイル`,s3f7:`修正依頼`,s3fd:`開始`,s407:T`${0}: 入力`,s408:`週の利用率`,s41:`Tab: 次のノード`,s42a:`フィールド`,s42c:`検証`,s438:`ハイライトを解除`,s43a:`入力ファイル`,s43e:`利用不可`,s451:`料金の高いタスク`,s454:T`${0} のループの各周`,s45d:T`${0}(カスタムビュー)`,s466:`モデル切り替えのあったタスク 1 件`,s467:T`1 周: ${0}`,s473:`キャッシュ読み込み`,s478:`検証対象のファイル(OutputContract、InputContract)`,s479:`締め切り`,s47a:T`このタスクの入力 ${0} 件`,s47b:`Python タスク`,s47c:`未対応のイベント`,s482:T`終了 ${0}`,s484:`テキストなし`,s48e:`所要時間`,s490:`モニターのサーバーに接続済み`,s491:T`${0} のループ`,s4a:T`${0} 日前`,s4d6:`検索結果 1 件`,s4d8:`モデル切り替え`,s4e7:T`修正依頼 ${0} 回で完了 | 最初の検証エラー: ${1}`,s4ef:`ループ`,s4f0a:`スキーマにない`,s4f0b:T`再開後に再実行: ${0}`,s4f9:T`ホスト ${0}`,s4fe:`エージェントタスク`,s501:T`${0}: ${1} → ${2}`,s504:`日付指定`,s5131:`そのモデルで始めたエージェントのセッションの数`,s5138:`入力・出力・キャッシュ読み込み・キャッシュ書き込みの合計`,s514:`実行が終了した`,s521:`1 ユニット`,s522:`安全分類器がエージェントのセッションの一部を止め、セッションはそのまま続いた(safety_stops)`,s525b:`失敗の後の、次のモデルでの新しいエージェントのセッション(Router のホップ)`,s525c:`記録から再生した試行(replayed)`,s529:T`上限 ${0}`,s52b:`このバージョンの contraagent が対応していないイベント種別(unread_events)`,s52c7:`次の周`,s52cc:T`${0} の締め切りと仕上げの猶予を過ぎた`,s52cf:`カスタムビュー`,s535:`種別`,s53c5:T`${0}: 未実行`,s53c8:`不可`,s541:`開始できず`,s543:`プロンプト`,s552:T`フロー呼び出し ${0}`,s555:`プラグインディレクトリ`,s558:`認証情報の不一致`,s5590:`項目`,s559f:`その他のモデル`,s55f:T`${0}(${1})`,s566:T`(ほか ${0} 文字は未保存)`,s567:`未実行(依存先タスクが失敗)`,s568:T`後続タスク: ${0}`,s571:T`入力 ${0} がありません(${1} が未実行)`,s574:T`キャッシュ書き込み ${0}`,s585:T`入力 ${0} がありません(${1} が失敗)`,s587:T`${0} 以降報告なし`,s58b:`モデルの置き換え`,s58c:`実行履歴`,s591:`5 時間枠`,s594:T`修正依頼 ${0} 回`,s59e:`上限に接近`,s5a3:`休止中`,s5a7:`ツール`,s5ab:`並び順`,s5b9:`種別ごとのトークンと料金`,s5bd:`フロー呼び出しごとの締め切り(time_box)`,s5c7:`サービスなし`,s5cd:T`エージェントのセッション ${0} 回`,s5cf:`値なし`,s5d0:`実行中にこのタスクが占有する名前(claims)`,s5d4:T`${0} 回目で完了 | 失敗 ${1} 回`,s5da:`モデル`,s5de:`依存先タスク`,s5e3:`書き込みなし(タスクが未実行)`,s5e6:`テキスト(JSON 文字列)`,s5f2:`ロールなし`,s5f31:`エージェント・モデル・認証情報`,s5f34:`エラー`,s5f40:`行なし`,s5f43:`ソース`,s5f7:`なし(必須)`,s5f8:T`認証情報 ${0} は休止中`,s5ff:`エージェントタスク`,s601:`実行中`,s605:T`未実行の後続タスク ${0} 件`,s620:`キャッシュ書き込み`,s629:`任意`,s647:`応答が JSON ではなく HTML`,s649:`後続タスク`,s64f:`変更禁止の箇所`,s652:T`ロック ${0} 件`,s653:`締め切りを過ぎた`,s65c:`中断`,s6645:`拡大(Ctrl + スクロール)`,s6647:`ファイルなし`,s664b:`ツール呼び出しが戻る前に実行が終了`,s670:T`${0} ユニット`,s673:`停止でエラー`,s680:`タイムライン`,s685:`修正依頼`,s688:`その他の検証`,s68d:T`仕上げの猶予 ${0}`,s695:`修正依頼 1 回`,s699:T`スキーマ ${0}`,s6a0:`1 ステップ完了`,s6a8:T`入力 ${0} がありません(${1} が未完了)`,s6aa:`未実行(入力ファイルなし)`,s6b0:`ホスト`,s6b8:T`同時実行 ${0}/${1}`,s6b9:`タスクなし`,s6c3:`依存先タスクなし`,s6c7:`実行の開始時刻`,s6c8:T`依存先タスク ${0} が失敗`,s6d7:T`${1} タスク中 ${0} 件完了`,s6db:T`${0} 文字`,s6e4:`未選択`,s6eb:`読み込み中…`,s6f1:`API 呼び出し`,s6f2:`出力ファイル 1 件`,s6fa:`フロー呼び出しがエラーで終了`,s700:`書き出しに含まれない`,s703:T`${0} まで休止`,s706:`実行グループ`,s70a7:T`タスク終了後の利用率: ${0}`,s70af:`種別`,s71:T`モデル切り替え: ${0}`,s721:`ホストからの報告なし`,s7233:`古い試行 1 件は非表示`,s7239:T`修正依頼のあったタスク ${0} 件`,s72dc:`ユニットごとの周回数`,s72dd:`キャッシュ読み込み`,s734:`スタブエージェント`,s737:`ループの周回数`,s73d:`未実行の後続タスク 1 件`,s755:T`プラグイン ${0}`,s758:`エージェントのセッションなし`,s75e:`実行を検索`,s767:T`${0} モニター`,s76d:`カスタム列(row_extras)`,s76f:`原因`,s771:T`入力 ${0} は失敗したタスク ${1} の出力`,s77e:T`未実行 ${0} 件`,s786:`トランスクリプト`,s78f:`トークン`,s797:`すべての中を隠す`,s79a:T`未対応のイベント: ${0}`,s79f:T`5 時間枠の利用率 ${0}`,s7a1:`エラーで終了したフロー呼び出し 1 件`,s7a3:`出力ファイル`,s7a4:`権限エラー`,s7b16:`入力ファイルなし`,s7b1c:`修正依頼のあった試行`,s7b3:`検索に一致する実行なし`,s7bf:T`最初のエージェントのセッションの前に各モデルへ送る 1 回のリクエスト(preflight, policy ${0})`,s7c0:T`ホストからの報告なし ${0} 件`,s7c9:`フィルター`,s7cd8:`このタスクの入力 1 件`,s7cd9:`利用できるモデルがなく、最初に応答したモデルで実行する種別(substitute)`,s7cf:`応答が JSON ではない`,s7da:`最終報告`,s7df:T`終了(未実行のタスク ${0} 件)`,s7e:T`ロール ${0}`,s7f:`表示形式`,s803:`ファイル`,s807:`実行 1 件`,s80c:`1 行`,s816:`モデル切り替えなし`,s817:`変更したファイル 1 件`,s822:T`以前の試行のモデル: ${0}`,s826:`エージェントのセッションが使ったモデル`,s827:`認証情報が休止中`,s83:T`書き込み ${0}`,s841:`たった今`,s843:T`修正依頼 ${0} 回後`,s84f:`リトライ`,s8512:T`テーマ: ${0}`,s851d:`ファイルの値`,s859:`実行中`,s85e:T`${0}: モデル切り替え`,s863:T`入力 ${0} がありません`,s864:`全体を表示`,s868:T`${2} 年 ${0}〜${1} | ${3}`,s86c:T`ホスト ${0} 台`,s874:T`${0} ステップ完了`,s877:T`${0} 回目の失敗後の、新しいエージェントのセッション`,s87a:`実行されず`,s87b:T`モデル切り替え後に完了: ${0}`,s87c:`修正依頼 1 回後`,s880:`全試行の合計`,s888:`入力`,s88b:`表で表示`,s88e:T`修正依頼 ${0}`,s892:T`入力 ${0}(${1} の出力)がありません`,s89e:`パラメータなし`,s8a56:`なし`,s8a59:T`PID ${0}`,s8ab:`コーディングエージェント`,s8ad:`周回数`,s8ae:T`${0} の記録から再生したエージェントのセッションと、そこに記録した新しいセッション(replay, record_missing)`,s8b1:`リトライしたタスク`,s8b4:`同じロックを持つタスクが共有する常駐の補助プロセス(services.jsonl)`,s8bb:`終了したすべての試行から集計(journal.jsonl)`,s8c:T`${0} 分前`,s8d3:`コーディングエージェントが使ったアカウントまたは API キー(credential)`,s8d4:`PID`,s8dd:T`キャッシュ読み込み ${0}`,s8de:`再開後の実行での、新しいエージェントのセッション`,s8df:`オブジェクト`,s8e3:`アシスタント`,s8e6:`Python コードで定義`,s8e9:T`ほか ${0} アカウント`,s8ea:`Tab: 次の行`,s8f1:`選択を解除`,s8f2:`ユニット`,s8f4:`入力と出力(全試行の合計)`,s8f5:`未実行`,s8fa:`未実行(入力ファイルなし、入力ファイルに検証エラー)`,s8fc:T`修正依頼 1 回で完了 | 最初の検証エラー: ${0}`,s900:`ビュー`,s901:`完了したタスク`,s906:`Python タスク`,s90c:T`コンテキストの上限 ${1} の ${0}%`,s90e:`ほかの種別が実装する種別(base_kind)`,s90f:`認証エラー`,s914:T`最大 ${0} 周`,s915:T`モデル ${0} 種類`,s919:T`${0}d ${1}h`,s924:T`モデル ${0}`,s92a:T`依存先タスク ${0} 件の出力待ち`,s92b:T`5 時間枠 ${0}`,s934:`試行 1 回`,s936:`キュー内で同順位のタスクの順序を決める値(priority)`,s93e:`リプレイ`,s941:T`1 日あたり ${0}`,s949:`書き出しの期間`,s94d:`認証情報`,s94e:T`最終更新 ${0}`,s94f0:`実行中のタスク`,s94fd:T`${0} を折りたたむ`,s967:T`失敗 ${0} 件`,s96a:`コンテキストの上限`,s96c:T`出力 ${0}`,s97:T`修正依頼 ${0} 回で完了`,s980:`テキストフィルター`,s9893d9:T`利用率のルール: ${0}`,s9893de:`ホスト 1 台`,s98b:`グループ`,s98f:`入力ファイルなし`,s99:T`${0} 日間`,s9a2:`すべてのプロセス`,s9a4:T`失敗: ${0}`,s9a6:T`Web 検索 ${0} 回`,s9aa:`API 呼び出し 1 回あたりの入力の最大値。キャッシュ読み込みとキャッシュ書き込みを含む(peak_context)`,s9b1a6:`実行中ではありません`,s9b1a9:T`仕上げの種別: ${0}`,s9b3:`報告間隔`,s9b7:`書き込みなし(タスクが失敗)`,s9bd:T`${0} 回目で完了 | 失敗 ${1} 回 | 最初の失敗: ${2}`,s9c3:T`上限を超えた利用: ${0}`,s9c5:T`${0} の出力`,s9c7:`すべての中を表示`,s9cb:`実装する種別`,s9d3:T`${0} 時点の書き出し`,s9d6:`最終応答なしで終了`,s9de:`モデル`,s9e0:T`状態: ${0}`,s9e8:`未実行(入力ファイルに検証エラー)`,s9f0:T`入力 ${0}`,s9f2:`一部のみ完了`,s9f7:`エラー`,s9f92:T`${0} の内部`,s9f97:`料金の上限`,s9fb:`実行`,s9fd:`タスクの開始前からあるファイルも有効`,s9ff:`モデル切り替え`,sa0:`出力を待つ`,sa1:`リプレイした試行`,sa23:`ターン数の上限`,sa24:T`${0} の締め切りまでに終わらない`,sa31:`行を折り返す`,sa33:`後続タスクなし`,sa358:`ロール`,sa35c:`試行`,sa36:`モデル別の内訳`,sa39:T`実行中のエージェントのセッションの新しいイベント ${0} 件を表示`,sa3c:`形式`,sa3d3:T`週の利用率 ${0}(リセット ${1})`,sa3de:`停止`,sa3e:`アカウント全体の値 | エージェントのセッション開始時に取得`,sa3f:`各タスクが読み込むファイル`,sa43:`作成元`,sa48:`コマンドライン`,sa4f:T`最大 ${0} 回`,sa508:`安全分類器による停止 1 件`,sa50a:`折りたたむ`,sa57:`権限エラーになったツール呼び出し`,sa58:`周回数`,sa62:T`${0}: トランスクリプト`,sa66:T`前の ${0} 行を表示`,sa6a:`開始日`,sa70:`項目なし`,sa71:`期待する型`,sa74:`縮小(Ctrl + スクロール)`,sa81:`システム設定に合わせる`,sa84:T`新しいイベント ${0} 件を表示`,sa86:T`${0} 時間前`,sa87:`ソースを表示`,sa88:T`${0} の入れ子のループ`,sa8b:`Shift + 矢印キー: 依存先タスク・後続タスク`,sa9b:`タスク詳細`,sa9d:`報告なし`,saa0:`書き込み待ち(タスクが実行中)`,saa2:`理由`,saaa:`5 時間枠の利用率`,saab:`テーマ`,sab5:T`${0} 行目`,sabd:`思考`,sac1:`モニターのサーバーに未接続`,sac7:T`${0} に利用できるモデルなし`,saca:`期間内の実行の合計`,sacc:`可`,sad1:T`ほかに休止中の認証情報 ${0} 件`,sad3:`状態`,sad9:`API リクエストを再送`,sae5:`必須`,sae6:`実行履歴のリトライしたタスク`,saee:`プロセス`,saf2:`すべてのモデルが利用可能`,saf8:`変更したファイルなし`,safd:T`${0} 回目が失敗: ${1}`,sb05:`エラー`,sb06:`実行履歴の修正依頼のあった試行`,sb0c:`サブスクリプションの利用率`,sb0f:`Python タスク 1 回`,sb105:T`未実行: ${0}`,sb106:`検索語`,sb108:`作成、試行の失敗後に削除`,sb14:T`報告なし ${0} 台`,sb16:T`${0} 行`,sb1f:`前の 1 行を表示`,sb26a:`登録順`,sb26f:`表示中の階層の外`,sb27:`Enter: 開く`,sb28:`キャッシュ書き込み`,sb31:T`プロンプト(${0} 文字)`,sb34:T`変更したファイル ${0} 件`,sb38:`ツール呼び出し`,sb45:`リトライしたタスク 1 件`,sb4d:`トランスクリプトなし`,sb51:`パイプラインのプロセス内`,sb53:`はい`,sb55:`コーディングエージェントが報告した値`,sb59:T`コンテキストの上限に接近(${0}%)`,sb5a:`未実行`,sb6:`タスク実行中の書き込みが必須`,sb7:T`${0} に停止`,sb8:`エージェントのセッション 1 回`,sb94:T`5 時間枠(${0})`,sb97:`コンテキストの上限に接近`,sb98:T`${0}: 完了`,sb99:`トークンと料金`,sb9c:T`Python タスク: ${0}`,sba3:`1 周`,sba7:`ほかの出力 1 件`,sba8:`検証を通るファイルを書き込む前に、タスクが失敗`,sbaf:`要素 1 個`,sbb0:T`このバージョンの contraagent が対応していないイベント種別(unread_events): ${0}`,sbb2:`開始時の利用率`,sbb7:T`${1} タスク中 ${0} 件が未完了`,sbb9:`終了`,sbc6:T`${0} 周: ${1}`,sbc9:T`以前の試行のモデル: ${0}`,sbca:`タスクの開始時`,sbcc:`依存先タスクが失敗`,sbd4:`実行を切り替え(r)`,sbd5:`停止の記録なし`,sbd9:`再開後`,sbdc:T`履歴にほか ${0} 件`,sbe2:`実行履歴の失敗した試行`,sbe4:T`${0} の記録から再生したエージェントのセッション(replay)`,sbe9:T`週(${0})`,sbea:`保存対象外(keep_transcripts = false)`,sbf18:`種別のロール`,sbf1d:T`ロック ${0}`,sbf2:`アクティビティなし`,sbf9:`スタブエージェントが台本どおりの応答で処理したタスク(stub)`,sc03:`それ以前`,sc07:`リトライ対象の例外`,sc15:`スキップ`,sc1a:T`待機中 ${0} 件`,sc1b:T`リトライしたタスク ${0} 件`,sc2:`ツール`,sc3:`この期間の実行はありません`,sc4:`タイムアウト`,sc53:`休止した認証情報`,sc54:T`${0} の締め切りを過ぎた`,sc57:T`入力 ${0} に検証エラー`,sc5b:`次のモデルでの新しいエージェントのセッション`,sc61:T`週 ${0}`,sc65:`縮小`,sc68:`日時`,sc6c:T`書き込まれていない出力 ${0} 件(タスクが未実行)`,sc6e:`締め切りまでに終わらない`,sc6f:T`エラーで終了したフロー呼び出し ${0} 件`,sc73:`開始`,sc75:T`全 ${1} 行のうち先頭 ${0} 行`,sc79:`タスク`,sc7d:`同時実行(上限)`,sc87a:T`警告のしきい値: ${0}`,sc87d:T`終了 ${0}`,sc92:`空き`,sc94:`全体`,sc97:`タイムゾーン`,sc9e:`その他`,sca4:`プロセスなし`,sca6:`プレビューを表示`,sca7:`ロール`,scb8:`終了(未完了のタスク 1 件)`,scb9:`最終試行の終了時刻`,scbd:`全文`,scca:T`最も高い種別: ${0}`,sccc:`モデルが応答を拒否`,scd1:`モデルの応答`,scd2:T`${0}: ${1} → 次のモデル`,scd94:`エージェントの所要時間`,scd9c:T`優先度 ${0}`,scdb:`Esc: 選択を解除`,scde:`ループ`,scf41:T`完了 ${0} 件`,scf43:T`入力 ${0} は失敗したタスクの出力`,scf70:`レート制限`,scf71:`失敗した試行の後の試行(retries)`,sd05:T`締め切り ${0}`,sd0e:`出来事`,sd17:`入力 / 出力 | キャッシュ読み込み / キャッシュ書き込み`,sd1f:`ファイルの検証に使うスキーマ`,sd2:T`${0} 件を同時実行`,sd34:T`${0} に開始(${1})`,sd38:`変更`,sd3c:`登録済みのタスクなし`,sd3e:T`終了(未完了のタスク ${0} 件)`,sd4:`ローカルの認証情報(ambient)`,sd58:`終了(失敗したタスク 1 件)`,sd5a:`実行がシグナルで停止された`,sd5d:T`トークン: 入力 ${0}、出力 ${1}、キャッシュ読み込み ${2}、キャッシュ書き込み ${3}`,sd5e:`所要時間の合計`,sd73:`失敗`,sd744:`検証対象のファイル`,sd747:`なし(任意)`,sd75:`検証エラー`,sd776:T`全体の ${0}%`,sd77d:`実行中のエージェントのセッションの新しいイベント 1 件を表示`,sd79:`結果を受けて作成`,sd7d:T`入力 ${0}(${1} の出力)に検証エラー`,sd82:`タスクの開始前からあるファイルは無効`,sd8a:T`${0} まで`,sd93:T`依存先タスク ${0} の出力待ち`,sd95:T`一部のみ完了: ${0}`,sd96:`中を隠す`,sda2:T`セッション開始時の利用率: ${0}`,sda80:T`すべて表示(${0} 文字)`,sda8d:`最大コンテキストが警告のしきい値を超えた(context_warned)`,sdb1:`入力`,sdb4:`イベントが途絶えた`,sdb8:`出力に検証エラー`,sdc:T`実行グループ ${0}`,sdd1:`モニターから応答がありません`,sdd4:`モデル 1 種類`,sdd8:`修正依頼なし`,sddf:`ビューを表示`,sde7:`履歴にほか 1 件`,sde8:T`アカウント ${0}`,sdf1:T`${0} 回目で完了 | 失敗 1 回 | 最初の失敗: ${1}`,sdf4:`リトライなし`,sdf9:`リトライ後に完了`,se0e6:T`${0} から休止中`,se0ed:T`実行されず: ${0}`,se17:T`必要な時間 ${0}`,se1a:`作成`,se21:`指標`,se27:`タスクを実行した CLI(claude、omp)`,se2b:T`キー ${0} 個: ${1}`,se2c:T`期待する型: ${0}`,se3:`キーボードショートカット`,se41:`作成、試行の失敗後も保持`,se4b:`修正依頼のあったタスク 1 件`,se55:`エージェントのセッションの所要時間の合計`,se5a:`モデル切り替え`,se5b:`推移`,se5d:`monitor.Panel`,se60:`ハイコントラスト`,se61:`パイプラインのプロセス内の関数`,se66:`1 タスク`,se6d:`下の階層あり`,se71:T`${0} 回目`,se75:`リプレイと新しいセッション`,se8:T`安全分類器による停止 ${0} 件`,se90:`認証情報`,se99d:`ロック`,se99f:T`終了(失敗したタスク ${0} 件)`,sea2:`期間`,sea4:`定義`,sea6:`矢印キー: マーク`,sea74:T`${0} タスク`,sea7b:`実行の一覧`,seac:`待機中`,seb0:`グラフで表示`,seb2:`締め切りと仕上げの猶予を過ぎた`,seba:`既定`,sec2:`すべての種別`,sec7:`コーディングエージェントが使ったエージェント定義(agents/<role>.md)`,secc:`上限に到達`,secf:T`${0}の利用率 ${1}`,sed05:`コーディングエージェントが報告した料金(試行が終わった日に計上)`,sed0a:`タスクごとに 1 つ(Backend.run)`,sed7:`種別または関数`,sed8:`合計`,sede:`ステージなし`,seea0:`結果`,seea1:`ホスト ID なし`,seee1:`スキップ`,seee3:`完了しなかった試行`,sef0:T`実行中 ${0} 件`,sefc:`言語`,ser:`稼働中`,sf03:`所要時間の中央値`,sf06:T`タスクは ${0} 回目で完了`,sf08:`すべてのエージェントのセッションの合計(同時に実行した分も含む)`,sf11:`終了時刻`,sf14:`最初のエージェントのセッション`,sf26:T`実行 ${0} 件`,sf2b:`トークンの報告なし`,sf2c:`すべての試行が完了`,sf2d:T`関数 ${0}`,sf2e:`定義`,sf39:`周回数`,sf3c:`ほか 1 アカウント`,sf3e:`カスタムビュー`,sf46:T`${0} 周目`,sf48:`終了後の利用率`,sf4d:`コピー済み`,sf55:`サービス`,sf56:`試行の終了後に、同じアカウントで最初に報告された値`,sf5d:`ユニットごとではなく、実行ごとに 1 回実行されるタスク`,sf6:`フロー呼び出し`,sf7b:T`不明(${0})`,sf7d:T`残り ${0}`,sf7e:`すべての実行グループ`,sf82:T`休止 ${0} → ${1}`,sf86:`内容不明`,sf93:`合計`,sf9b:`エージェントのセッションが始まらなかった`,sfa0:`テキスト`,sfa2:T`${0} 〜 ${1}`,sfa6:`フィルターに一致するタスクなし`,sfa8:`ツールのリクエスト`,sfad:`修正依頼 1 回で完了`,sfae:`ホスト一覧`,sfb3:`実行を切り替え`,sfb6:T`実行中のエージェントのセッション ${0} 件`,sfbb:`失敗した試行`,sfc:`再開カーソルなし`,sfd3:T`リトライ後に完了 ${0} 件`,sfd5:T`要素 ${0} 個: ${1}`,sfd7:`出力`,sfd85:`タスクの前から変わらない出力ファイルの箇所(preserve)`,sfd8b:`各日の最大値`,sfdd:`プロセス`,sfde:`ファイルにない必須フィールド`,sfe7:T`${0}: 入力と出力`,sfe9:T`プロセス ${0}`,sff6:`登録済みのタスクはまだありません`,sff8:T`${0} のタスク`,sffa:`定義なし`,sfff:T`Python タスク ${0} 回`,stag:`完了`,stat:`状態`,"stop-c":`完了`,"stop-i":`未実行`,"stop-p":`一部のみ完了`,tab:`タスク`,tas:`タスク`,tok:`出力`,too:`完了`,"trends-p":`一部のみ完了`,"trends-r":`実行`,"view-g":`グラフ`,"view-o":`出力`,"view-t":`表`}),Tn=`en`,En=[`ja`],Dn=[`en`,`ja`],On={en:`English`,ja:`日本語`},kn={ja:()=>Promise.resolve(Cn)};function An(){if(Sn===void 0)try{Sn=at({sourceLocale:Tn,targetLocales:En,loadLocale:e=>kn[e]()})}catch{Sn=null}return Sn!==null}var I=()=>Sn?.getLocale()??Tn;async function jn(e){An()&&await Sn.setLocale(e)}var Mn=`contraagent:locale`,Nn=e=>Dn.includes(e);function Pn(){try{let e=globalThis.localStorage?.getItem(Mn);if(Nn(e))return e}catch{}for(let e of globalThis.navigator?.languages??[]){let t=e.toLowerCase().split(`-`)[0];if(Nn(t))return t}return Tn}async function Fn(e){try{globalThis.localStorage?.setItem(Mn,e)}catch{}await jn(e)}var In=`contraagent`,Ln=null,Rn=``,zn=null,Bn=!1;function Vn(){let e=globalThis.history?.state;return e&&typeof e==`object`?e:{}}function Hn(){let e=Vn()[In];return e&&typeof e==`object`?e:{}}function Un(){zn&&clearTimeout(zn),zn=null;let e=Ln;Ln=null,e&&globalThis.history&&Hn().entry===Rn&&history.replaceState({...Vn(),[In]:{...Hn(),...e}},``)}function Wn(){Un()}var Gn={recall:function(e){if(globalThis.history)return Ln&&Rn===Hn().entry&&e in Ln?Ln[e]:Hn()[e]},remember:function(e,t){if(!globalThis.history)return;let n=function(){let e=Hn().entry;if(e)return e;let t=Math.random().toString(36).slice(2);return history.replaceState({...Vn(),[In]:{...Hn(),entry:t}},``),t}();Ln&&Rn!==n&&(Ln=null),Rn=n,(Ln??={})[e]=t,zn??=setTimeout(Un,200),Bn||(Bn=!0,globalThis.addEventListener?.(`pagehide`,Wn))}},Kn=class{constructor(){this.values=new Map}recall(e){return this.values.get(e)}remember(e,t){this.values.set(e,t)}},qn=new WeakMap;function Jn(e,t){t?qn.set(e,t):qn.delete(e)}function Yn(e){for(let t=e;t;t=t.parentNode??t.host){let e=qn.get(t);if(e)return e}return Gn}var Xn=class{constructor(e,t){this.id=e,this.from=t,this.items=null}get memory(){return Yn(this.from)}get loaded(){return this.items??=new Set(this.memory.recall(this.id)??[])}has(e){return this.loaded.has(e)}set(e,t){let n=this.loaded;t!==n.has(e)&&(t?n.add(e):n.delete(e),this.memory.remember(this.id,[...n]))}values(){return[...this.loaded]}clear(){this.loaded.size&&(this.loaded.clear(),this.memory.remember(this.id,[]))}},Zn=class{constructor(e){this.id=e;let t=null;try{t=JSON.parse(globalThis.sessionStorage?.getItem(`${In}:${e}`)??`null`)}catch{}this.items=new Set(Array.isArray(t)?t.filter(e=>typeof e==`string`):[])}has(e){return this.items.has(e)}set(e,t){if(t!==this.items.has(e)){t?this.items.add(e):this.items.delete(e);try{globalThis.sessionStorage?.setItem(`${In}:${this.id}`,JSON.stringify([...this.items]))}catch{}}}},Qn=[`wheel`,`touchstart`,`pointerdown`,`keydown`],$n=class{constructor(e,t=()=>Gn){this.id=e,this.memory=t,this.el=null,this.frame=0,this.restoring=!1,this.cancel=()=>{if(cancelAnimationFrame(this.frame),this.frame=0,this.restoring){this.restoring=!1;for(let e of Qn)this.el?.removeEventListener(e,this.cancel)}},this.onScroll=()=>{!this.restoring&&this.el&&this.memory().remember(this.id,Math.round(this.el.scrollTop))}}attach(e){this.el!==e&&(this.detach(),this.el=e,e.addEventListener(`scroll`,this.onScroll,{passive:!0}))}detach(){this.cancel(),this.el?.removeEventListener(`scroll`,this.onScroll),this.el=null}restore(){let e=this.el;if(!e)return;this.cancel();let t=this.memory().recall(this.id)??0;if(t<=0)return void(e.scrollTop=0);let n=performance.now()+6e3;this.restoring=!0;for(let t of Qn)e.addEventListener(t,this.cancel,{passive:!0,once:!0});let r=()=>{let i=e.scrollHeight-e.clientHeight;if(e.scrollTop=Math.min(t,i),i>=t||performance.now()>n)return this.cancel();this.frame=requestAnimationFrame(r)};r()}reset(){this.cancel(),this.el&&(this.el.scrollTop=0)}},er=[`overview`,`tasks`,`journal`,`outputs`,`definitions`,`procs`,`stream`],tr=[`transcript`,`input`,`output`,`definition`],nr=[7,14,30],rr={page:``,run:``,tab:`overview`,key:null,view:`transcript`,round:null,def:null,kind:``,stop:``,q:``,layer:``,unit:``,sel:``,days:14,from:``,to:``,tz:``,group:``,trendsTab:``},ir=e=>er.includes(e)||/^panel:.+/.test(e),ar=e=>tr.includes(e);function or(e){let t=new URLSearchParams(e),n=t.get(`tab`)??``,r=t.get(`view`)??``,i=Number(t.get(`round`)),a=t.get(`page`)===`hosts`?`hosts`:t.get(`page`)===`trends`?`trends`:``,o=t.get(`from`)??``,s=t.get(`to`)??``,c=/^\d{4}-\d{2}-\d{2}$/.test(o)&&/^\d{4}-\d{2}-\d{2}$/.test(s),l=Number(t.get(`days`));return{page:a,run:a?``:t.get(`run`)??``,tab:a!==`trends`&&ir(n)?n:`overview`,key:t.get(`key`)||null,view:ar(r)?r:`transcript`,round:Number.isInteger(i)&&i>0?i:null,def:t.get(`def`)||null,kind:t.get(`kind`)??``,stop:t.get(`stop`)??``,q:t.get(`q`)??``,layer:t.get(`layer`)??``,unit:t.get(`unit`)??``,sel:t.get(`sel`)??``,days:c?0:nr.includes(l)?l:rr.days,from:c?o:``,to:c?s:``,tz:t.get(`tz`)??``,group:t.get(`group`)??``,trendsTab:a===`trends`?t.get(`tab`)??``:``}}function sr(e){if(e.page===`hosts`)return`?page=hosts`;if(e.page===`trends`){let t=new URLSearchParams({page:`trends`});return e.days===0&&e.from&&e.to?(t.set(`from`,e.from),t.set(`to`,e.to)):e.days!==rr.days&&t.set(`days`,String(e.days)),e.tz&&t.set(`tz`,e.tz),e.group&&t.set(`group`,e.group),e.trendsTab&&t.set(`tab`,e.trendsTab),`?${t.toString()}`}let t=new URLSearchParams;e.run&&t.set(`run`,e.run),e.tab!==`overview`&&t.set(`tab`,e.tab),e.tab===`stream`&&(e.key&&t.set(`key`,e.key),e.view!==`transcript`&&t.set(`view`,e.view),e.round!=null&&t.set(`round`,String(e.round))),e.tab===`definitions`&&e.def&&t.set(`def`,e.def),e.tab===`overview`&&e.layer&&t.set(`layer`,e.layer),e.tab===`overview`&&e.unit&&t.set(`unit`,e.unit),e.tab===`overview`&&e.sel&&t.set(`sel`,e.sel);let n=e.tab===`tasks`||e.tab===`journal`;n&&e.kind&&t.set(`kind`,e.kind),e.tab===`journal`&&e.stop&&t.set(`stop`,e.stop),n&&e.q&&t.set(`q`,e.q);let r=t.toString();return r?`?${r}`:``}function cr(e,t){let n={...e,...t};return t.run!==void 0&&t.run!==e.run&&Object.assign(n,{key:null,def:null,round:null,layer:``,unit:``,sel:``,...t}),t.layer!==void 0&&t.layer!==e.layer&&t.sel===void 0&&(n.sel=``),t.key!==void 0&&t.key!==e.key&&(t.view===void 0&&(n.view=`transcript`),t.round===void 0&&(n.round=null)),n}function lr(e,t){let n=e=>sr({...e,kind:``,stop:``,q:``,unit:``,sel:``});return n(e)!==n(t)}var ur=class{constructor(e,t,n,r=()=>{}){this.mode=e,this.onChange=t,this.onLeave=r,this.onPop=()=>{this.current=or(location.search),this.onChange(this.current,`pop`)};let i=or(e===`url`?location.search:``);this.current=cr(i,n??{})}get viewRoute(){return this.current}start(){this.mode===`url`&&(history.scrollRestoration=`manual`,addEventListener(`popstate`,this.onPop)),this.onChange(this.current,`init`)}stop(){this.mode===`url`&&removeEventListener(`popstate`,this.onPop)}navigate(e,t={}){let n=cr(this.current,e);if(sr(n)===sr(this.current))return;let r=!t.replace&&lr(this.current,n);if(this.current=n,this.mode===`url`){let e=`${location.pathname}${sr(n)}${location.hash}`;r?(this.onLeave(),history.pushState({},``,e)):history.replaceState(history.state,``,e)}this.onChange(n,r?`push`:`replace`)}},dr=class{constructor(e,t){this.host=e,this.opts=t,this.ready=Promise.resolve(),e.addController(this)}hostConnected(){let e=this.opts.locale();this.ready=jn(Nn(e)?e:Pn()).catch(()=>{})}hostUpdated(){let e=this.opts.locale();e!==this.seen&&(this.seen=e,Nn(e)&&e!==I()&&jn(e)),this.opts.pageWide()&&(document.documentElement.lang=I()),this.host.lang=I()}},fr=class{constructor(e,t,n){this.host=e,this.onKey=t,this.scope=n,this.bound=null,this.boundScope=`off`,this.listener=e=>{let t=e;t.defaultPrevented||function(e){let t=e.composedPath()[0];return t instanceof HTMLElement&&(t.isContentEditable||t.matches(`input, select, textarea, [contenteditable]:not([contenteditable="false"])`))}(t)||t.metaKey||t.ctrlKey||t.altKey||this.onKey(t)},e.addController(this)}hostConnected(){this.bind()}hostUpdated(){this.scope()!==this.boundScope&&this.bind()}hostDisconnected(){this.unbind()}bind(){this.unbind();let e=this.scope();this.boundScope=e,this.bound=e===`page`?document:e===`element`?this.host:null,this.bound?.addEventListener(`keydown`,this.listener)}unbind(){this.bound?.removeEventListener(`keydown`,this.listener),this.bound=null,this.boundScope=`off`}},pr=[{name:`backdrop`,prop:`--ca-backdrop`},{name:`bg`,prop:`--ca-bg`},{name:`card`,prop:`--ca-card`},{name:`panel`,prop:`--ca-panel`},{name:`panel2`,prop:`--ca-panel2`},{name:`raise`,prop:`--ca-raise`},{name:`well`,prop:`--ca-well`},{name:`track`,prop:`--ca-track`},{name:`line`,prop:`--ca-line`},{name:`line2`,prop:`--ca-line2`},{name:`shadow`,prop:`--ca-shadow`},{name:`text`,prop:`--ca-text`},{name:`text-2`,prop:`--ca-text-secondary`},{name:`text-muted`,prop:`--ca-text-muted`},{name:`accent`,prop:`--ca-accent`},{name:`accent-bg`,prop:`--ca-accent-bg`,derive:`color-mix(in srgb, var(--accent) calc(var(--tint) + 1%), transparent)`},{name:`focus`,prop:`--ca-focus`},{name:`focus-width`,prop:`--ca-focus-width`},{name:`selection`,prop:`--ca-selection`},{name:`status-failed`,prop:`--ca-status-failed`},{name:`status-failed-bg`,prop:`--ca-status-failed-bg`,derive:`color-mix(in srgb, var(--status-failed) var(--tint), transparent)`},{name:`status-attention`,prop:`--ca-status-attention`},{name:`status-attention-bg`,prop:`--ca-status-attention-bg`,derive:`color-mix(in srgb, var(--status-attention) var(--tint), transparent)`},{name:`status-done`,prop:`--ca-status-done`},{name:`status-done-bg`,prop:`--ca-status-done-bg`,derive:`color-mix(in srgb, var(--status-done) var(--tint), transparent)`},{name:`status-running`,prop:`--ca-status-running`},{name:`status-running-bg`,prop:`--ca-status-running-bg`,derive:`color-mix(in srgb, var(--status-running) var(--tint), transparent)`},{name:`status-muted`,prop:`--ca-status-muted`},{name:`status-muted-bg`,prop:`--ca-status-muted-bg`,derive:`color-mix(in srgb, var(--status-muted) calc(var(--tint) - 1%), transparent)`},{name:`tint`,prop:`--ca-tint`},{name:`agent`,prop:`--ca-agent`},{name:`agent-bg`,prop:`--ca-agent-bg`,derive:`color-mix(in srgb, var(--agent) calc(var(--tint) + 2%), transparent)`},{name:`meter`,prop:`--ca-meter`},{name:`tok-input`,prop:`--ca-tok-input`},{name:`tok-cache-read`,prop:`--ca-tok-cache-read`},{name:`tok-cache-write`,prop:`--ca-tok-cache-write`},{name:`tok-output`,prop:`--ca-tok-output`},{name:`series-1`,prop:`--ca-series-1`},{name:`series-2`,prop:`--ca-series-2`},{name:`series-3`,prop:`--ca-series-3`},{name:`series-4`,prop:`--ca-series-4`},{name:`series-5`,prop:`--ca-series-5`},{name:`series-6`,prop:`--ca-series-6`},{name:`code-keyword`,prop:`--ca-code-keyword`},{name:`code-string`,prop:`--ca-code-string`},{name:`code-number`,prop:`--ca-code-number`},{name:`code-constant`,prop:`--ca-code-constant`},{name:`code-comment`,prop:`--ca-code-comment`},{name:`code-function`,prop:`--ca-code-function`},{name:`code-type`,prop:`--ca-code-type`},{name:`code-name`,prop:`--ca-code-name`},{name:`font-size-xs`,prop:`--ca-font-size-xs`,derive:`10px`},{name:`font-size-sm`,prop:`--ca-font-size-sm`,derive:`11px`},{name:`font-size-md`,prop:`--ca-font-size-md`,derive:`12px`},{name:`font-size-lg`,prop:`--ca-font-size-lg`,derive:`13px`},{name:`font-size-xl`,prop:`--ca-font-size-xl`,derive:`15px`},{name:`font-size-2xl`,prop:`--ca-font-size-2xl`,derive:`28px`},{name:`radius-sm`,prop:`--ca-radius-sm`,derive:`4px`},{name:`radius-md`,prop:`--ca-radius-md`,derive:`8px`},{name:`radius-lg`,prop:`--ca-radius-lg`,derive:`12px`},{name:`radius-pill`,prop:`--ca-radius-pill`,derive:`999px`}],mr=[`contraagent-dark`,`contraagent-light`,`github-dark`,`github-light`,`one-dark`,`nord`,`high-contrast`],hr=[`contraagent-dark`,`contraagent-light`,`system`,`github-dark`,`github-light`,`one-dark`,`nord`,`high-contrast`],gr=[`github-dark`,`github-light`,`one-dark`,`nord`,`high-contrast`],_r=`contraagent-dark`,vr={"contraagent-dark":{label:`contraagent Dark`,scheme:`dark`,tokens:{backdrop:`radial-gradient(1100px 520px at 8% -12%, #10203a 0%, transparent 62%), radial-gradient(900px 480px at 108% 4%, #1b1238 0%, transparent 58%), #060a11`,bg:`#060a11`,card:`#0f1724`,panel:`#0f1724`,panel2:`#142034`,raise:`#1a2740`,well:`#0a111c`,track:`#1b273b`,line:`#1d2940`,line2:`#2b3c58`,shadow:`#060a11`,text:`#e7edf5`,"text-2":`#bcc7d6`,"text-muted":`#909db2`,accent:`#7aa2ff`,focus:`#7aa2ff`,"focus-width":`2px`,selection:`#7aa2ff4d`,"status-failed":`#f87171`,"status-attention":`#fbbf24`,"status-done":`#34d399`,"status-running":`#22d3ee`,"status-muted":`#94a3b8`,tint:`13%`,agent:`#b597fb`,meter:`#7d8ba3`,"tok-input":`#7c86f5`,"tok-cache-read":`#3f4d63`,"tok-cache-write":`#8796ad`,"tok-output":`#d6b8ff`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#c4a5ff`,"code-string":`#7ee2a8`,"code-number":`#f5c26b`,"code-constant":`#ff9e64`,"code-comment":`#74839a`,"code-function":`#7dd3fc`,"code-type":`#ffd479`,"code-name":`#79b8ff`}},"contraagent-light":{label:`contraagent Light`,scheme:`light`,tokens:{backdrop:`radial-gradient(1100px 520px at 8% -12%, #dde7fb 0%, transparent 62%), radial-gradient(900px 480px at 108% 4%, #ebe3fa 0%, transparent 58%), #eef2f8`,bg:`#eef2f8`,card:`#ffffff`,panel:`#ffffff`,panel2:`#f7f9fc`,raise:`#e6ecf5`,well:`#f3f6fa`,track:`#e1e7f0`,line:`#d6dde8`,line2:`#b6c2d3`,shadow:`#0f172438`,text:`#0f1724`,"text-2":`#34415a`,"text-muted":`#556279`,accent:`#2f58d4`,focus:`#2f58d4`,"focus-width":`2px`,selection:`#2f58d42e`,"status-failed":`#b8132d`,"status-attention":`#6c4801`,"status-done":`#026b49`,"status-running":`#01525f`,"status-muted":`#56637a`,tint:`11%`,agent:`#6f45c0`,meter:`#8a97ab`,"tok-input":`#4d4cc8`,"tok-cache-read":`#cdd6e3`,"tok-cache-write":`#7d8aa0`,"tok-output":`#a07ad9`,"series-1":`#2a78d6`,"series-2":`#eb6834`,"series-3":`#1baf7a`,"series-4":`#eda100`,"series-5":`#e87ba4`,"series-6":`#008300`,"code-keyword":`#6f49a8`,"code-string":`#076b40`,"code-number":`#7b5605`,"code-constant":`#964605`,"code-comment":`#5d6b80`,"code-function":`#086586`,"code-type":`#785902`,"code-name":`#095ea8`}},"github-dark":{label:`GitHub Dark`,scheme:`dark`,tokens:{backdrop:`#010409`,bg:`#010409`,card:`#0d1117`,panel:`#0d1117`,panel2:`#151b23`,raise:`#212830`,well:`#010409`,track:`#262c36`,line:`#262c36`,line2:`#3d444d`,shadow:`#010409`,text:`#f0f6fc`,"text-2":`#d1d7e0`,"text-muted":`#9299a2`,accent:`#4796fb`,focus:`#1f6feb`,"focus-width":`2px`,selection:`#388bfd4d`,"status-failed":`#fc554d`,"status-attention":`#d29922`,"status-done":`#3fb950`,"status-running":`#39c5cf`,"status-muted":`#9198a1`,tint:`15%`,agent:`#ab7df8`,meter:`#656c76`,"tok-input":`#58a6ff`,"tok-cache-read":`#2f3742`,"tok-cache-write":`#656c76`,"tok-output":`#d2a8ff`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#ff7b72`,"code-string":`#a5d6ff`,"code-number":`#79c0ff`,"code-constant":`#79c0ff`,"code-comment":`#9198a1`,"code-function":`#d2a8ff`,"code-type":`#ffa657`,"code-name":`#7ee787`}},"github-light":{label:`GitHub Light`,scheme:`light`,tokens:{backdrop:`#f6f8fa`,bg:`#f6f8fa`,card:`#ffffff`,panel:`#ffffff`,panel2:`#ffffff`,raise:`#eff2f5`,well:`#f6f8fa`,track:`#e6eaef`,line:`#d1d9e0`,line2:`#b7c0ca`,shadow:`#1f232833`,text:`#1f2328`,"text-2":`#393f46`,"text-muted":`#59636e`,accent:`#0165d6`,focus:`#0165d6`,"focus-width":`2px`,selection:`#0969da33`,"status-failed":`#cd1e2b`,"status-attention":`#916103`,"status-done":`#147b33`,"status-running":`#10767d`,"status-muted":`#59636e`,tint:`8%`,agent:`#804ddc`,meter:`#818b98`,"tok-input":`#54aeff`,"tok-cache-read":`#d1d9e0`,"tok-cache-write":`#818b98`,"tok-output":`#a475f9`,"series-1":`#2a78d6`,"series-2":`#eb6834`,"series-3":`#1baf7a`,"series-4":`#eda100`,"series-5":`#e87ba4`,"series-6":`#008300`,"code-keyword":`#cf222e`,"code-string":`#0a3069`,"code-number":`#0550ae`,"code-constant":`#0550ae`,"code-comment":`#59636e`,"code-function":`#6639ba`,"code-type":`#953800`,"code-name":`#116329`}},"one-dark":{label:`One Dark`,scheme:`dark`,tokens:{backdrop:`#21252b`,bg:`#21252b`,card:`#282c34`,panel:`#282c34`,panel2:`#2c313a`,raise:`#2c313a`,well:`#21252b`,track:`#3a3f4b`,line:`#181a1f`,line2:`#4b5263`,shadow:`#0e1013`,text:`#d7dae0`,"text-2":`#abb2bf`,"text-muted":`#a7afbe`,accent:`#64b2f2`,focus:`#528bff`,"focus-width":`2px`,selection:`#3e4451`,"status-failed":`#fc858d`,"status-attention":`#e5c07b`,"status-done":`#98c379`,"status-running":`#57b7c3`,"status-muted":`#a7afbe`,tint:`12%`,agent:`#d788ee`,meter:`#5c6370`,"tok-input":`#61afef`,"tok-cache-read":`#3e4451`,"tok-cache-write":`#5c6370`,"tok-output":`#c678dd`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#c678dd`,"code-string":`#98c379`,"code-number":`#d19a66`,"code-constant":`#d19a66`,"code-comment":`#8f949e`,"code-function":`#61afef`,"code-type":`#e5c07b`,"code-name":`#e36e77`}},nord:{label:`Nord`,scheme:`dark`,tokens:{backdrop:`#2e3440`,bg:`#242933`,card:`#2e3440`,panel:`#2e3440`,panel2:`#323946`,raise:`#3b4252`,well:`#272c36`,track:`#3b4252`,line:`#3b4252`,line2:`#4c566a`,shadow:`#1d2129`,text:`#eceff4`,"text-2":`#d8dee9`,"text-muted":`#adbcd9`,accent:`#9dbedf`,focus:`#88c0d0`,"focus-width":`2px`,selection:`#4c566a`,"status-failed":`#fe9aa1`,"status-attention":`#ebcb8b`,"status-done":`#a5c18e`,"status-running":`#89c1d1`,"status-muted":`#adbcd9`,tint:`13%`,agent:`#d0a9c9`,meter:`#7b88a1`,"tok-input":`#5e81ac`,"tok-cache-read":`#4c566a`,"tok-cache-write":`#7b88a1`,"tok-output":`#b48ead`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#81a1c1`,"code-string":`#a3be8c`,"code-number":`#b790b0`,"code-constant":`#d38972`,"code-comment":`#8f9db8`,"code-function":`#88c0d0`,"code-type":`#8fbcbb`,"code-name":`#8fbcbb`}},"high-contrast":{label:`High contrast`,scheme:`dark`,tokens:{backdrop:`#010409`,bg:`#010409`,card:`#0a0c10`,panel:`#0a0c10`,panel2:`#0a0c10`,raise:`#1c2128`,well:`#010409`,track:`#272b33`,line:`#7a828e`,line2:`#9ea7b3`,shadow:`#000000`,text:`#ffffff`,"text-2":`#f0f3f6`,"text-muted":`#bdc4cc`,accent:`#7abbfe`,focus:`#7abbfe`,"focus-width":`3px`,selection:`#409eff66`,"status-failed":`#ffacb8`,"status-attention":`#fad209`,"status-done":`#0ef38e`,"status-running":`#62ceff`,"status-muted":`#bdc4cc`,tint:`12%`,agent:`#c299fe`,meter:`#9ea7b3`,"tok-input":`#409eff`,"tok-cache-read":`#525964`,"tok-cache-write":`#9ea7b3`,"tok-output":`#dbb7ff`,"series-1":`#3987e5`,"series-2":`#d95926`,"series-3":`#199e70`,"series-4":`#c98500`,"series-5":`#d55181`,"series-6":`#008300`,"code-keyword":`#ff9492`,"code-string":`#addcff`,"code-number":`#91cbff`,"code-constant":`#91cbff`,"code-comment":`#bdc4cc`,"code-function":`#dbb7ff`,"code-type":`#ffb757`,"code-name":`#72f088`}}},yr=Object.fromEntries(pr.map(e=>[e.name,e.prop])),br=e=>`:where([data-ca-theme="${e}"])`;function xr(e=br){return mr.map(t=>{let n=vr[t],r=Object.entries(n.tokens).map(([e,t])=>`${yr[e]}: ${t};`);return`${e(t)} { color-scheme: ${n.scheme}; --ca-color-scheme: ${n.scheme}; ${r.join(` `)} }`}).join(`
|
|
6
6
|
`)}var Sr=e=>hr.includes(e);function Cr(e,t){return e===`system`?t?`contraagent-light`:`contraagent-dark`:(e=>mr.includes(e))(e)?e:_r}var wr=`contraagent:theme`,Tr=()=>{try{return globalThis.localStorage}catch{return}},Er=pt(xr()),Dr=pt(xr(e=>`:host([data-ca-theme="${e}"])`)),Or=new WeakSet,kr=class{constructor(e,t){this.host=e,this.opts=t,this.light=globalThis.matchMedia?.(`(prefers-color-scheme: light)`).matches??!1,this.stop=null,e.addController(this)}get choice(){let e=this.opts.theme();return Sr(e)?e:function(e=Tr()){try{let t=e?.getItem(wr);if(Sr(t))return t}catch{}return _r}()}get shown(){return Cr(this.choice,this.light)}get system(){return Cr(`system`,this.light)}hostConnected(){this.apply();let e=globalThis.matchMedia?.(`(prefers-color-scheme: light)`);if(!e)return;let t=e=>{this.light=e.matches,this.host.requestUpdate()};e.addEventListener(`change`,t),this.stop=()=>e.removeEventListener(`change`,t)}hostDisconnected(){this.stop?.(),this.stop=null}hostUpdated(){this.apply()}apply(){let e=this.shown;this.host.getAttribute(`data-ca-theme`)!==e&&this.host.setAttribute(`data-ca-theme`,e),this.opts.pageWide()&&document.documentElement.getAttribute(`data-ca-theme`)!==e&&document.documentElement.setAttribute(`data-ca-theme`,e)}},L=e=>e&&e!==`neutral`?e:j;function R(e,t,n){return e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}function Ar(e,t){let n={...e};if(t)for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function z(e,t){customElements.get(e)||customElements.define(e,t)}function B(e){if(e==null||Number.isNaN(e))return`—`;let t=Math.max(0,e);if(t<.05)return`<0.1s`;if(t<9.95)return`${t.toFixed(1)}s`;let n=Math.round(t);return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m ${String(n%60).padStart(2,`0`)}s`:`${Math.floor(n/3600)}h ${String(Math.floor(n%3600/60)).padStart(2,`0`)}m`}var jr=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`),Mr=new Set,Nr=null;function Pr(){for(let e of Mr)e.requestUpdate()}var Fr=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){Mr.add(this.host),Nr??=setInterval(Pr,1e3)}hostDisconnected(){Mr.delete(this.host),!Mr.size&&Nr&&(clearInterval(Nr),Nr=null)}},Ir=new class{constructor(){this.seen=new Map}at(e,t,n=Date.now()){let r=Math.round(n-1e3*t),i=this.seen.get(e);return i!==void 0&&Math.abs(i-r)<5e3?i:(this.seen.set(e,r),r)}},Lr=O` .tag{font-size:var(--font-size-xs);padding:0 7px;border-radius:var(--radius-pill);border:1px solid var(--line2);color:var(--text-muted);white-space:nowrap;}.chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}.chip{font-size:var(--font-size-sm);padding:1px 8px;border-radius:var(--radius-pill);border:1px solid var(--line);color:var(--text-muted);white-space:nowrap;}.chip[data-tone='done']{color:var(--text-2);}.chip[data-tone='done']>[aria-hidden]{color:var(--tone);font-weight:700;}.chip[data-tone='running']{background:var(--tone);color:var(--bg);border-color:var(--tone);font-weight:600;animation:ping 1.6s var(--ease) infinite;}.chip.todo{opacity:0.65;}.taskchip{display:inline-block;font:inherit;font-family:var(--mono);font-size:var(--font-size-sm);line-height:1.5;padding:0 8px;border-radius:var(--radius-pill);border:1px solid var(--line);background:var(--raise);color:var(--text-2);white-space:nowrap;}button.taskchip{cursor:pointer;}button.taskchip:hover{border-color:var(--accent);color:var(--text);}.kbd{font-family:var(--mono);font-size:var(--font-size-xs);border:1px solid var(--line2);border-bottom-width:2px;border-radius:var(--radius-sm);padding:0 4px;color:var(--text-muted);}`,Rr=O` .g12{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px;container-type:inline-size;}.c12{grid-column:span 12;}.c7{grid-column:span 7;}.c5{grid-column:span 5;}@container (max-width:1100px){.c7,.c5{grid-column:span 12;}}.panel{background:linear-gradient(180deg,var(--panel2),var(--panel));border:1px solid var(--line);border-radius:var(--radius-lg);padding:14px 16px;min-width:0;box-shadow:0 10px 28px color-mix(in srgb,var(--shadow) 40%,transparent);}.panel>h3{margin:0 0 12px;display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;color:var(--text-2);}.panel>h3 .r{margin-left:auto;font-weight:400;font-size:11.5px;color:var(--text-muted);}.sect-h{margin:14px 0 8px;font-size:var(--font-size-md);color:var(--text-2);font-weight:600;}.sect-h .meta{margin-left:8px;font-weight:400;}.blank{display:flex;flex-direction:column;align-items:center;gap:8px;padding:60px 16px;color:var(--text-muted);text-align:center;}.blank .ic{font-size:30px;opacity:0.55;}.blank b{color:var(--text-2);font-weight:600;}.blank a.lnk{text-decoration:underline;}.blank.small{padding:24px;}.fl{padding:7px 10px;border-radius:var(--radius-md);cursor:pointer;display:grid;grid-template-columns:auto 1fr auto;gap:2px 10px;align-items:baseline;}button.fl{width:100%;background:none;border:0;color:inherit;text-align:start;}.fl-name{background:none;border:0;padding:0;color:inherit;font-weight:700;text-align:start;cursor:pointer;min-width:0;}.fl>.meta:last-child{grid-column:1 / 4;overflow:hidden;text-overflow:ellipsis;}.fl:hover{background:var(--raise);}`,zr=O` .enter{animation:enter 0.5s var(--ease) both;}@keyframes turn{to{transform:rotate(360deg);}}@keyframes breathe{0%,100%{opacity:0.45;box-shadow:0 0 0 0 transparent;transform:scale(0.85);}50%{opacity:1;box-shadow:0 0 0 4px var(--status-running-bg);transform:scale(1);}}@keyframes ping{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--status-running) 55%,transparent);}80%,100%{box-shadow:0 0 0 9px transparent;}}@keyframes enter{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:none;}}@keyframes bump{0%{transform:scale(1);}35%{transform:scale(1.04);box-shadow:0 0 0 1px var(--line2);}100%{transform:scale(1);}}@keyframes scan{from{transform:translateX(-100%);}to{transform:translateX(100%);}}@keyframes growx{from{transform:scaleX(0);}to{transform:scaleX(1);}}@keyframes stripes{to{background-position:17px 0;}}@keyframes toast-in{from{opacity:0;transform:translateY(12px) scale(0.97);}to{opacity:1;transform:none;}}@keyframes toast-out{to{opacity:0;transform:translateX(24px);}}@keyframes rowin{from{background:color-mix(in srgb,var(--text) 10%,transparent);}to{background:transparent;}}@keyframes bounce{0%,80%,100%{transform:translateY(0);opacity:0.45;}40%{transform:translateY(-5px);opacity:1;}}@keyframes core-beat{0%,100%{transform:scale(1);}50%{transform:scale(0.72);}}@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none !important;transition:none !important;}}`,Br=O` *,*::before,*::after{box-sizing:border-box;}*{scrollbar-width:thin;scrollbar-color:var(--line2) transparent;}*:hover{scrollbar-color:var(--text-muted) transparent;}::selection{background:var(--selection);}:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:2px;}button{font:inherit;color:inherit;}[hidden]{display:none !important;}`,Vr=O` [data-tone='failed']{--tone:var(--status-failed);--tone-bg:var(--status-failed-bg);}[data-tone='attention']{--tone:var(--status-attention);--tone-bg:var(--status-attention-bg);}[data-tone='done']{--tone:var(--status-done);--tone-bg:var(--status-done-bg);}[data-tone='running']{--tone:var(--status-running);--tone-bg:var(--status-running-bg);}[data-tone='muted']{--tone:var(--status-muted);--tone-bg:var(--status-muted-bg);}[data-mark]::before{margin-right:0.35em;font-weight:700;}[data-mark='done']::before{content:'✓';content:'✓' / '';color:var(--status-done);}[data-mark='failed']::before{content:'✕';content:'✕' / '';}[data-mark='pending']::before{content:'◌';content:'◌' / '';}.tone-text[data-tone]{color:var(--tone);}.pill{border-radius:var(--radius-pill);padding:1px 10px;font-size:var(--font-size-sm);font-weight:500;background:var(--raise);color:var(--text-2);white-space:nowrap;}.pill[data-tone]{background:var(--tone-bg);color:var(--tone);}.pill[data-tone='done']{background:none;padding-left:2px;color:var(--text-2);}.jstop{font-weight:600;}.jstop[data-tone='failed'],.jstop[data-tone='attention']{color:var(--tone);}.jstop[data-tone='done']{color:var(--text-2);font-weight:500;}.dot{width:8px;height:8px;border-radius:50%;background:var(--line2);flex:none;display:inline-block;}.dot[data-tone]{background:var(--tone);}.dot[data-tone='running']{animation:breathe 1.8s ease-in-out infinite;}.dot[data-tone='attention']{border-radius:1px;transform:rotate(45deg) scale(0.86);}.dot[data-tone='failed']{border-radius:1.5px;}.spin{width:14px;height:14px;border-radius:50%;border:2px solid var(--status-running-bg);border-top-color:var(--status-running);animation:turn 0.9s linear infinite;flex:none;display:inline-block;}`,Hr=O` .jmono,code,.mono{font-family:var(--mono);}.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}.jmono{font-size:11.5px;}.meta{color:var(--text-muted);font-size:var(--font-size-sm);}.words{word-break:keep-all;overflow-wrap:break-word;line-break:strict;}.words .f{display:inline-block;max-width:100%;}@supports (word-break:auto-phrase){.words:lang(ja){word-break:auto-phrase;}}.mut,.jdim{color:var(--text-muted);}a.lnk{color:var(--accent);cursor:pointer;text-decoration:none;}a.lnk:hover{text-decoration:underline;}`,Ur=vr[_r].tokens,Wr=O` :host{${pt(pr.map(e=>e.derive?`--${e.name}: var(${e.prop}, ${e.derive});`:`--${e.name}: var(${e.prop}, ${Ur[e.name]});`).join(`
|
|
7
7
|
`))} --sans:var(--ca-sans,system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif);--mono:var(--ca-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,'Liberation Mono',monospace);--ease:cubic-bezier(0.2,0.8,0.2,1);color-scheme:var(--ca-color-scheme,${pt(vr[_r].scheme)});color:var(--text);}:host([hidden]){display:none !important;}`,Gr=O` .jtree{font-family:var(--mono);font-size:var(--font-size-md);overflow:auto;}.jt{margin-left:16px;}details.jt>summary{cursor:pointer;list-style:revert;}.jk{color:var(--code-name);}.js{color:var(--code-string);}.jn{color:var(--code-number);}.md-p{margin:0.15em 0;}.md-gap{height:0.5em;}.md-h{font-weight:600;margin:0.7em 0 0.25em;}.md-h1{font-size:1.25em;}.md-h2{font-size:1.12em;}.md-h3{font-size:1.03em;color:var(--text-2);}.md-h4{color:var(--text-2);}.md-li{padding-left:16px;text-indent:-12px;margin:0.1em 0;}.md-li::before{content:'• ';color:var(--text-muted);}.md-ol::before{content:'';}.md-n{color:var(--text-muted);margin-right:6px;}.md-q{border-left:3px solid var(--line2);padding-left:10px;color:var(--text-2);margin:0.2em 0;}.md-hr{border:0;border-top:1px solid var(--line);margin:0.7em 0;}.md-t{border-collapse:collapse;margin:0.4em 0;}.md-t th,.md-t td{border:1px solid var(--line);padding:3px 9px;text-align:left;font-size:12.5px;}.md-t th{background:var(--raise);}.md-doc{padding:10px 14px;background:var(--well);border:1px solid var(--line);border-radius:var(--radius-md);max-height:460px;overflow:auto;line-height:1.55;}.md-doc code,.tx code{background:var(--raise);border-radius:var(--radius-sm);padding:0 4px;font-size:0.92em;}.md-doc pre{background:var(--well);border:1px solid var(--line);border-radius:6px;padding:8px 10px;white-space:pre-wrap;}.md-doc pre code,.tx pre code{background:none;padding:0;border-radius:0;font-size:inherit;}.md-front{margin-bottom:10px;border-collapse:collapse;}.md-front td{padding:2px 14px 2px 0;font-size:12.5px;border:0;vertical-align:top;}.md-front td:first-child{color:var(--text-muted);}.md-tele{color:var(--text-muted);font-size:11.5px;margin-bottom:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.df-text{background:var(--well);border:1px solid var(--line);border-radius:var(--radius-md);padding:10px 12px;font-size:var(--font-size-md);white-space:pre-wrap;max-height:420px;overflow:auto;margin:0;}.df-tog{margin-left:auto;font-size:var(--font-size-sm);color:var(--accent);border:1px solid var(--line2);border-radius:var(--radius-pill);padding:0 9px;cursor:pointer;background:none;}.df-tog:hover{background:var(--accent-bg);}.pv{color:var(--code-constant);background:color-mix(in srgb,var(--code-constant) 12%,transparent);border-radius:var(--radius-sm);padding:0 3px;}.pv.pc{color:var(--code-keyword);background:color-mix(in srgb,var(--code-keyword) 12%,transparent);}.hl{font-family:var(--mono);}.hl-k{color:var(--code-keyword);}.hl-const{color:var(--code-constant);font-style:italic;}.hl-s{color:var(--code-string);}.hl-doc{color:var(--code-string);font-style:italic;opacity:0.85;}.hl-c{color:var(--code-comment);font-style:italic;}.hl-n{color:var(--code-number);}.hl-d{color:var(--code-function);}.hl-f{color:var(--code-function);font-weight:600;}.hl-cls{color:var(--code-type);font-weight:700;}.hl-t{color:var(--code-type);}.hl-b{color:var(--code-name);}.hl-key{color:var(--code-name);}.hl-tag{color:var(--code-keyword);}.hl-attr{color:var(--code-name);}.hl-meta{color:var(--code-comment);font-weight:600;}.hl-ins{color:var(--status-done);}.hl-del{color:var(--status-failed);}`,Kr=O` .jdur{position:relative;display:block;height:6px;border-radius:3px;background:var(--track);overflow:hidden;margin-top:2px;}.jdur i{position:absolute;left:0;top:0;bottom:0;border-radius:3px;background:var(--meter);}.jdur i.bad{background:var(--status-failed);}`,qr=O` .drv-facts{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:8px;font-size:var(--font-size-md);}.drv-facts i{font-style:normal;color:var(--text-muted);margin-right:5px;font-size:var(--font-size-sm);}`,Jr=O` .mark{width:var(--m);height:var(--m);padding:0;margin:0;border:0;border-radius:50%;background:var(--tone,var(--status-done));opacity:0.9;cursor:pointer;position:relative;transition:opacity 0.2s,transform 0.15s,background 0.3s;}.mark:not([data-tone]){--tone:initial;}.mark[data-tone='muted']{opacity:0.55;}.mark[data-tone='running']{opacity:1;animation:breathe 1.4s ease-in-out infinite;}.mark[data-shape='ring']{background:transparent;box-shadow:inset 0 0 0 1.5px var(--tone,var(--line2));}.mark[data-shape='hatched']{border-radius:2px;background:repeating-linear-gradient(135deg,transparent 0 2px,color-mix(in srgb,var(--tone) 55%,transparent) 2px 3px);box-shadow:inset 0 0 0 1.5px var(--tone);opacity:1;}.mark[data-shape='half']{background:linear-gradient(0deg,var(--tone) 50%,transparent 50%);box-shadow:inset 0 0 0 1.5px var(--tone);opacity:1;}.mark[data-shape='square']{border-radius:2px;opacity:1;}.big .mark[data-tone='failed']::after{content:'✕';position:absolute;inset:0;display:grid;place-items:center;color:var(--bg);font-size:calc(var(--m) - 3px);line-height:1;font-weight:700;}.mark[data-n]::after{content:'';position:absolute;inset:32%;border-radius:50%;background:var(--card);}.big .mark[data-n]::after{content:attr(data-n);inset:0;display:grid;place-items:center;border-radius:0;background:none;font:700 max(7px,calc(var(--m) - 4px)) / 1 var(--sans);color:var(--bg);letter-spacing:-0.5px;}.big .mark:is(:not([data-tone]),[data-tone='attention'],[data-tone='muted'])[data-n]::after{color:var(--text);}.mark:hover,.mark:focus-visible{transform:scale(1.4);outline:var(--focus-width) solid var(--text);outline-offset:1px;z-index:2;}.mark.sel{outline:var(--focus-width) solid var(--accent);outline-offset:2px;z-index:2;}@media (prefers-reduced-motion:reduce){.mark{transition:none;}.mark[data-tone='running']{animation:none;background:linear-gradient(90deg,var(--status-running) 50%,transparent 50%);box-shadow:inset 0 0 0 1.5px var(--status-running);}}`,V=[Wr,Br,Hr,Vr,Lr,Rr,zr];function Yr(e){switch(e){case`done`:return`done`;case`failed`:return`failed`;case`attention`:return`pending`;default:return null}}var Xr=e=>(e.mark===void 0||!0===e.mark?Yr(e.tone??`neutral`):e.mark||null)??j;function Zr(e){let t=e.tone??`neutral`;return k`<span class="pill ${e.cls??``}" part="pill tone-${t}" data-tone=${L(t)} data-mark=${Xr(e)} title=${e.title||j}>${e.text}</span>`}function Qr(e){let t=e.tone??`neutral`;return k`<span class="jstop ${e.cls??``}" part="status tone-${t}" data-tone=${L(t)} data-mark=${Xr(e)} title=${e.title||j}>${e.text}</span>`}function $r(e,t){let n=t.tone??`neutral`;return k`<span class="${e} ${t.cls??``}" data-tone=${L(n)} data-mark=${Xr(t)} title=${t.title||j}>${t.text}</span>`}var ei=e=>(...t)=>({_$litDirective$:e,values:t}),ti=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},ni=`important`,ri=` !`+ni,ii=ei(class extends ti{constructor(e){if(super(e),e.type!==1||e.name!==`style`||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(e,[t]){let{style:n}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let e of this.ft)t[e]??(this.ft.delete(e),e.includes(`-`)?n.removeProperty(e):n[e]=null);for(let e in t){let r=t[e];if(r!=null){this.ft.add(e);let t=typeof r==`string`&&r.endsWith(ri);e.includes(`-`)||t?n.setProperty(e,t?r.slice(0,-11):r,t?ni:``):n[e]=r}}return $t}});function ai(e,t={}){return k`<div class="legend ${t.cls??``}" part="legend" role="list" aria-label=${t.label||j}>
|
|
8
8
|
${e.map(e=>k`<span role="listitem" aria-hidden=${e.decorative?`true`:j}>${(e=>e.icon??(e.swatch||e.tone||e.shape||e.cls?k`<i class=${e.cls||j} data-tone=${L(e.tone)} data-shape=${e.shape??j} style=${e.swatch?ii({background:e.swatch}):j}></i>`:j))(e)}${e.label}</span>`)}
|
|
@@ -318,46 +318,46 @@ ${n===null?j:r.length?k`<details class="rawfold"><summary>${e.s.fullText}</summa
|
|
|
318
318
|
`)[0]||``).trim();return n.length>100?`${n.slice(0,100)}…`:n}function J(e){let t=e??0;return t<1e3?String(Math.round(t)):t<1e4?`${(t/1e3).toFixed(1).replace(/\.0$/,``)}k`:t<1e6?`${Math.round(t/1e3)}k`:`${(t/1e6).toFixed(1).replace(/\.0$/,``)}M`}function Y(e){return e==null?`—`:e===0?`$0`:e<.001?`<$0.001`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function ns(e){let t=new Map;for(let n of e)for(let[e,r]of Object.entries(n.unread_events??{}))t.set(e,(t.get(e)??0)+r);return[...t].map(([e,t])=>`${e} ×${t}`).join(`, `)}function rs(e){switch(e){case`done`:return E(`done`,{id:`outcome-done`});case`recovered`:return E(`done after retrying`);case`partial`:return E(`partly done`,{id:`outcome-partial`});case`failed`:return E(`failed`);case`not_started`:return E(`not started`);case`running`:return E(`running`);case`waiting`:return E(`waiting`);case`skipped`:return E(`skipped`)}}var is=(e,t)=>e!==`waiting`||t?rs(e):E(`not run`);function X(e,t){switch(e){case`done`:return E(T`${t} done`);case`recovered`:return E(T`${t} done after retrying`);case`partial`:return E(T`${t} partly done`);case`failed`:return E(T`${t} failed`);case`not_started`:return E(T`${t} not started`);case`running`:return E(T`${t} running`);case`waiting`:return E(T`${t} waiting`);case`skipped`:return E(T`${t} skipped`);case`not_run`:return E(T`${t} not run`)}}function as(e,t){return e>0?t:`neutral`}function os(e,t){return e===`running`?`running`:e===`unresponsive`?`attention`:t?.total?t.failed?`failed`:t.not_started||t.partial?`attention`:`done`:`neutral`}var ss={completed:`done`,partial:`attention`,invalid_input:`attention`,skipped:`muted`,timeout:`failed`,max_turns:`failed`,budget:`failed`,context_budget:`failed`,stalled:`failed`,auth_failed:`failed`,api_error:`failed`,rate_limited:`failed`,refused:`failed`,aborted:`failed`,denied:`failed`,error:`failed`,no_output:`failed`,launch_failed:`failed`,invalid_output:`failed`,credential_mismatch:`failed`},cs=(Object.keys(ss),e=>e!=null&&Object.hasOwn(ss,e));function ls(e){return cs(e)?ss[e]:`failed`}function us(e){switch(e){case`done`:case`recovered`:return`done`;case`failed`:return`failed`;case`partial`:case`not_started`:return`attention`;case`running`:return`running`;case`waiting`:case`skipped`:return`muted`}}function ds(e){switch(e){case`valid`:return`done`;case`invalid`:case`failed`:return`failed`;case`refused`:return`attention`;case`running`:return`running`;case`pending`:return`muted`;case null:case void 0:return`neutral`}}var fs=e=>e===`waiting`?`pending`:Yr(us(e));function Z(e,t){return e?cs(e)?function(e,t){switch(e){case`completed`:return E(`done`,{id:`stop-completed`});case`skipped`:return E(`skipped`);case`partial`:return E(`partly done`,{id:`stop-partial`});case`invalid_input`:{let e=new Set(ze(t).map(e=>e.problem));return e.size===1&&e.has(`missing`)?E(`not started (input missing)`):e.size===1&&e.has(`checks`)?E(`not started (input failed checks)`):e.size===1&&e.has(`failed`)?E(`not started (earlier task failed)`):e.size===2&&e.has(`missing`)&&e.has(`checks`)?E(`not started (input missing and input failed checks)`):E(`not started`,{id:`stop-invalid-input`})}case`invalid_output`:return E(`failed checks`);case`timeout`:return E(`timed out`);case`max_turns`:return E(`turn limit reached`);case`budget`:return E(`cost limit reached`);case`context_budget`:return E(`context limit reached`);case`stalled`:return E(`stalled (no events)`);case`auth_failed`:return E(`authentication failed`);case`api_error`:return E(`API error`);case`rate_limited`:return E(`rate limited`);case`refused`:return E(`refused by the model`);case`aborted`:return E(`aborted`);case`denied`:return E(`permission denied`);case`error`:return E(`error`);case`no_output`:return E(`ended without a result`);case`launch_failed`:return E(`agent session did not start`);case`credential_mismatch`:return E(`wrong identity used`)}}(e,t):E(T`unknown (${e})`):`—`}function ps(e,t,n){return t===`failed`?E(n?T`input ${e} is the output of failed task ${n.name}`:T`input ${e} is the output of a failed task`):t===`checks`?E(n?T`input ${e} from ${n.name} failed checks`:T`input ${e} failed checks`):n?n.outcome===`failed`?E(T`input ${e} is missing because ${n.name} failed`):n.outcome===`not_started`?E(T`input ${e} is missing because ${n.name} did not start`):n.outcome&&g(n.outcome)?E(T`input ${e} from ${n.name} is missing`):E(T`input ${e} is missing because ${n.name} did not finish`):E(T`input ${e} is missing`)}function ms(e,t,n,r){let i=e.attempts[e.attempts.length-1];if(i?.stop===`invalid_input`){let e=ze(i.reason)[0];if(!e)return w(i.reason,n);let a=e.producer||r?.(e.path)||``,o=a?t.get(a):void 0;return ps(w(e.path,n),e.problem,o?{name:q(o),outcome:o.outcome}:void 0)}let a=e.cause?t.get(e.cause):void 0;return a?E(T`earlier task ${q(a)} failed`):``}var hs=()=>E(`An attempt after a failed attempt (retries)`),gs=e=>E(T`Attempt ${(e??0)+1}`);function _s(e){let t=le(e),n=e.map((e,n)=>t[n]?K(gs(e.attempt),E(`resumed run`)):gs(e.attempt));return n.map((t,r)=>n.indexOf(t)===n.lastIndexOf(t)?t:K(t,G(e[r]?.ts)))}function vs(e){return e<=0?``:E(e===1?`1 correction`:T`${e} corrections`)}var ys=e=>E(T`Pass ${e}`),bs=e=>E(e<=1?`1 pass`:T`up to ${e} passes`),xs=e=>E(e<=1?`1 pass`:T`${e} passes`),Ss=e=>e.map(([e,t])=>E(e<=1?T`1 pass: ${t}`:T`${e} passes: ${t}`)).join(` | `),Cs=()=>E(`loop`),ws=e=>e?e===`ambient`?E(`default`):e:``,Ts=e=>e===`ambient`?E(`local credentials (ambient)`):``,Es=e=>e==null?`—`:`${Math.round(e)}%`;function Ds(e,t){if(!e||e===`allowed`)return``;let n=e.split(`,`),r=n.some(e=>[`rejected`,`exhausted`,`quota`,`blocked`].includes(e))?E(`limit reached`):n.every(e=>[`allowed_warning`,`warning`].includes(e))?E(`near the limit`):E(T`unknown (${e})`);return t?K(r,Os(t)):r}function Os(e){if(e===`five_hour`)return E(`5-hour`);if(e===`seven_day`)return E(`weekly`);let t=/^(five_hour|seven_day)_(.+)$/.exec(e);return t?t[1]===`five_hour`?E(T`5-hour (${t[2]})`):E(T`weekly (${t[2]})`):e}var ks=e=>E(T`account ${e.slice(0,6)}`),As=e=>K(E(T`weekly ${Es(e.seven_day_pct)}`),E(T`5-hour ${Es(e.five_hour_pct)}`));function js(e){let t=[e.seven_day_resets_at?E(T`Weekly usage ${Es(e.seven_day_pct)} (resets ${G(e.seven_day_resets_at,!0)})`):E(T`Weekly usage ${Es(e.seven_day_pct)}`),e.five_hour_resets_at?E(T`5-hour usage ${Es(e.five_hour_pct)} (resets ${G(e.five_hour_resets_at,!0)})`):E(T`5-hour usage ${Es(e.five_hour_pct)}`),...Object.entries(e.windows??{}).filter(([e])=>e!==`five_hour`&&e!==`seven_day`).map(([e,t])=>E(T`${Zo(Os(e))} usage ${Es(t.pct)}`)),E(T`Reported ${G(e.observed_at,!0)}`)],n=Ds(e.status,e.status_window);return n&&t.push(E(T`Status: ${n}`)),e.threshold_pct!=null&&t.push(E(T`Warning threshold: ${Es(e.threshold_pct)}`)),e.overage_status&&t.push(E(T`Extra usage: ${function(e){return e===`allowed`||e===`allowed_warning`?E(`allowed`):e===`rejected`?E(`not allowed`):e}(e.overage_status)}`)),e.account&&t.push(E(T`Account: ${e.account}`)),t.join(`
|
|
319
319
|
`)}var Ms=e=>K(As(e),ws(e.credential));function Ns(e){let t=e[0];if(!t)return``;let n=e.length-1;return n?K(Ms(t.last),E(n===1?`1 more account`:T`${n} more accounts`)):As(t.last)}var Ps=e=>e.map(e=>e.credential?`${ws(e.credential)}\n${js(e.last)}`:js(e.last)).join(`
|
|
320
320
|
|
|
321
|
-
`);function Fs(e,t){return E(e===`seven_day`?T`Weekly usage ${Es(t)}`:T`5-hour usage ${Es(t)}`)}var Is=e=>e==null?`—`:`${Number(e.toFixed(2))}%`,Ls=e=>E(T`limit ${Is(e)}`);function Rs(e){return e.rule?E(T`Usage rule: ${e.rule}`):K(Fs(e.window??``,e.pct),Ls(e.cap),e.until?E(T`until ${G(e.until,!0)}`):``)}var zs=e=>K(E(T`Identity ${ws(e.credential)} paused`),Rs(e));function Bs(e){let t=new Set;return e.filter(e=>!t.has(e.credential)&&t.add(e.credential))}function Vs(e,t=``,n=``){let r=n?n.slice(n.lastIndexOf(`.`)+1):``;switch(e?.cause){case`deadline`:return E(r?T`Past the deadline of ${r}`:`Past the deadline`);case`grace_window`:return E(r?T`Past the deadline of ${r} and its finishing time`:`Past the deadline and its finishing time`);case`cannot_finish`:return K(E(r?T`Cannot finish before the deadline of ${r}`:`Cannot finish before the deadline`),e.need_s==null?``:E(T`needs ${B(e.need_s)}`),e.left_s==null?``:E(T`${B(e.left_s)} left`));case`dependency_not_queued`:return E(`An earlier task was never scheduled`);case`dependency_deferred`:return E(`An earlier task was not run`);case`rest`:{let n=Bs(e.rests??[]);return n.length?n.length===1?zs(n[0]):K(zs(n[0]),E(T`+${n.length-1} paused identities`)):t}default:return t}}var Hs=e=>E(T`${e.model||e.route||`—`} (identity paused)`);function Us(e){if(!e||e.five_hour_pct==null&&e.seven_day_pct==null)return``;let t=K(e.seven_day_pct==null?``:E(T`weekly ${Is(e.seven_day_pct)}`),e.five_hour_pct==null?``:E(T`5-hour ${Is(e.five_hour_pct)}`));return E(T`Limits: ${t}`)}var Ws=()=>E(`A new agent session on the next model after a failed one (Router hops)`),Gs=e=>e.model||e.route||`—`;function Ks(e,t,n){let r=[...new Map((n??[]).map(e=>[e.route||e.model,e])).values()];if(!e||e.length+r.length<2||!e.length)return``;let i=[...r.map(Hs),...e.map((t,n)=>n<e.length-1?E(T`${Gs(t)} (${Z(t.stop)})`):Gs(t))].join(` → `);return t==null?i:`${i} | ${B(t)}`}function qs(e){switch(e){case`valid`:return E(`passed`);case`invalid`:return E(`failed checks`);case`refused`:return E(`not written (task not started)`);case`failed`:return E(`not written (task failed)`);case`running`:return E(`not written yet (task running)`);case`pending`:return E(`not written yet (task waiting)`)}}function Js(e){return e===`failed`?E(`The task failed before it wrote a file that passes its checks`):``}var Ys=()=>E(`Another round in the same agent session after failed checks (rounds)`);function Xs(e,t){let n=(e??1)-1;return n<1?``:E(t?n===1?`after 1 correction`:T`after ${n} corrections`:n===1?`1 correction`:T`${n} corrections`)}function Zs(e,t,n){let r=e.errors??[],i=ze(`invalid input: ${r.map(e=>e.replace(/^invalid input:\s*/,``)).join(`; `)}`)[0];if(!i)return r[0]?Zo(w(r[0],t)):``;let a=n?.(i.path);return Zo(ps(w(i.path,t),i.problem,a))}var Qs=(e,t)=>e.ready?Le(e.journal):t.quota??[],$s=e=>E(T`Agent sessions played from the recordings in ${e} (replay)`),ec=e=>!!e?.replay&&!e.stub,tc=()=>E(`replayed`),nc=()=>E(`Played from a recording (replayed)`);function rc(e){return e?.replay&&ec(e)?{text:E(`replay and new sessions`),title:(t=e.replay,E(T`Agent sessions played from the recordings in ${t}, and new agent sessions recorded there (replay, record_missing)`))}:e?.replay?{text:E(`replay`),title:$s(e.replay)}:e?.stub?{text:E(`stub agent`),title:E(`Tasks played by the stub agent with scripted replies (stub)`)}:null;var t}var ic=()=>E(`no report from host`),ac=e=>e.up?E(`up`):E(`no report`),oc=e=>e?.last_seen?E(T`Last report ${G(e.last_seen,!0)}`):``,sc=e=>E(e?T`Host ${e}`:`No host id`),cc=e=>E(e===1?`1 run`:T`${e} runs`);function lc(e){let t=e.filter(e=>!e.up).length;return K(e.length===1?E(`1 host`):E(T`${e.length} hosts`),t?E(T`${t} with no report`):``)}var uc=e=>({empty:e,sortAscending:E(`Sort ascending`),sortDescending:E(`Sort descending`)}),dc=()=>E(`Names this task holds while it runs (claims)`);function fc(e){switch(e){case`running`:return E(`running`,{id:`service-running`});case`stopped`:return E(`stopped`);case`failed`:return E(`did not start`);default:return E(`stop not recorded`)}}var pc=()=>E(`A deadline of its own (time_box)`),mc=()=>E(`Custom column (row_extras)`);function hc(e){if(e==null||e===``)return`—`;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)??`—`}catch{return`—`}}function gc(e,t){let n=e;return t.filter(e=>n[e]!==null&&n[e]!==void 0&&n[e]!==``).map(e=>[e,hc(n[e])])}function _c(e){switch(e){case`cost`:return E(`Cost`);case`tokens`:return E(`Tokens`);case`time`:return E(`Time`);case`sessions`:return E(`Agent sessions`)}}function vc(e){switch(e){case`cost`:return E(`Reported by the coding agent`);case`tokens`:return E(`Input, output, cache read and cache write`);case`time`:return E(`Time of the agent sessions, summed`);case`sessions`:return E(`Agent sessions started on the model`)}}function yc(e,t){switch(t){case`cost`:return e.cost_usd===null||e.cost_usd===void 0?`—`:Y(e.cost_usd);case`tokens`:return J(Ae(e));case`time`:return B(e.wall_s??0);case`sessions`:return String(e.sessions)}}function bc(e){let t=100*e;return t>0&&t<.05?`<0.1%`:Math.abs(t)<10?Math.round(10*t)/10+`%`:`${Math.round(t)}%`}var xc=e=>String(Math.round(100*e)/100);function Sc(e){switch(e){case`usd`:return Y;case`pct`:return bc;case`duration`:return B;case`tokens`:return J;default:return xc}}function Cc(e,t){return e==null||e===``?`—`:t===`datetime`&&typeof e==`string`?G(e,!0)||e:typeof e==`number`?Sc(t)(e):typeof e==`boolean`?String(e):typeof e==`string`?e:JSON.stringify(e)}var wc=e=>E(T`Exported ${G(e.exported_at,!0)}`);function Tc(e){return e===`transcripts`?E(`transcripts`):e===`processes`?E(`processes`):e}var Ec=e=>E(T`Not in this export: ${es(e.left_out.map(Tc))}`),Dc=()=>E(`not in this export`),Oc=()=>E(`Trends`),kc=()=>E(`Totals of the runs in a period`);function Ac(e,t=I()){let n=new Date(`${e}T12:00:00Z`);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{month:`short`,day:`numeric`,timeZone:`UTC`}).format(n)}var jc=e=>E(T`${e} days`);function Mc(e=I()){let t=new Intl.DateTimeFormat(e,{weekday:`short`,timeZone:`UTC`});return Array.from({length:7},(e,n)=>t.format(new Date(Date.UTC(2026,9,12+n,12))))}var Nc=()=>({runs:E(`Runs`,{id:`trends-runs`}),attempts:E(`Attempts`),done:E(`Done`),cost:E(`Cost`),tokens:E(`Tokens`),time:E(`Time`),costByDay:E(`Cost by day`),costByDayTip:E(`Reported by the coding agent, on the day each attempt ended`),kinds:E(`Kinds`),kind:E(`Kind`),group:E(`Group`),tasks:E(`Tasks`),tasksDone:E(`Tasks done`),partial:E(`Partly done`,{id:`trends-partial`}),medianTime:E(`Median time`),totalTime:E(`Total time`),models:E(`Models`),model:E(`Model`),sessions:E(`Agent sessions`),calls:E(`API calls`),input:E(`Input`),output:E(`Output`),cacheRead:E(`Cache read`),cacheWrite:E(`Cache write`),outcomes:E(`Attempts not done`),outcome:E(`Outcome`),denials:E(`Denied tool calls`),toolCalls:E(`Tool calls`),pythonKinds:E(`Python tasks`),tool:E(`Tool`),usage:E(`Subscription usage`),usageTip:E(`The highest reading of each day`),deferred:E(`Not run`),cause:E(`Cause`),task:E(`Task`),when:E(`When`),rests:E(`Paused identities`),identity:E(`Identity`),event:E(`Event`),starts:E(`Run starts`),startsTip:E(`By weekday and hour, in the period's time zone`),run:E(`Run`),started:E(`Started`),trendPanels:E(`Custom views`)}),Pc=(e,t)=>`${e} | ${t}`,Fc=e=>{let t=/^(\S+) rests\b/.exec(e)?.[1];return E(t?T`Identity ${t} paused`:`Identity paused`)},Ic=(e,t)=>`${e} | ${t}`,Lc=e=>e?E(T`Priority ${e}`):``,Rc=()=>E(`Tie-breaker in the queue's order (priority)`),zc=()=>E(`Peak context`),Bc=()=>E(`Largest input of one API call, cache read and cache write included (peak_context)`);function Vc(e){let t=e.usage?.peak_context;return t==null?``:E(T`Peak context: ${function(e,t){let n=t?Math.round(100*e/t):null;return K(J(e),n===null?``:E(T`${n}% of the context limit ${J(t)}`))}(t,e.context_budget)}`)}function Hc(e){let t=e.usage?.peak_context,n=e.context_budget;return E(t!=null&&n?T`near the context limit (${Math.round(100*t/n)}%)`:`near the context limit`)}var Uc=()=>E(`Peak context above the warning threshold (context_warned)`),Wc=(e,t)=>t?`${e} / ${t}`:e,Gc=e=>K(Wc(e.agent,e.model),e.credential?E(T`identity ${ws(e.credential)}`):``,e.reason,e.kinds.length?E(T`kinds ${es(e.kinds)}`):``),Kc=e=>K(e.kind,`${Wc(e.from_agent,e.from_model)} → ${Wc(e.to_agent,e.to_model)}`),qc=()=>E(`No available model`),Jc=()=>E(`Must stay unchanged`),Yc=()=>E(`Parts of the output file kept as before the task (preserve)`),Xc=()=>E(`Safety stops`),Zc=e=>E(e===1?`1 safety stop`:T`${e} safety stops`),Qc=()=>E(`A safety classifier stopped part of the agent session, and the session went on (safety_stops)`);function $c(e){switch(e){case`response`:return E(`model response`);case`tool`:return E(`tool request`);case`unread`:return E(`unrecognized`);default:return e||`—`}}var el=e=>K($c(e.part),e.model,e.category,e.tool,G(e.ts,!0));function tl({url:e,failure:t,status:n,type:r}){let i=t===`network`?E(`network error, no response`):t===`status`?E(T`the response status is ${n}`):r.includes(`html`)?E(`the response is HTML, not JSON`):E(`the response is not JSON`);return E(T`No monitor API at ${e}: ${i}`)}function nl(e,t){let n=q(e),r=w(e.reason,t).slice(0,110);if(e.stop===`invalid_input`)return[`attention`,E(T`${n}: not started`),r];if(ce(e))return[`failed`,E(T`${n}: ${Z(e.stop)}`),r];if(e.stop===`partial`)return[`attention`,E(T`${n}: ${Z(e.stop)}`),r];let i=Ks(e.hops,e.wall_s,e.skipped_hops);return i?[`agent`,E(T`${n}: model switch`),i.slice(0,110)]:[`done`,E(T`${n}: done`),K(B(e.wall_s),e.model)]}z(`cae-segmented`,Ei);var rl={done:`✓`,failed:`✕`,attention:`◌`,running:`●`,agent:`✦`},il=class extends M{constructor(...e){super(...e),this.toasts=[],this.next=0}static{this.styles=[V,O` :host{position:fixed;right:18px;bottom:18px;display:flex;flex-direction:column;gap:8px;z-index:60;pointer-events:none;}.toast{pointer-events:auto;min-width:240px;max-width:380px;padding:10px 14px;border-radius:11px;background:var(--panel2);border:1px solid var(--line2);box-shadow:0 18px 40px color-mix(in srgb,var(--shadow) 60%,transparent);display:flex;gap:10px;align-items:flex-start;animation:toast-in 0.35s var(--ease) both;}.toast.out{animation:toast-out 0.35s var(--ease) both;}.ti{font-size:16px;line-height:1.2;}b{display:block;font-size:12.5px;}span.sub{font-size:11.5px;color:var(--text-muted);}.ti{color:var(--text-muted);}.toast[data-tone] .ti{color:var(--tone);}.toast[data-tone='failed'],.toast[data-tone='attention']{border-color:color-mix(in srgb,var(--tone) 50%,var(--line2));}.agent .ti{color:var(--agent);}`]}show(e,t,n=``){let r={id:this.next++,kind:e,title:t,sub:n,out:!1};this.toasts=[...this.toasts,r].slice(-4),setTimeout(()=>{this.toasts=this.toasts.map(e=>e.id===r.id?{...e,out:!0}:e),setTimeout(()=>this.toasts=this.toasts.filter(e=>e.id!==r.id),400)},5200)}render(){let e=e=>H(this.toasts.filter(t=>!t.out&&t.kind===`failed`===e),e=>e.id,e=>k`<p>${K(e.title,e.sub)}</p>`);return k`<div class="sr" role="status" aria-live="polite">${e(!1)}</div>
|
|
321
|
+
`);function Fs(e,t){return E(e===`seven_day`?T`Weekly usage ${Es(t)}`:T`5-hour usage ${Es(t)}`)}var Is=e=>e==null?`—`:`${Number(e.toFixed(2))}%`,Ls=e=>E(T`limit ${Is(e)}`),Rs=e=>K(E(`Authentication failed`),e.model??``);function zs(e){return e.stop?Rs(e):e.rule?E(T`Usage rule: ${e.rule}`):K(Fs(e.window??``,e.pct),Ls(e.cap),e.until?E(T`until ${G(e.until,!0)}`):``)}var Bs=e=>K(E(T`Identity ${ws(e.credential)} paused`),zs(e));function Vs(e){let t=new Set;return e.filter(e=>!t.has(e.credential)&&t.add(e.credential))}function Hs(e,t=``,n=``){let r=n?n.slice(n.lastIndexOf(`.`)+1):``;switch(e?.cause){case`deadline`:return E(r?T`Past the deadline of ${r}`:`Past the deadline`);case`grace_window`:return E(r?T`Past the deadline of ${r} and its finishing time`:`Past the deadline and its finishing time`);case`cannot_finish`:return K(E(r?T`Cannot finish before the deadline of ${r}`:`Cannot finish before the deadline`),e.need_s==null?``:E(T`needs ${B(e.need_s)}`),e.left_s==null?``:E(T`${B(e.left_s)} left`));case`dependency_not_queued`:return E(`An earlier task was never scheduled`);case`dependency_deferred`:return E(`An earlier task was not run`);case`rest`:{let n=Vs(e.rests??[]);return n.length?n.length===1?Bs(n[0]):K(Bs(n[0]),E(T`+${n.length-1} paused identities`)):t}default:return t}}var Us=e=>E(T`${e.model||e.route||`—`} (identity paused)`);function Ws(e){if(!e||e.five_hour_pct==null&&e.seven_day_pct==null)return``;let t=K(e.seven_day_pct==null?``:E(T`weekly ${Is(e.seven_day_pct)}`),e.five_hour_pct==null?``:E(T`5-hour ${Is(e.five_hour_pct)}`));return E(T`Limits: ${t}`)}var Gs=()=>E(`A new agent session on the next model after a failed one (Router hops)`),Ks=e=>e.model||e.route||`—`;function qs(e,t,n){let r=[...new Map((n??[]).map(e=>[e.route||e.model,e])).values()];if(!e||e.length+r.length<2||!e.length)return``;let i=[...r.map(Us),...e.map((t,n)=>n<e.length-1?E(T`${Ks(t)} (${Z(t.stop)})`):Ks(t))].join(` → `);return t==null?i:`${i} | ${B(t)}`}function Js(e){switch(e){case`valid`:return E(`passed`);case`invalid`:return E(`failed checks`);case`refused`:return E(`not written (task not started)`);case`failed`:return E(`not written (task failed)`);case`running`:return E(`not written yet (task running)`);case`pending`:return E(`not written yet (task waiting)`)}}function Ys(e){return e===`failed`?E(`The task failed before it wrote a file that passes its checks`):``}var Xs=()=>E(`Another round in the same agent session after failed checks (rounds)`);function Zs(e,t){let n=(e??1)-1;return n<1?``:E(t?n===1?`after 1 correction`:T`after ${n} corrections`:n===1?`1 correction`:T`${n} corrections`)}function Qs(e,t,n){let r=e.errors??[],i=ze(`invalid input: ${r.map(e=>e.replace(/^invalid input:\s*/,``)).join(`; `)}`)[0];if(!i)return r[0]?Zo(w(r[0],t)):``;let a=n?.(i.path);return Zo(ps(w(i.path,t),i.problem,a))}var $s=(e,t)=>e.ready?Le(e.journal):t.quota??[],ec=e=>E(T`Agent sessions played from the recordings in ${e} (replay)`),tc=e=>!!e?.replay&&!e.stub,nc=()=>E(`replayed`),rc=()=>E(`Played from a recording (replayed)`);function ic(e){return e?.replay&&tc(e)?{text:E(`replay and new sessions`),title:(t=e.replay,E(T`Agent sessions played from the recordings in ${t}, and new agent sessions recorded there (replay, record_missing)`))}:e?.replay?{text:E(`replay`),title:ec(e.replay)}:e?.stub?{text:E(`stub agent`),title:E(`Tasks played by the stub agent with scripted replies (stub)`)}:null;var t}var ac=()=>E(`no report from host`),oc=e=>e.up?E(`up`):E(`no report`),sc=e=>e?.last_seen?E(T`Last report ${G(e.last_seen,!0)}`):``,cc=e=>E(e?T`Host ${e}`:`No host id`),lc=e=>E(e===1?`1 run`:T`${e} runs`);function uc(e){let t=e.filter(e=>!e.up).length;return K(e.length===1?E(`1 host`):E(T`${e.length} hosts`),t?E(T`${t} with no report`):``)}var dc=e=>({empty:e,sortAscending:E(`Sort ascending`),sortDescending:E(`Sort descending`)}),fc=()=>E(`Names this task holds while it runs (claims)`);function pc(e){switch(e){case`running`:return E(`running`,{id:`service-running`});case`stopped`:return E(`stopped`);case`failed`:return E(`did not start`);default:return E(`stop not recorded`)}}var mc=()=>E(`A deadline of its own (time_box)`),hc=()=>E(`Custom column (row_extras)`);function gc(e){if(e==null||e===``)return`—`;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)??`—`}catch{return`—`}}function _c(e,t){let n=e;return t.filter(e=>n[e]!==null&&n[e]!==void 0&&n[e]!==``).map(e=>[e,gc(n[e])])}function vc(e){switch(e){case`cost`:return E(`Cost`);case`tokens`:return E(`Tokens`);case`time`:return E(`Time`);case`sessions`:return E(`Agent sessions`)}}function yc(e){switch(e){case`cost`:return E(`Reported by the coding agent`);case`tokens`:return E(`Input, output, cache read and cache write`);case`time`:return E(`Time of the agent sessions, summed`);case`sessions`:return E(`Agent sessions started on the model`)}}function bc(e,t){switch(t){case`cost`:return e.cost_usd===null||e.cost_usd===void 0?`—`:Y(e.cost_usd);case`tokens`:return J(Ae(e));case`time`:return B(e.wall_s??0);case`sessions`:return String(e.sessions)}}function xc(e){let t=100*e;return t>0&&t<.05?`<0.1%`:Math.abs(t)<10?Math.round(10*t)/10+`%`:`${Math.round(t)}%`}var Sc=e=>String(Math.round(100*e)/100);function Cc(e){switch(e){case`usd`:return Y;case`pct`:return xc;case`duration`:return B;case`tokens`:return J;default:return Sc}}function wc(e,t){return e==null||e===``?`—`:t===`datetime`&&typeof e==`string`?G(e,!0)||e:typeof e==`number`?Cc(t)(e):typeof e==`boolean`?String(e):typeof e==`string`?e:JSON.stringify(e)}var Tc=e=>E(T`Exported ${G(e.exported_at,!0)}`);function Ec(e){return e===`transcripts`?E(`transcripts`):e===`processes`?E(`processes`):e}var Dc=e=>E(T`Not in this export: ${es(e.left_out.map(Ec))}`),Oc=()=>E(`not in this export`),kc=()=>E(`Trends`),Ac=()=>E(`Totals of the runs in a period`);function jc(e,t=I()){let n=new Date(`${e}T12:00:00Z`);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{month:`short`,day:`numeric`,timeZone:`UTC`}).format(n)}var Mc=e=>E(T`${e} days`);function Nc(e=I()){let t=new Intl.DateTimeFormat(e,{weekday:`short`,timeZone:`UTC`});return Array.from({length:7},(e,n)=>t.format(new Date(Date.UTC(2026,9,12+n,12))))}var Pc=()=>({runs:E(`Runs`,{id:`trends-runs`}),attempts:E(`Attempts`),done:E(`Done`),cost:E(`Cost`),tokens:E(`Tokens`),time:E(`Time`),costByDay:E(`Cost by day`),costByDayTip:E(`Reported by the coding agent, on the day each attempt ended`),kinds:E(`Kinds`),kind:E(`Kind`),group:E(`Group`),tasks:E(`Tasks`),tasksDone:E(`Tasks done`),partial:E(`Partly done`,{id:`trends-partial`}),medianTime:E(`Median time`),totalTime:E(`Total time`),models:E(`Models`),model:E(`Model`),sessions:E(`Agent sessions`),calls:E(`API calls`),input:E(`Input`),output:E(`Output`),cacheRead:E(`Cache read`),cacheWrite:E(`Cache write`),outcomes:E(`Attempts not done`),outcome:E(`Outcome`),denials:E(`Denied tool calls`),toolCalls:E(`Tool calls`),pythonKinds:E(`Python tasks`),tool:E(`Tool`),usage:E(`Subscription usage`),usageTip:E(`The highest reading of each day`),deferred:E(`Not run`),cause:E(`Cause`),task:E(`Task`),when:E(`When`),rests:E(`Paused identities`),identity:E(`Identity`),event:E(`Event`),starts:E(`Run starts`),startsTip:E(`By weekday and hour, in the period's time zone`),run:E(`Run`),started:E(`Started`),trendPanels:E(`Custom views`)}),Fc=(e,t)=>`${e} | ${t}`,Ic=e=>{let t=/^(\S+) rests\b/.exec(e)?.[1];return E(t?T`Identity ${t} paused`:`Identity paused`)},Lc=(e,t)=>`${e} | ${t}`,Rc=e=>e?E(T`Priority ${e}`):``,zc=()=>E(`Tie-breaker in the queue's order (priority)`),Bc=()=>E(`Peak context`),Vc=()=>E(`Largest input of one API call, cache read and cache write included (peak_context)`);function Hc(e){let t=e.usage?.peak_context;return t==null?``:E(T`Peak context: ${function(e,t){let n=t?Math.round(100*e/t):null;return K(J(e),n===null?``:E(T`${n}% of the context limit ${J(t)}`))}(t,e.context_budget)}`)}function Uc(e){let t=e.usage?.peak_context,n=e.context_budget;return E(t!=null&&n?T`near the context limit (${Math.round(100*t/n)}%)`:`near the context limit`)}var Wc=()=>E(`Peak context above the warning threshold (context_warned)`),Gc=(e,t)=>t?`${e} / ${t}`:e,Kc=e=>K(Gc(e.agent,e.model),e.credential?E(T`identity ${ws(e.credential)}`):``,e.reason,e.kinds.length?E(T`kinds ${es(e.kinds)}`):``),qc=e=>K(e.kind,`${Gc(e.from_agent,e.from_model)} → ${Gc(e.to_agent,e.to_model)}`),Jc=()=>E(`No available model`),Yc=()=>E(`Must stay unchanged`),Xc=()=>E(`Parts of the output file kept as before the task (preserve)`),Zc=()=>E(`Safety stops`),Qc=e=>E(e===1?`1 safety stop`:T`${e} safety stops`),$c=()=>E(`A safety classifier stopped part of the agent session, and the session went on (safety_stops)`);function el(e){switch(e){case`response`:return E(`model response`);case`tool`:return E(`tool request`);case`unread`:return E(`unrecognized`);default:return e||`—`}}var tl=e=>K(el(e.part),e.model,e.category,e.tool,G(e.ts,!0));function nl({url:e,failure:t,status:n,type:r}){let i=t===`network`?E(`network error, no response`):t===`status`?E(T`the response status is ${n}`):r.includes(`html`)?E(`the response is HTML, not JSON`):E(`the response is not JSON`);return E(T`No monitor API at ${e}: ${i}`)}function rl(e,t){let n=q(e),r=w(e.reason,t).slice(0,110);if(e.stop===`invalid_input`)return[`attention`,E(T`${n}: not started`),r];if(ce(e))return[`failed`,E(T`${n}: ${Z(e.stop)}`),r];if(e.stop===`partial`)return[`attention`,E(T`${n}: ${Z(e.stop)}`),r];let i=qs(e.hops,e.wall_s,e.skipped_hops);return i?[`agent`,E(T`${n}: model switch`),i.slice(0,110)]:[`done`,E(T`${n}: done`),K(B(e.wall_s),e.model)]}z(`cae-segmented`,Ei);var il={done:`✓`,failed:`✕`,attention:`◌`,running:`●`,agent:`✦`},al=class extends M{constructor(...e){super(...e),this.toasts=[],this.next=0}static{this.styles=[V,O` :host{position:fixed;right:18px;bottom:18px;display:flex;flex-direction:column;gap:8px;z-index:60;pointer-events:none;}.toast{pointer-events:auto;min-width:240px;max-width:380px;padding:10px 14px;border-radius:11px;background:var(--panel2);border:1px solid var(--line2);box-shadow:0 18px 40px color-mix(in srgb,var(--shadow) 60%,transparent);display:flex;gap:10px;align-items:flex-start;animation:toast-in 0.35s var(--ease) both;}.toast.out{animation:toast-out 0.35s var(--ease) both;}.ti{font-size:16px;line-height:1.2;}b{display:block;font-size:12.5px;}span.sub{font-size:11.5px;color:var(--text-muted);}.ti{color:var(--text-muted);}.toast[data-tone] .ti{color:var(--tone);}.toast[data-tone='failed'],.toast[data-tone='attention']{border-color:color-mix(in srgb,var(--tone) 50%,var(--line2));}.agent .ti{color:var(--agent);}`]}show(e,t,n=``){let r={id:this.next++,kind:e,title:t,sub:n,out:!1};this.toasts=[...this.toasts,r].slice(-4),setTimeout(()=>{this.toasts=this.toasts.map(e=>e.id===r.id?{...e,out:!0}:e),setTimeout(()=>this.toasts=this.toasts.filter(e=>e.id!==r.id),400)},5200)}render(){let e=e=>H(this.toasts.filter(t=>!t.out&&t.kind===`failed`===e),e=>e.id,e=>k`<p>${K(e.title,e.sub)}</p>`);return k`<div class="sr" role="status" aria-live="polite">${e(!1)}</div>
|
|
322
322
|
<div class="sr" role="alert" aria-live="assertive">${e(!0)}</div>
|
|
323
323
|
<div aria-hidden="true" style="display:contents">
|
|
324
324
|
${H(this.toasts,e=>e.id,e=>k`<div class="toast ${e.kind===`agent`?`agent`:``} ${e.out?`out`:``}" data-tone=${e.kind===`agent`?j:e.kind}>
|
|
325
|
-
<span class="ti">${
|
|
325
|
+
<span class="ti">${il[e.kind]}</span>
|
|
326
326
|
<div><b>${e.title}</b>${e.sub?k`<span class="sub">${e.sub}</span>`:j}</div>
|
|
327
327
|
</div>`)}
|
|
328
|
-
</div>`}};U([F()],
|
|
329
|
-
<summary>${
|
|
330
|
-
${
|
|
328
|
+
</div>`}};U([F()],al.prototype,`toasts`,void 0),al=U([N(`ca-toasts`)],al);var ol=O` :host{display:flex;flex-direction:column;height:100%;min-height:0;font:13px/1.5 var(--sans);color:var(--text);background:var(--backdrop);container:ca-monitor / inline-size;}header{flex:none;display:flex;gap:14px;align-items:center;padding:10px 18px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--bg) 75%,transparent);backdrop-filter:blur(10px);position:relative;z-index:20;}.brand{display:flex;align-items:center;gap:8px;font-weight:700;font-size:15px;letter-spacing:0.02em;}.brand{flex:none;max-width:30cqi;white-space:nowrap;}.brand span{overflow:hidden;text-overflow:ellipsis;}.brand svg{width:22px;height:22px;flex:none;}.logo-braces{stroke:var(--text);}.spark-a{stop-color:var(--accent);}.spark-b{stop-color:var(--agent);}.logo-spark{transform-origin:60px 60px;}:host([live]) .logo-spark{animation:core-beat 1.8s var(--ease) infinite;}.runbtn{display:flex;align-items:center;gap:10px;min-width:min(150px,100%);max-width:52cqi;cursor:pointer;padding:6px 13px;border-radius:999px;background:var(--panel);border:1px solid var(--line);color:var(--text);transition:border-color 0.2s,background 0.2s;}.runbtn:hover{border-color:var(--line2);background:var(--panel2);}.rn{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:none;max-width:40%;}.rs{color:var(--text-muted);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.chev{color:var(--text-muted);}.hostchip{flex:none;font-family:var(--mono);font-size:11px;color:var(--text-2);padding:0 7px;border:1px solid var(--line2);border-radius:999px;white-space:nowrap;max-width:24ch;overflow:hidden;text-overflow:ellipsis;}.runbtn .pill{flex:none;font-size:11px;}ca-run-picker{inset-inline-start:110px;}.hdr-right{margin-left:auto;display:flex;align-items:center;gap:12px;flex:none;white-space:nowrap;}.nowline{font-size:12px;color:var(--text-2);white-space:nowrap;overflow:hidden;max-width:40cqi;display:inline-flex;align-items:center;gap:4px;}.clock{font-family:var(--mono);font-size:11.5px;color:var(--text-muted);}.langs{--cae-segmented-radius:999px;--cae-segmented-height:auto;--cae-segmented-padding:2px 9px;--cae-segmented-font-size:11px;--cae-segmented-divider:0;--cae-segmented-hover:var(--text-2);}.live-dot{width:9px;height:9px;border-radius:50%;background:var(--status-running);display:inline-block;animation:breathe 1.8s ease-in-out infinite;}.live-dot.off{background:var(--line2);animation:none;box-shadow:none;}.bar{flex:none;display:flex;gap:8px;padding:8px 18px;border-top:1px solid var(--line);align-items:center;flex-wrap:wrap;}.bar select,.bar input{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:5px 9px;outline:none;font:inherit;font-size:12px;}.bar input:focus,.bar select:focus{border-color:var(--focus);box-shadow:0 0 0 calc(var(--focus-width) - 2px) var(--focus);}.api-error{flex:none;margin:0;padding:8px 18px;color:var(--status-failed);font:12px var(--mono);overflow-wrap:anywhere;}.api-error:empty{padding:0;}main{border-top:1px solid var(--line);flex:1 1 auto;min-height:0;overflow:auto;padding:16px 18px 48px;}main.stream{display:flex;flex-direction:column;overflow:hidden;padding-bottom:16px;}@container ca-monitor (max-width:1000px){header{flex-wrap:wrap;row-gap:8px;}}@container ca-monitor (max-width:760px){header{gap:8px;padding:8px 12px;}.runbtn{flex:1 1 0;min-width:0;max-width:none;}ca-run-picker{inset-inline:16px;width:auto;}.hdr-right{width:100%;margin-left:0;flex-wrap:wrap;row-gap:6px;}.nowline{max-width:none;flex:1 1 100%;}main{padding:12px 12px 40px;}.bar{padding:8px 12px;}.bar input{flex:1 1 10em;min-width:0;}}@container ca-monitor (max-width:420px){.brand{max-width:40cqi;}.runbtn{padding:6px 10px;gap:8px;}}`;function sl(e){return[...[{id:`overview`,label:E(`Overview`),icon:`◎`},{id:`tasks`,label:E(`Tasks`,{id:`tab-tasks`}),icon:`≡`},{id:`journal`,label:E(`History`),icon:`▤`,tip:`journal.jsonl`},{id:`outputs`,label:E(`Outputs`),icon:`▣`},{id:`definitions`,label:E(`Definitions`),icon:`⌘`},{id:`procs`,label:E(`Processes`),icon:`⚙`},{id:`stream`,label:E(`Task detail`),icon:`✦`}].map(e=>({...e,panel:!1})),...e.filter(ge).map(e=>({id:`panel:${e.name}`,label:e.title||e.name,icon:e.icon||`▤`,tip:e.description?E(T`${e.description} (custom view)`):E(`Custom view`),panel:!0}))]}var cl=e=>`tab-${e}`;function ll(e){let t=e.querySelector(`.tab.sel`),n=e.querySelector(`.tab-ind`);if(!t||!n)return;n.style.left=`${t.offsetLeft+10}px`,n.style.width=`${Math.max(12,t.offsetWidth-20)}px`,n.classList.contains(`init`)&&requestAnimationFrame(()=>n.classList.remove(`init`));let r=n.parentElement;r&&n.dataset.tab!==t.id&&(n.dataset.tab=t.id,t.offsetLeft-24<r.scrollLeft?r.scrollLeft=Math.max(0,t.offsetLeft-24):t.offsetLeft+t.offsetWidth+24>r.scrollLeft+r.clientWidth&&(r.scrollLeft=t.offsetLeft+t.offsetWidth+24-r.clientWidth))}var ul=O` nav{flex:none;display:flex;gap:2px;padding:6px 18px 0;position:relative;overflow-x:auto;scrollbar-width:none;align-items:center;--shade:color-mix(in srgb,var(--text) 22%,transparent);background:linear-gradient(to right,var(--backdrop) 40%,transparent) left / 32px 100% no-repeat local,linear-gradient(to left,var(--backdrop) 40%,transparent) right / 32px 100% no-repeat local,radial-gradient(farthest-side at 0 50%,var(--shade),transparent) left / 12px 100% no-repeat scroll,radial-gradient(farthest-side at 100% 50%,var(--shade),transparent) right / 12px 100% no-repeat scroll;}nav::-webkit-scrollbar{display:none;}.tabs{flex:none;display:flex;gap:2px;align-items:center;}.tab{position:relative;background:none;border:none;padding:8px 14px 11px;color:var(--text-muted);cursor:pointer;font-weight:500;white-space:nowrap;transition:color 0.2s;}.tab:hover{color:var(--text-2);}.tab.sel{color:var(--text);font-weight:600;}.tab-label{display:inline-flex;flex-direction:column;}.tab-label::after{content:attr(data-label);font-weight:600;height:0;overflow:hidden;visibility:hidden;}.tab-ic{opacity:0.55;margin-right:6px;font-size:12px;}.tab.sel .tab-ic{opacity:1;color:var(--accent);}.badge{margin-left:6px;font-size:10px;font-weight:500;padding:0 6px;border-radius:999px;background:var(--raise);color:var(--text-2);font-variant-numeric:tabular-nums;}.badge[data-tone]{background:var(--tone-bg);color:var(--tone);}.tab-sep{width:1px;height:18px;background:var(--line2);margin:0 8px 3px;flex:none;align-self:center;}.tab-ind{position:absolute;bottom:0;left:0;width:0;height:2px;border-radius:2px;background:var(--accent);transition:left 0.3s var(--ease),width 0.3s var(--ease);}.tab-ind.init{transition:none;}.tabhint{margin-left:auto;padding-left:12px;white-space:nowrap;}@container ca-monitor (max-width:900px){.tabhint{display:none;}}@container ca-monitor (max-width:760px){nav{padding:4px 8px 0;}.tab{padding:8px 10px 11px;}}`;function Q(e,t,n,{bubbles:r=!0}={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:r,composed:!0}))}function dl(e,t,n){return n.key?k`<button type="button" class="taskchip" title=${n.key} @click=${t=>{t.stopPropagation(),Q(e,`ca-open-task`,{key:n.key,...C(n)?{view:`output`}:{}})}}>${t}</button>`:k`<span class="taskchip">${t}</span>`}function fl(e,t){return e.startsWith(`list[`)||e===`array`?Array.isArray(t):e===`string`?typeof t==`string`:e===`integer`?Number.isInteger(t):e===`number`?typeof t==`number`:e===`boolean`?typeof t==`boolean`:e!==`object`||typeof t==`object`&&!!t&&!Array.isArray(t)}z(`cae-check-table`,Za);var pl=e=>/^RootModel\[(.+)\]$/.exec(e)?.[1]??null,ml=e=>/^Rows\[(.+)\]$/.exec(e)?.[1]??null;function hl(e){let t=e.file.content;return e.file.exists&&typeof t==`object`&&t&&!Array.isArray(t)?t:null}function gl(e){if(!e.fields.length&&(e.schema_name===`text`||pl(e.schema_name)!==null))return null;let t=hl(e),n=e.fields.map(e=>{let n={name:e.name,expected:e.type,optional:!e.required};if(!t)return{...n,hasValue:!1,verdict:`none`,verdictLabel:``};if(!(e.name in t))return e.required?{...n,hasValue:!1,verdict:`fail`,verdictLabel:E(`missing`),tip:E(`A required field that is not in the file`)}:{...n,hasValue:!1,verdict:`none`,verdictLabel:E(`absent (optional)`)};let r=t[e.name];return fl(e.type,r)?{...n,hasValue:!0,value:r,verdict:`pass`,verdictLabel:E(`passed`)}:{...n,hasValue:!0,value:r,verdict:`fail`,verdictLabel:E(`wrong type`),tip:E(T`Expected ${e.type}`)}}),r=t?Object.keys(t).filter(t=>!e.fields.some(e=>e.name===t)):[];return[...n,...r.map(e=>({name:e,expected:E(`not in the schema`),extra:!0,hasValue:!0,value:t?.[e],verdict:`warn`,verdictLabel:E(`extra field`),tip:E(`Not in the schema`)}))]}function _l(){return{name:E(`Field`),expected:E(`Expected`),actual:E(`In the file`),verdict:E(`Check`),optional:E(`optional`),items:e=>E(e===1?`1 item`:T`${e} items`),object:E(`object`)}}function vl(e){let t=!!e.file.exists;return $r(`ct-chip`,{text:t?E(`found`):e.required?E(`missing (required)`):E(`missing (optional)`),tone:t?`done`:e.required?`failed`:`muted`})}function yl(e,t){return $r(`ct-chip`,e?{text:t===void 0?Js(e):k`${Js(e)} <b>${t}</b>`,tone:ds(e),title:Ys(e)}:{text:`—`})}function bl(e){let t=e.content;return typeof t==`object`&&t?k`<cae-json-tree .value=${t}></cae-json-tree>`:k`<pre class="jtree">${typeof t==`string`?t:E(`Not JSON`)}</pre>`}function xl(e){let t=e.file,n=gl(e),r=k`<details class="ct-raw">
|
|
329
|
+
<summary>${Sl(t)}</summary>
|
|
330
|
+
${bl(t)}
|
|
331
331
|
</details>`;if(!n)return t.exists?r:k``;if(e.format===`jsonl`){let e=k`<details class="ct-raw">
|
|
332
332
|
<summary>${K(function(e){let t=Array.isArray(e.content)?e.content.length:0;return E(t===1?`1 row`:T`${t} rows`)}(t),`${t.size??0} B`,t.mtime?E(T`written ${G(t.mtime,!0)}`):``,t.truncated?E(`truncated`):``)}</summary>
|
|
333
|
-
${
|
|
334
|
-
</details>`;return k`<cae-check-table .rows=${n} .showValues=${!1} .strings=${
|
|
335
|
-
${t.exists?e:j}`}return t.exists?k`<cae-check-table .rows=${n} .strings=${
|
|
336
|
-
${
|
|
337
|
-
${r}`:n.length?k`<cae-check-table .rows=${n} .showValues=${!1} .strings=${
|
|
333
|
+
${bl(t)}
|
|
334
|
+
</details>`;return k`<cae-check-table .rows=${n} .showValues=${!1} .strings=${_l()}></cae-check-table>
|
|
335
|
+
${t.exists?e:j}`}return t.exists?k`<cae-check-table .rows=${n} .strings=${_l()}></cae-check-table>
|
|
336
|
+
${hl(e)?j:k`<div class="meta note">${E(`Not a JSON object`)}</div>`}
|
|
337
|
+
${r}`:n.length?k`<cae-check-table .rows=${n} .showValues=${!1} .strings=${_l()}></cae-check-table>`:k``}z(`cae-json-tree`,Di);var Sl=e=>K(E(`Whole file`),`${e.size??0} B`,e.mtime?E(T`written ${G(e.mtime,!0)}`):``,e.truncated?E(`truncated`):``);function Cl(e){let t=pl(e.schema_name),n=e.schema_name===`text`||t===`str`?E(`text`):t??ml(e.schema_name)??e.schema_name;return k`<b class="jmono" title=${e.schema_ref||e.schema_name}>${n}</b>`}function wl(e){let t=e.schema_ref||e.schema_name;if(e.schema_name===`text`)return E(`text file`);if(e.format===`jsonl`)return E(k`JSON Lines, one object of schema ${Cl(e)} per line`);let n=pl(e.schema_name);return n===`str`?k`<span title=${t}>${E(`text (JSON string)`)}</span>`:n?k`<span title=${t}>${E(T`JSON value of type ${n}`)}</span>`:E(k`JSON object, schema ${Cl(e)}`)}function Tl(e,t){let n=wl(e),r=function(e){let t=e.validators??[];if(!t.length)return null;let n=(e.errors??[]).join(`
|
|
338
338
|
`);return k`${t.map((t,r)=>k`${r?`, `:``}<span class="jmono">${t}</span> ${(t=>e.status===`valid`?Ya(`pass`,E(`passed`)):n.includes(t)?Ya(`fail`,E(`failed checks`)):j)(t)}`)}`}(e);return k`<dl class="conds">
|
|
339
|
-
${(t===`output`?[[E(`Format`),n],...r?[[E(`Other checks`),r,E(`Checks beyond the schema (validators)`)]]:[],[E(`Must be written during the task`),e.fresh?E(`yes`):E(`no`),e.fresh?E(`A file from before the task does not count`):E(`A file from before the task counts`)],...e.preserve?.length?[[
|
|
340
|
-
</dl>`}var
|
|
339
|
+
${(t===`output`?[[E(`Format`),n],...r?[[E(`Other checks`),r,E(`Checks beyond the schema (validators)`)]]:[],[E(`Must be written during the task`),e.fresh?E(`yes`):E(`no`),e.fresh?E(`A file from before the task does not count`):E(`A file from before the task counts`)],...e.preserve?.length?[[Yc(),k`<span class="jmono">${e.preserve.join(`, `)}</span>`,Xc()]]:[]]:[[E(`Format`),n],...r?[[E(`Other checks`),r,E(`Checks beyond the schema (validators)`)]]:[],[E(`Check time`),E(`when the task starts`)],[E(`Required`),e.required?E(`yes`):E(`no`)]]).map(([e,t,n])=>k`<dt>${e}</dt><dd title=${n??``}>${t}</dd>`)}
|
|
340
|
+
</dl>`}var El=O` .ct-chip{display:inline-block;padding:1px 10px;border-radius:var(--radius-pill);font-size:11.5px;background:var(--raise);color:var(--text-2);white-space:nowrap;}.ct-chip b{margin-left:4px;}.ct-chip[data-tone]{background:var(--tone-bg);color:var(--tone);}.ct-chip[data-tone='done']{background:none;box-shadow:inset 0 0 0 1px var(--line2);color:var(--text-2);}`,Dl=O` ${El} ${qa} .ct-path{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.ct-lead{margin:2px 0 8px;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 6px;}.conds{display:grid;grid-template-columns:fit-content(50%) minmax(0,1fr);gap:2px 14px;margin:2px 0 10px;font-size:12px;}.conds dt{color:var(--text-muted);overflow-wrap:anywhere;}.conds dd{margin:0;color:var(--text-2);min-width:0;overflow-wrap:anywhere;}.note{margin-top:6px;}.ct-raw{margin-top:8px;}.ct-raw>summary{cursor:pointer;color:var(--text-muted);font-size:12px;}.ct-err{color:var(--status-failed);white-space:pre-wrap;}.ct-fields{border-collapse:collapse;width:100%;}.ct-fields td{padding:2px 10px 2px 0;border:0;font-size:12px;}.ct-in{display:flex;align-items:center;gap:10px;padding:5px 4px;border-top:1px solid var(--line);}h4{margin:8px 0 6px;font-size:12px;color:var(--text-2);font-weight:600;}.io-card{border:1px solid var(--line);border-radius:10px;padding:10px 14px;margin-bottom:10px;background:var(--raise);}.io-hd{display:flex;align-items:center;gap:10px;margin-bottom:6px;}.io-from{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:-2px 0 8px;}.io-hd .ct-path{flex:1;}.io-card.one .io-hd{margin-bottom:2px;}`;z(`cae-count`,la),z(`cae-elapsed`,ua);var Ol=class extends M{constructor(...e){super(...e),this.procs=null}static{this.styles=[V,O` :host{display:block;}.ptree2{font-family:var(--mono);font-size:11.5px;max-height:220px;overflow:auto;}.pt-n{display:flex;gap:10px;align-items:center;padding:3px 6px 3px calc(6px + var(--d) * 18px);border-radius:6px;position:relative;}.pt-n:hover{background:color-mix(in srgb,var(--text) 4%,transparent);}.pt-n::before{content:'';position:absolute;left:calc(var(--d) * 18px - 8px);top:0;bottom:50%;width:8px;border-left:1px solid var(--line2);border-bottom:1px solid var(--line2);}.pt-n.root::before{display:none;}.pt-pid{color:var(--text-muted);min-width:58px;}.pt-cmd{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;color:var(--text-2);}.pt-n.llm .pt-cmd{color:var(--text);}.pt-n.llm .pt-pid{box-shadow:inset 2px 0 0 color-mix(in srgb,var(--agent) 70%,transparent);padding-left:6px;}.pt-age{color:var(--text-muted);}`]}render(){let e=this.procs?.tree[0];return e?k`<div class="ptree2">${this.node(e,0)}</div>`:k`<div class="meta">${E(`No running processes`)}</div>`}node(e,t){let n=e.full_cmd||e.cmd||``,r=(e.cmd||n).split(` `).slice(0,3).join(` `);return k`<div class="pt-n ${/\b(claude|omp)\b/.test(n)?`llm`:``} ${t?``:`root`}" style="--d:${t}" title=${n}>
|
|
341
341
|
<span class="pt-pid">${e.pid}</span>
|
|
342
342
|
<span class="pt-cmd">${e.key?k`<b>${q(e)}</b> `:j}${r.length>70?`${r.slice(0,70)}…`:r}</span>
|
|
343
343
|
<cae-elapsed class="pt-age" .since=${Ir.at(`p:${e.pid}`,e.age_s)}></cae-elapsed>
|
|
344
344
|
</div>
|
|
345
|
-
${(e.children??[]).map(e=>this.node(e,t+1))}`}};function
|
|
346
|
-
${
|
|
345
|
+
${(e.children??[]).map(e=>this.node(e,t+1))}`}};function kl(e){let t=e.filter(f),n=t.filter(C),r=t.filter(e=>!C(e)),i=e=>e.reduce((e,t)=>e+(t.wall_s||0),0),a=e=>[...new Set(e.map(e=>e.key))],o=e=>a(e).length,s=m(e),c=t.filter(e=>(e.rounds||1)>1),l=t.filter(e=>(e.hops||[]).length>1);return{attempts:t.length,python:n.length,launches:r.length,bad:t.filter(e=>!e.ok).length,launchWall:i(r),pythonWall:i(n),retries:s.length,retriedTasks:o(s),retriedKeys:a(s),fixupKeys:a(c),fixups:c.reduce((e,t)=>e+(t.rounds||1)-1,0),fixupTasks:o(c),switches:l.reduce((e,t)=>e+(t.hops||[]).length-1,0),switchTasks:o(l)}}function Al(e){return e.startsWith(`task:`)?{key:e.slice(5)}:{stop:e.replace(/^history:/,``)}}function jl(e){let t=!1,n=!1,r=!1;for(let i of e){if(i.outcome!==`not_started`)continue;let e=i.attempts[i.attempts.length-1],a=e?.stop===`invalid_input`?ze(e.reason):[];a.some(e=>e.problem===`missing`)&&(t=!0),a.some(e=>e.problem===`checks`)&&(n=!0),(a.some(e=>e.problem===`failed`)||!a.length&&i.cause)&&(r=!0)}return Qo(r?E(`Earlier task failed`):``,t?E(`Input missing`):``,n?E(`Input failed checks`):``)}U([P({attribute:!1})],Ol.prototype,`procs`,void 0),Ol=U([N(`ca-proc-tree`),D()],Ol),z(`cae-stat-tiles`,_a),z(`cae-count`,la);var Ml=(e,t)=>({id:`history:${e}`,label:t});function Nl(e,t,n,r){let i=t.length===1?t[0]:void 0;if(!i)return Ml(n,r);let a=e.find(e=>e.key===i);return{id:`task:${i}`,label:a?q(a):i}}function Pl(e,t){let n=kl(e),{outcomes:r,counts:i}=t,a=[{text:X(`done`,i.doneTotal),tone:`neutral`},{text:i.skipped?X(`skipped`,i.skipped):``,tone:`neutral`},{text:i.failed?X(`failed`,i.failed):``,tone:as(i.failed,`failed`)},{text:i.not_started?X(`not_started`,i.not_started):``,tone:as(i.not_started,`attention`)},{text:i.partial?X(`partial`,i.partial):``,tone:as(i.partial,`attention`)}];return[{id:`tasks`,label:E(`Tasks`,{id:`tasks`}),value:i.total,sub:[a]},{id:`attempts`,label:E(`Attempts`),value:n.attempts,sub:[Qo(n.launches===1?E(`1 agent session`):E(T`${n.launches} agent sessions`),n.python===1?E(`1 Python task attempt`):E(T`${n.python} Python task attempts`))],tip:E(`Attempts that ran, retries included (journal.jsonl)`)},...Fl(e),{id:`bad`,tone:as(n.bad,`failed`),label:E(`Failed attempts`),value:n.bad,sub:[n.bad?[]:[E(`All attempts done`)]],...n.bad?{action:Ml(`bad`,E(`Failed attempts in history`))}:{}},{id:`notstarted`,tone:as(i.not_started,`attention`),label:E(`Not started`),value:i.not_started,sub:[i.not_started?jl(r.values()):[E(`All tasks started`)]],...i.not_started?{action:Ml(`invalid_input`,E(`Tasks not started in history`))}:{}},{id:`wall`,label:E(`Agent session time`),value:B(n.launchWall),sub:[[E(T`Python tasks: ${B(n.pythonWall)}`)]],tip:E(`Summed over agent sessions, including sessions that ran at once`)},{id:`retry`,label:E(`Retries`),value:n.retries,sub:[[n.retries?n.retriedTasks===1?E(`1 task retried`):E(T`${n.retriedTasks} tasks retried`):E(`No retries`)]],tip:hs(),...n.retries?{action:Nl(e,n.retriedKeys,`retried`,E(`Retried tasks in history`))}:{}},{id:`ct`,label:E(`Corrections`),value:n.fixups,sub:[[n.fixups?n.fixupTasks===1?E(`1 task with a correction`):E(T`${n.fixupTasks} tasks with corrections`):E(`No corrections`)]],tip:Xs(),...n.fixups?{action:Nl(e,n.fixupKeys,`fixup`,E(`Attempts with corrections in history`))}:{}},{id:`fo`,label:E(`Model switches`),value:n.switches,sub:[[n.switches?n.switchTasks===1?E(`1 task with a model switch`):E(T`${n.switchTasks} tasks with model switches`):E(`No model switches`)]],tip:Gs()}]}function Fl(e){let t=De(e);if(!t)return[];let n=ke(e)[0];return[{id:`cost`,label:E(`Cost`),value:Y(t.cost),sub:n&&n.share!==null?[[E(T`Highest cost: ${n.kind}`)],Qo(Y(n.spend.cost),E(T`${Math.round(100*n.share)}% of the total`))]:[[]],tip:E(`Reported by the coding agent`)},{id:`tokens`,label:E(`Tokens`),value:J(Te(t)),sub:[Qo(E(T`${J(t.input)} input`),E(T`${J(t.output)} output`),E(T`${J(t.cache_read+t.cache_creation)} cache`))],tip:K(E(T`${J(t.cache_read)} cache read`),E(T`${J(t.cache_creation)} cache write`),t.calls===1?E(`1 API call`):E(T`${t.calls} API calls`))}]}var Il=class extends M{constructor(...e){super(...e),this.journal=[],this.plan={nodes:[],groups:[]},this.onAction=e=>{e.stopPropagation();let t=Al(e.detail.action);`key`in t?Q(this,`ca-open-task`,{key:t.key}):Q(this,`ca-navigate`,{tab:`journal`,stop:t.stop})}}static{this.styles=O` :host{display:block;}`}render(){return k`<cae-stat-tiles exportparts="tiles, tile, label, value, sub, action" .tiles=${Pl(this.journal,S(this.journal,this.plan))} @cae-action=${this.onAction}></cae-stat-tiles>`}};U([P({attribute:!1})],Il.prototype,`journal`,void 0),U([P({attribute:!1})],Il.prototype,`plan`,void 0),Il=U([N(`ca-kpis`),D()],Il);var Ll=[`input`,`cache_read`,`cache_creation`,`output`],Rl=class extends M{constructor(...e){super(...e),this.journal=[],this.top=5}static{this.styles=[V,oi,O` :host{display:block;}.kinds{display:grid;grid-template-columns:minmax(70px,max-content) minmax(0,420px) max-content max-content;justify-content:start;gap:8px 14px;align-items:center;}.kind{font-family:var(--mono);font-size:12px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.bar{display:flex;height:12px;border-radius:4px;overflow:hidden;background:var(--track);}.bar i{display:block;height:100%;}.num{font-variant-numeric:tabular-nums;text-align:right;font-size:12px;white-space:nowrap;}.share{color:var(--text-muted);min-width:3.5em;}.seg-input{background:var(--tok-input);}.seg-cache_read{background:var(--tok-cache-read);}.seg-cache_creation{background:var(--tok-cache-write);}.seg-output{background:var(--tok-output);}.legend{margin-top:10px;}h4{margin:16px 0 6px;font-size:12px;color:var(--text-2);font-weight:600;}.top{display:grid;grid-template-columns:minmax(0,max-content) 64px 64px max-content;column-gap:20px;row-gap:4px;align-items:baseline;}.top a{font-family:var(--mono);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}`]}partLabel(e){switch(e){case`input`:return E(`input`);case`cache_read`:return E(`cache read`);case`cache_creation`:return E(`cache write`);case`output`:return E(`output`)}}bar(e,t){let n=Te(e),r=t?100*n/t:0;return k`<div class="bar" title=${K(...Ll.map(t=>`${this.partLabel(t)} ${J(e[t])}`))} style="width:${Math.max(r,.5).toFixed(2)}%">
|
|
346
|
+
${Ll.map(t=>e[t]&&n?k`<i class="seg-${t}" style="width:${(100*e[t]/n).toFixed(2)}%"></i>`:j)}
|
|
347
347
|
</div>`}render(){if(!De(this.journal))return k`<div class="meta">${E(`No tokens reported`)}</div>`;let e=ke(this.journal),t=Math.max(1,...e.map(e=>Te(e.spend))),n=(r=this.journal,Oe(r,e=>e.key)).slice(0,this.top);var r;return k`<div class="kinds">
|
|
348
348
|
${H(e,e=>e.id,e=>k`<span class="kind" title=${e.id}>${e.id}</span>${this.bar(e.spend,t)}
|
|
349
349
|
<span class="num">${K(J(Te(e.spend)),Y(e.spend.cost))}</span>
|
|
350
350
|
<span class="num share">${e.share===null?``:`${Math.round(100*e.share)}%`}</span>`)}
|
|
351
351
|
</div>
|
|
352
|
-
${ai(
|
|
352
|
+
${ai(Ll.map(e=>({label:this.partLabel(e),cls:`seg-${e}`})))}
|
|
353
353
|
<h4>${E(`Most expensive tasks`)}</h4>
|
|
354
354
|
<div class="top">
|
|
355
355
|
${n.map(e=>k`<a class="lnk" href="#" title=${e.id} @click=${t=>{t.preventDefault(),Q(this,`ca-open-task`,{key:e.id})}}>${q(e)}</a>
|
|
356
356
|
<span class="num">${J(Te(e.spend))}</span>
|
|
357
357
|
<span class="num">${Y(e.spend.cost)}</span>
|
|
358
358
|
<span class="num share">${e.share===null?``:E(T`${Math.round(100*e.share)}%`)}</span>`)}
|
|
359
|
-
</div>`}};U([P({attribute:!1})],
|
|
360
|
-
<cae-segmented label=${E(`Measure`)} .value=${e} .options=${t.map(e=>({value:e,label:
|
|
359
|
+
</div>`}};U([P({attribute:!1})],Rl.prototype,`journal`,void 0),U([P({type:Number})],Rl.prototype,`top`,void 0),Rl=U([N(`ca-spend-breakdown`),D()],Rl);var zl=6,Bl=`var(--meter)`,Vl=e=>`${e.agent}/${e.model}`;function Hl(e){let t=e.length>6?5:6;return new Map(e.map((e,n)=>[Vl(e),n<t?`var(--series-${n+1})`:Bl]))}function Ul(e,t){let n=Hl(e),r=[],i=0;for(let a of e){let e=je(a,t)??0,o=n.get(Vl(a));o===`var(--meter)`?i+=e:r.push({id:Vl(a),label:a.model,value:e,color:o,text:bc(a,t)})}return e.length>6&&r.push({id:`other`,label:E(`Other models`),value:i,color:Bl}),r}function Wl(e,t){let n=Hl(e),r=e.map(e=>je(e,t)??0),i=si(r),a=r.some(e=>e>0);return e.map((e,t)=>({id:Vl(e),usage:e,colour:n.get(Vl(e)),share:a?ci(i[t],r[t]):`—`}))}var Gl=[`cost`,`tokens`,`time`,`sessions`],Kl=class extends M{constructor(...e){super(...e),this.models=[],this.measure=``}static{this.styles=[V,li,O` :host{display:block;}.head{display:flex;justify-content:flex-end;margin-bottom:10px;overflow-x:auto;}.head cae-segmented{flex:none;}.wrap{overflow-x:auto;margin-top:14px;border-radius:6px;}.wrap:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}table{border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums;}th{font-weight:500;color:var(--text-muted);text-align:right;padding:0 0 6px 28px;white-space:nowrap;border-bottom:1px solid var(--line);}th:first-child{text-align:left;padding-left:0;}th.on{color:var(--text);font-weight:600;}td{padding:7px 0 7px 28px;text-align:right;white-space:nowrap;color:var(--text-2);vertical-align:top;}tr + tr td{border-top:1px solid var(--line);}td:first-child{text-align:left;padding-left:0;}td.on{color:var(--text);}td.share{color:var(--text);font-weight:600;}.model{display:grid;grid-template-columns:10px max-content;column-gap:8px;align-items:baseline;}.model i{width:10px;height:10px;border-radius:3px;align-self:center;}.model b{font-family:var(--mono);font-weight:500;color:var(--text);}.model small{grid-column:2;font-size:11px;color:var(--text-muted);}`]}chosen(){let e=Me(this.models);return this.measure&&e.includes(this.measure)?this.measure:e[0]??`sessions`}render(){if(!this.models.length)return k`<div class="meta">${E(`No agent sessions`)}</div>`;let e=this.chosen(),t=Me(this.models),n=Wl(this.models,e),r=this.models.some(e=>e.peak_context!=null);return k`${t.length>1?k`<div class="head">
|
|
360
|
+
<cae-segmented label=${E(`Measure`)} .value=${e} .options=${t.map(e=>({value:e,label:vc(e),title:yc(e)}))} @cae-change=${e=>this.measure=e.detail.value}></cae-segmented>
|
|
361
361
|
</div>`:j}
|
|
362
362
|
${function(e,t={}){let n=e.filter(e=>e.value>0),r=si(n.map(e=>e.value)),i=n.reduce((e,t)=>e+t.value,0),a=t.labelAt??.15,o=(e,t)=>[e.label,ci(r[t],e.value),e.text].filter(Boolean).join(` | `);return k`<div class="share" part="share">
|
|
363
363
|
<div class="share-bar" role="list" aria-label=${t.label||j}>
|
|
@@ -366,16 +366,16 @@ ${n.map((e,t)=>k`<span class="share-seg" role="listitem" tabindex="0" aria-label
|
|
|
366
366
|
<div class="share-names" aria-hidden="true">
|
|
367
367
|
${n.map((e,t)=>k`<span style=${ii({flexGrow:String(e.value/i)})} >${e.value/i>=a?k`<b>${e.label}</b> ${ci(r[t],e.value)}`:j}</span>`)}
|
|
368
368
|
</div>
|
|
369
|
-
</div>`}(
|
|
369
|
+
</div>`}(Ul(this.models,e),{label:vc(e)})}
|
|
370
370
|
<div class="wrap" data-scroll="x" tabindex="0" role="region" aria-label=${E(`Models`)}>
|
|
371
371
|
<table>
|
|
372
372
|
<thead>
|
|
373
373
|
<tr>
|
|
374
374
|
<th scope="col">${E(`Model`)}</th>
|
|
375
|
-
<th scope="col" class="on" title=${
|
|
376
|
-
${
|
|
375
|
+
<th scope="col" class="on" title=${vc(e)}>${E(`Share`)}</th>
|
|
376
|
+
${Gl.map(t=>k`<th scope="col" class=${t===e?`on`:j} title=${yc(t)}>${vc(t)}</th>`)}
|
|
377
377
|
<th scope="col">${E(`API calls`)}</th>
|
|
378
|
-
${r?k`<th scope="col" title=${
|
|
378
|
+
${r?k`<th scope="col" title=${Vc()}>${Bc()}</th>`:j}
|
|
379
379
|
</tr>
|
|
380
380
|
</thead>
|
|
381
381
|
<tbody>
|
|
@@ -384,95 +384,95 @@ ${H(n,e=>e.id,t=>k`<tr>
|
|
|
384
384
|
<span class="model"><i style=${ii({background:t.colour})}></i><b>${t.usage.model}</b><small>${t.usage.agent}</small></span>
|
|
385
385
|
</td>
|
|
386
386
|
<td class="share">${t.share}</td>
|
|
387
|
-
${
|
|
387
|
+
${Gl.map(n=>k`<td class=${n===e?`on`:j}>${bc(t.usage,n)}</td>`)}
|
|
388
388
|
<td>${t.usage.calls??0}</td>
|
|
389
389
|
${r?k`<td>${t.usage.peak_context==null?`—`:J(t.usage.peak_context)}</td>`:j}
|
|
390
390
|
</tr>`)}
|
|
391
391
|
</tbody>
|
|
392
392
|
</table>
|
|
393
|
-
</div>`}};U([P({attribute:!1})],
|
|
393
|
+
</div>`}};U([P({attribute:!1})],Kl.prototype,`models`,void 0),U([F()],Kl.prototype,`measure`,void 0),Kl=U([N(`ca-model-usage`),D()],Kl);var ql=class extends M{static{this.styles=[V,O` :host{display:block;container-type:inline-size;}.rows{display:grid;grid-template-columns:max-content minmax(70px,420px) max-content max-content;justify-content:start;gap:10px 14px;align-items:center;}.name{font-size:12px;color:var(--text-2);white-space:nowrap;}.bar{position:relative;height:12px;border-radius:4px;background:var(--track);overflow:hidden;}.bar i{position:absolute;top:0;bottom:0;}.bar .before{left:0;background:var(--meter);opacity:0.45;}.bar .during{background:var(--meter);}.bar.hot .during,.bar.full .during,.bar.hot .before,.bar.full .before{background:var(--status-attention);}.bar .cap{width:2px;margin-left:-1px;background:var(--text);opacity:0.7;}.val.hot b,.val.full b{color:var(--status-attention);}.val{font-family:var(--mono);font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap;}.val b{color:var(--text);}.val .lim{color:var(--text-muted);}.reset{font-size:11.5px;color:var(--text-muted);white-space:nowrap;}@container (max-width:460px){.rows{grid-template-columns:max-content minmax(70px,1fr) max-content;row-gap:2px;}.reset{grid-column:2 / -1;margin-bottom:6px;}}.status{margin-top:8px;}.acct{padding:10px 0;border-top:1px solid var(--line);}.acct:first-child{border-top:0;padding-top:0;}.acct-h{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;margin-bottom:8px;font-size:12px;}.acct-h i{font-style:normal;color:var(--text-muted);font-size:11px;}.acct-h b{font-family:var(--mono);color:var(--text);font-weight:600;}.rests{margin:8px 0 0;padding:0;list-style:none;font-size:11.5px;color:var(--text-2);}.rests li{padding:2px 0;}.rule{margin-bottom:10px;font-size:12px;color:var(--text-2);}.rule code{font-family:var(--mono);color:var(--text);}`]}constructor(){super(),this.journal=[],this.accounts=null,this.caps=[],this.rests=[],this.rule=``,this.live=!1,new Fr(this)}row(e,t,n,r,i){let a=n[`${e}_pct`],o=r[`${e}_pct`];if(a==null&&o==null)return j;let s=Math.max(0,Math.min(100,a??o??0)),c=Math.max(s,Math.min(100,o??s)),l=r[`${e}_resets_at`],u=c>=100||i!=null&&c>=i?`full`:c>=80?`hot`:``,d=i==null?``:Ls(i);return k`<span class="name">${t}</span>
|
|
394
394
|
<span class="bar ${u}" title=${d?`${Es(a)} → ${Es(o)} | ${d}`:`${Es(a)} → ${Es(o)}`}>
|
|
395
395
|
<i class="before" style="width:${s}%"></i>
|
|
396
396
|
<i class="during" style="left:${s}%;width:${c-s}%"></i>
|
|
397
397
|
${i==null?j:k`<i class="cap" style="left:${Math.min(100,i)}%" aria-hidden="true"></i>`}
|
|
398
398
|
</span>
|
|
399
399
|
<span class="val ${u}">${Es(a)} → <b>${Es(o)}</b>${d?k` <span class="lim">| ${d}</span>`:j}</span>
|
|
400
|
-
<span class="reset" title=${l?G(l,!0):``}>${function(e,t=Date.now()){let n=Date.parse(e??``);if(Number.isNaN(n))return``;if(n<=t)return E(`reset`);let r=(n-t)/36e5,i=r>=48?E(T`${Math.floor(r/24)}d ${Math.floor(r%24)}h`):B((n-t)/1e3);return E(T`resets in ${i}`)}(l)}</span>`}paused(e){let t=Date.now(),n=e.find(e=>!e.ended&&(e.until?Date.parse(e.until)>t:this.live));return n?Zr({text:n.until?E(T`paused until ${G(n.until,!0)}`):E(`paused`),tone:`attention`,title:
|
|
401
|
-
<div class="acct-h"><i>${E(`Identity`)}</i><b>${ws(n.credential)||`—`}</b>${o?k`<i title=${E(T`Account: ${n.account??``}`)}>${ks(n.account??``)}</i>`:j}${r?Zr({text:r,tone:`attention`,title:n.last.status,mark:null}):j}${this.paused(a)}${i?k`<i title="max_five_hour_pct, max_seven_day_pct">${
|
|
400
|
+
<span class="reset" title=${l?G(l,!0):``}>${function(e,t=Date.now()){let n=Date.parse(e??``);if(Number.isNaN(n))return``;if(n<=t)return E(`reset`);let r=(n-t)/36e5,i=r>=48?E(T`${Math.floor(r/24)}d ${Math.floor(r%24)}h`):B((n-t)/1e3);return E(T`resets in ${i}`)}(l)}</span>`}paused(e){let t=Date.now(),n=e.find(e=>!e.ended&&(e.until?Date.parse(e.until)>t:this.live));return n?Zr({text:n.until?E(T`paused until ${G(n.until,!0)}`):E(`paused`),tone:`attention`,title:zs(n)}):j}render(){let e=this.accounts??Le(this.journal);if(!e.length&&!this.rests.length)return j;let t=new Map(this.caps.map(e=>[e.credential,e]));return k`${this.rule?k`<div class="rule" title="quota_rule">${E(`Usage rule`)} <code>${this.rule}</code></div>`:j}${e.map(n=>{let r=Ds(n.last.status,n.last.status_window),i=t.get(n.credential),a=this.rests.filter(e=>!(e.credential!==n.credential||e.account&&n.account&&e.account!==n.account)),o=!!n.account&&e.some(e=>e!==n&&e.credential===n.credential);return k`<div class="acct">
|
|
401
|
+
<div class="acct-h"><i>${E(`Identity`)}</i><b>${ws(n.credential)||`—`}</b>${o?k`<i title=${E(T`Account: ${n.account??``}`)}>${ks(n.account??``)}</i>`:j}${r?Zr({text:r,tone:`attention`,title:n.last.status,mark:null}):j}${this.paused(a)}${i?k`<i title="max_five_hour_pct, max_seven_day_pct">${Ws(i)}</i>`:j}</div>
|
|
402
402
|
<div class="rows">
|
|
403
403
|
${this.row(`seven_day`,E(`Weekly usage`),n.first,n.last,i?.seven_day_pct)}
|
|
404
404
|
${this.row(`five_hour`,E(`5-hour usage`),n.first,n.last,i?.five_hour_pct)}
|
|
405
405
|
</div>
|
|
406
406
|
${this.restList(a)}
|
|
407
|
-
</div>`})}${this.unread(e,t)}`}restList(e){return e.length?k`<ul class="rests" title="rests.jsonl">${e.map(e=>k`<li>${function(e){
|
|
408
|
-
<div class="acct-h"><i>${E(`Identity`)}</i><b>${ws(e)}</b>${this.paused(n)}${r?k`<i title="max_five_hour_pct, max_seven_day_pct">${
|
|
407
|
+
</div>`})}${this.unread(e,t)}`}restList(e){return e.length?k`<ul class="rests" title="rests.jsonl">${e.map(e=>k`<li>${function(e){let t=e.ended?E(T`Paused ${G(e.since)} → ${G(e.ended)}`):E(T`Paused since ${G(e.since)}`);return e.stop?K(t,Rs(e)):K(t,e.rule?E(T`Usage rule: ${e.rule}`):K(Fs(e.window??``,e.pct),Ls(e.cap)))}(e)}</li>`)}</ul>`:j}unread(e,t){let n=new Set(e.map(e=>e.credential));return[...new Set(this.rests.map(e=>e.credential))].filter(e=>!n.has(e)).map(e=>{let n=this.rests.filter(t=>t.credential===e),r=t.get(e);return k`<div class="acct">
|
|
408
|
+
<div class="acct-h"><i>${E(`Identity`)}</i><b>${ws(e)}</b>${this.paused(n)}${r?k`<i title="max_five_hour_pct, max_seven_day_pct">${Ws(r)}</i>`:j}</div>
|
|
409
409
|
${this.restList(n)}
|
|
410
|
-
</div>`})}};U([P({attribute:!1})],
|
|
410
|
+
</div>`})}};U([P({attribute:!1})],ql.prototype,`journal`,void 0),U([P({attribute:!1})],ql.prototype,`accounts`,void 0),U([P({attribute:!1})],ql.prototype,`caps`,void 0),U([P({attribute:!1})],ql.prototype,`rests`,void 0),U([P()],ql.prototype,`rule`,void 0),U([P({type:Boolean})],ql.prototype,`live`,void 0),ql=U([N(`ca-quota`),D()],ql);var Jl={running:`running`,stopped:`done`,failed:`failed`,unknown:`muted`},Yl=class extends M{constructor(...e){super(...e),this.services=[],this.nodes=[],this.live=!1}static{this.styles=[V,O` :host{display:block;}ul{margin:0;padding:0;list-style:none;display:grid;gap:8px;}li{display:grid;grid-template-columns:max-content 1fr;column-gap:10px;row-gap:2px;align-items:baseline;font-size:12px;}.name{font-family:var(--mono);color:var(--text);overflow-wrap:anywhere;}.addr{font-family:var(--mono);color:var(--text-2);overflow-wrap:anywhere;}.facts{grid-column:2;color:var(--text-2);overflow-wrap:anywhere;}.by{grid-column:2;}`]}render(){if(!this.services.length)return k`<div class="meta">${E(`No services`)}</div>`;let e=new Map(this.nodes.map(e=>[e.key,e]));return k`<ul>
|
|
411
411
|
${this.services.map(t=>{let n=function(e,t){return e.start_error?`failed`:e.stopped_at?`stopped`:t?`running`:`unknown`}(t,this.live),r=t.key?e.get(t.key):void 0;return k`<li>
|
|
412
|
-
${Qr({text:
|
|
412
|
+
${Qr({text:pc(n),tone:Jl[n]})}
|
|
413
413
|
<div><span class="name" title="services.jsonl">${t.name}</span>${t.address?k` <span class="addr">${t.address}</span>`:j}</div>
|
|
414
414
|
<div class="facts">${function(e){return e.start_error?K(G(e.started_at),e.start_error):K(E(T`Started ${G(e.started_at)} in ${B(e.start_s??0)}`),e.stopped_at?E(T`Stopped ${G(e.stopped_at)}`):``,function(e){switch(e){case`run_end`:return E(`The run ended`);case`interrupted`:return E(`The run was stopped by a signal`);default:return``}}(e.stop_cause),e.stop_error?E(`Stop failed`):``,e.stop_error)}(t)}</div>
|
|
415
|
-
${t.key?k`<div class="by">${
|
|
415
|
+
${t.key?k`<div class="by">${dl(this,r?q(r):t.key,r??{key:t.key})}</div>`:j}
|
|
416
416
|
</li>`})}
|
|
417
|
-
</ul>`}};U([P({attribute:!1})],Jl.prototype,`services`,void 0),U([P({attribute:!1})],Jl.prototype,`nodes`,void 0),U([P({type:Boolean})],Jl.prototype,`live`,void 0),Jl=U([N(`ca-services`),D()],Jl),z(`cae-mark-matrix`,to),z(`cae-layered-graph`,zo);var Yl=`loop:`,Xl=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])},Zl=e=>typeof e==`string`;function Ql(e){let t=e.flow_calls;return Array.isArray(t)&&t.length!==0?new Map(t.filter(e=>e&&Zl(e.id)&&Zl(e.function)).map(e=>[e.id,e])):null}var $l=new WeakMap;function eu(e){let t=$l.get(e);if(t)return t;let n=e.nodes.map(e=>{let t=function(e){let t=e.flow;if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=e;if(!t||typeof t!=`object`||!Zl(t.function))break;let r=(Array.isArray(t.loops)?t.loops:[]).filter(e=>!!e&&typeof e.line==`number`);n.push({function:t.function,file:Zl(t.file)?t.file:``,line:typeof t.line==`number`?t.line:0,loops:r.map(e=>e.line),passes:r.map(e=>typeof e.pass==`number`&&e.pass>=1?e.pass:1)})}return n}(e),n=e.created_from;return{n:e,frames:t,path:t.map(e=>e.function),from:Array.isArray(n)?n.filter(Zl):[],call:Zl(e.flow_call)?e.flow_call:``}}),r=new Map;for(let t of e.nodes)t.unit&&!r.has(t.unit)&&r.set(t.unit,r.size);let i={tasks:n,byKey:new Map(n.map(e=>[e.n.key,e])),calls:Ql(e),unitRank:r,labels:new Map(e.groups.map(e=>[e.id,e.label]))};return $l.set(e,i),i}var tu=(e,t)=>t.every((t,n)=>e[n]===t),nu=e=>e.slice(e.lastIndexOf(`.`)+1)||e,ru=(e,t)=>t>0?e.frames[t-1]?.loops??[]:[],iu=(e,t)=>t>0?e.frames[t-1]?.passes??[]:[];function au(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=(e[n]??0)-(t[n]??0);if(r)return r}return 0}var ou=e=>e.map((t,n)=>`${Yl}${e.slice(0,n+1).join(`.`)}`);function su(e,t){let n=ru(e,t),r=n.length?`@${n.join(`.`)}`:``;if(e.path.length<=t)return{id:`kind:${e.n.group}${r}`,type:`kind`,name:e.n.group,loops:n};let i=e.path[t];return{id:`flow:${i}${r}`,type:`flow`,name:i,loops:n}}function cu(e,t,n){if(!e.call)return{id:`>${t}`,own:!1};let r=e.call.split(`.`),i=r.map((e,t)=>r.slice(0,t+1).join(`.`)),a=0,o=0;if(n)for(let r=1;r<i.length;r++){let s=n.get(i[r])?.function,c=s===void 0?-1:e.frames.findIndex((e,t)=>t>o&&e.function===s);if(c<0||c>t)break;a=r,o=c}else a=Math.min(t,i.length-1),o=a;let s=i[a];return o===t?{id:s,own:!0}:{id:`${s}>${t}`,own:!1}}var lu={failed:6,running:5,blocked:4,partial:3,pending:2,skipped:1,done:0},uu=e=>e.reduce((e,t)=>lu[t.state]>lu[e]?t.state:e,`done`),du=e=>e.reduce((e,t)=>lu[t]>lu[e]?t:e,`done`);function fu(e){let t=e.filter(C).length;return t===0?`agent`:t===e.length?`python`:`mixed`}var pu={running:`running`,returned:`done`,raised:`failed`,closed:`failed`},mu=e=>e?.state===`raised`||e?.state===`closed`;function hu(e,t){let n=e.map(e=>e.n);return{key:(n.find(e=>e.state===`running`)??n[n.length-1]??{key:``}).key,unit:t,state:uu(n),count:n.length,keys:n.map(e=>e.key)}}function gu(e){let t=new Map,n=[];for(let r of e)r.n.unit?Xl(t,r.n.unit,r):n.push(hu([r],``));return{byUnit:new Map([...t].map(([e,t])=>[e,hu(t,e)])),single:n}}function _u(e,t,n,r){let i=(e,t)=>{let i=e.map(e=>e.own?r?.get(e.id):void 0),a=e.map((e,t)=>{let n=i[t],r=uu(e.tasks.map(e=>e.n));return n&&pu[n.state]?du([pu[n.state],r]):r}),o=e.flatMap(e=>e.tasks),s=o.map(e=>e.n.key),c=e.find((e,t)=>a[t]===`running`)??e[e.length-1],l=i.find(mu),u={key:c?.id??``,unit:t,state:du(a),count:s.length,keys:s,flow:n,counts:vu(o)},d=c?.own?r?.get(c.id)?.time_box:null,f=d?function(e){let t=Date.parse(e.started_at);return Number.isNaN(t)?``:new Date(t+1e3*e.deadline_s).toISOString()}(d):``,p=f?{...u,deadlineAt:f}:u;return l?{...p,error:l.error??``}:p},a=new Map,o=[],s=function(e,t,n){let r=new Map;for(let i of e){let{id:e,own:a}=cu(i,t,n);(r.get(e)??r.set(e,{id:e,own:a,tasks:[],unit:``}).get(e))?.tasks.push(i)}for(let e of r.values()){let t=new Set(e.tasks.map(e=>e.n.unit||``));e.unit=t.size===1?[...t][0]:``}return[...r.values()]}(e,t,r);for(let e of s)e.unit?Xl(a,e.unit,e):o.push(i([e],``));let c=r?s.filter(e=>e.own&&mu(r.get(e.id))).length:0,l=s.map(e=>e.own?r?.get(e.id)?.time_box:null).find(e=>e)??null;return{byUnit:new Map([...a].map(([e,t])=>[e,i(t,e)])),single:o,calls:s.length,errors:c,timeBox:l}}function vu(e){let t={total:e.length,done:0,partial:0,failed:0,running:0,pending:0,skipped:0,blocked:0};for(let n of e)t[n.n.state]+=1;return t}function yu(e,t){let n=new Map;for(let r of e){let e=r.n.unit||``,i=n.get(e);(!i||au(iu(r,t),i)>0)&&n.set(e,iu(r,t))}return e.filter(e=>au(iu(e,t),n.get(e.n.unit||``)??[])===0)}function bu(e,t){let n=new Map;for(let r of e){let e=r.n.unit||``;(n.get(e)??n.set(e,new Set).get(e))?.add(iu(r,t).join(`.`))}return new Map([...n].map(([e,t])=>[e,t.size]))}var xu=(e,t)=>t&&t>1?{...e,passes:t}:e;function Su(e,t){let n=eu(e);return Cu(n,t,n.tasks.filter(e=>tu(e.path,t)))}function Cu(e,t,n){let r=t.length,i=new Map,a=new Map;for(let e of n){let t=su(e,r);(i.get(t.id)??i.set(t.id,{...t,tasks:[]}).get(t.id))?.tasks.push(e),a.set(e.n.key,t.id)}let o=new Map,s=new Map,c=new Map,l=new Map;for(let t of i.values()){let n=ou(t.loops),i=n[n.length-1]??null;n.forEach((e,t)=>l.set(e,n[t-1]??null)),i&&c.set(t.id,i);let a=i?yu(t.tasks,r):t.tasks;s.set(t.id,a);let u=t.type===`kind`?gu(a):_u(a,r,t.name,e.calls);if(i){let e=bu(t.tasks,r);u.byUnit=new Map([...u.byUnit].map(([t,n])=>[t,xu(n,e.get(t))]))}o.set(t.id,u)}let u=[...new Set([...o.values()].flatMap(e=>[...e.byUnit.keys()]))].sort((t,n)=>(e.unitRank.get(t)??0)-(e.unitRank.get(n)??0)),d=new Map,f=new Map;for(let e of i.values()){let t=ou(e.loops);for(let n of e.tasks){let e=iu(n,r);t.forEach((t,r)=>{d.set(t,Math.max(d.get(t)??1,e[r]??1));let i=f.get(t)??f.set(t,new Map).get(t),a=n.n.unit||``;(i?.get(a)??i?.set(a,new Set).get(a))?.add(e.slice(0,r+1).join(`.`))})}}let p=new Set,m=new Map,h=new Map,g=n=>{let i=0;for(;i<r&&n.path[i]===t[i];)i++;let a=su(n,i);return{id:`stub:${i}:${a.id}`,label:a.type===`kind`?e.labels.get(a.name)??a.name:nu(a.name)}};for(let t of n){let n=a.get(t.n.key),i=(i,o)=>{let s=a.get(i);if(s===n)return void(o===`after`&&p.add(n));if(s!==void 0){let a=e.byKey.get(i),c=ru(a,r),l=ru(t,r),u=0;for(;u<c.length&&c[u]===l[u];)u++;let d=au(iu(a,r).slice(0,u),iu(t,r).slice(0,u))===0,f=`${s}\0${n}\0${o}`,p=m.get(f)??m.set(f,{from:s,to:n,type:o,tasks:new Set,samePass:!1}).get(f);p?.tasks.add(t.n.key),p&&d&&(p.samePass=!0);return}let c=e.byKey.get(i);if(!c)return;let l=g(c),u=`${l.id}\0${n}\0${o}`;(h.get(u)??h.set(u,{...l,to:n,type:o,tasks:new Set}).get(u))?.tasks.add(t.n.key)};for(let e of t.n.after??[])i(e,`after`);for(let e of t.from)i(e,`created`)}let _=(e,t)=>e<t?-1:+(e>t),v=[...m.values()].filter(e=>e.type===`after`||!m.has(`${e.from}\0${e.to}\0after`)).sort((e,t)=>_(`${e.from}\0${e.to}\0${e.type}`,`${t.from}\0${t.to}\0${t.type}`)),y=[...h.values()].filter(e=>e.type===`after`||!h.has(`${e.id}\0${e.to}\0after`)).sort((e,t)=>_(`${e.id}\0${e.to}\0${e.type}`,`${t.id}\0${t.to}\0${t.type}`)),b=[...l.keys()].map(e=>{let i=new Map;for(let[t,n]of f.get(e)??[])t&&i.set(n.size,(i.get(n.size)??0)+1);return{id:e,local:e,layer:[...t],loop:Number(e.slice(5).split(`.`).pop()),file:n[0]?.frames[r-1]?.file??``,parent:l.get(e)??null,passes:d.get(e)??1,spread:[...i].sort((e,t)=>e[0]-t[0]),layers:[]}});return{model:{path:[...t],nodes:[...i.values()].map(n=>{let r=o.get(n.id),i=r.byUnit.size>0;return{id:n.id,type:n.type,name:n.name,label:n.type===`kind`?e.labels.get(n.name)??n.name:nu(n.name),layer:[...t],kinds:[...new Set(n.tasks.map(e=>e.n.kind))],executor:n.type===`flow`?null:fu(n.tasks.map(e=>e.n)),box:c.get(n.id)??null,units:i?u.map(e=>r.byUnit.get(e)??null):[],single:r.single,inOrder:p.has(n.id),counts:vu(s.get(n.id)??[]),calls:r.calls??0,errors:r.errors??0,timeBox:r.timeBox??null}}),boxes:b,fns:[],edges:v.map(e=>({from:e.from,to:e.to,tasks:e.tasks.size,type:e.type,samePass:e.samePass,back:!1})),stubs:y.map(e=>({id:e.id,label:e.label,to:e.to,tasks:e.tasks.size,type:e.type})),units:u},drafts:i,ix:e}}var wu=e=>e===`after`?`solid`:`dashed`;function Tu(e){return{nodes:e.nodes.map(e=>({id:e.id,cluster:e.box})),clusters:[...e.boxes.map(e=>({id:e.id,parent:e.parent,cycle:!0})),...e.fns.map(e=>({id:e.id,parent:e.parent,cycle:!1}))],edges:e.edges.map(e=>({from:e.from,to:e.to,style:wu(e.type),ranks:e.samePass})),stubs:e.stubs.map(e=>({id:e.id,to:e.to,style:wu(e.type)}))}}function Eu(e,t){let n=new Map(e.nodes.map(e=>[e.id,e])),r=new Map(t.clusters.map(e=>[e.id,e.layers]));return{...t,path:e.path,nodes:t.drawn.map(e=>n.get(e)),boxes:e.boxes.map(e=>({...e,layers:r.get(e.id)??[]})),fns:e.fns,edges:e.edges.map((e,n)=>({...e,back:t.back[n]??!1})),stubs:e.stubs,units:e.units}}var Du=`fx::`,Ou=(e,t)=>`${e.join(`/`)}/${t}`,ku=e=>e?.state===`raised`||e?.state===`closed`;function Au(e,t,n=!1){let r=t.length,i=new Map,a=new Set;if(e.calls)for(let t of e.calls.values())ku(t)&&a.add(t.id);for(let o of e.tasks){if(!tu(o.path,t))continue;let e=o.n.state,s=!!o.call&&[...a].some(e=>o.call===e||o.call.startsWith(`${e}.`)),c=null;for(let t=r;t<o.path.length;t++){let a=su(o,t),l=o.path.slice(0,t),u=Ou(l,a.id),d=i.get(u);if(!d){let e={total:0,done:0,partial:0,failed:0,running:0,pending:0,skipped:0,blocked:0},n=t>0?o.frames[t-1]?.file??``:``;d={key:u,layer:l,id:a.id,name:a.name,depth:t-r,loops:a.loops,file:n,counts:e,tasks:0,agent:0,failed:0,running:0,stuck:0,errors:!1,kids:new Set,fns:new Set,parent:c},i.set(u,d)}d.tasks+=1,d.counts.total+=1,d.counts[e]+=1,C(o.n)||(d.agent+=1),e===`failed`?d.failed+=1:e===`running`?d.running+=1:(e===`blocked`||e===`pending`&&!n)&&(d.stuck+=1),s&&(d.errors=!0);let f=su(o,t+1);d.kids.add(f.id),f.type===`flow`&&d.fns.add(Ou(o.path.slice(0,t+1),f.id)),c=u}}return i}function ju(e,t=new Set){return Math.log2(1+e.tasks)+(e.failed||e.errors?4:0)+(e.running?3:0)+(e.stuck?1.5:0)+(t.has(e.key)?6:0)}var Mu=(e,t=new Set)=>e.agent>0||e.failed>0||e.errors||e.running>0||e.stuck>0||t.has(e.key),Nu=(e,t)=>ju(e,t)-1.5*e.depth;function Pu(e,t,n){let r=new Set,i=[],a=n.closed??new Set,o=n.open??new Set,s=t,c=new Set([...e.values()].filter(e=>e.parent===null).map(e=>e.key));for(;c.size;){let t=null,l=-1/0;for(let r of c){let i=e.get(r),a=o.has(r)?1/0:Nu(i,n.toward);a>l&&(t=i,l=a)}if(!t)break;if(c.delete(t.key),a.has(t.key))continue;let u=t.kids.size-1;if(o.has(t.key)||n.all||!(s+u>n.budget)&&Mu(t,n.toward)){r.add(t.key),o.has(t.key)||i.push(t.key),s+=u;for(let e of t.fns)c.add(e)}}return{open:r,auto:i}}function Fu(e,t){let n=new Set,r=null;e.startsWith(`fx::`)?r=e.slice(4).split(`#`)[0]??null:e.includes(`::`)&&(r=e.slice(0,e.lastIndexOf(`::`)));for(let e=r;e!==null&&t.has(e);e=t.get(e)?.parent??null)n.add(e);return n}function Iu(e,t,n){let r=eu(e),i=t.length,a=r.tasks.filter(e=>tu(e.path,t)),o=Au(r,t,n.live),s=new Set(a.map(e=>su(e,i).id)).size,c=n.sel?Fu(n.sel,o):n.toward,{open:l,auto:u}=Pu(o,s,{...n,toward:c}),d=Lu(r,t,a,o,l),f=e=>uo(lo(Tu(e))).span;if(n.maxSpan&&!n.all)for(;u.length&&f(d)>n.maxSpan;)l.delete(u.pop()),d=Lu(r,t,a,o,l);return{model:d,open:l,stats:o}}function Lu(e,t,n,r,i){let a=t.length,o=new Map,s=new Map([[``,[]]]);for(let e of n){let t=a,n=``;for(s.get(``)?.push(e);t<e.path.length;){let r=Ou(e.path.slice(0,t),su(e,t).id);if(!i.has(r))break;n=r,Xl(s,r,e),t++}o.set(e.n.key,{key:n,depth:t})}let c=new Map,l=new Map;for(let[n,i]of s){let a=r.get(n),o=a?[...a.layer,a.name]:[...t];l.set(n,o),c.set(n,Cu(e,o,i))}let u=(e,t)=>e===``?t:`${e}::${t}`,d=e=>{let t=r.get(e);return(t?c.get(t.parent??``):void 0)?.model.nodes.find(e=>e.id===t?.id)},f=e=>(e=>{let t=r.get(e);if(!t||t.parent===null)return!1;let n=c.get(t.parent);if(!n)return!1;let i=n.model.nodes.filter(e=>e.type===`flow`);return i.length===1&&i[0]?.id===t.id&&!i[0]?.box})(e)?f(r.get(e).parent):`${Du}${e}`,p=[],m=[],h=new Map,g=new Set;for(let e of[...c.keys()].sort((e,t)=>e===``?-1:t===``?1:(r.get(e)?.depth??0)-(r.get(t)?.depth??0))){let t=c.get(e),n=l.get(e),a=e===``?null:f(e);if(e!==``){let t=d(e),n=r.get(e),i=t?{...t,id:u(n.parent??``,t.id)}:void 0,o={id:`${Du}${e}`,key:e,node:i};if(a===`fx::${e}`){let e=t?.box?u(n.parent??``,t.box):n.parent===null?null:f(n.parent);h.set(a,{id:a,parent:e,parts:[o]})}else h.get(a)?.parts.push(o)}for(let r of t.model.boxes)m.push({...r,id:u(e,r.id),parent:r.parent?u(e,r.parent):a,layer:n});for(let r of t.model.nodes)r.type===`flow`&&i.has(Ou(n,r.id))||p.push({...r,id:u(e,r.id),box:r.box?u(e,r.box):a,layer:n});for(let e of t.model.units)g.add(e)}let _=[...g].sort((t,n)=>(e.unitRank.get(t)??0)-(e.unitRank.get(n)??0)),v=new Map([...c].map(([e,t])=>[e,t.model.units]));for(let e of p){let t=e.id.includes(`::`)?e.id.slice(0,e.id.lastIndexOf(`::`)):``,n=v.get(t)??[];if(!e.units.length)continue;let r=new Map(n.map((t,n)=>[t,e.units[n]??null]));e.units=_.map(e=>r.get(e)??null)}let y=e=>{let t=o.get(e.n.key);return u(t.key,su(e,t.depth).id)},b=e=>e.path.slice(0,o.get(e.n.key).depth),x=new Set,S=new Map,ee=new Map;for(let r of n){let n=y(r),i=(i,o)=>{let s=e.byKey.get(i);if(!s)return;if(tu(s.path,t)){let e=y(s);if(e===n)return void(o===`after`&&x.add(n));let t=b(s),i=b(r),a=0;for(;a<t.length&&a<i.length&&t[a]===i[a];)a++;let c=ru(s,a),l=ru(r,a),u=0;for(;u<c.length&&c[u]===l[u];)u++;let d=au(iu(s,a).slice(0,u),iu(r,a).slice(0,u))===0,f=`${e}\0${n}\0${o}`,p=S.get(f)??S.set(f,{from:e,to:n,type:o,tasks:new Set,samePass:!1}).get(f);p?.tasks.add(r.n.key),p&&d&&(p.samePass=!0);return}let c=0;for(;c<a&&s.path[c]===t[c];)c++;let l=su(s,c),u={id:`stub:${c}:${l.id}`,label:l.type===`kind`?e.labels.get(l.name)??l.name:nu(l.name)},d=`${u.id}\0${n}\0${o}`;(ee.get(d)??ee.set(d,{...u,to:n,type:o,tasks:new Set}).get(d))?.tasks.add(r.n.key)};for(let e of r.n.after??[])i(e,`after`);for(let e of r.from)i(e,`created`)}for(let e of p)e.inOrder=x.has(e.id);let te=[...S.values()].filter(e=>e.type===`after`||!S.has(`${e.from}\0${e.to}\0after`)).map(e=>({from:e.from,to:e.to,tasks:e.tasks.size,type:e.type,samePass:e.samePass,back:!1})),ne=[...ee.values()].filter(e=>e.type===`after`||!ee.has(`${e.id}\0${e.to}\0after`)).map(e=>({id:e.id,label:e.label,to:e.to,tasks:e.tasks.size,type:e.type}));return{path:[...t],nodes:p,boxes:m,fns:[...h.values()],edges:te,stubs:ne,units:_}}function Ru(e){let t=new Map;for(let n of e)for(let e of n.after??[])(t.get(e)??t.set(e,[]).get(e))?.push(n.key);return{byKey:new Map(e.map(e=>[e.key,e])),waiters:t}}function zu(e,t,n,r,i=Su(e,t)){let{drafts:a,ix:o}=i,s=Eu(i.model,lo(Tu(i.model),r,!1)),c=s.boxes.find(e=>e.id===n);if(!c)return null;let l=t.length,u=c.id.slice(5).split(`.`).length-1,d=new Map(s.boxes.map(e=>[e.id,e])),f=new Map(s.nodes.map(e=>[e.id,e])),p=e=>iu(e,l).slice(u),m=e=>e.layers.flat().flatMap(e=>d.has(e)?m(d.get(e)):[e]),h=e=>m(e).flatMap(e=>a.get(e)?.tasks??[]),g=(e,t)=>e.length===t.length&&au(e,t)===0,_=(e,t)=>{let n=t.length;return[...new Set(h(e).map(p).filter(e=>e.length>n&&au(e.slice(0,n),t)===0).map(e=>e[n]))].sort((e,t)=>e-t).flatMap(n=>{let r=[...t,n],i=e.layers.flat().flatMap(e=>{let t=d.get(e);if(t){let e=_(t,r);return e.length?[{type:`loop`,box:t,kids:e}]:[]}let n=f.get(e);return n&&a.get(e)?.tasks.some(e=>g(p(e),r))?[{type:`node`,node:n,passes:r}]:[]});return i.length?[{type:`pass`,box:e,pass:n,kids:i}]:[]})},v=_(c,[]),y=[],b=e=>e.type===`node`?1:e.kids.reduce((e,t)=>e+b(t),0),x=e=>e.type===`node`?1:1+Math.max(0,...e.kids.map(x)),S=Math.max(1,...v.map(x)),ee=Array.from({length:S},()=>[]),te=(e,t)=>{let n=ee[t];if(e.type===`node`)return n.push({type:`node`,node:e.node,passes:e.passes,span:1,rows:S-t}),void y.push({node:e.node,passes:e.passes});n.push(e.type===`pass`?{type:`pass`,box:e.box,pass:e.pass,span:b(e),rows:1}:{type:`loop`,box:e.box,span:b(e),rows:1});for(let n of e.kids)te(n,t+1)};for(let e of v)te(e,0);let ne=h(c),re=new Set(ne.map(e=>e.n.unit||``)),ie=[...s.units.filter(e=>re.has(e)),...re.has(``)?[``]:[]],ae=new Map;return y.forEach((e,t)=>{for(let n of a.get(e.node.id)?.tasks??[])g(p(n),e.passes)&&Xl(ae,`${t}\0${n.n.unit||``}`,n)}),{box:c,columns:y,head:ee,rows:ie.map(e=>{let t=y.map((t,n)=>{let r=ae.get(`${n}\0${e}`);return r?.length?((e,t,n)=>{let r=a.get(e.node.id);if(r.type===`kind`)return hu(t,n);let i=_u(t,l,r.name,o.calls);return n?i.byUnit.get(n)??i.single[0]??null:i.single[0]??null})(t,r,e):null});return{unit:e,passes:new Set(ne.filter(t=>(t.n.unit||``)===e).map(e=>iu(e,l).slice(0,u+1).join(`.`))).size,state:du(t.filter(e=>e!==null).map(e=>e.state)),cells:t}})}}function Bu(e,t){let n=new Map(e.map((e,t)=>[e,t])),r=e=>t===`passes`?-e.passes:t===`state`?-lu[e.state]:0;return[...e].sort((e,t)=>r(e)-r(t)||(n.get(e)??0)-(n.get(t)??0))}var Vu=(e,t,n=[])=>`${e}${n.length?`|${n.join(`.`)}`:``}#${t.unit||t.key}`;function Hu(e,t,n){if(!n)return null;let r=n.indexOf(`#`);if(r<0){let t=e.nodes.find(e=>e.id===n);if(t)return{type:`node`,id:n,node:t};let r=e.boxes.find(e=>e.id===n);if(r)return{type:`box`,id:n,box:r};let i=e.fns.flatMap(e=>e.parts).find(e=>e.id===n);return i?{type:`node`,id:n,node:i.node}:null}let[i=``,a]=n.slice(0,r).split(`|`),o=n.slice(r+1),s=e=>!!e&&(e.unit?e.unit===o:e.key===o);if(a!==void 0){if(!t)return null;let e=t.columns.findIndex(e=>e.node.id===i&&e.passes.join(`.`)===a),r=t.columns[e],o=t.rows.map(t=>t.cells[e]).find(s);return r&&o?{type:`mark`,id:n,node:r.node,mark:o,passes:r.passes}:null}let c=e.nodes.find(e=>e.id===i),l=c?[...c.units,...c.single].find(s):void 0;return c&&l?{type:`mark`,id:n,node:c,mark:l,passes:[]}:null}var Uu=[`done`,`partial`,`running`,`pending`,`failed`,`blocked`,`skipped`],Wu={done:{tone:`done`,shape:`round`},partial:{tone:`attention`,shape:`half`},running:{tone:`running`,shape:`round`},pending:{tone:`neutral`,shape:`ring`},failed:{tone:`failed`,shape:`square`},blocked:{tone:`attention`,shape:`hatched`},skipped:{tone:`muted`,shape:`round`}};function Gu(e){return Object.fromEntries(Uu.map(t=>[t,{...Wu[t],label:Ku(t,e),rank:lu[t],count:n=>qu(t,n,e)}]))}function Ku(e,t){return is(h(e),t)}function qu(e,t,n){let r=h(e);return X(r!==`waiting`||n?r:`not_run`,t)}function Ju(e){return E(T`${e.done} of ${e.total} tasks done`)}function Yu(e,t){return[`failed`,`blocked`,`partial`,`running`,`pending`,`skipped`].filter(t=>e[t]).map(n=>qu(n,e[n],t))}function Xu(e,t){let n=e.counts,r=[];return n.failed&&r.push([`err`,qu(`failed`,n.failed,t)]),e.errors&&r.push([`err`,e.errors===1?E(`1 flow call stopped with an error`):E(T`${e.errors} flow calls stopped with an error`)]),n.blocked&&r.push([`warn`,qu(`blocked`,n.blocked,t)]),n.partial&&r.push([`warn`,qu(`partial`,n.partial,t)]),n.running&&r.push([`live`,qu(`running`,n.running,t)]),n.pending&&r.push([`mut`,qu(`pending`,n.pending,t)]),n.skipped&&r.push([`mut`,qu(`skipped`,n.skipped,t)]),r}function Zu(e,t){let n=t?t.slice(t.lastIndexOf(`/`)+1):``;return n?`${n}:${e}`:E(T`line ${e}`)}function Qu(e){return e.executor===`agent`?E(`Agent task`):e.executor===`python`?E(`Python task`):e.executor===`mixed`?K(E(`Agent task`),E(`Python task`)):``}function $u(e){return e.type===`flow`?K(E(T`Function ${e.name}`),e.timeBox?E(T`Deadline ${B(e.timeBox.deadline_s)}`):``,Ju(e.counts)):K(e.label,Qu(e),Ju(e.counts))}function ed(e,t){let n=e=>{let n=t.nodes.find(t=>t.id===e);return n?n.box?E(T`${n.label} in the loop`):n.label:e},r=r=>[...t.stubs.filter(t=>t.to===e.id&&t.type===r).map(e=>e.label),...t.edges.filter(t=>t.to===e.id&&t.type===r).map(e=>n(e.from))];return{waits:r(`after`),after:r(`created`),feeds:[...new Set(t.edges.filter(t=>t.from===e.id).map(e=>n(e.to)))]}}function td(e,t,n){let r=e.counts,{waits:i,after:a,feeds:o}=ed(e,t);return[e.type===`flow`?K(E(T`Function ${e.label}`),Ju(r)):K(e.label,Qu(e),Ju(r)),...Xu(e,n).map(([,e])=>e),i.length?E(T`Waits for: ${es(i)}`):``,a.length?E(T`Created after: ${es(a)}`):``,o.length?E(T`Later tasks: ${es(o)}`):``].filter(Boolean).join(`. `)}function nd(e,t,n,r=``){let i=t.flow?void 0:n.task,a=q({kind:t.count===1&&i?i.kind:e,unit:t.unit}),o=t.flow||t.state!==`blocked`?``:n.causeOf(t.key),s=o?E(T`Not started: ${o}`):Ku(t.state,n.live),c=i?.attempts??1,l=c>1?E(T`${c} attempts`):``;return{name:a,parts:[s,r,t.passes?xs(t.passes):``,l,t.flow||t.count>1?E(T`${t.count} tasks`):``,...t.counts?Yu(t.counts,n.live):[],...t.error===void 0?[]:[E(`Flow call stopped with an error`),t.error],t.flow||t.state!==`done`&&t.state!==`partial`&&t.state!==`failed`||!i?.wall_s?``:B(i.wall_s)].filter(Boolean),id:t.flow?E(T`Flow call ${t.key}`):t.key}}var rd={err:`failed`,warn:`attention`,live:`running`,mut:`muted`};function id(e){return t=>{let{outcomes:n}=S(e.journal,e.plan),r=n.get(t);return r?ms(r,n,e.run):``}}var ad=e=>{let t=id(e);return n=>({task:e.links.byKey.get(n.key),causeOf:t,live:e.live})},od=e=>E(T`Loop at ${Zu(e.loop,e.file)}`),sd=e=>e.executor===`mixed`?[`agent`,`python`]:e.executor?[e.executor]:[];function cd(e,t,n=!1){let r=ad(t),i=(e,t)=>{let{name:n,parts:i}=nd(e.label,t,r(t));return{id:Vu(e.id,t),state:t.state,label:K(n,...i),tip:[n,i[0]??``].filter(Boolean).join(`
|
|
418
|
-
`),...t.passes?{badge:String(t.passes)}:{},name:t.unit||t.key,drill:!!t.flow}},a=e.nodes.map(r=>{let a=r.counts;return{id:r.id,label:r.label,tip
|
|
419
|
-
`),drill:!!n.flow}})(n,t))})),value:{label:E(`Passes`),tip:E(`Passes of this loop`)},sorts:[{id:`order`,label:E(`Scheduled order`)},{id:`passes`,label:E(`Number of passes`)},{id:`state`,label:E(`Status`,{id:`status`})}],sort:t}}function
|
|
417
|
+
</ul>`}};U([P({attribute:!1})],Yl.prototype,`services`,void 0),U([P({attribute:!1})],Yl.prototype,`nodes`,void 0),U([P({type:Boolean})],Yl.prototype,`live`,void 0),Yl=U([N(`ca-services`),D()],Yl),z(`cae-mark-matrix`,to),z(`cae-layered-graph`,zo);var Xl=`loop:`,Zl=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])},Ql=e=>typeof e==`string`;function $l(e){let t=e.flow_calls;return Array.isArray(t)&&t.length!==0?new Map(t.filter(e=>e&&Ql(e.id)&&Ql(e.function)).map(e=>[e.id,e])):null}var eu=new WeakMap;function tu(e){let t=eu.get(e);if(t)return t;let n=e.nodes.map(e=>{let t=function(e){let t=e.flow;if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=e;if(!t||typeof t!=`object`||!Ql(t.function))break;let r=(Array.isArray(t.loops)?t.loops:[]).filter(e=>!!e&&typeof e.line==`number`);n.push({function:t.function,file:Ql(t.file)?t.file:``,line:typeof t.line==`number`?t.line:0,loops:r.map(e=>e.line),passes:r.map(e=>typeof e.pass==`number`&&e.pass>=1?e.pass:1)})}return n}(e),n=e.created_from;return{n:e,frames:t,path:t.map(e=>e.function),from:Array.isArray(n)?n.filter(Ql):[],call:Ql(e.flow_call)?e.flow_call:``}}),r=new Map;for(let t of e.nodes)t.unit&&!r.has(t.unit)&&r.set(t.unit,r.size);let i={tasks:n,byKey:new Map(n.map(e=>[e.n.key,e])),calls:$l(e),unitRank:r,labels:new Map(e.groups.map(e=>[e.id,e.label]))};return eu.set(e,i),i}var nu=(e,t)=>t.every((t,n)=>e[n]===t),ru=e=>e.slice(e.lastIndexOf(`.`)+1)||e,iu=(e,t)=>t>0?e.frames[t-1]?.loops??[]:[],au=(e,t)=>t>0?e.frames[t-1]?.passes??[]:[];function ou(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=(e[n]??0)-(t[n]??0);if(r)return r}return 0}var su=e=>e.map((t,n)=>`${Xl}${e.slice(0,n+1).join(`.`)}`);function cu(e,t){let n=iu(e,t),r=n.length?`@${n.join(`.`)}`:``;if(e.path.length<=t)return{id:`kind:${e.n.group}${r}`,type:`kind`,name:e.n.group,loops:n};let i=e.path[t];return{id:`flow:${i}${r}`,type:`flow`,name:i,loops:n}}function lu(e,t,n){if(!e.call)return{id:`>${t}`,own:!1};let r=e.call.split(`.`),i=r.map((e,t)=>r.slice(0,t+1).join(`.`)),a=0,o=0;if(n)for(let r=1;r<i.length;r++){let s=n.get(i[r])?.function,c=s===void 0?-1:e.frames.findIndex((e,t)=>t>o&&e.function===s);if(c<0||c>t)break;a=r,o=c}else a=Math.min(t,i.length-1),o=a;let s=i[a];return o===t?{id:s,own:!0}:{id:`${s}>${t}`,own:!1}}var uu={failed:6,running:5,blocked:4,partial:3,pending:2,skipped:1,done:0},du=e=>e.reduce((e,t)=>uu[t.state]>uu[e]?t.state:e,`done`),fu=e=>e.reduce((e,t)=>uu[t]>uu[e]?t:e,`done`);function pu(e){let t=e.filter(C).length;return t===0?`agent`:t===e.length?`python`:`mixed`}var mu={running:`running`,returned:`done`,raised:`failed`,closed:`failed`},hu=e=>e?.state===`raised`||e?.state===`closed`;function gu(e,t){let n=e.map(e=>e.n);return{key:(n.find(e=>e.state===`running`)??n[n.length-1]??{key:``}).key,unit:t,state:du(n),count:n.length,keys:n.map(e=>e.key)}}function _u(e){let t=new Map,n=[];for(let r of e)r.n.unit?Zl(t,r.n.unit,r):n.push(gu([r],``));return{byUnit:new Map([...t].map(([e,t])=>[e,gu(t,e)])),single:n}}function vu(e,t,n,r){let i=(e,t)=>{let i=e.map(e=>e.own?r?.get(e.id):void 0),a=e.map((e,t)=>{let n=i[t],r=du(e.tasks.map(e=>e.n));return n&&mu[n.state]?fu([mu[n.state],r]):r}),o=e.flatMap(e=>e.tasks),s=o.map(e=>e.n.key),c=e.find((e,t)=>a[t]===`running`)??e[e.length-1],l=i.find(hu),u={key:c?.id??``,unit:t,state:fu(a),count:s.length,keys:s,flow:n,counts:yu(o)},d=c?.own?r?.get(c.id)?.time_box:null,f=d?function(e){let t=Date.parse(e.started_at);return Number.isNaN(t)?``:new Date(t+1e3*e.deadline_s).toISOString()}(d):``,p=f?{...u,deadlineAt:f}:u;return l?{...p,error:l.error??``}:p},a=new Map,o=[],s=function(e,t,n){let r=new Map;for(let i of e){let{id:e,own:a}=lu(i,t,n);(r.get(e)??r.set(e,{id:e,own:a,tasks:[],unit:``}).get(e))?.tasks.push(i)}for(let e of r.values()){let t=new Set(e.tasks.map(e=>e.n.unit||``));e.unit=t.size===1?[...t][0]:``}return[...r.values()]}(e,t,r);for(let e of s)e.unit?Zl(a,e.unit,e):o.push(i([e],``));let c=r?s.filter(e=>e.own&&hu(r.get(e.id))).length:0,l=s.map(e=>e.own?r?.get(e.id)?.time_box:null).find(e=>e)??null;return{byUnit:new Map([...a].map(([e,t])=>[e,i(t,e)])),single:o,calls:s.length,errors:c,timeBox:l}}function yu(e){let t={total:e.length,done:0,partial:0,failed:0,running:0,pending:0,skipped:0,blocked:0};for(let n of e)t[n.n.state]+=1;return t}function bu(e,t){let n=new Map;for(let r of e){let e=r.n.unit||``,i=n.get(e);(!i||ou(au(r,t),i)>0)&&n.set(e,au(r,t))}return e.filter(e=>ou(au(e,t),n.get(e.n.unit||``)??[])===0)}function xu(e,t){let n=new Map;for(let r of e){let e=r.n.unit||``;(n.get(e)??n.set(e,new Set).get(e))?.add(au(r,t).join(`.`))}return new Map([...n].map(([e,t])=>[e,t.size]))}var Su=(e,t)=>t&&t>1?{...e,passes:t}:e;function Cu(e,t){let n=tu(e);return wu(n,t,n.tasks.filter(e=>nu(e.path,t)))}function wu(e,t,n){let r=t.length,i=new Map,a=new Map;for(let e of n){let t=cu(e,r);(i.get(t.id)??i.set(t.id,{...t,tasks:[]}).get(t.id))?.tasks.push(e),a.set(e.n.key,t.id)}let o=new Map,s=new Map,c=new Map,l=new Map;for(let t of i.values()){let n=su(t.loops),i=n[n.length-1]??null;n.forEach((e,t)=>l.set(e,n[t-1]??null)),i&&c.set(t.id,i);let a=i?bu(t.tasks,r):t.tasks;s.set(t.id,a);let u=t.type===`kind`?_u(a):vu(a,r,t.name,e.calls);if(i){let e=xu(t.tasks,r);u.byUnit=new Map([...u.byUnit].map(([t,n])=>[t,Su(n,e.get(t))]))}o.set(t.id,u)}let u=[...new Set([...o.values()].flatMap(e=>[...e.byUnit.keys()]))].sort((t,n)=>(e.unitRank.get(t)??0)-(e.unitRank.get(n)??0)),d=new Map,f=new Map;for(let e of i.values()){let t=su(e.loops);for(let n of e.tasks){let e=au(n,r);t.forEach((t,r)=>{d.set(t,Math.max(d.get(t)??1,e[r]??1));let i=f.get(t)??f.set(t,new Map).get(t),a=n.n.unit||``;(i?.get(a)??i?.set(a,new Set).get(a))?.add(e.slice(0,r+1).join(`.`))})}}let p=new Set,m=new Map,h=new Map,g=n=>{let i=0;for(;i<r&&n.path[i]===t[i];)i++;let a=cu(n,i);return{id:`stub:${i}:${a.id}`,label:a.type===`kind`?e.labels.get(a.name)??a.name:ru(a.name)}};for(let t of n){let n=a.get(t.n.key),i=(i,o)=>{let s=a.get(i);if(s===n)return void(o===`after`&&p.add(n));if(s!==void 0){let a=e.byKey.get(i),c=iu(a,r),l=iu(t,r),u=0;for(;u<c.length&&c[u]===l[u];)u++;let d=ou(au(a,r).slice(0,u),au(t,r).slice(0,u))===0,f=`${s}\0${n}\0${o}`,p=m.get(f)??m.set(f,{from:s,to:n,type:o,tasks:new Set,samePass:!1}).get(f);p?.tasks.add(t.n.key),p&&d&&(p.samePass=!0);return}let c=e.byKey.get(i);if(!c)return;let l=g(c),u=`${l.id}\0${n}\0${o}`;(h.get(u)??h.set(u,{...l,to:n,type:o,tasks:new Set}).get(u))?.tasks.add(t.n.key)};for(let e of t.n.after??[])i(e,`after`);for(let e of t.from)i(e,`created`)}let _=(e,t)=>e<t?-1:+(e>t),v=[...m.values()].filter(e=>e.type===`after`||!m.has(`${e.from}\0${e.to}\0after`)).sort((e,t)=>_(`${e.from}\0${e.to}\0${e.type}`,`${t.from}\0${t.to}\0${t.type}`)),y=[...h.values()].filter(e=>e.type===`after`||!h.has(`${e.id}\0${e.to}\0after`)).sort((e,t)=>_(`${e.id}\0${e.to}\0${e.type}`,`${t.id}\0${t.to}\0${t.type}`)),b=[...l.keys()].map(e=>{let i=new Map;for(let[t,n]of f.get(e)??[])t&&i.set(n.size,(i.get(n.size)??0)+1);return{id:e,local:e,layer:[...t],loop:Number(e.slice(5).split(`.`).pop()),file:n[0]?.frames[r-1]?.file??``,parent:l.get(e)??null,passes:d.get(e)??1,spread:[...i].sort((e,t)=>e[0]-t[0]),layers:[]}});return{model:{path:[...t],nodes:[...i.values()].map(n=>{let r=o.get(n.id),i=r.byUnit.size>0;return{id:n.id,type:n.type,name:n.name,label:n.type===`kind`?e.labels.get(n.name)??n.name:ru(n.name),layer:[...t],kinds:[...new Set(n.tasks.map(e=>e.n.kind))],executor:n.type===`flow`?null:pu(n.tasks.map(e=>e.n)),box:c.get(n.id)??null,units:i?u.map(e=>r.byUnit.get(e)??null):[],single:r.single,inOrder:p.has(n.id),counts:yu(s.get(n.id)??[]),calls:r.calls??0,errors:r.errors??0,timeBox:r.timeBox??null}}),boxes:b,fns:[],edges:v.map(e=>({from:e.from,to:e.to,tasks:e.tasks.size,type:e.type,samePass:e.samePass,back:!1})),stubs:y.map(e=>({id:e.id,label:e.label,to:e.to,tasks:e.tasks.size,type:e.type})),units:u},drafts:i,ix:e}}var Tu=e=>e===`after`?`solid`:`dashed`;function Eu(e){return{nodes:e.nodes.map(e=>({id:e.id,cluster:e.box})),clusters:[...e.boxes.map(e=>({id:e.id,parent:e.parent,cycle:!0})),...e.fns.map(e=>({id:e.id,parent:e.parent,cycle:!1}))],edges:e.edges.map(e=>({from:e.from,to:e.to,style:Tu(e.type),ranks:e.samePass})),stubs:e.stubs.map(e=>({id:e.id,to:e.to,style:Tu(e.type)}))}}function Du(e,t){let n=new Map(e.nodes.map(e=>[e.id,e])),r=new Map(t.clusters.map(e=>[e.id,e.layers]));return{...t,path:e.path,nodes:t.drawn.map(e=>n.get(e)),boxes:e.boxes.map(e=>({...e,layers:r.get(e.id)??[]})),fns:e.fns,edges:e.edges.map((e,n)=>({...e,back:t.back[n]??!1})),stubs:e.stubs,units:e.units}}var Ou=`fx::`,ku=(e,t)=>`${e.join(`/`)}/${t}`,Au=e=>e?.state===`raised`||e?.state===`closed`;function ju(e,t,n=!1){let r=t.length,i=new Map,a=new Set;if(e.calls)for(let t of e.calls.values())Au(t)&&a.add(t.id);for(let o of e.tasks){if(!nu(o.path,t))continue;let e=o.n.state,s=!!o.call&&[...a].some(e=>o.call===e||o.call.startsWith(`${e}.`)),c=null;for(let t=r;t<o.path.length;t++){let a=cu(o,t),l=o.path.slice(0,t),u=ku(l,a.id),d=i.get(u);if(!d){let e={total:0,done:0,partial:0,failed:0,running:0,pending:0,skipped:0,blocked:0},n=t>0?o.frames[t-1]?.file??``:``;d={key:u,layer:l,id:a.id,name:a.name,depth:t-r,loops:a.loops,file:n,counts:e,tasks:0,agent:0,failed:0,running:0,stuck:0,errors:!1,kids:new Set,fns:new Set,parent:c},i.set(u,d)}d.tasks+=1,d.counts.total+=1,d.counts[e]+=1,C(o.n)||(d.agent+=1),e===`failed`?d.failed+=1:e===`running`?d.running+=1:(e===`blocked`||e===`pending`&&!n)&&(d.stuck+=1),s&&(d.errors=!0);let f=cu(o,t+1);d.kids.add(f.id),f.type===`flow`&&d.fns.add(ku(o.path.slice(0,t+1),f.id)),c=u}}return i}function Mu(e,t=new Set){return Math.log2(1+e.tasks)+(e.failed||e.errors?4:0)+(e.running?3:0)+(e.stuck?1.5:0)+(t.has(e.key)?6:0)}var Nu=(e,t=new Set)=>e.agent>0||e.failed>0||e.errors||e.running>0||e.stuck>0||t.has(e.key),Pu=(e,t)=>Mu(e,t)-1.5*e.depth;function Fu(e,t,n){let r=new Set,i=[],a=n.closed??new Set,o=n.open??new Set,s=t,c=new Set([...e.values()].filter(e=>e.parent===null).map(e=>e.key));for(;c.size;){let t=null,l=-1/0;for(let r of c){let i=e.get(r),a=o.has(r)?1/0:Pu(i,n.toward);a>l&&(t=i,l=a)}if(!t)break;if(c.delete(t.key),a.has(t.key))continue;let u=t.kids.size-1;if(o.has(t.key)||n.all||!(s+u>n.budget)&&Nu(t,n.toward)){r.add(t.key),o.has(t.key)||i.push(t.key),s+=u;for(let e of t.fns)c.add(e)}}return{open:r,auto:i}}function Iu(e,t){let n=new Set,r=null;e.startsWith(`fx::`)?r=e.slice(4).split(`#`)[0]??null:e.includes(`::`)&&(r=e.slice(0,e.lastIndexOf(`::`)));for(let e=r;e!==null&&t.has(e);e=t.get(e)?.parent??null)n.add(e);return n}function Lu(e,t,n){let r=tu(e),i=t.length,a=r.tasks.filter(e=>nu(e.path,t)),o=ju(r,t,n.live),s=new Set(a.map(e=>cu(e,i).id)).size,c=n.sel?Iu(n.sel,o):n.toward,{open:l,auto:u}=Fu(o,s,{...n,toward:c}),d=Ru(r,t,a,o,l),f=e=>uo(lo(Eu(e))).span;if(n.maxSpan&&!n.all)for(;u.length&&f(d)>n.maxSpan;)l.delete(u.pop()),d=Ru(r,t,a,o,l);return{model:d,open:l,stats:o}}function Ru(e,t,n,r,i){let a=t.length,o=new Map,s=new Map([[``,[]]]);for(let e of n){let t=a,n=``;for(s.get(``)?.push(e);t<e.path.length;){let r=ku(e.path.slice(0,t),cu(e,t).id);if(!i.has(r))break;n=r,Zl(s,r,e),t++}o.set(e.n.key,{key:n,depth:t})}let c=new Map,l=new Map;for(let[n,i]of s){let a=r.get(n),o=a?[...a.layer,a.name]:[...t];l.set(n,o),c.set(n,wu(e,o,i))}let u=(e,t)=>e===``?t:`${e}::${t}`,d=e=>{let t=r.get(e);return(t?c.get(t.parent??``):void 0)?.model.nodes.find(e=>e.id===t?.id)},f=e=>(e=>{let t=r.get(e);if(!t||t.parent===null)return!1;let n=c.get(t.parent);if(!n)return!1;let i=n.model.nodes.filter(e=>e.type===`flow`);return i.length===1&&i[0]?.id===t.id&&!i[0]?.box})(e)?f(r.get(e).parent):`${Ou}${e}`,p=[],m=[],h=new Map,g=new Set;for(let e of[...c.keys()].sort((e,t)=>e===``?-1:t===``?1:(r.get(e)?.depth??0)-(r.get(t)?.depth??0))){let t=c.get(e),n=l.get(e),a=e===``?null:f(e);if(e!==``){let t=d(e),n=r.get(e),i=t?{...t,id:u(n.parent??``,t.id)}:void 0,o={id:`${Ou}${e}`,key:e,node:i};if(a===`fx::${e}`){let e=t?.box?u(n.parent??``,t.box):n.parent===null?null:f(n.parent);h.set(a,{id:a,parent:e,parts:[o]})}else h.get(a)?.parts.push(o)}for(let r of t.model.boxes)m.push({...r,id:u(e,r.id),parent:r.parent?u(e,r.parent):a,layer:n});for(let r of t.model.nodes)r.type===`flow`&&i.has(ku(n,r.id))||p.push({...r,id:u(e,r.id),box:r.box?u(e,r.box):a,layer:n});for(let e of t.model.units)g.add(e)}let _=[...g].sort((t,n)=>(e.unitRank.get(t)??0)-(e.unitRank.get(n)??0)),v=new Map([...c].map(([e,t])=>[e,t.model.units]));for(let e of p){let t=e.id.includes(`::`)?e.id.slice(0,e.id.lastIndexOf(`::`)):``,n=v.get(t)??[];if(!e.units.length)continue;let r=new Map(n.map((t,n)=>[t,e.units[n]??null]));e.units=_.map(e=>r.get(e)??null)}let y=e=>{let t=o.get(e.n.key);return u(t.key,cu(e,t.depth).id)},b=e=>e.path.slice(0,o.get(e.n.key).depth),x=new Set,S=new Map,ee=new Map;for(let r of n){let n=y(r),i=(i,o)=>{let s=e.byKey.get(i);if(!s)return;if(nu(s.path,t)){let e=y(s);if(e===n)return void(o===`after`&&x.add(n));let t=b(s),i=b(r),a=0;for(;a<t.length&&a<i.length&&t[a]===i[a];)a++;let c=iu(s,a),l=iu(r,a),u=0;for(;u<c.length&&c[u]===l[u];)u++;let d=ou(au(s,a).slice(0,u),au(r,a).slice(0,u))===0,f=`${e}\0${n}\0${o}`,p=S.get(f)??S.set(f,{from:e,to:n,type:o,tasks:new Set,samePass:!1}).get(f);p?.tasks.add(r.n.key),p&&d&&(p.samePass=!0);return}let c=0;for(;c<a&&s.path[c]===t[c];)c++;let l=cu(s,c),u={id:`stub:${c}:${l.id}`,label:l.type===`kind`?e.labels.get(l.name)??l.name:ru(l.name)},d=`${u.id}\0${n}\0${o}`;(ee.get(d)??ee.set(d,{...u,to:n,type:o,tasks:new Set}).get(d))?.tasks.add(r.n.key)};for(let e of r.n.after??[])i(e,`after`);for(let e of r.from)i(e,`created`)}for(let e of p)e.inOrder=x.has(e.id);let te=[...S.values()].filter(e=>e.type===`after`||!S.has(`${e.from}\0${e.to}\0after`)).map(e=>({from:e.from,to:e.to,tasks:e.tasks.size,type:e.type,samePass:e.samePass,back:!1})),ne=[...ee.values()].filter(e=>e.type===`after`||!ee.has(`${e.id}\0${e.to}\0after`)).map(e=>({id:e.id,label:e.label,to:e.to,tasks:e.tasks.size,type:e.type}));return{path:[...t],nodes:p,boxes:m,fns:[...h.values()],edges:te,stubs:ne,units:_}}function zu(e){let t=new Map;for(let n of e)for(let e of n.after??[])(t.get(e)??t.set(e,[]).get(e))?.push(n.key);return{byKey:new Map(e.map(e=>[e.key,e])),waiters:t}}function Bu(e,t,n,r,i=Cu(e,t)){let{drafts:a,ix:o}=i,s=Du(i.model,lo(Eu(i.model),r,!1)),c=s.boxes.find(e=>e.id===n);if(!c)return null;let l=t.length,u=c.id.slice(5).split(`.`).length-1,d=new Map(s.boxes.map(e=>[e.id,e])),f=new Map(s.nodes.map(e=>[e.id,e])),p=e=>au(e,l).slice(u),m=e=>e.layers.flat().flatMap(e=>d.has(e)?m(d.get(e)):[e]),h=e=>m(e).flatMap(e=>a.get(e)?.tasks??[]),g=(e,t)=>e.length===t.length&&ou(e,t)===0,_=(e,t)=>{let n=t.length;return[...new Set(h(e).map(p).filter(e=>e.length>n&&ou(e.slice(0,n),t)===0).map(e=>e[n]))].sort((e,t)=>e-t).flatMap(n=>{let r=[...t,n],i=e.layers.flat().flatMap(e=>{let t=d.get(e);if(t){let e=_(t,r);return e.length?[{type:`loop`,box:t,kids:e}]:[]}let n=f.get(e);return n&&a.get(e)?.tasks.some(e=>g(p(e),r))?[{type:`node`,node:n,passes:r}]:[]});return i.length?[{type:`pass`,box:e,pass:n,kids:i}]:[]})},v=_(c,[]),y=[],b=e=>e.type===`node`?1:e.kids.reduce((e,t)=>e+b(t),0),x=e=>e.type===`node`?1:1+Math.max(0,...e.kids.map(x)),S=Math.max(1,...v.map(x)),ee=Array.from({length:S},()=>[]),te=(e,t)=>{let n=ee[t];if(e.type===`node`)return n.push({type:`node`,node:e.node,passes:e.passes,span:1,rows:S-t}),void y.push({node:e.node,passes:e.passes});n.push(e.type===`pass`?{type:`pass`,box:e.box,pass:e.pass,span:b(e),rows:1}:{type:`loop`,box:e.box,span:b(e),rows:1});for(let n of e.kids)te(n,t+1)};for(let e of v)te(e,0);let ne=h(c),re=new Set(ne.map(e=>e.n.unit||``)),ie=[...s.units.filter(e=>re.has(e)),...re.has(``)?[``]:[]],ae=new Map;return y.forEach((e,t)=>{for(let n of a.get(e.node.id)?.tasks??[])g(p(n),e.passes)&&Zl(ae,`${t}\0${n.n.unit||``}`,n)}),{box:c,columns:y,head:ee,rows:ie.map(e=>{let t=y.map((t,n)=>{let r=ae.get(`${n}\0${e}`);return r?.length?((e,t,n)=>{let r=a.get(e.node.id);if(r.type===`kind`)return gu(t,n);let i=vu(t,l,r.name,o.calls);return n?i.byUnit.get(n)??i.single[0]??null:i.single[0]??null})(t,r,e):null});return{unit:e,passes:new Set(ne.filter(t=>(t.n.unit||``)===e).map(e=>au(e,l).slice(0,u+1).join(`.`))).size,state:fu(t.filter(e=>e!==null).map(e=>e.state)),cells:t}})}}function Vu(e,t){let n=new Map(e.map((e,t)=>[e,t])),r=e=>t===`passes`?-e.passes:t===`state`?-uu[e.state]:0;return[...e].sort((e,t)=>r(e)-r(t)||(n.get(e)??0)-(n.get(t)??0))}var Hu=(e,t,n=[])=>`${e}${n.length?`|${n.join(`.`)}`:``}#${t.unit||t.key}`;function Uu(e,t,n){if(!n)return null;let r=n.indexOf(`#`);if(r<0){let t=e.nodes.find(e=>e.id===n);if(t)return{type:`node`,id:n,node:t};let r=e.boxes.find(e=>e.id===n);if(r)return{type:`box`,id:n,box:r};let i=e.fns.flatMap(e=>e.parts).find(e=>e.id===n);return i?{type:`node`,id:n,node:i.node}:null}let[i=``,a]=n.slice(0,r).split(`|`),o=n.slice(r+1),s=e=>!!e&&(e.unit?e.unit===o:e.key===o);if(a!==void 0){if(!t)return null;let e=t.columns.findIndex(e=>e.node.id===i&&e.passes.join(`.`)===a),r=t.columns[e],o=t.rows.map(t=>t.cells[e]).find(s);return r&&o?{type:`mark`,id:n,node:r.node,mark:o,passes:r.passes}:null}let c=e.nodes.find(e=>e.id===i),l=c?[...c.units,...c.single].find(s):void 0;return c&&l?{type:`mark`,id:n,node:c,mark:l,passes:[]}:null}var Wu=[`done`,`partial`,`running`,`pending`,`failed`,`blocked`,`skipped`],Gu={done:{tone:`done`,shape:`round`},partial:{tone:`attention`,shape:`half`},running:{tone:`running`,shape:`round`},pending:{tone:`neutral`,shape:`ring`},failed:{tone:`failed`,shape:`square`},blocked:{tone:`attention`,shape:`hatched`},skipped:{tone:`muted`,shape:`round`}};function Ku(e){return Object.fromEntries(Wu.map(t=>[t,{...Gu[t],label:qu(t,e),rank:uu[t],count:n=>Ju(t,n,e)}]))}function qu(e,t){return is(h(e),t)}function Ju(e,t,n){let r=h(e);return X(r!==`waiting`||n?r:`not_run`,t)}function Yu(e){return E(T`${e.done} of ${e.total} tasks done`)}function Xu(e,t){return[`failed`,`blocked`,`partial`,`running`,`pending`,`skipped`].filter(t=>e[t]).map(n=>Ju(n,e[n],t))}function Zu(e,t){let n=e.counts,r=[];return n.failed&&r.push([`err`,Ju(`failed`,n.failed,t)]),e.errors&&r.push([`err`,e.errors===1?E(`1 flow call stopped with an error`):E(T`${e.errors} flow calls stopped with an error`)]),n.blocked&&r.push([`warn`,Ju(`blocked`,n.blocked,t)]),n.partial&&r.push([`warn`,Ju(`partial`,n.partial,t)]),n.running&&r.push([`live`,Ju(`running`,n.running,t)]),n.pending&&r.push([`mut`,Ju(`pending`,n.pending,t)]),n.skipped&&r.push([`mut`,Ju(`skipped`,n.skipped,t)]),r}function Qu(e,t){let n=t?t.slice(t.lastIndexOf(`/`)+1):``;return n?`${n}:${e}`:E(T`line ${e}`)}function $u(e){return e.executor===`agent`?E(`Agent task`):e.executor===`python`?E(`Python task`):e.executor===`mixed`?K(E(`Agent task`),E(`Python task`)):``}function ed(e){return e.type===`flow`?K(E(T`Function ${e.name}`),e.timeBox?E(T`Deadline ${B(e.timeBox.deadline_s)}`):``,Yu(e.counts)):K(e.label,$u(e),Yu(e.counts))}function td(e,t){let n=e=>{let n=t.nodes.find(t=>t.id===e);return n?n.box?E(T`${n.label} in the loop`):n.label:e},r=r=>[...t.stubs.filter(t=>t.to===e.id&&t.type===r).map(e=>e.label),...t.edges.filter(t=>t.to===e.id&&t.type===r).map(e=>n(e.from))];return{waits:r(`after`),after:r(`created`),feeds:[...new Set(t.edges.filter(t=>t.from===e.id).map(e=>n(e.to)))]}}function nd(e,t,n){let r=e.counts,{waits:i,after:a,feeds:o}=td(e,t);return[e.type===`flow`?K(E(T`Function ${e.label}`),Yu(r)):K(e.label,$u(e),Yu(r)),...Zu(e,n).map(([,e])=>e),i.length?E(T`Waits for: ${es(i)}`):``,a.length?E(T`Created after: ${es(a)}`):``,o.length?E(T`Later tasks: ${es(o)}`):``].filter(Boolean).join(`. `)}function rd(e,t,n,r=``){let i=t.flow?void 0:n.task,a=q({kind:t.count===1&&i?i.kind:e,unit:t.unit}),o=t.flow||t.state!==`blocked`?``:n.causeOf(t.key),s=o?E(T`Not started: ${o}`):qu(t.state,n.live),c=i?.attempts??1,l=c>1?E(T`${c} attempts`):``;return{name:a,parts:[s,r,t.passes?xs(t.passes):``,l,t.flow||t.count>1?E(T`${t.count} tasks`):``,...t.counts?Xu(t.counts,n.live):[],...t.error===void 0?[]:[E(`Flow call stopped with an error`),t.error],t.flow||t.state!==`done`&&t.state!==`partial`&&t.state!==`failed`||!i?.wall_s?``:B(i.wall_s)].filter(Boolean),id:t.flow?E(T`Flow call ${t.key}`):t.key}}var id={err:`failed`,warn:`attention`,live:`running`,mut:`muted`};function ad(e){return t=>{let{outcomes:n}=S(e.journal,e.plan),r=n.get(t);return r?ms(r,n,e.run):``}}var od=e=>{let t=ad(e);return n=>({task:e.links.byKey.get(n.key),causeOf:t,live:e.live})},sd=e=>E(T`Loop at ${Qu(e.loop,e.file)}`),cd=e=>e.executor===`mixed`?[`agent`,`python`]:e.executor?[e.executor]:[];function ld(e,t,n=!1){let r=od(t),i=(e,t)=>{let{name:n,parts:i}=rd(e.label,t,r(t));return{id:Hu(e.id,t),state:t.state,label:K(n,...i),tip:[n,i[0]??``].filter(Boolean).join(`
|
|
418
|
+
`),...t.passes?{badge:String(t.passes)}:{},name:t.unit||t.key,drill:!!t.flow}},a=e.nodes.map(r=>{let a=r.counts;return{id:r.id,label:r.label,tip:ed(r),summary:nd(r,e,t.live),cluster:r.box,icons:cd(r),accent:r.executor===`agent`,drill:r.type===`flow`,marks:r.units.map(e=>e&&i(r,e)),loose:r.single.map(e=>i(r,e)),counts:a,progress:{done:a.done,total:a.total,label:Yu(a)},notes:Zu(r,t.live).map(([e,t])=>({text:t,tone:id[e]})),look:a.failed||r.errors?`failed`:a.running?`running`:a.done+a.skipped===a.total?`done`:void 0,...r.type===`flow`&&n?{toggle:`closed`}:{}}}),o=e.fns.map(n=>{let r=n.parts[0].node,i=n.parts.map(e=>e.node.label).join(` › `),a=r.counts,o=Zu(r,t.live).map(([,e])=>e);return{id:n.id,parent:n.parent,label:i,tip:r.name,note:`${a.done}/${a.total}`,...o.length?{detail:K(...o)}:{},summary:K(i,nd(r,e,t.live)),chipLabel:E(T`Inside ${i}`),chipTip:K(E(`Function`),i),drill:!0,cycle:!1,toggle:`open`,path:n.parts.map(e=>({id:e.id,label:e.node.label,tip:e.node.name}))}}),s=e.boxes.map(e=>{let t=sd(e),n=e.spread.length>1?Ss(e.spread):``,r=bs(e.passes);return{id:e.id,parent:e.parent,label:Cs(),tip:K(Cs(),t),note:r,...n?{detail:n,detailTip:E(`Units by number of passes`)}:{},summary:K(t,r,n),chipLabel:K(E(T`Passes of the loop at ${Qu(e.loop,e.file)}`),r),chipTip:K(t,r),drill:!0,cycle:!0}});return{series:e.units,nodes:a,clusters:[...s,...o],edges:e.edges.map(e=>({from:e.from,to:e.to,style:Tu(e.type),weight:e.tasks,ranks:e.samePass})),stubs:e.stubs.map(e=>({id:e.id,label:e.label,to:e.to,style:Tu(e.type),weight:e.tasks}))}}function ud(e,t,n){let r=Cu(e,t);return{input:ld(r.model,{...n,plan:e}),proj:r}}function dd(e,t,n){let r=od(n),i=e.box,a=sd(i),o=e.rows.filter(e=>e.unit).length,s=e.head.map(e=>e.map(e=>{if(e.type===`pass`)return{id:`${e.box.id}|${e.pass}`,label:ys(e.pass),tip:e.box.id===i.id?sd(e.box):E(T`Nested loop at ${Qu(e.box.loop,e.box.file)}`),span:e.span,rows:e.rows,type:`group`};if(e.type===`loop`)return{id:e.box.id,label:Cs(),tip:E(T`Nested loop at ${Qu(e.box.loop,e.box.file)}`),code:!0,span:e.span,rows:e.rows,type:`group`};let t=e.node,n=t.type===`flow`;return{id:`${t.id}|${e.passes.join(`.`)}`,label:t.label,tip:n?E(T`Function ${t.name}`):K(t.label,$u(t)),summary:n?t.label:K(t.label,$u(t)),icons:t.executor&&t.executor!==`mixed`?[t.executor]:[],span:e.span,rows:e.rows,type:`column`}}));return{caption:a,...i.file?{captionTip:`${i.file}:${i.loop}`}:{},label:K(a,bs(i.passes)),facts:[bs(i.passes),i.spread.length>1?Ss(i.spread):``,E(o===1?`1 unit`:T`${o} units`)].filter(Boolean),head:s,columns:e.columns.map(e=>({id:`${e.node.id}|${e.passes.join(`.`)}`,groups:e.passes.map((t,n)=>e.passes.slice(0,n+1).join(`.`))})),rows:Vu(e.rows,t).map(t=>({id:t.unit,label:t.unit||E(`No unit`),tip:t.unit||E(`Tasks that run once per run, not once per unit`),muted:!t.unit,value:t.passes,strong:t.passes>1,cells:t.cells.map((t,n)=>t&&((t,n)=>{let i=e.columns[t],a=i?.node.label??``,o=i?.passes??[],{name:s,parts:c}=rd(a,n,r(n),es(o.map(ys)));return{id:Hu(i?.node.id??``,n,o),state:n.state,label:K(s,...c),tip:[s,c[0]??``].filter(Boolean).join(`
|
|
419
|
+
`),drill:!!n.flow}})(n,t))})),value:{label:E(`Passes`),tip:E(`Passes of this loop`)},sorts:[{id:`order`,label:E(`Scheduled order`)},{id:`passes`,label:E(`Number of passes`)},{id:`state`,label:E(`Status`,{id:`status`})}],sort:t}}function fd(e,t,n,r,i,a,o){let s=Bu(e,t,n,r,o);return s&&{input:dd(s,i,{...a,plan:e}),matrix:s}}function pd(e,t=[],n,r=!1){let{model:i}=Cu(e,t);return Du(i,lo(Eu(i),n,r))}function md(e){let t=tu(e),n=[],r=new Set;if(t.calls)for(let e of t.calls.values())e.state!==`raised`&&e.state!==`closed`||r.add(e.id);for(;;){let e=null,i=!0,a=[];for(let r of t.tasks){if(!nu(r.path,n))continue;let t=cu(r,n.length);if(t.type===`kind`||e&&e.id!==t.id){i=!1;break}e=t,a.push(r)}let o=a.some(e=>{return i=lu(e,n.length,t.calls).id,r.has(i)&&![...r].some(e=>e!==i&&e.startsWith(`${i}.`));var i});if(!i||!e||o)return n;n.push(e.name)}}function hd(e){let t=e[e.length-1];return t?.startsWith(`loop:`)?{path:e.slice(0,-1),loop:t}:{path:[...e],loop:null}}function gd(e,t){let{path:n,loop:r}=hd(t),i=tu(e),a=t=>!r||Cu(e,t).model.boxes.some(e=>e.id===r);if(i.tasks.some(e=>nu(e.path,n)))return a(n)?[...t]:null;let o=n[n.length-1];if(o===void 0)return null;let s=e=>{let t=new Map;for(let n of i.tasks)n.path.forEach((r,i)=>e(r)&&t.set(n.path.slice(0,i+1).join(`/`),n.path.slice(0,i+1)));return[...t.values()]},c=s(e=>e===o),l=c.length?c:s(e=>ru(e)===o),u=l.length===1?l[0]:null;return u&&a(u)?r?[...u,r]:u:null}function _d(e,t){if(e.length<=t.length)return null;let n=e.slice(0,-1);return n.length<=t.length?[]:n}function vd(e,t,n){return pi((e=>e?`⚙`:`✦`)(e),t,{cls:n??`k-ic `+(e?``:`llm`)})}var yd=O` .k-ic{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:6px;margin-right:7px;font-size:var(--font-size-sm);background:var(--raise);color:var(--text-muted);flex:none;}.k-ic.llm{background:var(--agent-bg);color:var(--agent);}`;function bd(e,t){t!==e.sel&&Q(e.el,`ca-navigate`,{sel:t})}function xd(e,t,n=e.unit){let r=t.join(`/`);Q(e.el,`ca-navigate`,{layer:r===e.auto.join(`/`)?``:r,unit:n})}function Sd(e,t){Q(e.el,`ca-navigate`,{tab:`tasks`,kind:t.kinds.length===1?t.kinds[0]:``})}function Cd(e,t,n){if(t.flow)return xd(e,[...n?.layer??e.graph.path,t.flow],t.unit||e.unit);let r=e.links.byKey.get(t.key);Q(e.el,`ca-open-task`,t.state===`blocked`?{key:t.key,view:`input`}:r?.executor===`python`?{key:t.key,view:`output`}:{key:t.key})}function wd(e,t){return t.type===`mark`?Cd(e,t.mark,t.node):t.type===`box`?xd(e,[...t.box.layer,t.box.local]):t.node.type===`flow`?xd(e,[...t.node.layer,t.node.name]):void Sd(e,t.node)}function Td(e,t){let n=function(e,t){let n=e=>{let r=e;for(;r.type===`fn`&&!t(r.id)&&r.kids.length===1&&r.kids[0]?.type===`fn`&&!t(r.kids[0].id);){let e=r.kids[0];r={...r,label:`${r.label} › ${e.label}`,tip:`${r.tip}\n${e.tip}`,kids:e.kids,parts:[...r.parts,...e.parts]}}return{...r,kids:r.kids.map(n)}};return e.map(n)}(t,t=>e.current(t)),r=(t,n=``)=>{let i=t.kids.length>0&&e.expanded(t.id),a=t.counts,o=a.total?Math.round((a.done+a.partial+a.skipped)/a.total*100):0,s=(t=>Zu({counts:t.counts,errors:+!!t.errors},e.live))(t),c=s.map(([,e])=>e).join(`|`),l=c===n?[]:s,u=t.parts.some(t=>e.current(t.id)),d=t.parts.some(t=>e.here(t.id));return k`<li>
|
|
420
420
|
<div class="orow ${u?`cur`:``} ${t.parts.some(t=>e.selected(t.id))?`sel`:``}">
|
|
421
421
|
${t.kids.length?k`<button type="button" class="odisc" aria-expanded=${i} aria-label=${E(i?T`Fold ${t.label}`:T`Unfold ${t.label}`)} @click=${()=>e.expand(t.id,!i)}><span aria-hidden="true">${i?`▾`:`▸`}</span></button>`:k`<span class="odisc" aria-hidden="true"></span>`}
|
|
422
422
|
<button type="button" class="oname" title=${t.tip||j} aria-current=${d?`location`:j} @click=${n=>n.detail<2&&e.pick(t)} @dblclick=${()=>e.enter(t)} @keydown=${n=>{n.key===`Enter`&&(n.preventDefault(),e.enter(t))}}>
|
|
423
423
|
${t.type===`loop`?bo(12):j}<span class="ol">${t.label}</span>
|
|
424
424
|
<span class="obar" aria-hidden="true"><i style="width:${o}%"></i></span>
|
|
425
|
-
<span class="ocount" title=${
|
|
425
|
+
<span class="ocount" title=${Yu(a)}>${a.done}/${a.total}</span>
|
|
426
426
|
</button>
|
|
427
427
|
${l.length?k`<div class="onote">${l.map(([e,t])=>k`<span class=${e}>${t}</span>`)}</div>`:j}
|
|
428
428
|
</div>
|
|
429
429
|
${i?k`<ul>${t.kids.map(e=>r(e,c))}</ul>`:j}
|
|
430
|
-
</li>`};return k`<nav class="outline" aria-label=${E(`Outline of the flow`)}><ul class="otree">${n.map(e=>r(e))}</ul></nav>`}var Td=[V,vd,Jr,O` :host{display:flex;flex-direction:column;}cae-layered-graph{flex:auto;min-height:0;}.bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-bottom:8px;font-size:12px;}.crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:4px;list-style:none;margin:0;padding:0;}.crumbs li{display:inline-flex;align-items:center;gap:4px;}.crumbs .sep{color:var(--text-muted);}.crumbs button{all:unset;cursor:pointer;color:var(--accent);font-family:var(--mono);}.crumbs button:hover{text-decoration:underline;}.crumbs button:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:2px;border-radius:3px;}.crumbs [aria-current]{font-family:var(--mono);color:var(--text);font-weight:600;}.pin{display:inline-flex;align-items:center;gap:8px;color:var(--text-2);}.pin b{font-family:var(--mono);}.missing{margin-bottom:8px;font-size:12px;color:var(--status-attention);}.missing code{font-family:var(--mono);}.card{display:contents;}.ic{display:block;flex:none;}.loop-ic{color:var(--text-2);}.in-ic{color:var(--text-muted);}.card h4{margin:0;display:flex;align-items:center;gap:7px;font-family:var(--mono);font-size:13px;font-weight:600;color:var(--text);overflow-wrap:anywhere;}.card h4 .mark{--m:11px;flex:none;cursor:default;animation:none;}.card h4 .mark:hover{transform:none;outline:none;}.card h4 .k-ic{width:18px;height:18px;margin:0;border-radius:5px;font-size:10px;}.card .sub{color:var(--text-2);}.card dl{display:grid;grid-template-columns:fit-content(42%) minmax(0,1fr);gap:4px 12px;margin:0;}.card dt{color:var(--text-muted);word-break:keep-all;overflow-wrap:break-word;}.card dd{margin:0;color:var(--text);overflow-wrap:anywhere;font-variant-numeric:tabular-nums;}.card dd .err{color:var(--status-failed);}.card dd .warn{color:var(--status-attention);}.card .acts{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;padding-top:2px;}.card .go{all:unset;cursor:pointer;color:var(--accent);overflow-wrap:anywhere;}.card .go.primary{font-weight:600;}.card .go:hover{text-decoration:underline;}.card .go:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:2px;border-radius:3px;}.card .acts .switch{margin-left:auto;}.switch{all:unset;cursor:pointer;font-size:11.5px;color:var(--text-2);padding:2px 8px;border-radius:6px;border:1px solid var(--line);}.switch:hover{color:var(--text);border-color:var(--line2);}.switch:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;}.switch[aria-pressed='true']{color:var(--text);background:var(--accent-bg);border-color:var(--accent);}.opens{display:inline-flex;gap:6px;margin-left:auto;}.whole{display:grid;grid-template-columns:minmax(200px,282px) minmax(0,1fr);gap:14px;align-items:start;}.whole>.g{min-width:0;}.outline{font-size:12px;max-height:70vh;overflow:auto;padding:2px 6px 2px 0;border-right:1px solid var(--line);}.otree,.otree ul{list-style:none;margin:0;padding:0;}.otree ul{padding-left:10px;}.orow{display:grid;grid-template-columns:16px minmax(0,1fr);align-items:start;border-radius:6px;}.orow.sel{background:var(--accent-bg);}.orow.cur .ol{font-weight:600;color:var(--text);}.odisc{all:unset;cursor:pointer;width:16px;text-align:center;color:var(--text-muted);font-size:10px;line-height:22px;}.odisc:focus-visible,.oname:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;border-radius:4px;}.oname{all:unset;cursor:pointer;display:flex;align-items:flex-start;gap:6px;min-width:0;padding:3px 6px 3px 2px;border-radius:6px;color:var(--text-2);}.oname:hover{background:var(--raise);color:var(--text);}.oname .loop-ic{flex:none;color:var(--text-muted);}.ol{flex:1;min-width:0;overflow-wrap:break-word;font-family:var(--mono);line-height:1.35;}.obar{flex:none;width:32px;height:4px;margin-top:6px;border-radius:2px;background:var(--track);overflow:hidden;}.obar i{display:block;height:100%;background:var(--meter);}.ocount{flex:none;font-size:11px;color:var(--text-muted);font-variant-numeric:tabular-nums;}.onote{grid-column:2;display:flex;flex-wrap:wrap;gap:0 8px;padding:0 6px 2px 2px;font-size:11px;}.onote .err{color:var(--status-failed);}.onote .warn{color:var(--status-attention);}.onote .live{color:var(--status-running);}.onote .mut{color:var(--text-muted);}.odet{margin-bottom:8px;}.odet>summary{cursor:pointer;font-size:12px;color:var(--text-2);padding:2px 0;}.odet .outline{border-right:none;max-height:50vh;}`],Ed=[vd,O` .node .k-ic{width:16px;height:16px;margin-right:6px;border-radius:4px;font-size:9.5px;}.legend .k-ic{width:14px;height:14px;margin:0;border-radius:4px;font-size:8.5px;}.list .k-ic{width:16px;height:16px;border-radius:4px;font-size:9.5px;}.list .nm .k-ic{margin:0 -2px 0 0;}.matrix thead th.nh .k-ic{width:14px;height:14px;margin-right:5px;border-radius:4px;font-size:8.5px;vertical-align:-2px;}`],Dd=e=>Math.max(14,Math.min(60,Math.round(e/34))),Od=e=>Math.max(8,Math.min(16,Math.round(e/105))),kd=(e,t)=>t>0&&t/(180*e)<.6,Ad=`*all`,jd=`*none`,Md={...lo({nodes:[],clusters:[],edges:[],stubs:[]}),path:[],nodes:[],boxes:[],fns:[],edges:[],stubs:[],units:[]},Nd=class extends M{constructor(...e){super(...e),this.plan={nodes:[],groups:[]},this.journal=[],this.run=``,this.live=!1,this.layer=``,this.unit=``,this.sel=``,this.down=!1,this.tall=!1,this.sort=`order`,this.missing=``,this.fixLayer=null,this.replacing=!1,this.auto=[],this.segments=[],this.proj=null,this.model=null,this.graph=Md,this.input={series:[],nodes:[],clusters:[],edges:[],stubs:[]},this.prevOrder=void 0,this.matrix=null,this.matrixIn=null,this.orders=new Map,this.links=Ru([]),this.states=Gu(!1),this.locale=``,this.opened=null,this.closed=null,this.memRun=null,this.rev=0,this.budget=40,this.shownOpen=new Set,this.stats=new Map,this.focusToggle=``,this.flowStats=new Map,this.tree=[],this.folds=new Map,this.wide=!0,this.oh=this.outlineHost(),this.lights=()=>new Set,this.refocus=!1,this.cameFrom=``,this.h=this.partsHost(),this.onToggle=e=>this.toggle(e.detail.id,e.detail.open),this.onEscape=e=>{if(e.key!==`Escape`||e.defaultPrevented)return;let t=gd(this.segments,this.auto);t&&(e.preventDefault(),this.refocus=!0,this.cameFrom=this.segments[this.segments.length-1]??``,bd(this.h,t))},this.onSelect=e=>yd(this.h,e.detail.id??``),this.onActivate=e=>{let t=Hu(this.graph,this.matrix,e.detail.id);t?.type===`mark`?Sd(this.h,t.mark,t.node):t?.type===`node`&&xd(this.h,t.node)},this.onDrill=e=>{let t=Hu(this.graph,this.matrix,e.detail.id);t&&Cd(this.h,t)},this.onView=e=>{e.detail.view===`graph`&&this.matrix&&function(e){let t=e.segments[e.segments.length-1]??``,n=gd(e.segments,e.auto)??[],r=e.auto.join(`/`);Q(e.el,`ca-navigate`,{layer:n.join(`/`)===r?``:n.join(`/`),unit:e.unit,sel:t})}(this.h)}}static{this.styles=Td}static{this.properties={plan:{attribute:!1},journal:{attribute:!1},run:{},live:{type:Boolean},layer:{},unit:{},sel:{},down:{state:!0},sort:{state:!0},missing:{state:!0},rev:{state:!0},budget:{state:!0},wide:{state:!0}}}willUpdate(e){if(e.has(`run`)&&this.orders.clear(),e.has(`layer`)&&e.get(`layer`)!==void 0){let e=this.renderRoot instanceof ShadowRoot?this.renderRoot.activeElement:null,t=e?.shadowRoot?.activeElement;this.refocus=e!==null&&!t?.closest(`.views`),this.replacing?this.replacing=!1:this.missing=``}e.has(`run`)&&e.get(`run`)!==void 0&&(this.missing=``),e.has(`plan`)&&(this.links=Ru(this.plan.nodes)),(e.has(`plan`)||e.has(`live`))&&(this.flowStats=Au(eu(this.plan),[],this.live),this.tree=function(e){let t=new Map;for(let n of e.values())(t.get(n.parent)??t.set(n.parent,[]).get(n.parent))?.push(n);let n=e=>{let r=[],i=new Map;for(let a of t.get(e)??[]){let e={id:a.key,type:`fn`,label:nu(a.name),tip:a.name,layer:a.layer,name:a.name,counts:a.counts,errors:a.errors,kids:n(a.key),parts:[{id:a.key,layer:a.layer,name:a.name}]},t=r;a.loops.forEach((e,n)=>{let r=`${Yl}${a.loops.slice(0,n+1).join(`.`)}`,o=`${a.layer.join(`/`)}|${r}`,s=i.get(o);if(!s){let e=a.loops[n];s={id:o,type:`loop`,label:E(T`Loop at ${Zu(e,a.file)}`),tip:a.file?`${a.file}:${e}`:``,layer:a.layer,name:r,counts:{total:0,done:0,partial:0,failed:0,running:0,pending:0,skipped:0,blocked:0},errors:!1,kids:[],parts:[{id:o,layer:a.layer,name:r}]},i.set(o,s),t.push(s)}for(let e of Object.keys(s.counts))s.counts[e]+=a.counts[e];s.errors||=a.errors,t=s.kids}),t.push(e)}return r};return n(null)}(this.flowStats)),e.has(`run`)&&this.folds.clear();let t=e.has(`sel`)&&!!this.sel&&!md(this.segments).loop&&!Hu(this.graph,this.matrix,this.sel),n=e.has(`plan`)||e.has(`layer`)||e.has(`run`)||e.has(`down`)||e.has(`rev`)||e.has(`budget`)||t;if(n){if(this.auto=pd(this.plan),this.segments=this.layer?this.layer.split(`/`):this.auto,this.layer&&this.plan.nodes.length){let e=hd(this.plan,this.segments);e?e.join(`/`)!==this.layer&&(this.segments=e,this.fixLayer=e.join(`/`)===this.auto.join(`/`)?``:e.join(`/`)):(this.missing=this.layer,this.segments=this.auto,this.fixLayer=``)}let{path:e,loop:t}=md(this.segments);if(t)this.proj=Su(this.plan,e),this.model=this.proj.model;else{let t=this.memory(),n=this.openMode(),r=Iu(this.plan,e,{open:new Set(t.opened.values().filter(e=>!e.startsWith(`*`))),closed:new Set(t.closed.values()),all:n===`all`,budget:n===`none`?0:this.budget,maxSpan:Od(this.graphWidth()),sel:this.sel,live:this.live});this.proj=null,this.model=r.model,this.shownOpen=r.open,this.stats=r.stats}this.prevOrder=this.orders.get(e.join(`/`))}let r=I(),i=n||e.has(`journal`)||e.has(`live`)||r!==this.locale;(i||e.has(`sort`))&&this.build(i,r)}build(e,t){let n=this.model;if(!n)return;let r=this.proj,{path:i,loop:a}=md(this.segments),o={plan:this.plan,journal:this.journal,run:this.run,live:this.live,links:this.links};if(e){this.locale=t,this.states=Gu(this.live),this.input=cd(n,o,!a);let e=lo(this.input,this.prevOrder,this.down);this.tall=!this.down&&!a&&kd(uo(e).span,this.graphWidth()),this.tall&&(e=lo(this.input,this.prevOrder,!0)),this.graph=Eu(n,e),this.orders.set(i.join(`/`),e.order),this.lights=function(e,t,n){let r=n.nodes.flatMap(e=>[...e.units,...e.single].filter(e=>e!==null).map(t=>[Vu(e.id,t),t])),i=new Map(r.map(([e,t])=>[e,t.key])),a=new Map;return n=>{let o=a.get(n);if(o)return o;let s=function(e,t,n){let r=e.filter(e=>e.unit?e.unit===n:e.key===n).map(e=>e.key),i=new Set(r),a=e=>{let t=new Set(r),n=[...r];for(let r=n.pop();r!==void 0;r=n.pop())for(let a of e(r))t.has(a)||(t.add(a),i.add(a),n.push(a))};return a(e=>t.waiters.get(e)??[]),a(e=>t.byKey.get(e)?.after??[]),i}(e.nodes,t,i.get(n)??n),c=new Set(r.filter(([,e])=>e.keys.some(e=>s.has(e))).map(([e])=>e));return a.set(n,c),c}}(this.plan,this.links,this.graph)}let s=a&&r?dd(this.plan,i,a,this.graph.order,this.sort,o,r):null;this.matrix=s?.matrix??null,this.matrixIn=s?.input??null}connectedCallback(){super.connectedCallback(),this.addEventListener(`keydown`,this.onEscape),this.resize=new ResizeObserver(()=>{let e=this.clientWidth,t=e>0&&e<640;t!==this.down&&(this.down=t);let n=e>0?Dd(this.graphWidth()):this.budget;n!==this.budget&&(this.budget=n);let r=e===0||e>=1500;r!==this.wide&&(this.wide=r)}),this.resize.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`keydown`,this.onEscape),this.resize?.disconnect()}memory(){return this.opened&&this.closed&&this.memRun===this.run||(this.memRun=this.run,this.opened=new Xn(`graph-open:${this.run}`,this),this.closed=new Xn(`graph-closed:${this.run}`,this)),{opened:this.opened,closed:this.closed}}openMode(){let{opened:e}=this.memory();return e.has(Ad)?`all`:e.has(jd)?`none`:`auto`}setMode(e){let{opened:t,closed:n}=this.memory();t.clear(),n.clear(),e===`all`&&t.set(Ad,!0),e===`none`&&t.set(jd,!0),Wn(),this.rev++}placeOfNode(e){let t=this.graph.nodes.find(t=>t.id===e);if(!t||t.type!==`flow`)return null;let n=e.includes(`::`)?e.slice(e.lastIndexOf(`::`)+2):e;return Ou(t.layer,n)}toggle(e,t){let n=e.startsWith(`fx::`)?e.slice(4):this.placeOfNode(e);if(!n)return;let{opened:r,closed:i}=this.memory();r.set(n,t),i.set(n,!t),Wn(),this.focusToggle=t?`${Du}${n}`:this.nodeIdOf(n),this.rev++}nodeIdOf(e){let t=this.stats.get(e);if(!t)return``;let n=t.parent;return n!==null&&this.shownOpen.has(n)?`${n}::${t.id}`:t.id}updated(){if(this.focusToggle){let e=this.focusToggle;this.focusToggle=``;let t=this.renderRoot.querySelector(`cae-layered-graph`);t&&t.updateComplete.then(()=>t.focusToggle(e))}if(this.fixLayer!==null){let e=this.fixLayer;this.fixLayer=null,this.replacing=!0,Q(this,`ca-navigate`,{layer:e,unit:this.unit,sel:this.sel,replace:!0})}if(this.refocus||this.cameFrom){let e=this.cameFrom;this.refocus=!1,this.cameFrom=``;let t=e.startsWith(`loop:`)?e:this.graph.nodes.find(t=>t.type===`flow`&&t.name===e)?.id??null,n=this.renderRoot.querySelector(`cae-layered-graph`);n&&n.updateComplete.then(()=>n.focusItem(e?t:null))}}render(){if(!this.plan.nodes.length)return k`<div class="blank" style="padding:24px">${this.live?E(`No tasks scheduled yet`):E(`No tasks scheduled`)}</div>`;let e=this.renderGraph();return this.tree.length?this.wide?k`<div class="whole">${wd(this.oh,this.tree)}<div class="g">${e}</div></div>`:k`<details class="odet"><summary>${E(`Outline of the flow`)}</summary>${wd(this.oh,this.tree)}</details>${e}`:e}renderGraph(){let e=Hu(this.graph,this.matrix,this.sel),t=this.graph.nodes.some(e=>e.type===`flow`);return k`<cae-layered-graph .graph=${this.input} .states=${this.states} .selected=${this.sel||null} .highlight=${this.unit||null} .order=${this.prevOrder} key=${this.segments.join(`/`)} direction=${this.down||this.tall?`down`:`across`} .matrix=${this.matrixIn} .related=${this.lights} .strings=${function(e,t){let n=E(`Enter: open`);return{graph:E(`Graph`,{id:`view-graph`}),table:E(`Table`,{id:`view-table`}),view:E(`View`),zoomIn:E(`Zoom in`),zoomInTip:E(`Zoom in (Ctrl + scroll)`),zoomOut:E(`Zoom out`),zoomOutTip:E(`Zoom out (Ctrl + scroll)`),showAll:E(`Show all`),graphKeys:[E(`Tab: next node`),E(`Arrow keys: marks`),E(`Shift + arrow keys: earlier and later tasks`),n],tableKeys:[E(`Tab: next row`),n],matrixKeys:[E(`Arrow keys: marks`),n],clearKey:E(`Esc: clear selection`),upKey:e?E(`Esc: up a level`):``,inspector:E(`Selected item`),stubTip:E(`Outside this layer`),more:e=>E(T`+${e}`),badge:E(`number of passes`),solidEdge:E(`waits for output`),dashedEdge:E(`created after result`),cycle:E(`next pass`),drill:E(`has a level below`),open:E(`Show inside`),close:E(`Hide inside`),iconNames:{agent:E(`agent task`),python:E(`Python task`)},nameHeader:E(t?`Kind or function`:`Kind`),statusHeader:E(`Status`,{id:`status`}),solidHeader:E(`Waits for`),dashedHeader:E(`Created after`),laterHeader:E(`Later tasks`),none:E(`none`,{id:`none`}),inCluster:e=>E(T`${e} in the loop`),list:e=>es(e)}}(!!gd(this.segments,this.auto),t)} .matrixStrings=${{sortBy:E(`Sort units`),rowsHeader:E(`Unit`)}} .renderIcon=${Pd} .iconStyles=${Ed} @cae-select=${this.onSelect} @cae-activate=${this.onActivate} @cae-drill=${this.onDrill} @cae-view-change=${this.onView} @cae-toggle=${this.onToggle} @cae-sort=${e=>this.sort=e.detail.id}>
|
|
431
|
-
<div slot="crumbs">${function(e,t=null){let n=e.segments,r=e.unit;if(!n.length&&!r&&!t)return j;let{path:i,loop:a}=
|
|
430
|
+
</li>`};return k`<nav class="outline" aria-label=${E(`Outline of the flow`)}><ul class="otree">${n.map(e=>r(e))}</ul></nav>`}var Ed=[V,yd,Jr,O` :host{display:flex;flex-direction:column;}cae-layered-graph{flex:auto;min-height:0;}.bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-bottom:8px;font-size:12px;}.crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:4px;list-style:none;margin:0;padding:0;}.crumbs li{display:inline-flex;align-items:center;gap:4px;}.crumbs .sep{color:var(--text-muted);}.crumbs button{all:unset;cursor:pointer;color:var(--accent);font-family:var(--mono);}.crumbs button:hover{text-decoration:underline;}.crumbs button:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:2px;border-radius:3px;}.crumbs [aria-current]{font-family:var(--mono);color:var(--text);font-weight:600;}.pin{display:inline-flex;align-items:center;gap:8px;color:var(--text-2);}.pin b{font-family:var(--mono);}.missing{margin-bottom:8px;font-size:12px;color:var(--status-attention);}.missing code{font-family:var(--mono);}.card{display:contents;}.ic{display:block;flex:none;}.loop-ic{color:var(--text-2);}.in-ic{color:var(--text-muted);}.card h4{margin:0;display:flex;align-items:center;gap:7px;font-family:var(--mono);font-size:13px;font-weight:600;color:var(--text);overflow-wrap:anywhere;}.card h4 .mark{--m:11px;flex:none;cursor:default;animation:none;}.card h4 .mark:hover{transform:none;outline:none;}.card h4 .k-ic{width:18px;height:18px;margin:0;border-radius:5px;font-size:10px;}.card .sub{color:var(--text-2);}.card dl{display:grid;grid-template-columns:fit-content(42%) minmax(0,1fr);gap:4px 12px;margin:0;}.card dt{color:var(--text-muted);word-break:keep-all;overflow-wrap:break-word;}.card dd{margin:0;color:var(--text);overflow-wrap:anywhere;font-variant-numeric:tabular-nums;}.card dd .err{color:var(--status-failed);}.card dd .warn{color:var(--status-attention);}.card .acts{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;padding-top:2px;}.card .go{all:unset;cursor:pointer;color:var(--accent);overflow-wrap:anywhere;}.card .go.primary{font-weight:600;}.card .go:hover{text-decoration:underline;}.card .go:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:2px;border-radius:3px;}.card .acts .switch{margin-left:auto;}.switch{all:unset;cursor:pointer;font-size:11.5px;color:var(--text-2);padding:2px 8px;border-radius:6px;border:1px solid var(--line);}.switch:hover{color:var(--text);border-color:var(--line2);}.switch:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;}.switch[aria-pressed='true']{color:var(--text);background:var(--accent-bg);border-color:var(--accent);}.opens{display:inline-flex;gap:6px;margin-left:auto;}.whole{display:grid;grid-template-columns:minmax(200px,282px) minmax(0,1fr);gap:14px;align-items:start;}.whole>.g{min-width:0;}.outline{font-size:12px;max-height:70vh;overflow:auto;padding:2px 6px 2px 0;border-right:1px solid var(--line);}.otree,.otree ul{list-style:none;margin:0;padding:0;}.otree ul{padding-left:10px;}.orow{display:grid;grid-template-columns:16px minmax(0,1fr);align-items:start;border-radius:6px;}.orow.sel{background:var(--accent-bg);}.orow.cur .ol{font-weight:600;color:var(--text);}.odisc{all:unset;cursor:pointer;width:16px;text-align:center;color:var(--text-muted);font-size:10px;line-height:22px;}.odisc:focus-visible,.oname:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;border-radius:4px;}.oname{all:unset;cursor:pointer;display:flex;align-items:flex-start;gap:6px;min-width:0;padding:3px 6px 3px 2px;border-radius:6px;color:var(--text-2);}.oname:hover{background:var(--raise);color:var(--text);}.oname .loop-ic{flex:none;color:var(--text-muted);}.ol{flex:1;min-width:0;overflow-wrap:break-word;font-family:var(--mono);line-height:1.35;}.obar{flex:none;width:32px;height:4px;margin-top:6px;border-radius:2px;background:var(--track);overflow:hidden;}.obar i{display:block;height:100%;background:var(--meter);}.ocount{flex:none;font-size:11px;color:var(--text-muted);font-variant-numeric:tabular-nums;}.onote{grid-column:2;display:flex;flex-wrap:wrap;gap:0 8px;padding:0 6px 2px 2px;font-size:11px;}.onote .err{color:var(--status-failed);}.onote .warn{color:var(--status-attention);}.onote .live{color:var(--status-running);}.onote .mut{color:var(--text-muted);}.odet{margin-bottom:8px;}.odet>summary{cursor:pointer;font-size:12px;color:var(--text-2);padding:2px 0;}.odet .outline{border-right:none;max-height:50vh;}`],Dd=[yd,O` .node .k-ic{width:16px;height:16px;margin-right:6px;border-radius:4px;font-size:9.5px;}.legend .k-ic{width:14px;height:14px;margin:0;border-radius:4px;font-size:8.5px;}.list .k-ic{width:16px;height:16px;border-radius:4px;font-size:9.5px;}.list .nm .k-ic{margin:0 -2px 0 0;}.matrix thead th.nh .k-ic{width:14px;height:14px;margin-right:5px;border-radius:4px;font-size:8.5px;vertical-align:-2px;}`],Od=e=>Math.max(14,Math.min(60,Math.round(e/34))),kd=e=>Math.max(8,Math.min(16,Math.round(e/105))),Ad=(e,t)=>t>0&&t/(180*e)<.6,jd=`*all`,Md=`*none`,Nd={...lo({nodes:[],clusters:[],edges:[],stubs:[]}),path:[],nodes:[],boxes:[],fns:[],edges:[],stubs:[],units:[]},Pd=class extends M{constructor(...e){super(...e),this.plan={nodes:[],groups:[]},this.journal=[],this.run=``,this.live=!1,this.layer=``,this.unit=``,this.sel=``,this.down=!1,this.tall=!1,this.sort=`order`,this.missing=``,this.fixLayer=null,this.replacing=!1,this.auto=[],this.segments=[],this.proj=null,this.model=null,this.graph=Nd,this.input={series:[],nodes:[],clusters:[],edges:[],stubs:[]},this.prevOrder=void 0,this.matrix=null,this.matrixIn=null,this.orders=new Map,this.links=zu([]),this.states=Ku(!1),this.locale=``,this.opened=null,this.closed=null,this.memRun=null,this.rev=0,this.budget=40,this.shownOpen=new Set,this.stats=new Map,this.focusToggle=``,this.flowStats=new Map,this.tree=[],this.folds=new Map,this.wide=!0,this.oh=this.outlineHost(),this.lights=()=>new Set,this.refocus=!1,this.cameFrom=``,this.h=this.partsHost(),this.onToggle=e=>this.toggle(e.detail.id,e.detail.open),this.onEscape=e=>{if(e.key!==`Escape`||e.defaultPrevented)return;let t=_d(this.segments,this.auto);t&&(e.preventDefault(),this.refocus=!0,this.cameFrom=this.segments[this.segments.length-1]??``,xd(this.h,t))},this.onSelect=e=>bd(this.h,e.detail.id??``),this.onActivate=e=>{let t=Uu(this.graph,this.matrix,e.detail.id);t?.type===`mark`?Cd(this.h,t.mark,t.node):t?.type===`node`&&Sd(this.h,t.node)},this.onDrill=e=>{let t=Uu(this.graph,this.matrix,e.detail.id);t&&wd(this.h,t)},this.onView=e=>{e.detail.view===`graph`&&this.matrix&&function(e){let t=e.segments[e.segments.length-1]??``,n=_d(e.segments,e.auto)??[],r=e.auto.join(`/`);Q(e.el,`ca-navigate`,{layer:n.join(`/`)===r?``:n.join(`/`),unit:e.unit,sel:t})}(this.h)}}static{this.styles=Ed}static{this.properties={plan:{attribute:!1},journal:{attribute:!1},run:{},live:{type:Boolean},layer:{},unit:{},sel:{},down:{state:!0},sort:{state:!0},missing:{state:!0},rev:{state:!0},budget:{state:!0},wide:{state:!0}}}willUpdate(e){if(e.has(`run`)&&this.orders.clear(),e.has(`layer`)&&e.get(`layer`)!==void 0){let e=this.renderRoot instanceof ShadowRoot?this.renderRoot.activeElement:null,t=e?.shadowRoot?.activeElement;this.refocus=e!==null&&!t?.closest(`.views`),this.replacing?this.replacing=!1:this.missing=``}e.has(`run`)&&e.get(`run`)!==void 0&&(this.missing=``),e.has(`plan`)&&(this.links=zu(this.plan.nodes)),(e.has(`plan`)||e.has(`live`))&&(this.flowStats=ju(tu(this.plan),[],this.live),this.tree=function(e){let t=new Map;for(let n of e.values())(t.get(n.parent)??t.set(n.parent,[]).get(n.parent))?.push(n);let n=e=>{let r=[],i=new Map;for(let a of t.get(e)??[]){let e={id:a.key,type:`fn`,label:ru(a.name),tip:a.name,layer:a.layer,name:a.name,counts:a.counts,errors:a.errors,kids:n(a.key),parts:[{id:a.key,layer:a.layer,name:a.name}]},t=r;a.loops.forEach((e,n)=>{let r=`${Xl}${a.loops.slice(0,n+1).join(`.`)}`,o=`${a.layer.join(`/`)}|${r}`,s=i.get(o);if(!s){let e=a.loops[n];s={id:o,type:`loop`,label:E(T`Loop at ${Qu(e,a.file)}`),tip:a.file?`${a.file}:${e}`:``,layer:a.layer,name:r,counts:{total:0,done:0,partial:0,failed:0,running:0,pending:0,skipped:0,blocked:0},errors:!1,kids:[],parts:[{id:o,layer:a.layer,name:r}]},i.set(o,s),t.push(s)}for(let e of Object.keys(s.counts))s.counts[e]+=a.counts[e];s.errors||=a.errors,t=s.kids}),t.push(e)}return r};return n(null)}(this.flowStats)),e.has(`run`)&&this.folds.clear();let t=e.has(`sel`)&&!!this.sel&&!hd(this.segments).loop&&!Uu(this.graph,this.matrix,this.sel),n=e.has(`plan`)||e.has(`layer`)||e.has(`run`)||e.has(`down`)||e.has(`rev`)||e.has(`budget`)||t;if(n){if(this.auto=md(this.plan),this.segments=this.layer?this.layer.split(`/`):this.auto,this.layer&&this.plan.nodes.length){let e=gd(this.plan,this.segments);e?e.join(`/`)!==this.layer&&(this.segments=e,this.fixLayer=e.join(`/`)===this.auto.join(`/`)?``:e.join(`/`)):(this.missing=this.layer,this.segments=this.auto,this.fixLayer=``)}let{path:e,loop:t}=hd(this.segments);if(t)this.proj=Cu(this.plan,e),this.model=this.proj.model;else{let t=this.memory(),n=this.openMode(),r=Lu(this.plan,e,{open:new Set(t.opened.values().filter(e=>!e.startsWith(`*`))),closed:new Set(t.closed.values()),all:n===`all`,budget:n===`none`?0:this.budget,maxSpan:kd(this.graphWidth()),sel:this.sel,live:this.live});this.proj=null,this.model=r.model,this.shownOpen=r.open,this.stats=r.stats}this.prevOrder=this.orders.get(e.join(`/`))}let r=I(),i=n||e.has(`journal`)||e.has(`live`)||r!==this.locale;(i||e.has(`sort`))&&this.build(i,r)}build(e,t){let n=this.model;if(!n)return;let r=this.proj,{path:i,loop:a}=hd(this.segments),o={plan:this.plan,journal:this.journal,run:this.run,live:this.live,links:this.links};if(e){this.locale=t,this.states=Ku(this.live),this.input=ld(n,o,!a);let e=lo(this.input,this.prevOrder,this.down);this.tall=!this.down&&!a&&Ad(uo(e).span,this.graphWidth()),this.tall&&(e=lo(this.input,this.prevOrder,!0)),this.graph=Du(n,e),this.orders.set(i.join(`/`),e.order),this.lights=function(e,t,n){let r=n.nodes.flatMap(e=>[...e.units,...e.single].filter(e=>e!==null).map(t=>[Hu(e.id,t),t])),i=new Map(r.map(([e,t])=>[e,t.key])),a=new Map;return n=>{let o=a.get(n);if(o)return o;let s=function(e,t,n){let r=e.filter(e=>e.unit?e.unit===n:e.key===n).map(e=>e.key),i=new Set(r),a=e=>{let t=new Set(r),n=[...r];for(let r=n.pop();r!==void 0;r=n.pop())for(let a of e(r))t.has(a)||(t.add(a),i.add(a),n.push(a))};return a(e=>t.waiters.get(e)??[]),a(e=>t.byKey.get(e)?.after??[]),i}(e.nodes,t,i.get(n)??n),c=new Set(r.filter(([,e])=>e.keys.some(e=>s.has(e))).map(([e])=>e));return a.set(n,c),c}}(this.plan,this.links,this.graph)}let s=a&&r?fd(this.plan,i,a,this.graph.order,this.sort,o,r):null;this.matrix=s?.matrix??null,this.matrixIn=s?.input??null}connectedCallback(){super.connectedCallback(),this.addEventListener(`keydown`,this.onEscape),this.resize=new ResizeObserver(()=>{let e=this.clientWidth,t=e>0&&e<640;t!==this.down&&(this.down=t);let n=e>0?Od(this.graphWidth()):this.budget;n!==this.budget&&(this.budget=n);let r=e===0||e>=1500;r!==this.wide&&(this.wide=r)}),this.resize.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`keydown`,this.onEscape),this.resize?.disconnect()}memory(){return this.opened&&this.closed&&this.memRun===this.run||(this.memRun=this.run,this.opened=new Xn(`graph-open:${this.run}`,this),this.closed=new Xn(`graph-closed:${this.run}`,this)),{opened:this.opened,closed:this.closed}}openMode(){let{opened:e}=this.memory();return e.has(jd)?`all`:e.has(Md)?`none`:`auto`}setMode(e){let{opened:t,closed:n}=this.memory();t.clear(),n.clear(),e===`all`&&t.set(jd,!0),e===`none`&&t.set(Md,!0),Wn(),this.rev++}placeOfNode(e){let t=this.graph.nodes.find(t=>t.id===e);if(!t||t.type!==`flow`)return null;let n=e.includes(`::`)?e.slice(e.lastIndexOf(`::`)+2):e;return ku(t.layer,n)}toggle(e,t){let n=e.startsWith(`fx::`)?e.slice(4):this.placeOfNode(e);if(!n)return;let{opened:r,closed:i}=this.memory();r.set(n,t),i.set(n,!t),Wn(),this.focusToggle=t?`${Ou}${n}`:this.nodeIdOf(n),this.rev++}nodeIdOf(e){let t=this.stats.get(e);if(!t)return``;let n=t.parent;return n!==null&&this.shownOpen.has(n)?`${n}::${t.id}`:t.id}updated(){if(this.focusToggle){let e=this.focusToggle;this.focusToggle=``;let t=this.renderRoot.querySelector(`cae-layered-graph`);t&&t.updateComplete.then(()=>t.focusToggle(e))}if(this.fixLayer!==null){let e=this.fixLayer;this.fixLayer=null,this.replacing=!0,Q(this,`ca-navigate`,{layer:e,unit:this.unit,sel:this.sel,replace:!0})}if(this.refocus||this.cameFrom){let e=this.cameFrom;this.refocus=!1,this.cameFrom=``;let t=e.startsWith(`loop:`)?e:this.graph.nodes.find(t=>t.type===`flow`&&t.name===e)?.id??null,n=this.renderRoot.querySelector(`cae-layered-graph`);n&&n.updateComplete.then(()=>n.focusItem(e?t:null))}}render(){if(!this.plan.nodes.length)return k`<div class="blank" style="padding:24px">${this.live?E(`No tasks scheduled yet`):E(`No tasks scheduled`)}</div>`;let e=this.renderGraph();return this.tree.length?this.wide?k`<div class="whole">${Td(this.oh,this.tree)}<div class="g">${e}</div></div>`:k`<details class="odet"><summary>${E(`Outline of the flow`)}</summary>${Td(this.oh,this.tree)}</details>${e}`:e}renderGraph(){let e=Uu(this.graph,this.matrix,this.sel),t=this.graph.nodes.some(e=>e.type===`flow`);return k`<cae-layered-graph .graph=${this.input} .states=${this.states} .selected=${this.sel||null} .highlight=${this.unit||null} .order=${this.prevOrder} key=${this.segments.join(`/`)} direction=${this.down||this.tall?`down`:`across`} .matrix=${this.matrixIn} .related=${this.lights} .strings=${function(e,t){let n=E(`Enter: open`);return{graph:E(`Graph`,{id:`view-graph`}),table:E(`Table`,{id:`view-table`}),view:E(`View`),zoomIn:E(`Zoom in`),zoomInTip:E(`Zoom in (Ctrl + scroll)`),zoomOut:E(`Zoom out`),zoomOutTip:E(`Zoom out (Ctrl + scroll)`),showAll:E(`Show all`),graphKeys:[E(`Tab: next node`),E(`Arrow keys: marks`),E(`Shift + arrow keys: earlier and later tasks`),n],tableKeys:[E(`Tab: next row`),n],matrixKeys:[E(`Arrow keys: marks`),n],clearKey:E(`Esc: clear selection`),upKey:e?E(`Esc: up a level`):``,inspector:E(`Selected item`),stubTip:E(`Outside this layer`),more:e=>E(T`+${e}`),badge:E(`number of passes`),solidEdge:E(`waits for output`),dashedEdge:E(`created after result`),cycle:E(`next pass`),drill:E(`has a level below`),open:E(`Show inside`),close:E(`Hide inside`),iconNames:{agent:E(`agent task`),python:E(`Python task`)},nameHeader:E(t?`Kind or function`:`Kind`),statusHeader:E(`Status`,{id:`status`}),solidHeader:E(`Waits for`),dashedHeader:E(`Created after`),laterHeader:E(`Later tasks`),none:E(`none`,{id:`none`}),inCluster:e=>E(T`${e} in the loop`),list:e=>es(e)}}(!!_d(this.segments,this.auto),t)} .matrixStrings=${{sortBy:E(`Sort units`),rowsHeader:E(`Unit`)}} .renderIcon=${Fd} .iconStyles=${Dd} @cae-select=${this.onSelect} @cae-activate=${this.onActivate} @cae-drill=${this.onDrill} @cae-view-change=${this.onView} @cae-toggle=${this.onToggle} @cae-sort=${e=>this.sort=e.detail.id}>
|
|
431
|
+
<div slot="crumbs">${function(e,t=null){let n=e.segments,r=e.unit;if(!n.length&&!r&&!t)return j;let{path:i,loop:a}=hd(n),o=[...i.map((e,t)=>({name:ru(e),tip:e,to:i.slice(0,t+1)})),...(a?a.slice(5).split(`.`):[]).map((t,n,r)=>{let a=Xl+r.slice(0,n+1).join(`.`),o=e.graph.boxes.find(e=>e.id===a)?.file||e.matrix?.box.file||``,s=/^\d+$/.test(t);return{name:E(s?T`Loop at ${Qu(t,o)}`:`Loop`),tip:s&&o?`${o}:${t}`:``,to:[...i,a]}})];return k`<div class="bar">
|
|
432
432
|
${n.length?k`<nav aria-label=${E(`Pipeline layer`)}>
|
|
433
433
|
<ol class="crumbs">
|
|
434
|
-
<li><button type="button" @click=${()=>
|
|
434
|
+
<li><button type="button" @click=${()=>xd(e,[])}>${E(`Pipeline`)}</button></li>
|
|
435
435
|
${o.map((t,n)=>k`<li><span class="sep" aria-hidden="true">›</span>
|
|
436
|
-
${n===o.length-1?k`<span aria-current="page" title=${t.tip||j}>${t.name}</span>`:k`<button type="button" title=${t.tip||j} @click=${()=>
|
|
436
|
+
${n===o.length-1?k`<span aria-current="page" title=${t.tip||j}>${t.name}</span>`:k`<button type="button" title=${t.tip||j} @click=${()=>xd(e,t.to)}>${t.name}</button>`}</li>`)}
|
|
437
437
|
</ol>
|
|
438
438
|
</nav>`:j}
|
|
439
439
|
${r?k`<span class="pin">${E(T`Unit: ${r}`)}
|
|
440
440
|
<button type="button" class="switch" @click=${()=>Q(e.el,`ca-navigate`,{unit:``})}>${E(`Clear highlight`)}</button></span>`:j}
|
|
441
441
|
${t??j}
|
|
442
|
-
</div>`}(this.h,
|
|
443
|
-
${e?function(e,t){return k`<div slot="inspector" class="card">${function(e,t){let n=(e,t)=>k`<dt>${e}</dt><dd>${t}</dd>`,r=(e,t,n=!1)=>k`<button type="button" class="go ${n?`primary`:``}" @click=${t}>${e}</button>`,i=k`<button type="button" class="switch" @click=${()=>
|
|
442
|
+
</div>`}(this.h,hd(this.segments).loop?null:function(e,t){let n=(n,r)=>k`<button type="button" class="switch" aria-pressed=${e===n} @click=${()=>t(e===n?`auto`:n)}>${r}</button>`;return k`<span class="opens">${n(`all`,E(`Show all inside`))}${n(`none`,E(`Hide all inside`))}</span>`}(this.openMode(),e=>this.setMode(e)))}${function(e){if(!e)return j;let t=e.split(`/`),n=t[t.length-1]||e;return k`<div class="missing" role="status" title=${e}>${E(k`No layer <code>${n}</code> in this run`)}</div>`}(this.missing)}</div>
|
|
443
|
+
${e?function(e,t){return k`<div slot="inspector" class="card">${function(e,t){let n=(e,t)=>k`<dt>${e}</dt><dd>${t}</dd>`,r=(e,t,n=!1)=>k`<button type="button" class="go ${n?`primary`:``}" @click=${t}>${e}</button>`,i=k`<button type="button" class="switch" @click=${()=>bd(e,``)}>${E(`Clear selection`)}</button>`,a=e=>e.length?es(e):E(`none`,{id:`none`});if(t.type===`box`){let a=t.box,o=Qu(a.loop,a.file);return k`<h4 title=${a.file?`${a.file}:${a.loop}`:j}>${bo(16)}${E(T`Loop at ${o}`)}</h4>
|
|
444
444
|
<dl>
|
|
445
445
|
${n(E(`Passes`),bs(a.passes))}
|
|
446
446
|
${a.spread.length>1?n(E(`Units by number of passes`),Ss(a.spread)):j}
|
|
447
447
|
</dl>
|
|
448
|
-
<div class="acts">${r(E(T`Passes of the loop at ${o}`),()=>
|
|
448
|
+
<div class="acts">${r(E(T`Passes of the loop at ${o}`),()=>wd(e,t),!0)}${i}</div>`}if(t.type===`node`){let o=t.node,s=o.counts,{waits:c,after:l,feeds:u}=td(o,e.graph),d=Zu(o,e.live).map(([e,t])=>k`<div class=${e}>${t}</div>`);return o.type===`flow`?k`<h4 title=${o.name}>${xo()}${o.label}</h4>
|
|
449
449
|
<div class="sub">${E(`Function`)}</div>
|
|
450
450
|
<dl>
|
|
451
451
|
${n(E(`Flow calls`),o.calls)}
|
|
452
|
-
${o.timeBox?n(E(`Deadline`),k`<span title=${
|
|
453
|
-
${n(E(`Tasks`,{id:`tasks`}),k`${
|
|
452
|
+
${o.timeBox?n(E(`Deadline`),k`<span title=${mc()}>${function(e){let t=e.finishing_kinds??[];return K(B(e.deadline_s),e.grace_s&&t.length?E(T`finishing time ${B(e.grace_s)}`):``,t.length?E(T`finishing kinds: ${es(t)}`):``)}(o.timeBox)}</span>`):j}
|
|
453
|
+
${n(E(`Tasks`,{id:`tasks`}),k`${Yu(s)}${d}`)}
|
|
454
454
|
${n(E(`Waits for`),a(c))}
|
|
455
455
|
${l.length?n(E(`Created after`),a(l)):j}
|
|
456
456
|
${n(E(`Later tasks`),a(u))}
|
|
457
457
|
</dl>
|
|
458
|
-
<div class="acts">${r(E(T`Inside ${o.label}`),()=>
|
|
459
|
-
<div class="sub">${
|
|
458
|
+
<div class="acts">${r(E(T`Inside ${o.label}`),()=>wd(e,t),!0)}${i}</div>`:k`<h4>${o.executor&&o.executor!==`mixed`?vd(o.executor===`python`):j}${o.label}</h4>
|
|
459
|
+
<div class="sub">${$u(o)}</div>
|
|
460
460
|
<dl>
|
|
461
461
|
${o.kinds.length>1?n(E(`Kinds`),es(o.kinds)):j}
|
|
462
|
-
${n(E(`Tasks`,{id:`tasks`}),k`${
|
|
462
|
+
${n(E(`Tasks`,{id:`tasks`}),k`${Yu(s)}${d}`)}
|
|
463
463
|
${n(E(`Waits for`),a(c))}
|
|
464
464
|
${l.length?n(E(`Created after`),a(l)):j}
|
|
465
465
|
${n(E(`Later tasks`),a(u))}
|
|
466
466
|
</dl>
|
|
467
|
-
<div class="acts">${r(E(T`Tasks of ${o.label}`),()=>
|
|
467
|
+
<div class="acts">${r(E(T`Tasks of ${o.label}`),()=>wd(e,t),!0)}${i}</div>`}let{node:o,mark:s,passes:c}=t,l=q({kind:(s.flow||s.count!==1?void 0:e.links.byKey.get(s.key))?.kind??o.label,unit:s.unit}),u=s.flow||s.state!==`blocked`?``:ad(e)(s.key),d=k`<span data-status class=${s.state===`failed`?`err`:s.state===`blocked`||s.state===`partial`?`warn`:``}>${qu(s.state,e.live)}</span>`,p=Ku(e.live)[s.state],m=k`<h4 title=${s.flow?E(T`Flow call ${s.key}`):s.key}><i class="mark" data-tone=${L(p?.tone)} data-shape=${p?.shape??j} aria-hidden="true"></i>${l}</h4>`,h=c.length?es(c.map(ys)):s.passes?xs(s.passes):``;if(s.flow){let a=s.counts;return k`${m}
|
|
468
468
|
<dl>
|
|
469
469
|
${n(E(`Status`,{id:`status`}),d)}
|
|
470
470
|
${h?n(E(`Pass`),h):j}
|
|
471
|
-
${s.deadlineAt?n(E(`Deadline`),k`<span title=${
|
|
472
|
-
${a?n(E(`Tasks`,{id:`tasks`}),k`${
|
|
471
|
+
${s.deadlineAt?n(E(`Deadline`),k`<span title=${mc()}>${g=s.deadlineAt,G(g,!0)}</span>`):j}
|
|
472
|
+
${a?n(E(`Tasks`,{id:`tasks`}),k`${Yu(a)}${Xu(a,e.live).map(e=>k`<div>${e}</div>`)}`):j}
|
|
473
473
|
${s.error===void 0?j:n(E(`Error`),k`<span class="err">${s.error||E(`Flow call stopped with an error`)}</span>`)}
|
|
474
474
|
</dl>
|
|
475
|
-
<div class="acts">${r(E(T`Inside ${
|
|
475
|
+
<div class="acts">${r(E(T`Inside ${ru(s.flow)}`),()=>wd(e,t),!0)}${i}</div>`}var g;let _=e.journal.filter(e=>s.keys.includes(e.key)).filter(f),v=_.map(e=>e.cost_usd).filter(e=>typeof e==`number`),y=_.reduce((e,t)=>e+(t.wall_s??0),0);return k`${m}
|
|
476
476
|
<dl>
|
|
477
477
|
${n(E(`Status`,{id:`status`}),u?k`${d}<div>${u}</div>`:d)}
|
|
478
478
|
${h?n(E(`Pass`),h):j}
|
|
@@ -481,12 +481,12 @@ ${n(E(`Attempts`),_.length||E(`none`,{id:`none`}))}
|
|
|
481
481
|
${n(E(`Time`),_.length?B(y):E(`none`,{id:`none`}))}
|
|
482
482
|
${n(E(`Cost`),v.length?Y(v.reduce((e,t)=>e+t,0)):`—`)}
|
|
483
483
|
</dl>
|
|
484
|
-
<div class="acts">${r(E(`Task detail`),()=>
|
|
485
|
-
</cae-layered-graph>`}graphWidth(){let e=this.clientWidth||1200;return this.tree.length&&e>=1500?e-300:e}currentKeys(){let{path:e}=
|
|
486
|
-
<div class="drv-ic" data-tone=${L(i)} aria-hidden="true">${
|
|
484
|
+
<div class="acts">${r(E(`Task detail`),()=>wd(e,t),!0)}${o.kinds.length===1?r(E(T`Tasks of ${o.label}`),()=>Sd(e,o)):j}${i}</div>`}(e,t)}</div>`}(this.h,e):j}
|
|
485
|
+
</cae-layered-graph>`}graphWidth(){let e=this.clientWidth||1200;return this.tree.length&&e>=1500?e-300:e}currentKeys(){let{path:e}=hd(this.segments),t=new Set;for(let n of this.flowStats.values()){let r=n.layer.length;r<e.length&&nu(e,n.layer)&&e[r]===n.name&&t.add(n.key)}return t}selectedItem(){let e=this.sel;if(!e)return``;if(e.startsWith(`fx::`))return e.slice(4);let t=e.split(`#`)[0]??``;if(this.graph.nodes.find(e=>e.id===t)?.type===`flow`)return this.placeOfNode(t)??``;let n=this.graph.boxes.find(e=>e.id===t);return n?`${n.layer.join(`/`)}|${n.local}`:``}drawnId(e){let{path:t}=hd(this.segments);if(e.layer.length<t.length||!nu(e.layer,t))return null;let n=[];for(let r=this.flowStats.get(e.type===`fn`?this.flowStats.get(e.id)?.parent??``:this.containerKey(e)??``);r&&r.layer.length>=t.length;r=this.flowStats.get(r.parent??``))n.unshift(r.key);let r=n[n.length-1]??``;if(e.type===`fn`){let t=this.flowStats.get(e.id);return t?this.shownOpen.has(e.id)?{id:`${Ou}${e.id}`,open:n}:{id:r?`${r}::${t.id}`:t.id,open:n}:null}return{id:r?`${r}::${e.name}`:e.name,open:n}}containerKey(e){let{path:t}=hd(this.segments);if(e.layer.length===t.length)return``;for(let t of this.flowStats.values())if([...t.layer,t.name].join(`/`)===e.layer.join(`/`))return t.key;return null}outlineHost(){let e=this;return{get live(){return e.live},expanded(t){let n=e.folds.get(t);if(n!==void 0)return n;let r=new Set([...e.currentKeys(),...e.shownOpen,e.selectedItem()]),i=e=>r.has(e.id)||e.kids.some(i),a=Id(e.tree,t);return!!a&&(e.tree.includes(a)||i(a))},expand(t,n){e.folds.set(t,n),e.requestUpdate()},current:t=>e.currentKeys().has(t),here:t=>{let{path:n}=hd(e.segments),r=e.flowStats.get(t);return!!r&&r.layer.length===n.length-1&&nu(n,[...r.layer,r.name])},selected:t=>!!t&&e.selectedItem()===t,pick(t){let n=e.drawnId(t);if(!n){let n=t.type===`fn`?e.flowStats.get(t.id)?.id??``:t.name;Q(e,`ca-navigate`,{layer:t.layer.join(`/`)===e.auto.join(`/`)?``:t.layer.join(`/`),unit:e.unit,sel:n});return}let{opened:r,closed:i}=e.memory(),a=!1;for(let t of n.open)e.shownOpen.has(t)||(a=!0),r.set(t,!0),i.set(t,!1);a&&e.rev++,bd(e.h,n.id)},enter(t){let n=t.parts[t.parts.length-1]??t;xd(e.h,[...n.layer,n.name])}}}partsHost(){let e=this;return{el:e,get plan(){return e.plan},get journal(){return e.journal},get run(){return e.run},get live(){return e.live},get sel(){return e.sel},get unit(){return e.unit},get segments(){return e.segments},get auto(){return e.auto},get graph(){return e.graph},get matrix(){return e.matrix},get links(){return e.links}}}};Pd=U([N(`ca-pipeline-graph`),D()],Pd);var Fd=e=>vd(e===`python`);function Id(e,t){for(let n of e){if(n.id===t)return n;let e=Id(n.kids,t);if(e)return e}}function Ld(e){if(!e||e.policy===`off`)return[];let t=[...(e.stopped??[]).map(e=>({label:Jc(),text:e,tone:`failed`,tip:``})),...(e.kept??[]).map(e=>({label:Jc(),text:K(e.kind,Gc(e.agent,e.model),e.reason),tone:`attention`,tip:E(`A kind with no available model, run on its own model (kept)`)})),...(e.substituted??[]).map(e=>({label:E(`Model replaced`),text:qc(e),tone:`attention`,tip:E(`A kind with no available model, run on the first model that answered (substitute)`)})),...(e.dropped??[]).map(e=>({label:E(`Unavailable`),text:Kc(e),tone:`muted`,tip:``}))];return t.length?t:[{label:``,text:E(`all models available`),tone:`neutral`,tip:``}]}var Rd={failed:`✕`,attention:`◌`,done:`✓`,running:``,muted:`■`,neutral:`■`},zd=class extends M{constructor(...e){super(...e),this.procs=null,this.plan={nodes:[],groups:[]}}static{this.styles=[V,qr,O` :host{display:block;}.drv{display:flex;gap:14px;align-items:flex-start;}.drv-ic{width:42px;height:42px;border-radius:12px;flex:none;display:grid;place-items:center;font-size:16px;background:var(--raise);color:var(--text-muted);}.drv.on .drv-ic{background:var(--status-running-bg);box-shadow:0 0 0 1px color-mix(in srgb,var(--status-running) 35%,transparent),0 0 22px var(--status-running-bg);}.drv-ic[data-tone]{color:var(--tone);font-weight:700;}.drv-ic[data-tone='failed'],.drv-ic[data-tone='attention']{background:var(--tone-bg);}.drv.on .drv-ic .spin{width:18px;height:18px;}.drv-t{font-size:15px;font-weight:600;}.drv-up{font-family:var(--mono);font-size:12px;color:var(--status-running);margin-left:6px;font-weight:400;}.drv-cmd{margin-top:8px;}.drv-cmd summary{cursor:pointer;font-size:11px;color:var(--text-muted);}.pf{margin-top:10px;font-size:12px;}.pf-h{color:var(--text-muted);font-size:11px;margin-bottom:4px;}.pf-rows{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:3px 12px;margin:0;}.pf-rows dt{color:var(--text-muted);}.pf-rows dt[data-tone]{color:var(--tone);}.pf-rows dd{margin:0;color:var(--text-2);overflow-wrap:anywhere;}.drv-cmd code{display:block;margin-top:4px;white-space:pre-wrap;word-break:break-all;color:var(--text-2);max-height:120px;overflow:auto;}`]}stateTitle(){if(this.plan.preflight?.stopped?.length)return[E(`Ended before the first agent session`),`failed`];if(!this.plan.nodes.length)return[E(`Not running`),`neutral`];let e=te(this.plan);return e.failed?[e.failed===1?E(`Finished with 1 task failed`):E(T`Finished with ${e.failed} tasks failed`),`failed`]:e.left?[e.left===1?E(`Finished with 1 task not done`):E(T`Finished with ${e.left} tasks not done`),`attention`]:e.notStarted?[e.notStarted===1?E(`Finished with 1 task not started`):E(T`Finished with ${e.notStarted} tasks not started`),`attention`]:[E(`Finished`),`done`]}render(){let e=this.procs,t=this.summary;if(!e?.alive){let e=re(t)===`unresponsive`,[r,i]=e?[Zo(ac()),`attention`]:this.stateTitle(),a=e?null:ne(t);return k`<div class="drv off">
|
|
486
|
+
<div class="drv-ic" data-tone=${L(i)} aria-hidden="true">${Rd[i]}</div>
|
|
487
487
|
<div>
|
|
488
488
|
<div class="drv-t tone-text" data-tone=${i===`done`?j:L(i)}>${r}</div>
|
|
489
|
-
<div class="meta">${K(this.plan.preflight?.stopped?.length?(n=this.plan.preflight.stopped,E(T`No available model for ${es(n)}`)):``,e?
|
|
489
|
+
<div class="meta">${K(this.plan.preflight?.stopped?.length?(n=this.plan.preflight.stopped,E(T`No available model for ${es(n)}`)):``,e?sc(this.host):``,E(t?.last_ts?e?T`Last activity ${G(t.last_ts,!0)}`:T`Ended ${G(t.last_ts,!0)}`:`No activity`),a==null?``:E(T`Took ${B(a)}`),t?.run_group?E(T`Run group ${t.run_group}`):``,e?cc(t?.host_id??``):``)}</div>
|
|
490
490
|
${this.preflight()}
|
|
491
491
|
</div>
|
|
492
492
|
</div>`}var n;let r=Date.parse(e.started_at),i=Ir.at(`drv:${e.pid??``}`,Number.isNaN(r)?1:(Date.now()-r)/1e3),a=[[E(`PID`),e.pid??`—`],[E(`Run group`),e.run_group],[E(`Running at once (limit)`),e.max_workers||`—`],[E(`Started`),G(e.started_at,!0)]];return k`<div class="drv on">
|
|
@@ -497,20 +497,20 @@ ${this.preflight()}
|
|
|
497
497
|
${this.preflight()}
|
|
498
498
|
<details class="drv-cmd"><summary>${E(`Command line`)}</summary><code>${e.argv.join(` `)}</code></details>
|
|
499
499
|
</div>
|
|
500
|
-
</div>`}preflight(){let e=this.plan.preflight,t=
|
|
500
|
+
</div>`}preflight(){let e=this.plan.preflight,t=Ld(e);return e&&t.length?k`<div class="pf">
|
|
501
501
|
<div class="pf-h" title=${n=e.policy,E(T`One request to each model before the first agent session (preflight, policy ${n})`)}>${E(`Model availability`)}</div>
|
|
502
502
|
<dl class="pf-rows">
|
|
503
503
|
${t.map(e=>k`<dt data-tone=${L(e.tone)} title=${e.tip||j}>${e.label}</dt><dd class="jmono">${e.text}</dd>`)}
|
|
504
504
|
</dl>
|
|
505
|
-
</div>`:j;var n}};U([P({attribute:!1})],
|
|
506
|
-
`)}let i=
|
|
507
|
-
`)}function
|
|
508
|
-
${H(e,e=>e.id,e=>{let t=k`<span class="wk-top">${
|
|
505
|
+
</div>`:j;var n}};U([P({attribute:!1})],zd.prototype,`procs`,void 0),U([P({attribute:!1})],zd.prototype,`summary`,void 0),U([P({attribute:!1})],zd.prototype,`plan`,void 0),U([P({attribute:!1})],zd.prototype,`host`,void 0),zd=U([N(`ca-run-driver`),D()],zd),z(`cae-lanes`,ba);var Bd=216e5,Vd=e=>new Date(e).toLocaleTimeString(I(),{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`});function Hd(){return{py:{label:E(`Python task`),color:`var(--meter)`},llm:{label:E(`Agent task`),color:`var(--agent)`},run:{label:E(`running`),color:`var(--status-running)`,pattern:`striped`,group:1},bad:{label:E(`failed`),color:`var(--status-failed)`,pattern:`hatched`,group:1},idle:{label:E(`not started`),color:`var(--line2)`,pattern:`outline`,group:1}}}function Ud(e,t,n,r){if(!f(e)){let t=n.get(e.key),i=e.stop===`invalid_input`&&t?ms(t,n,r):``;return[q(e),i?E(T`Not started: ${i}`):Z(e.stop,e.reason),e.key].join(`
|
|
506
|
+
`)}let i=qs(e.hops,null,e.skipped_hops),a=e.reason&&!e.ok?w(e.reason,r):``;return[q(e),K(Z(e.stop),B(e.wall_s),E(T`ended ${Vd(t)}`)),i?E(T`Model switch: ${i}`):e.model?E(T`Model ${e.model}`):``,a,e.key].filter(Boolean).join(`
|
|
507
|
+
`)}function Wd(e,t,n,r){let i=[];if(e.forEach((e,t)=>{if(!e.ts)return;let a=Date.parse(e.ts);if(Number.isNaN(a))return;let o=f(e)?e.ok?C(e)?`py`:`llm`:`bad`:`idle`;i.push({lane:e.kind||`?`,bar:{id:`j${t}`,style:o,start:a-1e3*(e.wall_s||0),end:a,label:Ud(e,a,n,r)}})}),!i.length&&!t.length)return null;let a=Math.max(...i.map(e=>e.bar.end),...t.map(e=>e.t0)),o=i.filter(e=>e.bar.end>=a-Bd),s=i.length-o.length;t.forEach((e,t)=>o.push({lane:e.kind,bar:{id:`live${t}`,style:`run`,start:e.t0,end:null,label:`${e.kind}\n${E(`running`)}`}}));let c=new Map;for(let{lane:e,bar:t}of[...o].sort((e,t)=>e.bar.start-t.bar.start))(c.get(e)??c.set(e,[]).get(e)).push(t);return{lanes:[...c].map(([e,t])=>({id:e,label:e,bars:t})),omitted:s}}var Gd=class extends M{constructor(...e){super(...e),this.journal=[],this.plan=null,this.procs=null,this.live=!1,this.run=``}static{this.styles=[V,O`:host{display:block;}`]}render(){let e=Date.now(),t=this.live?pe(this.procs).map(t=>({kind:t.kind,cls:t.cls,t0:Ir.at(t.id,t.ageS,e)})):[],n=Wd(this.journal,t,S(this.journal,this.plan).outcomes,this.run);return n?wo(this.run,k`<cae-lanes .lanes=${n.lanes} .barStyles=${Hd()} .omitted=${n.omitted} ?live=${this.live} locale=${I()} .strings=${{omitted:e=>E(e===1?`1 older attempt not shown`:T`${e} older attempts not shown`)}}></cae-lanes>`):k`<div class="blank" style="padding:28px"><span class="ic" aria-hidden="true">⏱</span>${this.live?E(`No finished attempts yet`):E(`No finished attempts`)}</div>`}};U([P({attribute:!1})],Gd.prototype,`journal`,void 0),U([P({attribute:!1})],Gd.prototype,`plan`,void 0),U([P({attribute:!1})],Gd.prototype,`procs`,void 0),U([P({type:Boolean})],Gd.prototype,`live`,void 0),U([P()],Gd.prototype,`run`,void 0),Gd=U([N(`ca-timeline`),D()],Gd);var Kd=class extends M{constructor(...e){super(...e),this.procs=null,this.live=!1}static{this.styles=[V,O` :host{display:block;container-type:inline-size;}.wks{display:grid;grid-template-columns:repeat(var(--n,3),minmax(0,1fr));gap:10px;}@container (max-width:860px){.wks{grid-template-columns:repeat(2,minmax(0,1fr));}}@container (max-width:360px){.wks{grid-template-columns:minmax(0,1fr);}}.wk{border-radius:11px;padding:10px 12px;border:1px solid var(--line);background:color-mix(in srgb,var(--text) 2.5%,transparent);min-width:0;position:relative;overflow:hidden;display:block;width:100%;color:inherit;text-align:start;}.wk>.meta{display:block;}.wk.py,.wk.llm{border-color:var(--line2);}.wk.llm{box-shadow:inset 3px 0 0 -1px color-mix(in srgb,var(--agent) 60%,transparent);cursor:pointer;}.wk.llm:hover{border-color:var(--accent);}.wk.idle{opacity:0.45;border-style:dashed;}.wk-top{display:flex;align-items:center;gap:8px;min-width:0;}.wk-top b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.wk-ic{width:24px;height:24px;border-radius:7px;flex:none;display:grid;place-items:center;background:var(--raise);font-size:12px;}.wk.llm .wk-ic{color:var(--agent);}.wk.py .wk-ic{color:var(--text-muted);}.wk-el{margin-left:auto;font-family:var(--mono);font-size:11.5px;color:var(--status-running);}.wk-bar{position:absolute;left:0;right:0;bottom:0;height:2px;overflow:hidden;}.wk-bar i{position:absolute;top:0;bottom:0;width:30%;background:linear-gradient(90deg,transparent,var(--status-running),transparent);animation:scan 1.8s linear infinite;}`]}render(){let e=this.live?pe(this.procs):[],t=Math.max(this.procs?.max_workers||1,e.length),n=Array.from({length:t-e.length},(e,t)=>t);return k`<div class="wks" style="--n:${Math.min(t,6)}">
|
|
508
|
+
${H(e,e=>e.id,e=>{let t=k`<span class="wk-top">${vd(e.cls!==`llm`,e.cls===`llm`?E(`Agent task`):E(`Python task`),`wk-ic`)}<b>${e.kind}</b>
|
|
509
509
|
<cae-elapsed class="wk-el" .since=${Ir.at(e.id,e.ageS)}></cae-elapsed></span>
|
|
510
510
|
<span class="meta">${e.detail}</span>
|
|
511
511
|
<span class="wk-bar"><i></i></span>`;return e.key?k`<button type="button" class="wk ${e.cls}" @click=${()=>Q(this,`ca-open-task`,{key:e.key})}>${t}</button>`:k`<div class="wk ${e.cls}">${t}</div>`})}
|
|
512
512
|
${n.map(()=>k`<div class="wk idle"><div class="wk-top"><b>${E(`Idle`)}</b></div></div>`)}
|
|
513
|
-
</div>`}};U([P({attribute:!1})],
|
|
513
|
+
</div>`}};U([P({attribute:!1})],Kd.prototype,`procs`,void 0),U([P({type:Boolean})],Kd.prototype,`live`,void 0),Kd=U([N(`ca-workers`),D()],Kd);var qd=[`invalid`,`refused`,`failed`,`running`,`pending`,`valid`];function Jd(e){if(e.title)return e.title;if(e.type===`tiles`){let t=e.tiles[0];return t?`${t.label}: ${String(t.value)}`:``}if(e.type===`blocks`)for(let t of e.blocks){let e=he(t),n=e?Jd(e):``;if(n)return n}return``}function Yd(e){if(e===void 0)return E(`Loading…`);let t=he(e);if(t)return Jd(t);if(typeof e!=`object`||!e)return JSON.stringify(e);let n=Object.keys(e);if(!n.length)return E(`none`,{id:`none`});let r=`${n.slice(0,4).join(`, `)}${n.length>4?`, …`:``}`;return E(Array.isArray(e)?T`${n.length} items: ${r}`:T`${n.length} keys: ${r}`)}var Xd=class extends M{constructor(...e){super(...e),this.run=``,this.layer=``,this.unit=``,this.sel=``}static{this.styles=[V,O` :host{display:block;container-type:inline-size;}.ov{display:flex;flex-direction:column;gap:14px;}.band.status{display:grid;gap:14px;align-items:stretch;}.stack{display:flex;flex-direction:column;gap:14px;min-width:0;}.stack>.panel:first-child{flex:1;}.band.parts{display:grid;gap:14px;align-items:stretch;grid-template-columns:repeat(auto-fit,minmax(min(100%,max(440px,calc((100% - 14px) / 2))),1fr));}@container (min-width:894px){.band.parts>.panel:last-child:nth-child(odd){grid-column:1 / -1;}}.stack{grid-area:stack;}.problems{grid-area:problems;}.outputs{grid-area:outputs;}.row{grid-area:running;}.band.status{grid-template-areas:'stack' 'problems' 'outputs' 'running';}@container (min-width:760px){.band.status{grid-template-columns:minmax(240px,1fr) minmax(0,1.4fr);grid-template-areas:'stack problems' 'outputs outputs' 'running running';}}@container (min-width:1100px){.band.status{grid-template-columns:minmax(240px,1fr) minmax(0,1.3fr) minmax(0,1.3fr);grid-template-areas:'stack problems outputs' 'running running running';}}.ok{display:flex;align-items:baseline;gap:6px;color:var(--text-2);}.ok span[aria-hidden]{color:var(--status-done);}.ofl{grid-template-columns:max-content minmax(0,1fr);}.ofl>.jstop{white-space:nowrap;}.ofl>b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.ofl>.meta{grid-column:1 / -1;overflow:hidden;text-overflow:ellipsis;}.ct-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px;}.pcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(320px,100%),1fr));gap:12px;}.pcard{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 12px;align-items:start;padding:12px 14px;border-radius:10px;background:var(--raise);border:1px solid var(--line);cursor:pointer;transition:border-color 0.15s,transform 0.15s;text-align:left;color:inherit;font:inherit;width:100%;min-width:0;}.pcard>div{min-width:0;}.pcard .meta{overflow-wrap:anywhere;}.pcard:hover{border-color:var(--accent);transform:translateY(-1px);}.pc-ic{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:var(--well);color:var(--text-2);font-size:16px;}.pc-peek{font-family:var(--mono);font-size:11.5px;color:var(--text-2);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.pc-go{grid-column:2;color:var(--accent);font-size:12px;opacity:0.8;margin-top:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.pcard:hover .pc-go{opacity:1;}.cur-units{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:8px 14px;}.cu{display:grid;grid-template-columns:90px 1fr 70px auto;gap:8px;align-items:center;}.cu-bar{height:5px;border-radius:3px;background:var(--track);overflow:hidden;}.cu-bar i{display:block;height:100%;background:var(--meter);}.fl>div.meta{grid-column:1 / 4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.ofl>.meta{white-space:nowrap;}.stopped{grid-column:1 / 4;color:var(--text-muted);font-size:11px;display:flex;flex-wrap:wrap;align-items:center;gap:4px;}.fl.muted{opacity:0.7;}.problems h4.sub{margin:10px 0 2px;font-size:11px;font-weight:600;color:var(--text-muted);display:flex;}.problems h4.sub .r{margin-left:auto;font-weight:400;}.next{margin:10px 2px 2px;font-size:12px;color:var(--text-2);}.next code{font-family:var(--mono);}.more{font-size:12px;margin:6px 10px 0;}`]}go(e){Q(this,`ca-navigate`,{tab:e})}open(e){Q(this,`ca-open-task`,{key:e.key,...C(e)?{view:`output`}:{}})}render(){let e=this.state,t=fe(e,this.summary),n=t?pe(e.procs).length:0,r=e.procs?.max_workers||null,i=this.info.panels.filter(ge),a=t&&n>0;return k`<div class="ov">
|
|
514
514
|
<div class="band status">
|
|
515
515
|
<div class="stack">
|
|
516
516
|
<section class="panel enter">
|
|
@@ -582,13 +582,13 @@ ${this.panelCards(i)}
|
|
|
582
582
|
<h3 title=${E(`Limit: max_concurrent`)}>${E(`Running tasks`)}
|
|
583
583
|
${e?k`<span class="r">${E(n?T`${t} of ${n} running at once`:T`${t} running at once`)}</span>`:j}</h3>
|
|
584
584
|
${t?k`<ca-workers .procs=${this.state.procs} .live=${e}></ca-workers>`:k`<div class="meta">${E(`No tasks running`)}</div>`}
|
|
585
|
-
</section>`}outputs(){let{contracts:e,tally:t}=this.state.outputs;if(!e.length)return k`<div class="meta">${E(`No output files`)}</div>`;let n=
|
|
586
|
-
${n.length?n.map(e=>
|
|
585
|
+
</section>`}outputs(){let{contracts:e,tally:t}=this.state.outputs;if(!e.length)return k`<div class="meta">${E(`No output files`)}</div>`;let n=qd.filter(e=>t[e]),r=e.flatMap(e=>(e.outputs??[]).map(t=>[e,t])).filter(([,e])=>e.status===`invalid`||e.status===`failed`),i=r.slice(0,5),a=t.refused;return k`<div class="ct-row">
|
|
586
|
+
${n.length?n.map(e=>yl(e,t[e])):k`<span class="meta">${E(`No checked files`)}</span>`}
|
|
587
587
|
</div>
|
|
588
588
|
${i.map(([e,t])=>k`<button type="button" class="fl ofl" @click=${()=>this.go(`outputs`)}>
|
|
589
|
-
${Qr({text:t.status?
|
|
589
|
+
${Qr({text:t.status?Js(t.status):`—`,tone:ds(t.status),title:t.status?Ys(t.status):null})}
|
|
590
590
|
<b class="jmono" title=${e.key}>${q({kind:e.kind,unit:e.unit===e.key?``:e.unit})}</b>
|
|
591
|
-
<span class="meta">${
|
|
591
|
+
<span class="meta">${wl(t)}</span>
|
|
592
592
|
<span class="meta" title=${w(t.errors?.[0]||t.path,this.run)}>${w(t.errors?.[0]||t.path,this.run)}</span>
|
|
593
593
|
</button>`)}
|
|
594
594
|
${r.length>i.length?k`<div class="more"><a class="lnk" href="#" @click=${e=>this.nav(e,()=>this.go(`outputs`))}>${r.length-i.length===1?E(`1 more output`):E(T`${r.length-i.length} more outputs`)}</a></div>`:j}
|
|
@@ -604,7 +604,7 @@ ${t.inflight.length?Zr({text:E(`running`),tone:`running`,title:t.inflight.join(`
|
|
|
604
604
|
`)}):j}
|
|
605
605
|
</div>`)}
|
|
606
606
|
</div>`:j}`}panelCards(e){return k`<div class="pcards">
|
|
607
|
-
${H(e,e=>e.name,e=>{let t=
|
|
607
|
+
${H(e,e=>e.name,e=>{let t=Yd(this.state.panels[e.name]);return k`<button type="button" class="pcard" @click=${()=>this.go(`panel:${e.name}`)}>
|
|
608
608
|
<span class="pc-ic" aria-hidden="true">${e.icon||`▤`}</span>
|
|
609
609
|
<div>
|
|
610
610
|
<b>${e.title||e.name}</b>
|
|
@@ -615,7 +615,7 @@ ${t?k`<div class="pc-peek">${t}</div>`:j}
|
|
|
615
615
|
</button>`})}
|
|
616
616
|
</div>`}nameButton(e){return k`<button type="button" class="fl-name jmono" title=${e.key} @click=${()=>this.open(e)}>${this.name(e)}</button>`}openRow(e,t){e.target.closest(`button`)||this.open(t)}name(e){return q(e)}problems(e){let{outcomes:t,problems:n}=S(this.state.journal,this.state.plan),{failed:r,notStarted:i,partial:a,recovered:o}=n,s=r.length+i.length+a.length,c=k`<div class="ok"><span aria-hidden="true">✓</span>${E(`No problems`)}</div>`;if(!s&&!o.length)return c;let l=e=>w(e.attempts[e.attempts.length-1]?.reason||`—`,this.run),u=e=>e.length?k`<div class="stopped">
|
|
617
617
|
<span>${e.length===1?E(`1 later task not started`):E(T`${e.length} later tasks not started`)}</span>
|
|
618
|
-
${e.slice(0,4).map(e=>
|
|
618
|
+
${e.slice(0,4).map(e=>dl(this,this.name(e),e))}
|
|
619
619
|
${e.length>4?k`<span>${E(T`${e.length-4} more`)}</span>`:j}
|
|
620
620
|
</div>`:j,d=(e,t,n)=>e>t?k`<div class="more"><a class="lnk" href="#" @click=${e=>this.nav(e,()=>Q(this,`ca-navigate`,{tab:`journal`,stop:n}))}>${E(e-t===1?`1 more in history`:T`${e-t} more in history`)}</a></div>`:j;return k`${s?j:c}${H(r.slice(0,5),e=>e.task.key,e=>{let t=e.task.attempts[e.task.attempts.length-1];return k`<div class="fl" @click=${t=>this.openRow(t,e.task)}>
|
|
621
621
|
${Qr({text:rs(`failed`),tone:`failed`})}
|
|
@@ -643,30 +643,30 @@ ${this.nameButton(e)}<span></span>
|
|
|
643
643
|
<div class="meta">${E(t===1?T`Done on attempt ${n} | 1 failed attempt`:T`Done on attempt ${n} | ${t} failed attempts`)}</div>
|
|
644
644
|
</div>`})}
|
|
645
645
|
${d(o.length,3,`retried`)}
|
|
646
|
-
${this.nextStep(e,s)}`}metaLine(e){return k`<div class="meta" title=${e}>${e}</div>`}nextStep(e,t){if(e||!t)return j;let n=S(this.state.journal,this.state.plan).counts,r=n.total-n.finished+n.partial;return r?k`<div class="next" title="resume=True">${E(T`${r} of ${n.total} tasks not done`)}</div>`:j}};function
|
|
647
|
-
${
|
|
646
|
+
${this.nextStep(e,s)}`}metaLine(e){return k`<div class="meta" title=${e}>${e}</div>`}nextStep(e,t){if(e||!t)return j;let n=S(this.state.journal,this.state.plan).counts,r=n.total-n.finished+n.partial;return r?k`<div class="next" title="resume=True">${E(T`${r} of ${n.total} tasks not done`)}</div>`:j}};function Zd(e,t,n){let r=n.toLowerCase();return e.filter(e=>(!t||e.kind===t)&&(!r||`${e.kind} ${e.unit} ${(e.claims??[]).join(` `)} ${e.key} ${e.last_stop}`.toLowerCase().includes(r)))}U([P({attribute:!1})],Xd.prototype,`state`,void 0),U([P({attribute:!1})],Xd.prototype,`summary`,void 0),U([P({attribute:!1})],Xd.prototype,`host`,void 0),U([P({attribute:!1})],Xd.prototype,`info`,void 0),U([P()],Xd.prototype,`run`,void 0),U([P()],Xd.prototype,`layer`,void 0),U([P()],Xd.prototype,`unit`,void 0),U([P()],Xd.prototype,`sel`,void 0),Xd=U([N(`ca-overview`),D()],Xd),z(`cae-data-table`,ha);var Qd={failed:0,not_started:1,partial:2,running:3,waiting:4};function $d(e){return e.map((e,t)=>({t:e,i:t})).sort((e,t)=>(Qd[e.t.outcome]??9)-(Qd[t.t.outcome]??9)||t.t.last_ts.localeCompare(e.t.last_ts)||e.i-t.i).map(e=>e.t)}var ef=[`key`,`unit`,`stop`,`kind`,`route`,`reason`],tf=e=>new Set(m(e).map(e=>e.key)),nf=e=>(e.rounds??1)>1;function rf(e,t,n,r){let i=r.toLowerCase(),a=n===`retried`?tf(e):null;return e.filter(e=>!(n===`bad`&&!ce(e))&&!(n===`fixup`&&!nf(e))&&!(a&&!a.has(e.key))&&!(n===`replayed`&&!e.replayed)&&!(n&&![`bad`,`fixup`,`retried`,`replayed`].includes(n)&&e.stop!==n)&&(!t||e.kind===t)&&(!i||ef.some(t=>String(e[t]??``).toLowerCase().includes(i))))}function af(e){let t=new Map;for(let n of e)t.set(n.stop||`?`,(t.get(n.stop||`?`)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1])}function of(e){let t=new Map;return e.forEach((e,n)=>{let r=t.get(e.key)??{count:0,lastOk:-1,lastOkTry:0};f(e)&&r.count++,e.ok&&(r.lastOk=n,r.lastOkTry=(e.attempt??0)+1),t.set(e.key,r)}),t}var sf=()=>E(`none`,{id:`none`});function cf(e){let t=new Map;for(let n of e.all)t.set(`${n.kind}|${n.unit}`,(t.get(`${n.kind}|${n.unit}`)??0)+1);let n=Math.max(1,...e.rows.map(e=>e.wall_s)),r=new Map;for(let t of e.journal)Ee(r.get(t.key)??r.set(t.key,we()).get(t.key),t);let i=e=>e.tries.length>0,a=(e,t)=>{if(!i(e))return k`<span class="jdim">${sf()}</span>`;let n=r.get(e.key);return n?.reported?t(n):k`<span class="jdim">—</span>`};return[{id:`task`,header:E(`Task`),tip:E(`Kind · unit`),width:`minmax(220px, 0.6fr)`,rowHeader:!0,text:e=>e.key,cell:e=>{let n=C(e),r=e.pass!==null&&(t.get(`${e.kind}|${e.unit}`)??0)>1?e.pass:null;return k`<span class="grow jmono" title=${e.key}>
|
|
647
|
+
${vd(n,E(n?`Python task`:`Agent task`))}${e.kind}
|
|
648
648
|
${e.unit?k`<span class="jdim">· ${e.unit}</span>`:j}${r===null?j:k`<span class="pass">${ys(r)}</span>`}
|
|
649
|
-
${e.claims?.length?k`<span class="jdim also" title=${i=e.claims,K(
|
|
650
|
-
${e.priority?k`<span class="jdim also" title=${
|
|
651
|
-
</span>`;var i}},{id:`attempts`,header:E(`Attempts`),tip:E(`Attempts that ran`),align:`end`,width:`64px`,cell:e=>e.tries.length},{id:`time`,header:E(`Time`),tip:E(`Summed over all attempts`),align:`end`,width:`132px`,cell:e=>k`<span class="wall">${i(e)?k`${B(e.wall_s)}<span class="jdur"><i class=${C(e)?``:`llm`} style="width:${Math.max(4,Math.round(100*e.wall_s/n))}%"></i></span>`:k`<span class="jdim">${
|
|
652
|
-
`):``}(t.deferredCause)||t.deferred:``;return k`${Zr({text:is(t.outcome,e.live&&!t.deferred),tone:us(t.outcome),mark:fs(t.outcome),title:t.last_stop})}${n?k`<span class="cause" title=${r||j}>${n}</span>`:j}`}}]}var
|
|
653
|
-
${q(e)}</span>`}},{id:`outcome`,header:E(`Outcome`),tip:E(`How the attempt ended (stop)`),width:`minmax(150px,0.7fr)`,cell:t=>{let r=f(t),i=r&&(n.get(t.key)?.count??1)>1,a=r?vs((t.rounds??1)-1):``,o=e.replayMarks&&t.replayed?
|
|
654
|
-
`)||j}>${t.map(e=>ws(e)).join(` → `)}${n?k` <span class="q">${a}</span>`:j}</span>`}(e)}`:`—`}</span>`},{id:`tokens`,header:E(`Tokens`),tip:E(`Input / output | cache read / cache write`),align:`end`,width:`92px`,cell:e=>{let t=e.usage;return k`<span class="two" title=${[t?.resident==null?``:E(T`Input of the first API call: ${J(t.resident)}`),
|
|
649
|
+
${e.claims?.length?k`<span class="jdim also" title=${i=e.claims,K(fc(),es(i))}>${(e=>e.length>2?E(T`Locks ${e.length} names`):E(T`Locks ${es(e)}`))(e.claims)}</span>`:j}
|
|
650
|
+
${e.priority?k`<span class="jdim also" title=${zc()}>${Rc(e.priority)}</span>`:j}
|
|
651
|
+
</span>`;var i}},{id:`attempts`,header:E(`Attempts`),tip:E(`Attempts that ran`),align:`end`,width:`64px`,cell:e=>e.tries.length},{id:`time`,header:E(`Time`),tip:E(`Summed over all attempts`),align:`end`,width:`132px`,cell:e=>k`<span class="wall">${i(e)?k`${B(e.wall_s)}<span class="jdur"><i class=${C(e)?``:`llm`} style="width:${Math.max(4,Math.round(100*e.wall_s/n))}%"></i></span>`:k`<span class="jdim">${sf()}</span><span class="jdur" style="visibility:hidden"></span>`}</span>`},{id:`tokens`,header:E(`Tokens`),tip:E(`Input and output, summed over all attempts`),align:`end`,width:`72px`,cell:e=>a(e,e=>k`<span title=${K(E(T`Cache read ${J(e.cache_read)}`),E(T`Cache write ${J(e.cache_creation)}`))}>${J(e.input+e.output)}</span>`)},{id:`cost`,header:E(`Cost`),tip:E(`Reported by the coding agent`),align:`end`,width:`72px`,cell:e=>a(e,e=>Y(e.cost))},{id:`ended`,header:E(`Last attempt ended`),align:`end`,width:`128px`,cell:e=>k`<span class="meta">${i(e)?G(e.tries[e.tries.length-1]?.ts,!0):sf()}</span>`},{id:`status`,header:E(`Status`,{id:`status`}),width:`minmax(240px, 1fr)`,cell:t=>{let n=function(e,t){return e.outcome===`not_started`?ms(e,t.outcomes,t.run):e.outcome===`partial`?w(e.attempts[e.attempts.length-1]?.reason??``,t.run):e.outcome===`waiting`&&e.deferred?Hs(e.deferredCause,e.deferred,e.deferredIn):e.outcome===`waiting`?function(e){let t=e[0];return t?e.length===1?E(T`waits for output of ${q(t)}`):E(T`waits for output of ${e.length} earlier tasks`):``}(e.waits_for.map(e=>t.outcomes.get(e)??{kind:e})):``}(t,e),r=t.outcome===`waiting`&&t.deferred?function(e){let t=e?.cause===`rest`?Vs(e.rests??[]):[];return t.length>1?t.map(Bs).join(`
|
|
652
|
+
`):``}(t.deferredCause)||t.deferred:``;return k`${Zr({text:is(t.outcome,e.live&&!t.deferred),tone:us(t.outcome),mark:fs(t.outcome),title:t.last_stop})}${n?k`<span class="cause" title=${r||j}>${n}</span>`:j}`}}]}var lf=[Kr,yd,O` caption{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}tr{column-gap:20px;padding:6px 12px;}tbody tr{border-bottom:0;border-radius:8px;transition:background 0.15s;}thead tr{align-items:end;white-space:nowrap;padding:4px 12px 8px;margin-bottom:4px;}tbody [data-col='ended']{font-size:var(--font-size-sm);}.wall{display:flex;align-items:center;justify-content:flex-end;gap:8px;}.wall .jdur{width:56px;margin:0;flex:none;}.grow{display:flex;align-items:center;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.grow .jdim{margin-left:8px;}.pass{margin-left:8px;font-size:11px;color:var(--text-muted);}.cause{display:block;font-size:11px;color:var(--text-muted);margin-top:2px;white-space:normal;overflow-wrap:anywhere;}@container (max-width:760px){tr{grid-template-columns:minmax(0,1fr) 128px 90px;}[data-col='attempts'],[data-col='tokens'],[data-col='cost'],[data-col='ended']{display:none;}}`],uf=class extends M{constructor(...e){super(...e),this.journal=[],this.plan=null,this.kind=``,this.q=``,this.live=!1,this.run=``}static{this.styles=[V,O`:host{display:block;margin-top:4px;}`]}open(e,t){let n=e.find(e=>e.key===t);n&&Q(this,`ca-open-task`,C(n)?{key:t,view:`output`}:{key:t})}render(){let e=this.plan?S(this.journal,this.plan):null,t=e?.rows??[],n=$d(Zd(t,this.kind,this.q));return n.length?k`<cae-data-table .columns=${cf({run:this.run,live:this.live,outcomes:e?.outcomes??new Map,all:t,rows:n,journal:this.journal})} .rows=${n} .rowKey=${e=>e.key} .rowTone=${e=>e.outcome===`running`?`running`:void 0} .rowAttrs=${e=>({"data-executor":C(e)?`python`:`agent`})} .cellStyles=${lf} .caption=${E(`Tasks`,{id:`tab-tasks`})} .strings=${dc(E(`No tasks`))} @cae-activate=${e=>this.open(n,e.detail.id)} ></cae-data-table>`:k`<div class="blank"><span class="ic" aria-hidden="true">≡</span>${t.length?E(`No tasks match the filter`):E(`No tasks`)}</div>`}};function df(e){return e===`invalid_input`?rs(`not_started`):Z(e)}function ff(e){let t=Math.max(1,...e.rows.map(e=>e.wall_s||0)),n=of(e.journal),r=new Map(e.journal.map((e,t)=>[e,t]));return[{id:`ended`,header:E(`Ended`),width:`64px`,cell:e=>k`<span class="jmono" title=${G(e.ts,!0)}>${G(e.ts)}</span>`},{id:`task`,header:E(`Task`),width:`minmax(130px,0.8fr)`,rowHeader:!0,text:e=>e.key,cell:e=>{let t=C(e);return k`<span class="jmono" title=${e.key}>${vd(t,E(t?`Python task`:`Agent task`),``)}
|
|
653
|
+
${q(e)}</span>`}},{id:`outcome`,header:E(`Outcome`),tip:E(`How the attempt ended (stop)`),width:`minmax(150px,0.7fr)`,cell:t=>{let r=f(t),i=r&&(n.get(t.key)?.count??1)>1,a=r?vs((t.rounds??1)-1):``,o=e.replayMarks&&t.replayed?nc():``;return Qr({text:k`<span class="nw">${df(t.stop)}</span>${i||a||o?k`<span class="sub" title=${o?rc():j}>${K(i?gs(t.attempt):``,a,o)}</span>`:j}`,tone:ls(t.stop),cls:`two`,title:t.stop})}},{id:`agent`,header:E(`Agent, model, identity`),width:`minmax(150px,1fr)`,cell:e=>k`<span class="jmono jdim two" title=${K(e.route,qs(e.hops,null,e.skipped_hops))||j}>${f(e)?k`<span>${[e.agent,e.model].filter(Boolean).join(` / `)||`—`}</span>${function(e){let t=[...new Set([...(e.hops??[]).map(e=>e.credential),e.credential].filter(Boolean))];if(!t.length)return j;let n=(e.quota??[])[0],r=n?E(T`Usage at session start (account-wide): ${Ms(n)}`):``,i=n&&t.length===1&&(n.credential??``)===t[0],a=n?i?As(n):Ms(n):``;return k`<span class="sub" title=${[r,...t.map(Ts)].filter(Boolean).join(`
|
|
654
|
+
`)||j}>${t.map(e=>ws(e)).join(` → `)}${n?k` <span class="q">${a}</span>`:j}</span>`}(e)}`:`—`}</span>`},{id:`tokens`,header:E(`Tokens`),tip:E(`Input / output | cache read / cache write`),align:`end`,width:`92px`,cell:e=>{let t=e.usage;return k`<span class="two" title=${[t?.resident==null?``:E(T`Input of the first API call: ${J(t.resident)}`),Hc(e)].filter(Boolean).join(`
|
|
655
655
|
`)||j}>${t?k`<span>${J(t.input)} / ${J(t.output)}</span><span class="sub">${J(t.cache_read)} / ${J(t.cache_creation)}</span>`:k`<span class="jdim">—</span>`}</span>`}},{id:`cost`,header:E(`Cost`),tip:E(`Reported by the coding agent`),align:`end`,width:`60px`,cell:e=>{let t=e.hops??[];return k`<span class="cost" title=${(t.length>1?t.map(e=>K(e.model||e.route||`—`,ws(e.credential)||`—`,Y(e.cost_usd),Z(e.stop))).join(`
|
|
656
|
-
`):``)||E(`Reported by the coding agent`)}>${Y(e.cost_usd)}</span>`}},{id:`time`,header:E(`Time`),align:`end`,width:`76px`,cell:e=>{let n=C(e);return f(e)?k`${B(e.wall_s)}<span class="jdur"><i class=${ce(e)?`bad`:n?``:`llm`} style="width:${Math.max(2,Math.round(100*(e.wall_s||0)/t))}%"></i></span>`:`—`}},{id:`reason`,header:E(`Reason`),width:`minmax(200px,2.2fr)`,cell:t=>{let i=ns([t]),a=t.safety_stops??[];return k`<span class="jwhy" title=${t.reason||j}>${(t=>{let i=f(t),a=
|
|
657
|
-
`)}>${p}</span>`:j}`:k`<span class="jdim">—</span>`})(t)}${a.length?k` <span class="tone-text nw" data-tone="attention" title=${[
|
|
658
|
-
`)} >${
|
|
659
|
-
${
|
|
660
|
-
${t?i(`fixup`,E(`attempts with corrections`),t,
|
|
656
|
+
`):``)||E(`Reported by the coding agent`)}>${Y(e.cost_usd)}</span>`}},{id:`time`,header:E(`Time`),align:`end`,width:`76px`,cell:e=>{let n=C(e);return f(e)?k`${B(e.wall_s)}<span class="jdur"><i class=${ce(e)?`bad`:n?``:`llm`} style="width:${Math.max(2,Math.round(100*(e.wall_s||0)/t))}%"></i></span>`:`—`}},{id:`reason`,header:E(`Reason`),width:`minmax(200px,2.2fr)`,cell:t=>{let i=ns([t]),a=t.safety_stops??[];return k`<span class="jwhy" title=${t.reason||j}>${(t=>{let i=f(t),a=qs(t.hops,null,t.skipped_hops),o=e.run||t.run_id||``,s=e.outcomes.get(t.key),c=t.stop===`invalid_input`&&s?ms({attempts:[t],cause:null},e.outcomes,o):``,l=c?Zo(c):t.ok&&i&&t.stop!==`partial`||!t.reason?``:w(t.reason,o),u=(e=>{let t=n.get(e.key);return!e.ok&&f(e)&&(t?.lastOk??-1)>(r.get(e)??0)?t?.lastOkTry??0:0})(t),d=u?E(T`Task done on attempt ${u}`):``,p=t.context_warned?Uc(t):``;return a||l||d||p?k`${a?k`<span class="nw" title=${E(`Model switch`)}>${a}</span><br />`:j}${l?k`${l}<br />`:j}${d?k`<span class="later">${d}</span>${p?k`<br />`:j}`:j}${p?k`<span class="tone-text" data-tone="attention" title=${[Wc(),Hc(t)].filter(Boolean).join(`
|
|
657
|
+
`)}>${p}</span>`:j}`:k`<span class="jdim">—</span>`})(t)}${a.length?k` <span class="tone-text nw" data-tone="attention" title=${[$c(),...a.map(tl)].join(`
|
|
658
|
+
`)} >${Qc(a.length)}</span >`:j}${i?k` <span class="unread nw" title=${E(T`Event types this contraagent version does not know (unread_events): ${i}`)} ><span aria-hidden="true">⚠</span> ${E(`Unrecognized events`)}</span >`:j}</span>`}},...(e.extras??[]).map(e=>({id:`x:${e}`,header:e,tip:hc(),width:`minmax(80px,0.6fr)`,text:t=>gc(t[e]),cell:t=>{let n=gc(t[e]);return n===`—`?k`<span class="jdim">—</span>`:k`<span class="jmono" title=${n}>${n}</span>`}}))]}U([P({attribute:!1})],uf.prototype,`journal`,void 0),U([P({attribute:!1})],uf.prototype,`plan`,void 0),U([P()],uf.prototype,`kind`,void 0),U([P()],uf.prototype,`q`,void 0),U([P({type:Boolean})],uf.prototype,`live`,void 0),U([P()],uf.prototype,`run`,void 0),uf=U([N(`ca-task-table`),D()],uf);var pf=[Kr,yd,O` caption{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}tr{column-gap:12px;row-gap:2px;padding:7px 12px;border-bottom:1px solid var(--line);font-size:12px;min-width:980px;}th,td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}tbody [data-col='outcome'],tbody [data-col='agent'],tbody [data-col='tokens'],tbody [data-col='reason']{white-space:normal;}tbody [data-col='ended'],tbody [data-col='task']{font-family:var(--mono);font-size:11.5px;}thead{position:sticky;top:0;z-index:1;}thead tr{color:var(--text-muted);font-size:11px;background:var(--bg);}tbody tr[data-key]:hover{background:var(--card);}tbody tr[data-executor='python']{opacity:0.85;}tbody tr[data-executor='python']:hover,tbody tr[data-executor='python'][data-tone='failed']{opacity:1;}tbody tr[data-ran='false']{opacity:0.8;}tbody tr[data-fresh]{animation:rowin 1.6s var(--ease);}tr.empty{min-width:0;}tr.empty td{font-size:var(--font-size-sm);}.jwhy{color:var(--text-2);overflow-wrap:anywhere;}.later{color:var(--status-done);}.nw{white-space:nowrap;}.unread{color:var(--status-attention);}.two{display:flex;flex-direction:column;line-height:1.35;}.jstop.two{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:center;}.jstop.two>*{grid-column:2;}.jstop.two::before{grid-row:1;}.two .sub{color:var(--text-muted);font-size:11px;white-space:normal;overflow-wrap:anywhere;}[data-col='tokens'] .two>span{white-space:nowrap;}.sub .q{color:var(--text-2);font-family:var(--mono);white-space:nowrap;}.jstop .sub{font-weight:400;}.cost{font-variant-numeric:tabular-nums;color:var(--text-2);}`],mf=class extends M{constructor(...e){super(...e),this.rows=[],this.plan=null,this.fresh=new Set,this.kind=``,this.stop=``,this.q=``,this.run=``,this.extras=[],this.replayMarks=!1}static{this.styles=[V,O` :host{display:block;}.jtally{display:flex;flex-wrap:wrap;gap:8px;padding:2px 0 12px;}.jchip{border:1px solid var(--line);border-radius:999px;padding:3px 11px;font-size:11.5px;color:var(--text-muted);cursor:pointer;transition:all 0.15s;background:none;}.jchip b{color:var(--text);}.jchip:hover{border-color:var(--line2);color:var(--text);}.jchip.on{background:var(--accent-bg);border-color:var(--accent);color:var(--text);}.jchip[data-tone='failed'],.jchip[data-tone='attention']{color:var(--tone);border-color:color-mix(in srgb,var(--tone) 40%,transparent);}`]}open(e,t){let n=e.find(e=>ue(e)===t);n&&Q(this,`ca-open-task`,C(n)?{key:n.key,view:`output`}:{key:n.key})}render(){let e=rf(this.rows,this.kind,this.stop,this.q).reverse(),t=this.rows.filter(nf).length,n=tf(this.rows).size,r=this.replayMarks?this.rows.filter(e=>e.replayed).length:0,i=(e,t,n,r,i=`neutral`)=>k`<button type="button" class="jchip ${this.stop===e?`on`:``}" data-tone=${L(i)} data-mark=${Yr(i)??j} aria-pressed=${this.stop===e} title=${r} @click=${()=>Q(this,`ca-filter`,{stop:this.stop===e?``:e})}>${t} <b>${n}</b></button>`,a=ff({run:this.run,outcomes:S(this.rows,this.plan).outcomes,journal:this.rows,rows:e,extras:this.extras,replayMarks:this.replayMarks});return k`<div class="jtally">
|
|
659
|
+
${af(this.rows).map(([e,t])=>i(e,df(e),t,e,ls(e)))}
|
|
660
|
+
${t?i(`fixup`,E(`attempts with corrections`),t,Xs()):j}
|
|
661
661
|
${n?i(`retried`,E(`tasks retried`),n,hs()):j}
|
|
662
|
-
${r?i(`replayed`,E(`attempts replayed`),r,
|
|
662
|
+
${r?i(`replayed`,E(`attempts replayed`),r,rc()):j}
|
|
663
663
|
</div>
|
|
664
|
-
<cae-data-table .columns=${a} .rows=${e} .rowKey=${ue} .rowTone=${e=>f(e)&&ce(e)?`failed`:void 0} .rowAttrs=${e=>({"data-executor":C(e)?`python`:`agent`,...f(e)?{}:{"data-ran":`false`},...this.fresh.has(ue(e))?{"data-fresh":``}:{}})} .cellStyles=${
|
|
665
|
-
<span>${E(`No task declares an OutputContract or an InputContract`)}</span></div>`;let t=e.flatMap(e=>(e.outputs??[]).map(t=>[e,t])).sort(([e,t],[n,r])=>
|
|
664
|
+
<cae-data-table .columns=${a} .rows=${e} .rowKey=${ue} .rowTone=${e=>f(e)&&ce(e)?`failed`:void 0} .rowAttrs=${e=>({"data-executor":C(e)?`python`:`agent`,...f(e)?{}:{"data-ran":`false`},...this.fresh.has(ue(e))?{"data-fresh":``}:{}})} .cellStyles=${pf} .caption=${E(`History`)} .strings=${dc(E(`No finished attempts`))} @cae-activate=${t=>this.open(e,t.detail.id)} ></cae-data-table>`}};U([P({attribute:!1})],mf.prototype,`rows`,void 0),U([P({attribute:!1})],mf.prototype,`plan`,void 0),U([P({attribute:!1})],mf.prototype,`fresh`,void 0),U([P()],mf.prototype,`kind`,void 0),U([P()],mf.prototype,`stop`,void 0),U([P()],mf.prototype,`q`,void 0),U([P()],mf.prototype,`run`,void 0),U([P({attribute:!1})],mf.prototype,`extras`,void 0),U([P({type:Boolean,attribute:`replay-marks`})],mf.prototype,`replayMarks`,void 0),mf=U([N(`ca-journal-table`),D()],mf);var hf=[`invalid`,`refused`,`failed`,`running`,`pending`,`valid`];function gf(e){let t=e?.tally,n=t?hf.filter(e=>t[e]):[];return n.length?n.map(e=>yl(e,t?.[e])):k`<span class="meta">${E(`No checked files`)}</span>`}var _f=e=>e.split(`/`).slice(-2).join(`/`),vf=e=>q({kind:e.kind||e.key,unit:e.unit&&e.unit!==e.key?e.unit:``}),yf=e=>e?hf.indexOf(e):hf.length,bf=class extends M{constructor(...e){super(...e),this.outputs=null,this.run=``,this.journal=[],this.plan=null,this.outcomes=new Map,this.open=new Xn(`contracts:open`,this),this.producerOf=e=>{for(let t of this.outputs?.contracts??[]){let n=(t.outputs??[]).find(t=>t.path===e);if(n)return{name:vf(t),written:!!n.file.exists,outcome:this.outcomes.get(t.key)?.outcome}}}}static{this.styles=[V,Dl,yd,O` :host{display:block;container-type:inline-size;}.ct-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px;}details.ct{border-top:1px solid var(--line);}details.ct>summary{list-style:none;cursor:pointer;padding:7px 4px;display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;}details.ct>summary>*{min-width:0;overflow-wrap:anywhere;}details.ct>summary::-webkit-details-marker{display:none;}details.ct>summary::before{content:'▸';color:var(--text-muted);width:10px;transition:transform 0.15s;}details.ct[open]>summary::before{transform:rotate(90deg);}details.ct>summary:hover{background:var(--raise);border-radius:8px;}.k-ic{margin-right:0;}.ct-f{margin-left:auto;white-space:nowrap;}.ct-body{padding:4px 10px 14px 24px;}@container (max-width:480px){.ct-body{padding:4px 0 14px 12px;}}.ct-links{margin-top:10px;font-size:12px;}.lead{margin:-4px 0 10px;}.one{display:flex;align-items:center;gap:10px;padding:7px 4px 7px 24px;border-top:1px solid var(--line);flex-wrap:wrap;}.why{color:var(--text-2);font-size:12px;}`]}render(){let e=this.outputs?.contracts??[];if(this.outcomes=this.plan?S(this.journal,this.plan).outcomes:new Map,!e.length)return k`<div class="blank"><span class="ic" aria-hidden="true">▣</span><b>${E(`No checked files`)}</b>
|
|
665
|
+
<span>${E(`No task declares an OutputContract or an InputContract`)}</span></div>`;let t=e.flatMap(e=>(e.outputs??[]).map(t=>[e,t])).sort(([e,t],[n,r])=>yf(t.status)-yf(r.status)||e.key.localeCompare(n.key)),n=e.flatMap(e=>(e.inputs??[]).map(t=>[e,t]));return k`<div class="g12">
|
|
666
666
|
<section class="panel c12">
|
|
667
667
|
<h3 title=${E(`OutputContract`)}>${E(`Outputs`)}
|
|
668
668
|
<span class="r">${E(`Files each task must write`)}</span></h3>
|
|
669
|
-
<div class="ct-row">${
|
|
669
|
+
<div class="ct-row">${gf(this.outputs)}</div>
|
|
670
670
|
${H(t,([e,t])=>`out|${e.key}|${t.path}`,([e,t])=>this.outRow(e,t))}
|
|
671
671
|
</section>
|
|
672
672
|
${n.length?k`<section class="panel c12">
|
|
@@ -677,28 +677,28 @@ ${H(n,([e,t])=>`in|${e.key}|${t.path}`,([e,t])=>this.inRow(e,t))}
|
|
|
677
677
|
</div>`}details(e,t,n){return k`<details class="ct" ?open=${this.open.has(e)} @toggle=${t=>this.open.set(e,t.target.open)}>
|
|
678
678
|
<summary class="ct-sum">${t}</summary>
|
|
679
679
|
<div class="ct-body">${n}</div>
|
|
680
|
-
</details>`}link(e,t,n){return k`<a class="lnk" href="#" @click=${n=>{n.preventDefault(),Q(this,`ca-open-task`,{key:e,view:t})}}>${n}</a>`}who(e){let t=C(e);return k`${
|
|
681
|
-
<b class="jmono" title=${e.key}>${
|
|
682
|
-
${
|
|
683
|
-
<span class="why">${
|
|
684
|
-
</div>`;let n=t.file,r=t.status,i=t.rounds??0,a=t.errors??[],o=
|
|
685
|
-
${i>1?k`<span class="meta" title=${
|
|
680
|
+
</details>`}link(e,t,n){return k`<a class="lnk" href="#" @click=${n=>{n.preventDefault(),Q(this,`ca-open-task`,{key:e,view:t})}}>${n}</a>`}who(e){let t=C(e);return k`${vd(t,E(t?`Python task`:`Agent task`))}
|
|
681
|
+
<b class="jmono" title=${e.key}>${vf(e)}</b>`}reasonOf(e){for(let t=this.journal.length-1;t>=0;t--){let n=this.journal[t];if(n?.key===e)return w(n.reason,this.run)}return``}outRow(e,t){if(t.status===`refused`)return k`<div class="one">
|
|
682
|
+
${yl(`refused`)}${this.who(e)}
|
|
683
|
+
<span class="why">${Qs(t,this.run,this.producerOf)}</span>
|
|
684
|
+
</div>`;let n=t.file,r=t.status,i=t.rounds??0,a=t.errors??[],o=vf(e);return this.details(`out|${e.key}|${t.path}`,k`${yl(r)}
|
|
685
|
+
${i>1?k`<span class="meta" title=${Xs()}>${Zs(i,r===`valid`)}</span>`:j}
|
|
686
686
|
${this.who(e)}
|
|
687
|
-
<span class="jmono jdim ct-path" title=${t.path}>${
|
|
687
|
+
<span class="jmono jdim ct-path" title=${t.path}>${_f(t.path)}</span>
|
|
688
688
|
${r===`failed`&&this.reasonOf(e.key)?k`<span class="why">${this.reasonOf(e.key)}</span>`:j}
|
|
689
|
-
<span class="meta ct-f">${n.exists?`${n.size??0} B`:r?j:E(`No file`)}</span>`,k`${
|
|
690
|
-
${
|
|
689
|
+
<span class="meta ct-f">${n.exists?`${n.size??0} B`:r?j:E(`No file`)}</span>`,k`${Tl(t,`output`)}
|
|
690
|
+
${xl(t)}
|
|
691
691
|
${a.length?k`<h4>${E(`Errors`)}</h4><pre class="ct-err">${a.map(e=>w(e,this.run)).join(`
|
|
692
692
|
`)}</pre>`:j}
|
|
693
693
|
<div class="ct-links">
|
|
694
694
|
${this.link(e.key,`output`,E(T`${o}: input and output`))}
|
|
695
695
|
${C(e)?j:k`<br />${this.link(e.key,`transcript`,E(T`${o}: transcript`))}`}
|
|
696
|
-
</div>`)}inRow(e,t){let n=t.file,r=!!n.exists;return this.details(`in|${e.key}|${t.path}`,k`${
|
|
696
|
+
</div>`)}inRow(e,t){let n=t.file,r=!!n.exists;return this.details(`in|${e.key}|${t.path}`,k`${vl(t)}
|
|
697
697
|
${this.who(e)}
|
|
698
|
-
<span class="jmono jdim ct-path" title=${t.path}>${
|
|
699
|
-
<span class="meta ct-f">${r?`${n.size??0} B`:E(`No file`)}</span>`,k`${
|
|
700
|
-
${
|
|
701
|
-
<div class="ct-links">${this.link(e.key,`input`,E(T`${
|
|
698
|
+
<span class="jmono jdim ct-path" title=${t.path}>${_f(t.path)}</span>
|
|
699
|
+
<span class="meta ct-f">${r?`${n.size??0} B`:E(`No file`)}</span>`,k`${Tl(t,`input`)}
|
|
700
|
+
${xl(t)}
|
|
701
|
+
<div class="ct-links">${this.link(e.key,`input`,E(T`${vf(e)}: input`))}</div>`)}};U([P({attribute:!1})],bf.prototype,`outputs`,void 0),U([P()],bf.prototype,`run`,void 0),U([P({attribute:!1})],bf.prototype,`journal`,void 0),U([P({attribute:!1})],bf.prototype,`plan`,void 0),bf=U([N(`ca-contracts`),D()],bf);var xf=e=>e.replace(/\$\{?([A-Za-z_]\w*)\}?/g,`<span class="pv">$&</span>`).replace(/\{\{contract\}\}/g,`<span class="pv pc">{{contract}}</span>`);function Sf(e){let t=e.match(/^(TELEMETRY [^\n]*)\n+([\s\S]*)$/);return t?{head:t[1]??``,body:t[2]??``}:{head:``,body:e}}var Cf=new Set([`instructions`,`schema`,`agent`]),wf=class extends M{constructor(...e){super(...e),this.definition=null,this.memory=`definition`,this.open=new Xn(`definition:open`,this),this.source=new Xn(`definition:source`,this)}static{this.styles=[V,Gr,qr,El,O` :host{display:block;}.ct-in{display:flex;align-items:center;gap:10px;padding:5px 4px;border-top:1px solid var(--line);}.df{border-top:1px solid var(--line);}.df-hd{padding:6px 2px;display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center;}.df-sum{flex:1 1 16em;min-width:0;display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center;padding:0;background:none;border:0;color:inherit;text-align:start;cursor:pointer;}.df-sum .jmono{min-width:0;overflow-wrap:anywhere;}.df-tog{flex:none;margin-inline-start:auto;}.df-sum::before{content:'▸';color:var(--text-muted);width:10px;flex:none;transition:transform 0.15s;}.df-sum[aria-expanded='true']::before{transform:rotate(90deg);}.py-sig{font-family:var(--mono);font-size:14px;padding:10px 14px;background:var(--well);border:1px solid var(--line);border-radius:8px;overflow-x:auto;white-space:pre;}.py-where{margin:6px 2px 12px;font-family:var(--mono);font-size:11.5px;color:var(--text-muted);overflow-wrap:anywhere;}.py-doc{margin:0 0 12px;padding:8px 12px;border-left:3px solid var(--line2);color:var(--text-2);white-space:pre-wrap;line-height:1.6;}.src{display:grid;grid-template-columns:auto minmax(0,1fr);background:var(--well);border:1px solid var(--line);border-radius:8px;font-family:var(--mono);font-size:12px;line-height:1.55;max-height:520px;overflow:auto;}.src pre{margin:0;padding:10px 12px;white-space:pre;}.src .ln{color:var(--text-muted);text-align:right;user-select:none;border-right:1px solid var(--line);opacity:0.7;}`]}willUpdate(e){e.has(`memory`)&&(this.open=new Xn(`${this.memory}:open`,this),this.source=new Xn(`${this.memory}:source`,this))}render(){let e=this.definition;if(!e)return k`<div class="blank"><span class="ic" aria-hidden="true">⌘</span><b>${E(`No definition`)}</b></div>`;if(e.executor===`python`)return this.python(e);let t=e.plugin_dirs||[],n=e.output_from===`message`?K(e.output||``,E(`from the final message`)):e.output||``,r=e.preserve??[],i=[...e.base_kind?[[E(`Implementation of`),k`<span class="jmono" title=${E(`A kind that other kinds implement (base_kind)`)}>${e.base_kind}</span>`]]:[],[E(`Role`),e.role||E(`none`,{id:`none`})],[t.length>1?E(`Plugin directories`):E(`Plugin directory`),t.length?k`${t.map((e,t)=>k`${t?`, `:``}<span class="jmono" title=${e}>${(e=>{let t=e.split(`/`).filter(Boolean);return t.length>2?`…/${t.slice(-2).join(`/`)}`:e})(e)}</span>`)}`:E(`none`,{id:`none`})],[E(`Parameters`),e.params||E(`none`,{id:`none`})],[E(`Output`,{id:`definition-output`}),e.output_of?k`<span title=${E(`The kind whose output file this task writes (output_of)`)}>${K(n,(a=e.output_of,E(T`output of ${a}`)))}</span>`:n||E(`none`,{id:`none`})],...r.length?[[Yc(),k`<span class="jmono" title=${Xc()}>${r.join(`, `)}</span>`]]:[],...(e.validators||[]).length?[[E(`Other checks`),(e.validators||[]).join(`, `)]]:[],...Array.isArray(e.tools)&&e.tools.length===0?[[E(`Tools`),E(`none`,{id:`none`})]]:[]];var a;let o=Array.isArray(e.declared)?e.declared:[],s=t=>t.part===`agent`&&!!e.role&&t.path.replace(/^.*\//,``)===`${e.role}.md`,c=[...e.files||[]].sort((e,t)=>Number(s(t))-Number(s(e)));return k`<div class="drv-facts" style="margin-bottom:10px">${i.map(([e,t])=>k`<span><i>${e}</i>${t}</span>`)}</div>
|
|
702
702
|
${o.length?k`<h4 class="sect-h">${E(`Checked files`)}</h4>
|
|
703
703
|
${o.map(e=>k`<div class="ct-in">
|
|
704
704
|
<span class="ct-chip">${e.io}</span><span class="jmono">${e.path}</span>
|
|
@@ -716,7 +716,7 @@ ${t?k`<h4 class="sect-h">${E(`Source`)}</h4>
|
|
|
716
716
|
<pre class="ln">${Array.from({length:r},(e,t)=>n+t).join(`
|
|
717
717
|
`)}</pre>
|
|
718
718
|
<pre class="hl">${qi(Gi(t.text.replace(/\n$/,``),`python`))}</pre>
|
|
719
|
-
</div>`:j}`}file(e,t=!1,n=!1){let r=`${e.part}|${e.path}`,i=/\.md$/i.test(e.path),a=e.part===`instructions`,o=!i||this.source.has(r),s=e.part===`agent`&&n?t:
|
|
719
|
+
</div>`:j}`}file(e,t=!1,n=!1){let r=`${e.part}|${e.path}`,i=/\.md$/i.test(e.path),a=e.part===`instructions`,o=!i||this.source.has(r),s=e.part===`agent`&&n?t:Cf.has(e.part),c=this.open.has(r)||s&&!this.open.has(`closed:${r}`);return k`<div class="df">
|
|
720
720
|
<div class="df-hd">
|
|
721
721
|
<button type="button" class="df-sum" aria-expanded=${c?`true`:`false`} @click=${()=>{this.open.set(r,!c),this.open.set(`closed:${r}`,c),this.requestUpdate()}}>
|
|
722
722
|
<span class="tag">${e.part}</span><span class="jmono">${e.path}</span>
|
|
@@ -724,8 +724,8 @@ ${t?k`<span class="ct-chip">${E(`Role of this kind`)}</span>`:j}
|
|
|
724
724
|
</button>
|
|
725
725
|
${i?k`<button type="button" class="df-tog" @click=${()=>{this.source.set(r,!this.source.has(r)),this.requestUpdate()}}>${E(o?`Show rendered`:`Show source`)}</button>`:j}
|
|
726
726
|
</div>
|
|
727
|
-
${c?o?k`<pre class="df-text"><code class="hl">${qi(a?(l=e.text,
|
|
728
|
-
</div>`;var l}};U([P({attribute:!1})],
|
|
727
|
+
${c?o?k`<pre class="df-text"><code class="hl">${qi(a?(l=e.text,xf(jr(l))):Gi(e.text,e.path))}</code></pre>`:qi($i(e.text,a?xf:void 0)):j}
|
|
728
|
+
</div>`;var l}};U([P({attribute:!1})],wf.prototype,`definition`,void 0),U([P()],wf.prototype,`memory`,void 0),wf=U([N(`ca-definition`),D()],wf);var Tf=class extends M{constructor(...e){super(...e),this.run=``,this.live=!1,this.journal=[],this.plan=null,this.selected=null,this.defs=[],this.defsRun=``,this.timer=null}static{this.styles=[V,O` :host{display:block;container-type:inline-size;}.defs{display:grid;grid-template-columns:260px minmax(0,1fr);gap:14px;align-items:start;}.deflist{display:flex;flex-direction:column;gap:6px;}.defitem{padding:9px 12px;border-radius:10px;background:var(--panel);border:1px solid var(--line);cursor:pointer;color:inherit;text-align:start;display:flex;flex-direction:column;gap:2px;}.defitem:hover{border-color:var(--line2);}.defitem.sel{border-color:var(--accent);background:var(--accent-bg);}@container (max-width:720px){.defs{grid-template-columns:minmax(0,1fr);}}`]}disconnectedCallback(){super.disconnectedCallback(),this.clearTimer(),this.defsRun=``}connectedCallback(){super.connectedCallback(),this.run&&this.defsRun!==this.run&&this.load()}willUpdate(e){(e.has(`run`)||e.has(`client`))&&this.run&&this.client&&this.defsRun!==this.run&&(this.defs=[],this.load())}updated(){let e=new Set(this.tasks().filter(e=>!C(e)&&(e.tries.length||e.outcome===`running`)).map(e=>e.kind)).size;this.live&&this.defsRun===this.run&&this.defs.length<e&&!this.timer&&(this.timer=setTimeout(()=>{this.timer=null,this.load()},3e3))}tasks(){return[...S(this.journal,this.plan).outcomes.values()]}clearTimer(){this.timer&&clearTimeout(this.timer),this.timer=null}async load(){if(!this.client||!this.run)return;let e=this.run;this.defsRun=e;let t=[];try{t=await this.client.definitions(e)}catch{t=[]}e===this.run&&(this.defs=t)}render(){let e=this.defs,t=this.tasks(),n=[...new Set(t.filter(e=>C(e)).map(e=>e.kind))].filter(t=>!e.some(e=>e.kind===t));if(!e.length&&!n.length)return k`<div class="blank"><span class="ic" aria-hidden="true">⌘</span><b>${this.live?E(`No definitions yet`):E(`No definitions`)}</b></div>`;let r=this.selected!==null&&n.includes(this.selected)?this.selected:null,i=r?void 0:e.find(e=>e.kind===this.selected)??e.find(e=>e.plugin)??e[0],a=r??i?.kind??n[0]??``,o=e=>{let n=t.filter(t=>t.kind===e),r=n.length,i=n.reduce((e,t)=>e+t.tries.length,0);return Qo(E(r===1?`1 task`:T`${r} tasks`),E(i===1?`1 attempt`:T`${i} attempts`))};return k`<div class="defs">
|
|
729
729
|
<div class="deflist">
|
|
730
730
|
${H(e,e=>e.kind,e=>{return k`<button type="button" class="defitem ${e.kind===a?`sel`:``}" aria-current=${e.kind===a?`true`:j} @click=${()=>Q(this,`ca-navigate`,{def:e.kind})}>
|
|
731
731
|
<b class="jmono">${e.kind}</b>
|
|
@@ -743,7 +743,7 @@ ${i.kind}<span class="r">${i.executor===`python`?E(`Python task`):i.plugin?E(T`P
|
|
|
743
743
|
<ca-definition .definition=${i} memory="definition:${i.kind}"></ca-definition>`:k`<h3>${a}<span class="r">${E(`Python task`)}</span></h3>
|
|
744
744
|
<ca-definition .definition=${null}></ca-definition>`}
|
|
745
745
|
</section>
|
|
746
|
-
</div>`}};U([P({attribute:!1})],
|
|
746
|
+
</div>`}};U([P({attribute:!1})],Tf.prototype,`client`,void 0),U([P()],Tf.prototype,`run`,void 0),U([P({type:Boolean})],Tf.prototype,`live`,void 0),U([P({attribute:!1})],Tf.prototype,`journal`,void 0),U([P({attribute:!1})],Tf.prototype,`plan`,void 0),U([P({attribute:!1})],Tf.prototype,`selected`,void 0),U([F()],Tf.prototype,`defs`,void 0),Tf=U([N(`ca-definitions`),D()],Tf);var Ef=class extends M{constructor(...e){super(...e),this.procs=null,this.unresponsive=!1,this.exported=!1}static{this.styles=[V,O` :host{display:block;}.cmd{word-break:break-all;}`]}open(e){Q(this,`ca-open-task`,{key:e})}render(){let e=this.procs;if(!e?.alive){let e=this.exported?Oc():this.unresponsive?ac():E(`not running`);return k`<div class="blank"><span class="ic" aria-hidden="true">⚙</span><b>${K(E(`No processes`),e)}</b></div>`}let t=e.python_tasks;return k`<div class="g12">
|
|
747
747
|
<section class="panel c12">
|
|
748
748
|
<h3 title=${E(`One per task (Backend.run)`)}>${E(`Agent sessions running`)} <span class="r">${e.launches.length}</span></h3>
|
|
749
749
|
${e.launches.length?H(e.launches,e=>e.key,e=>k`<div class="fl" @click=${t=>!t.target.closest(`button`)&&this.open(e.key)}>
|
|
@@ -761,36 +761,36 @@ ${H(t,e=>e.key,e=>k`<div class="fl">
|
|
|
761
761
|
</div>`)}
|
|
762
762
|
</section>`:j}
|
|
763
763
|
<section class="panel c12"><h3>${E(`Process tree`)}</h3><ca-proc-tree .procs=${e}></ca-proc-tree></section>
|
|
764
|
-
</div>`}};U([P({attribute:!1})],
|
|
764
|
+
</div>`}};U([P({attribute:!1})],Ef.prototype,`procs`,void 0),U([P({type:Boolean})],Ef.prototype,`unresponsive`,void 0),U([P({type:Boolean})],Ef.prototype,`exported`,void 0),Ef=U([N(`ca-procs-view`),D()],Ef),z(`cae-column-chart`,ja),z(`cae-line-chart`,Ma),z(`cae-heatmap`,Ia),z(`cae-state-grid`,Wa),z(`cae-bar-chart`,Ga),z(`cae-code`,Yi),z(`cae-tree`,ca);var Df=[`failed`,`attention`,`done`,`running`,`muted`,`neutral`],Of=e=>typeof e._tone==`string`&&Df.includes(e._tone)?e._tone:void 0,kf=new Set([`usd`,`pct`,`duration`,`tokens`,`number`]),Af=e=>typeof e==`string`?e:JSON.stringify(e),jf=[Kr,O` caption{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}tr{column-gap:12px;padding:6px 12px;border-bottom:1px solid var(--line);font-size:12px;min-width:560px;}th,td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}thead tr{color:var(--text-muted);font-size:11px;}tbody [data-align='end']{font-variant-numeric:tabular-nums;}tbody tr[data-tone='failed'],tbody tr[data-tone='attention']{box-shadow:inset 2px 0 0 var(--tone);}td a,th a{color:var(--accent);text-decoration:none;}td a:hover,th a:hover,td a:focus-visible,th a:focus-visible{text-decoration:underline;}`],Mf=class extends M{constructor(...e){super(...e),this.baseUrl=``,this.label=``,this.sorts=new Map,this.picks=new Map}static{this.styles=[V,Gr,O` :host{display:block;}.note{font-size:var(--font-size-sm);color:var(--text-2);line-height:1.55;max-width:78ch;}.note>:first-child{margin-top:0;}.note>:last-child{margin-bottom:0;}.note[data-tone]{padding-left:10px;border-left:3px solid var(--line2);}.note[data-tone='failed']{border-left-color:var(--status-failed);}.note[data-tone='attention']{border-left-color:var(--status-attention);}.note[data-tone='done']{border-left-color:var(--status-done);}.note[data-tone='running']{border-left-color:var(--status-running);}.block + .block{margin-top:18px;}h4{margin:0 0 8px;font-size:var(--font-size-sm);font-weight:600;color:var(--text-2);}details>summary{cursor:pointer;margin-bottom:8px;font-size:var(--font-size-sm);font-weight:600;color:var(--text-2);}details:not([open])>summary{margin-bottom:0;}.block[data-anchor]{scroll-margin-top:12px;}.block[data-anchor]:focus{outline:none;}.pair{display:grid;grid-template-columns:minmax(180px,30%) minmax(0,1fr);gap:12px;align-items:start;}.pair>.tree{border:1px solid var(--line);border-radius:var(--radius-md);max-height:70vh;overflow:auto;}.pane{min-width:0;}@media (max-width:720px){.pair{grid-template-columns:minmax(0,1fr);}.pair>.tree{max-height:40vh;}}.embed{display:block;width:100%;height:calc(100dvh - 160px);min-height:320px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface);}`]}render(){let e=he(this.body);return e?this.draw(e,`0`):k`<cae-json-tree .value=${this.body??{}}></cae-json-tree>`}draw(e,t){let n=this.content(e,t),r=e.anchor||j;return e.title?e.collapsed?k`<details class="block" data-anchor=${r} tabindex=${e.anchor?-1:j}><summary>${e.title}</summary>${n}</details>`:k`<div class="block" data-anchor=${r} tabindex=${e.anchor?-1:j}><h4>${e.title}</h4>${n}</div>`:k`<div class="block" data-anchor=${r} tabindex=${e.anchor?-1:j}>${n}</div>`}code(e,t){return k`<cae-code .code=${e.text} .language=${e.language??``} .start=${e.start??1} .highlight=${e.highlight??[]} .path=${e.path??t??``} .label=${e.title??e.path??t??``} ?wrap=${!!e.wrap} .strings=${{copy:E(`Copy`),copied:E(`Copied`),wrap:E(`Wrap lines`),empty:E(`No text`),cut:(e,t)=>E(T`First ${e.toLocaleString(I())} of ${t.toLocaleString(I())} lines`)}}></cae-code>`}embed(e){let t=new URL(this.baseUrl?this.baseUrl.replace(/\/?$/,`/`):`./`,document.baseURI),n=new URL(e.url,t);return n.searchParams.set(`theme`,function(e){for(let t=e;t;t=t.parentNode??(t instanceof ShadowRoot?t.host:null)){let e=t instanceof Element?t.getAttribute(`data-ca-theme`):null;if(e)return e.includes(`light`)?`light`:`dark`}return matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}(this)),k`<iframe class="embed" src=${n.href} title=${e.title||this.label} style=${e.height?`height:${e.height}px`:j}></iframe>`}tree(e,t){let{items:n,nodes:r,first:i}=function(e){let t=new Map,n=null,r=(e,i)=>e.map(e=>{let a=i?`${i}/${e.name}`:e.name,o=e.id??a;return t.set(o,e),n===null&&e.code&&(n=o),{id:o,name:e.name,icon:e.icon??null,badge:e.badge??null,tone:e.tone??null,open:e.open??!0,selectable:!!e.code||!!e.link,children:e.children?.length?r(e.children,a):null}});return{items:r(e.nodes,``),nodes:t,first:e.selected??n}}(e),a=this.picks.get(t),o=a!==void 0&&r.has(a)?a:i,s=o?r.get(o):void 0,c=[...r.values()].some(e=>e.code),l=k`<cae-tree class="tree" .items=${n} .selected=${s?.code?o:null} .label=${e.title??``} .strings=${{empty:E(`No items`)}} @cae-select=${e=>this.choose(t,e.detail.id,r)}></cae-tree>`;return c?k`<div class="pair">
|
|
765
765
|
${l}
|
|
766
766
|
<div class="pane">${s?.code?this.code(s.code,o??``):k`<div class="meta">${E(`No selection`)}</div>`}</div>
|
|
767
|
-
</div>`:l}choose(e,t,n){let r=t===null?void 0:n.get(t);r&&t!==null&&(r.code?this.picks=new Map(this.picks).set(e,t):r.link&&this.follow(r.link))}follow(e){if(e.anchor){let t=this.renderRoot.querySelector(`[data-anchor="${CSS.escape(e.anchor)}"]`);t?.scrollIntoView?.({block:`start`}),t?.focus({preventScroll:!0});return}let t=e.run?{run:e.run}:{};e.panel?Q(this,`ca-navigate`,{page:``,...t,tab:`panel:${e.panel}`}):e.task&&Q(this,`ca-navigate`,{page:``,...t,tab:`stream`,key:e.task,view:`transcript`,round:null})}content(e,t){let n={empty:E(`No values`),showTable:E(`Show table`),showChart:E(`Show chart`),label:E(`Label`),other:E(`Other`),total:E(`Total`),none:`—`,scale:(e,t)=>E(T`${e} to ${t}`)};switch(e.type){case`blocks`:return k`${e.blocks.map((e,n)=>{let r=he(e);return r?this.draw(r,`${t}.${n}`):k`<div class="block"><cae-json-tree .value=${e}></cae-json-tree></div>`})}`;case`tiles`:return k`<cae-stat-tiles .tiles=${r=e.tiles,r.map(e=>({id:e.id,label:e.label,value:e.value,tone:e.tone??void 0,tip:e.tip??void 0,sub:e.sub??[]}))} .bump=${!1}></cae-stat-tiles>`;case`table`:return this.table(e,t);case`columns`:return k`<cae-column-chart .label=${e.title??``} .x=${e.x} .series=${e.series} ?stacked=${!!e.stacked} .format=${
|
|
767
|
+
</div>`:l}choose(e,t,n){let r=t===null?void 0:n.get(t);r&&t!==null&&(r.code?this.picks=new Map(this.picks).set(e,t):r.link&&this.follow(r.link))}follow(e){if(e.anchor){let t=this.renderRoot.querySelector(`[data-anchor="${CSS.escape(e.anchor)}"]`);t?.scrollIntoView?.({block:`start`}),t?.focus({preventScroll:!0});return}let t=e.run?{run:e.run}:{};e.panel?Q(this,`ca-navigate`,{page:``,...t,tab:`panel:${e.panel}`}):e.task&&Q(this,`ca-navigate`,{page:``,...t,tab:`stream`,key:e.task,view:`transcript`,round:null})}content(e,t){let n={empty:E(`No values`),showTable:E(`Show table`),showChart:E(`Show chart`),label:E(`Label`),other:E(`Other`),total:E(`Total`),none:`—`,scale:(e,t)=>E(T`${e} to ${t}`)};switch(e.type){case`blocks`:return k`${e.blocks.map((e,n)=>{let r=he(e);return r?this.draw(r,`${t}.${n}`):k`<div class="block"><cae-json-tree .value=${e}></cae-json-tree></div>`})}`;case`tiles`:return k`<cae-stat-tiles .tiles=${r=e.tiles,r.map(e=>({id:e.id,label:e.label,value:e.value,tone:e.tone??void 0,tip:e.tip??void 0,sub:e.sub??[]}))} .bump=${!1}></cae-stat-tiles>`;case`table`:return this.table(e,t);case`columns`:return k`<cae-column-chart .label=${e.title??``} .x=${e.x} .series=${e.series} ?stacked=${!!e.stacked} .format=${Cc(e.unit)} .strings=${n}></cae-column-chart>`;case`lines`:return k`<cae-line-chart .label=${e.title??``} .x=${e.x} .series=${e.series} .format=${Cc(e.unit)} .strings=${n}></cae-line-chart>`;case`heatmap`:return k`<cae-heatmap .label=${e.title??``} .x=${e.x} .y=${e.y} .values=${e.values} .format=${Cc(e.unit)} .strings=${n}></cae-heatmap>`;case`hbars`:return k`<cae-bar-chart .label=${e.title??``} .bars=${e.bars.map(e=>({label:e.label,value:e.value,tone:e.tone??void 0}))} .format=${Cc(e.unit)} .strings=${n}></cae-bar-chart>`;case`status_grid`:return k`<cae-state-grid .label=${e.title??``} .x=${e.x} .y=${e.y} .cells=${e.cells} .strings=${n}></cae-state-grid>`;case`note`:return k`<div class="note" data-tone=${e.tone&&e.tone!==`neutral`?e.tone:j}>${qi(Qi(e.text))}</div>`;case`code`:return this.code(e);case`tree`:return this.tree(e,t);case`embed`:return this.embed(e);default:return k`${j}`}var r}table(e,t){let n=(s=e).columns.map((e,t)=>{let n=e.format?kf.has(e.format):s.rows.some(t=>typeof t[e.id]==`number`),r=e.bar?Math.max(0,...s.rows.map(t=>Number(t[e.id])||0)):0;return{id:e.id,header:e.label,tip:e.tip??void 0,align:e.align??(n?`end`:`start`),rowHeader:t===0,compare:(t,n)=>function(e,t){let n=e=>e==null||e===``;return n(e)||n(t)?n(e)===n(t)?0:n(e)?1:-1:typeof e==`number`&&typeof t==`number`?e-t:Af(e).localeCompare(Af(t))}(t[e.id],n[e.id]),text:t=>wc(t[e.id],e.format),cell:t=>{let n=t[e.id],i=wc(n,e.format),a=e.link?function(e){if(typeof e!=`string`||!/^https?:\/\//i.test(e.trim()))return null;try{let t=new URL(e.trim());return t.protocol===`http:`||t.protocol===`https:`?t.href:null}catch{return null}}(t[e.link]):null;return a?k`<a href=${a} target="_blank" rel="noopener noreferrer">${i}</a>`:e.bar&&typeof n==`number`?k`${i}<span class="jdur" aria-hidden="true"><i style="width: ${r>0?100*Math.max(0,n)/r:0}%"></i></span>`:i}}}),r=e.rows,i=new Map(r.map((e,t)=>[e,String(t)])),a=this.sorts.get(t)??null,o=a?function(e,t,n){let r=n&&t.find(e=>e.id===n.id);if(!n||!r)return[...e];let i=n.direction===`desc`?-1:1,{compare:a,text:o}=r,s=(e,t)=>{let n=o?o(e):r.cell(e,t);return typeof n==`number`||typeof n==`string`?n:``};return e.map((e,t)=>({r:e,i:t,v:a?0:s(e,t)})).sort((e,t)=>i*((e,t)=>a?a(e.r,t.r):typeof e.v==`number`&&typeof t.v==`number`?e.v-t.v:String(e.v).localeCompare(String(t.v),void 0,{numeric:!0}))(e,t)||e.i-t.i).map(e=>e.r)}(r,n,a):r;var s;return k`<cae-data-table .columns=${n} .rows=${o} .rowKey=${e=>i.get(e)??``} .rowTone=${Of} .activatable=${!1} .sort=${a} .cellStyles=${jf} .caption=${e.title??``} .strings=${dc(E(`No rows`))} @cae-sort=${e=>this.sorts=new Map(this.sorts).set(t,e.detail)} ></cae-data-table>`}};U([P({attribute:!1})],Mf.prototype,`body`,void 0),U([P({attribute:`base-url`})],Mf.prototype,`baseUrl`,void 0),U([P()],Mf.prototype,`label`,void 0),U([F()],Mf.prototype,`sorts`,void 0),U([F()],Mf.prototype,`picks`,void 0),Mf=U([N(`ca-panel-body`),D()],Mf);var Nf=class extends M{constructor(...e){super(...e),this.name=``,this.baseUrl=``}static{this.styles=[V,O` :host{display:block;}.tab-ic{opacity:1;margin-right:6px;font-size:12px;}.desc{margin:-4px 0 12px;}`]}render(){if(this.data===void 0)return this.panel?k`<div class="blank"><span class="ic" aria-hidden="true">…</span>${E(`Loading…`)}</div>`:k`<div class="blank"><span class="ic" aria-hidden="true">▤</span>${E(T`No custom view named ${this.name}`)}</div>`;let e=this.panel;return k`<section class="panel">
|
|
768
768
|
<h3><span class="tab-ic" aria-hidden="true">${e?.icon||`▤`}</span>${e?.title||this.name}
|
|
769
769
|
<span class="r">${E(`Custom view`)}</span></h3>
|
|
770
770
|
${e?.description?k`<div class="meta desc">${e.description}</div>`:j}
|
|
771
771
|
${he(this.data)?k`<ca-panel-body .body=${this.data} base-url=${this.baseUrl} label=${e?.title||this.name}></ca-panel-body>`:k`<cae-json-tree .value=${this.data}></cae-json-tree>`}
|
|
772
|
-
</section>`}};U([P()],
|
|
773
|
-
`))/^Errors:\s*$/.test(r)?n=!0:n&&r.startsWith(`- `)?t.push(r.slice(2)):n&&r.trim()&&!r.startsWith(`- `)&&(n=!1);return t}z(`cae-transcript`,Jo);var
|
|
774
|
-
`),loadEarlier:e=>E(e===1?`Show 1 earlier line`:T`Show ${e} earlier lines`),newBelow:e=>E(e===1?`Show 1 new event`:T`Show ${e} new events`),newInLatest:e=>E(e===1?`Show 1 new event in the running agent session`:T`Show ${e} new events in the running agent session`),prompt:E(`Prompt`),assistant:E(`Assistant`),reasoning:E(`Reasoning`),characters:e=>E(T`${e} characters`),tool:E(`tool`),results:e=>E(e===1?`1 result`:T`${e} results`),done:E(`done`,{id:`tool-done`}),failed:E(`failed`),running:E(`running`),interrupted:E(`interrupted`),interruptedTip:E(`The run ended before the tool call returned`),query:E(`query`),page:E(`page`),fullText:E(`Full text`),showAll:e=>E(T`Show all (${e} characters)`),showLess:E(`Show less`)}} @cae-section-change=${e=>{e.stopPropagation(),Q(this,`ca-navigate`,{round:e.detail.index===null?null:e.detail.index+1})}} @cae-section-shown=${e=>{e.stopPropagation(),this.shown=e.detail.index}} @cae-load-earlier=${t=>{t.stopPropagation(),this.stream&&e.loadEarlier(this.client??a({baseUrl:this.baseUrl}),this.run,this.stream)}}></cae-transcript>`)}updated(){let{rounds:e}=this.sections(),t=`${this.feed.version}|${this.shown}|${e.length}|${this.rows.length}`;t!==this.lastSent&&(this.lastSent=t,Q(this,`ca-rounds`,{launches:this.feed.model.rounds.map(e=>e.launch),shown:this.shown,rounds:e},{bubbles:!1}))}revealWebSearch(e,t=0){let n=this.feed.model.rounds.flatMap(e=>e.items).filter(t=>t.type===`tool`&&t.query===e)[t],r=n&&this.view?this.view.reveal(n.id):-1;if(!(r<0))return{round:r===this.feed.model.rounds.length-1?null:r+1}}};U([P({attribute:!1})],
|
|
775
|
-
`);return[{label:E(`identity`),value:es(t.map(ws)),tip:n,look:`quiet`}]}function
|
|
772
|
+
</section>`}};U([P()],Nf.prototype,`name`,void 0),U([P({attribute:!1})],Nf.prototype,`panel`,void 0),U([P({attribute:!1})],Nf.prototype,`data`,void 0),U([P({attribute:`base-url`})],Nf.prototype,`baseUrl`,void 0),Nf=U([N(`ca-panel-view`),D()],Nf);var Pf=class{constructor(e){this.host=e,this.value=null,this.error=null,this.token=0}load(e,t,n){let r=++this.token;this.value=null,this.error=null,t&&n&&e&&this.fetch(r,e,t,n)}async fetch(e,t,n,r){let i,a=null;try{i=await t.task(n,r)}catch(e){i=(e=>({key:e,rows:[],launches:[],definition:null,io:{params:{},inputs:[],outputs:[],executor:`agent`,upstream:[],downstream:[]},stream:null}))(r),a=e}e===this.token&&(this.value=i,this.error=a,this.host.requestUpdate())}};function Ff(e){let t=[],n=!1;for(let r of(e||``).split(`
|
|
773
|
+
`))/^Errors:\s*$/.test(r)?n=!0:n&&r.startsWith(`- `)?t.push(r.slice(2)):n&&r.trim()&&!r.startsWith(`- `)&&(n=!1);return t}z(`cae-transcript`,Jo);var If=e=>!!e&&(e.prompt||``).startsWith(`The output file(s) you wrote do not pass their checks.`);function Lf(e,t){let n=new Map(t.filter(e=>e.stop!==`invalid_input`&&e.stop!==`skipped`).map((e,t)=>[t+1,e])),r=[],i=0,a=0,o=0;return e.forEach((e,t)=>{let s=n.get(i)?.hops?.length??1;t>0&&If(e)?a++:t>0&&o+1<s?(o++,a=0):(i++,o=0,a=0);let c=n.get(i)?.hops?.[o],l=c?.model||c?.route||``,u=a?`fixup`:o?`switch`:`try`;r.push({kind:u,tryNo:i,fixupNo:a,hopNo:o,model:l,result:null,rejectedWith:[],switchedStop:``,switchedTo:``,row:null})}),r.forEach((t,i)=>{let a=r[i+1];if(a&&a.tryNo===t.tryNo&&a.hopNo!==t.hopNo)return t.result=`switched`,t.switchedStop=n.get(t.tryNo)?.hops?.[t.hopNo]?.stop??``,void(t.switchedTo=a.model);if(a&&a.tryNo===t.tryNo)return t.result=`rejected`,void(t.rejectedWith=Ff(e[i+1]?.prompt));let o=n.get(t.tryNo)??null;t.row=o,t.result=o?o.ok?`ok`:`failed`:null}),r}var Rf=e=>/\[([\w.-]+)\]/.exec(e)?.[1]??``;function zf(e){let t=/\[([\w.-]+)\]\s*(.*)$/.exec(e);return t?`${t[1]}: ${t[2]}`:e}function Bf(e,t,n=gs(e.tryNo-1)){return t>1?e.fixupNo?K(n,E(T`correction ${e.fixupNo}`)):e.hopNo?K(n,E(`model switch`)):n:e.fixupNo?E(T`Correction ${e.fixupNo}`):e.hopNo?E(`Model switch`):gs(0)}function Vf(e){let t=e.model||E(`model`);return e.switchedTo?E(T`${t}: ${Z(e.switchedStop)} → ${e.switchedTo}`):E(T`${t}: ${Z(e.switchedStop)} → next model`)}var Hf={claude:`Claude Code`,omp:`omp`,codex:`Codex`,opencode:`opencode`,gemini:`Gemini CLI`};function Uf(e){let t=String(e||``).split(`/`).pop()??``;return Hf[t]??t}var Wf=(e,t)=>{let n=e.indexOf(t);return n>=0?e[n+1]??``:``};function Gf(e){let t=e.argv,n=/TELEMETRY [^\n]*role=([\w:-]+)/.exec(e.prompt||``)?.[1];return{agent:Uf(t[0]),model:Wf(t,`--model`)||Wf(t,`-m`),role:n&&n!==`-`?n:``}}function Kf(e){if(!e)return[];let t=[];return e.agent&&t.push({label:E(`coding agent`),value:e.agent,tip:E(`The CLI that ran the task (claude, omp)`)}),e.model&&t.push({label:E(`model`),value:e.model,tip:E(`The model the agent session ran on`),look:`mono`}),e.role&&t.push({label:E(`role`),value:e.role,tip:E(`The agent definition the coding agent ran as (agents/<role>.md)`),look:`quiet`}),t}function qf(e){let t=e.prompt||``,n=e.prompt_truncated||0;return[{id:`cmd`,code:!0,summary:E(`Command line`),text:e.argv.join(` `)},{id:`prompt`,summary:E(n?T`Prompt (${t.length} characters; ${n} characters not saved)`:T`Prompt (${t.length} characters)`),text:t+(n?`\n\n${E(T`(${n} characters not saved)`)}`:``)}]}function Jf(e,t){if(e.result===`rejected`)return{tone:`attention`,title:E(`Output failed checks`),list:e.rejectedWith.map(e=>w(e,t)),note:E(`Sent in the correction prompt`)};if(e.result===`switched`)return{tone:`failed`,title:Vf(e)};if(e.result===`failed`&&e.row){let n=w(e.row.reason,t)||Z(e.row.stop);return{tone:`failed`,title:E(T`Attempt ${e.tryNo} failed: ${n}`)}}}function Yf(e,t,n){let r=t[t.length-1]?.tryNo??1,i=_s(n.rows.filter(f)),a=e.rounds.length-1;return e.rounds.map((e,o)=>{let s=t[o],[c,l,u]=s?function(e,t){switch(e.result){case`ok`:return[`✓`,E(`passed`),E(`Output passed checks`)];case`rejected`:return[`✕`,E(`failed checks`),E(`Output failed checks`)];case`switched`:return[`✕`,Z(e.switchedStop),Vf(e)];case`failed`:return[`✕`,E(`failed`),w(e.row?.reason,t)||Z(e.row?.stop)];default:return[``,``,``]}}(s,n.run):[``,``,``],d=e.who?.model;return{id:e.id,title:s?Bf(s,r,i[s.tryNo-1]):String(o+1),facts:d?[d.replace(/^claude-/,``)]:[],verdict:c?{tone:c===`✓`?`done`:`failed`,text:l,tip:u}:void 0,active:o===a&&n.active,tags:e.launch?Kf(e.who):[],details:e.launch?qf(e.launch):[],items:e.items.map(e=>e.type===`event`?{...e,title:E(`API request sent again`)}:e),footer:s&&Jf(s,n.run)}})}var Xf=/\{\s*"title"\s*:\s*"((?:[^"\\]|\\.)*)"\s*,\s*"url"\s*:\s*"(https?:\/\/[^"\s]+)"/g,Zf=/^\s*\[\d+\]\s+(.+)\n\s*(https?:\/\/\S+)/gm,Qf=/https?:\/\/[^\s"'<>)\]]+/g;function $f(e){let t=e??``,n=[],r=new Set,i=(e,t)=>{r.has(t)||n.length>=20||(r.add(t),n.push({title:e.trim()||t,url:t}))};for(let e of t.matchAll(Xf)){let t=e[1]??``;try{t=JSON.parse(`"${t}"`)}catch{}i(t,e[2]??``)}if(!n.length)for(let e of t.matchAll(Zf))i(e[1]??``,e[2]??``);if(!n.length)for(let e of t.matchAll(Qf))i(``,e[0].replace(/[.,;:!?]+$/,``));return n}var ep=()=>({rounds:[],tools:new Map,next:0}),tp=/session init:.*?model=([\w.\-:]+)/;function np(e){return`i`+e.next++}function rp(e,t){let n={id:`r${e.rounds.length}`,launch:t,who:t?Gf(t):null,items:[]};return e.rounds.push(n),n}function ip(e){return e.rounds[e.rounds.length-1]??rp(e,null)}function ap(e,t){t?e.name=t:e.name||=`tool`,e.icon=(e.name.split(/[_:]/).pop()??``).toLowerCase()}function op(e,t,n){let r=n?e.tools.get(n):void 0;return r||(r={type:`tool`,id:n?`call:${n}`:np(e),call:n,name:``,icon:``,summary:``,intent:``,body:``,output:null,status:`running`},n&&e.tools.set(n,r),t.items.push(r)),r}function sp(e,t){let n=0;for(let i of t){let t=r(i);if(!t)continue;if(t.type===`launch`){rp(e,t),n++;continue}let a=ip(e);switch(t.type){case`message_start`:case`message_end`:if(t.role!==`user`||!t.text)continue;a.items.push({type:`prompt`,id:np(e),text:t.text});break;case`turn_end`:if(!t.thinking)continue;a.items.push({type:`reasoning`,id:np(e),text:t.thinking});break;case`acall`:case`tool_execution_start`:case`tool_execution_update`:{let n=op(e,a,t.call);n.output===null?(ap(n,t.tool),n.summary=ts(t.cmd),n.intent=t.intent||``,n.body=t.cmd||n.body,t.web_query&&(n.query=t.web_query),t.web_fetch&&(n.page=t.web_fetch)):!n.summary&&t.cmd&&(n.summary=ts(t.cmd));break}case`aresult`:case`tool_execution_end`:{let n=op(e,a,t.call);if(n.output!==null&&!t.out)break;ap(n,t.tool),n.status=t.err?`error`:`ok`,!n.summary&&n.body&&(n.summary=ts(n.body)),n.output=t.out||`(no output)`,n.query&&(n.links=$f(n.output));break}case`message_update`:{if(!t.delta)continue;let n=a.items[a.items.length-1];n?.type===`message`?n.text+=t.delta:a.items.push({type:`message`,id:np(e),text:t.delta});break}case`auto_retry_start`:a.items.push({type:`event`,id:np(e),icon:`↻`,title:``,text:t.err??``});break;case`notice`:{let n=tp.exec(t.text||``)?.[1];n&&(a.who??={agent:``,model:``,role:``},a.who.model||(a.who.model=n)),a.items.push({type:`notice`,id:np(e),text:(t.text||``).replace(/\s+/g,` `).trim()});break}}n++}return n}var cp=class{constructor(e){this.host=e,this.model=ep(),this.behind=0,this.count=0,this.ready=!1,this.version=0,this.generation=0,this.loaded=``,this.close=null,e.addController(this)}get tailing(){return this.close!==null}hostDisconnected(){this.stop(),this.loaded=``}stop(){this.close?.(),this.close=null}load(e,t){if(this.stop(),this.loaded=e,this.generation++,this.version++,this.model=ep(),this.behind=0,this.count=0,this.ready=!1,t&&`events`in t)this.count=sp(this.model,t.events),this.ready=!0;else if(t){let e=this.generation;this.close=function(e,t,n,r={}){return s(`${l(r)}/events/stream?run=${c(e)}&key=${c(t)}`,[`stream`],{...n,message:e=>n.message(e.data)},r)}(t.run,t.stream,{message:t=>this.onPage(t,e)},{baseUrl:t.baseUrl})}}append(e){e.length&&(this.count+=sp(this.model,e),this.version++)}onPage(e,t){t===this.generation&&(!this.ready&&e.behind&&(this.behind=e.behind),this.count+=sp(this.model,e.events),this.ready=!0,this.version++,this.host.requestUpdate())}async loadEarlier(e,t,n){let r=this.generation,i=Math.max(0,this.behind-3e3);this.behind=0,this.host.requestUpdate();let a=await e.stream(t,n,i);r===this.generation&&(this.model=ep(),sp(this.model,a.events),this.version++,this.host.requestUpdate())}};function lp(e){return k`<cae-markdown .text=${e} .split=${Sf} .strings=${{showRendered:E(`Show rendered`),showSource:E(`Show source`)}}></cae-markdown>`}z(`cae-markdown`,ta);var up=class extends M{constructor(...e){super(...e),this.events=null,this.run=``,this.stream=null,this.baseUrl=``,this.client=null,this.live=!1,this.round=null,this.rows=[],this.mode=`full`,this.shown=-1,this.feed=new cp(this),this.memory=null,this.drawn=null,this.lastSent=``,this.fed=null}static{this.styles=O` :host{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;position:relative;}:host([mode='none']){display:none;}:host([mode='tabs']){flex:none;}`}get source(){return this.events?`static`:this.run&&this.stream?`${this.run}\n${this.stream}`:``}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.requestUpdate()}willUpdate(e){let t=this.source;if(!e.has(`events`)&&t===this.feed.loaded)return;let n=this.fed,r=this.events;if(this.fed=r,r&&n&&t===this.feed.loaded&&function(e,t){if(e===t||e.length<t.length)return e===t;for(let n=t.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}(r,n))return void this.feed.append(r.slice(n.length));let{run:i,stream:a}=this,o=`transcript:${i}/${a??``}`,s=Yn(this),c=s===Gn?new Zn(`${o}:open`):new Xn(`${o}:open`,this),l=!this.events&&!!a;this.memory={isOpen:e=>c.has(e),setOpen:(e,t)=>c.set(e,t),scroll:()=>l?s.recall(`${o}:scroll`):void 0,setScroll:e=>l&&s.remember(`${o}:scroll`,e)},this.shown=-1,this.feed.load(t,this.events?{events:this.events}:t&&a?{run:i,stream:a,baseUrl:this.baseUrl}:null)}sections(){let e=this.live&&this.feed.tailing,t=[this.feed.version,this.rows,this.run,e,I()];if(this.drawn?.key.every((e,n)=>e===t[n]))return this.drawn;let n=this.feed.model,r=Lf(n.rounds.map(e=>e.launch),this.rows);return this.drawn={key:t,rounds:r,sections:Yf(n,r,{run:this.run,rows:this.rows,active:e})},this.drawn}render(){let e=this.feed,{sections:t}=this.sections();return wo(e.generation,k`<cae-transcript .sections=${t} .shown=${this.round===null?null:this.round-1} ?live=${this.live} .earlier=${e.behind} ?loading=${!e.ready} .count=${e.count} mode=${this.mode} .memory=${this.memory} .markdown=${Qi} .renderDetail=${e=>lp(e.text)} .strings=${{sections:E(`Agent sessions`),sectionsTip:[`${E(`Retry`)}: ${hs()}`,`${E(`Correction`)}: ${Xs()}`,`${E(`Model switch`)}: ${Gs()}`].join(`
|
|
774
|
+
`),loadEarlier:e=>E(e===1?`Show 1 earlier line`:T`Show ${e} earlier lines`),newBelow:e=>E(e===1?`Show 1 new event`:T`Show ${e} new events`),newInLatest:e=>E(e===1?`Show 1 new event in the running agent session`:T`Show ${e} new events in the running agent session`),prompt:E(`Prompt`),assistant:E(`Assistant`),reasoning:E(`Reasoning`),characters:e=>E(T`${e} characters`),tool:E(`tool`),results:e=>E(e===1?`1 result`:T`${e} results`),done:E(`done`,{id:`tool-done`}),failed:E(`failed`),running:E(`running`),interrupted:E(`interrupted`),interruptedTip:E(`The run ended before the tool call returned`),query:E(`query`),page:E(`page`),fullText:E(`Full text`),showAll:e=>E(T`Show all (${e} characters)`),showLess:E(`Show less`)}} @cae-section-change=${e=>{e.stopPropagation(),Q(this,`ca-navigate`,{round:e.detail.index===null?null:e.detail.index+1})}} @cae-section-shown=${e=>{e.stopPropagation(),this.shown=e.detail.index}} @cae-load-earlier=${t=>{t.stopPropagation(),this.stream&&e.loadEarlier(this.client??a({baseUrl:this.baseUrl}),this.run,this.stream)}}></cae-transcript>`)}updated(){let{rounds:e}=this.sections(),t=`${this.feed.version}|${this.shown}|${e.length}|${this.rows.length}`;t!==this.lastSent&&(this.lastSent=t,Q(this,`ca-rounds`,{launches:this.feed.model.rounds.map(e=>e.launch),shown:this.shown,rounds:e},{bubbles:!1}))}revealWebSearch(e,t=0){let n=this.feed.model.rounds.flatMap(e=>e.items).filter(t=>t.type===`tool`&&t.query===e)[t],r=n&&this.view?this.view.reveal(n.id):-1;if(!(r<0))return{round:r===this.feed.model.rounds.length-1?null:r+1}}};U([P({attribute:!1})],up.prototype,`events`,void 0),U([P()],up.prototype,`run`,void 0),U([P({attribute:!1})],up.prototype,`stream`,void 0),U([P({attribute:`base-url`})],up.prototype,`baseUrl`,void 0),U([P({attribute:!1})],up.prototype,`client`,void 0),U([P({type:Boolean})],up.prototype,`live`,void 0),U([P({attribute:!1})],up.prototype,`round`,void 0),U([P({attribute:!1})],up.prototype,`rows`,void 0),U([P({reflect:!0})],up.prototype,`mode`,void 0),U([F()],up.prototype,`shown`,void 0),U([xn(`cae-transcript`)],up.prototype,`view`,void 0),up=U([N(`ca-transcript`),D()],up);var dp=e=>C(e.io)||e.rows.some(C),fp=e=>!dp(e)&&(!!e.stream||e.launches.length>0||e.rows.some(f)),pp=e=>e.live?`running`:e.outcomes.get(e.detail.key)?.outcome??p(void 0,e.detail.rows),mp=(e,t)=>e.detail.io.upstream.find(e=>e.outputs.some(e=>e.path===t)),hp=e=>t=>{let n=mp(e,t);if(!n)return;let r=n.outputs.find(e=>e.path===t);return{name:q(n),written:!!r?.file.exists,outcome:e.outcomes.get(n.key)?.outcome}},gp=e=>vs((e.rounds||1)-1),_p=(e,t)=>k`<a class="lnk" href="#" @click=${n=>{n.preventDefault(),Q(e.host,`ca-open-task`,{key:t.key})}}>${q(t)}</a>`,vp=new Set([`key`,`rows`,`launches`,`stream`,`task_detail_error`,`definition`,`io`,`row_extras`]);function yp(e){for(let t=e.launches.length-1;t>=0;t--){let n=e.launches[t],r=n?Gf(n).model:``;if(r)return r}return``}function bp(e){let t=[...new Set(e.flatMap(e=>[...(e.hops??[]).map(e=>e.credential),e.credential]).filter(e=>!!e))];if(!t.length)return[];let n=[E(`Account or API key the coding agent used (credential)`),...t.map(Ts)].filter(Boolean).join(`
|
|
775
|
+
`);return[{label:E(`identity`),value:es(t.map(ws)),tip:n,look:`quiet`}]}function xp(e,t,n=``,r={}){let i=t===`output`?k`${yl(e.status)}${(e.rounds??0)>1?k` <span class="meta" title=${Xs()}>${Zs(e.rounds,e.status===`valid`)}</span>`:j}`:vl(e),a=k`<div class="io-hd">${r.chip??i}<span class="jmono ct-path" title=${e.path}>${w(e.path,n)}</span></div>${r.origin?k`<div class="meta io-from">${r.origin}</div>`:j}`;if(t===`output`&&e.status===`refused`)return k`<div class="io-card one">${a}<div class="meta">${Qs(e,n,r.producerOf)}</div></div>`;if(t===`output`&&e.status===`failed`&&!e.file.exists)return k`<div class="io-card one">${a}</div>`;let o=e.errors??[];return k`<div class="io-card">
|
|
776
776
|
${a}
|
|
777
|
-
${
|
|
778
|
-
${
|
|
777
|
+
${Tl(e,t)}
|
|
778
|
+
${xl(e)}
|
|
779
779
|
${o.length?k`<h4>${E(`Errors`)}</h4><pre class="ct-err">${o.map(e=>w(e,n)).join(`
|
|
780
780
|
`)}</pre>`:j}
|
|
781
|
-
</div>`}var
|
|
781
|
+
</div>`}var Sp=e=>!e.file.exists||e.status!=null&&e.status!==`valid`,Cp=e=>Zr({text:rs(e),tone:us(e),mark:fs(e)}),wp=O` :host{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;position:relative;container-type:inline-size;}.taskmeta{flex:none;background:linear-gradient(180deg,var(--panel2),var(--panel));border:1px solid var(--line);border-radius:14px;padding:10px 12px;margin-bottom:8px;color:var(--text-2);}.tm-head{display:flex;gap:12px;align-items:center;}.tm-av{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;font-size:16px;flex:none;background:var(--agent-bg);color:var(--agent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--agent) 35%,transparent);}.tm-av.py{background:var(--raise);color:var(--text-muted);box-shadow:none;}.tm-name{font-size:15px;font-weight:600;color:var(--text);display:flex;gap:8px;align-items:center;}.verdict{font-size:12.5px;color:var(--text);margin-top:2px;}.verdict[data-tone='failed'],.verdict[data-tone='attention']{color:var(--tone);}.verdict[data-tone='muted']{color:var(--text-muted);}.whos{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:6px;}.runchips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;}.spend{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:6px;font-size:12px;color:var(--text-muted);font-variant-numeric:tabular-nums;}.spend b{color:var(--text);font-weight:600;}.spend.quota{flex-direction:column;gap:0;}.usage-wrap{overflow-x:auto;margin:4px 0 12px;}.usage{width:auto;border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums;}.usage th{text-align:right;font-weight:600;color:var(--text-muted);font-size:10.5px;white-space:nowrap;padding:6px 14px;border-bottom:1px solid var(--line2);vertical-align:bottom;}.usage td{text-align:right;padding:8px 14px;border-bottom:1px solid var(--line);white-space:nowrap;vertical-align:baseline;}.usage th:first-child,.usage td:first-child{padding-left:4px;}.usage td.l.jmono{font-size:12px;}.usage td.l:not(:first-child):not(.jmono){white-space:normal;min-width:12ch;}.usage th.l,.usage td.l{text-align:left;}.usage tr.hop td{padding-top:4px;padding-bottom:4px;color:var(--text-muted);}.usage tr.hop td:first-child{padding-left:28px;}.runchip{font-size:11px;padding:2px 9px;border-radius:999px;border:1px solid var(--line2);color:var(--text-2);}.runchip.ok>[aria-hidden]{color:var(--status-done);font-weight:700;}.runchip.part{border-color:color-mix(in srgb,var(--status-attention) 45%,transparent);background:var(--status-attention-bg);}.runchip.part>[aria-hidden]{color:var(--status-attention);font-weight:700;}.runchip.bad{border-color:color-mix(in srgb,var(--status-failed) 45%,transparent);color:var(--status-failed);background:var(--status-failed-bg);}.io-fold{margin-top:6px;}.io-fold>summary,.launch>summary{cursor:pointer;color:var(--text-muted);}.searches{margin:4px 0 0;padding-left:22px;}.unread{color:var(--status-attention);margin-top:4px;}.qlink{background:none;border:0;padding:0;color:var(--accent);cursor:pointer;text-align:left;font:inherit;}.qlink:hover{text-decoration:underline;}.tviews{flex:none;display:flex;flex-wrap:wrap;gap:4px;margin:2px 0 8px;border-bottom:1px solid var(--line);}@container (max-width:480px){.tviews{gap:0;}.tview{padding:6px 10px;}}.tview{background:none;border:0;border-bottom:2px solid transparent;color:var(--text-muted);padding:6px 14px;cursor:pointer;}.tview:hover{color:var(--text-2);}.tview.sel{color:var(--text);border-bottom-color:var(--accent);}.tview .badge{margin-left:6px;font-size:10px;padding:0 6px;border-radius:999px;background:var(--raise);color:var(--text-2);}.pane{flex:1 1 auto;min-height:0;overflow:auto;position:relative;}.upstream{margin-bottom:12px;}.up-hd{display:flex;align-items:center;gap:10px;margin:2px 0 6px;}.down{display:flex;flex-wrap:wrap;gap:8px;}.notrans{flex:1 1 auto;border:1px solid var(--line);border-radius:14px;}details.upstream>summary{cursor:pointer;list-style:none;}details.upstream>summary::-webkit-details-marker{display:none;}.params td{vertical-align:top;}.from{color:var(--text-muted);white-space:nowrap;}`,Tp=class extends M{constructor(...e){super(...e),this.baseUrl=``,this.run=``,this.taskKey=null,this.view=`transcript`,this.round=null,this.live=!1,this.journal=[],this.plan=null,this.exported=!1,this.replayMarks=!1,this.detail=new Pf(this),this.launches=[],this.shownRound=-1,this.rounds=[],this.outcomes=new Map}static{this.styles=[V,Dl,Wo,yd,wp]}willUpdate(e){(e.has(`run`)||e.has(`taskKey`)||e.has(`client`))&&(this.detail.load(this.client,this.run,this.taskKey),this.launches=[],this.shownRound=-1,this.rounds=[]),this.outcomes=this.plan?S(this.journal,this.plan).outcomes:new Map}shownView(e){return this.view===`transcript`&&dp(e)&&!e.stream?`output`:this.view}revealSearch(e,t){let n=this.transcriptEl?.revealWebSearch(e,t);Q(this,`ca-navigate`,n?{view:`transcript`,round:n.round}:{view:`transcript`})}render(){let e=this.taskKey;if(!e)return k`<div class="blank"><span class="ic" aria-hidden="true">✦</span><b>${E(`No task selected`)}</b></div>`;let t=this.detail.value;if(!t)return k`<div class="taskmeta meta"><strong>${e}</strong> ${E(`Loading…`)}</div>`;let n={host:this,run:this.run,detail:t,live:t.launches.length>0&&this.live,journal:this.journal,plan:this.plan,outcomes:this.outcomes,launches:this.launches,shownRound:this.shownRound,rounds:this.rounds,exported:this.exported,replayMarks:this.replayMarks},r=this.shownView(t);return k`${function(e,t,n){let r=e.detail,i=e.live,{rows:a,launches:o}=r,s=dp(r),c=fp(r),l=a.slice().sort((e,t)=>String(e.ts).localeCompare(String(t.ts))),d=l[l.length-1],p=o[0],m={agent:Uf(p?.cmd?p.cmd.split(` `)[0]:d?.agent),model:p?.model||d?.model||yp(e),role:p?.role||``},h=c?[...new Set(l.map(e=>e.model).filter(e=>!!e&&e!==m.model))]:[],g=a[0],_=a.filter(f),v=Object.entries(r).filter(([e])=>!vp.has(e)),[y,b]=function(e){let t=e.detail.rows,n=t.filter(f),r=t[t.length-1],i=pp(e);switch(i){case`running`:return[E(`Running`),`neutral`];case`waiting`:{let t=e.plan?.nodes.find(t=>t.key===e.detail.key),n=t?.deferred?Hs(t.deferred_cause,t.deferred,u(e.plan,t.deferred_cause)):``;return n?[E(T`Not run: ${n}`),`attention`]:[E(`Waiting`),`muted`]}case`skipped`:return[E(`Skipped`),`muted`];case`not_started`:{let t=function(e){let t=e.detail,n=ms(e.outcomes.get(t.key)??{attempts:t.rows,cause:null},e.outcomes,e.run,t=>mp(e,t)?.key);if(n)return n;let r=ze(t.rows[t.rows.length-1]?.reason)[0],i=r?mp(e,r.path):void 0;return r?ps(w(r.path,e.run),r.problem,i?{name:q(i)}:void 0):``}(e);return[E(t?T`Not started: ${t}`:`Not started`),`attention`]}case`partial`:{let t=r?.reason&&cs(r.reason)?Z(r.reason):w(r?.reason,e.run);return[E(t?T`Partly done: ${t}`:`Partly done`),`attention`]}case`failed`:{let t=w(r?.reason,e.run)||Z(r?.stop);return[n.length>1?E(T`Failed on all ${n.length} attempts: ${t}`):E(T`Failed: ${t}`),`failed`]}}if(!r)return[rs(i),`neutral`];let a=n.filter(e=>!e.ok);if(a.length){let t=w(a[0]?.reason,e.run)||Z(a[0]?.stop);return[a.length===1?E(T`Done on attempt ${n.length} | 1 failed attempt | first failure: ${t}`):E(T`Done on attempt ${n.length} | ${a.length} failed attempts | first failure: ${t}`),`neutral`]}let o=(r.rounds||1)-1+(r.hook_errors??[]).length;if(o>0){let t=[...(r.hook_errors??[]).flat(),...(r.round_errors??[]).flat(),...e.rounds.flatMap(e=>e.rejectedWith)],n=t[0]?zf(w(t[0],e.run)):``;return n?[E(o===1?T`Done after 1 correction | first failed check: ${n}`:T`Done after ${o} corrections | first failed check: ${n}`),`neutral`]:[E(o===1?`Done after 1 correction`:T`Done after ${o} corrections`),`neutral`]}let s=qs(r.hops,null,r.skipped_hops);return s?[E(T`Done after a model switch: ${s}`),`neutral`]:[E(`Done`),`neutral`]}(e),x=E(s?`Python task`:`Agent task`),S=e.plan?.nodes.find(e=>e.key===r.key);return k`<div class="taskmeta">
|
|
782
782
|
<div class="tm-head">
|
|
783
|
-
${
|
|
783
|
+
${vd(s,x,`tm-av `+(s?`py`:``))}
|
|
784
784
|
<div style="min-width:0">
|
|
785
785
|
<div class="tm-name" title=${t}>${g?q(g):S?q(S):t.replace(/^python:/,``)} ${i?Zr({text:E(`running`),tone:`running`}):j}</div>
|
|
786
786
|
<div class="verdict" data-tone=${L(b)}>${y}</div>
|
|
787
|
-
${S?.claims?.length?k`<div class="meta" title=${
|
|
787
|
+
${S?.claims?.length?k`<div class="meta" title=${fc()}>
|
|
788
788
|
${E(`Locks`)} ${S.claims.map(e=>Zr({text:e}))}
|
|
789
789
|
</div>`:j}
|
|
790
|
-
${S?.priority?k`<div class="meta" title=${
|
|
790
|
+
${S?.priority?k`<div class="meta" title=${zc()}>${Rc(S.priority)}</div>`:j}
|
|
791
791
|
${S?.rerun?k`<div class="meta">${E(T`Ran again after a resume: ${S.rerun}`)}</div>`:j}
|
|
792
792
|
${c?k`<div class="whos">
|
|
793
|
-
${Uo([...
|
|
793
|
+
${Uo([...Kf(m),...bp(_)])}
|
|
794
794
|
${h.length?k`<span class="meta">${E(h.length===1?T`Earlier attempts used model ${h[0]??``}`:T`Earlier attempts used models ${es(h)}`)}</span>`:j}
|
|
795
795
|
</div>`:j}
|
|
796
796
|
${o.length?k`<div class="meta">${o.length===1?E(`1 agent session running`):E(T`${o.length} agent sessions running`)}</div>`:j}
|
|
@@ -798,8 +798,8 @@ ${function(e,t){if(!e)return j;let n=function(e){let t=null;for(let n of e){let
|
|
|
798
798
|
<b title=${E(`Reported by the coding agent`)}>${Y(e.cost)}</b>
|
|
799
799
|
<span>${E(T`Tokens: ${J(e.input)} input, ${J(e.output)} output, ${J(e.cache_read)} cache read, ${J(e.cache_creation)} cache write`)}</span>
|
|
800
800
|
<span>${e.calls===1?E(`1 API call`):E(T`${e.calls} API calls`)}</span>
|
|
801
|
-
${n?k`<span title=${
|
|
802
|
-
${r?k`<span class="tone-text" data-tone="attention" title=${
|
|
801
|
+
${n?k`<span title=${Vc()}>${Hc(n)}</span>`:j}
|
|
802
|
+
${r?k`<span class="tone-text" data-tone="attention" title=${Wc()}>${Uc(r)}</span>`:j}
|
|
803
803
|
</div>`}(De(a),_)}
|
|
804
804
|
${function(e,t){let n=Fe(e.journal.length?e.journal:t),r=t[0],i=t[t.length-1],a=r?Re(r,n).start:null;if(!a||!i)return j;let o=Re(i,n).next;return k`<div class="spend quota">
|
|
805
805
|
<span title=${js(a)}>${E(T`Usage at session start: ${As(a)}`)}</span>
|
|
@@ -807,11 +807,11 @@ ${o?k`<span title=${js(o)}>${E(T`Usage after this task: ${As(o)}`)}</span>`:j}
|
|
|
807
807
|
</div>`}(e,_)}
|
|
808
808
|
</div>
|
|
809
809
|
</div>
|
|
810
|
-
${_.length?k`<div class="runchips">${_s(_).map((t,n)=>function(e,t,n,r,i){let a=t.stop===`partial`?`part`:t.ok?`ok`:`bad`,o=!!e.replayMarks&&!!t.replayed,s=w(t.reason,e.run),c=
|
|
810
|
+
${_.length?k`<div class="runchips">${_s(_).map((t,n)=>function(e,t,n,r,i){let a=t.stop===`partial`?`part`:t.ok?`ok`:`bad`,o=!!e.replayMarks&&!!t.replayed,s=w(t.reason,e.run),c=qs(t.hops,null,t.skipped_hops),l=t.safety_stops?.length?Qc(t.safety_stops.length):``,u=[E(T`Ended ${G(t.ts,!0)}`),gp(t),r&&t.model?E(T`Model ${t.model}`):``,c?E(T`Model switch: ${c}`):``,Hc(t),t.context_warned?Uc(t):``,s,t.route||``,o?rc():``,..._c(t,i).map(([e,t])=>`${e}: ${t}`)].filter(Boolean).join(`
|
|
811
811
|
`),d=t.cost_usd!==null&&t.cost_usd!==void 0?Y(t.cost_usd):``;return k`<span class="runchip ${a}" title=${u}>
|
|
812
|
-
${(e=>e.stop===`partial`?k`<span aria-hidden="true">◌</span><span class="sr">${rs(`partial`)}</span>`:k`<span aria-hidden="true">${e.ok?`✓`:`✕`}</span><span class="sr">${e.ok?E(`passed`):E(`failed`)}</span>`)(t)} ${K(n,Z(t.stop,t.reason),B(t.wall_s),d,l,o?
|
|
812
|
+
${(e=>e.stop===`partial`?k`<span aria-hidden="true">◌</span><span class="sr">${rs(`partial`)}</span>`:k`<span aria-hidden="true">${e.ok?`✓`:`✕`}</span><span class="sr">${e.ok?E(`passed`):E(`failed`)}</span>`)(t)} ${K(n,Z(t.stop,t.reason),B(t.wall_s),d,l,o?nc():``)}
|
|
813
813
|
</span>`}(e,_[n],t,c,r.row_extras??[]))}</div>`:j}
|
|
814
|
-
${function(e,t){let n=e[e.length-1],r=n?
|
|
814
|
+
${function(e,t){let n=e[e.length-1],r=n?_c(n,t):[];if(!r.length)return j;let i=hc();return k`<div class="whos">${Uo(r.map(([e,t])=>({label:e,value:t,tip:i,look:`quiet`})))}</div>`}(_,r.row_extras??[])}
|
|
815
815
|
${function(e,t){let n=e.flatMap(e=>e.web_queries??[]),r=new Map;return n.length?k`<details class="io-fold">
|
|
816
816
|
<summary>${n.length===1?E(`1 web search`):E(T`${n.length} web searches`)}</summary>
|
|
817
817
|
<ol class="meta searches">
|
|
@@ -824,8 +824,8 @@ ${function(e){let t=_s(e),n=e.filter(e=>e.changes).length,r=e.flatMap((e,r)=>{le
|
|
|
824
824
|
<summary title=${E(`Files under the task's declared patterns that its attempts created, modified or deleted (changes)`)}>${i=r.length,E(i===1?`1 changed file`:T`${i} changed files`)}</summary>
|
|
825
825
|
<ul class="meta searches jmono">${r.map(e=>k`<li>${e}</li>`)}</ul>
|
|
826
826
|
</details>`:k`<div class="meta">${E(`No changed files`)}</div>`:j;var i}(_)}
|
|
827
|
-
${function(e){let t=_s(e),n=e.filter(e=>e.safety_stops?.length).length;if(!n)return j;let r=e.flatMap((e,r)=>(e.safety_stops??[]).map(e=>K(n>1?t[r]??``:``,
|
|
828
|
-
<summary title=${
|
|
827
|
+
${function(e){let t=_s(e),n=e.filter(e=>e.safety_stops?.length).length;if(!n)return j;let r=e.flatMap((e,r)=>(e.safety_stops??[]).map(e=>K(n>1?t[r]??``:``,tl(e))));return k`<details class="io-fold">
|
|
828
|
+
<summary title=${$c()}>${Qc(r.length)}</summary>
|
|
829
829
|
<ul class="meta searches">${r.map(e=>k`<li>${e}</li>`)}</ul>
|
|
830
830
|
</details>`}(_)}
|
|
831
831
|
${ns(_)?k`<div class="meta unread" title=${E(`Event types this contraagent version does not know (unread_events)`)}>
|
|
@@ -838,36 +838,36 @@ ${o.map(e=>k`<details class="launch">
|
|
|
838
838
|
</details>`)}
|
|
839
839
|
${v.map(([e,t])=>k`<details class="io-fold"><summary>${e}</summary><cae-json-tree .value=${t}></cae-json-tree></details>`)}
|
|
840
840
|
</div>`}(n,e,(e,t)=>this.revealSearch(e,t))} ${this.renderViews(t,r)}
|
|
841
|
-
${t.stream?k`<ca-transcript .run=${this.run} .stream=${t.stream} base-url=${this.baseUrl} .client=${this.client} .live=${n.live} .rows=${t.rows} .round=${this.round} mode=${r===`transcript`?`full`:r===`input`?`tabs`:`none`} @ca-rounds=${e=>{this.launches=e.detail.launches,this.shownRound=e.detail.shown,this.rounds=e.detail.rounds}}></ca-transcript>`:r===`transcript`?function(e){let t=e.detail,n=
|
|
842
|
-
${t?k`<span>${E(k`Earlier task ${
|
|
843
|
-
${r===`transcript`?j:k`<div class="pane">${this.renderPane(n,r)}</div>`}`}renderViews(e,t){let n=e.io,r=
|
|
841
|
+
${t.stream?k`<ca-transcript .run=${this.run} .stream=${t.stream} base-url=${this.baseUrl} .client=${this.client} .live=${n.live} .rows=${t.rows} .round=${this.round} mode=${r===`transcript`?`full`:r===`input`?`tabs`:`none`} @ca-rounds=${e=>{this.launches=e.detail.launches,this.shownRound=e.detail.shown,this.rounds=e.detail.rounds}}></ca-transcript>`:r===`transcript`?function(e){let t=e.detail,n=pp(e);if(n===`not_started`){let t=function(e){let t=e.detail,n=ze(t.rows[t.rows.length-1]?.reason)[0],r=n?.producer?e.outcomes.get(n.producer):void 0;if(r)return r;let i=n?mp(e,n.path):void 0;if(i)return i;let a=e.outcomes.get(t.key)?.cause;return a?e.outcomes.get(a):void 0}(e);return k`<div class="blank notrans"><span class="ic" aria-hidden="true">⊘</span><b>${K(E(`No transcript`),rs(n))}</b>
|
|
842
|
+
${t?k`<span>${E(k`Earlier task ${dl(e.host,q(t),t)}`)}</span>`:j}</div>`}if(e.exported&&fp(t))return k`<div class="blank notrans"><span class="ic" aria-hidden="true">✦</span><b>${K(E(`No transcript`),Oc())}</b></div>`;if(fp(t))return k`<div class="blank notrans"><span class="ic" aria-hidden="true">✦</span><b>${K(E(`No transcript`),E(`not saved (keep_transcripts = false)`))}</b></div>`;let r=n===`waiting`&&!!e.plan?.nodes.find(e=>e.key===t.key)?.deferred;return k`<div class="blank notrans"><span class="ic" aria-hidden="true">✦</span><b>${K(E(`No transcript`),r?is(n,!1):rs(n))}</b></div>`}(n):j}
|
|
843
|
+
${r===`transcript`?j:k`<div class="pane">${this.renderPane(n,r)}</div>`}`}renderViews(e,t){let n=e.io,r=dp(e)&&!e.stream,i={input:new Set([...n.inputs.map(e=>e.path),...n.upstream.flatMap(e=>e.outputs.map(e=>e.path))]).size+Object.keys(n.params).length,output:n.outputs.length};return k`<div class="tviews" role="tablist">
|
|
844
844
|
${tr.filter(e=>!(r&&e===`transcript`)).map(e=>{let n={transcript:E(`Transcript`),input:E(`Input`),output:E(`Output`,{id:`view-output`}),definition:E(`Definition`)}[e];return k`<button type="button" role="tab" aria-selected=${e===t} class="tview ${e===t?`sel`:``}" @click=${()=>Q(this,`ca-navigate`,{view:e})}>
|
|
845
845
|
${n}${i[e]?k`<span class="badge">${i[e]}</span>`:j}
|
|
846
846
|
</button>`})}
|
|
847
|
-
</div>`}renderPane(e,t){return t===`input`?function(e){let t=e.detail,n=t.io,r=Object.entries(n.params),{files:i,earlier:a}=function(e){let t=new Set(e.inputs.map(e=>e.path)),n=e.inputs.map(t=>{for(let n of e.upstream){let e=n.outputs.find(e=>e.path===t.path);if(e)return{spec:t,from:n,out:e}}return{spec:t,from:null,out:null}}),r=e.upstream.map(e=>({task:e,read:e.outputs.filter(e=>t.has(e.path)).length,rest:e.outputs.filter(e=>!t.has(e.path))})),i=e=>Number(e.task.outputs.some(
|
|
847
|
+
</div>`}renderPane(e,t){return t===`input`?function(e){let t=e.detail,n=t.io,r=Object.entries(n.params),{files:i,earlier:a}=function(e){let t=new Set(e.inputs.map(e=>e.path)),n=e.inputs.map(t=>{for(let n of e.upstream){let e=n.outputs.find(e=>e.path===t.path);if(e)return{spec:t,from:n,out:e}}return{spec:t,from:null,out:null}}),r=e.upstream.map(e=>({task:e,read:e.outputs.filter(e=>t.has(e.path)).length,rest:e.outputs.filter(e=>!t.has(e.path))})),i=e=>Number(e.task.outputs.some(Sp));return{files:n,earlier:[...r].sort((e,t)=>i(t)-i(e))}}(n);return k`<h4 class="sect-h">${E(`Parameters`)}</h4>
|
|
848
848
|
${r.length?k`<table class="ct-fields params">
|
|
849
849
|
${r.map(([t,r])=>{let i=(e=>n.upstream.find(t=>t.outputs.some(t=>t.file.exists&&((e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}})(t.file.content,e))))(r);return k`<tr>
|
|
850
850
|
<td class="jmono">${t}</td>
|
|
851
851
|
<td>${typeof r==`object`&&r?k`<cae-json-tree .value=${r} .open=${0}></cae-json-tree>`:k`<span class="jmono">${(e=>typeof e==`string`?e:JSON.stringify(e)??String(e))(r)}</span>`}</td>
|
|
852
|
-
<td>${i?k`<span class="from">${E(k`From ${
|
|
852
|
+
<td>${i?k`<span class="from">${E(k`From ${_p(e,i)}`)}</span>`:j}</td>
|
|
853
853
|
</tr>`})}
|
|
854
854
|
</table>`:k`<div class="meta">${E(`No parameters`)}</div>`}
|
|
855
855
|
<h4 class="sect-h">${E(`Input files`)}</h4>
|
|
856
|
-
${i.length?i.map(t=>function(e,t){let n=t.from,r=n?e.outcomes.get(n.key)?.outcome:void 0,i=n?k`<span>${E(k`Output of ${
|
|
856
|
+
${i.length?i.map(t=>function(e,t){let n=t.from,r=n?e.outcomes.get(n.key)?.outcome:void 0,i=n?k`<span>${E(k`Output of ${_p(e,n)}`)}</span>${r&&r!==`done`?Cp(r):j}`:E(`File from before the run`),a=t.out?.status;if(!a)return xp(t.spec,`input`,e.run,{origin:i});let o=yl(a);return xp({...t.spec,status:a},`input`,e.run,{origin:i,chip:o})}(e,t)):k`<div class="meta">${E(`No input files`)}</div>`}
|
|
857
857
|
<h4 class="sect-h">${E(`Earlier tasks`)}</h4>
|
|
858
858
|
${a.length?a.map(t=>function(e,t){let n=t.task,r=C(n)?E(`Python task`):E(`Agent task`),i=e.outcomes.get(n.key)?.outcome,a=n.outputs.length,o=a?K(E(a===1?`1 output file`:T`${a} output files`),t.read?t.read===1?E(`1 read by this task`):E(T`${t.read} read by this task`):``):E(`No output files`),s=k`<div class="up-hd">
|
|
859
|
-
${
|
|
860
|
-
${
|
|
861
|
-
${i?
|
|
859
|
+
${vd(C(n),r)}
|
|
860
|
+
${_p(e,n)}
|
|
861
|
+
${i?Cp(i):j}
|
|
862
862
|
<span class="meta">${o}</span>
|
|
863
|
-
</div>`;if(!t.rest.length)return k`<div class="upstream">${s}</div>`;let c=t.rest.map(t=>
|
|
864
|
-
${
|
|
865
|
-
${l?
|
|
866
|
-
${n.outputs.length?n.outputs.map(t=>
|
|
863
|
+
</div>`;if(!t.rest.length)return k`<div class="upstream">${s}</div>`;let c=t.rest.map(t=>xp(t,`output`,e.run,{producerOf:hp(e)}));return t.rest.some(Sp)?k`<div class="upstream">${s}${c}</div>`:k`<details class="upstream"><summary>${s}</summary>${c}</details>`}(e,t)):k`<div class="meta">${E(`No earlier tasks`)}</div>`}
|
|
864
|
+
${dp(t)?j:function(e){let t=e.detail,n=e.launches.length,r=e.shownRound,i=e.rounds[r],a=e.rounds[e.rounds.length-1]?.tryNo??1,o=t.rows.filter(f),s=_s(o),c=le(o),l=e.launches[r]?.prompt??``,u=pp(e);return k`<h4 class="sect-h">${E(`Prompt`)}${n>1&&i?k` <span class="meta">${Bf(i,a,s[i.tryNo-1])}: ${function(e,t=!1){return e.fixupNo?E(`same agent session, after failed checks`):e.hopNo?E(`new agent session on the next model`):e.tryNo>1&&t?E(`new agent session in the resumed run`):e.tryNo>1?E(T`new agent session after attempt ${e.tryNo-1} failed`):E(`first agent session`)}(i,c[i.tryNo-1]!==c[i.tryNo-2])}</span>`:j}</h4>
|
|
865
|
+
${l?lp(l):k`<div class="meta">${t.stream?E(`Loading…`):fp(t)?K(E(`No prompt`),E(`not saved (keep_transcripts = false)`)):K(E(`No prompt`),rs(u))}</div>`}`}(e)}`}(e):t===`output`?function(e){let t=e.detail,n=t.io,r=t.rows[t.rows.length-1];return k`<h4 class="sect-h">${E(`Output files`)}</h4>
|
|
866
|
+
${n.outputs.length?n.outputs.map(t=>xp(t,`output`,e.run,{producerOf:hp(e)})):k`<div class="meta">${E(`No output files`)}</div>`}
|
|
867
867
|
${r?k`<h4 class="sect-h">${E(`Outcome`)}</h4>
|
|
868
868
|
<div class="ct-in">
|
|
869
869
|
${Zr({text:Z(r.stop,r.reason),tone:ls(r.stop)})}
|
|
870
|
-
${f(r)?k`<span class="meta">${K(gs(r.attempt),B(r.wall_s),
|
|
870
|
+
${f(r)?k`<span class="meta">${K(gs(r.attempt),B(r.wall_s),gp(r))}</span>`:j}
|
|
871
871
|
</div>`:j}
|
|
872
872
|
${function(e,t){let n=t.filter(e=>f(e)&&(e.usage||e.cost_usd!==null&&e.cost_usd!==void 0));if(!n.length)return j;let r=k`<td class="jdim">—</td>`,i=Fe(e.journal.length?e.journal:t),a=n.some(e=>(e.quota??[]).length),o=k`<td class="l jdim">—</td>`,s=(e,t)=>e?k`<td class="l" title=${js(e)}>${(e.credential??``)===(t??``)?As(e):Ms(e)}</td>`:o;return k`<h4 class="sect-h">${E(`Tokens and cost`)}</h4>
|
|
873
873
|
<div class="usage-wrap" data-scroll="x"><table class="usage">
|
|
@@ -891,19 +891,19 @@ ${a?k`<td></td><td></td>`:j}
|
|
|
891
891
|
</tr>`):j}`})}
|
|
892
892
|
</table></div>`}(e,t.rows)}
|
|
893
893
|
<h4 class="sect-h">${E(`Later tasks`)}</h4>
|
|
894
|
-
${n.downstream.length?k`<div class="down">${n.downstream.map(t=>
|
|
894
|
+
${n.downstream.length?k`<div class="down">${n.downstream.map(t=>dl(e.host,q(t),t))}</div>`:k`<div class="meta">${E(`No later tasks`)}</div>`}`}(e):(e=>k`<ca-definition .definition=${e.detail.definition??null} memory="task-definition"></ca-definition>`)(e)}};U([P({attribute:!1})],Tp.prototype,`client`,void 0),U([P({attribute:`base-url`})],Tp.prototype,`baseUrl`,void 0),U([P()],Tp.prototype,`run`,void 0),U([P({attribute:!1})],Tp.prototype,`taskKey`,void 0),U([P()],Tp.prototype,`view`,void 0),U([P({attribute:!1})],Tp.prototype,`round`,void 0),U([P({type:Boolean})],Tp.prototype,`live`,void 0),U([P({attribute:!1})],Tp.prototype,`journal`,void 0),U([P({attribute:!1})],Tp.prototype,`plan`,void 0),U([P({type:Boolean})],Tp.prototype,`exported`,void 0),U([P({type:Boolean,attribute:`replay-marks`})],Tp.prototype,`replayMarks`,void 0),U([xn(`ca-transcript`)],Tp.prototype,`transcriptEl`,void 0),U([F()],Tp.prototype,`launches`,void 0),U([F()],Tp.prototype,`shownRound`,void 0),U([F()],Tp.prototype,`rounds`,void 0),Tp=U([N(`ca-task-view`),D()],Tp);var Ep=class extends M{constructor(){super(),new Fr(this)}createRenderRoot(){return this}render(){return new Date().toLocaleTimeString(I(),{hour12:!1})}};Ep=U([N(`ca-clock`),D()],Ep);var Dp=()=>E(`Runs`,{id:`col-runs`}),Op=class extends M{constructor(...e){super(...e),this.hosts=null}static{this.styles=[V,O` :host{display:block;container-type:inline-size;}.g12{align-content:start;}table{width:100%;border-collapse:collapse;font-size:12.5px;}th,td{text-align:start;padding:8px 10px;border-top:1px solid var(--line);vertical-align:baseline;}thead th{border-top:0;font-size:11.5px;font-weight:600;color:var(--text-muted);white-space:nowrap;}tbody th{font-family:var(--mono);font-weight:600;color:var(--text);overflow-wrap:anywhere;}.num{font-family:var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap;}td.runs{color:var(--text-2);}@container (max-width:640px){thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);}tr{display:block;padding:8px 0;border-top:1px solid var(--line);}tbody tr:first-child{border-top:0;}th,td{display:flex;gap:12px;padding:2px 0;border:0;white-space:normal;}td::before{content:attr(data-label);flex:0 0 9em;color:var(--text-muted);font-family:var(--sans);font-size:11.5px;}}`]}row(e){let t=!e.up;return k`<tr>
|
|
895
895
|
<th scope="row">${e.host_id}</th>
|
|
896
|
-
<td data-label=${E(`Status`)}>${Qr({text:
|
|
896
|
+
<td data-label=${E(`Status`)}>${Qr({text:oc(e),tone:t?`attention`:`done`})}</td>
|
|
897
897
|
<td data-label=${E(`Last report`)} class="num" title=${e.last_seen}>${G(e.last_seen,!0)||`—`}</td>
|
|
898
898
|
<td data-label=${E(`Report interval`)} class="num">${e.interval_s==null?`—`:B(e.interval_s)}</td>
|
|
899
|
-
<td data-label=${
|
|
899
|
+
<td data-label=${Dp()} class="runs" ><span>${lc(e.runs)}${e.running?k` | ${E(T`${e.running} running`)}`:j}${e.unresponsive?k` | <span class="tone-text" data-tone="attention">${n=e.unresponsive,E(T`${n} with no report from host`)}</span>`:j}</span></td >
|
|
900
900
|
</tr>`;var n}render(){let e=this.hosts?.hosts??[],t=this.hosts?.quota??[];return k`<div class="g12">
|
|
901
901
|
<section class="panel c12 enter">
|
|
902
|
-
<h3>${E(`Hosts`)}<span class="r">${
|
|
902
|
+
<h3>${E(`Hosts`)}<span class="r">${uc(e)}</span></h3>
|
|
903
903
|
${e.length?k`<table>
|
|
904
904
|
<thead><tr>
|
|
905
905
|
<th scope="col">${E(`Host`)}</th><th scope="col">${E(`Status`)}</th><th scope="col">${E(`Last report`)}</th>
|
|
906
|
-
<th scope="col">${E(`Report interval`)}</th><th scope="col">${
|
|
906
|
+
<th scope="col">${E(`Report interval`)}</th><th scope="col">${Dp()}</th>
|
|
907
907
|
</tr></thead>
|
|
908
908
|
<tbody>${e.map(e=>this.row(e))}</tbody>
|
|
909
909
|
</table>`:k`<div class="meta">${E(`No hosts`)}</div>`}
|
|
@@ -913,7 +913,7 @@ ${t.length?k`<section class="panel c12 enter">
|
|
|
913
913
|
${E(`Subscription usage`)}<span class="r">${E(`Per account, first → last reading`)}</span></h3>
|
|
914
914
|
<ca-quota .accounts=${t} .rests=${t.flatMap(e=>e.rests??[])} live></ca-quota>
|
|
915
915
|
</section>`:j}
|
|
916
|
-
</div>`}};U([P({attribute:!1})],
|
|
916
|
+
</div>`}};U([P({attribute:!1})],Op.prototype,`hosts`,void 0),Op=U([N(`ca-hosts`),D()],Op);var kp=e=>`run-${e}`,Ap=class extends M{constructor(...e){super(...e),this.runs=[],this.current=``,this.open=!1,this.hub=!1,this.hosts=[],this.page=``,this.q=``,this.host=``,this.kb=-1}static{this.styles=[V,O` :host{position:absolute;top:50px;width:min(580px,calc(100cqi - 24px));max-height:min(72vh,660px);display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line2);border-radius:14px;box-shadow:0 24px 70px color-mix(in srgb,var(--shadow) 70%,transparent);opacity:0;transform:translateY(-6px) scale(0.985);pointer-events:none;z-index:40;visibility:hidden;container-type:inline-size;transition:opacity 0.16s var(--ease),transform 0.16s var(--ease),visibility 0s linear 0.16s;}:host([open]){opacity:1;transform:none;pointer-events:auto;visibility:visible;transition-delay:0s;}.search{padding:10px;border-bottom:1px solid var(--line);}input,select{background:var(--well);border:1px solid var(--line);color:var(--text);border-radius:9px;font:inherit;outline:none;}input{width:100%;padding:8px 11px;}input:focus,select:focus{border-color:var(--accent);}.list{overflow:auto;padding:6px;}.group{font-size:11.5px;font-weight:600;color:var(--text-muted);padding:10px 9px 4px;}.group .n{font-weight:400;margin-left:4px;}.keys{margin-top:6px;display:flex;gap:4px;align-items:center;}.item{display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:3px 10px;align-items:center;padding:7px 9px;border-radius:9px;cursor:pointer;}.item:hover,.item.kb{background:var(--raise);}.item.cur{box-shadow:inset 2px 0 0 var(--accent);background:var(--accent-bg);}.nm{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.when{font-size:11px;color:var(--text-muted);white-space:nowrap;}@container (max-width:480px){.when.page{grid-column:2 / 4;white-space:normal;}}.sub{grid-column:2 / 4;display:flex;gap:7px;flex-wrap:wrap;font-size:11px;color:var(--text-muted);}.row{display:flex;gap:8px;}select{max-width:40%;padding:0 8px;}.host{display:flex;gap:8px;flex-wrap:wrap;color:var(--text-2);border-top:1px solid var(--line);margin-top:6px;}.host b{font-family:var(--mono);color:var(--text);}.host .n{margin-left:auto;}.when[data-tone]{color:var(--tone);font-weight:600;}`]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`dialog`),this.setAttribute(`aria-modal`,`true`)}willUpdate(){this.setAttribute(`aria-label`,E(`Runs`))}updated(e){e.has(`open`)&&this.open&&(this.q=``,this.kb=-1,setTimeout(()=>this.input?.focus(),30))}groups(){let e=this.q.toLowerCase().trim(),t=this.runs.filter(t=>(!e||t.run.toLowerCase().includes(e)||(t.run_group||``).toLowerCase().includes(e))&&(!this.host||t.host_id===this.host));if(this.hub)return se(t,this.hosts).map(({hostId:e,host:t,runs:n})=>{let r=e||cc(``),i=t?(e=>!e.up&&e.last_seen?E(T`no report since ${G(e.last_seen,!0)}`):oc(e))(t):``,a=lc(n.length);return[K(r,i,a),k`<b>${r}</b>${t?Qr({text:i,tone:t.up?`done`:`attention`,title:sc(t)}):j}<span class="n">${a}</span>`,n]});let n=e=>!e.running&&(e=>{let t=Date.parse(e.last_ts||``);return Number.isNaN(t)?1/0:(Date.now()-t)/1e3})(e)>=86400;return[[E(`Running`),t.filter(e=>e.running)],[E(`Last 24 hours`),t.filter(e=>!e.running&&!n(e))],[E(`Older`),t.filter(n)]].map(([e,t])=>[e,k`${e} <span class="n">${t.length}</span>`,t])}pick(e){this.close(),typeof e==`string`?e!==this.page&&Q(this,`ca-navigate`,{page:e,run:``}):(e.run!==this.current||this.page)&&Q(this,`ca-select-run`,{run:e.run})}close(){Q(this,`ca-close`,{})}onDialogKey(e){e.key===`Escape`?this.close():e.key===`Tab`&&(e.preventDefault(),(e.target===this.input&&this.hub?this.select:this.input)?.focus())}onKey(e,t){if(e.key===`ArrowDown`)this.kb=Math.min(t.length-1,this.kb+1);else{if(e.key!==`ArrowUp`){if(e.key===`Enter`){e.preventDefault();let n=t[Math.max(0,this.kb)];n!==void 0&&this.pick(n);return}return}this.kb=Math.max(0,this.kb-1)}e.preventDefault(),this.updateComplete.then(()=>this.renderRoot.querySelector(`.item.kb`)?.scrollIntoView({block:`nearest`}))}render(){let e=this.groups().filter(e=>e[2].length),t=e.flatMap(e=>e[2]),n=this.q.trim()?[]:this.hub?[`trends`,`hosts`]:[`trends`],r=[...n,...t],i=r[this.kb]===void 0?j:kp(this.kb),a=k`<input placeholder=${E(`Search runs`)} aria-label=${E(`Search runs`)} autocomplete="off" .value=${this.q} role="combobox" aria-expanded=${r.length?`true`:`false`} aria-controls="runs" aria-autocomplete="list" aria-activedescendant=${i} @input=${e=>{this.q=e.target.value,this.kb=0}} @keydown=${e=>this.onKey(e,r)} />`,o=0;return k`<div class="search" @keydown=${e=>this.onDialogKey(e)}>
|
|
917
917
|
${this.hub?k`<div class="row">${a}${this.hostFilter()}</div>`:a}
|
|
918
918
|
<div class="keys meta" aria-hidden="true"><span class="kbd">↑</span><span class="kbd">↓</span> <span class="kbd">Enter</span> <span class="kbd">Esc</span></div>
|
|
919
919
|
</div>
|
|
@@ -927,16 +927,16 @@ ${n.map(e=>this.item(e,o++))}
|
|
|
927
927
|
</div>`:k`<div class="blank"><span>${E(`No runs match the search`)}</span></div>`}
|
|
928
928
|
</div>`}hostFilter(){return k`<select aria-label=${E(`Host`)} title=${E(`Host`)} @change=${e=>{this.host=e.target.value,this.kb=-1}}>
|
|
929
929
|
<option value="" ?selected=${!this.host}>${E(`All hosts`)}</option>
|
|
930
|
-
${se(this.runs,this.hosts).map(e=>k`<option value=${e.hostId} ?selected=${e.hostId===this.host}>${e.hostId||
|
|
931
|
-
</select>`}counts(e){let t=e.tasks,n=[E(T`${t.done} of ${t.total} tasks done`)];t.failed&&n.push(X(`failed`,t.failed)),t.not_started&&n.push(X(`not_started`,t.not_started)),t.partial&&n.push(X(`partial`,t.partial)),t.skipped&&n.push(X(`skipped`,t.skipped)),t.running&&n.push(X(`running`,t.running)),t.waiting&&n.push(X(`waiting`,t.waiting)),t.not_run&&n.push(X(`not_run`,t.not_run));let r=(e=>ne(e))(e);r!=null&&n.push(E(T`took ${B(r)}`)),e.cost_usd!==null&&e.cost_usd!==void 0&&n.push(Y(e.cost_usd));let i=Ns(e.quota??[]);return i&&n.push(i),K(...n)}when(e){let t=re(e),n=G(e.last_ts,!0),r=t===`unresponsive`;return k`<span class="when" data-tone=${r?`attention`:j} data-mark=${r?`pending`:j} title=${r?K(
|
|
932
|
-
${typeof e==`string`?n===`hosts`?k`<span aria-hidden="true">⊞</span><span class="nm">${E(`Hosts`)}</span><span class="when page">${
|
|
930
|
+
${se(this.runs,this.hosts).map(e=>k`<option value=${e.hostId} ?selected=${e.hostId===this.host}>${e.hostId||cc(``)}</option>`)}
|
|
931
|
+
</select>`}counts(e){let t=e.tasks,n=[E(T`${t.done} of ${t.total} tasks done`)];t.failed&&n.push(X(`failed`,t.failed)),t.not_started&&n.push(X(`not_started`,t.not_started)),t.partial&&n.push(X(`partial`,t.partial)),t.skipped&&n.push(X(`skipped`,t.skipped)),t.running&&n.push(X(`running`,t.running)),t.waiting&&n.push(X(`waiting`,t.waiting)),t.not_run&&n.push(X(`not_run`,t.not_run));let r=(e=>ne(e))(e);r!=null&&n.push(E(T`took ${B(r)}`)),e.cost_usd!==null&&e.cost_usd!==void 0&&n.push(Y(e.cost_usd));let i=Ns(e.quota??[]);return i&&n.push(i),K(...n)}when(e){let t=re(e),n=G(e.last_ts,!0),r=t===`unresponsive`;return k`<span class="when" data-tone=${r?`attention`:j} data-mark=${r?`pending`:j} title=${r?K(sc(ie(this.hosts,e)),E(T`Last activity ${n}`)):n} >${t===`running`?E(`running`):r?ac():Xo(e.last_ts)}</span>`}item(e,t){let n=typeof e==`string`?e:null,r=n?n===this.page:!this.page&&e.run===this.current;return k`<div class=${`item${r?` cur`:``}${t===this.kb?` kb`:``}`} id=${kp(t)} role="option" aria-selected=${t===this.kb?`true`:`false`} aria-current=${r?n?`page`:`true`:j} @click=${()=>this.pick(e)}>
|
|
932
|
+
${typeof e==`string`?n===`hosts`?k`<span aria-hidden="true">⊞</span><span class="nm">${E(`Hosts`)}</span><span class="when page">${uc(this.hosts)}</span>`:k`<span aria-hidden="true">▥</span><span class="nm">${kc()}</span><span class="when page">${Ac()}</span>`:k`<span class="dot" data-tone=${L(os(re(e),e.tasks))} aria-hidden="true"></span><span class="nm" title=${this.hub?e.run:j}>${this.hub?ae(e):e.run}${ic(e)?k` ${Zr({...ic(e),tone:`muted`})}`:j}</span>
|
|
933
933
|
${this.when(e)}
|
|
934
934
|
<span class="sub">
|
|
935
935
|
${e.run_group&&e.run_group!==ae(e)?k`<span>${E(T`Run group ${e.run_group}`)}</span>`:j} <span title=${Ps(e.quota??[])}>${this.counts(e)}</span>
|
|
936
936
|
</span>`}
|
|
937
|
-
</div>`}};function
|
|
938
|
-
${n}<span>${
|
|
939
|
-
</button>`}render(){let e=hr.filter(e=>e===`system`||!gr.includes(e));return k`<button type="button" class="trig" aria-haspopup="menu" aria-expanded=${this.open?`true`:`false`} aria-controls="menu" title=${E(T`Theme: ${
|
|
937
|
+
</div>`}};function jp(e){return e===`system`?E(`System`):e===`high-contrast`?E(`High contrast`):vr[e].label}U([P({attribute:!1})],Ap.prototype,`runs`,void 0),U([P()],Ap.prototype,`current`,void 0),U([P({type:Boolean,reflect:!0})],Ap.prototype,`open`,void 0),U([P({type:Boolean})],Ap.prototype,`hub`,void 0),U([P({attribute:!1})],Ap.prototype,`hosts`,void 0),U([P()],Ap.prototype,`page`,void 0),U([F()],Ap.prototype,`q`,void 0),U([F()],Ap.prototype,`host`,void 0),U([F()],Ap.prototype,`kb`,void 0),U([xn(`input`)],Ap.prototype,`input`,void 0),U([xn(`select`)],Ap.prototype,`select`,void 0),Ap=U([N(`ca-run-picker`),D()],Ap);var Mp=class extends M{constructor(...e){super(...e),this.value=`contraagent-dark`,this.system=`contraagent-dark`,this.open=!1,this.onDocDown=e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)}}static{this.styles=[V,O` :host{position:relative;display:inline-flex;}.trig{display:inline-flex;align-items:center;gap:6px;background:none;border:1px solid var(--line);border-radius:999px;padding:2px 10px 2px 7px;font-size:11px;color:var(--text-muted);cursor:pointer;}.trig:hover,.trig[aria-expanded='true']{color:var(--text);border-color:var(--line2);}.trig svg{width:13px;height:13px;}.menu{position:absolute;right:0;top:calc(100% + 8px);min-width:236px;padding:6px;z-index:50;background:var(--panel);border:1px solid var(--line2);border-radius:12px;box-shadow:0 18px 48px color-mix(in srgb,var(--shadow) 65%,transparent);animation:enter 0.16s var(--ease) both;}.grp{font-size:11px;color:var(--text-muted);padding:8px 9px 4px;}[role='separator']{height:1px;background:var(--line);margin:6px 4px;}.item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;background:none;border:0;border-radius:8px;padding:6px 9px;text-align:left;cursor:pointer;color:var(--text-2);font-size:12px;}.item:hover{background:var(--raise);color:var(--text);}.item:focus-visible{outline-offset:-2px;}.item[aria-checked='true']{background:var(--accent-bg);color:var(--text);font-weight:600;}.item .meta{font-weight:400;}.item .sub{display:block;}.rd{width:12px;height:12px;border-radius:50%;border:1.5px solid var(--line2);display:grid;place-items:center;}[aria-checked='true'] .rd{border-color:var(--accent);}[aria-checked='true'] .rd::after{content:'';width:6px;height:6px;border-radius:50%;background:var(--accent);}.sw{display:inline-flex;gap:2px;align-items:flex-end;width:30px;height:18px;border-radius:5px;border:1px solid;padding:3px 4px;}.sw i{flex:1;height:4px;border-radius:2px;}.sw i:first-child{height:8px;}.sw.split{padding:0;overflow:hidden;gap:0;}.sw.split>span{flex:1;height:100%;display:flex;gap:2px;align-items:flex-end;padding:3px 2px;}`]}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`pointerdown`,this.onDocDown)}items(){return[...this.renderRoot.querySelectorAll(`.item`)]}updated(e){e.has(`open`)&&(this.open?document.addEventListener(`pointerdown`,this.onDocDown):document.removeEventListener(`pointerdown`,this.onDocDown)),e.has(`open`)&&this.open&&(this.items().find(e=>e.getAttribute(`aria-checked`)===`true`)??this.items()[0])?.focus()}close(e){this.open=!1,e&&this.trig?.focus()}choose(e){this.value=e,Q(this,`ca-choose-theme`,{theme:e}),this.close(!0)}onTrigKey(e){e.key!==`ArrowDown`&&e.key!==`ArrowUp`||(e.preventDefault(),this.open=!0)}onMenuKey(e){let t=this.items(),n=t.indexOf(e.composedPath()[0]),r=e=>t[(e+t.length)%t.length]?.focus();if(e.key===`ArrowDown`)r(n+1);else if(e.key===`ArrowUp`)r(n-1);else if(e.key===`Home`)r(0);else if(e.key===`End`)r(t.length-1);else{if(e.key!==`Escape`)return e.key===`Tab`?void(this.open=!1):void 0;this.close(!0)}e.preventDefault(),e.stopPropagation()}item(e){let t=e===this.value,n=e===`system`?k`<span class="sw split" style="border-color:${vr[`contraagent-dark`].tokens.line2}" ><span style="background:${vr[`contraagent-dark`].tokens.card}"><i style="background:${vr[`contraagent-dark`].tokens.accent}"></i></span ><span style="background:${vr[`contraagent-light`].tokens.card}"><i style="background:${vr[`contraagent-light`].tokens.accent}"></i></span ></span>`:(e=>{let t=vr[e].tokens;return k`<span class="sw" style="background:${t.card};border-color:${t.line2}" ><i style="background:${t.accent}"></i><i style="background:${t[`code-string`]}"></i><i style="background:${t[`code-keyword`]}"></i ></span>`})(e);return k`<button type="button" class="item" role="menuitemradio" aria-checked=${t?`true`:`false`} tabindex="-1" data-theme=${e} @click=${()=>this.choose(e)}>
|
|
938
|
+
${n}<span>${jp(e)}${e===`system`?k`<span class="meta sub">${vr[this.system].label}</span>`:j}</span><span class="rd" aria-hidden="true"></span>
|
|
939
|
+
</button>`}render(){let e=hr.filter(e=>e===`system`||!gr.includes(e));return k`<button type="button" class="trig" aria-haspopup="menu" aria-expanded=${this.open?`true`:`false`} aria-controls="menu" title=${E(T`Theme: ${jp(this.value)}`)} @click=${()=>this.open=!this.open} @keydown=${e=>this.onTrigKey(e)}>
|
|
940
940
|
<svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.25" fill="none" stroke="currentColor" stroke-width="1.5" /><path d="M8 1.75a6.25 6.25 0 0 1 0 12.5z" fill="currentColor" /></svg>
|
|
941
941
|
${E(`Theme`)}
|
|
942
942
|
</button>
|
|
@@ -947,18 +947,18 @@ ${e.map(e=>this.item(e))}
|
|
|
947
947
|
<div class="grp" id="grp-editor">${E(`Editor themes`)}</div>
|
|
948
948
|
${gr.map(e=>this.item(e))}
|
|
949
949
|
</div>
|
|
950
|
-
</div>`:j}`}};U([P()],
|
|
950
|
+
</div>`:j}`}};U([P()],Mp.prototype,`value`,void 0),U([P()],Mp.prototype,`system`,void 0),U([F()],Mp.prototype,`open`,void 0),U([xn(`.trig`)],Mp.prototype,`trig`,void 0),Mp=U([N(`ca-theme-switch`),D()],Mp);var Np=e=>(e.input??0)+(e.output??0)+(e.cache_read??0)+(e.cache_creation??0);function Pp(e,t){if(!e.totals.runs)return[];let n=Pc(),r=e.period.days.map(e=>jc(e,t)),i=[],a=function(e){let t=new Map;for(let n of[...e.quota,...e.rests]){let e=n.credential??``;if(!n.account)continue;let r=t.get(e)??new Set;r.add(n.account),t.set(e,r)}return(e,n)=>{let r=e??``,i=ws(r)||r||`—`;return n&&(t.get(r)?.size??0)>1?`${i} | ${ks(n)}`:i}}(e),o=e.totals,s=e.daily.filter(e=>Object.keys(e.cost_usd).length).length;var c,l;i.push({id:`totals`,wide:!0,body:{type:`tiles`,collapsed:!1,tiles:[{id:`runs`,label:n.runs,value:String(o.runs),sub:[]},{id:`attempts`,label:n.attempts,value:String(o.attempts),sub:[[(l=o.attempts?`${Math.round(o.ok/o.attempts*100)}%`:`—`,E(T`Done ${l}`)),...o.partial?[X(`partial`,o.partial)]:[]]]},{id:`cost`,label:n.cost,value:o.cost_usd==null?`—`:Y(o.cost_usd),sub:s&&o.cost_usd!=null?[[(c=Y(o.cost_usd/s),E(T`${c} a day`))]]:[]},{id:`tokens`,label:n.tokens,value:J(Np(o.tokens)),sub:[[`${n.input} ${J(o.tokens.input)} | ${n.output} ${J(o.tokens.output)}`]]},{id:`time`,label:n.time,value:B(o.wall_s),sub:[]}]}});let u=[...new Set(e.daily.flatMap(e=>Object.keys(e.cost_usd)))].map(t=>({s:t,total:e.daily.reduce((e,n)=>e+(n.cost_usd[t]??0),0)})).sort((e,t)=>t.total-e.total).map(e=>e.s);i.push({id:`cost-by-day`,wide:!0,body:{type:`columns`,collapsed:!1,title:n.costByDay,x:r,unit:`usd`,stacked:!0,series:u.map(t=>({name:t,values:e.daily.map(e=>e.cost_usd[t]??null)}))}});let d=(t,r,i,a)=>({id:t,wide:!0,body:{type:`table`,collapsed:a,title:r,columns:[{id:`kind`,label:n.kind},...e.kinds.some(e=>e.group&&e.group!==e.kind)?[{id:`group`,label:n.group}]:[],{id:`tasks`,label:n.tasks,align:`end`,format:`number`},{id:`passed`,label:n.tasksDone,align:`end`,format:`pct`},...i.some(e=>e.tasks_partial)?[{id:`partial`,label:n.partial,align:`end`,format:`number`}]:[],{id:`attempts`,label:n.attempts,align:`end`,format:`number`},{id:`median`,label:n.medianTime,align:`end`,format:`duration`},{id:`wall`,label:n.totalTime,align:`end`,format:`duration`},{id:`tokens`,label:n.tokens,align:`end`,format:`tokens`},{id:`cost`,label:n.cost,align:`end`,format:`usd`,bar:!0}],rows:[...i].sort((e,t)=>(t.cost_usd??0)-(e.cost_usd??0)||t.attempts-e.attempts).map(e=>({kind:e.kind,group:e.group,tasks:e.tasks,passed:e.tasks?e.tasks_ok/e.tasks:null,partial:e.tasks_partial??0,attempts:e.attempts,median:e.wall_s_median,wall:e.wall_s,tokens:Np(e.tokens),cost:e.cost_usd,...e.tasks_ok<e.tasks?{_tone:`attention`}:{}}))}}),f=e.kinds.filter(e=>e.executor!==`python`),p=e.kinds.filter(e=>e.executor===`python`);f.length&&i.push(d(`kinds`,n.kinds,f,!1)),p.length&&i.push(d(`python-kinds`,Fc(n.pythonKinds,p.length),p,f.length>0)),e.models.length&&i.push({id:`models`,wide:!0,body:{type:`table`,collapsed:!1,title:n.models,columns:[{id:`model`,label:n.model},{id:`sessions`,label:n.sessions,align:`end`,format:`number`},{id:`calls`,label:n.calls,align:`end`,format:`number`},{id:`input`,label:n.input,align:`end`,format:`tokens`},{id:`output`,label:n.output,align:`end`,format:`tokens`},{id:`cache_read`,label:n.cacheRead,align:`end`,format:`tokens`},{id:`cache_write`,label:n.cacheWrite,align:`end`,format:`tokens`},{id:`cost`,label:n.cost,align:`end`,format:`usd`,bar:!0},{id:`wall`,label:n.time,align:`end`,format:`duration`},...e.models.some(e=>e.peak_context!=null)?[{id:`peak`,label:Bc(),align:`end`,format:`tokens`,tip:Vc()}]:[]],rows:e.models.map(e=>{return{model:(t=e.agent,n=e.model,t?`${n||`—`} | ${t}`:n||`—`),sessions:e.sessions,calls:e.calls,input:e.input,output:e.output,cache_read:e.cache_read,cache_write:e.cache_creation,cost:e.cost_usd,wall:e.wall_s,peak:e.peak_context??null};var t,n})}}),e.quota.length&&i.push({id:`usage`,wide:!0,body:{type:`lines`,collapsed:!1,title:n.usage,x:r,unit:`pct`,series:e.quota.map(e=>({name:Lc(a(e.credential,e.account),Os(e.window)),values:e.daily_peak.map(e=>e==null?null:e/100)}))}});let m=e.stops.filter(e=>e.stop!==`completed`&&e.stop!==`skipped`);return m.length&&i.push({id:`outcomes`,body:{type:`table`,collapsed:!1,title:n.outcomes,columns:[{id:`outcome`,label:n.outcome},{id:`attempts`,label:n.attempts,align:`end`,format:`number`,bar:!0},{id:`kinds`,label:n.kinds}],rows:m.map(e=>({outcome:Z(e.stop),attempts:e.attempts,kinds:Object.entries(e.kinds).sort((e,t)=>t[1]-e[1]).map(([e,t])=>`${e} ${t}`).join(` | `),_tone:`failed`}))}}),e.denials.length&&i.push({id:`denials`,body:{type:`table`,collapsed:!1,title:n.denials,columns:[{id:`tool`,label:n.tool},{id:`count`,label:n.toolCalls,align:`end`,format:`number`,bar:!0},{id:`kinds`,label:n.kinds}],rows:e.denials.map(e=>({tool:e.tool,count:e.count,kinds:Object.entries(e.kinds).map(([e,t])=>`${e} ${t}`).join(` | `)}))}}),e.safety_stops.length&&i.push({id:`safety-stops`,body:{type:`table`,collapsed:!1,title:Zc(),columns:[{id:`part`,label:E(`Stopped part`),tip:$c()},{id:`model`,label:n.model},{id:`count`,label:Zc(),align:`end`,format:`number`,bar:!0},{id:`kinds`,label:n.kinds}],rows:e.safety_stops.map(e=>({part:el(e.part),model:e.model||`—`,count:e.count,kinds:Object.entries(e.kinds).sort((e,t)=>t[1]-e[1]).map(([e,t])=>`${e} ${t}`).join(` | `)}))}}),e.deferred.length&&i.push({id:`deferred`,body:{type:`table`,collapsed:e.deferred.length>20,title:Fc(n.deferred,e.deferred.length),columns:[{id:`when`,label:n.when,format:`datetime`},{id:`task`,label:n.task},{id:`cause`,label:n.cause},{id:`run`,label:n.run}],rows:[...e.deferred].sort((e,t)=>t.ts.localeCompare(e.ts)).map(e=>({when:e.ts,task:e.key,cause:e.cause===`rest`?Ic(e.reason):Hs({cause:e.cause},e.reason),run:e.run,_tone:`attention`}))}}),e.rests.length&&i.push({id:`rests`,body:{type:`table`,collapsed:!1,title:n.rests,columns:[{id:`when`,label:n.when,format:`datetime`},{id:`identity`,label:n.identity},{id:`event`,label:n.event},{id:`run`,label:n.run}],rows:[...e.rests].sort((e,t)=>(t.ts??``).localeCompare(e.ts??``)).map(e=>{return{when:e.ts,identity:a(e.credential,e.account),event:(t=e.event,t===`end`?E(`ended`):t===`start`?E(`started`):t||`—`),run:e.run};var t})}}),e.starts.counts.some(e=>e.some(e=>e>0))&&i.push({id:`starts`,wide:!0,body:{type:`heatmap`,collapsed:!1,title:n.starts,x:e.starts.hours.map(e=>String(e).padStart(2,`0`)),y:Nc(t),values:e.starts.counts.map(e=>e.map(e=>e||null)),unit:`number`}}),i.push({id:`runs`,wide:!0,body:{type:`table`,collapsed:!1,title:n.runs,columns:[{id:`run`,label:n.run},{id:`started`,label:n.started,format:`datetime`},{id:`attempts`,label:n.attempts,align:`end`,format:`number`},{id:`passed`,label:n.done,align:`end`,format:`pct`},...e.runs.some(e=>e.partial)?[{id:`partial`,label:n.partial,align:`end`,format:`number`}]:[],{id:`cost`,label:n.cost,align:`end`,format:`usd`,bar:!0},{id:`wall`,label:n.time,align:`end`,format:`duration`}],rows:e.runs.map(e=>({run:e.run,started:e.started_at||null,attempts:e.attempts,passed:e.attempts?e.ok/e.attempts:null,partial:e.partial??0,cost:e.cost_usd,wall:e.wall_s,...e.ok<e.attempts?{_tone:`attention`}:{}}))}}),i}var Fp=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`;function Ip(e,t){let n=new Date(`${e}T00:00:00Z`);return n.setUTCDate(n.getUTCDate()-t),n.toISOString().slice(0,10)}function Lp(e,t=new Date){let n=e.tz||Fp();return{...e.days===0&&e.from&&e.to?{from:e.from,to:e.to}:(()=>{let r=function(e,t=new Date){try{return new Intl.DateTimeFormat(`en-CA`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(t)}catch{return t.toISOString().slice(0,10)}}(n,t);return{from:Ip(r,Math.max(1,e.days)-1),to:r}})(),tz:n,...e.group?{run_group:e.group}:{}}}var Rp=e=>[``,...new Set(e.filter(e=>e.scope===`trends`&&e.tab).map(e=>e.tab))],zp=class extends M{constructor(...e){super(...e),this.view=null,this.days=14,this.from=``,this.to=``,this.tz=``,this.group=``,this.groups=[],this.panels=[],this.exported=!1,this.tab=``,this.tabFocus=new mi(this,{items:()=>[...this.renderRoot.querySelectorAll(`[role="tab"]`)],layout:`horizontal`,wrap:!0})}static{this.styles=[V,O` :host{display:block;}.controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin-bottom:14px;}.controls label{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--text-muted);}input,select{background:var(--well);border:1px solid var(--line);color:var(--text);border-radius:8px;font:inherit;font-size:12px;padding:4px 8px;}input:focus-visible,select:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;}.period{font-size:12px;color:var(--text-2);}.loading{font-size:12px;color:var(--text-muted);}.err{font-size:12px;color:var(--status-failed);}.wide{margin-bottom:14px;}.pairs{columns:2 440px;column-gap:14px;margin-bottom:14px;}.pairs>.panel{break-inside:avoid;margin-bottom:14px;}.panel{display:block;}.tabs{display:flex;flex-wrap:wrap;gap:2px;border-bottom:1px solid var(--line);margin-bottom:14px;}.tab{background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;padding:8px 14px 9px;color:var(--text-muted);font:inherit;font-weight:500;cursor:pointer;white-space:nowrap;}.tab:hover{color:var(--text-2);}.tab[aria-selected='true']{color:var(--text);font-weight:600;border-bottom-color:var(--accent);}.tab:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:-2px;}`]}go(e){Q(this,`ca-navigate`,e)}render(){let e=this.view,t=this.panels.filter(e=>e.scope===`trends`),n=Rp(t),r=n.includes(this.tab)?this.tab:``,i=t.filter(e=>(e.tab??``)===r),a=r?this.trendPanels(i,e?.panels??{},!1):this.trends(i);return k`<h2 class="sr">${kc()}</h2>
|
|
951
951
|
${this.controls()}
|
|
952
952
|
${e?.error?k`<p class="err" role="alert">${E(`No answer from the monitor`)} | ${e.error.message}</p>`:j}
|
|
953
|
-
${n.length>1?k`${this.tabList(n,r)}<div role="tabpanel" id="trends-tabpanel" aria-labelledby=${`trends-tab-${n.indexOf(r)}`}>${a}</div>`:a}`}tabList(e,t){return k`<div class="tabs" role="tablist" aria-label=${
|
|
953
|
+
${n.length>1?k`${this.tabList(n,r)}<div role="tabpanel" id="trends-tabpanel" aria-labelledby=${`trends-tab-${n.indexOf(r)}`}>${a}</div>`:a}`}tabList(e,t){return k`<div class="tabs" role="tablist" aria-label=${kc()}>
|
|
954
954
|
${e.map((e,n)=>k`<button type="button" role="tab" class="tab" id=${`trends-tab-${n}`} aria-selected=${e===t?`true`:`false`} aria-controls="trends-tabpanel" @click=${()=>e!==t&&Q(this,`ca-navigate`,{trendsTab:e})}>${e||E(`Summary`)}</button>`)}
|
|
955
|
-
</div>`}updated(){let e=
|
|
955
|
+
</div>`}updated(){let e=Rp(this.panels);this.tabFocus.set(Math.max(0,e.indexOf(this.tab)))}trends(e){let t=this.view,n=t?.data??null,r=n?Pp(n,I()):[],i=r.filter(e=>e.wide),a=r.filter(e=>!e.wide),o=[`totals`,`cost-by-day`,`kinds`,`python-kinds`,`models`,`usage`],s=i.filter(e=>o.includes(e.id)),c=i.filter(e=>!o.includes(e.id)),l=(e,t)=>k`<section class="panel" data-section=${t}><ca-panel-body .body=${e}></ca-panel-body></section>`;return k`${!n&&t?.loading?k`<p class="loading">${E(`Loading…`)}</p>`:j}
|
|
956
956
|
${n&&!r.length?k`<div class="blank small"><span>${E(`No runs in this period`)}</span></div>`:j}
|
|
957
957
|
${H(s,e=>e.id,e=>k`<div class="wide">${l(e.body,e.id)}</div>`)}
|
|
958
958
|
${a.length?k`<div class="pairs">${H(a,e=>e.id,e=>l(e.body,e.id))}</div>`:j}
|
|
959
959
|
${H(c,e=>e.id,e=>k`<div class="wide">${l(e.body,e.id)}</div>`)}
|
|
960
|
-
${this.trendPanels(e,t?.panels??{},!0)}`}controls(){let e=this.view?.data,t=e?k`<span class="period">${function(e,t,n,r=I()){let i=t.slice(0,4);return E(T`${
|
|
961
|
-
<cae-segmented label=${E(`Period`)} .value=${n} .options=${[...nr.map(e=>({value:String(e),label:
|
|
960
|
+
${this.trendPanels(e,t?.panels??{},!0)}`}controls(){let e=this.view?.data,t=e?k`<span class="period">${function(e,t,n,r=I()){let i=t.slice(0,4);return E(T`${jc(e,r)} to ${jc(t,r)}, ${i} | ${n}`)}(e.period.from,e.period.to,e.period.tz)}</span>`:j;if(this.exported)return k`<div class="controls"><span class="meta">${E(`Period of this export`)}</span>${t}</div>`;let n=this.days?String(this.days):`dates`,r=e?.period.to||new Date().toISOString().slice(0,10),i=[...new Set([this.tz,Intl.DateTimeFormat().resolvedOptions().timeZone,`UTC`].filter(Boolean))];return k`<div class="controls">
|
|
961
|
+
<cae-segmented label=${E(`Period`)} .value=${n} .options=${[...nr.map(e=>({value:String(e),label:Mc(e)})),{value:`dates`,label:E(`Dates`)}]} @cae-change=${e=>e.detail.value===`dates`?this.go({days:0,from:this.from||Ip(r,(this.days||14)-1),to:this.to||r}):this.go({days:Number(e.detail.value),from:``,to:``})}></cae-segmented>
|
|
962
962
|
${this.days===0?k`<label>${E(`From`)} <input type="date" .value=${this.from} max=${this.to||j} @change=${e=>this.go({days:0,from:e.target.value,to:this.to})} /></label>
|
|
963
963
|
<label>${E(`To`)} <input type="date" .value=${this.to} min=${this.from||j} @change=${e=>this.go({days:0,from:this.from,to:e.target.value})} /></label>`:j}
|
|
964
964
|
<label>${E(`Time zone`)}
|
|
@@ -972,11 +972,11 @@ ${this.groups.map(e=>k`<option value=${e} ?selected=${e===this.group}>${e}</opti
|
|
|
972
972
|
</select></label>`:j}
|
|
973
973
|
${t}
|
|
974
974
|
${this.view?.loading&&e?k`<span class="loading" aria-live="polite">${E(`Loading…`)}</span>`:j}
|
|
975
|
-
</div>`}trendPanels(e,t,n){return e.length?k`${n?k`<h3 class="sect-h">${
|
|
975
|
+
</div>`}trendPanels(e,t,n){return e.length?k`${n?k`<h3 class="sect-h">${Pc().trendPanels}</h3>`:j}
|
|
976
976
|
${e.map(e=>k`<section class="panel wide" data-panel=${e.name}>
|
|
977
977
|
<h3>${e.icon} ${e.title||e.name}${e.description?k`<span class="r">${e.description}</span>`:j}</h3>
|
|
978
978
|
${t[e.name]?k`<ca-panel-body .body=${t[e.name]}></ca-panel-body>`:k`<p class="loading">${E(`Loading…`)}</p>`}
|
|
979
|
-
</section>`)}`:j}};U([P({attribute:!1})],
|
|
979
|
+
</section>`)}`:j}};U([P({attribute:!1})],zp.prototype,`view`,void 0),U([P({type:Number})],zp.prototype,`days`,void 0),U([P()],zp.prototype,`from`,void 0),U([P()],zp.prototype,`to`,void 0),U([P()],zp.prototype,`tz`,void 0),U([P()],zp.prototype,`group`,void 0),U([P({attribute:!1})],zp.prototype,`groups`,void 0),U([P({attribute:!1})],zp.prototype,`panels`,void 0),U([P({type:Boolean})],zp.prototype,`exported`,void 0),U([P()],zp.prototype,`tab`,void 0),zp=U([N(`ca-trends`),D()],zp);var $=class extends M{static{this.styles=[Dr,V,ul,ol]}constructor(){super(),this.baseUrl=``,this.exportUrl=``,this.history=`url`,this.shortcuts=``,this.run=``,this.locale=``,this.theme=``,this.live=!1,this.pickerOpen=!1,this.qDraft=null,this.themes=new kr(this,{theme:()=>this.theme,pageWide:()=>this.history===`url`}),this.tabFocus=new mi(this,{items:()=>[...this.renderRoot.querySelectorAll(`[role="tablist"] [role="tab"]`)],layout:`horizontal`,wrap:!0}),this.storeBase=``,this.viewRouterMode=`url`,this.storeCleanups=[],this.mainScroll=new $n(`main`,()=>Yn(this)),this.pendingScroll=null,this.qTimer=null,this.cleanups=[],this.localMemory=new Kn,this.onOutsideClick=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&(e.localName===`ca-run-picker`||e.classList.contains(`runbtn`)))||(this.pickerOpen=!1)},this.outsideClickOn=!1,this.navObserver=null,this.navObserved=null,this.locales=!1,this.language=new dr(this,{locale:()=>this.locale,pageWide:()=>this.history===`url`}),new fr(this,e=>this.onKey(e),()=>this.shortcutScope)}async scheduleUpdate(){return await this.language.ready,super.scheduleUpdate()}connectedCallback(){this.locales=An(),function(e=document){if(Or.has(e))return;let t=Er.styleSheet;t&&`adoptedStyleSheets`in e&&(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t],Or.add(e))}(this.ownerDocument),super.connectedCallback(),this.openStore(),this.openViewRouter(),this.store.start(),this.cleanups.push(()=>{this.listenOutside(!1),this.navObserver?.disconnect(),this.navObserver=null,this.navObserved=null}),this.addEventListener(`ca-open-task`,e=>{this.navigate({tab:`stream`,key:e.detail.key,...e.detail.view?{view:e.detail.view}:{}})}),this.addEventListener(`ca-navigate`,e=>{let{replace:t,...n}=e.detail;this.navigate(n,{replace:!0===t})}),this.addEventListener(`ca-select-run`,e=>this.navigate({run:e.detail.run,page:``})),this.addEventListener(`ca-filter`,e=>this.navigate(e.detail)),this.addEventListener(`ca-choose-theme`,e=>{this.theme=e.detail.theme,function(e,t=Tr()){try{t?.setItem(wr,e)}catch{}}(e.detail.theme)})}get source(){return this.exportUrl?`export:${this.exportUrl}`:this.baseUrl}openStore(){if(this.storeBase=this.source,this.exportUrl){let e=function(e,t={}){let n=e.endsWith(`/`)?e:`${e}/`,r=t.fetch??globalThis.fetch,a=new Map;function o(e){let t=a.get(e);return t||(t=async function(e){let t;try{t=await r(new Request(e))}catch{throw new i(e,`network`)}let n=(t.headers.get(`Content-Type`)??``).split(`;`)[0].trim().toLowerCase();if(!t.ok)throw new i(e,`status`,t.status,n);try{return await t.json()}catch{throw new i(e,`not-json`,t.status,n)}}(n+e),t.catch(()=>a.delete(e)),a.set(e,t)),t}let s=(e,t)=>`runs/${be(e)}/${t}`,c=e=>Promise.reject(new i(n+e,`status`,404));return{baseUrl:n.replace(/\/$/,``),file:o,info:()=>o(`info.json`),runs:()=>o(`runs.json`),hosts:()=>c(`hosts.json`),async journal(e,t=0){let n=await o(s(e,`journal.json`));return t>0?{entries:n.entries.slice(t),total:n.total}:n},definitions:e=>o(s(e,`definitions.json`)),async task(e,t){let[n,r,i,a]=await Promise.all([o(s(e,`tasks/${be(xe(t))}.json`)),o(s(e,`journal.json`)),o(s(e,`definitions.json`)),o(s(e,`plan.json`))]),c=r.entries.filter(e=>e.key===t),l=c.at(-1)?.kind??a.nodes.find(e=>e.key===t)?.kind;return{...n,rows:c,definition:i.find(e=>e.kind===l)??null}},stream:(e,t)=>c(s(e,`streams/${be(xe(t))}.json`)),panel:(e,t)=>o(s(e,`panels/${be(t)}.json`)),trends:()=>o(`trends.json`),trendsPanel:e=>o(`trends/panels/${be(e)}.json`)}}(new URL(this.exportUrl,this.ownerDocument.baseURI).href);this.store=new ye({client:e,openRunFeed:Ce(e),runsEveryMs:0})}else this.store=new ye({baseUrl:this.baseUrl});this.show(this.store.snapshot),this.storeCleanups.push(this.store.subscribe(e=>{this.show(e),this.pickDefaultRun()}),this.store.onNewRow(e=>this.toasts?.show(...rl(e,this.snap.run))))}closeStore(){for(let e of this.storeCleanups.splice(0))e();this.store.stop()}openViewRouter(){this.viewRouterMode=this.history,Jn(this,this.history===`memory`?this.localMemory:null);let e=this.viewRoute?this.history===`memory`?this.viewRoute:{}:this.run?{run:this.run}:{};this.viewRouter=new ur(this.history,(e,t)=>this.onViewRoute(e,t),e,Wn),this.viewRouter.start()}willUpdate(e){this.isConnected&&this.store&&(this.source!==this.storeBase&&(this.closeStore(),this.openStore(),this.navigate({run:this.run},{replace:!0}),this.store.selectRun(this.viewRoute.run),this.store.start()),this.history!==this.viewRouterMode&&(this.viewRouter.stop(),this.openViewRouter()),e.has(`run`)&&e.get(`run`)!==void 0&&this.run&&this.navigate({run:this.run}))}show(e){e.error&&e.error!==this.snap?.error&&console.error(nl(e.error)),this.snap=e,this.live=fe(e.state,de(e.runs,e.run))}get shortcutScope(){return(e=>e===`page`||e===`element`||e===`off`)(this.shortcuts)?this.shortcuts:this.history===`url`?`page`:`element`}listenOutside(e){e!==this.outsideClickOn&&(this.outsideClickOn=e,e?document.addEventListener(`click`,this.onOutsideClick):document.removeEventListener(`click`,this.onOutsideClick))}get shownTheme(){return this.themes.shown}disconnectedCallback(){super.disconnectedCallback();for(let e of this.cleanups.splice(0))e();Jn(this,null),this.viewRouter.stop(),this.closeStore(),this.mainScroll.detach()}navigate(e,t={}){this.viewRouter.navigate(e,t)}onViewRoute(e,t){let n=this.viewRoute;this.viewRoute=e,t!==`replace`&&(this.qDraft=null),this.store.selectRun(e.run);let r=n?.page===`trends`&&JSON.stringify(Lp(n))===JSON.stringify(Lp(e));e.page===`trends`?r||this.store.loadTrends(Lp(e)):this.store.closeTrends(),this.pickDefaultRun(),t!==`replace`&&(this.pendingScroll=t)}pickDefaultRun(){let{info:e,runs:t}=this.snap;if(this.viewRoute.page===`trends`)return;if(this.viewRoute.page===`hosts`){if(!e.api_version||e.hosts)return;this.navigate({page:``},{replace:!0})}let n=t[0];!this.viewRoute.run&&n&&this.navigate({run:n.run},{replace:!0})}onKey(e){if(e.key===`r`)e.preventDefault(),this.pickerOpen=!0;else if(e.key===`/`)e.preventDefault(),this.renderRoot.querySelector(`.bar input`)?.focus();else if(/^[1-9]$/.test(e.key)&&!this.viewRoute.page){let t=sl(this.snap.info.panels)[Number(e.key)-1];t&&this.navigate({tab:t.id})}}selectedTab(){return sl(this.snap.info.panels).findIndex(e=>e.id===this.viewRoute.tab)}closePicker(){let e=this.picker?.matches(`:focus-within`);this.pickerOpen=!1,e&&this.runBtn?.focus()}updated(){this.history===`url`&&this.snap&&(document.title=E(T`${this.snap.info.title} monitor`)),this.listenOutside(this.isConnected&&this.pickerOpen),this.observeNav(),this.snap&&this.viewRoute&&this.tabFocus.set(Math.max(0,this.selectedTab())),ll(this.renderRoot),this.main&&this.mainScroll.attach(this.main),this.pendingScroll&&=(this.pendingScroll===`push`?this.mainScroll.reset():this.mainScroll.restore(),null)}observeNav(){let e=this.renderRoot.querySelector(`nav`);e&&typeof ResizeObserver<`u`&&this.navObserved!==e&&(this.navObserver?this.navObserver.disconnect():this.navObserver=new ResizeObserver(()=>ll(this.renderRoot)),this.navObserver.observe(e),this.navObserved=e)}setQ(e){this.qDraft=e,this.qTimer&&clearTimeout(this.qTimer),this.qTimer=setTimeout(()=>{this.qTimer=null,this.navigate({q:e})},250)}pickLocale(e){this.locale=e,Fn(e)}render(){if(!this.snap||!this.viewRoute)return j;let{snap:e,viewRoute:t}=this,n=pe(e.state.procs),r=S(e.state.journal,e.state.plan),i=this.selectedTab(),a=this.shortcutScope!==`off`,o=!!e.info.hosts,s=t.page===`hosts`,c=t.page===`trends`;return k`
|
|
980
980
|
<header>
|
|
981
981
|
${u=e.info.title,k`<div class="brand">
|
|
982
982
|
<svg viewBox="12 12 96 96" aria-hidden="true">
|
|
@@ -1001,38 +1001,38 @@ ${s?this.hostsLabel():c?this.trendsLabel():this.runLabel(o,r)}
|
|
|
1001
1001
|
<span class="chev" aria-hidden="true">▾</span>
|
|
1002
1002
|
</button>
|
|
1003
1003
|
<div class="hdr-right">
|
|
1004
|
-
${((e,t)=>k`<span class="nowline">${t.length?E(k`Running ${t.slice(0,3).map(t=>
|
|
1004
|
+
${((e,t)=>k`<span class="nowline">${t.length?E(k`Running ${t.slice(0,3).map(t=>dl(e,q(t),{key:t.key}))}${t.length>3?k` <span>+${t.length-3}</span>`:j}`):j}</span>`)(this,n)}
|
|
1005
1005
|
<ca-theme-switch .value=${this.themes.choice} .system=${this.themes.system}></ca-theme-switch>
|
|
1006
1006
|
${this.locales?k`<cae-segmented class="langs" label=${E(`Language`)} .value=${I()} .options=${Dn.map(e=>({value:e,label:On[e],lang:e}))} @cae-change=${e=>Nn(e.detail.value)&&this.pickLocale(e.detail.value)}></cae-segmented>`:j}
|
|
1007
|
-
${e.info.export?Zr({text:
|
|
1007
|
+
${e.info.export?Zr({text:Tc(e.info.export),tone:`muted`,title:Dc(e.info.export)}):(e=>{let t=E(e?`Connected to the monitor server`:`Not connected to the monitor server`);return k`<span role="img" aria-label=${t} title=${t}><span class="live-dot ${e?``:`off`}"></span></span>`})(e.connected)}
|
|
1008
1008
|
<ca-clock class="clock"></ca-clock>
|
|
1009
1009
|
</div>
|
|
1010
1010
|
<ca-run-picker .runs=${e.runs} current=${t.run} ?open=${this.pickerOpen} ?hub=${o} .hosts=${e.hosts?.hosts??[]} page=${t.page} @ca-close=${()=>this.closePicker()}></ca-run-picker>
|
|
1011
1011
|
</header>
|
|
1012
|
-
${s?k`${this.renderApiError()}<main id="main"><ca-hosts .hosts=${e.hosts}></ca-hosts></main>`:c?k`${this.renderApiError()}<main id="main"><ca-trends .view=${e.trends} days=${t.days} from=${t.from} to=${t.to} tz=${t.tz||
|
|
1013
|
-
<main id="main" class=${t.tab===`stream`?`stream`:``} role="tabpanel" aria-labelledby=${i>=0?
|
|
1012
|
+
${s?k`${this.renderApiError()}<main id="main"><ca-hosts .hosts=${e.hosts}></ca-hosts></main>`:c?k`${this.renderApiError()}<main id="main"><ca-trends .view=${e.trends} days=${t.days} from=${t.from} to=${t.to} tz=${t.tz||Fp()} group=${t.group} .groups=${l=e.runs,[...new Set(l.map(e=>e.run_group).filter(e=>!!e))]} .panels=${e.info.panels} tab=${t.trendsTab} ?exported=${!!e.info.export}></ca-trends></main>`:k`${this.renderTabs(r,n.length)} ${this.renderBar(r)} ${this.renderApiError()}
|
|
1013
|
+
<main id="main" class=${t.tab===`stream`?`stream`:``} role="tabpanel" aria-labelledby=${i>=0?cl(i):j} >${function({snap:e,viewRoute:t,derived:n,q:r,client:i,baseUrl:a}){let{state:o}=e;if(!t.run)return k`<div class="blank">${e.runsLoaded&&!e.error?k`<span class="ic" aria-hidden="true">✦</span><b>${E(`No runs yet`,{id:`no-runs-yet`})}</b>`:j}</div>`;let s=de(e.runs,e.run),c=fe(o,s);switch(t.tab){case`overview`:return k`<ca-overview .state=${o} .summary=${s} .host=${ie(e.hosts?.hosts,s)} .info=${e.info} .run=${t.run} .layer=${t.layer} .unit=${t.unit} .sel=${t.sel}></ca-overview>`;case`tasks`:return k`<ca-task-table .run=${t.run} .journal=${o.journal} .plan=${o.plan} .kind=${t.kind} .q=${r} ?live=${c}></ca-task-table>`;case`journal`:return k`<ca-journal-table .run=${t.run} .rows=${o.journal} .plan=${o.plan} .fresh=${e.fresh} .kind=${t.kind} .stop=${t.stop} .q=${r} .extras=${s?.row_extras??[]} ?replay-marks=${tc(s)}></ca-journal-table>`;case`outputs`:return k`<ca-contracts .run=${t.run} .outputs=${o.outputs} .journal=${o.journal} .plan=${o.plan}></ca-contracts>`;case`definitions`:return k`<ca-definitions .client=${i} .run=${t.run} .journal=${o.journal} .plan=${o.plan} .live=${c} .selected=${t.def}></ca-definitions>`;case`procs`:return k`<ca-procs-view .procs=${o.procs} ?unresponsive=${re(s,!!o.procs?.alive)===`unresponsive`} ?exported=${!!e.info.export}></ca-procs-view>`;case`stream`:return k`<ca-task-view .client=${i} .journal=${o.journal} .plan=${o.plan} base-url=${a} .run=${t.run} .taskKey=${t.key??function(e){let t=e.filter(e=>e.executor!==`python`),n=t.find(e=>e.outcome===`running`);if(n)return n.key;let r=e=>e.tries[e.tries.length-1]?.ts??``;return t.filter(r).sort((e,t)=>r(t).localeCompare(r(e)))[0]?.key??null}(n.rows)} .view=${t.view} .round=${t.round} .live=${c} ?exported=${!!e.info.export} ?replay-marks=${tc(s)}></ca-task-view>`;default:{let n=t.tab.slice(6);return k`<ca-panel-view .name=${n} .panel=${e.info.panels.find(e=>e.name===n)} .data=${o.panels[n]} base-url=${a}></ca-panel-view>`}}}({snap:e,viewRoute:t,derived:r,q:this.qDraft??t.q,client:this.store.client,baseUrl:this.store.client.baseUrl})}</main>`}
|
|
1014
1014
|
<ca-toasts></ca-toasts>
|
|
1015
1015
|
`;var l,u}runLabel(e,t){let{snap:n,viewRoute:r}=this,i=de(n.runs,n.run),a=re(i,!!n.state.procs?.alive),o=os(a,i?.tasks),s=e?i?.host_id??``:``;return k`<span class="dot" data-tone=${L(o)} aria-hidden="true"></span>
|
|
1016
1016
|
<span class="rn" title=${s?r.run:j}>${i&&s?ae(i):r.run||`—`}</span>
|
|
1017
|
-
${s?k`<span class="hostchip" title=${
|
|
1018
|
-
${a===`unresponsive`?Zr({text:
|
|
1019
|
-
${
|
|
1020
|
-
<span class="rs" title=${i?Ps(
|
|
1021
|
-
<span class="rn">${E(`Hosts`)}</span><span class="rs">${
|
|
1017
|
+
${s?k`<span class="hostchip" title=${cc(s)}><span class="sr">${cc(s)}</span><span aria-hidden="true">${s}</span></span>`:j}
|
|
1018
|
+
${a===`unresponsive`?Zr({text:ac(),tone:`attention`,title:sc(ie(n.hosts?.hosts,i))}):j}
|
|
1019
|
+
${ic(i)?Zr({...ic(i),tone:`muted`}):j}
|
|
1020
|
+
<span class="rs" title=${i?Ps($s(n.state,i)):``}>${i?function(e,t,n=S(e.journal,e.plan)){let r=ne(t),i=e.ready?De(e.journal)?.cost:t.cost_usd,a=i==null?``:Y(i),o=Ns($s(e,t)),s=K(r==null?``:E(T`took ${B(r)}`),a,o,t.running?E(`running`):``);if(!e.ready)return s;let c=n.counts,l=t.tasks.not_run?X(`not_run`,t.tasks.not_run):``;return K(E(T`${c.doneTotal} of ${c.total} tasks done`),l,s)}(n.state,i,t):``}</span>`}trendsLabel(){return k`<span class="dot" data-tone="neutral" aria-hidden="true"></span><span class="rn">${kc()}</span><span class="rs">${Ac()}</span>`}hostsLabel(){let e=this.snap.hosts?.hosts??[];return k`<span class="dot" data-tone=${L(e.some(e=>!e.up)?`attention`:`neutral`)} aria-hidden="true"></span>
|
|
1021
|
+
<span class="rn">${E(`Hosts`)}</span><span class="rs">${uc(e)}</span>`}renderApiError(){let{error:e}=this.snap;return k`<p class="api-error" role="alert">${e?k`<span class="ic" aria-hidden="true">✕</span> ${nl(e)}`:j}</p>`}renderTabs(e,t){let{state:n}=this.snap,{tries:r}=e.tries,i=e.counts;return function(e,t,n,r,i,a=!0){return k`<nav data-scroll="x">
|
|
1022
1022
|
<div class="tabs" role="tablist" aria-label=${E(`Views`)}>
|
|
1023
1023
|
${e.map((a,o)=>{let s=n(a.id),c=a.id===t;return k`${a.panel&&!e[o-1]?.panel?k`<span class="tab-sep" aria-hidden="true" title=${E(`Custom views`)}></span>`:j}
|
|
1024
|
-
<button type="button" role="tab" id=${
|
|
1024
|
+
<button type="button" role="tab" id=${cl(o)} aria-selected=${c?`true`:`false`} aria-controls=${i} class="tab ${a.panel?`panel-tab`:``} ${c?`sel`:``}" title=${a.tip??j} @click=${()=>r(a.id)}>
|
|
1025
1025
|
<span class="tab-ic" aria-hidden="true">${a.icon}</span><span class="tab-label" data-label=${a.label}>${a.label}</span>${s&&s[0]!==``?k`<span class="badge" data-tone=${L(s[1])}>${s[0]}</span>`:j}
|
|
1026
1026
|
</button>`})}
|
|
1027
1027
|
</div>
|
|
1028
1028
|
<span class="tab-ind init" aria-hidden="true"></span>
|
|
1029
1029
|
${a?k`<span class="tabhint meta" role="note" aria-label=${E(`Keyboard shortcuts`)} ><span aria-hidden="true"><span class="kbd">1</span>–<span class="kbd">${Math.min(9,e.length)}</span> ${E(`Tabs`)} |
|
|
1030
1030
|
<span class="kbd">r</span> ${E(`Runs`)} | <span class="kbd">/</span> ${E(`Filter`)}</span></span >`:j}
|
|
1031
|
-
</nav>`}(
|
|
1031
|
+
</nav>`}(sl(this.snap.info.panels),this.viewRoute.tab,e=>e===`tasks`?[i.total||``,`neutral`]:e===`journal`?[r||``,`neutral`]:e===`procs`?[n.procs?.alive&&t||``,`running`]:null,e=>this.navigate({tab:e}),`main`,this.shortcutScope!==`off`)}renderBar(e){let{viewRoute:t}=this;if(t.tab!==`tasks`&&t.tab!==`journal`)return j;let{counts:n,kinds:r}=e,i=n.total;return k`<div class="bar">
|
|
1032
1032
|
<select title=${E(`Kind`)} aria-label=${E(`Kind`)} @change=${e=>this.navigate({kind:e.target.value})}>
|
|
1033
1033
|
<option value="" ?selected=${!t.kind}>${E(`All kinds`)}</option>
|
|
1034
1034
|
${r.map(e=>k`<option ?selected=${e===t.kind}>${e}</option>`)}
|
|
1035
1035
|
</select>
|
|
1036
1036
|
<input placeholder=${E(`Filter`)} aria-label=${E(`Text filter`)} size="22" title=${this.shortcutScope===`off`?E(`Text filter`):E(`Text filter (/)`)} .value=${this.qDraft??t.q} @input=${e=>this.setQ(e.target.value)} />
|
|
1037
1037
|
<span class="meta">${t.tab===`journal`?function({tries:e,notStarted:t}){return K(E(e===1?`1 attempt`:T`${e} attempts`),t?X(`not_started`,t):``)}(e.tries):E(i===1?`1 task`:T`${i} tasks`)}</span>
|
|
1038
|
-
</div>`}};U([P({attribute:`base-url`})],$.prototype,`baseUrl`,void 0),U([P({attribute:`export`})],$.prototype,`exportUrl`,void 0),U([P()],$.prototype,`history`,void 0),U([P()],$.prototype,`shortcuts`,void 0),U([P()],$.prototype,`run`,void 0),U([P()],$.prototype,`locale`,void 0),U([P()],$.prototype,`theme`,void 0),U([P({type:Boolean,reflect:!0})],$.prototype,`live`,void 0),U([F()],$.prototype,`snap`,void 0),U([F()],$.prototype,`viewRoute`,void 0),U([F()],$.prototype,`pickerOpen`,void 0),U([F()],$.prototype,`qDraft`,void 0),U([xn(`main`)],$.prototype,`main`,void 0),U([xn(`ca-toasts`)],$.prototype,`toasts`,void 0),U([xn(`.runbtn`)],$.prototype,`runBtn`,void 0),U([xn(`ca-run-picker`)],$.prototype,`picker`,void 0),$=U([N(`ca-monitor`),D()],$);export{er as BUILTIN_TABS,
|
|
1038
|
+
</div>`}};U([P({attribute:`base-url`})],$.prototype,`baseUrl`,void 0),U([P({attribute:`export`})],$.prototype,`exportUrl`,void 0),U([P()],$.prototype,`history`,void 0),U([P()],$.prototype,`shortcuts`,void 0),U([P()],$.prototype,`run`,void 0),U([P()],$.prototype,`locale`,void 0),U([P()],$.prototype,`theme`,void 0),U([P({type:Boolean,reflect:!0})],$.prototype,`live`,void 0),U([F()],$.prototype,`snap`,void 0),U([F()],$.prototype,`viewRoute`,void 0),U([F()],$.prototype,`pickerOpen`,void 0),U([F()],$.prototype,`qDraft`,void 0),U([xn(`main`)],$.prototype,`main`,void 0),U([xn(`ca-toasts`)],$.prototype,`toasts`,void 0),U([xn(`.runbtn`)],$.prototype,`runBtn`,void 0),U([xn(`ca-run-picker`)],$.prototype,`picker`,void 0),$=U([N(`ca-monitor`),D()],$);export{er as BUILTIN_TABS,Ep as CaClock,bf as CaContracts,wf as CaDefinition,Tf as CaDefinitions,Op as CaHosts,mf as CaJournalTable,Il as CaKpis,Kl as CaModelUsage,$ as CaMonitor,Xd as CaOverview,Mf as CaPanelBody,Nf as CaPanelView,Pd as CaPipelineGraph,Ol as CaProcTree,Ef as CaProcsView,ql as CaQuota,zd as CaRunDriver,Ap as CaRunPicker,Yl as CaServices,Rl as CaSpendBreakdown,uf as CaTaskTable,Tp as CaTaskView,Gd as CaTimeline,al as CaToasts,up as CaTranscript,Kd as CaWorkers,rr as DEFAULT_VIEW_ROUTE,On as LOCALE_NAMES,Xl as LOOP_SEGMENT,Bl as OTHER_COLOUR,zl as SERIES_COLOURS,tr as TASK_VIEWS,Bd as TIMELINE_WINDOW_MS,nr as TREND_DAYS,ur as ViewRouter,Uf as agentLabel,Dn as allLocales,cr as applyPatch,sp as applyTranscriptEvents,of as attemptFacts,md as autoLayer,Od as budgetFor,zf as checkMessage,Rf as checkName,gl as checkRowsFromContract,_l as checkTableStrings,Fn as chooseLocale,Fu as chooseOpen,Lf as classifyRounds,Lu as compound,An as configureLocales,hl as contentObject,gf as ctChips,Pu as doi,Q as emit,ep as emptyTranscript,jr as esc,Qo as factList,K as facts,rf as filterJournal,Zd as filterTasks,ts as firstLine,Ff as fixupErrors,B as fmtDur,sr as formatViewRoute,I as getLocale,ud as graphFromPlan,ld as graphInput,nf as hadFixup,Mu as interest,If as isFixup,lr as isNewPlace,ff as journalColumns,af as journalTally,q as kindUnit,Al as kpiAction,Pl as kpiTiles,kl as kpis,Hd as laneStyles,Wd as lanesFromJournal,Gf as launchWho,pd as layerGraph,es as listText,G as localTime,Hu as markSel,fd as matrixFromPlan,dd as matrixInput,Hl as modelColours,Vl as modelId,Wl as modelRows,Nu as notable,_d as parentLayer,Uu as parseSelection,or as parseViewRoute,Bu as passMatrix,ku as placeKey,ju as placeStats,Pn as preferredLocale,Ld as preflightRows,Xo as relAgo,gd as resolveLayer,tf as retriedKeys,pl as rootOf,ml as rowOf,rl as rowToast,Zo as sentence,jn as setLocale,Ul as shareParts,df as shortStop,Vu as sortPassRows,$d as sortTasks,kd as spanFor,hd as splitLayer,cf as taskColumns,vf as taskName,Ku as taskStateStyles,J as tokenCount,Ad as tooWide,Iu as towardOf,Yf as transcriptSections,Pp as trendSections,fl as typeOk,ns as unreadEvents,Y as usd,$f as webResults,Kf as whoTags};
|