@contraagent/ui 0.6.2 → 0.7.1
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/custom-elements.json +24 -3
- package/dist/adapters/forecast.d.ts +20 -0
- package/dist/adapters/forecast.d.ts.map +1 -0
- package/dist/adapters/forecast.js +35 -0
- package/dist/adapters/forecast.js.map +1 -0
- package/dist/adapters/graph/compound.d.ts.map +1 -1
- package/dist/adapters/graph/compound.js +7 -5
- package/dist/adapters/graph/compound.js.map +1 -1
- package/dist/adapters/graph/highlight.d.ts +21 -5
- package/dist/adapters/graph/highlight.d.ts.map +1 -1
- package/dist/adapters/graph/highlight.js +49 -21
- package/dist/adapters/graph/highlight.js.map +1 -1
- package/dist/adapters/graph/input.d.ts +3 -1
- package/dist/adapters/graph/input.d.ts.map +1 -1
- package/dist/adapters/graph/input.js +7 -1
- package/dist/adapters/graph/input.js.map +1 -1
- package/dist/adapters/graph/project.d.ts +5 -3
- package/dist/adapters/graph/project.d.ts.map +1 -1
- package/dist/adapters/graph/project.js +13 -9
- package/dist/adapters/graph/project.js.map +1 -1
- package/dist/adapters/graph/selection.js +1 -1
- package/dist/adapters/graph/selection.js.map +1 -1
- package/dist/adapters/graph/states.d.ts.map +1 -1
- package/dist/adapters/graph/states.js +1 -1
- package/dist/adapters/graph/states.js.map +1 -1
- package/dist/adapters/graph/types.d.ts +12 -4
- package/dist/adapters/graph/types.d.ts.map +1 -1
- package/dist/adapters/graph/types.js +2 -0
- package/dist/adapters/graph/types.js.map +1 -1
- package/dist/adapters/graph/words.d.ts +5 -4
- package/dist/adapters/graph/words.d.ts.map +1 -1
- package/dist/adapters/graph/words.js +11 -9
- package/dist/adapters/graph/words.js.map +1 -1
- package/dist/adapters/index.d.ts +1 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +1 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/journal-columns.d.ts.map +1 -1
- package/dist/adapters/journal-columns.js +4 -1
- package/dist/adapters/journal-columns.js.map +1 -1
- package/dist/adapters/kpi-tiles.d.ts.map +1 -1
- package/dist/adapters/kpi-tiles.js +1 -0
- package/dist/adapters/kpi-tiles.js.map +1 -1
- package/dist/contraagent-ui.js +674 -657
- package/dist/core/scroll.d.ts +13 -1
- package/dist/core/scroll.d.ts.map +1 -1
- package/dist/core/scroll.js +46 -12
- package/dist/core/scroll.js.map +1 -1
- package/dist/elements/overview/ca-overview.d.ts.map +1 -1
- package/dist/elements/overview/ca-overview.js +3 -3
- package/dist/elements/overview/ca-overview.js.map +1 -1
- package/dist/elements/overview/ca-pipeline-graph.d.ts +6 -1
- package/dist/elements/overview/ca-pipeline-graph.d.ts.map +1 -1
- package/dist/elements/overview/ca-pipeline-graph.js +30 -13
- package/dist/elements/overview/ca-pipeline-graph.js.map +1 -1
- package/dist/elements/overview/pipeline-graph/crumbs.d.ts +5 -0
- package/dist/elements/overview/pipeline-graph/crumbs.d.ts.map +1 -1
- package/dist/elements/overview/pipeline-graph/crumbs.js +27 -1
- package/dist/elements/overview/pipeline-graph/crumbs.js.map +1 -1
- package/dist/elements/overview/pipeline-graph/inspector.d.ts.map +1 -1
- package/dist/elements/overview/pipeline-graph/inspector.js +39 -5
- package/dist/elements/overview/pipeline-graph/inspector.js.map +1 -1
- package/dist/elements/overview/pipeline-graph/outline.js +1 -1
- package/dist/elements/overview/pipeline-graph/outline.js.map +1 -1
- package/dist/elements/overview/pipeline-graph/strings.d.ts.map +1 -1
- package/dist/elements/overview/pipeline-graph/strings.js +6 -3
- package/dist/elements/overview/pipeline-graph/strings.js.map +1 -1
- package/dist/elements/overview/pipeline-graph/styles.d.ts.map +1 -1
- package/dist/elements/overview/pipeline-graph/styles.js +6 -2
- package/dist/elements/overview/pipeline-graph/styles.js.map +1 -1
- package/dist/elements/shell/ca-monitor.d.ts +2 -0
- package/dist/elements/shell/ca-monitor.d.ts.map +1 -1
- package/dist/elements/shell/ca-monitor.js +11 -0
- package/dist/elements/shell/ca-monitor.js.map +1 -1
- package/dist/elements/shell/ca-run-picker.d.ts.map +1 -1
- package/dist/elements/shell/ca-run-picker.js +2 -0
- package/dist/elements/shell/ca-run-picker.js.map +1 -1
- package/dist/elements/task/ca-task-view.d.ts.map +1 -1
- package/dist/elements/task/ca-task-view.js +4 -1
- package/dist/elements/task/ca-task-view.js.map +1 -1
- package/dist/elements/task/header.d.ts.map +1 -1
- package/dist/elements/task/header.js +34 -3
- package/dist/elements/task/header.js.map +1 -1
- package/dist/elements/task/panes/io.d.ts +5 -1
- package/dist/elements/task/panes/io.d.ts.map +1 -1
- package/dist/elements/task/panes/io.js +56 -8
- package/dist/elements/task/panes/io.js.map +1 -1
- package/dist/elements/task/styles.d.ts.map +1 -1
- package/dist/elements/task/styles.js +6 -2
- package/dist/elements/task/styles.js.map +1 -1
- package/dist/lib/tone.d.ts.map +1 -1
- package/dist/lib/tone.js +2 -0
- package/dist/lib/tone.js.map +1 -1
- package/dist/locales/ja.d.ts +47 -5
- package/dist/locales/ja.d.ts.map +1 -1
- package/dist/locales/ja.js +47 -5
- package/dist/locales/ja.js.map +1 -1
- package/dist/words/flow-calls.d.ts +12 -0
- package/dist/words/flow-calls.d.ts.map +1 -0
- package/dist/words/flow-calls.js +31 -0
- package/dist/words/flow-calls.js.map +1 -0
- package/dist/words/forecast.d.ts +16 -0
- package/dist/words/forecast.d.ts.map +1 -0
- package/dist/words/forecast.js +17 -0
- package/dist/words/forecast.js.map +1 -0
- package/dist/words/format.d.ts +10 -0
- package/dist/words/format.d.ts.map +1 -1
- package/dist/words/format.js +17 -0
- package/dist/words/format.js.map +1 -1
- package/dist/words/index.d.ts +4 -0
- package/dist/words/index.d.ts.map +1 -1
- package/dist/words/index.js +4 -0
- package/dist/words/index.js.map +1 -1
- package/dist/words/lineage.d.ts +8 -0
- package/dist/words/lineage.d.ts.map +1 -0
- package/dist/words/lineage.js +35 -0
- package/dist/words/lineage.js.map +1 -0
- package/dist/words/outcome.d.ts.map +1 -1
- package/dist/words/outcome.js +4 -0
- package/dist/words/outcome.js.map +1 -1
- package/dist/words/rerun.d.ts +24 -0
- package/dist/words/rerun.d.ts.map +1 -0
- package/dist/words/rerun.js +41 -0
- package/dist/words/rerun.js.map +1 -0
- package/dist/words/stop.js +2 -0
- package/dist/words/stop.js.map +1 -1
- package/package.json +3 -3
- package/src/adapters/forecast.ts +43 -0
- package/src/adapters/graph/compound.ts +10 -9
- package/src/adapters/graph/highlight.ts +53 -22
- package/src/adapters/graph/input.ts +10 -2
- package/src/adapters/graph/plans.fixture.ts +2 -2
- package/src/adapters/graph/project.ts +16 -12
- package/src/adapters/graph/selection.ts +1 -1
- package/src/adapters/graph/states.ts +1 -1
- package/src/adapters/graph/types.ts +14 -4
- package/src/adapters/graph/words.ts +17 -12
- package/src/adapters/index.ts +1 -0
- package/src/adapters/journal-columns.ts +4 -1
- package/src/adapters/kpi-tiles.ts +1 -0
- package/src/core/scroll.ts +43 -11
- package/src/elements/overview/ca-overview.ts +3 -2
- package/src/elements/overview/ca-pipeline-graph.ts +34 -18
- package/src/elements/overview/pipeline-graph/crumbs.ts +28 -0
- package/src/elements/overview/pipeline-graph/inspector.ts +45 -5
- package/src/elements/overview/pipeline-graph/outline.ts +1 -1
- package/src/elements/overview/pipeline-graph/strings.ts +6 -3
- package/src/elements/overview/pipeline-graph/styles.ts +6 -2
- package/src/elements/shell/ca-monitor.ts +9 -0
- package/src/elements/shell/ca-run-picker.ts +1 -0
- package/src/elements/task/ca-task-view.ts +7 -2
- package/src/elements/task/header.ts +34 -3
- package/src/elements/task/panes/io.ts +72 -8
- package/src/elements/task/styles.ts +6 -2
- package/src/lib/tone.ts +2 -0
- package/src/locales/ja.ts +47 -5
- package/src/words/flow-calls.ts +36 -0
- package/src/words/forecast.ts +28 -0
- package/src/words/format.ts +19 -0
- package/src/words/index.ts +4 -0
- package/src/words/lineage.ts +41 -0
- package/src/words/outcome.ts +4 -0
- package/src/words/rerun.ts +61 -0
- package/src/words/stop.ts +2 -0
package/dist/contraagent-ui.js
CHANGED
|
@@ -1,243 +1,246 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=new Set([`launch`,`message_update`,`tool_execution_start`,`tool_execution_update`,`tool_execution_end`,`acall`,`aresult`,`message_start`,`message_end`,`turn_end`,`notice`,`auto_retry_start`]);function r(e){return n.has(e.type)?e:null}var i=class extends Error{constructor(e,t,n=0,r=``){super(`No JSON answer from ${e}: ${t} ${n} ${r}`.trim()),this.url=e,this.failure=t,this.status=n,this.type=r,this.name=`ApiError`}};function a(e={}){let t=(e.baseUrl??``).replace(/\/$/,``),n=(t||globalThis.location?.origin||``).replace(/\/$/,``),r=e.fetch??globalThis.fetch;async function a(e,t){let{path:a={},query:o={}}=t??{},s=n+e.replace(/\{(\w+)\}/g,(e,t)=>t in a?encodeURIComponent(a[t]):e),c=Object.entries(o).filter(([,e])=>e!=null).map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join(`&`),l=c?`${s}?${c}`:s,u;try{u=await r(new Request(l))}catch{throw new i(l,`network`)}let{status:d,ok:f}=u,p=(u.headers.get(`Content-Type`)??``).split(`;`)[0].trim().toLowerCase();try{if(f)return await u.json()}catch{}throw new i(l,f?`not-json`:`status`,d,p)}return{baseUrl:t,info:()=>a(`/api/info`),runs:()=>a(`/api/runs`),hosts:()=>a(`/api/hosts`),journal:(e,t=0)=>a(`/api/runs/{run}/journal`,{path:{run:e},query:{since:t}}),definitions:e=>a(`/api/runs/{run}/definitions`,{path:{run:e}}),task:(e,t)=>a(`/api/runs/{run}/task/{key}`,{path:{run:e,key:t}}),stream:(e,t,n=0)=>a(`/api/runs/{run}/stream/{key}`,{path:{run:e,key:t},query:{since:n}}),panel:(e,t)=>a(`/api/runs/{run}/panels/{name}`,{path:{run:e,name:t}}),trends:(e={})=>a(`/api/trends`,{query:{...e}}),trendsPanel:(e,t={})=>a(`/api/trends/panels/{name}`,{path:{name:e},query:{...t}})}}var o=[`journal`,`procs`,`plan`,`outputs`,`cursor`,`ready`];function s(e,t,n,r){let i=new(r.EventSource??globalThis.EventSource)(e);i.onopen=()=>n.open?.(),i.onerror=()=>n.error?.();for(let e of t)i.addEventListener(e,t=>{n.message({event:e,data:JSON.parse(t.data)})});return()=>i.close()}var c=encodeURIComponent,l=e=>(e.baseUrl??``).replace(/\/$/,``);function u(e,t){let n=t?.flow_call;return n?e?.flow_calls?.find(e=>e.id===n)?.function??``:``}var d=e=>e.ok,f=e=>e.stop!==`invalid_input`&&e.stop!==`skipped`;function p(e,t){if(e?.state===`running`)return`running`;let n=t[t.length-1];return n?n.stop===`skipped`?`skipped`:n.stop===`invalid_input`?`not_started`:n.stop===`partial`?`partial`:d(n)?t.some(e=>f(e)&&!d(e))?`recovered`:`done`:`failed`:e?.state===`blocked`?`not_started`:`waiting`}function m(e){let t=new Set,n=[];for(let r of e)f(r)&&(t.has(r.key)&&n.push(r),d(r)||t.add(r.key));return n}function h(e){switch(e){case`blocked`:return`not_started`;case`pending`:return`waiting`;default:return e}}var g=e=>e===`done`||e===`recovered`||e===`partial`||e===`skipped`;function _(e){let t=new Map;for(let n of e.values())n.outcome===`failed`&&t.set(n.key,{task:n,stopped:[]});let n=[];for(let r of e.values()){if(r.outcome!==`not_started`)continue;let e=r.cause?t.get(r.cause):void 0;e?e.stopped.push(r):n.push(r)}let r=e=>e.attempts[e.attempts.length-1]?.ts??``;return{failed:[...t.values()].sort((e,t)=>r(t.task).localeCompare(r(e.task))),notStarted:n,partial:[...e.values()].filter(e=>e.outcome===`partial`),recovered:[...e.values()].filter(e=>e.outcome===`recovered`)}}function v(e){let t=Array.isArray(e?.flow)?e.flow:[];for(let e=t.length-1;e>=0;e--){let n=t[e]?.loops??[],r=n[n.length-1];if(r)return typeof r.pass==`number`&&r.pass>=1?r.pass:1}return null}function y(e,t){let n=new Map(t.nodes.map(e=>[e.key,e]));return[...e.values()].map(t=>{let r=t.attempts[t.attempts.length-1],i=n.get(t.key);return{...t,pass:v(i),wall_s:t.tries.reduce((e,t)=>e+(t.wall_s||0),0),last_ts:r?.ts??``,last_stop:r?.stop??``,waits_for:t.outcome===`waiting`?(i?.after??[]).filter(t=>!g(e.get(t)?.outcome??`waiting`)):[],claims:i?.claims??[],priority:i?.priority??0}})}var b={nodes:[],groups:[]},x=new WeakMap;function S(e,t=b){let n=t??b,r=x.get(e);r||x.set(e,r=new WeakMap);let i=r.get(n);return i||r.set(n,i=function(e,t){let n=function(e,t){let n=new Map;for(let t of e){let e=n.get(t.key);e||n.set(t.key,e=[]),e.push(t)}let r=new Map(t.nodes.map(e=>[e.key,e])),i=[...new Set([...t.nodes.map(e=>e.key),...n.keys()])],a=new Map;for(let e of i){let i=r.get(e),o=n.get(e)??[],s=o[0];a.set(e,{key:e,kind:i?.kind??s?.kind??``,unit:i?.unit??s?.unit??``,executor:i?.executor??s?.executor??`agent`,outcome:p(i,o),attempts:o,tries:o.filter(f),cause:null,deferred:i?.deferred??``,deferredCause:i?.deferred_cause??null,deferredIn:u(t,i?.deferred_cause)})}let o=(e,t)=>{for(let n of r.get(e)?.after??[]){if(t.has(n))continue;t.add(n);let e=a.get(n);if(e?.outcome===`failed`)return n;if(e?.outcome===`not_started`){let e=o(n,t);if(e)return e}}return null};for(let e of a.values())e.outcome===`not_started`&&(e.cause=o(e.key,new Set));return a}(e,t),r=function(e){let t={done:0,recovered:0,partial:0,failed:0,not_started:0,running:0,waiting:0,skipped:0,total:0};for(let n of e.values())t[n.outcome]++,t.total++;return t}(n);return{outcomes:n,rows:y(n,t),counts:{...r,doneTotal:r.done+r.recovered,finished:r.done+r.recovered+r.partial+r.skipped},problems:_(n),kinds:[...new Set([...n.values()].map(e=>e.kind))].sort(),tries:
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=new Set([`launch`,`message_update`,`tool_execution_start`,`tool_execution_update`,`tool_execution_end`,`acall`,`aresult`,`message_start`,`message_end`,`turn_end`,`notice`,`auto_retry_start`]);function r(e){return n.has(e.type)?e:null}var i=class extends Error{constructor(e,t,n=0,r=``){super(`No JSON answer from ${e}: ${t} ${n} ${r}`.trim()),this.url=e,this.failure=t,this.status=n,this.type=r,this.name=`ApiError`}};function a(e={}){let t=(e.baseUrl??``).replace(/\/$/,``),n=(t||globalThis.location?.origin||``).replace(/\/$/,``),r=e.fetch??globalThis.fetch;async function a(e,t){let{path:a={},query:o={}}=t??{},s=n+e.replace(/\{(\w+)\}/g,(e,t)=>t in a?encodeURIComponent(a[t]):e),c=Object.entries(o).filter(([,e])=>e!=null).map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join(`&`),l=c?`${s}?${c}`:s,u;try{u=await r(new Request(l))}catch{throw new i(l,`network`)}let{status:d,ok:f}=u,p=(u.headers.get(`Content-Type`)??``).split(`;`)[0].trim().toLowerCase();try{if(f)return await u.json()}catch{}throw new i(l,f?`not-json`:`status`,d,p)}return{baseUrl:t,info:()=>a(`/api/info`),runs:()=>a(`/api/runs`),hosts:()=>a(`/api/hosts`),journal:(e,t=0)=>a(`/api/runs/{run}/journal`,{path:{run:e},query:{since:t}}),definitions:e=>a(`/api/runs/{run}/definitions`,{path:{run:e}}),task:(e,t)=>a(`/api/runs/{run}/task/{key}`,{path:{run:e,key:t}}),stream:(e,t,n=0)=>a(`/api/runs/{run}/stream/{key}`,{path:{run:e,key:t},query:{since:n}}),panel:(e,t)=>a(`/api/runs/{run}/panels/{name}`,{path:{run:e,name:t}}),trends:(e={})=>a(`/api/trends`,{query:{...e}}),trendsPanel:(e,t={})=>a(`/api/trends/panels/{name}`,{path:{name:e},query:{...t}})}}var o=[`journal`,`procs`,`plan`,`outputs`,`forecast`,`cursor`,`ready`];function s(e,t,n,r){let i=new(r.EventSource??globalThis.EventSource)(e);i.onopen=()=>n.open?.(),i.onerror=()=>n.error?.();for(let e of t)i.addEventListener(e,t=>{n.message({event:e,data:JSON.parse(t.data)})});return()=>i.close()}var c=encodeURIComponent,l=e=>(e.baseUrl??``).replace(/\/$/,``);function u(e,t){let n=t?.flow_call;return n?e?.flow_calls?.find(e=>e.id===n)?.function??``:``}var d=e=>e.ok,f=e=>e.stop!==`invalid_input`&&e.stop!==`skipped`;function p(e,t){if(e?.state===`running`)return`running`;let n=t[t.length-1];return n?n.stop===`skipped`?`skipped`:n.stop===`invalid_input`?`not_started`:n.stop===`partial`?`partial`:n.stop===`cancelled`?`cancelled`:d(n)?t.some(e=>f(e)&&!d(e))?`recovered`:`done`:`failed`:e?.state===`blocked`?`not_started`:`waiting`}function m(e){let t=new Set,n=[];for(let r of e)f(r)&&(t.has(r.key)&&n.push(r),d(r)||t.add(r.key));return n}function h(e){switch(e){case`blocked`:return`not_started`;case`pending`:return`waiting`;default:return e}}var g=e=>e===`done`||e===`recovered`||e===`partial`||e===`skipped`||e===`cancelled`;function _(e){let t=new Map;for(let n of e.values())n.outcome===`failed`&&t.set(n.key,{task:n,stopped:[]});let n=[];for(let r of e.values()){if(r.outcome!==`not_started`)continue;let e=r.cause?t.get(r.cause):void 0;e?e.stopped.push(r):n.push(r)}let r=e=>e.attempts[e.attempts.length-1]?.ts??``;return{failed:[...t.values()].sort((e,t)=>r(t.task).localeCompare(r(e.task))),notStarted:n,partial:[...e.values()].filter(e=>e.outcome===`partial`),recovered:[...e.values()].filter(e=>e.outcome===`recovered`)}}function v(e){let t=Array.isArray(e?.flow)?e.flow:[];for(let e=t.length-1;e>=0;e--){let n=t[e]?.loops??[],r=n[n.length-1];if(r)return typeof r.pass==`number`&&r.pass>=1?r.pass:1}return null}function y(e,t){let n=new Map(t.nodes.map(e=>[e.key,e]));return[...e.values()].map(t=>{let r=t.attempts[t.attempts.length-1],i=n.get(t.key);return{...t,pass:v(i),wall_s:t.tries.reduce((e,t)=>e+(t.wall_s||0),0),last_ts:r?.ts??``,last_stop:r?.stop??``,waits_for:t.outcome===`waiting`?(i?.after??[]).filter(t=>!g(e.get(t)?.outcome??`waiting`)):[],claims:i?.claims??[],priority:i?.priority??0}})}var b={nodes:[],groups:[]},x=new WeakMap;function S(e,t=b){let n=t??b,r=x.get(e);r||x.set(e,r=new WeakMap);let i=r.get(n);return i||r.set(n,i=function(e,t){let n=function(e,t){let n=new Map;for(let t of e){let e=n.get(t.key);e||n.set(t.key,e=[]),e.push(t)}let r=new Map(t.nodes.map(e=>[e.key,e])),i=[...new Set([...t.nodes.map(e=>e.key),...n.keys()])],a=new Map;for(let e of i){let i=r.get(e),o=n.get(e)??[],s=o[0];a.set(e,{key:e,kind:i?.kind??s?.kind??``,unit:i?.unit??s?.unit??``,executor:i?.executor??s?.executor??`agent`,outcome:p(i,o),attempts:o,tries:o.filter(f),cause:null,deferred:i?.deferred??``,deferredCause:i?.deferred_cause??null,deferredIn:u(t,i?.deferred_cause)})}let o=(e,t)=>{for(let n of r.get(e)?.after??[]){if(t.has(n))continue;t.add(n);let e=a.get(n);if(e?.outcome===`failed`)return n;if(e?.outcome===`not_started`){let e=o(n,t);if(e)return e}}return null};for(let e of a.values())e.outcome===`not_started`&&(e.cause=o(e.key,new Set));return a}(e,t),r=function(e){let t={done:0,recovered:0,partial:0,failed:0,not_started:0,running:0,waiting:0,skipped:0,cancelled:0,total:0};for(let n of e.values())t[n.outcome]++,t.total++;return t}(n);return{outcomes:n,rows:y(n,t),counts:{...r,doneTotal:r.done+r.recovered,finished:r.done+r.recovered+r.partial+r.skipped+r.cancelled},problems:_(n),kinds:[...new Set([...n.values()].map(e=>e.kind))].sort(),tries:C(e)}}(e,n)),i}function C(e){let t=e.filter(f).length;return{tries:t,notStarted:e.length-t}}function ee(e){let t=(...t)=>e.nodes.filter(e=>t.includes(e.state)).length;return{done:t(`done`),partial:t(`partial`),skipped:t(`skipped`),cancelled:t(`cancelled`),failed:t(`failed`),notStarted:t(`blocked`),left:t(`pending`,`running`)}}function te(e){let t=Date.parse(e?.started_at??``),n=Date.parse(e?.last_ts??``);return Number.isNaN(t)||Number.isNaN(n)?null:Math.max(0,(n-t)/1e3)}function ne(e,t=!1){return t||e?.running?`running`:e?.unresponsive?`unresponsive`:`stopped`}var re=(e,t)=>t?.host_id?e?.find(e=>e.host_id===t.host_id):void 0;function ie(e){let t=e.run.length-(e.host_id?.length??0)-1;return e.host_id&&t>0&&e.run.endsWith(`@${e.host_id}`)?e.run.slice(0,t):e.run}var ae=[`running`,`unresponsive`,`stopped`];function oe(e,t=[]){let n=[...new Set(e.map(e=>e.host_id??``))],r=t.map(e=>e.host_id),i=e=>ae.indexOf(ne(e));return[...r.filter(e=>n.includes(e)),...n.filter(e=>!r.includes(e)).sort()].map(n=>({hostId:n,host:t.find(e=>e.host_id===n),runs:e.filter(e=>(e.host_id??``)===n).sort((e,t)=>i(e)-i(t))}))}var se=e=>!!e.stop&&e.stop!==`completed`&&e.stop!==`partial`&&e.stop!==`skipped`&&e.stop!==`cancelled`,w=e=>e.executor===`python`;function ce(e){let t=0;return e.map((n,r)=>{let i=e[r-1];return i&&(n.attempt??0)<=(i.attempt??0)&&t++,t})}var le=e=>`${e.ts}|${e.key}`,ue=(e,t)=>e.find(e=>e.run===t),de=(e,t)=>ne(t,!!e.procs?.alive)===`running`;function fe(e){return e?[...e.launches.map(e=>({cls:`llm`,id:`c:${e.key}`,kind:e.kind||`task`,unit:e.unit||``,detail:[e.unit,e.model||e.role].filter(Boolean).join(` | `),ageS:e.age_s,key:e.key})),...e.python_tasks.map(e=>({cls:`py`,id:`p:${e.key}`,kind:e.kind||`task`,unit:e.unit||``,detail:e.unit||`Python`,ageS:e.age_s,key:``}))]:[]}var pe=[`tiles`,`table`,`columns`,`lines`,`heatmap`,`hbars`,`status_grid`,`note`,`code`,`tree`,`embed`,`blocks`];function me(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.type;return typeof t==`string`&&pe.includes(t)?e:null}var he=e=>(e.scope??`run`)===`run`,ge={title:`contraagent`,panels:[],api_version:``},_e=(e,t)=>e instanceof i?e:new i(t,`network`),ve=class{constructor(e={}){this.snap={info:ge,runs:[],hosts:null,run:``,state:{journal:[],procs:null,plan:{nodes:[],groups:[],flow_calls:[]},outputs:{contracts:[],tally:{valid:0,invalid:0,refused:0,pending:0,failed:0,running:0}},forecast:null,cursor:null,panels:{},ready:!1},connected:!1,fresh:new Set,runsLoaded:!1,error:null,trends:null},this.trendsQuery=null,this.trendsAsked=0,this.trendsOver=null,this.refreshing=!1,this.trendsBusy=!1,this.infoError=null,this.runsError=null,this.hostsError=null,this.infoLoaded=!1,this.stopped=!1,this.listeners=new Set,this.rowListeners=new Set,this.closeFeed=null,this.queue=[],this.flushTimer=null,this.pollTimer=null,this.opts={runsEveryMs:5e3,batchMs:50,freshMs:4e3,...e},this.client=e.client??a(e.baseUrl===void 0?{}:{baseUrl:e.baseUrl})}get snapshot(){return this.snap}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}onNewRow(e){return this.rowListeners.add(e),()=>this.rowListeners.delete(e)}async start(){this.stopped=!1,await this.refresh(),this.schedule()}schedule(){this.stopped||this.opts.runsEveryMs<=0||this.pollTimer||(this.pollTimer=setTimeout(()=>{this.pollTimer=null,this.refresh().finally(()=>this.schedule())},this.opts.runsEveryMs))}async refresh(){if(this.refreshing)return;this.refreshing=!0;try{this.infoLoaded||await this.loadInfo(),await this.refreshRuns()}finally{this.refreshing=!1}let e=this.trendsQuery;!e||this.trendsBusy||this.stopped||this.trendsKey()===this.trendsOver||(this.trendsBusy=!0,this.fetchTrends(e).finally(()=>this.trendsBusy=!1))}trendsKey(){return`${this.snap.runs.map(e=>`${e.run}\t${e.last_ts}\t${e.attempts}`).join(`
|
|
2
2
|
`)}\n\n${this.trendPanelNames().join(`
|
|
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:
|
|
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:`選択中の項目`,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
|
-
`)}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=
|
|
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,${
|
|
8
|
-
${e.map(e=>
|
|
9
|
-
</div>`}var oi=
|
|
10
|
-
${H(this.options,e=>e.value,e=>{let t=e.value===this.value;return
|
|
11
|
-
</div>`}};U([
|
|
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:_e(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=_e(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=_e(e.reason,`${this.client.baseUrl}/api/runs`),t.status===`fulfilled`?(n.hosts=t.value,this.hostsError=null):this.hostsError=_e(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(he).map(e=>e.name).join(`
|
|
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}},forecast:null,cursor:null,panels:{},ready:!1},connected:!1,fresh:new Set}),!e))return;let t=this.snap.info.panels.filter(he).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`forecast`:n={...n,forecast: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(le(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(le(t));this.set({fresh:e})},this.opts.freshMs)}set(e){this.snap={...this.snap,...e};for(let e of this.listeners)e(this.snap)}},ye=encodeURIComponent;function be(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 xe=e=>Object.keys(e).length>0;function Se(e){return(t,n,r)=>{let i=!1;return(async()=>{try{let[a,o,s,c,l,u]=await Promise.all([e.journal(t),e.file(`runs/${ye(t)}/plan.json`),e.file(`runs/${ye(t)}/outputs.json`),e.file(`runs/${ye(t)}/forecast.json`).catch(()=>null),e.file(`runs/${ye(t)}/cursor.json`),Promise.all(n.map(n=>e.panel(t,n).catch(e=>({error:String(e)}))))]);if(i)return;r.open?.();let d=e=>!i&&r.message(e);for(let e of a.entries)d({event:`journal`,data:e});d({event:`plan`,data:o}),d({event:`outputs`,data:s}),c&&d({event:`forecast`,data:c}),d({event:`cursor`,data:xe(l)?l:null}),n.forEach((e,t)=>d({event:`panel:${e}`,data:u[t]??{}})),d({event:`ready`,data:{journal:a.total}})}catch{i||r.error?.()}})(),()=>{i=!0}}}var Ce=()=>({input:0,output:0,cache_read:0,cache_creation:0,calls:0,cost:null,reported:0}),we=e=>e.input+e.output+e.cache_read+e.cache_creation;function Te(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 Ee(e){let t={input:0,output:0,cache_read:0,cache_creation:0,calls:0,cost:null,reported:0};for(let n of e)Te(t,n);return t.reported?t:null}function De(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){Te(r,i);let e=t(i),a=n.get(e);a||n.set(e,a={id:e,kind:i.kind,unit:i.unit??``,spend:Ce(),share:null}),Te(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)||we(t.spend)-we(e.spend))}var Oe=e=>De(e,e=>e.kind).map(e=>({...e,unit:``})),ke=e=>(e.input??0)+(e.output??0)+(e.cache_read??0)+(e.cache_creation??0);function Ae(e,t){switch(t){case`cost`:return e.cost_usd??null;case`tokens`:return ke(e);case`time`:return e.wall_s??0;case`sessions`:return e.sessions}}var je=e=>[`cost`,`tokens`,`time`,`sessions`].filter(t=>e.some(e=>(Ae(e,t)??0)>0)),Me=e=>Date.parse(e.observed_at??``),Ne=e=>!Number.isNaN(Me(e))&&(e.five_hour_pct!=null||e.seven_day_pct!=null);function Pe(e){let t=[];for(let n of e)for(let e of n.quota??[])Ne(e)&&t.push({reading:e,key:n.key,attempt:n.attempt??0});return t.sort((e,t)=>Me(e.reading)-Me(t.reading))}var Fe=e=>`${e.credential??``}\0${e.account??``}`;function Ie(e){let t=new Map;for(let{reading:n}of Pe(e)){let e=Fe(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 Le(e,t){let n=(e.quota??[]).filter(Ne).sort((e,t)=>Me(e)-Me(t)),r=Date.parse(e.ts),i=n[0]??null,a=i===null?``:Fe(i);return{start:i,next:(i===null||Number.isNaN(r)?void 0:t.find(e=>Me(e.reading)>r&&Fe(e.reading)===a))?.reading??null}}function Re(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 T(e,t){if(!e||!t)return e??``;let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return e.replace(RegExp(`(?:/[^\\s:'"]*)?/${n}/`,`g`),``)}var ze=`lit-localize-status`,E=(e,...t)=>({strTag:!0,strings:e,values:t}),Be=(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},Ve=e=>{return typeof(t=e)!=`string`&&`strTag`in t?Be(e.strings,e.values):e;var t},D=Ve,He=!1,Ue=class{constructor(e){this.__litLocalizeEventHandler=e=>{e.detail.status===`ready`&&this.host.requestUpdate()},this.host=e}hostConnected(){window.addEventListener(ze,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(ze,this.__litLocalizeEventHandler)}},We=e=>e.addController(new Ue(e)),O=()=>(e,t)=>(e.addInitializer(We),e),Ge=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)}},Ke=[];for(let e=0;e<256;e++)Ke[e]=(e>>4&15).toString(16)+(15&e).toString(16);var qe=new WeakMap,Je=new Map;function Ye(e){window.dispatchEvent(new CustomEvent(ze,{detail:e}))}var Xe,Ze,Qe,$e,et,tt=``,nt=new Ge;nt.resolve();var rt=0,it=e=>(function(){if(He)throw Error(`lit-localize can only be configured once`);D=(e,t)=>function(e,t,n){if(e){let r=e[n?.id??function(e){let t=typeof e==`string`?e:e.strings,n=Je.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 Ke[c>>8]+Ke[255&c]+Ke[o>>8]+Ke[255&o]+Ke[i>>8]+Ke[255&i]+Ke[n>>8]+Ke[255&n]}(typeof e==`string`?e:e.join(``))}(t,typeof e!=`string`&&!(`strTag`in e)),Je.set(t,n)),n}(t)];if(r){if(typeof r==`string`)return r;if(`strTag`in r)return Be(r.strings,t.values,r.values);{let e=qe.get(r);return e===void 0&&(e=r.values,qe.set(r,e)),{...r,values:e.map(e=>t.values[e])}}}}return Ve(t)}(et,e,t),He=!0}(),tt=Ze=e.sourceLocale,(Qe=new Set(e.targetLocales)).add(e.sourceLocale),$e=e.loadLocale,{getLocale:at,setLocale:ot}),at=()=>tt,ot=e=>{if(e===(Xe??tt))return nt.promise;if(!Qe||!$e)throw Error(`Internal error`);if(!Qe.has(e))throw Error(`Invalid locale code`);let t=++rt;return Xe=e,nt.settled&&(nt=new Ge),Ye({status:`loading`,loadingLocale:e}),(e===Ze?Promise.resolve({templates:void 0}):$e(e)).then(n=>{rt===t&&(tt=e,Xe=void 0,et=n.templates,Ye({status:`ready`,readyLocale:e}),nt.resolve())},n=>{rt===t&&(Ye({status:`error`,errorLocale:e,errorMessage:n.toString()}),nt.reject(n))}),nt.promise},st=globalThis,ct=st.ShadowRoot&&(st.ShadyCSS===void 0||st.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,lt=Symbol(),ut=new WeakMap,dt=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==lt)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(ct&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=ut.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ut.set(t,e))}return e}toString(){return this.cssText}},ft=e=>new dt(typeof e==`string`?e:e+``,void 0,lt),k=(e,...t)=>new dt(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,lt),pt=(e,t)=>{if(ct)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=st.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},mt=ct?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return ft(t)})(e):e,{is:ht,defineProperty:gt,getOwnPropertyDescriptor:_t,getOwnPropertyNames:vt,getOwnPropertySymbols:yt,getPrototypeOf:bt}=Object,xt=globalThis,St=xt.trustedTypes,Ct=St?St.emptyScript:``,wt=xt.reactiveElementPolyfillSupport,Tt=(e,t)=>e,Et={toAttribute(e,t){switch(t){case Boolean:e=e?Ct: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}},Dt=(e,t)=>!ht(e,t),Ot={attribute:!0,type:String,converter:Et,reflect:!1,useDefault:!1,hasChanged:Dt};Symbol.metadata??=Symbol(`metadata`),xt.litPropertyMetadata??=new WeakMap;var kt=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=Ot){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&>(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=_t(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)??Ot}static _$Ei(){if(this.hasOwnProperty(Tt(`elementProperties`)))return;let e=bt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Tt(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Tt(`properties`))){let e=this.properties,t=[...vt(e),...yt(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(mt(e))}else e!==void 0&&t.push(mt(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 pt(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?Et: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?Et: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??Dt)(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){}};kt.elementStyles=[],kt.shadowRootOptions={mode:`open`},kt[Tt(`elementProperties`)]=new Map,kt[Tt(`finalized`)]=new Map,wt?.({ReactiveElement:kt}),(xt.reactiveElementVersions??=[]).push(`2.1.2`);var At=globalThis,jt=e=>e,Mt=At.trustedTypes,Nt=Mt?Mt.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,Pt=`$lit$`,Ft=`lit$${Math.random().toFixed(9).slice(2)}$`,It=`?`+Ft,Lt=`<${It}>`,Rt=document,zt=()=>Rt.createComment(``),Bt=e=>e===null||typeof e!=`object`&&typeof e!=`function`,Vt=Array.isArray,Ht=e=>Vt(e)||typeof e?.[Symbol.iterator]==`function`,Ut=`[
|
|
5
|
+
\f\r]`,Wt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Gt=/-->/g,Kt=/>/g,qt=RegExp(`>|${Ut}(?:([^\\s"'>=/]+)(${Ut}*=${Ut}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),Jt=/'/g,Yt=/"/g,Xt=/^(?:script|style|textarea|title)$/i,Zt=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),A=Zt(1),j=Zt(2),Qt=Symbol.for(`lit-noChange`),M=Symbol.for(`lit-nothing`),$t=new WeakMap,en=Rt.createTreeWalker(Rt,129);function tn(e,t){if(!Vt(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return Nt===void 0?t:Nt.createHTML(t)}var nn=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=Wt;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===Wt?c[1]===`!--`?o=Gt:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=qt):(Xt.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=qt):o=Kt:o===qt?c[0]===`>`?(o=i??Wt,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?qt:c[3]===`"`?Yt:Jt):o===Yt||o===Jt?o=qt:o===Gt||o===Kt?o=Wt:(o=qt,i=void 0);let d=o===qt&&e[t+1].startsWith(`/>`)?` `:``;a+=o===Wt?n+Lt:l>=0?(r.push(s),n.slice(0,l)+Pt+n.slice(l)+Ft+d):n+Ft+(l===-2?t:d)}return[tn(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},rn=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]=nn(t,n);if(this.el=e.createElement(l,r),en.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=en.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(Pt)){let t=u[o++],n=i.getAttribute(e).split(Ft),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?ln:r[1]===`?`?un:r[1]===`@`?dn:cn}),i.removeAttribute(e)}else e.startsWith(Ft)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Xt.test(i.tagName)){let e=i.textContent.split(Ft),t=e.length-1;if(t>0){i.textContent=Mt?Mt.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],zt()),en.nextNode(),c.push({type:2,index:++a});i.append(e[t],zt())}}}else if(i.nodeType===8){if(i.data===It)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(Ft,e+1))!==-1;)c.push({type:7,index:a}),e+=Ft.length-1}}a++}}static createElement(e,t){let n=Rt.createElement(`template`);return n.innerHTML=e,n}};function an(e,t,n=e,r){if(t===Qt)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=Bt(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=an(e,i._$AS(e,t.values),i,r)),t}var on=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??Rt).importNode(t,!0);en.currentNode=r;let i=en.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new sn(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new fn(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=en.nextNode(),a++)}return en.currentNode=Rt,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++}},sn=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=M,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=an(this,e,t),Bt(e)?e===M||e==null||e===``?(this._$AH!==M&&this._$AR(),this._$AH=M):e!==this._$AH&&e!==Qt&&this._(e):e._$litType$===void 0?e.nodeType===void 0?Ht(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!==M&&Bt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Rt.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=rn.createElement(tn(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new on(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=$t.get(e.strings);return t===void 0&&$t.set(e.strings,t=new rn(e)),t}k(t){Vt(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(zt()),this.O(zt()),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=jt(e).nextSibling;jt(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},cn=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=M,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=M}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=an(this,e,t,0),a=!Bt(e)||e!==this._$AH&&e!==Qt,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=an(this,r[n+o],t,o),s===Qt&&(s=this._$AH[o]),a||=!Bt(s)||s!==this._$AH[o],s===M?e=M:e!==M&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===M?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},ln=class extends cn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===M?void 0:e}},un=class extends cn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==M)}},dn=class extends cn{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=an(this,e,t,0)??M)===Qt)return;let n=this._$AH,r=e===M&&n!==M||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==M&&(n===M||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)}},fn=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){an(this,e)}},pn={M:Pt,P:Ft,A:It,C:1,L:nn,R:on,D:Ht,V:an,I:sn,H:cn,N:un,U:dn,B:ln,F:fn},mn=At.litHtmlPolyfillSupport;mn?.(rn,sn),(At.litHtmlVersions??=[]).push(`3.3.3`);var hn=globalThis,N=class extends kt{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 sn(t.insertBefore(zt(),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 Qt}};N._$litElement$=!0,N.finalized=!0,hn.litElementHydrateSupport?.({LitElement:N});var gn=hn.litElementPolyfillSupport;gn?.({LitElement:N}),(hn.litElementVersions??=[]).push(`4.2.2`);var P=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},_n={attribute:!0,type:String,converter:Et,reflect:!1,hasChanged:Dt},vn=(e=_n,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 F(e){return(t,n)=>typeof n==`object`?vn(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 I(e){return F({...e,state:!0,attribute:!1})}var yn=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function bn(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 yn(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 yn(n,r,{get(){return a(this)}})}}var xn,Sn=t({templates:()=>Cn}),Cn=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:`出力`,"edge-a":`完了を待つ`,"edge-c":`結果を受けて作成`,"edge-g":`出力を受け取る`,f:`停止`,h0:A`JSON Lines(1 行ごとに JSON オブジェクト、スキーマ ${0})`,h5:A`${0} の出力`,h6:A`JSON オブジェクト(スキーマ ${0})`,h87:A`依存先タスク ${0}`,h8e:A`この実行には階層 <code>${0}</code> がありません`,ha:A`ファイルなし | Python コードで定義(<code>TaskAdapter</code>)`,hc:A`実行中 ${0}${1}`,hf:A`${0} の出力から`,i:`未確認`,"no-":`実行はまだありません`,non:`なし`,"outcome-c":`取り消し`,"outcome-d":`完了`,"outcome-p":`一部のみ完了`,"part-d":`定義`,"part-i":`入力ファイル`,"part-p":`パラメータ`,s000:`実行履歴の未実行のタスク`,s00c:E`HTTP ステータス ${0}`,s02f7:`実行されず`,s02f9:E`アカウント: ${0}`,s030:E`カスタムビュー ${0} はありません`,s037:`完了`,s0382:E`${0}: ${1}`,s038b:`ページ`,s03b:`タブ`,s03e:`タスク`,s03f:E`古い試行 ${0} 件は非表示`,s041:E`ほか ${0} 件`,s042:`タスクが宣言したパターンの下で、試行が作成・変更・削除したファイル(changes)`,s044:E`一部のみ完了 ${0} 件`,s048:`再開後に再実行`,s04f:`停止した部分`,s051:`実行中のエージェントのセッション`,s055:`選択中の項目`,s05f:`認証エラー`,s061:`OutputContract`,s062:`トランスクリプト`,s0668:`ユニットごとのステージとステップ(CursorStore)`,s066d:`出力`,s06a:`Esc: 1 つ上の階層`,s06b0:`実行中ではありません`,s06bf:`中を表示`,s077:`テキストフィルター(/)`,s079:E`キャッシュ ${0}`,s07d:`関数`,s07e:E`+${0}`,s087:E`${0}%`,s08b1:E`${0}(認証情報が休止中)`,s08b3:`いいえ`,s08c:`稼働中`,s0932:`出力の検証: OK`,s0935:`終了日`,s094:`最初のエージェントのセッションの前に終了`,s09b:`プロンプトなし`,s0a:E`入力元: ${0}`,s0b0:E`作成元: ${0}`,s0b2:`エージェントのセッション開始時のサブスクリプション利用率(アカウント全体)`,s0b3:`OK`,s0b7:`実行前からあるファイル`,s0bf:E`${0} 周目`,s0c:E`モデル切り替えのあったタスク ${0} 件`,s0d7:E`キャッシュ書き込み ${0}`,s0df:`依存先タスクが登録されなかった`,s0e6:`問題`,s0ea:`プラグインディレクトリ`,s0ef:`すべてのホスト`,s0f0:`一部省略`,s0f1:`リセット済み`,s0f2:E`最初の API 呼び出しの入力: ${0}`,s0f8:E`出力ファイル ${0} 件`,s103:`再開カーソル`,s104:`昇順に並べ替え`,s107:`種別の最初のタスクの開始時に記録(definitions/<kind>.json)`,s108:E`${0} の実装`,s114:E`${0} 型の JSON 値`,s115:`過去 24 時間`,s123:`待機中`,s125:E`要素 ${0} 個`,s12c:`型の不一致`,s13:E`最終報告 ${0}`,s14b:`コーディングエージェントが報告した値`,s14c:E`この失敗で ${0} が ${1} で停止`,s150:`出力`,s156:`なし(任意)`,s158:E`週の利用率 ${0}`,s159:`このタスクが代わりに出力ファイルを書く種別(output_of)`,s163:`検証対象のファイルなし`,s165:E`${0} 回目で完了 | 失敗 1 回`,s168:`検証のタイミング`,s170:E`実行されず ${0} 件`,s172:E`同じフローの実行 ${0} から見込んだ、この実行がまだ作成していないタスク(forecast)`,s179:`アカウントごと、最初の値 → 最後の値`,s17d:`利用率のルール`,s17e:`書き込み待ち(タスクが待機中)`,s18:E`ループ内の ${0}`,s197:`利用できるモデルなし`,s19e:`上限: max_concurrent`,s1a2:E`スキップ ${0} 件`,s1a3:`種別 · ユニット`,s1a4:`モデルごとの、エージェントのセッションの使用量。モデル切り替えの前後は別々に集計(Plan.models)`,s1ac8:`エディタのテーマ`,s1acc:`書き込まれていない出力 1 件(タスクが未実行)`,s1b2:E`種別 ${0}`,s1bb:`すべてのタスクが開始済み`,s1bf:`実行中のプロセスなし`,s1c0:`パラメータ`,s1c2:`タスクが選択されていません`,s1c4:E`セッション開始時の利用率(アカウント全体): ${0}`,s1c7:`実行に登録されたすべてのタスク(種別ごと、plan.jsonl)`,s1cc:`実行中の Python タスク`,s1d4:`どのフローも結果を待たず、after= にも渡さず、戻り値にも含めなかったタスク(unawaited)。出力ファイルと変更のために実行された`,s1db:`API エラー`,s1dc:E`試行 ${0} 回`,s1dd:`実行中のタスクなし`,s1e9:E`プロンプト(${0} 文字、ほか ${1} 文字は未保存)`,s1eb:`入力`,s1f2:`削除`,s1f5:E`所要時間 ${0}`,s204:`安全分類器による停止`,s20e:E`リセットまで ${0}`,s20f9:`依存先タスクが実行されなかった`,s20fd:`ホストなし`,s217:`あり`,s21a:`発生したらリトライする例外(retry_on)`,s221:`JSON ではありません`,s224:`ツール実行中に中止`,s230:`スキーマにないフィールド`,s234:`終了した試行はまだありません`,s236:`拡大`,s23b:E`${0} 回の試行がすべて失敗: ${1}`,s23f:`定義はまだありません`,s24:E`完了 ${0}`,s257:`OutputContract・InputContract を宣言したタスクはありません`,s25f:E`まだ登録されていない種別: ${0}`,s260:`API 呼び出し 1 回`,s26ba:`ユニットなし`,s26bb:`実行した試行の回数(リトライを含む、journal.jsonl)`,s26e:E`API 呼び出し ${0} 回`,s27a:`最後のメッセージから`,s27b:E`ユニット: ${0}`,s27d:`フローの構成`,s28a2:`リプレイ`,s28ad:`曜日と時刻ごと(期間のタイムゾーン)`,s28f:`InputContract`,s29:E`最大コンテキスト: ${0}`,s2a:`現在`,s2c0:E`パラメータ ${0}`,s2c8:`リトライ`,s2cd:`モデルの利用可否`,s2dd:`試行の結果(stop)`,s2df0:`割合`,s2df6:`開始時も同じ内容`,s2e3:E`ほかの出力 ${0} 件`,s2e4:`周`,s2f34:E`${0} 周`,s2f3c:`問題なし`,s2f4:`すべての出力`,s2f5:`定義なし`,s2fa:E`5 時間枠の利用率 ${0}(リセット ${1})`,s2fe3:`ツール`,s2fea:E`修正依頼 ${0}`,s313:`終了(未実行のタスク 1 件)`,s31a:E`待たれなかったタスク ${0} 件`,s321:`余分なフィールド`,s326:E`キャッシュ読み込み ${0}`,s32d:`最大コンテキスト`,s33b:`パイプラインの階層`,s33f:E`${0} で停止`,s343:`新しいイベント 1 件を表示`,s34b:`終了`,s34e:`降順に並べ替え`,s351:`終了した試行なし`,s352:`ファイル全体`,s355:`入力ファイルに検証エラー`,s366:`週`,s367:`料金`,s368:`コピー`,s36d:E`この書き出しに含まれないもの: ${0}`,s36e:E`所要時間 ${0}`,s3700:`Web 検索 1 回`,s370b:E`報告時刻 ${0}`,s378:`検証エラーの後に、同じエージェントのセッションで続けるラウンド(rounds)`,s37d:`スキーマ以外の検証(validators)`,s384:E`${0} を展開`,s387:E`検索結果 ${0} 件`,s38e65:`修正依頼のプロンプトに含めて送信`,s38e6a:`日ごとの料金`,s390:`JSON オブジェクトではありません`,s39e:`パイプライン`,s3a7:E`上限: ${0}`,s3aa:`出力ファイルなし`,s3b3:`プロセスツリー`,s3b9:E`${0} にモニター API がありません: ${1}`,s3bd:E`task_detail コールバックが失敗: ${0}`,s3c6:`実行した試行の回数`,s3cd:`実行中のエージェントのセッション 1 件`,s3d0:`エージェントのセッション`,s3d1:`概要`,s3d31:`利用できるモデルがなく、設定どおりのモデルで実行する種別(kept)`,s3d38:E`認証情報 ${0}`,s3d99:`検証エラー後の、同じエージェントのセッション`,s3d9b:`テキストファイル`,s3dd:`ネットワークエラーで応答なし`,s3f1:`各タスクが書き込むファイル`,s3f7:`修正依頼`,s3fd6:`開始`,s3fda:`このタスクの出力が後続タスクのパラメータに含まれる(given_from)`,s407:E`${0}: 入力`,s408:`週の利用率`,s41:`Tab: 次のノード`,s42a:`フィールド`,s42c:`検証`,s438:`ハイライトを解除`,s43a:`入力ファイル`,s43e:`利用不可`,s451:`料金の高いタスク`,s454:E`${0} のループの各周`,s45d:E`${0}(カスタムビュー)`,s466:`モデル切り替えのあったタスク 1 件`,s467:E`1 周: ${0}`,s473:`キャッシュ読み込み`,s478:`検証対象のファイル(OutputContract、InputContract)`,s479:`締め切り`,s47a:E`このタスクの入力 ${0} 件`,s47b:`Python タスク`,s47c:`未対応のイベント`,s482:E`終了 ${0}`,s484:`テキストなし`,s48e:`所要時間`,s490:`モニターのサーバーに接続済み`,s491:E`${0} のループ`,s4a:E`${0} 日前`,s4c:`あと 1 件の見込み(forecast)`,s4d6:`検索結果 1 件`,s4d8:`モデル切り替え`,s4e7:E`修正依頼 ${0} 回で完了 | 最初の検証エラー: ${1}`,s4ef:`ループ`,s4f0:`スキーマにない`,s4f9:E`ホスト ${0}`,s4fe:`エージェントタスク`,s5013:E`取り消し ${0} 件`,s5018:E`${0}: ${1} → ${2}`,s504:`日付指定`,s5131:`そのモデルで始めたエージェントのセッションの数`,s5138:`入力・出力・キャッシュ読み込み・キャッシュ書き込みの合計`,s514:`実行が終了した`,s521:`1 ユニット`,s522:`安全分類器がエージェントのセッションの一部を止め、セッションはそのまま続いた(safety_stops)`,s525b:`失敗の後の、次のモデルでの新しいエージェントのセッション(Router のホップ)`,s525c:`記録から再生した試行(replayed)`,s529:E`上限 ${0}`,s52b:`このバージョンの contraagent が対応していないイベント種別(unread_events)`,s52c7:`次の周`,s52cc:E`${0} の締め切りと仕上げの猶予を過ぎた`,s52cf:`カスタムビュー`,s535:`種別`,s53c5:E`${0}: 未実行`,s53c8:`不可`,s541:`開始できず`,s543:`プロンプト`,s5522:E`フロー呼び出し ${0}`,s552a:E`${0} の失敗により停止`,s555:`プラグインディレクトリ`,s558:`認証情報の不一致`,s5590:`項目`,s559f:`その他のモデル`,s55f:E`${0}(${1})`,s566:E`(ほか ${0} 文字は未保存)`,s567:`未実行(依存先タスクが失敗)`,s568:E`後続タスク: ${0}`,s571:E`入力 ${0} がありません(${1} が未実行)`,s574:E`キャッシュ書き込み ${0}`,s585:E`入力 ${0} がありません(${1} が失敗)`,s587:E`${0} 以降報告なし`,s58b:`モデルの置き換え`,s58c:`実行履歴`,s591:`5 時間枠`,s594:E`修正依頼 ${0} 回`,s59e:`上限に接近`,s5a3:`休止中`,s5a7:`ツール`,s5ab:`並び順`,s5b9:`種別ごとのトークンと料金`,s5bd:`フロー呼び出しごとの締め切り(time_box)`,s5c7:`サービスなし`,s5cb:`分岐`,s5cd:E`エージェントのセッション ${0} 回`,s5cf:`値なし`,s5d0:`実行中にこのタスクが占有する名前(claims)`,s5d4:E`${0} 回目で完了 | 失敗 ${1} 回`,s5da:`モデル`,s5de:`依存先タスク`,s5e3:`書き込みなし(タスクが未実行)`,s5e6:`テキスト(JSON 文字列)`,s5f2:`ロールなし`,s5f31:`エージェント・モデル・認証情報`,s5f34:`エラー`,s5f40:`行なし`,s5f43:`ソース`,s5f7:`なし(必須)`,s5f8:E`認証情報 ${0} は休止中`,s5ff:`エージェントタスク`,s601:`実行中`,s605:E`未実行の後続タスク ${0} 件`,s620:`キャッシュ書き込み`,s629:`任意`,s647:`応答が JSON ではなく HTML`,s649:`後続タスク`,s64a:`前のタスクの出力は同じなのに、フローが別のパラメータを渡した(divergence)。時刻、乱数、外部の状態、フローのコードの変更による`,s64f:`変更禁止の箇所`,s652:E`ロック ${0} 件`,s653:`締め切りを過ぎた`,s65c:`中断`,s6645:`拡大(Ctrl + スクロール)`,s6647:`ファイルなし`,s664b:`ツール呼び出しが戻る前に実行が終了`,s670:E`${0} ユニット`,s673:`停止でエラー`,s680:`タイムライン`,s685:`修正依頼`,s688:`その他の検証`,s68d:E`仕上げの猶予 ${0}`,s695:`修正依頼 1 回`,s699:E`スキーマ ${0}`,s6a0:`1 ステップ完了`,s6a8:E`入力 ${0} がありません(${1} が未完了)`,s6aa:`未実行(入力ファイルなし)`,s6b0:`ホスト`,s6b8:E`同時実行 ${0}/${1}`,s6b9:`タスクなし`,s6c3:`依存先タスクなし`,s6c7:`実行の開始時刻`,s6c8:E`依存先タスク ${0} が失敗`,s6d7:E`${1} タスク中 ${0} 件完了`,s6db:E`${0} 文字`,s6e4:`未選択`,s6eb:`読み込み中…`,s6f1:`API 呼び出し`,s6f2:`出力ファイル 1 件`,s6f5:E`見込み: あと ${0} タスク`,s6fa:`フロー呼び出しがエラーで終了`,s700:`書き出しに含まれない`,s703:E`${0} まで休止`,s706:`実行グループ`,s70a7:E`タスク終了後の利用率: ${0}`,s70af:`種別`,s71:E`モデル切り替え: ${0}`,s721:`ホストからの報告なし`,s7233:`古い試行 1 件は非表示`,s7239:E`修正依頼のあったタスク ${0} 件`,s72dc:`ユニットごとの周回数`,s72dd:`キャッシュ読み込み`,s734:`スタブエージェント`,s737:`ループの周回数`,s73d:`未実行の後続タスク 1 件`,s755:E`プラグイン ${0}`,s758:`エージェントのセッションなし`,s75e:`実行を検索`,s767:E`${0} モニター`,s76d:`カスタム列(row_extras)`,s76f:`原因`,s771:E`入力 ${0} は失敗したタスク ${1} の出力`,s77e:E`未実行 ${0} 件`,s782:`書き足す対象のファイル`,s786:`トランスクリプト`,s78f:`トークン`,s797:`すべての中を隠す`,s79a:E`未対応のイベント: ${0}`,s79f:E`5 時間枠の利用率 ${0}`,s7a1:`エラーで終了したフロー呼び出し 1 件`,s7a3:`出力ファイル`,s7a4:`権限エラー`,s7b16:`入力ファイルなし`,s7b1c:`修正依頼のあった試行`,s7b3:`検索に一致する実行なし`,s7bf:E`最初のエージェントのセッションの前に各モデルへ送る 1 回のリクエスト(preflight, policy ${0})`,s7c0:E`ホストからの報告なし ${0} 件`,s7c9:`フィルター`,s7cd8:`このタスクの入力 1 件`,s7cd9:`利用できるモデルがなく、最初に応答したモデルで実行する種別(substitute)`,s7cf:`応答が JSON ではない`,s7da:`最終報告`,s7df:E`終了(未実行のタスク ${0} 件)`,s7e:E`ロール ${0}`,s7f:`表示形式`,s803:`ファイル`,s807:`実行 1 件`,s80c:`1 行`,s816:`モデル切り替えなし`,s817:`変更したファイル 1 件`,s822:E`以前の試行のモデル: ${0}`,s826:`エージェントのセッションが使ったモデル`,s827:`認証情報が休止中`,s83:E`書き込み ${0}`,s841:`たった今`,s843:E`修正依頼 ${0} 回後`,s84f:`リトライ`,s8512:E`テーマ: ${0}`,s851d:`ファイルの値`,s859:`実行中`,s85e:E`${0}: モデル切り替え`,s863:E`入力 ${0} がありません`,s864:`全体を表示`,s868:E`${2} 年 ${0}〜${1} | ${3}`,s86c:E`ホスト ${0} 台`,s874:E`${0} ステップ完了`,s877:E`${0} 回目の失敗後の、新しいエージェントのセッション`,s87a:`実行されず`,s87b:E`モデル切り替え後に完了: ${0}`,s87c:`修正依頼 1 回後`,s880:`全試行の合計`,s888:`入力`,s88b:`表で表示`,s88e:E`修正依頼 ${0}`,s892:E`入力 ${0}(${1} の出力)がありません`,s89e:`パラメータなし`,s8a56:`なし`,s8a59:E`PID ${0}`,s8ab:`コーディングエージェント`,s8ad:`周回数`,s8ae:E`${0} の記録から再生したエージェントのセッションと、そこに記録した新しいセッション(replay, record_missing)`,s8b1:`リトライしたタスク`,s8b4:`同じロックを持つタスクが共有する常駐の補助プロセス(services.jsonl)`,s8bb:`終了したすべての試行から集計(journal.jsonl)`,s8c1:E`${0} 分前`,s8c5:`このタスクの結果を受け取った直後に、フロー呼び出しが後続タスクを作成した(created_from)`,s8d3:`コーディングエージェントが使ったアカウントまたは API キー(credential)`,s8d4:`PID`,s8dd:E`キャッシュ読み込み ${0}`,s8de:`再開後の実行での、新しいエージェントのセッション`,s8df:`オブジェクト`,s8e3:`アシスタント`,s8e6:`Python コードで定義`,s8e9:E`ほか ${0} アカウント`,s8ea:`Tab: 次の行`,s8f1:`選択を解除`,s8f2:`ユニット`,s8f4:`入力と出力(全試行の合計)`,s8f5:`未実行`,s8fa:`未実行(入力ファイルなし、入力ファイルに検証エラー)`,s8fc:E`修正依頼 1 回で完了 | 最初の検証エラー: ${0}`,s900:`ビュー`,s901:`完了したタスク`,s906:`Python タスク`,s90c:E`コンテキストの上限 ${1} の ${0}%`,s90e:`ほかの種別が実装する種別(base_kind)`,s90f:`認証エラー`,s914:E`最大 ${0} 周`,s915:E`モデル ${0} 種類`,s919:E`${0}d ${1}h`,s91d:`順序のみの依存先`,s924:E`モデル ${0}`,s92a:E`依存先タスク ${0} 件の出力待ち`,s92b:E`5 時間枠 ${0}`,s934:`試行 1 回`,s936:`キュー内で同順位のタスクの順序を決める値(priority)`,s93e:`リプレイ`,s941:E`1 日あたり ${0}`,s949:`書き出しの期間`,s94d:`認証情報`,s94e:E`最終更新 ${0}`,s94f0:`実行中のタスク`,s94fd:E`${0} を折りたたむ`,s967:E`失敗 ${0} 件`,s96a:`コンテキストの上限`,s96c:E`出力 ${0}`,s97:E`修正依頼 ${0} 回で完了`,s980:`テキストフィルター`,s9893d9:E`利用率のルール: ${0}`,s9893de:`ホスト 1 台`,s98b:`グループ`,s98f:`入力ファイルなし`,s99:E`${0} 日間`,s9a2:`すべてのプロセス`,s9a4:E`失敗: ${0}`,s9a6:E`Web 検索 ${0} 回`,s9aa:`API 呼び出し 1 回あたりの入力の最大値。キャッシュ読み込みとキャッシュ書き込みを含む(peak_context)`,s9b1a6:`実行中ではありません`,s9b1a9:E`仕上げの種別: ${0}`,s9b3:`報告間隔`,s9b7:`書き込みなし(タスクが失敗)`,s9bd:E`${0} 回目で完了 | 失敗 ${1} 回 | 最初の失敗: ${2}`,s9c3:E`上限を超えた利用: ${0}`,s9c5:E`${0} の出力`,s9c7:`すべての中を表示`,s9cb:`実装する種別`,s9d3:E`${0} 時点の書き出し`,s9d6:`最終応答なしで終了`,s9de:`モデル`,s9e0:E`状態: ${0}`,s9e8:`未実行(入力ファイルに検証エラー)`,s9f0:E`入力 ${0}`,s9f2:`一部のみ完了`,s9f7:`エラー`,s9f92:E`${0} の内部`,s9f97:`料金の上限`,s9fb:`実行`,s9fd:`タスクの開始前からあるファイルも有効`,s9ff:`モデル切り替え`,sa1:`リプレイした試行`,sa23:`ターン数の上限`,sa24:E`${0} の締め切りまでに終わらない`,sa31:`行を折り返す`,sa33:`後続タスクなし`,sa358:`ロール`,sa35c:`試行`,sa36:`モデル別の内訳`,sa39:E`実行中のエージェントのセッションの新しいイベント ${0} 件を表示`,sa3c:`形式`,sa3d3:E`週の利用率 ${0}(リセット ${1})`,sa3de:`停止`,sa3e:`アカウント全体の値 | エージェントのセッション開始時に取得`,sa3f:`各タスクが読み込むファイル`,sa43:`作成元`,sa48:`コマンドライン`,sa4f:E`最大 ${0} 回`,sa508:`安全分類器による停止 1 件`,sa50a:`折りたたむ`,sa54:`API 呼び出しごとのトークンは不明`,sa57:`権限エラーになったツール呼び出し`,sa58:`周回数`,sa62:E`${0}: トランスクリプト`,sa66:E`前の ${0} 行を表示`,sa6a:`開始日`,sa70:`項目なし`,sa71:`期待する型`,sa74:`縮小(Ctrl + スクロール)`,sa81:`システム設定に合わせる`,sa84:E`新しいイベント ${0} 件を表示`,sa86:E`${0} 時間前`,sa87:`ソースを表示`,sa88:E`${0} の入れ子のループ`,sa8b:`Shift + 矢印キー: 依存先タスク・後続タスク`,sa9b:`タスク詳細`,sa9d:`報告なし`,saa0:`書き込み待ち(タスクが実行中)`,saa2:`理由`,saaa:`5 時間枠の利用率`,saab:`テーマ`,sab5:E`${0} 行目`,sabd:`思考`,sac1:`モニターのサーバーに未接続`,sac7:E`${0} に利用できるモデルなし`,saca:`期間内の実行の合計`,sacb:`分かっているのはコーディングエージェントが出力したトークンの合計だけ。API 呼び出しごとのトークンは不明(usage_unknown)`,sacc:`可`,sad1:E`ほかに休止中の認証情報 ${0} 件`,sad3:`状態`,sad9:`API リクエストを再送`,sadb:`トークンは不明`,sae5:`必須`,sae6:`実行履歴のリトライしたタスク`,saee:`プロセス`,saf2:`すべてのモデルが利用可能`,saf8:`変更したファイルなし`,safd:E`${0} 回目が失敗: ${1}`,sb05:`エラー`,sb06:`実行履歴の修正依頼のあった試行`,sb0c:`サブスクリプションの利用率`,sb0f:`Python タスク 1 回`,sb105:E`未実行: ${0}`,sb106:`検索語`,sb108:`作成、試行の失敗後に削除`,sb14:E`報告なし ${0} 台`,sb16:E`${0} 行`,sb1f:`前の 1 行を表示`,sb24:E`この失敗で ${0} が停止`,sb26a:`登録順`,sb26f:`表示中の階層の外`,sb27:`Enter: 開く`,sb28:`キャッシュ書き込み`,sb31:E`プロンプト(${0} 文字)`,sb34:E`変更したファイル ${0} 件`,sb38:`ツール呼び出し`,sb45:`リトライしたタスク 1 件`,sb4d:`トランスクリプトなし`,sb51:`パイプラインのプロセス内`,sb53:`はい`,sb55:`コーディングエージェントが報告した値`,sb59:E`コンテキストの上限に接近(${0}%)`,sb5a:`未実行`,sb6:`タスク実行中の書き込みが必須`,sb7:E`${0} に停止`,sb81:`実行したエージェントのセッションのトークンは不明(usage_unknown)`,sb89:`エージェントのセッション 1 回`,sb94:E`5 時間枠(${0})`,sb97:`コンテキストの上限に接近`,sb98:E`${0}: 完了`,sb99:`トークンと料金`,sb9c:E`Python タスク: ${0}`,sba3:`1 周`,sba7:`ほかの出力 1 件`,sba8:`検証を通るファイルを書き込む前に、タスクが失敗`,sbaf:`要素 1 個`,sbb0:E`このバージョンの contraagent が対応していないイベント種別(unread_events): ${0}`,sbb2:`開始時の利用率`,sbb7:E`${1} タスク中 ${0} 件が未完了`,sbb9:`終了`,sbbe:`入力元`,sbc6:E`${0} 周: ${1}`,sbc9:E`以前の試行のモデル: ${0}`,sbca:`タスクの開始時`,sbcc:`依存先タスクが失敗`,sbd4:`実行を切り替え(r)`,sbd5:`停止の記録なし`,sbd9:`再開後`,sbdc:E`履歴にほか ${0} 件`,sbe2:`実行履歴の失敗した試行`,sbe4:E`${0} の記録から再生したエージェントのセッション(replay)`,sbe9:E`週(${0})`,sbea:`保存対象外(keep_transcripts = false)`,sbf18:`種別のロール`,sbf1d:E`ロック ${0}`,sbf2:`アクティビティなし`,sbf9:`スタブエージェントが台本どおりの応答で処理したタスク(stub)`,sc03:`それ以前`,sc07:`リトライ対象の例外`,sc15:`スキップ`,sc1a:E`待機中 ${0} 件`,sc1b:E`リトライしたタスク ${0} 件`,sc2:`ツール`,sc3:`この期間の実行はありません`,sc4:`タイムアウト`,sc53:`休止した認証情報`,sc54:E`${0} の締め切りを過ぎた`,sc57:E`入力 ${0} に検証エラー`,sc5b:`次のモデルでの新しいエージェントのセッション`,sc61:E`週 ${0}`,sc65:`縮小`,sc68:`日時`,sc6c:E`書き込まれていない出力 ${0} 件(タスクが未実行)`,sc6e:`締め切りまでに終わらない`,sc6f:E`エラーで終了したフロー呼び出し ${0} 件`,sc73:`開始`,sc75:E`全 ${1} 行のうち先頭 ${0} 行`,sc79:`タスク`,sc7d:`同時実行(上限)`,sc87a:E`警告のしきい値: ${0}`,sc87d:E`終了 ${0}`,sc92:`空き`,sc94:`全体`,sc97:`タイムゾーン`,sc9e:`その他`,sca1:`開始前に変更された`,sca4:`プロセスなし`,sca6:`プレビューを表示`,sca7:`ロール`,scb8:`終了(未完了のタスク 1 件)`,scb9:`最終試行の終了時刻`,scbd:`全文`,scca:E`最も高い種別: ${0}`,sccc:`モデルが応答を拒否`,scd1:`モデルの応答`,scd2:E`${0}: ${1} → 次のモデル`,scd94:`エージェントの所要時間`,scd9c:E`優先度 ${0}`,scdb:`Esc: 選択を解除`,scde:`ループ`,scf41:E`完了 ${0} 件`,scf43:E`入力 ${0} は失敗したタスクの出力`,scf70:`レート制限`,scf71:`失敗した試行の後の試行(retries)`,sd05:E`締め切り ${0}`,sd0e:`出来事`,sd17:`入力 / 出力 | キャッシュ読み込み / キャッシュ書き込み`,sd1f:`ファイルの検証に使うスキーマ`,sd20:E`順序のみの依存先: ${0}`,sd26:E`${0} 件を同時実行`,sd34:E`${0} に開始(${1})`,sd38:`変更`,sd3c:`登録済みのタスクなし`,sd3e:E`終了(未完了のタスク ${0} 件)`,sd40:`読み込むファイル(検証あり)`,sd47:`ローカルの認証情報(ambient)`,sd58:`終了(失敗したタスク 1 件)`,sd5a:`実行がシグナルで停止された`,sd5c:E`変更: ${0}`,sd5d:E`トークン: 入力 ${0}、出力 ${1}、キャッシュ読み込み ${2}、キャッシュ書き込み ${3}`,sd5e:`所要時間の合計`,sd73:`失敗`,sd744:`検証対象のファイル`,sd747:`なし(任意)`,sd75:`検証エラー`,sd776:E`全体の ${0}%`,sd77d:`実行中のエージェントのセッションの新しいイベント 1 件を表示`,sd7d:E`入力 ${0}(${1} の出力)に検証エラー`,sd82:`タスクの開始前からあるファイルは無効`,sd8a:E`${0} まで`,sd93:E`依存先タスク ${0} の出力待ち`,sd95:E`一部のみ完了: ${0}`,sd96:`中を隠す`,sda2:E`セッション開始時の利用率: ${0}`,sda80:E`すべて表示(${0} 文字)`,sda8d:`最大コンテキストが警告のしきい値を超えた(context_warned)`,sdb1:`入力`,sdb4:`イベントが途絶えた`,sdb8:`出力に検証エラー`,sdc:E`実行グループ ${0}`,sdd1:`モニターから応答がありません`,sdd4:`モデル 1 種類`,sdd8:`修正依頼なし`,sddf:`ビューを表示`,sde7:`履歴にほか 1 件`,sde8:E`アカウント ${0}`,sdf1:E`${0} 回目で完了 | 失敗 1 回 | 最初の失敗: ${1}`,sdf4:`リトライなし`,sdf9:`リトライ後に完了`,se0e6:E`${0} から休止中`,se0ed:E`実行されず: ${0}`,se17:E`必要な時間 ${0}`,se1a:`作成`,se21:`指標`,se27:`タスクを実行した CLI(claude、omp)`,se2b:E`キー ${0} 個: ${1}`,se2c:E`期待する型: ${0}`,se3:`キーボードショートカット`,se41:`作成、試行の失敗後も保持`,se4b:`修正依頼のあったタスク 1 件`,se55:`エージェントのセッションの所要時間の合計`,se5a:`モデル切り替え`,se5b:`推移`,se5d:`monitor.Panel`,se60:`ハイコントラスト`,se61:`パイプラインのプロセス内の関数`,se66:`1 タスク`,se69:`後続タスクはこのタスクの完了を待つが、出力は受け取らない(after)`,se6d:`下の階層あり`,se71:E`${0} 回目`,se75:`リプレイと新しいセッション`,se7b:E`タスクの所要時間 ${0}`,se8:E`安全分類器による停止 ${0} 件`,se90:`認証情報`,se99d:`ロック`,se99f:E`終了(失敗したタスク ${0} 件)`,sea2:`期間`,sea4:`定義`,sea6:`矢印キー: マーク`,sea74:E`${0} タスク`,sea7b:`実行の一覧`,seac:`待機中`,seb0:`グラフで表示`,seb2:`締め切りと仕上げの猶予を過ぎた`,seba:`既定`,sec2:`すべての種別`,sec7:`コーディングエージェントが使ったエージェント定義(agents/<role>.md)`,secc:`上限に到達`,secf:E`${0}の利用率 ${1}`,sed05:`コーディングエージェントが報告した料金(試行が終わった日に計上)`,sed0a:`タスクごとに 1 つ(Backend.run)`,sed7:`種別または関数`,sed8:`合計`,sede:`ステージなし`,seea0:`結果`,seea1:`ホスト ID なし`,seee1:`スキップ`,seee3:`完了しなかった試行`,sef0:E`実行中 ${0} 件`,sefc:`言語`,ser:`稼働中`,sf03:`所要時間の中央値`,sf06:E`タスクは ${0} 回目で完了`,sf08:`すべてのエージェントのセッションの合計(同時に実行した分も含む)`,sf11:`終了時刻`,sf14:`最初のエージェントのセッション`,sf26:E`実行 ${0} 件`,sf2b:`トークンの報告なし`,sf2c:`すべての試行が完了`,sf2d:E`関数 ${0}`,sf2e:`定義`,sf39:`周回数`,sf3c:`ほか 1 アカウント`,sf3e:`カスタムビュー`,sf46:E`${0} 周目`,sf48:`終了後の利用率`,sf4d:`コピー済み`,sf55:`サービス`,sf56:`試行の終了後に、同じアカウントで最初に報告された値`,sf5d:`ユニットごとではなく、実行ごとに 1 回実行されるタスク`,sf6:`フロー呼び出し`,sf7b:E`不明(${0})`,sf7d:E`残り ${0}`,sf7e:`すべての実行グループ`,sf82:E`休止 ${0} → ${1}`,sf86:`内容不明`,sf93:`合計`,sf9b:`エージェントのセッションが始まらなかった`,sfa04:`テキスト`,sfa06:`待たれなかったタスク 1 件`,sfa25:E`${0} 〜 ${1}`,sfa29:E`あと ${0} 件の見込み(forecast)`,sfa6:`フィルターに一致するタスクなし`,sfa8:`ツールのリクエスト`,sfad:`修正依頼 1 回で完了`,sfae:`ホスト一覧`,sfb3:`実行を切り替え`,sfb6:E`実行中のエージェントのセッション ${0} 件`,sfbb1:`失敗した試行`,sfbb8:E`${1} の失敗により ${0} で停止`,sfc4:`外部の状態`,sfc7:`再開カーソルなし`,sfd3:E`リトライ後に完了 ${0} 件`,sfd5:E`要素 ${0} 個: ${1}`,sfd7:`出力`,sfd85:`タスクの前から変わらない出力ファイルの箇所(preserve)`,sfd8b:`各日の最大値`,sfdd:`プロセス`,sfde:`ファイルにない必須フィールド`,sfe7:E`${0}: 入力と出力`,sfe9:E`プロセス ${0}`,sfef:`見込み: あと 1 タスク`,sff6:`登録済みのタスクはまだありません`,sff8:E`${0} のタスク`,sffa:`定義なし`,sfff:E`Python タスク ${0} 回`,stag:`完了`,stat:`状態`,"stop-ca":`取り消し`,"stop-co":`完了`,"stop-i":`未実行`,"stop-p":`一部のみ完了`,tab:`タスク`,tas:`タスク`,tok:`出力`,too:`完了`,"trends-p":`一部のみ完了`,"trends-r":`実行`,"view-g":`グラフ`,"view-o":`出力`,"view-t":`表`}),wn=`en`,Tn=[`ja`],En=[`en`,`ja`],Dn={en:`English`,ja:`日本語`},On={ja:()=>Promise.resolve(Sn)};function kn(){if(xn===void 0)try{xn=it({sourceLocale:wn,targetLocales:Tn,loadLocale:e=>On[e]()})}catch{xn=null}return xn!==null}var An=()=>xn?.getLocale()??wn;async function jn(e){kn()&&await xn.setLocale(e)}var Mn=`contraagent:locale`,Nn=e=>En.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 wn}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.target=0,this.until=null,this.step=()=>{if(this.frame=0,this.restoring&&this.el)return this.place()?this.cancel():void(this.until!==null&&(this.frame=requestAnimationFrame(this.step)))},this.cancel=()=>{if(cancelAnimationFrame(this.frame),this.frame=0,this.restoring){this.restoring=!1,this.el&&(this.el.style.overflowAnchor=``);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)e.scrollTop=0;else{this.target=t,this.until=null,this.restoring=!0,e.style.overflowAnchor=`none`;for(let t of Qn)e.addEventListener(t,this.cancel,{passive:!0,once:!0});this.place()}}update(e){this.restoring&&(e&&(this.until??=performance.now()+6e3),this.frame||=requestAnimationFrame(this.step))}reset(){this.cancel(),this.el&&(this.el.scrollTop=0)}place(){let e=this.el,t=e.scrollHeight-e.clientHeight;return e.scrollTop=Math.min(this.target,t),this.until!==null&&(t>=this.target||performance.now()>this.until)}},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!==An()&&jn(e)),this.opts.pageWide()&&(document.documentElement.lang=An()),this.host.lang=An()}},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
|
+
`)}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=ft(xr()),Dr=ft(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:M;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=k` .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=k` .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=k` .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=k` *,*::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=k` [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=k` .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=k` :host{${ft(pr.map(e=>e.derive?`--${e.name}: var(${e.prop}, ${e.derive});`:`--${e.name}: var(${e.prop}, ${Ur[e.name]});`).join(`
|
|
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,${ft(vr[_r].scheme)});color:var(--text);}:host([hidden]){display:none !important;}`,Gr=k` .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=k` .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=k` .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=k` .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)??M;function Zr(e){let t=e.tone??`neutral`;return A`<span class="pill ${e.cls??``}" part="pill tone-${t}" data-tone=${L(t)} data-mark=${Xr(e)} title=${e.title||M}>${e.text}</span>`}function Qr(e){let t=e.tone??`neutral`;return A`<span class="jstop ${e.cls??``}" part="status tone-${t}" data-tone=${L(t)} data-mark=${Xr(e)} title=${e.title||M}>${e.text}</span>`}function $r(e,t){let n=t.tone??`neutral`;return A`<span class="${e} ${t.cls??``}" data-tone=${L(n)} data-mark=${Xr(t)} title=${t.title||M}>${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 Qt}});function ai(e,t={}){return A`<div class="legend ${t.cls??``}" part="legend" role="list" aria-label=${t.label||M}>
|
|
8
|
+
${e.map(e=>A`<span role="listitem" aria-hidden=${e.decorative?`true`:M}>${(e=>e.icon??(e.swatch||e.tone||e.shape||e.cls?A`<i class=${e.cls||M} data-tone=${L(e.tone)} data-shape=${e.shape??M} style=${e.swatch?ii({background:e.swatch}):M}></i>`:M))(e)}${e.label}</span>`)}
|
|
9
|
+
</div>`}var oi=k` .legend{display:flex;gap:14px;flex-wrap:wrap;font-size:var(--font-size-sm);color:var(--text-muted);}.legend>span{white-space:nowrap;}.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px;}.legend i[data-tone]{background:var(--tone);}.legend i[data-shape='round']{border-radius:50%;}.legend i[data-shape='square']{border-radius:2px;}.legend i[data-shape='ring']{background:none;border-radius:50%;box-shadow:inset 0 0 0 1.5px var(--tone,var(--line2));}.legend i[data-shape='half']{border-radius:50%;background:linear-gradient(0deg,var(--tone,var(--line2)) 50%,transparent 50%);box-shadow:inset 0 0 0 1.5px var(--tone,var(--line2));}.legend i[data-shape='hatched']{border-radius:2px;background:repeating-linear-gradient(135deg,transparent 0 2px,var(--tone,var(--line2)) 2px 3px);}`;function si(e){let t=e.reduce((e,t)=>e+Math.max(t,0),0);if(!t)return e.map(()=>0);let n=e.map(e=>100*Math.max(e,0)/t),r=n.map(Math.floor),i=n.map((e,t)=>[e-Math.floor(e),t]).sort((e,t)=>t[0]-e[0]||e[1]-t[1]);for(let e=0,t=100-r.reduce((e,t)=>e+t,0);e<t;e++)r[i[e][1]]+=1;return r}var ci=(e,t)=>e===0&&t>0?`<1%`:`${e}%`,li=k` .share{display:grid;gap:6px;}.share-bar,.share-names{display:flex;gap:2px;min-width:0;}.share-bar{height:14px;}.share-seg{position:relative;flex:0 1 0;min-width:3px;height:100%;border-radius:1px;cursor:default;outline-offset:2px;}.share-seg[data-edge='start']{border-radius:4px 1px 1px 4px;}.share-seg[data-edge='end']{border-radius:1px 4px 4px 1px;}.share-seg:only-child{border-radius:4px;}.share-seg::before{content:'';position:absolute;inset:-6px 0;}.share-seg:hover,.share-seg:focus-visible{box-shadow:0 0 0 2px var(--card);}.share-tip{display:none;position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);z-index:2;padding:4px 8px;border-radius:var(--radius-sm);background:var(--raise);border:1px solid var(--line2);box-shadow:0 4px 14px var(--shadow);color:var(--text);font-size:var(--font-size-sm);white-space:nowrap;pointer-events:none;}.share-seg[data-edge='start'] .share-tip,.share-seg:only-child .share-tip{left:0;transform:none;}.share-seg[data-edge='end'] .share-tip{left:auto;right:0;transform:none;}.share-seg:hover .share-tip,.share-seg:focus-visible .share-tip{display:block;}.share-names span{flex:0 1 0;min-width:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--font-size-sm);color:var(--text-muted);font-variant-numeric:tabular-nums;}.share-names b{font-weight:600;color:var(--text-2);}`,ui=(e,t,n)=>e[t]?.count?.(n)??`${n} ${e[t]?.label??t}`;function di(e,t=` | `){let n=e.filter(e=>typeof e==`string`?e:e.text);return n.length?A`${n.map((e,n)=>typeof e==`string`?A`${n?t:``}<span class="f">${e}</span>`:A`${n?t:``}<span class="f tone-text" data-tone=${L(e.tone)}>${e.text}</span>`)}`:M}var fi=new Map;function pi(e,t,n={}){let r=fi.get(e)??e;return t?A`<span class=${n.cls||M} part="icon" title=${t}><span aria-hidden="true">${r}</span><span class="sr">${t}</span></span>`:A`<span class=${n.cls||M} part="icon" aria-hidden="true">${r}</span>`}var mi=class{constructor(e,t){this.host=e,this.o=t,this.current=0,this.onFocus=e=>{let t=this.indexOf(e);t>=0&&t!==this.current&&this.set(t)},this.onKey=e=>{let t=this.o.items(),n=this.indexOf(e);if(n<0)return;let r=function(e,t,n,r){if(e<=0)return null;let i=n=>n===t||n<0||n>=e?null:n;if(r.layout===`grid`){let a=Math.max(1,r.cols??1),o=Math.floor(t/a)*a;switch(n){case`ArrowRight`:return(t+1)%a&&t+1<e?i(t+1):null;case`ArrowLeft`:return t%a?i(t-1):null;case`ArrowDown`:return i(t+a);case`ArrowUp`:return i(t-a);case`Home`:return i(r.ctrl?0:o);case`End`:return i(r.ctrl?e-1:Math.min(o+a,e)-1);default:return null}}let[a,o]=r.layout===`horizontal`?[`ArrowLeft`,`ArrowRight`]:[`ArrowUp`,`ArrowDown`],s=n=>i(r.wrap?(t+n+e)%e:t+n);switch(n){case o:return s(1);case a:return s(-1);case`Home`:return i(0);case`End`:return i(e-1);default:return null}}(t.length,n,e.key,{layout:this.o.layout,cols:this.o.columns?.(),wrap:this.o.wrap,ctrl:e.ctrlKey||e.metaKey}),i=r===null?void 0:t[r];r!==null&&i&&(e.preventDefault(),this.set(r),i.focus(),this.o.onMove?.(i,r))},e.addController(this)}hostConnected(){this.host.addEventListener(`keydown`,this.onKey),this.host.addEventListener(`focusin`,this.onFocus)}hostDisconnected(){this.host.removeEventListener(`keydown`,this.onKey),this.host.removeEventListener(`focusin`,this.onFocus)}hostUpdated(){this.sync()}set(e){this.current=e,this.sync()}sync(){let e=this.o.items();e.length&&(this.current=Math.min(Math.max(0,this.current),e.length-1),e.forEach((e,t)=>e.tabIndex=t===this.current?0:-1))}indexOf(e){return this.o.items().findIndex(t=>e.composedPath().includes(t))}};function hi(e,t,n,r=8){let i=Math.max(0,e.length-1),a=e[i]??0;if(!i||a<=0)return{from:0,to:i,padTop:0,padBottom:0};let o=Math.max(0,t),s=gi(e,o),c=gi(e,o+Math.max(0,n)),l=Math.max(0,s-r),u=Math.min(i,Math.max(l,c+1+r));return{from:l,to:u,padTop:e[l],padBottom:a-e[u]}}function gi(e,t){let n=0,r=e.length-1-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return n}var{I:_i}=pn,vi=e=>e,yi=()=>document.createComment(``),bi=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new _i(r.insertBefore(yi(),i),r.insertBefore(yi(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=vi(e).nextSibling;vi(r).insertBefore(e,i),e=t}}}return n},xi=(e,t,n=e)=>(e._$AI(t,n),e),Si={},Ci=(e,t=Si)=>e._$AH=t,wi=e=>{e._$AR(),e._$AA.remove()},Ti=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},H=ei(class extends ti{constructor(e){if(super(e),e.type!==2)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=(e=>e._$AH)(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=xi(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=xi(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=xi(i[d],a[m]),bi(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=xi(i[f],a[p]),bi(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=Ti(o,p,m),u=Ti(s,d,f)),l.has(s[d])){if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=bi(e,i[d]);xi(t,a[p]),c[p]=t}else c[p]=xi(n,a[p]),bi(e,i[d],n),i[t]=null;p++}else wi(i[f]),f--}else wi(i[d]),d++;for(;p<=m;){let t=bi(e,c[m+1]);xi(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&wi(e)}return this.ut=o,Ci(e,c),Qt}});function U(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}var Ei=class extends N{constructor(...e){super(...e),this.options=[],this.value=``,this.label=``,this.roving=new mi(this,{items:()=>[...this.renderRoot.querySelectorAll(`button:not(:disabled)`)??[]],layout:`horizontal`,wrap:!0,onMove:e=>this.choose(e.dataset.value??``)})}static{this.styles=[V,k` :host{display:inline-flex;vertical-align:middle;}.group{display:inline-flex;border:1px solid var(--line);border-radius:var(--cae-segmented-radius,6px);overflow:hidden;}button{min-width:22px;height:var(--cae-segmented-height,20px);line-height:var(--cae-segmented-height,20px);padding:var(--cae-segmented-padding,0 10px);margin:0;border:0;border-radius:0;background:none;font-size:var(--cae-segmented-font-size,11.5px);text-align:center;color:var(--text-muted);cursor:pointer;}button + button{border-left:var(--cae-segmented-divider,1px solid var(--line));}button:hover{color:var(--cae-segmented-hover,var(--text));}button[aria-checked='true']{background:var(--raise);color:var(--text);cursor:default;}button:disabled{opacity:0.5;cursor:default;}button:focus-visible{outline-offset:-2px;}`]}willUpdate(){let e=this.options.filter(e=>!e.disabled).findIndex(e=>e.value===this.value);e>=0&&(this.roving.current=e)}choose(e){e!==this.value&&(this.value=e,R(this,`cae-change`,{value:e}))}render(){return A`<div class="group" part="group" role="radiogroup" aria-label=${this.label||M}>
|
|
10
|
+
${H(this.options,e=>e.value,e=>{let t=e.value===this.value;return A`<button type="button" role="radio" part=${t?`option option-selected`:`option`} aria-checked=${t?`true`:`false`} data-value=${e.value} lang=${e.lang||M} title=${e.title||M} ?disabled=${!!e.disabled} @click=${()=>this.choose(e.value)}>${e.label}</button>`})}
|
|
11
|
+
</div>`}};U([F({attribute:!1})],Ei.prototype,`options`,void 0),U([F()],Ei.prototype,`value`,void 0),U([F()],Ei.prototype,`label`,void 0);var Di=class extends N{constructor(...e){super(...e),this.open=1}static{this.styles=[V,Gr]}render(){return A`<div class="jtree" part="tree" data-scroll="x">${this.node(this.value,0)}</div>`}node(e,t){if(typeof e!=`object`||!e)return A`<span class=${typeof e==`string`?`js`:`jn`}>${JSON.stringify(e)??`undefined`}</span>`;let n=Array.isArray(e)?e.map((e,t)=>[t,e]):Object.entries(e);return n.length?A`${n.map(([e,n])=>(e=>typeof e!=`object`||!e||(Array.isArray(e)?!e.length:!Object.keys(e).length))(n)?A`<div class="jt"><span class="jk">${e}</span>: ${this.node(n,t+1)}</div>`:A`<details class="jt" ?open=${t<this.open}>
|
|
12
12
|
<summary>
|
|
13
13
|
<span class="jk">${e}</span>
|
|
14
14
|
<span class="meta">${Array.isArray(n)?`[${n.length}]`:`{${Object.keys(n).length}}`}</span>
|
|
15
15
|
</summary>
|
|
16
16
|
${this.node(n,t+1)}
|
|
17
|
-
</details>`)}`:Array.isArray(e)?`[]`:`{}`}};U([P({attribute:!1})],Di.prototype,`value`,void 0),U([P({type:Number})],Di.prototype,`open`,void 0);var Oi=[`python`,`json`,`javascript`,`typescript`,`c`,`cpp`,`java`,`go`,`rust`,`shell`,`toml`,`yaml`,`sql`,`xml`,`diff`],W=e=>new Set(e.split(` `)),ki=[`comment`,`//[^\\n]*|/\\*[\\s\\S]*?\\*/`],Ai=`"(?:[^"\\\\\\n]|\\\\.)*"`,ji=`'(?:[^'\\\\\\n]|\\\\.)*'`,Mi=`'(?:[^'\\\\\\n]|\\\\.)'`,Ni=[`number`,`\\b(?:0[xX][\\da-fA-F_']+|0[bB][01_]+|\\d[\\d_']*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)[uUlLfFn]*\\b`],Pi=`break case catch class const continue debugger default delete do else export extends finally for from function if import in instanceof let new of return static super switch throw try typeof var void while with yield async await as`,Fi=`auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while bool`,Ii={struct:`class`,class:`class`,enum:`class`,union:`class`},Li={python:{rules:[[`comment`,`#[^\\n]*`],[`doc`,`(?:[rRbBfFuU]{0,2})(?:"""[\\s\\S]*?"""|'''[\\s\\S]*?''')`],[`string`,`(?:[rRbBfFuU]{0,2})(?:${Ai}|${ji})`],[`decorator`,`@[A-Za-z_][\\w.]*`],[`number`,`\\b\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b`]],keywords:W(`and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield match case`),constants:W(`None True False self cls`),builtins:W(`str int float bool list dict set tuple bytes object type len range print isinstance super Optional Literal Any Union Path`),defines:{def:`function`,class:`class`},types:!0,name:`[A-Za-z_]\\w*`},json:{rules:[[`key`,`${Ai}(?=\\s*:)`],[`string`,Ai],[`comment`,`//[^\\n]*|/\\*[\\s\\S]*?\\*/`],[`number`,`-?\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b`]],constants:W(`true false null`),name:`[A-Za-z_]\\w*`},javascript:{rules:[ki,[`string`,`${Ai}|${ji}|\`(?:[^\`\\\\]|\\\\.)*\``],[`decorator`,`@[A-Za-z_$][\\w$.]*`],Ni],keywords:W(Pi),constants:W(`true false null undefined this NaN Infinity`),builtins:W(`console Math JSON Promise Array Object String Number Boolean Map Set WeakMap Symbol Error Date RegExp BigInt globalThis window document`),defines:{function:`function`,class:`class`},types:!0},typescript:{rules:[ki,[`string`,`${Ai}|${ji}|\`(?:[^\`\\\\]|\\\\.)*\``],[`decorator`,`@[A-Za-z_$][\\w$.]*`],Ni],keywords:W(`${Pi} interface type enum implements namespace declare abstract private protected public readonly keyof infer is satisfies module override`),constants:W(`true false null undefined this NaN Infinity`),builtins:W(`console Math JSON Promise Array Object String Number Boolean Map Set WeakMap Symbol Error Date RegExp BigInt globalThis string number boolean unknown never any void Record Partial Readonly`),defines:{function:`function`,class:`class`,interface:`class`,type:`class`,enum:`class`},types:!0},c:{rules:[[`meta`,`^[ \\t]*#[ \\t]*\\w+`],ki,[`string`,`${Ai}|${Mi}`],Ni],keywords:W(Fi),constants:W(`NULL true false`),builtins:W(`printf fprintf malloc calloc realloc free size_t memcpy memset strlen strcmp FILE`),defines:Ii,types:!0},cpp:{rules:[[`meta`,`^[ \\t]*#[ \\t]*\\w+`],ki,[`string`,`${Ai}|${Mi}`],Ni],keywords:W(`${Fi} alignas alignof catch class constexpr consteval const_cast decltype delete dynamic_cast explicit export friend mutable namespace new noexcept operator private protected public reinterpret_cast static_assert static_cast template this thread_local throw try typeid typename using virtual co_await co_return co_yield concept requires override final`),constants:W(`nullptr NULL true false`),builtins:W(`std string vector map set unordered_map array optional cout cerr endl unique_ptr shared_ptr make_unique make_shared size_t`),defines:Ii,types:!0},java:{rules:[ki,[`string`,`"""[\\s\\S]*?"""|${Ai}|${Mi}`],[`decorator`,`@[A-Za-z_][\\w.]*`],Ni],keywords:W(`abstract assert boolean break byte case catch char class continue default do double else enum extends final finally float for if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while var record yield sealed permits`),constants:W(`true false null`),builtins:W(`String System Object Integer Long Double Boolean List Map Set Optional Exception RuntimeException`),defines:{class:`class`,interface:`class`,enum:`class`,record:`class`},types:!0},go:{rules:[ki,[`string`,`${Ai}|\`[^\`]*\`|${Mi}`],Ni],keywords:W(`break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var`),constants:W(`true false nil iota`),builtins:W(`append cap close complex copy delete imag len make new panic print println real recover string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 byte rune error bool float32 float64 any`),defines:{func:`function`,type:`class`},types:!0},rust:{rules:[ki,[`string`,`b?r#*"[\\s\\S]*?"#*|b?"(?:[^"\\\\]|\\\\.)*"`],[`string`,`b?${Mi}`],[`type`,`'[A-Za-z_]\\w*\\b(?!')`],[`decorator`,`#!?\\[[^\\]\\n]*\\]`],[`builtin`,`\\b[A-Za-z_]\\w*!(?=\\s*[\\[({])`],Ni],keywords:W(`as async await break const continue crate dyn else enum extern fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait type unsafe use where while`),constants:W(`true false None Some Ok Err`),builtins:W(`Vec String Option Result Box Rc Arc HashMap str usize isize u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 bool char`),defines:{fn:`function`,struct:`class`,enum:`class`,trait:`class`,type:`class`},types:!0},shell:{rules:[[`comment`,`(?:^|(?<=\\s))#[^\\n]*`],[`string`,`"(?:[^"\\\\]|\\\\.)*"|'[^']*'`],[`builtin`,`\\$(?:\\{[^}\\n]*\\}|\\w+|[@*#?$!0-9-])`],[`number`,`\\b\\d+\\b`]],keywords:W(`if then else elif fi for while until do done case esac in function select return local export readonly declare set unset shift break continue exit source alias`),builtins:W(`echo cd printf read test eval exec trap pwd`),name:`[A-Za-z_][\\w-]*`},toml:{rules:[[`comment`,`#[^\\n]*`],[`class`,`^[ \\t]*\\[\\[?[^\\]\\n]*\\]\\]?`],[`key`,`^[ \\t]*[A-Za-z0-9_.\\-"']+(?=[ \\t]*=)`],[`string`,`"""[\\s\\S]*?"""|'''[\\s\\S]*?'''|${Ai}|'[^'\\n]*'`],[`number`,`\\d{4}-\\d{2}-\\d{2}(?:[T ]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?(?:Z|[+-]\\d{2}:\\d{2})?)?`],[`number`,`[+-]?\\b\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b`]],constants:W(`true false inf nan`),name:`[A-Za-z_]\\w*`},yaml:{rules:[[`comment`,`(?:^|(?<=\\s))#[^\\n]*`],[`meta`,`^(?:---|\\.\\.\\.)(?=\\s|$)`],[`key`,`[A-Za-z0-9_.\\-/]+(?=:(?:[ \\t]|$))`],[`string`,`${Ai}|'(?:[^'\\n]|'')*'`],[`decorator`,`[&*][\\w-]+`],[`number`,`[+-]?\\b\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b`]],constants:W(`true false null yes no on off True False Null`),name:`[A-Za-z_]\\w*`},sql:{rules:[[`comment`,`--[^\\n]*|/\\*[\\s\\S]*?\\*/`],[`string`,`'(?:[^']|'')*'`],[`key`,`"(?:[^"]|"")*"`],[`number`,`\\b\\d+(?:\\.\\d+)?\\b`]],keywords:W(`select from where and or not insert into values update set delete create table drop alter add column index primary key foreign references join left right inner outer full cross on as group by order having limit offset union all distinct case when then else end is in exists between like returning with view default unique constraint if begin commit rollback transaction asc desc`),constants:W(`true false null`),builtins:W(`count sum avg min max coalesce cast lower upper now integer int text varchar char boolean date timestamp real numeric bigint serial float double`),caseless:!0,name:`[A-Za-z_]\\w*`},xml:{rules:[[`comment`,`<!--[\\s\\S]*?-->`],[`meta`,`<\\?[\\s\\S]*?\\?>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|<![A-Za-z][^>]*>`],[`tag`,`</?[A-Za-z_][\\w:.-]*|/?>`],[`attribute`,`[A-Za-z_:][\\w:.-]*(?=\\s*=\\s*["'])`],[`string`,`(?<==\\s*)(?:"[^"]*"|'[^']*')`],[`constant`,`&#?\\w+;`]],name:null},diff:{rules:[[`meta`,`^(?:diff |index |--- |\\+\\+\\+ |@@)[^\\n]*`],[`inserted`,`^\\+[^\\n]*`],[`deleted`,`^-[^\\n]*`]],name:null}},Ri={py:`python`,python3:`python`,pyi:`python`,pyw:`python`,jsonc:`json`,jsonl:`json`,json5:`json`,geojson:`json`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`javascript`,node:`javascript`,ts:`typescript`,tsx:`typescript`,mts:`typescript`,cts:`typescript`,h:`c`,"c++":`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,hh:`cpp`,hxx:`cpp`,golang:`go`,rs:`rust`,sh:`shell`,bash:`shell`,zsh:`shell`,ksh:`shell`,shellscript:`shell`,ini:`toml`,cfg:`toml`,yml:`yaml`,html:`xml`,htm:`xml`,xhtml:`xml`,svg:`xml`,plist:`xml`,xsd:`xml`,xsl:`xml`,patch:`diff`};function zi(e){let t=String(e||``).trim().toLowerCase().replace(/^.*\//,``),n=e=>Oi.includes(e)?e:Ri[e]??``;return n(t)||(t.includes(`.`)?n(t.replace(/^.*\./,``)):``)}var Bi=new Map;function Vi(e,t,n){let r=e.caseless?t.toLowerCase():t;return e.keywords?.has(r)?`keyword`:e.constants?.has(r)?`constant`:e.defines?.[n]||(e.builtins?.has(r)?`builtin`:e.types&&/^[A-Z]\w*$/.test(t)&&t.length>1&&/[a-z]/.test(t)?`type`:``)}function Hi(e,t){let n=zi(t);if(!n||!e)return e?[{text:e,type:``}]:[];let r=Li[n],i=function(e){let t=Bi.get(e);if(!t){let n=Li[e],r=n.rules.map(([,e])=>`(${e})`),i=n.name===void 0?`[A-Za-z_$][\\w$]*`:n.name;i&&r.push(`(${i})`),t=new RegExp(r.join(`|`),`gm`),Bi.set(e,t)}return t}(n),a=[],o=(e,t)=>{if(!e)return;let n=a[a.length-1];n&&n.type===t?n.text+=e:a.push({text:e,type:t})},s=0,c=``;i.lastIndex=0;for(let t=i.exec(e);t;t=i.exec(e)){if(!t[0]){i.lastIndex++;continue}let n=e.slice(s,t.index);/\S/.test(n)&&(c=``),o(n,``),s=i.lastIndex;let a=t.findIndex((e,t)=>t>0&&e!==void 0)-1;a<r.rules.length?(o(t[0],r.rules[a][0]),c=``):(o(t[0],Vi(r,t[0],c)),c=t[0])}return o(e.slice(s),``),a}var Ui={comment:`hl-c`,doc:`hl-s hl-doc`,string:`hl-s`,number:`hl-n`,keyword:`hl-k`,constant:`hl-k hl-const`,builtin:`hl-b`,type:`hl-t`,function:`hl-f`,class:`hl-cls`,decorator:`hl-d`,key:`hl-key`,tag:`hl-tag`,attribute:`hl-attr`,inserted:`hl-ins`,deleted:`hl-del`,meta:`hl-meta`};function Wi(e){return e.map(e=>e.type?`<span class="${Ui[e.type]}">${jr(e.text)}</span>`:jr(e.text)).join(``)}function Gi(e,t){return Wi(Hi(e,t))}var Ki=class extends ti{constructor(e){if(super(e),this.it=j,e.type!==2)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===j||e==null)return this._t=void 0,this.it=e;if(e===$t)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ki.directiveName=`unsafeHTML`,Ki.resultType=1;var qi=ei(Ki),Ji={copy:`Copy`,copied:`Copied`,wrap:`Wrap lines`,empty:`No text`,cut:(e,t)=>`First ${e.toLocaleString(`en`)} of ${t.toLocaleString(`en`)} lines`},Yi=class extends M{constructor(...e){super(...e),this.code=``,this.language=``,this.start=1,this.highlight=[],this.path=``,this.label=``,this.wrap=!1,this.maxLines=5e3,this.maxCharacters=5e5,this.strings={},this.wrapped=!1,this.copied=!1}static{this.styles=[V,Gr,O` :host{display:block;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--well);overflow:hidden;}.head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;padding:4px 6px 4px 10px;border-bottom:1px solid var(--line);font-size:var(--font-size-sm);color:var(--text-2);}.path{font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}.lang{color:var(--text-muted);}.tools{margin-left:auto;display:flex;gap:4px;flex:none;}.tools button{font-size:var(--font-size-sm);color:var(--text-2);border:1px solid var(--line2);border-radius:var(--radius-pill);padding:0 9px;cursor:pointer;background:none;}.tools button[aria-pressed='true']{background:var(--raise);color:var(--text);}.scroll{overflow:auto;max-height:var(--cae-code-max-height,70vh);font-family:var(--mono);font-size:var(--font-size-md);line-height:1.5;}.lines{display:block;min-width:max-content;padding:4px 0;}.wrap .lines{min-width:0;}.ln{display:flex;}.ln::before{content:attr(data-n);position:sticky;left:0;flex:none;box-sizing:border-box;width:calc(var(--digits) * 1ch + 22px);padding:0 10px 0 8px;text-align:right;color:var(--text-muted);background:var(--well);border-left:3px solid transparent;}.t{flex:1;white-space:pre;padding-right:12px;}.t:empty::after{content:' ';}.wrap .t{white-space:pre-wrap;overflow-wrap:anywhere;}.ln[data-mark]{background:color-mix(in srgb,var(--accent) 6%,transparent);}.hl-doc{opacity:1;}.ln[data-mark]::before{border-left-color:var(--accent);color:var(--text);background:color-mix(in srgb,var(--accent) 14%,var(--well));}.cut,.empty{padding:4px 10px;font-size:var(--font-size-sm);color:var(--text-muted);border-top:1px solid var(--line);}.empty{border-top:0;}`]}willUpdate(e){e.has(`wrap`)&&(this.wrapped=this.wrap),e.has(`code`)&&(this.copied=!1)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.copiedTimer)}async copy(){try{await navigator.clipboard.writeText(this.code)}catch{return}this.copied=!0,clearTimeout(this.copiedTimer),this.copiedTimer=setTimeout(()=>this.copied=!1,1500)}render(){let e=Ar(Ji,this.strings),t=zi(this.language),{shown:n,lines:r,total:i,cut:a}=function(e,t,n){let r=e.endsWith(`
|
|
17
|
+
</details>`)}`:Array.isArray(e)?`[]`:`{}`}};U([F({attribute:!1})],Di.prototype,`value`,void 0),U([F({type:Number})],Di.prototype,`open`,void 0);var Oi=[`python`,`json`,`javascript`,`typescript`,`c`,`cpp`,`java`,`go`,`rust`,`shell`,`toml`,`yaml`,`sql`,`xml`,`diff`],W=e=>new Set(e.split(` `)),ki=[`comment`,`//[^\\n]*|/\\*[\\s\\S]*?\\*/`],Ai=`"(?:[^"\\\\\\n]|\\\\.)*"`,ji=`'(?:[^'\\\\\\n]|\\\\.)*'`,Mi=`'(?:[^'\\\\\\n]|\\\\.)'`,Ni=[`number`,`\\b(?:0[xX][\\da-fA-F_']+|0[bB][01_]+|\\d[\\d_']*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)[uUlLfFn]*\\b`],Pi=`break case catch class const continue debugger default delete do else export extends finally for from function if import in instanceof let new of return static super switch throw try typeof var void while with yield async await as`,Fi=`auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while bool`,Ii={struct:`class`,class:`class`,enum:`class`,union:`class`},Li={python:{rules:[[`comment`,`#[^\\n]*`],[`doc`,`(?:[rRbBfFuU]{0,2})(?:"""[\\s\\S]*?"""|'''[\\s\\S]*?''')`],[`string`,`(?:[rRbBfFuU]{0,2})(?:${Ai}|${ji})`],[`decorator`,`@[A-Za-z_][\\w.]*`],[`number`,`\\b\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b`]],keywords:W(`and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield match case`),constants:W(`None True False self cls`),builtins:W(`str int float bool list dict set tuple bytes object type len range print isinstance super Optional Literal Any Union Path`),defines:{def:`function`,class:`class`},types:!0,name:`[A-Za-z_]\\w*`},json:{rules:[[`key`,`${Ai}(?=\\s*:)`],[`string`,Ai],[`comment`,`//[^\\n]*|/\\*[\\s\\S]*?\\*/`],[`number`,`-?\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b`]],constants:W(`true false null`),name:`[A-Za-z_]\\w*`},javascript:{rules:[ki,[`string`,`${Ai}|${ji}|\`(?:[^\`\\\\]|\\\\.)*\``],[`decorator`,`@[A-Za-z_$][\\w$.]*`],Ni],keywords:W(Pi),constants:W(`true false null undefined this NaN Infinity`),builtins:W(`console Math JSON Promise Array Object String Number Boolean Map Set WeakMap Symbol Error Date RegExp BigInt globalThis window document`),defines:{function:`function`,class:`class`},types:!0},typescript:{rules:[ki,[`string`,`${Ai}|${ji}|\`(?:[^\`\\\\]|\\\\.)*\``],[`decorator`,`@[A-Za-z_$][\\w$.]*`],Ni],keywords:W(`${Pi} interface type enum implements namespace declare abstract private protected public readonly keyof infer is satisfies module override`),constants:W(`true false null undefined this NaN Infinity`),builtins:W(`console Math JSON Promise Array Object String Number Boolean Map Set WeakMap Symbol Error Date RegExp BigInt globalThis string number boolean unknown never any void Record Partial Readonly`),defines:{function:`function`,class:`class`,interface:`class`,type:`class`,enum:`class`},types:!0},c:{rules:[[`meta`,`^[ \\t]*#[ \\t]*\\w+`],ki,[`string`,`${Ai}|${Mi}`],Ni],keywords:W(Fi),constants:W(`NULL true false`),builtins:W(`printf fprintf malloc calloc realloc free size_t memcpy memset strlen strcmp FILE`),defines:Ii,types:!0},cpp:{rules:[[`meta`,`^[ \\t]*#[ \\t]*\\w+`],ki,[`string`,`${Ai}|${Mi}`],Ni],keywords:W(`${Fi} alignas alignof catch class constexpr consteval const_cast decltype delete dynamic_cast explicit export friend mutable namespace new noexcept operator private protected public reinterpret_cast static_assert static_cast template this thread_local throw try typeid typename using virtual co_await co_return co_yield concept requires override final`),constants:W(`nullptr NULL true false`),builtins:W(`std string vector map set unordered_map array optional cout cerr endl unique_ptr shared_ptr make_unique make_shared size_t`),defines:Ii,types:!0},java:{rules:[ki,[`string`,`"""[\\s\\S]*?"""|${Ai}|${Mi}`],[`decorator`,`@[A-Za-z_][\\w.]*`],Ni],keywords:W(`abstract assert boolean break byte case catch char class continue default do double else enum extends final finally float for if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while var record yield sealed permits`),constants:W(`true false null`),builtins:W(`String System Object Integer Long Double Boolean List Map Set Optional Exception RuntimeException`),defines:{class:`class`,interface:`class`,enum:`class`,record:`class`},types:!0},go:{rules:[ki,[`string`,`${Ai}|\`[^\`]*\`|${Mi}`],Ni],keywords:W(`break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var`),constants:W(`true false nil iota`),builtins:W(`append cap close complex copy delete imag len make new panic print println real recover string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 byte rune error bool float32 float64 any`),defines:{func:`function`,type:`class`},types:!0},rust:{rules:[ki,[`string`,`b?r#*"[\\s\\S]*?"#*|b?"(?:[^"\\\\]|\\\\.)*"`],[`string`,`b?${Mi}`],[`type`,`'[A-Za-z_]\\w*\\b(?!')`],[`decorator`,`#!?\\[[^\\]\\n]*\\]`],[`builtin`,`\\b[A-Za-z_]\\w*!(?=\\s*[\\[({])`],Ni],keywords:W(`as async await break const continue crate dyn else enum extern fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait type unsafe use where while`),constants:W(`true false None Some Ok Err`),builtins:W(`Vec String Option Result Box Rc Arc HashMap str usize isize u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 bool char`),defines:{fn:`function`,struct:`class`,enum:`class`,trait:`class`,type:`class`},types:!0},shell:{rules:[[`comment`,`(?:^|(?<=\\s))#[^\\n]*`],[`string`,`"(?:[^"\\\\]|\\\\.)*"|'[^']*'`],[`builtin`,`\\$(?:\\{[^}\\n]*\\}|\\w+|[@*#?$!0-9-])`],[`number`,`\\b\\d+\\b`]],keywords:W(`if then else elif fi for while until do done case esac in function select return local export readonly declare set unset shift break continue exit source alias`),builtins:W(`echo cd printf read test eval exec trap pwd`),name:`[A-Za-z_][\\w-]*`},toml:{rules:[[`comment`,`#[^\\n]*`],[`class`,`^[ \\t]*\\[\\[?[^\\]\\n]*\\]\\]?`],[`key`,`^[ \\t]*[A-Za-z0-9_.\\-"']+(?=[ \\t]*=)`],[`string`,`"""[\\s\\S]*?"""|'''[\\s\\S]*?'''|${Ai}|'[^'\\n]*'`],[`number`,`\\d{4}-\\d{2}-\\d{2}(?:[T ]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?(?:Z|[+-]\\d{2}:\\d{2})?)?`],[`number`,`[+-]?\\b\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b`]],constants:W(`true false inf nan`),name:`[A-Za-z_]\\w*`},yaml:{rules:[[`comment`,`(?:^|(?<=\\s))#[^\\n]*`],[`meta`,`^(?:---|\\.\\.\\.)(?=\\s|$)`],[`key`,`[A-Za-z0-9_.\\-/]+(?=:(?:[ \\t]|$))`],[`string`,`${Ai}|'(?:[^'\\n]|'')*'`],[`decorator`,`[&*][\\w-]+`],[`number`,`[+-]?\\b\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b`]],constants:W(`true false null yes no on off True False Null`),name:`[A-Za-z_]\\w*`},sql:{rules:[[`comment`,`--[^\\n]*|/\\*[\\s\\S]*?\\*/`],[`string`,`'(?:[^']|'')*'`],[`key`,`"(?:[^"]|"")*"`],[`number`,`\\b\\d+(?:\\.\\d+)?\\b`]],keywords:W(`select from where and or not insert into values update set delete create table drop alter add column index primary key foreign references join left right inner outer full cross on as group by order having limit offset union all distinct case when then else end is in exists between like returning with view default unique constraint if begin commit rollback transaction asc desc`),constants:W(`true false null`),builtins:W(`count sum avg min max coalesce cast lower upper now integer int text varchar char boolean date timestamp real numeric bigint serial float double`),caseless:!0,name:`[A-Za-z_]\\w*`},xml:{rules:[[`comment`,`<!--[\\s\\S]*?-->`],[`meta`,`<\\?[\\s\\S]*?\\?>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|<![A-Za-z][^>]*>`],[`tag`,`</?[A-Za-z_][\\w:.-]*|/?>`],[`attribute`,`[A-Za-z_:][\\w:.-]*(?=\\s*=\\s*["'])`],[`string`,`(?<==\\s*)(?:"[^"]*"|'[^']*')`],[`constant`,`&#?\\w+;`]],name:null},diff:{rules:[[`meta`,`^(?:diff |index |--- |\\+\\+\\+ |@@)[^\\n]*`],[`inserted`,`^\\+[^\\n]*`],[`deleted`,`^-[^\\n]*`]],name:null}},Ri={py:`python`,python3:`python`,pyi:`python`,pyw:`python`,jsonc:`json`,jsonl:`json`,json5:`json`,geojson:`json`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`javascript`,node:`javascript`,ts:`typescript`,tsx:`typescript`,mts:`typescript`,cts:`typescript`,h:`c`,"c++":`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,hh:`cpp`,hxx:`cpp`,golang:`go`,rs:`rust`,sh:`shell`,bash:`shell`,zsh:`shell`,ksh:`shell`,shellscript:`shell`,ini:`toml`,cfg:`toml`,yml:`yaml`,html:`xml`,htm:`xml`,xhtml:`xml`,svg:`xml`,plist:`xml`,xsd:`xml`,xsl:`xml`,patch:`diff`};function zi(e){let t=String(e||``).trim().toLowerCase().replace(/^.*\//,``),n=e=>Oi.includes(e)?e:Ri[e]??``;return n(t)||(t.includes(`.`)?n(t.replace(/^.*\./,``)):``)}var Bi=new Map;function Vi(e,t,n){let r=e.caseless?t.toLowerCase():t;return e.keywords?.has(r)?`keyword`:e.constants?.has(r)?`constant`:e.defines?.[n]||(e.builtins?.has(r)?`builtin`:e.types&&/^[A-Z]\w*$/.test(t)&&t.length>1&&/[a-z]/.test(t)?`type`:``)}function Hi(e,t){let n=zi(t);if(!n||!e)return e?[{text:e,type:``}]:[];let r=Li[n],i=function(e){let t=Bi.get(e);if(!t){let n=Li[e],r=n.rules.map(([,e])=>`(${e})`),i=n.name===void 0?`[A-Za-z_$][\\w$]*`:n.name;i&&r.push(`(${i})`),t=new RegExp(r.join(`|`),`gm`),Bi.set(e,t)}return t}(n),a=[],o=(e,t)=>{if(!e)return;let n=a[a.length-1];n&&n.type===t?n.text+=e:a.push({text:e,type:t})},s=0,c=``;i.lastIndex=0;for(let t=i.exec(e);t;t=i.exec(e)){if(!t[0]){i.lastIndex++;continue}let n=e.slice(s,t.index);/\S/.test(n)&&(c=``),o(n,``),s=i.lastIndex;let a=t.findIndex((e,t)=>t>0&&e!==void 0)-1;a<r.rules.length?(o(t[0],r.rules[a][0]),c=``):(o(t[0],Vi(r,t[0],c)),c=t[0])}return o(e.slice(s),``),a}var Ui={comment:`hl-c`,doc:`hl-s hl-doc`,string:`hl-s`,number:`hl-n`,keyword:`hl-k`,constant:`hl-k hl-const`,builtin:`hl-b`,type:`hl-t`,function:`hl-f`,class:`hl-cls`,decorator:`hl-d`,key:`hl-key`,tag:`hl-tag`,attribute:`hl-attr`,inserted:`hl-ins`,deleted:`hl-del`,meta:`hl-meta`};function Wi(e){return e.map(e=>e.type?`<span class="${Ui[e.type]}">${jr(e.text)}</span>`:jr(e.text)).join(``)}function Gi(e,t){return Wi(Hi(e,t))}var Ki=class extends ti{constructor(e){if(super(e),this.it=M,e.type!==2)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===M||e==null)return this._t=void 0,this.it=e;if(e===Qt)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ki.directiveName=`unsafeHTML`,Ki.resultType=1;var qi=ei(Ki),Ji={copy:`Copy`,copied:`Copied`,wrap:`Wrap lines`,empty:`No text`,cut:(e,t)=>`First ${e.toLocaleString(`en`)} of ${t.toLocaleString(`en`)} lines`},Yi=class extends N{constructor(...e){super(...e),this.code=``,this.language=``,this.start=1,this.highlight=[],this.path=``,this.label=``,this.wrap=!1,this.maxLines=5e3,this.maxCharacters=5e5,this.strings={},this.wrapped=!1,this.copied=!1}static{this.styles=[V,Gr,k` :host{display:block;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--well);overflow:hidden;}.head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;padding:4px 6px 4px 10px;border-bottom:1px solid var(--line);font-size:var(--font-size-sm);color:var(--text-2);}.path{font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}.lang{color:var(--text-muted);}.tools{margin-left:auto;display:flex;gap:4px;flex:none;}.tools button{font-size:var(--font-size-sm);color:var(--text-2);border:1px solid var(--line2);border-radius:var(--radius-pill);padding:0 9px;cursor:pointer;background:none;}.tools button[aria-pressed='true']{background:var(--raise);color:var(--text);}.scroll{overflow:auto;max-height:var(--cae-code-max-height,70vh);font-family:var(--mono);font-size:var(--font-size-md);line-height:1.5;}.lines{display:block;min-width:max-content;padding:4px 0;}.wrap .lines{min-width:0;}.ln{display:flex;}.ln::before{content:attr(data-n);position:sticky;left:0;flex:none;box-sizing:border-box;width:calc(var(--digits) * 1ch + 22px);padding:0 10px 0 8px;text-align:right;color:var(--text-muted);background:var(--well);border-left:3px solid transparent;}.t{flex:1;white-space:pre;padding-right:12px;}.t:empty::after{content:' ';}.wrap .t{white-space:pre-wrap;overflow-wrap:anywhere;}.ln[data-mark]{background:color-mix(in srgb,var(--accent) 6%,transparent);}.hl-doc{opacity:1;}.ln[data-mark]::before{border-left-color:var(--accent);color:var(--text);background:color-mix(in srgb,var(--accent) 14%,var(--well));}.cut,.empty{padding:4px 10px;font-size:var(--font-size-sm);color:var(--text-muted);border-top:1px solid var(--line);}.empty{border-top:0;}`]}willUpdate(e){e.has(`wrap`)&&(this.wrapped=this.wrap),e.has(`code`)&&(this.copied=!1)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.copiedTimer)}async copy(){try{await navigator.clipboard.writeText(this.code)}catch{return}this.copied=!0,clearTimeout(this.copiedTimer),this.copiedTimer=setTimeout(()=>this.copied=!1,1500)}render(){let e=Ar(Ji,this.strings),t=zi(this.language),{shown:n,lines:r,total:i,cut:a}=function(e,t,n){let r=e.endsWith(`
|
|
18
18
|
`)?e.slice(0,-1):e,i=r||e?1:0;for(let e=r.indexOf(`
|
|
19
19
|
`);e>=0;e=r.indexOf(`
|
|
20
20
|
`,e+1))i++;let a=0,o=0;for(;o<Math.max(1,t);){let e=r.indexOf(`
|
|
21
21
|
`,a),t=e<0?r.length:e;if(o>0&&t>n)break;if(o++,e<0){a=r.length;break}a=e+1}let s=o>=i?r:r.slice(0,a-1);return s.length>n&&(s=s.slice(0,n)),{shown:s,lines:i?o:0,total:i,cut:s.length<r.length}}(this.code,this.maxLines,this.maxCharacters),o=this.start+Math.max(r,1)-1,s=function(e){let t=[[]];for(let n of e)n.text.split(`
|
|
22
|
-
`).forEach((e,r)=>{r>0&&t.push([]),e&&t[t.length-1].push({text:e,type:n.type})});return t}(Hi(n,t)).map((e,t)=>{let n=this.start+t;return`<div class="ln" data-n="${n}"${function(e,t){return e.some(e=>typeof e==`number`?e===t:t>=e[0]&&t<=e[1])}(this.highlight,n)?` data-mark=""`:``}><span class="t">${Wi(e)}</span></div>`}).join(``);return
|
|
23
|
-
${this.path?
|
|
24
|
-
${t?
|
|
22
|
+
`).forEach((e,r)=>{r>0&&t.push([]),e&&t[t.length-1].push({text:e,type:n.type})});return t}(Hi(n,t)).map((e,t)=>{let n=this.start+t;return`<div class="ln" data-n="${n}"${function(e,t){return e.some(e=>typeof e==`number`?e===t:t>=e[0]&&t<=e[1])}(this.highlight,n)?` data-mark=""`:``}><span class="t">${Wi(e)}</span></div>`}).join(``);return A`<div class="head" part="header">
|
|
23
|
+
${this.path?A`<span class="path" title=${this.path}>${this.path}</span>`:M}
|
|
24
|
+
${t?A`<span class="lang">${t}</span>`:M}
|
|
25
25
|
<span class="tools">
|
|
26
26
|
<button type="button" aria-pressed=${this.wrapped?`true`:`false`} @click=${()=>this.wrapped=!this.wrapped}>${e.wrap}</button>
|
|
27
27
|
<button type="button" ?disabled=${!this.code} @click=${()=>{this.copy()}}>${this.copied?e.copied:e.copy}</button>
|
|
28
28
|
</span>
|
|
29
29
|
<span class="sr" role="status">${this.copied?e.copied:``}</span>
|
|
30
30
|
</div>
|
|
31
|
-
${this.code?
|
|
31
|
+
${this.code?A`<div class="scroll ${this.wrapped?`wrap`:``}" part="code" data-scroll=${this.wrapped?`y`:`x`} tabindex="0" role=${this.label||this.path?`region`:M} aria-label=${this.label||this.path||M} style="--digits: ${String(o).length}">
|
|
32
32
|
<code class="lines hl">${qi(s)}</code>
|
|
33
33
|
</div>
|
|
34
|
-
${a?
|
|
34
|
+
${a?A`<div class="cut" part="cut">${e.cut(r,i)}</div>`:M}`:A`<div class="empty">${e.empty}</div>`}`}};function Xi(e){return e.replace(/`([^`\n]+)`/g,`<code>$1</code>`).replace(/\*\*([^*\n]+)\*\*/g,`<b>$1</b>`).replace(/(^|[^*\w])\*([^*\n]+)\*(?!\w)/g,`$1<i>$2</i>`).replace(/\[([^\]\n]+)\]\((https?:\/\/[^)\s]+)\)/g,`<a class="lnk" href="$2" target="_blank" rel="noopener">$1</a>`)}U([F()],Yi.prototype,`code`,void 0),U([F()],Yi.prototype,`language`,void 0),U([F({type:Number})],Yi.prototype,`start`,void 0),U([F({attribute:!1})],Yi.prototype,`highlight`,void 0),U([F()],Yi.prototype,`path`,void 0),U([F()],Yi.prototype,`label`,void 0),U([F({type:Boolean})],Yi.prototype,`wrap`,void 0),U([F({type:Number})],Yi.prototype,`maxLines`,void 0),U([F({type:Number})],Yi.prototype,`maxCharacters`,void 0),U([F({attribute:!1})],Yi.prototype,`strings`,void 0),U([I()],Yi.prototype,`wrapped`,void 0),U([I()],Yi.prototype,`copied`,void 0);var Zi=/^\s*\|.*\|\s*$/;function Qi(e){return function(e){let t=[],n=0;for(;;){let r=e.indexOf("```",n);if(r<0)return t.push({t:`text`,s:e.slice(n)}),t;t.push({t:`text`,s:e.slice(n,r)});let i=e.indexOf(`
|
|
35
35
|
`,r+3),a=e.slice(r+3,i<0?e.length:i).trim(),o=i<0?e.length:i+1,s=e.indexOf("```",o);if(s<0)return t.push({t:`code`,s:e.slice(o),lang:a}),t;t.push({t:`code`,s:e.slice(o,s),lang:a}),n=s+3}}(String(e||``)).map(e=>{if(e.t===`code`)return`<pre><code class="hl">${Gi(e.s,e.lang)}</code></pre>`;let t=jr(e.s).split(`
|
|
36
36
|
`),n=[];for(let e=0;e<t.length;e++){let r=t[e]??``,i;if(i=r.match(/^(#{1,6})\s+(.*)$/))n.push(`<div class="md-h md-h${Math.min(i[1].length,4)}">${Xi(i[2])}</div>`);else if(/^\s*(-{3,}|\*{3,})\s*$/.test(r))n.push(`<hr class="md-hr">`);else if(i=r.match(/^\s*>\s?(.*)$/))n.push(`<div class="md-q">${Xi(i[1])}</div>`);else if(i=r.match(/^\s*[-*]\s+(.*)$/))n.push(`<div class="md-li">${Xi(i[1])}</div>`);else if(i=r.match(/^\s*(\d+)[.)]\s+(.*)$/))n.push(`<div class="md-li md-ol"><span class="md-n">${i[1]}.</span>${Xi(i[2])}</div>`);else if(Zi.test(r)&&/^\s*\|[\s:|-]+\|\s*$/.test(t[e+1]??``)){let i=e=>e.trim().replace(/^\||\|$/g,``).split(`|`).map(e=>Xi(e.trim())),a=i(r);e+=2;let o=[];for(;e<t.length&&Zi.test(t[e]??``);)o.push(i(t[e++]??``));e--,n.push(`<table class="md-t"><tr>${a.map(e=>`<th>${e}</th>`).join(``)}</tr>`+o.map(e=>`<tr>${e.map(e=>`<td>${e}</td>`).join(``)}</tr>`).join(``)+`</table>`)}else n.push(r.trim()===``?`<div class="md-gap"></div>`:`<div class="md-p">${Xi(r)}</div>`)}return n.join(``)}).join(``)}function $i(e,t){let n=String(e||``),r=n.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/),i=``,a=n;if(r){a=r[2]??``;let e=(r[1]??``).split(`
|
|
37
|
-
`).map(e=>e.match(/^([\w-]+):\s*(.*)$/)).filter(e=>!!e).map(([,e,t])=>`<tr><td class="jmono">${jr(e)}</td><td>${jr(t)}</td></tr>`).join(``);i=e?`<table class="md-front">${e}</table>`:``}let o=Qi(a);return`<div class="md-doc">${i}${t?t(o):o}</div>`}var ea={showRendered:`Show rendered`,showSource:`Show source`},ta=class extends
|
|
37
|
+
`).map(e=>e.match(/^([\w-]+):\s*(.*)$/)).filter(e=>!!e).map(([,e,t])=>`<tr><td class="jmono">${jr(e)}</td><td>${jr(t)}</td></tr>`).join(``);i=e?`<table class="md-front">${e}</table>`:``}let o=Qi(a);return`<div class="md-doc">${i}${t?t(o):o}</div>`}var ea={showRendered:`Show rendered`,showSource:`Show source`},ta=class extends N{constructor(...e){super(...e),this.text=``,this.strings={},this.source=!1}static{this.styles=[V,Gr,k` :host{display:block;}.md-p,.md-h,.md-li,.md-q{overflow-wrap:anywhere;}.bar{display:flex;justify-content:flex-end;margin-bottom:4px;}`]}render(){let e=Ar(ea,this.strings),{head:t,body:n}=this.split?.(this.text)??{head:``,body:this.text},r=$i(n,this.transform);return A`<div class="bar">
|
|
38
38
|
<button type="button" class="df-tog" part="toggle" @click=${()=>this.source=!this.source}>
|
|
39
39
|
${this.source?e.showRendered:e.showSource}</button>
|
|
40
40
|
</div>
|
|
41
|
-
${this.source?
|
|
41
|
+
${this.source?A`<pre class="df-text">${this.text}</pre>`:A`${t?A`<div class="md-tele jmono">${t}</div>`:M}${qi(r)}`}`}};U([F()],ta.prototype,`text`,void 0),U([F({attribute:!1})],ta.prototype,`split`,void 0),U([F({attribute:!1})],ta.prototype,`transform`,void 0),U([F({attribute:!1})],ta.prototype,`strings`,void 0),U([I()],ta.prototype,`source`,void 0);var na={empty:`No items`},ra=e=>!!e.children?.length,ia=e=>e.selectable??!ra(e);function aa(e,t){for(let n of e){if(n.id===t)return[];let e=n.children?aa(n.children,t):null;if(e)return[n.id,...e]}return null}var oa=j`<path d="M1.5 3.5h4l1.5 1.5h7.5v8h-13z" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"></path>`,sa=j`<path d="M3.5 1.5h6l3 3v10h-9z M9.5 1.5v3h3" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"></path>`,ca=class extends N{constructor(...e){super(...e),this.items=[],this.selected=null,this.label=``,this.strings={},this.opened=new Map,this.focusId=null,this.isOpen=e=>this.opened.get(e.id)??e.open??!0}static{this.styles=[V,k` :host{display:block;font-size:var(--font-size-md);}.tree{margin:0;padding:2px 0;}.row{display:flex;align-items:center;gap:4px;min-height:24px;padding:0 8px 0 calc((var(--level) - 1) * 14px + 4px);border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;color:var(--text-2);}.row:hover{background:var(--raise);}.row[aria-selected='true']{background:color-mix(in srgb,var(--accent) 16%,transparent);color:var(--text);box-shadow:inset 2px 0 0 var(--accent);}.row:focus-visible{outline-offset:-2px;}.twist{flex:none;display:inline-grid;place-items:center;width:16px;height:16px;color:var(--text-muted);border-radius:var(--radius-sm);}.twist svg{transition:transform 0.12s ease;}[aria-expanded='true']>.twist svg{transform:rotate(90deg);}.twist:hover{color:var(--text);}.icon{flex:none;width:16px;height:16px;color:var(--text-muted);}.name{overflow:hidden;text-overflow:ellipsis;min-width:0;}.badge{flex:none;margin-left:6px;font-size:11px;padding:0 6px;border-radius:var(--radius-pill);background:var(--raise);color:var(--text-2);}.badge[data-tone]{background:var(--tone-bg);color:var(--tone);}.badge[data-tone='done']{background:none;color:var(--text-2);}.empty{color:var(--text-muted);font-size:var(--font-size-sm);padding:4px 8px;}@media (prefers-reduced-motion:reduce){.twist svg{transition:none;}}`]}willUpdate(e){if(e.has(`selected`)&&this.selected){let e=aa(this.items,this.selected);if(e?.some(e=>!0!==this.opened.get(e))){let t=new Map(this.opened);for(let n of e)t.set(n,!0);this.opened=t}}}updated(e){e.has(`selected`)&&this.selected&&!this.matches(`:focus-within`)&&this.rowOf(this.selected)?.scrollIntoView?.({block:`nearest`})}rowOf(e){return this.renderRoot.querySelector(`[data-id="${CSS.escape(e)}"]`)}setOpen(e,t){ra(e)&&this.isOpen(e)!==t&&(this.opened=new Map(this.opened).set(e.id,t),R(this,`cae-toggle`,{id:e.id,open:t}))}choose(e){this.focusId=e.id,ia(e)?R(this,`cae-select`,{id:e.id}):this.setOpen(e,!this.isOpen(e))}async moveTo(e){this.focusId=e,await this.updateComplete,this.rowOf(e)?.focus()}onKey(e,t,n){let r=t[n],i=r.item,a;switch(e.key){case`ArrowDown`:a=t[n+1];break;case`ArrowUp`:a=t[n-1];break;case`Home`:a=t[0];break;case`End`:a=t[t.length-1];break;case`ArrowRight`:ra(i)&&!this.isOpen(i)?this.setOpen(i,!0):ra(i)&&(a=t[n+1]);break;case`ArrowLeft`:ra(i)&&this.isOpen(i)?this.setOpen(i,!1):r.parent&&(a=t.find(e=>e.item.id===r.parent));break;case`Enter`:case` `:this.choose(i);break;default:{if(e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey||!/\S/.test(e.key))return;let r=e.key.toLowerCase();if(a=[...t.slice(n+1),...t.slice(0,n)].find(e=>e.item.name.toLowerCase().startsWith(r)),!a)return}}e.preventDefault(),a&&this.moveTo(a.item.id)}render(){if(!this.items.length)return A`<div class="empty" part="empty">${Ar(na,this.strings).empty}</div>`;let e=function(e,t){let n=[],r=(e,i,a)=>e.forEach((o,s)=>{n.push({item:o,level:i,parent:a,index:s,siblings:e.length}),ra(o)&&t(o)&&r(o.children,i+1,o.id)});return r(e,1,null),n}(this.items,this.isOpen),t=e.find(e=>e.item.id===this.focusId)??e.find(e=>e.item.id===this.selected)??e[0];return A`<div class="tree" role="tree" part="tree" aria-label=${this.label||M}>
|
|
42
42
|
${e.map((n,r)=>this.row(n,r,e,n===t))}
|
|
43
|
-
</div>`}row(e,t,n,r){let i=e.item,a=ra(i),o=a&&this.isOpen(i),s=(i.icon??(a?`directory`:`file`))===`directory`;return
|
|
44
|
-
<span class="twist" aria-hidden="true" @click=${e=>{a&&(e.stopPropagation(),this.focusId=i.id,this.setOpen(i,!o))}}>${a?
|
|
43
|
+
</div>`}row(e,t,n,r){let i=e.item,a=ra(i),o=a&&this.isOpen(i),s=(i.icon??(a?`directory`:`file`))===`directory`;return A`<div class="row" part="item" role="treeitem" data-id=${i.id} tabindex=${r?0:-1} style="--level: ${e.level}" aria-level=${e.level} aria-setsize=${e.siblings} aria-posinset=${e.index+1} aria-expanded=${a?String(o):M} aria-selected=${ia(i)?String(i.id===this.selected):M} @click=${()=>this.choose(i)} @focus=${()=>this.focusId=i.id} @keydown=${e=>this.onKey(e,n,t)} >
|
|
44
|
+
<span class="twist" aria-hidden="true" @click=${e=>{a&&(e.stopPropagation(),this.focusId=i.id,this.setOpen(i,!o))}}>${a?A`<svg width="10" height="10" viewBox="0 0 10 10"><path d="M3 1.5 7 5 3 8.5" fill="none" stroke="currentColor" stroke-width="1.5"></path></svg>`:M}</span>
|
|
45
45
|
<svg class="icon" viewBox="0 0 16 16" aria-hidden="true">${s?oa:sa}</svg>
|
|
46
46
|
<span class="name">${i.name}</span>
|
|
47
|
-
${i.badge?$r(`badge`,{text:i.badge,tone:i.tone??`neutral`}):
|
|
48
|
-
</div>`}};U([
|
|
49
|
-
${this.columns.map(r=>r.id===n?
|
|
50
|
-
</tr>`}render(){let e=Ar(da,this.strings),t=this.rows.length,n=this.columns.map(e=>e.width??`minmax(0, 1fr)`).join(` `),r=this.columns.find(e=>e.rowHeader)?.id,i=this.windowed?this.range.from:0,a=this.shown(),o=this.windowed?this.rowStarts():null,s=o?o[i]:0,c=o?o[t]-o[i+a.length]:0;return
|
|
47
|
+
${i.badge?$r(`badge`,{text:i.badge,tone:i.tone??`neutral`}):M}
|
|
48
|
+
</div>`}};U([F({attribute:!1})],ca.prototype,`items`,void 0),U([F({attribute:!1})],ca.prototype,`selected`,void 0),U([F()],ca.prototype,`label`,void 0),U([F({attribute:!1})],ca.prototype,`strings`,void 0),U([I()],ca.prototype,`opened`,void 0),U([I()],ca.prototype,`focusId`,void 0);var la=class extends N{constructor(...e){super(...e),this.value=0,this.shown=0,this.frame=0}createRenderRoot(){return this}willUpdate(e){if(!e.has(`value`))return;let t=this.shown,n=this.value;if(cancelAnimationFrame(this.frame),globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||t===n||!Number.isFinite(n)||!this.isConnected)return void(this.shown=n);let r=performance.now(),i=e=>{let a=Math.min(1,(e-r)/700);this.shown=Math.round(t+(n-t)*(1-(1-a)**3)),a<1&&(this.frame=requestAnimationFrame(i))};this.frame=requestAnimationFrame(i)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.frame),this.shown=this.value}render(){return String(this.shown)}};U([F({type:Number})],la.prototype,`value`,void 0),U([I()],la.prototype,`shown`,void 0);var ua=class extends N{constructor(){super(),this.since=0,new Fr(this)}createRenderRoot(){return this}render(){return this.since?B((Date.now()-this.since)/1e3):``}};U([F({type:Number})],ua.prototype,`since`,void 0);var da={empty:`No rows`,sortAscending:`Sort ascending`,sortDescending:`Sort descending`},fa=k` :host{display:block;container-type:inline-size;}table{display:block;width:100%;border-collapse:collapse;overflow-x:auto;}caption{display:block;text-align:start;}thead,tbody{display:block;}tr{display:grid;grid-template-columns:var(--cae-data-table-columns);column-gap:var(--cae-data-table-gap,12px);align-items:center;padding:var(--cae-data-table-row-padding,6px 12px);}th,td{display:block;min-width:0;padding:0;text-align:start;font-weight:inherit;}[data-align='end']{text-align:end;font-variant-numeric:tabular-nums;}thead tr{color:var(--text-muted);font-size:var(--font-size-sm);border-bottom:1px solid var(--line);}tbody tr{border-bottom:1px solid var(--line);}tbody tr[data-key]{cursor:pointer;}table.passive tbody tr[data-key]{cursor:default;}tbody tr[data-key]:hover{background:var(--raise);}tbody tr[data-key]:focus-visible{outline-offset:-2px;}tbody tr[aria-current='true']{background:var(--accent-bg);}tbody tr[data-tone='running']{background:var(--status-running-bg);}tbody tr[data-tone='failed']{background:color-mix(in srgb,var(--status-failed) 6%,transparent);box-shadow:inset 3px 0 0 var(--status-failed);}tr.spacer{display:block;padding:0;border:0;}tr.empty{display:block;border:0;padding:0;}tr.empty td{color:var(--text-muted);padding:8px;}.sort{display:inline-flex;align-items:center;gap:4px;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;}.sort:hover{color:var(--text);}.arrow{font-size:0.85em;}`,pa=ei(class extends ti{constructor(e){if(super(e),this.names=[],e.type!==6)throw Error(`attrs() goes on an element`)}render(e){return M}update(e,[t]){let n=e.element,r=Object.keys(t??{});for(let e of this.names)r.includes(e)||n.removeAttribute(e);for(let e of r)n.getAttribute(e)!==t[e]&&n.setAttribute(e,t[e]);return this.names=r,M}}),ma=new Set([`A`,`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`SUMMARY`,`LABEL`]),ha=class extends N{constructor(...e){super(...e),this.columns=[],this.rows=[],this.rowKey=e=>{let t=e.id;return typeof t==`string`||typeof t==`number`?String(t):``},this.activatable=!0,this.selected=null,this.sort=null,this.windowAt=200,this.rowHeight=32,this.caption=``,this.strings={},this.cellStyles=[],this.range={from:0,to:60},this.heights=new Map,this.offsets=null,this.focusKey=null,this.scroller=null,this.resized=null,this.frame=0,this.held=!1,this.roving=new mi(this,{items:()=>[...this.renderRoot.querySelectorAll(`tbody tr[data-key]`)],layout:`vertical`,onMove:e=>this.focusKey=e.dataset.key??null}),this.onScroll=()=>{this.frame||=requestAnimationFrame(()=>{this.frame=0,this.reframe()})},this.onClick=e=>{let t=this.rowOf(e);t&&this.act(t.id)},this.onFocusIn=e=>{let t=this.rowOf(e);t&&(this.focusKey=t.id)},this.onKey=e=>{let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.tagName===`TR`&&t.dataset.key!==void 0){if(e.key===`Enter`)return e.preventDefault(),void this.act(t.dataset.key);if(this.windowed&&(e.key===`Home`||e.key===`End`)){e.preventDefault(),e.stopPropagation();let t=e.key===`End`,n=this.rows[t?this.rows.length-1:0];if(n===void 0)return;this.focusKey=this.rowKey(n);let r=this.rows.length,i=Math.max(1,this.range.to-this.range.from);this.scrollToEnd(t),this.range=t?{from:Math.max(0,r-i),to:r}:{from:0,to:i},this.held=!0,this.updateComplete.then(()=>this.renderRoot.querySelector(`tbody tr[data-key="${CSS.escape(this.focusKey??``)}"]`)?.focus())}}}}static{this.styles=[V,fa]}get windowed(){return this.rows.length>this.windowAt}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}rowStarts(){if(this.offsets)return this.offsets;let e=0;for(let t of this.heights.values())e+=t;let t=this.heights.size?e/this.heights.size:this.rowHeight;return this.offsets=function(e,t){let n=Array(Math.max(0,e)+1);n[0]=0;for(let r=0;r<e;r++)n[r+1]=n[r]+Math.max(0,t(r));return n}(this.rows.length,e=>this.heights.get(this.rowKey(this.rows[e]))??t)}visible(){let e=this.rowStarts(),t=this.renderRoot.querySelector(`tbody`);if(!t||!this.scroller)return hi(e,0,e.at(-1)/Math.max(1,this.rows.length)*60,0);let n=this.scroller instanceof HTMLElement?{top:this.scroller.getBoundingClientRect().top,height:this.scroller.clientHeight}:{top:0,height:this.scroller.innerHeight};return hi(e,n.top-t.getBoundingClientRect().top,n.height)}scrollToEnd(e){let t=this.renderRoot.querySelector(`tbody`),n=this.scroller;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n instanceof HTMLElement?n.getBoundingClientRect():{top:0,bottom:n.innerHeight},a=e?r.bottom-i.bottom:r.top-i.top;n instanceof HTMLElement?n.scrollTop+=a:n.scrollBy(0,a)}reframe(){let e=this.visible();e.from===this.range.from&&e.to===this.range.to||(this.range={from:e.from,to:e.to})}findScroller(){let e=this.parentNode;for(;e;){if(e instanceof HTMLElement){let t=getComputedStyle(e).overflowY;if((t===`auto`||t===`scroll`||t===`overlay`)&&e.scrollHeight>e.clientHeight+1)return e}e=e instanceof ShadowRoot?e.host:e.parentNode}return window}watch(){this.scroller||(this.scroller=this.findScroller(),this.scroller.addEventListener(`scroll`,this.onScroll,{passive:!0}),this.scroller instanceof HTMLElement?typeof ResizeObserver<`u`&&(this.resized??=new ResizeObserver(this.onScroll)).observe(this.scroller):window.addEventListener(`resize`,this.onScroll,{passive:!0}))}unwatch(){cancelAnimationFrame(this.frame),this.frame=0,this.scroller?.removeEventListener(`scroll`,this.onScroll),window.removeEventListener(`resize`,this.onScroll),this.resized?.disconnect(),this.scroller=null}willUpdate(e){if((e.has(`rows`)||e.has(`rowHeight`))&&(this.offsets=null),e.has(`rows`)||e.has(`windowAt`)){if(this.windowed&&this.hasUpdated){let e=this.visible();this.range={from:e.from,to:e.to}}else this.windowed||this.unwatch()}let t=this.shown().map(this.rowKey),n=this.focusKey===null?-1:t.indexOf(this.focusKey);this.roving.current=Math.max(0,n)}updated(e){if(e.has(`cellStyles`)&&this.renderRoot instanceof ShadowRoot&&pt(this.renderRoot,[...this.constructor.elementStyles,...this.cellStyles]),!this.windowed)return;this.watch();let t=!1;for(let e of this.renderRoot.querySelectorAll(`tbody tr[data-key]`)){let n=e.getBoundingClientRect().height,r=e.dataset.key;n>0&&Math.abs(n-(this.heights.get(r)??-1))>.5&&(this.heights.set(r,n),t=!0)}t&&(this.offsets=null),this.held?this.held=!1:this.onScroll()}shown(){return this.windowed?this.rows.slice(this.range.from,Math.min(this.rows.length,this.range.to)):this.rows}rowOf(e){for(let t of e.composedPath())if(t instanceof HTMLElement){if(ma.has(t.tagName))return null;if(t.tagName===`TR`&&t.dataset.key!==void 0)return{tr:t,id:t.dataset.key};if(t===this)break}return null}act(e){this.activatable?R(this,`cae-activate`,{id:e}):(this.selected=e,R(this,`cae-select`,{id:e}))}header(e,t){let n=this.sort?.id===e.id?this.sort.direction:null,r=n===`asc`?`ascending`:n===`desc`?`descending`:M,i=(e=>e.sortable??!!e.compare)(e)?A`<button type="button" class="sort" title=${n===`asc`?t.sortDescending:t.sortAscending} @click=${()=>R(this,`cae-sort`,{id:e.id,direction:n===`asc`?`desc`:`asc`})}>${e.header}${n?A`<span class="arrow" aria-hidden="true">${n===`asc`?`▲`:`▼`}</span>`:M}</button>`:e.header;return A`<th scope="col" role="columnheader" part="header-cell" data-col=${e.id} data-align=${e.align??M} aria-sort=${r} title=${e.tip||M}>${i}</th>`}row(e,t,n){let r=this.rowKey(e),i=this.selected!==null&&this.selected===r;return A`<tr role="row" part=${i?`row row-selected`:`row`} data-key=${r} data-tone=${L(this.rowTone?.(e))} aria-current=${i?`true`:M} aria-rowindex=${this.windowed?t+2:M} ${pa(this.rowAttrs?.(e))}>
|
|
49
|
+
${this.columns.map(r=>r.id===n?A`<th scope="row" role="rowheader" part="cell" data-col=${r.id} data-align=${r.align??M}>${r.cell(e,t)}</th>`:A`<td role="cell" part="cell" data-col=${r.id} data-align=${r.align??M}>${r.cell(e,t)}</td>`)}
|
|
50
|
+
</tr>`}render(){let e=Ar(da,this.strings),t=this.rows.length,n=this.columns.map(e=>e.width??`minmax(0, 1fr)`).join(` `),r=this.columns.find(e=>e.rowHeader)?.id,i=this.windowed?this.range.from:0,a=this.shown(),o=this.windowed?this.rowStarts():null,s=o?o[i]:0,c=o?o[t]-o[i+a.length]:0;return A`<table part="table" data-scroll="x" role="table" class=${this.activatable?``:`passive`} style="--cae-data-table-columns: ${n}" aria-rowcount=${this.windowed?t+1:M}>
|
|
51
51
|
<caption part="caption"><slot name="caption">${this.caption}</slot></caption>
|
|
52
52
|
<thead part="head" role="rowgroup"><tr role="row">${this.columns.map(t=>this.header(t,e))}</tr></thead>
|
|
53
53
|
<tbody role="rowgroup" @click=${this.onClick} @keydown=${this.onKey} @focusin=${this.onFocusIn}>
|
|
54
|
-
${s>0?
|
|
54
|
+
${s>0?A`<tr class="spacer" aria-hidden="true" style="height: ${s}px"></tr>`:M}
|
|
55
55
|
${H(a,this.rowKey,(e,t)=>this.row(e,i+t,r))}
|
|
56
|
-
${c>0?
|
|
57
|
-
${t?
|
|
56
|
+
${c>0?A`<tr class="spacer" aria-hidden="true" style="height: ${c}px"></tr>`:M}
|
|
57
|
+
${t?M:A`<tr class="empty" role="row"><td part="empty" role="cell" colspan=${this.columns.length||1}><slot name="empty">${e.empty}</slot></td></tr>`}
|
|
58
58
|
</tbody>
|
|
59
|
-
</table>`}};U([
|
|
59
|
+
</table>`}};U([F({attribute:!1})],ha.prototype,`columns`,void 0),U([F({attribute:!1})],ha.prototype,`rows`,void 0),U([F({attribute:!1})],ha.prototype,`rowKey`,void 0),U([F({attribute:!1})],ha.prototype,`rowTone`,void 0),U([F({attribute:!1})],ha.prototype,`rowAttrs`,void 0),U([F({type:Boolean})],ha.prototype,`activatable`,void 0),U([F()],ha.prototype,`selected`,void 0),U([F({attribute:!1})],ha.prototype,`sort`,void 0),U([F({type:Number})],ha.prototype,`windowAt`,void 0),U([F({type:Number})],ha.prototype,`rowHeight`,void 0),U([F()],ha.prototype,`caption`,void 0),U([F({attribute:!1})],ha.prototype,`strings`,void 0),U([F({attribute:!1})],ha.prototype,`cellStyles`,void 0),U([I()],ha.prototype,`range`,void 0);var ga=k` :host{display:block;container-type:inline-size;}.tiles{display:grid;grid-template-columns:repeat(var(--cae-stat-tiles-columns,5),minmax(0,1fr));gap:var(--cae-stat-tiles-gap,12px);}@container (max-width:1100px){.tiles{grid-template-columns:repeat(4,minmax(0,1fr));}}@container (max-width:660px){.tiles{grid-template-columns:repeat(2,minmax(0,1fr));}}@container (max-width:420px){.tile{padding:10px 12px;}.value{font-size:22px;}}@container (max-width:240px){.tiles{grid-template-columns:minmax(0,1fr);}}.tile{position:relative;background:color-mix(in srgb,var(--text) 2.5%,transparent);border:1px solid var(--line);border-radius:11px;padding:12px 14px;overflow:hidden;}.tile::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--edge,transparent);}.label{font-size:12px;font-weight:600;color:var(--text-muted);}.value{overflow-wrap:anywhere;font-size:28px;font-weight:700;line-height:1.15;margin-top:6px;font-variant-numeric:tabular-nums;letter-spacing:-0.01em;color:var(--text);}.sub{font-size:11.5px;color:var(--text-muted);margin-top:2px;}.action{font-size:11.5px;margin-top:4px;}.tile[data-tone]{--edge:var(--tone);}.tile[data-tone] .value,.tile[data-tone] .label::before{color:var(--tone);}.label[data-mark]::before{display:inline-block;}`,_a=class extends N{constructor(...e){super(...e),this.tiles=[],this.columns=5,this.bump=!0,this.prev=new Map,this.changed=[]}static{this.styles=[V,ga]}willUpdate(e){if(e.has(`tiles`))for(let e of this.tiles)typeof e.value==`number`&&((this.prev.get(e.id)??0)!==e.value&&this.changed.push(e.id),this.prev.set(e.id,e.value))}render(){return A`<div class="tiles" part="tiles" style=${this.columns===5?M:`--cae-stat-tiles-columns:${this.columns}`}>
|
|
60
60
|
${H(this.tiles,e=>e.id,e=>this.tile(e))}
|
|
61
|
-
</div>`}tile(e){let t=e.tone??`neutral`;return
|
|
62
|
-
<div class="label words" part="label" data-mark=${Yr(t)??
|
|
63
|
-
<div class="value" part="value">${typeof e.value==`number`?
|
|
64
|
-
${(e.sub??[]).map(e=>
|
|
65
|
-
${e.action?
|
|
66
|
-
</div>`}updated(){let e=this.changed;if(this.changed=[],this.bump&&!globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)for(let t of this.renderRoot.querySelectorAll(`.tile`))e.includes(t.dataset.id??``)&&t.animate?.([{transform:`scale(1)`},{transform:`scale(1.04)`,boxShadow:`0 0 0 1px var(--line2)`,offset:.35},{transform:`scale(1)`}],{duration:700,easing:`cubic-bezier(.2,.8,.2,1)`})}};U([
|
|
67
|
-
<div class="axis" part="axis">${[0,.25,.5,.75,1].map(e=>
|
|
61
|
+
</div>`}tile(e){let t=e.tone??`neutral`;return A`<div class="tile" part="tile" data-tone=${L(t)} data-id=${e.id} title=${e.tip??M}>
|
|
62
|
+
<div class="label words" part="label" data-mark=${Yr(t)??M}>${e.label}</div>
|
|
63
|
+
<div class="value" part="value">${typeof e.value==`number`?A`<cae-count .value=${e.value}></cae-count>`:e.value}</div>
|
|
64
|
+
${(e.sub??[]).map(e=>A`<div class="sub words" part="sub">${di(e)}</div>`)}
|
|
65
|
+
${e.action?A`<div class="action words"><a class="lnk" part="action" href="#" @click=${t=>{t.preventDefault(),e.action&&R(this,`cae-action`,{id:e.id,action:e.action.id})}}>${e.action.label}</a></div>`:M}
|
|
66
|
+
</div>`}updated(){let e=this.changed;if(this.changed=[],this.bump&&!globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)for(let t of this.renderRoot.querySelectorAll(`.tile`))e.includes(t.dataset.id??``)&&t.animate?.([{transform:`scale(1)`},{transform:`scale(1.04)`,boxShadow:`0 0 0 1px var(--line2)`,offset:.35},{transform:`scale(1)`}],{duration:700,easing:`cubic-bezier(.2,.8,.2,1)`})}};U([F({attribute:!1})],_a.prototype,`tiles`,void 0),U([F({type:Number})],_a.prototype,`columns`,void 0),U([F({type:Boolean})],_a.prototype,`bump`,void 0);var va={omitted:e=>e===1?`1 bar not shown`:`${e} bars not shown`,empty:`No bars`},ya=k` :host{display:block;container-type:inline-size;--label:var(--cae-lanes-label-width,112px);}@container (max-width:760px){.lanes{--label:var(--cae-lanes-label-width,78px);}}@container (max-width:480px){.axis span:nth-child(even){display:none;}}.lanes{position:relative;}.axis{display:flex;justify-content:space-between;font-family:var(--mono);font-size:10px;color:var(--text-muted);margin:0 0 6px calc(var(--label) + 8px);}.lane{display:grid;grid-template-columns:var(--label) minmax(0,1fr);gap:8px;align-items:center;min-height:24px;padding:4px 0;}.name{font-size:11.5px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.track{position:relative;height:calc(var(--rows,1) * 14px + 2px);border-radius:4px;background:repeating-linear-gradient(90deg,color-mix(in srgb,var(--text) 5%,transparent) 0 1px,transparent 1px 10%);}.bar{position:absolute;top:calc(var(--row,0) * 14px + 2px);height:12px;border-radius:4px;min-width:3px;cursor:default;transform-origin:left center;transition:width 1s linear;}.anim .bar:not(.running){animation:growx 0.6s var(--ease) both;}:is(.bar,.legend i)[data-pattern]{background:var(--bar);}:is(.bar,.legend i)[data-pattern='hatched']{background:repeating-linear-gradient(135deg,var(--bar) 0 3px,color-mix(in srgb,var(--bar) 55%,var(--bg)) 3px 5px);}:is(.bar,.legend i)[data-pattern='outline']{background:none;box-shadow:inset 0 0 0 1.5px var(--bar);}:is(.bar,.legend i)[data-pattern='striped']{background:repeating-linear-gradient(45deg,var(--bar) 0 6px,color-mix(in srgb,var(--bar) 60%,var(--bg)) 6px 12px);background-size:17px 17px;}.bar[data-pattern='striped']{animation:stripes 0.8s linear infinite;box-shadow:0 0 12px color-mix(in srgb,var(--bar) 45%,transparent);}.bar:hover{filter:brightness(1.2);}.now{position:absolute;top:-4px;bottom:-4px;width:2px;background:var(--status-running);border-radius:2px;box-shadow:0 0 10px var(--status-running);}.legend{margin-top:10px;}.legend + .legend{margin-top:4px;}`,ba=class extends N{constructor(...e){super(...e),this.lanes=[],this.barStyles={},this.range=null,this.live=!1,this.omitted=0,this.locale=``,this.strings={},this.timer=null,this.drawn=!1}static{this.styles=[V,oi,ya]}connectedCallback(){super.connectedCallback(),this.tick(this.live)}disconnectedCallback(){super.disconnectedCallback(),this.tick(!1)}updated(e){e.has(`live`)&&this.tick(this.live)}tick(e){e&&!this.timer&&(this.timer=setInterval(()=>this.requestUpdate(),1e3)),!e&&this.timer&&(clearInterval(this.timer),this.timer=null)}time(e,t){let n=this.locale||document.documentElement.lang||void 0;return new Date(e).toLocaleTimeString(n,{hour:`2-digit`,minute:`2-digit`,...t?{second:`2-digit`}:{},hourCycle:`h23`})}render(){let e=Ar(va,this.strings),t=Date.now(),n=this.range??function(e,t){let n=e.flatMap(e=>e.bars);if(!n.length)return null;let r=Math.min(...n.map(e=>e.start));return{start:r,end:n.some(e=>e.end===null)?r+6e4*Math.ceil((t-r+2e4)/6e4):Math.max(...n.map(e=>e.end??t))}}(this.lanes,t);if(!n)return A`<div part="empty"><slot name="empty">${e.empty}</slot></div>`;let r=!this.drawn;this.drawn=!0;let i=Math.max(1,n.end-n.start),a=this.lanes.some(e=>e.bars.some(e=>e.end===null)),o=i<6e5,s=Math.min(1,(t-n.start)/i);return A`<div class="lanes ${r?`anim`:``}">
|
|
67
|
+
<div class="axis" part="axis">${[0,.25,.5,.75,1].map(e=>A`<span>${this.time(n.start+i*e,o)}</span>`)}</div>
|
|
68
68
|
${H(this.lanes,e=>e.id,e=>this.lane(e,n,t))}
|
|
69
|
-
${a?
|
|
69
|
+
${a?A`<span class="now" part="now" style="left:calc(var(--label) + 8px + (100% - var(--label) - 8px) * ${s.toFixed(4)})"></span>`:M}
|
|
70
70
|
</div>
|
|
71
|
-
${this.legends(e)}`}lane(e,t,n){let r=function(e){let t=[];return[...e].sort((e,t)=>e.start-t.start).map(e=>{let n=e.end??1/0,r=t.findIndex(t=>t<=e.start);return r<0?r=t.push(n)-1:t[r]=n,{bar:e,row:r}})}(e.bars),i=Math.max(1,...r.map(e=>e.row+1));return
|
|
71
|
+
${this.legends(e)}`}lane(e,t,n){let r=function(e){let t=[];return[...e].sort((e,t)=>e.start-t.start).map(e=>{let n=e.end??1/0,r=t.findIndex(t=>t<=e.start);return r<0?r=t.push(n)-1:t[r]=n,{bar:e,row:r}})}(e.bars),i=Math.max(1,...r.map(e=>e.row+1));return A`<div class="lane" part="lane">
|
|
72
72
|
<span class="name" part="lane-label" title=${e.label}>${e.label}</span>
|
|
73
73
|
<div class="track" part="track" style="--rows:${i}">
|
|
74
|
-
${r.map(({bar:e,row:r})=>{let i=function(e,t,n){let r=Math.max(1,t.end-t.start),i=(e.start-t.start)/r*100,a=((e.end??n)-e.start)/r*100;return{left:i,width:Math.max(.4,e.end===null?Math.min(100-i,a):a)}}(e,t,n),a=this.barStyles[e.style];return
|
|
74
|
+
${r.map(({bar:e,row:r})=>{let i=function(e,t,n){let r=Math.max(1,t.end-t.start),i=(e.start-t.start)/r*100,a=((e.end??n)-e.start)/r*100;return{left:i,width:Math.max(.4,e.end===null?Math.min(100-i,a):a)}}(e,t,n),a=this.barStyles[e.style];return A`<span class="bar ${e.end===null?`running`:``}" part="bar" data-style=${e.style} data-pattern=${a?.pattern??`solid`} title=${e.label} style="--bar:${a?.color??`var(--line2)`};--row:${r};left:min(${i.left.toFixed(3)}%, 100% - max(3px, ${i.width.toFixed(3)}%));width:${i.width.toFixed(3)}%"></span>`})}
|
|
75
75
|
</div>
|
|
76
|
-
</div>`}legends(e){let t=[];for(let e of Object.values(this.barStyles)){let n=e.group??0;(t[n]??=[]).push({label:e.label,icon:
|
|
77
|
-
${t.length?ai(t,{label:this.label}):
|
|
76
|
+
</div>`}legends(e){let t=[];for(let e of Object.values(this.barStyles)){let n=e.group??0;(t[n]??=[]).push({label:e.label,icon:A`<i data-pattern=${e.pattern??`solid`} style="--bar:${e.color}"></i>`})}let n=t.filter(Boolean);return this.omitted&&(n.length||n.push([]),n[n.length-1].push({label:e.omitted(this.omitted)})),n.map(e=>ai(e))}};U([F({attribute:!1})],ba.prototype,`lanes`,void 0),U([F({attribute:!1})],ba.prototype,`barStyles`,void 0),U([F({attribute:!1})],ba.prototype,`range`,void 0),U([F({type:Boolean})],ba.prototype,`live`,void 0),U([F({type:Number})],ba.prototype,`omitted`,void 0),U([F()],ba.prototype,`locale`,void 0),U([F({attribute:!1})],ba.prototype,`strings`,void 0);var xa={empty:`No values`,showTable:`Show table`,showChart:`Show chart`,label:`Label`,other:`Other`,total:`Total`,none:`—`,scale:(e,t)=>`${e} to ${t}`},Sa=`var(--meter)`,Ca=e=>e<6?`var(--series-${e+1})`:Sa;function wa(e,t,n=4){let r=Math.min(0,e),i=Math.max(0,t);if(!(i>r))return{min:0,max:1,ticks:[0,1]};let a=(i-r)/n,o=10**Math.floor(Math.log10(a)),s=[1,2,2.5,5,10].map(e=>e*o).find(e=>e>=a)??10*o,c=Math.floor(r/s)*s,l=Math.ceil(i/s)*s,u=[];for(let e=c;e<=l+s/2;e+=s)u.push(Math.round(e/s)*s);return{min:c,max:l,ticks:u}}function Ta(e,t,n){return e<=0||t<=0?1:Math.max(1,Math.ceil(e*n/t))}var Ea,Da=e=>String(Math.round(100*e)/100),Oa=new Map,ka=class extends N{constructor(...e){super(...e),this.label=``,this.format=Da,this.strings={},this.height=200,this.width=0,this.asTable=!1,this.active=null,this.resized=null,this.fontsLoaded=()=>{Oa.clear(),this.requestUpdate()},this.onKey=e=>{let t=this.itemCount();if(!t)return;let n=this.active,r=n,i=this.rowLength(),a=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:e.key===`ArrowDown`?i:e.key===`ArrowUp`?-i:0;if(a)r=n===null?a>0?0:t-1:Math.min(t-1,Math.max(0,n+a));else if(e.key===`Home`)r=0;else if(e.key===`End`)r=t-1;else{if(e.key!==`Escape`)return;r=null}e.preventDefault(),this.active=r}}static{this.styles=[V,oi,k` :host{display:block;min-width:0;}.head{display:flex;align-items:flex-start;gap:12px;margin-bottom:8px;min-height:22px;}.head .legend{flex:1;min-width:0;}.head .legend span{color:var(--text-2);}.switch{margin-left:auto;flex:none;background:none;border:1px solid var(--line);border-radius:999px;padding:2px 10px;font:inherit;font-size:var(--font-size-sm);color:var(--text-muted);cursor:pointer;}.switch:hover,.switch:focus-visible{color:var(--text);border-color:var(--line2);}.plot{position:relative;outline-offset:2px;}.plot:focus-visible{outline:2px solid var(--accent);border-radius:var(--radius-sm);}svg{display:block;overflow:visible;}.axis{font-size:${10.5}px;fill:var(--text-muted);font-variant-numeric:tabular-nums;}.grid{stroke:var(--line);stroke-width:1;shape-rendering:crispEdges;}.base{stroke:var(--line2);stroke-width:1;shape-rendering:crispEdges;}.hit{fill:transparent;}.band{fill:var(--text);opacity:0.05;}.tip{position:absolute;z-index:2;pointer-events:none;padding:6px 9px;border-radius:var(--radius-sm);background:var(--raise);border:1px solid var(--line2);box-shadow:0 4px 14px var(--shadow);color:var(--text);font-size:var(--font-size-sm);white-space:nowrap;line-height:1.45;}.tip b{font-weight:600;}.tip .row{display:flex;align-items:center;gap:6px;}.tip .row i{width:9px;height:9px;border-radius:2px;flex:none;}.tip .row .v{margin-left:auto;padding-left:12px;font-variant-numeric:tabular-nums;}.scale{display:inline-flex;gap:1px;margin-right:6px;vertical-align:-1px;}.legend .scale i{width:12px;height:10px;margin:0;border-radius:2px;}.empty{padding:18px 0;color:var(--text-muted);font-size:var(--font-size-sm);}table{border-collapse:collapse;font-size:var(--font-size-sm);font-variant-numeric:tabular-nums;}.tbl{overflow-x:auto;max-width:100%;}th,td{padding:4px 12px 4px 0;text-align:right;white-space:nowrap;border-bottom:1px solid var(--line);}th{color:var(--text-muted);font-weight:500;}th:first-child,td:first-child{text-align:left;}td{color:var(--text-2);}`]}get words(){return Ar(xa,this.strings)}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<`u`&&(this.resized??=new ResizeObserver(e=>{let t=Math.floor(e[0]?.contentRect.width??0);t&&Math.abs(t-this.width)>=1&&(this.width=t)}),this.resized.observe(this),document.fonts?.addEventListener(`loadingdone`,this.fontsLoaded))}disconnectedCallback(){super.disconnectedCallback(),this.resized?.disconnect(),document.fonts?.removeEventListener(`loadingdone`,this.fontsLoaded)}labelWidth(e){let t=getComputedStyle(this);return Math.ceil(function(e,t){if(Ea??=typeof document>`u`?null:document.createElement(`canvas`).getContext(`2d`),!Ea)return 10.5*e.length*.62;let n=`${t}\n${e}`,r=Oa.get(n);return r===void 0&&(Ea.font=t,r=Ea.measureText(e).width,Oa.set(n,r)),r}(e,`${t.fontStyle} ${t.fontWeight} 10.5px ${t.fontFamily}`))+6}firstUpdated(){this.width||=Math.floor(this.getBoundingClientRect().width)||600}get plotWidth(){return Math.max(240,this.width||600)}rowLength(){return 1}render(){let e=this.words;if(!this.hasValues())return A`<div class="empty" part="empty">${e.empty}</div>`;let t=this.legendItems();return A`<div class="head">
|
|
77
|
+
${t.length?ai(t,{label:this.label}):A`<span class="legend"></span>`}
|
|
78
78
|
<button type="button" class="switch" part="switch" aria-pressed=${this.asTable} @click=${()=>(this.asTable=!this.asTable,this.active=null)}>${this.asTable?e.showChart:e.showTable}</button>
|
|
79
79
|
</div>
|
|
80
|
-
${this.asTable?
|
|
81
|
-
${i.ticks.map(e=>
|
|
80
|
+
${this.asTable?A`<div class="tbl" part="table">${this.table()}</div>`:A`<div class="plot" part="plot" tabindex=${this.itemCount()?0:M} role="group" aria-label=${this.label||M} @keydown=${this.onKey} @blur=${()=>this.active=null} @mouseleave=${()=>this.active=null}>${this.plot()}</div>`}`}tip(e,t,n){let r=this.plotWidth,i=e>.6*r?`right`:`left`;return A`<div class="tip" role="status" style="${i}: ${i===`left`?Math.max(0,e+12):Math.max(0,r-e+12)}px; top: ${Math.max(0,t)}px">${n}</div>`}tipRow(e,t,n){return A`<div class="row">${e?A`<i style="background: ${e}"></i>`:M}<span>${t}</span><span class="v">${n}</span></div>`}};function Aa(e,t,n,r,i){if(r<=0||n<=0)return``;let a=i?Math.min(4,n/2,r):0;return`M${e},${t+r}V${t+a}${a?`Q${e},${t} ${e+a},${t}`:``}H${e+n-a}${a?`Q${e+n},${t} ${e+n},${t+a}`:``}V${t+r}Z`}U([F()],ka.prototype,`label`,void 0),U([F({attribute:!1})],ka.prototype,`format`,void 0),U([F({attribute:!1})],ka.prototype,`strings`,void 0),U([F({type:Number})],ka.prototype,`height`,void 0),U([I()],ka.prototype,`width`,void 0),U([I()],ka.prototype,`asTable`,void 0),U([I()],ka.prototype,`active`,void 0);var ja=class extends ka{constructor(...e){super(...e),this.x=[],this.series=[],this.stacked=!1}get drawn(){return function(e,t){if(e.length<=6)return e.map((e,t)=>({...e,colour:Ca(t)}));let n=e.slice(0,5).map((e,t)=>({...e,colour:Ca(t)})),r=e.slice(5),i=Math.max(...r.map(e=>e.values.length)),a=Array.from({length:i},(e,t)=>{let n=r.map(e=>e.values[t]).filter(e=>e!=null);return n.length?n.reduce((e,t)=>e+t,0):null});return[...n,{name:t,values:a,colour:Sa,folded:r.map(e=>e.name)}]}(this.series,this.words.other)}hasValues(){return this.x.length>0&&this.series.some(e=>e.values.some(e=>e!=null))}legendItems(){let e=this.drawn;return e.length>1?e.map(e=>({label:e.name,swatch:e.colour})):[]}itemCount(){return this.x.length}total(e){return this.drawn.reduce((t,n)=>t+Math.max(0,n.values[e]??0),0)}plot(){let e=this.drawn,t=this.x.length,n=e.flatMap(e=>e.values.filter(e=>e!=null)),r=this.stacked?Math.max(0,...this.x.map((e,t)=>this.total(t))):Math.max(0,...n),i=wa(Math.min(0,...n),r),a=Math.max(...i.ticks.map(e=>this.labelWidth(this.format(e))))+4,o=this.plotWidth,s=this.height,c=o-a-4,l=s-8-22,u=e=>8+l-(e-i.min)/(i.max-i.min)*l,d=c/t,f=Math.max(2,Math.min(40,d*(this.stacked||e.length===1?.62:.8))),p=Ta(t,c,Math.max(...this.x.map(e=>this.labelWidth(e)))+12),m=[];for(let n=0;n<t;n++){let t=a+n*d+(d-f)/2;if(this.stacked){let r=0,i=e.map(e=>({s:e,v:Math.max(0,e.values[n]??0)})).filter(e=>e.v>0);i.forEach((e,n)=>{let a=u(r+e.v),o=u(r)-a-(n>0?2:0);m.push(j`<path d=${Aa(t,a,f,Math.max(0,o),n===i.length-1)} fill=${e.s.colour}></path>`),r+=e.v})}else{let r=(f-2*(e.length-1))/e.length;e.forEach((e,i)=>{let a=e.values[n];if(a==null||a===0)return;let o=u(Math.max(0,a)),s=u(Math.min(0,a));m.push(j`<path d=${Aa(t+i*(r+2),o,Math.max(1,r),s-o,a>0)} fill=${e.colour}></path>`)})}}let h=this.active;return A`<svg width=${o} height=${s} role="img" aria-label=${this.label||M}>
|
|
81
|
+
${i.ticks.map(e=>j`<line class=${e===0?`base`:`grid`} x1=${a} x2=${o-4} y1=${u(e)} y2=${u(e)}></line>
|
|
82
82
|
<text class="axis" x=${a-6} y=${u(e)} dy="0.32em" text-anchor="end">${this.format(e)}</text>`)}
|
|
83
|
-
${h===null?j
|
|
83
|
+
${h===null?M:j`<rect class="band" x=${a+h*d} y=${8} width=${d} height=${l}></rect>`}
|
|
84
84
|
${m}
|
|
85
|
-
${this.x.map((e,t)=>t%p===0?
|
|
86
|
-
${this.x.map((e,t)=>
|
|
85
|
+
${this.x.map((e,t)=>t%p===0?j`<text class="axis" x=${a+t*d+d/2} y=${s-6} text-anchor="middle">${e}</text>`:M)}
|
|
86
|
+
${this.x.map((e,t)=>j`<rect class="hit" x=${a+t*d} y=${8} width=${d} height=${l+22} @mouseenter=${()=>this.active=t}></rect>`)}
|
|
87
87
|
</svg>
|
|
88
|
-
${h!==null&&h<t?this.tip(a+h*d+d/2,8,this.tipBody(h)):
|
|
88
|
+
${h!==null&&h<t?this.tip(a+h*d+d/2,8,this.tipBody(h)):M}`}tipBody(e){let t=this.drawn,n=this.words.none;return A`<b>${this.x[e]}</b>
|
|
89
89
|
${[...t].reverse().map(t=>this.tipRow(t.colour,t.name,t.values[e]===null||t.values[e]===void 0?n:this.format(t.values[e])))}
|
|
90
|
-
${this.stacked&&t.length>1?this.tipRow(null,this.words.total,this.format(this.total(e))):
|
|
91
|
-
<thead><tr><th scope="col">${this.words.label}</th>${e.map(e=>
|
|
92
|
-
<tbody>${this.x.map((r,i)=>
|
|
93
|
-
</table>`}};U([
|
|
94
|
-
${n.ticks.map(e=>
|
|
90
|
+
${this.stacked&&t.length>1?this.tipRow(null,this.words.total,this.format(this.total(e))):M}`}table(){let e=this.drawn,t=this.words.none,n=this.stacked&&e.length>1;return A`<table aria-label=${this.label||M}>
|
|
91
|
+
<thead><tr><th scope="col">${this.words.label}</th>${e.map(e=>A`<th scope="col">${e.name}</th>`)}${n?A`<th scope="col">${this.words.total}</th>`:M}</tr></thead>
|
|
92
|
+
<tbody>${this.x.map((r,i)=>A`<tr><th scope="row">${r}</th>${e.map(e=>A`<td>${e.values[i]===null||e.values[i]===void 0?t:this.format(e.values[i])}</td>`)}${n?A`<td>${this.format(this.total(i))}</td>`:M}</tr>`)}</tbody>
|
|
93
|
+
</table>`}};U([F({attribute:!1})],ja.prototype,`x`,void 0),U([F({attribute:!1})],ja.prototype,`series`,void 0),U([F({type:Boolean})],ja.prototype,`stacked`,void 0);var Ma=class extends ka{constructor(...e){super(...e),this.x=[],this.series=[]}hasValues(){return this.x.length>0&&this.series.some(e=>e.values.some(e=>e!=null))}legendItems(){return this.series.length>1?this.series.map((e,t)=>({label:e.name,swatch:Ca(t)})):[]}itemCount(){return this.x.length}plot(){let e=this.x.length,t=this.series.flatMap(e=>e.values.filter(e=>e!=null)),n=wa(Math.min(0,...t),Math.max(0,...t)),r=Math.max(...n.ticks.map(e=>this.labelWidth(this.format(e))))+4,i=this.plotWidth,a=this.height,o=i-r-10,s=a-8-22,c=e>1?o/(e-1):0,l=t=>e>1?r+t*c:r+o/2,u=e=>8+s-(e-n.min)/(n.max-n.min)*s,d=Ta(e,o,Math.max(...this.x.map(e=>this.labelWidth(e)))+12),f=this.active,p=e>1?c:o;return A`<svg width=${i} height=${a} role="img" aria-label=${this.label||M}>
|
|
94
|
+
${n.ticks.map(e=>j`<line class=${e===0?`base`:`grid`} x1=${r} x2=${i-10} y1=${u(e)} y2=${u(e)}></line>
|
|
95
95
|
<text class="axis" x=${r-6} y=${u(e)} dy="0.32em" text-anchor="end">${this.format(e)}</text>`)}
|
|
96
|
-
${f===null?j
|
|
97
|
-
${this.series.map((e,t)=>{let n=this.x.map((t,n)=>{let r=e.values[n];return r==null?null:[l(n),u(r)]}),r=n.filter((e,t)=>e&&!n[t-1]&&!n[t+1]);return
|
|
98
|
-
${r.map(e=>
|
|
99
|
-
${f===null?
|
|
100
|
-
${this.x.map((t,n)=>n%d===0?
|
|
101
|
-
${this.x.map((e,t)=>
|
|
96
|
+
${f===null?M:j`<line class="base" x1=${l(f)} x2=${l(f)} y1=${8} y2=${8+s}></line>`}
|
|
97
|
+
${this.series.map((e,t)=>{let n=this.x.map((t,n)=>{let r=e.values[n];return r==null?null:[l(n),u(r)]}),r=n.filter((e,t)=>e&&!n[t-1]&&!n[t+1]);return j`<path d=${function(e){let t=``,n=!1;for(let r of e)r?(t+=`${n?`L`:`M`}${r[0].toFixed(1)},${r[1].toFixed(1)}`,n=!0):n=!1;return t}(n)} fill="none" stroke=${Ca(t)} stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path>
|
|
98
|
+
${r.map(e=>j`<circle cx=${e[0]} cy=${e[1]} r="2.5" fill=${Ca(t)}></circle>`)}`})}
|
|
99
|
+
${f===null?M:this.series.map((e,t)=>{let n=e.values[f];return n==null?M:j`<circle cx=${l(f)} cy=${u(n)} r="4.5" fill=${Ca(t)} stroke="var(--card)" stroke-width="2"></circle>`})}
|
|
100
|
+
${this.x.map((t,n)=>n%d===0?j`<text class="axis" x=${l(n)} y=${a-6} text-anchor=${e>1&&n===0?`start`:e>1&&n===e-1?`end`:`middle`}>${t}</text>`:M)}
|
|
101
|
+
${this.x.map((e,t)=>j`<rect class="hit" x=${l(t)-p/2} y=${8} width=${p} height=${s+22} @mouseenter=${()=>this.active=t}></rect>`)}
|
|
102
102
|
</svg>
|
|
103
|
-
${f!==null&&f<e?this.tip(l(f),8,this.tipBody(f)):
|
|
104
|
-
${this.series.map((n,r)=>this.tipRow(Ca(r),n.name,n.values[e]===null||n.values[e]===void 0?t:this.format(n.values[e])))}`}table(){let e=this.words.none;return
|
|
105
|
-
<thead><tr><th scope="col">${this.words.label}</th>${this.series.map(e=>
|
|
106
|
-
<tbody>${this.x.map((t,n)=>
|
|
107
|
-
</table>`}};U([
|
|
108
|
-
${this.y.map((e,t)=>
|
|
103
|
+
${f!==null&&f<e?this.tip(l(f),8,this.tipBody(f)):M}`}tipBody(e){let t=this.words.none;return A`<b>${this.x[e]}</b>
|
|
104
|
+
${this.series.map((n,r)=>this.tipRow(Ca(r),n.name,n.values[e]===null||n.values[e]===void 0?t:this.format(n.values[e])))}`}table(){let e=this.words.none;return A`<table aria-label=${this.label||M}>
|
|
105
|
+
<thead><tr><th scope="col">${this.words.label}</th>${this.series.map(e=>A`<th scope="col">${e.name}</th>`)}</tr></thead>
|
|
106
|
+
<tbody>${this.x.map((t,n)=>A`<tr><th scope="row">${t}</th>${this.series.map(t=>A`<td>${t.values[n]===null||t.values[n]===void 0?e:this.format(t.values[n])}</td>`)}</tr>`)}</tbody>
|
|
107
|
+
</table>`}};U([F({attribute:!1})],Ma.prototype,`x`,void 0),U([F({attribute:!1})],Ma.prototype,`series`,void 0);var Na=[16,34,52,72,92],Pa=e=>`color-mix(in srgb, var(--series-1) ${e}%, var(--card))`;function Fa(e,t,n){if(!(n>t))return Na.length-1;let r=(e-t)/(n-t);return Math.min(Na.length-1,Math.max(0,Math.floor(r*Na.length)))}var Ia=class extends ka{constructor(...e){super(...e),this.x=[],this.y=[],this.values=[]}get range(){let e=this.values.flat().filter(e=>e!=null);return e.length?[Math.min(0,...e),Math.max(...e)]:[0,0]}hasValues(){return this.x.length>0&&this.y.length>0&&this.values.some(e=>e.some(e=>e!=null))}legendItems(){let[e,t]=this.range,n=A`<span class="scale" aria-hidden="true">${Na.map(e=>A`<i style="background: ${Pa(e)}"></i>`)}</span>`;return[{label:this.words.scale(this.format(e),this.format(t)),icon:n}]}itemCount(){return this.x.length*this.y.length}rowLength(){return this.x.length}plot(){let e=this.x.length,t=this.y.length,[n,r]=this.range,i=Math.max(...this.y.map(e=>this.labelWidth(e)))+2,a=this.plotWidth,o=a-i-2,s=o/e,c=2+22*t+22,l=Ta(e,o,Math.max(...this.x.map(e=>this.labelWidth(e)))+12),u=this.active,d=[];for(let a=0;a<t;a++)for(let t=0;t<e;t++){let o=this.values[a]?.[t],c=i+t*s,l=2+22*a,f=a*e+t;d.push(o==null?j`<rect x=${c+1} y=${l+1} width=${Math.max(1,s-2)} height=${20} rx="2" fill="none" stroke="var(--line)" @mouseenter=${()=>this.active=f}></rect>`:j`<rect x=${c+1} y=${l+1} width=${Math.max(1,s-2)} height=${20} rx="2" fill=${Pa(Na[Fa(o,n,r)]??92)} stroke=${u===f?`var(--text)`:`none`} stroke-width="1.5" @mouseenter=${()=>this.active=f}></rect>`)}let f=u!==null&&u<e*t?{r:Math.floor(u/e),c:u%e}:null;return A`<svg width=${a} height=${c} role="img" aria-label=${this.label||M}>
|
|
108
|
+
${this.y.map((e,t)=>j`<text class="axis" x=${i-6} y=${2+22*t+11} dy="0.32em" text-anchor="end">${e}</text>`)}
|
|
109
109
|
${d}
|
|
110
|
-
${this.x.map((e,t)=>t%l===0?
|
|
110
|
+
${this.x.map((e,t)=>t%l===0?j`<text class="axis" x=${i+t*s+s/2} y=${c-6} text-anchor="middle">${e}</text>`:M)}
|
|
111
111
|
</svg>
|
|
112
|
-
${f?this.tip(i+f.c*s+s/2,2+22*(f.r+1),this.tipBody(f.r,f.c)):
|
|
113
|
-
<div class="row"><span>${n==null?this.words.none:this.format(n)}</span></div>`}table(){let e=this.words.none;return
|
|
114
|
-
<thead><tr><th scope="col">${this.words.label}</th>${this.x.map(e=>
|
|
115
|
-
<tbody>${this.y.map((t,n)=>
|
|
116
|
-
</table>`}};function La(e){switch(e){case`failed`:return`color-mix(in srgb, var(--status-failed) 72%, var(--card))`;case`attention`:return`color-mix(in srgb, var(--status-attention) 68%, var(--card))`;case`running`:return`color-mix(in srgb, var(--status-running) 60%, var(--card))`;case`done`:return`color-mix(in srgb, var(--status-done) 30%, var(--card))`;case`muted`:return`color-mix(in srgb, var(--text-muted) 26%, var(--card))`;default:return`color-mix(in srgb, var(--text) 12%, var(--card))`}}function Ra(e){return e===`done`?`✓`:e===`failed`?`✕`:e===`attention`?`◌`:``}U([
|
|
112
|
+
${f?this.tip(i+f.c*s+s/2,2+22*(f.r+1),this.tipBody(f.r,f.c)):M}`}tipBody(e,t){let n=this.values[e]?.[t];return A`<b>${this.y[e]} | ${this.x[t]}</b>
|
|
113
|
+
<div class="row"><span>${n==null?this.words.none:this.format(n)}</span></div>`}table(){let e=this.words.none;return A`<table aria-label=${this.label||M}>
|
|
114
|
+
<thead><tr><th scope="col">${this.words.label}</th>${this.x.map(e=>A`<th scope="col">${e}</th>`)}</tr></thead>
|
|
115
|
+
<tbody>${this.y.map((t,n)=>A`<tr><th scope="row">${t}</th>${this.x.map((t,r)=>{let i=this.values[n]?.[r];return A`<td>${i==null?e:this.format(i)}</td>`})}</tr>`)}</tbody>
|
|
116
|
+
</table>`}};function La(e){switch(e){case`failed`:return`color-mix(in srgb, var(--status-failed) 72%, var(--card))`;case`attention`:return`color-mix(in srgb, var(--status-attention) 68%, var(--card))`;case`running`:return`color-mix(in srgb, var(--status-running) 60%, var(--card))`;case`done`:return`color-mix(in srgb, var(--status-done) 30%, var(--card))`;case`muted`:return`color-mix(in srgb, var(--text-muted) 26%, var(--card))`;default:return`color-mix(in srgb, var(--text) 12%, var(--card))`}}function Ra(e){return e===`done`?`✓`:e===`failed`?`✕`:e===`attention`?`◌`:``}U([F({attribute:!1})],Ia.prototype,`x`,void 0),U([F({attribute:!1})],Ia.prototype,`y`,void 0),U([F({attribute:!1})],Ia.prototype,`values`,void 0);var za=[`failed`,`attention`,`running`,`done`,`muted`,`neutral`],Ba=[``,`stripes`,`dots`,`cross`,`lines`];function Va(e){let t=new Map,n=new Map;for(let r of e){let e=t.get(r.tone)??0;t.set(r.tone,e+1),n.set(Ha(r),Ba[e%Ba.length])}return n}var Ha=e=>`${e.tone}\0${e.label}`;function Ua(e){let t=new Map;for(let n of e)for(let e of n)e&&!t.has(Ha(e))&&t.set(Ha(e),e);return[...t.values()].sort((e,t)=>za.indexOf(e.tone)-za.indexOf(t.tone))}var Wa=class extends ka{constructor(...e){super(...e),this.x=[],this.y=[],this.cells=[],this.uid=`sg${Math.random().toString(36).slice(2,8)}`}static{this.styles=[...ka.styles,k` .mark{font-size:11px;font-weight:700;fill:var(--text);pointer-events:none;}.mark.quiet{font-weight:400;fill:var(--text-muted);}.legend .key{display:inline-grid;place-items:center;width:14px;height:14px;margin-right:6px;border-radius:3px;font-size:9.5px;font-weight:700;color:var(--text);vertical-align:-2px;}`]}hasValues(){return this.x.length>0&&this.y.length>0&&this.cells.some(e=>e.some(e=>!!e))}legendItems(){let e=Ua(this.cells),t=Va(e);return e.map(e=>{let n=function(e){let t=`color-mix(in srgb, var(--text) 45%, transparent)`;switch(e){case`stripes`:return`repeating-linear-gradient(45deg, ${t} 0 1.5px, transparent 1.5px 4px)`;case`dots`:return`radial-gradient(${t} 1px, transparent 1.3px) 0 0 / 4px 4px`;case`cross`:return`repeating-linear-gradient(45deg, ${t} 0 1px, transparent 1px 4px), repeating-linear-gradient(-45deg, ${t} 0 1px, transparent 1px 4px)`;case`lines`:return`repeating-linear-gradient(0deg, ${t} 0 1.5px, transparent 1.5px 4px)`;default:return``}}(t.get(Ha(e))??``);return{label:e.label,icon:A`<span class="key" aria-hidden="true" data-texture=${t.get(Ha(e))||M} style="background: ${n?`${n}, `:``}${La(e.tone)}">${Ra(e.tone)}</span>`}})}itemCount(){return this.x.length*this.y.length}rowLength(){return this.x.length}plot(){let e=this.x.length,t=this.y.length,n=Math.max(...this.y.map(e=>this.labelWidth(e)))+2,r=this.plotWidth,i=r-n-2,a=i/e,o=2+22*t+22,s=Ta(e,i,Math.max(...this.x.map(e=>this.labelWidth(e)))+12),c=this.active,l=a-2>=14,u=Va(Ua(this.cells)),d=[];for(let r=0;r<t;r++)for(let t=0;t<e;t++){let i=this.cells[r]?.[t],o=r*e+t,s={x:n+t*a+1,y:2+22*r+1,w:Math.max(1,a-2),h:20};if(!i){d.push(j`<rect x=${s.x} y=${s.y} width=${s.w} height=${s.h} rx="2" fill="none" stroke="var(--line)" @mouseenter=${()=>this.active=o}></rect>`);continue}let f=l?Ra(i.tone):``,p=u.get(Ha(i))??``;d.push(j`<g @mouseenter=${()=>this.active=o}>
|
|
117
117
|
<rect x=${s.x} y=${s.y} width=${s.w} height=${s.h} rx="2" fill=${La(i.tone)} stroke=${c===o?`var(--text)`:`none`} stroke-width="1.5"></rect>
|
|
118
|
-
${p?
|
|
119
|
-
${f?
|
|
120
|
-
</g>`)}let f=c!==null&&c<e*t?{r:Math.floor(c/e),c:c%e}:null;return
|
|
118
|
+
${p?j`<rect class="texture" data-texture=${p} x=${s.x} y=${s.y} width=${s.w} height=${s.h} rx="2" fill=${`url(#${this.patternId(p)})`} pointer-events="none"></rect>`:M}
|
|
119
|
+
${f?j`<text class=${i.tone===`done`?`mark quiet`:`mark`} x=${s.x+s.w/2} y=${s.y+s.h/2} dy="0.35em" text-anchor="middle" aria-hidden="true">${f}</text>`:M}
|
|
120
|
+
</g>`)}let f=c!==null&&c<e*t?{r:Math.floor(c/e),c:c%e}:null;return A`<svg width=${r} height=${o} role="img" aria-label=${this.label||M}>
|
|
121
121
|
${this.patterns(new Set(u.values()))}
|
|
122
|
-
${this.y.map((e,t)=>
|
|
122
|
+
${this.y.map((e,t)=>j`<text class="axis" x=${n-6} y=${2+22*t+11} dy="0.32em" text-anchor="end">${e}</text>`)}
|
|
123
123
|
${d}
|
|
124
|
-
${this.x.map((e,t)=>t%s===0?
|
|
124
|
+
${this.x.map((e,t)=>t%s===0?j`<text class="axis" x=${n+t*a+a/2} y=${o-6} text-anchor="middle">${e}</text>`:M)}
|
|
125
125
|
</svg>
|
|
126
|
-
${f?this.tip(n+f.c*a+a/2,2+22*(f.r+1),this.tipBody(f.r,f.c)):
|
|
127
|
-
<div class="row">${n?
|
|
128
|
-
${n?.tip?
|
|
129
|
-
<thead><tr><th scope="col">${this.words.label}</th>${this.x.map(e=>
|
|
130
|
-
<tbody>${this.y.map((t,n)=>
|
|
131
|
-
</table>`}};U([
|
|
132
|
-
${this.bars.map(t=>
|
|
126
|
+
${f?this.tip(n+f.c*a+a/2,2+22*(f.r+1),this.tipBody(f.r,f.c)):M}`}patternId(e){return`${this.uid}-${e}`}patterns(e){let t=e=>j`<path d=${e} stroke="var(--text)" stroke-opacity="0.45" stroke-width="1.2"></path>`;return j`<defs>${[...e].filter(e=>e).map(e=>j`<pattern id=${this.patternId(e)} width="5" height="5" patternUnits="userSpaceOnUse">${(e=>e===`stripes`?t(`M-1 1 L1 -1 M0 5 L5 0 M4 6 L6 4`):e===`dots`?j`<circle cx="2.5" cy="2.5" r="0.9" fill="var(--text)" fill-opacity="0.5"></circle>`:t(e===`cross`?`M0 0 L5 5 M5 0 L0 5`:`M0 2.5 L5 2.5`))(e)}</pattern>`)}</defs>`}tipBody(e,t){let n=this.cells[e]?.[t];return A`<b>${this.y[e]} | ${this.x[t]}</b>
|
|
127
|
+
<div class="row">${n?A`<i style="background: ${La(n.tone)}"></i><span>${n.label}</span>`:A`<span>${this.words.none}</span>`}</div>
|
|
128
|
+
${n?.tip?A`<div class="row"><span>${n.tip}</span></div>`:M}`}table(){let e=this.words.none;return A`<table aria-label=${this.label||M}>
|
|
129
|
+
<thead><tr><th scope="col">${this.words.label}</th>${this.x.map(e=>A`<th scope="col">${e}</th>`)}</tr></thead>
|
|
130
|
+
<tbody>${this.y.map((t,n)=>A`<tr><th scope="row">${t}</th>${this.x.map((t,r)=>{let i=this.cells[n]?.[r];return A`<td title=${i?.tip||M}>${i?i.label:e}</td>`})}</tr>`)}</tbody>
|
|
131
|
+
</table>`}};U([F({attribute:!1})],Wa.prototype,`x`,void 0),U([F({attribute:!1})],Wa.prototype,`y`,void 0),U([F({attribute:!1})],Wa.prototype,`cells`,void 0);var Ga=class extends ka{constructor(...e){super(...e),this.bars=[]}static{this.styles=[...ka.styles,k` .bars{display:grid;grid-template-columns:minmax(80px,max-content) minmax(0,1fr) max-content;gap:6px 12px;align-items:center;font-size:var(--font-size-sm);}.bars .r{display:contents;}.bars .l{color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:34ch;}.bars .track{display:block;height:12px;}.bars .bar{display:block;height:100%;min-width:2px;border-radius:1px 4px 4px 1px;background:var(--series-1);}.bars .bar[data-tone]{background:var(--tone);}.bars .v{color:var(--text-2);font-variant-numeric:tabular-nums;text-align:right;}`]}hasValues(){return this.bars.length>0}legendItems(){return[]}itemCount(){return 0}plot(){let e=Math.max(0,...this.bars.map(e=>e.value));return A`<div class="bars" role="list" aria-label=${this.label||M}>
|
|
132
|
+
${this.bars.map(t=>A`<div class="r" role="listitem" aria-label="${t.label} | ${this.format(t.value)}">
|
|
133
133
|
<span class="l" aria-hidden="true" title=${t.label}>${t.label}</span>
|
|
134
134
|
<span class="track" aria-hidden="true"><span class="bar" data-tone=${L(t.tone)} style="width: ${e>0?100*Math.max(0,t.value)/e:0}%"></span></span>
|
|
135
135
|
<span class="v" aria-hidden="true">${this.format(t.value)}</span></div>`)}
|
|
136
|
-
</div>`}table(){return
|
|
137
|
-
<tbody>${this.bars.map(e=>
|
|
138
|
-
</table>`}};U([
|
|
136
|
+
</div>`}table(){return A`<table aria-label=${this.label||M}>
|
|
137
|
+
<tbody>${this.bars.map(e=>A`<tr><th scope="row">${e.label}</th><td>${this.format(e.value)}</td></tr>`)}</tbody>
|
|
138
|
+
</table>`}};U([F({attribute:!1})],Ga.prototype,`bars`,void 0);var Ka={name:`Name`,expected:`Expected`,actual:`Value`,verdict:`Check`,optional:`optional`,items:e=>e===1?`1 item`:`${e} items`,object:`object`},qa=k` .verdict{font-size:12px;}.verdict[data-verdict='pass']{color:var(--text-2);}.verdict[data-verdict='pass']>[aria-hidden]{color:var(--status-done);font-weight:700;}.verdict[data-verdict='fail']{color:var(--status-failed);font-weight:600;}.verdict[data-verdict='warn']{color:var(--status-attention);}.verdict[data-verdict='none']{color:var(--text-muted);}`,Ja=k` :host{display:block;max-width:100%;}table{width:auto;max-width:100%;border-collapse:collapse;}th{text-align:left;font-size:11.5px;color:var(--text-muted);font-weight:600;padding:4px 20px 4px 0;border-bottom:1px solid var(--line);}td{padding:5px 20px 5px 0;border:0;border-bottom:1px solid var(--line);vertical-align:baseline;font-size:12.5px;}th:last-child,td:last-child{padding-right:0;}td.value{overflow-wrap:anywhere;}tbody tr:last-child td{border-bottom:0;}td:first-child{font-weight:600;overflow-wrap:anywhere;}td:last-child{white-space:nowrap;}i{font-style:normal;color:var(--text-muted);font-size:11px;margin-left:4px;}.js{color:var(--code-string);}.jn{color:var(--code-number);}`;function Ya(e,t,n=``){if(e===`none`&&!t)return M;let r=e===`pass`?`✓`:e===`fail`?`✕`:``;return A`<span class="verdict" part="verdict" data-verdict=${e} title=${n||M}>${r?A`<span aria-hidden="true">${r}</span> `:M}${t}</span>`}var Xa=(e,t)=>e.length>t?`${e.slice(0,t)}…`:e,Za=class extends N{constructor(...e){super(...e),this.rows=[],this.showValues=!0,this.strings={}}static{this.styles=[V,qa,Ja]}render(){let e=Ar(Ka,this.strings),t=this.showValues;return A`<table part="table">
|
|
139
139
|
<thead><tr>
|
|
140
140
|
<th scope="col">${e.name}</th><th scope="col">${e.expected}</th>
|
|
141
|
-
${t?
|
|
141
|
+
${t?A`<th scope="col">${e.actual}</th><th scope="col">${e.verdict}</th>`:M}
|
|
142
142
|
</tr></thead>
|
|
143
143
|
<tbody>
|
|
144
|
-
${this.rows.map(n=>
|
|
144
|
+
${this.rows.map(n=>A`<tr part="row">
|
|
145
145
|
<td class="jmono">${n.name}</td>
|
|
146
|
-
<td class=${n.extra?`jdim`:`jmono jdim`}>${n.expected}${n.optional?
|
|
147
|
-
${t?
|
|
148
|
-
<span class="jdim">${n}${e.length>3?`, …`:``}</span>`}return typeof e==`object`&&e?
|
|
149
|
-
<td>${Ya(n.verdict,n.verdictLabel,n.tip)}</td>`:
|
|
146
|
+
<td class=${n.extra?`jdim`:`jmono jdim`}>${n.expected}${n.optional?A` <i>${e.optional}</i>`:M}</td>
|
|
147
|
+
${t?A`<td class="value">${function(e,t){if(e===void 0)return A`<span class="jdim">—</span>`;if(typeof e==`string`)return A`<span class="js" title=${e}>"${Xa(e,90)}"</span>`;if(Array.isArray(e)){let n=e.slice(0,3).map(e=>typeof e==`string`?`"${Xa(e,28)}"`:JSON.stringify(e)).join(`, `);return A`<span class="jn">${t.items(e.length)}</span>
|
|
148
|
+
<span class="jdim">${n}${e.length>3?`, …`:``}</span>`}return typeof e==`object`&&e?A`<span class="jn">${t.object}</span> <span class="jdim">${Object.keys(e).slice(0,4).join(`, `)}</span>`:A`<span class="jn">${JSON.stringify(e)}</span>`}(n.hasValue?n.value:void 0,e)}</td>
|
|
149
|
+
<td>${Ya(n.verdict,n.verdictLabel,n.tip)}</td>`:M}
|
|
150
150
|
</tr>`)}
|
|
151
151
|
</tbody>
|
|
152
|
-
</table>`}};U([
|
|
152
|
+
</table>`}};U([F({attribute:!1})],Za.prototype,`rows`,void 0),U([F({type:Boolean})],Za.prototype,`showValues`,void 0),U([F({attribute:!1})],Za.prototype,`strings`,void 0);var Qa={sortBy:`Sort`,rowsHeader:`Row`},$a=k` :host{display:contents;}.mxblock{display:flex;flex-direction:column;width:fit-content;max-width:100%;min-width:min(100%,27rem);animation:view-in 0.1s var(--ease) both;}@keyframes view-in{from{opacity:0;}}@media (prefers-reduced-motion:reduce){.mxblock{animation:none;}}.mxbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;margin-bottom:8px;font-size:12px;color:var(--text-2);width:0;min-width:100%;box-sizing:border-box;}.mxbar .cap{color:var(--text);font-weight:600;}.mxbar .sum{flex:1 0 100%;min-width:0;}.mxbar .f{white-space:nowrap;}.sep{color:var(--text-muted);}.mxbar label{display:inline-flex;align-items:center;gap:6px;margin-left:auto;color:var(--text-muted);font-size:11.5px;white-space:nowrap;}.mxbar select{font:inherit;font-size:11.5px;color:var(--text);background:var(--card);border:1px solid var(--line);border-radius:6px;padding:2px 6px;}.mxbar select:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;}.mx{overflow:auto;max-width:100%;max-height:max(${360}px,${ft(70)}vh);border-radius:6px;border:1px solid var(--line);}table.matrix{border-collapse:separate;border-spacing:0;font-size:11px;width:100%;min-width:max-content;}.matrix th,.matrix td{padding:0 6px;height:${24}px;border-bottom:1px solid var(--line);white-space:nowrap;}.matrix thead th{position:sticky;z-index:2;background:var(--panel2);color:var(--text-muted);font-weight:500;text-align:center;height:22px;}.matrix thead th.nh{font-family:var(--mono);color:var(--text-2);font-weight:600;max-width:110px;overflow:hidden;text-overflow:ellipsis;}.matrix thead th.group{color:var(--text-2);}.matrix thead th.group.code{font-family:var(--mono);color:var(--text-muted);}.matrix .uh,.matrix tbody th{position:sticky;left:0;z-index:1;background:var(--panel);text-align:left;}.matrix thead .uh{z-index:3;}.matrix thead .uh,.matrix thead .pn{background:var(--panel2);}.matrix tbody th{font-family:var(--mono);font-weight:600;color:var(--text);max-width:220px;overflow:hidden;text-overflow:ellipsis;}.matrix tbody th.none{font-family:var(--sans);font-weight:500;color:var(--text-muted);}.matrix .pn{text-align:right;color:var(--text-muted);font-variant-numeric:tabular-nums;}.matrix .pn.many{color:var(--text);font-weight:600;}.matrix td.c{text-align:center;--m:12px;}.matrix td.c .mark{vertical-align:middle;}.matrix .g0{border-left:1px solid var(--line2);}.matrix .g1{border-left:1px dashed var(--line);}.matrix tbody tr:hover td,.matrix tbody tr:hover th{background-color:color-mix(in srgb,var(--text-muted) 8%,transparent);}.matrix tbody tr.on td,.matrix tbody tr.on th{background-color:var(--accent-bg);}.matrix .gap td{padding:0;border:0;}.mx.hl .mark:not(.on){opacity:0.4;}.mx.hl .mark.on{transform:scale(1.2);}`,eo={caption:``,label:``,head:[],columns:[],rows:[]},to=class extends N{constructor(...e){super(...e),this.matrix=eo,this.states={},this.selected=null,this.highlight=null,this.key=``,this.windowAt=150,this.strings={},this.renderIcon=e=>pi(e),this.iconStyles=[],this.hover=null,this.scrollRow=0,this.cell=null,this.onScroll=e=>{let t=Math.floor(e.currentTarget.scrollTop/24);Math.abs(t-this.scrollRow)>=15&&(this.scrollRow=t)}}static{this.styles=[V,Jr,$a]}static{this.properties={matrix:{attribute:!1},states:{attribute:!1},selected:{attribute:!1},highlight:{attribute:!1},key:{},windowAt:{type:Number},strings:{attribute:!1},renderIcon:{attribute:!1},iconStyles:{attribute:!1},hover:{state:!0},scrollRow:{state:!0}}}willUpdate(e){e.has(`key`)&&e.get(`key`)!==void 0&&(this.scrollRow=0,this.cell=null)}updated(e){e.has(`iconStyles`)&&this.renderRoot instanceof ShadowRoot&&pt(this.renderRoot,[...this.constructor.elementStyles,...this.iconStyles])}lit(){if(this.hover!==null)return this.hover;let e=this.selected?this.matrix.rows.find(e=>e.cells.some(e=>e?.id===this.selected)):void 0;return e?e.id||this.selected:this.highlight}select(e){e!==this.selected&&R(this,`cae-select`,{id:e})}act(e){e.drill?R(this,`cae-drill`,{id:e.id}):R(this,`cae-activate`,{id:e.id})}render(){let e=this.matrix,t=Ar(Qa,this.strings),n=e.rows,r=e.columns,i=this.lit(),a=r.map((e,t)=>{let n=r[t-1]?.groups;if(!n)return-1;let i=e.groups.findIndex((e,t)=>e!==n[t]);return i<0?e.groups.length===n.length?-1:Math.min(e.groups.length,n.length):i}),o=e.head.length,s=!!e.value,c=s?2:1,l=n.length>this.windowAt,u=l?Math.max(0,this.scrollRow-30):0,d=l?Math.min(n.length,this.scrollRow+60+20):n.length,f=this.cell&&this.cell[0]<n.length?this.cell:function(e){for(let t=0;t<e.length;t++){let n=e[t]?.cells.findIndex(e=>e!==null)??-1;if(n>=0)return[t,n]}return null}(n),p=e=>e===0||a[e]===0?`g0`:(a[e]??-1)>0?`g1`:``,m=(e,t,n)=>{let r=`top:${22*n}px`;return e.type===`group`?A`<th scope="colgroup" part="head-cell" colspan=${e.span} class="group ${e.code?`code`:``} ${p(t)}" style=${r} title=${e.tip??M} aria-label=${e.summary??M}>${e.label}</th>`:A`<th scope="col" part="head-cell" rowspan=${e.rows} class="nh ${p(t)}" style=${r} title=${e.tip??M} aria-label=${e.summary??M}>${(e.icons??[]).map(e=>this.renderIcon(e))}${e.label}</th>`},h=(e.facts??[]).filter(e=>typeof e==`string`?e:e.text);return A`<div class="mxblock view">
|
|
153
153
|
<div class="mxbar">
|
|
154
|
-
<span class="cap" title=${e.captionTip??
|
|
155
|
-
${e.sorts?.length?
|
|
154
|
+
<span class="cap" title=${e.captionTip??M}>${e.caption}</span>
|
|
155
|
+
${e.sorts?.length?A`<label>${t.sortBy}
|
|
156
156
|
<select part="sort" @change=${e=>R(this,`cae-sort`,{id:e.target.value,direction:`asc`})}>
|
|
157
|
-
${e.sorts.map(t=>
|
|
157
|
+
${e.sorts.map(t=>A`<option value=${t.id} ?selected=${e.sort===t.id}>${t.label}</option>`)}
|
|
158
158
|
</select>
|
|
159
|
-
</label>`:
|
|
160
|
-
<span class="sum">${h.map((e,t)=>
|
|
159
|
+
</label>`:M}
|
|
160
|
+
<span class="sum">${h.map((e,t)=>A`${t?A`<span class="sep"> | </span>`:M}${typeof e==`string`?A`<span class="f">${e}</span>`:A`<span class="f tone-text" data-tone=${L(e.tone)}>${e.text}</span>`}`)}</span>
|
|
161
161
|
</div>
|
|
162
162
|
<div class="mx ${i?`hl`:``}" @scroll=${this.onScroll} @mouseleave=${()=>this.hover=null}>
|
|
163
163
|
<table class="matrix big" part="matrix" role="grid" aria-rowcount=${n.length+o} aria-colcount=${r.length+c} aria-label=${e.label}>
|
|
164
164
|
<thead>
|
|
165
|
-
${e.head.map((n,r)=>{let i=(t=>{let n=[],r=0;for(let i of e.head[t]??[]){for(;no(e.head,t,r);)r++;n.push(r),r+=i.span}return n})(r);return
|
|
166
|
-
${r===0?
|
|
167
|
-
${s?
|
|
165
|
+
${e.head.map((n,r)=>{let i=(t=>{let n=[],r=0;for(let i of e.head[t]??[]){for(;no(e.head,t,r);)r++;n.push(r),r+=i.span}return n})(r);return A`<tr>
|
|
166
|
+
${r===0?A`<th scope="col" rowspan=${o} class="uh" style="top:0">${t.rowsHeader}</th>
|
|
167
|
+
${s?A`<th scope="col" rowspan=${o} class="pn" style="top:0" title=${e.value?.tip??M}>${e.value?.label}</th>`:M}`:M}
|
|
168
168
|
${n.map((e,t)=>m(e,i[t]??0,r))}
|
|
169
169
|
</tr>`})}
|
|
170
170
|
</thead>
|
|
171
171
|
<tbody @keydown=${e=>this.onKey(e,n)}>
|
|
172
|
-
${u>0?
|
|
173
|
-
${H(n.slice(u,d),e=>e.id,(e,t)=>{let n=u+t;return
|
|
174
|
-
<th scope="row" part="row-header" class=${e.muted?`none`:
|
|
175
|
-
${s?
|
|
176
|
-
${e.cells.map((t,r)=>{let o=!!t&&f!==null&&f[0]===n&&f[1]===r;return
|
|
172
|
+
${u>0?A`<tr class="gap" aria-hidden="true"><td colspan=${r.length+c} style="height:${24*u}px"></td></tr>`:M}
|
|
173
|
+
${H(n.slice(u,d),e=>e.id,(e,t)=>{let n=u+t;return A`<tr class=${e.id&&e.id===i?`on`:``} aria-rowindex=${n+o+1}>
|
|
174
|
+
<th scope="row" part="row-header" class=${e.muted?`none`:M} title=${e.tip??e.label}>${e.label}</th>
|
|
175
|
+
${s?A`<td class="pn ${e.strong?`many`:``}">${e.value}</td>`:M}
|
|
176
|
+
${e.cells.map((t,r)=>{let o=!!t&&f!==null&&f[0]===n&&f[1]===r;return A`<td class="c ${(e=>a[e]===0?`g0`:(a[e]??-1)>0?`g1`:``)(r)}" role="gridcell">${t?this.mark(e,t,n,r,o,i):M}</td>`})}
|
|
177
177
|
</tr>`})}
|
|
178
|
-
${d<n.length?
|
|
178
|
+
${d<n.length?A`<tr class="gap" aria-hidden="true"><td colspan=${r.length+c} style="height:${24*(n.length-d)}px"></td></tr>`:M}
|
|
179
179
|
</tbody>
|
|
180
180
|
</table>
|
|
181
181
|
</div>
|
|
182
|
-
</div>`}mark(e,t,n,r,i,a){let o=this.states[t.state],s=e.id||t.id,c=this.selected===t.id;return k`<button type="button" part="mark" class="mark ${e.id&&e.id===a?`on`:``} ${c?`sel`:``}" data-tone=${L(o?.tone)} data-shape=${o?.shape??j} data-r=${n} data-c=${r} tabindex=${i?0:-1} title=${t.tip??j} aria-label=${t.label} aria-pressed=${c} @mouseenter=${()=>this.hover=s} @focus=${()=>{this.hover=s,this.cell=[n,r],this.select(t.id)}} @blur=${()=>this.hover=null} @click=${()=>this.select(t.id)} @dblclick=${()=>this.act(t)}></button>`}onKey(e,t){let n=e.target;if(!n.classList.contains(`mark`))return;let r=Number(n.dataset.r),i=Number(n.dataset.c);if(e.key===`Enter`){let n=t[r]?.cells[i];e.preventDefault(),n&&this.act(n);return}let a=function(e,t,n,r,i=!1,a=10){let o=(t,n)=>!0===e[t]?.[n],s=t=>(e[t]??[]).findIndex(Boolean),c=t=>(e[t]??[]).lastIndexOf(!0),l=t=>{let r=e[t]??[],i=-1;return r.forEach((e,t)=>e&&(i<0||Math.abs(t-n)<Math.abs(i-n))&&(i=t)),i<0?null:[t,i]};switch(r){case`ArrowRight`:case`ArrowLeft`:{let i=r===`ArrowRight`?1:-1;for(let r=n+i;r>=0&&r<(e[t]?.length??0);r+=i)if(o(t,r))return[t,r];return null}case`ArrowDown`:case`ArrowUp`:{let i=r===`ArrowDown`?1:-1,a=((t,n,r)=>{for(let i=t;i>=0&&i<e.length;i+=n)if(o(i,r))return i;return-1})(t+i,i,n);if(a>=0)return[a,n];for(let n=t+i;n>=0&&n<e.length;n+=i)if(s(n)>=0)return l(n);return null}case`Home`:{let n=i?e.findIndex(e=>e.some(Boolean)):t;return n<0||s(n)<0?null:[n,s(n)]}case`End`:{let n=t;if(i)for(n=e.length-1;n>=0&&c(n)<0;n--);return n<0||c(n)<0?null:[n,c(n)]}case`PageDown`:case`PageUp`:{let n=r===`PageDown`?1:-1;for(let r=Math.max(0,Math.min(e.length-1,t+n*a));r!==t;r-=n)if(s(r)>=0)return l(r);return null}default:return null}}(t.map(e=>e.cells.map(e=>e!==null)),r,i,e.key,e.ctrlKey||e.metaKey);if(!a)return;e.preventDefault(),this.cell=a;let o=this.renderRoot.querySelector(`.mx`);if(o&&t.length>this.windowAt){let e=24*a[0];(e<o.scrollTop+48||e>o.scrollTop+o.clientHeight-72)&&(o.scrollTop=Math.max(0,e-o.clientHeight/2)),this.scrollRow=Math.floor(o.scrollTop/24)}this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot.querySelector(`.matrix .mark[data-r="${a[0]}"][data-c="${a[1]}"]`)?.focus())}};function no(e,t,n){for(let r=0;r<t;r++){let i=0;for(let a of e[r]??[]){if(n>=i&&n<i+a.span&&r+a.rows>t)return!0;i+=a.span}}return!1}var ro=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])},io=(e,t)=>`${e}\0${t}`;function ao(e,t,n){let r=new Set(e),i=new Map(e.map(e=>[e,[]]));for(let[e,n]of t)e!==n&&r.has(e)&&r.has(n)&&!i.get(e)?.includes(n)&&i.get(e)?.push(n);let a=new Set,o=new Map;for(let t of e){if(o.has(t))continue;o.set(t,1);let e=[[t,0]];for(;e.length;){let t=e[e.length-1],n=i.get(t[0])??[];if(t[1]<n.length){let r=n[t[1]++],i=o.get(r);i===1?a.add(io(t[0],r)):i||(o.set(r,1),e.push([r,0]))}else o.set(t[0],2),e.pop()}}let s=new Map(e.map(e=>[e,[]])),c=new Map(e.map(e=>[e,[]]));for(let[e,t]of i)for(let n of t)a.has(io(e,n))||(s.get(e)?.push(n),c.get(n)?.push(e));let l=new Map(e.map(e=>[e,c.get(e)?.length??0])),u=e.filter(e=>!l.get(e)),d=new Map;for(let e=u.shift();e!==void 0;e=u.shift()){d.set(e,n.get(e)??Math.max(0,...(c.get(e)??[]).map(e=>(d.get(e)??0)+1)));for(let t of s.get(e)??[])l.set(t,(l.get(t)??0)-1),l.get(t)||u.push(t)}return d}var oo=e=>e.startsWith(`~`);function so(e,t,n){let r=new Map;e.forEach((e,t)=>e.forEach(e=>r.set(e,t)));let i=new Map,a=new Map;for(let[e,n]of t)ro(a,e,n),ro(i,n,e);let o=new Map,s=e=>e.forEach((e,t)=>o.set(e,t)),c=e.map(e=>[...e]);c.forEach(s);let l=()=>function(e,t,n,r){let i=0,a=new Map;for(let[e,i]of t){let t=r.get(e);t!==void 0&&ro(a,t,[n.get(e)??0,n.get(i)??0])}for(let e of a.values())for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let[r,a]=e[t],[o,s]=e[n];(r-o)*(a-s)<0&&i++}return e.length?i:0}(c,t,o,r),u=c.map(e=>[...e]),d=l(),f=(e,t)=>{let r=new Map;for(let n of e){let e=(t.get(n)??[]).map(e=>o.get(e)).filter(e=>e!==void 0);r.set(n,e.length?e.reduce((e,t)=>e+t,0)/e.length:o.get(n)??0)}let i=e=>r.get(e)??0;if(!n)return[...e].sort((e,t)=>i(e)-i(t)||(o.get(e)??0)-(o.get(t)??0));let a=e.filter(e=>!oo(e)),s=e.filter(oo).sort((e,t)=>i(e)-i(t)||(o.get(e)??0)-(o.get(t)??0)),c=[],l=0;for(let e of a){for(;l<s.length&&i(s[l])<i(e);)c.push(s[l++]);c.push(e)}return[...c,...s.slice(l)]};for(let e=0;e<4;e++){let t=e%2==0,n=t?c.map((e,t)=>t).slice(1):c.map((e,t)=>t).reverse().slice(1);for(let e of n){let n=f(c[e],t?i:a);c[e]=n,s(n)}let r=l();r<d&&(d=r,u=c.map(e=>[...e]))}return l()<=d?c:u}var co=new WeakMap;function lo(e,t,n=!1){let r=co.get(e)??[],i=r.find(e=>e.prev===t&&e.down===n);if(i)return i.out;let a=function(e,t,n){let r=new Set(e.clusters.map(e=>e.id)),i=new Map(e.clusters.map(e=>[e.id,e.parent])),a=new Map;for(let t of e.nodes)t.cluster&&a.set(t.id,t.cluster);let o=[...new Set(e.stubs.map(e=>e.id))],s=new Set(o),c=e=>{let t=[],n=r.has(e)?e:a.get(e)??null;for(;n;)t.push(n),n=i.get(n)??null;return t},l=(e,t)=>{let n=c(e);if(t===``)return n[n.length-1]??e;let r=n.indexOf(t);return r<0?void 0:r===0?e:n[r-1]},u=(e,t)=>c(e).find(e=>c(t).includes(e))??``,d=[``,...e.clusters.map(e=>e.id)],f=new Map(d.map(e=>[e,[]]));for(let{id:t}of e.nodes)for(let e of d){let n=l(t,e);n===void 0||f.get(e)?.includes(n)||f.get(e)?.push(n)}let p=new Map;for(let n of d){let r=f.get(n)??[],i=n===``?t?.layers:t?.clusters[n],a=new Map;i?.forEach((e,t)=>e.forEach(e=>r.includes(e)&&a.set(e,t)));let o=e.edges.filter(e=>e.ranks&&u(e.from,e.to)===n).map(e=>[l(e.from,n),l(e.to,n)]);p.set(n,ao(r,o,a))}let m=p.get(``),h=new Map;t?.layers.forEach((e,t)=>e.forEach(e=>h.set(e,t)));let g=new Map(o.map(t=>[t,h.get(t)??Math.min(...e.stubs.filter(e=>e.id===t).map(e=>m.get(l(e.to,``))??0))-1]));if([...g.values()].some(e=>e<0)){for(let[e,t]of m)m.set(e,t+1);for(let[e,t]of g)g.set(e,t+1)}for(let[e,t]of g)m.set(e,t);let _=(e,t)=>p.get(e)?.get(t)??0,v=e=>Math.max(0,...p.get(e)?.values()??[]),y=e.edges.map(e=>((e,t)=>{let n=u(e,t);return _(n,l(e,n))>=_(n,l(t,n))})(e.from,e.to)),b=new Map;for(let e of d){let n=((e===``?t?.layers:t?.clusters[e])??[]).flat(),r=[...e===``?[...o]:[],...f.get(e)??[]];r.sort((e,t)=>{let r=n.indexOf(e),i=n.indexOf(t);return(r<0?1/0:r)-(i<0?1/0:i)});let i=Array.from({length:v(e)+1},()=>[]);for(let t of r)i[_(e,t)]?.push(t);b.set(e,i)}let x=[],S=new Set,ee=(e,t,n,r)=>{let i=`~${e}|${t}|${n}|${r}`;return S.has(i)||(S.add(i),b.get(e)?.[r]?.push(i)),{id:i,in:e}},te=(e,t,n,r)=>{let i=_(e,t),a=`~${e}|by:${t}|${n}|${r}|${i}`;return S.has(a)||(S.add(a),b.get(e)?.[i]?.push(a)),{id:a,in:e}},ne=(e,t,r)=>{let o=s.has(e)?``:u(e,t),d=(p=e,s.has(p)?``:a.get(p)??``),f=e;var p;let m=[{id:e,in:d}];for(;d!==o;){let e=i.get(d)??``;m.push({id:d,in:e}),_(d,f)<v(d)&&m.push(te(e,d,f,r)),f=d,d=e}let h=l(t,o);for(let e=_(o,f)+1;e<_(o,h);e++)m.push(ee(o,f,r,e));let g=c(t),y=g.slice(0,o===``?g.length:g.indexOf(o)).reverse(),b=`>${o}:${f}`,x=o;for(let e of y){let i=l(t,e);(_(e,i)>0||n)&&m.push(te(x,e,b,r)),m.push({id:e,in:x}),x=e}return m.push({id:t,in:x}),m};e.edges.forEach((e,t)=>{y[t]||x.push({from:e.from,to:e.to,style:e.style,steps:ne(e.from,e.to,e.style)})});for(let t of e.stubs)x.push({from:t.id,to:t.to,style:t.style,steps:ne(t.id,t.to,t.style)});let re={};for(let e of d){let n=[],r=new Map((b.get(e)??[]).flatMap((e,t)=>e.map(e=>[e,t])));for(let t of x)for(let i=1;i<t.steps.length;i++){let a=t.steps[i-1],o=t.steps[i];a.in===e&&o.in===e&&r.get(a.id)!==r.get(o.id)&&n.push([a.id,o.id])}let i=e===``?!!t:!!t?.clusters[e];re[e]=so(b.get(e)??[],n,i).map(e=>{let t=e.filter(e=>e.includes(`|by:`));return e.filter(e=>!e.includes(`|by:`)).flatMap(e=>[e,...t.filter(t=>t.includes(`|by:${e}|`))])})}let ie=e=>e.map(e=>e.filter(e=>!oo(e))),ae=e.clusters.map(e=>({id:e.id,parent:e.parent,cycle:!!e.cycle,layers:ie(re[e.id]??[]).filter(e=>e.length)})),oe=ie(re[``]??[]).map(e=>e.filter(e=>!s.has(e))),se=new Map(ae.map(e=>[e.id,e])),ce=e=>e.flatMap(e=>r.has(e)?ce((se.get(e)?.layers??[]).flat()):[e]);return{drawn:ce(oe.flat()),layers:oe.filter(e=>e.length),clusters:ae,back:y,slots:re,edgePaths:x,order:{layers:ie(re[``]??[]),clusters:Object.fromEntries(ae.map(e=>[e.id,ie(re[e.id]??[])]))}}}(e,t,n);return co.set(e,[...r.slice(-3),{prev:t,down:n,out:a}]),a}function uo(e){let t=new Map(e.clusters.map(e=>[e.id,e])),n=new Map,r=e=>{let i=0,a=0;for(let o of e){let e=0,s=0;for(let i of o){let a=t.get(i),o=a?n.get(i)??n.set(i,r(a.layers)).get(i)??{span:1,stack:1}:{span:1,stack:1};e=Math.max(e,o.span),s+=o.stack}i+=e,a=Math.max(a,s)}return{span:i,stack:a}};return r(e.layers)}var fo={across:{gap:56,boxGap:40,sep:16,pointSep:12,pad:12,padEnd:24,margin:16},down:{gap:40,boxGap:32,sep:16,pointSep:12,pad:10,padEnd:24,margin:16}};function po(e,t,n){let r=[0];for(let n=1;n<e.length;n++)r.push(r[n-1]+t[n-1]);let i=[];e.forEach((e,t)=>{let a=n[t]??1;for(i.push({sum:a*(e-r[t]),w:a,n:1});i.length>1;){let e=i[i.length-1],t=i[i.length-2];if(t.sum/t.w<=e.sum/e.w)break;i.splice(-2,2,{sum:t.sum+e.sum,w:t.w+e.w,n:t.n+e.n})}});let a=[];for(let e of i)for(let t=0;t<e.n;t++)a.push(e.sum/e.w+r[a.length]);return a}function mo(e,t,n,r,i=0){if(e<=0||t<=0||n<=0)return{k:1,x:0,y:0,h:Math.max(0,t)};let a=Math.min(1,n/e),o=Math.max(i,Math.min(t*a,r)),s=Math.min(a,o/t);return{k:s,x:(n-e*s)/2,y:(o-t*s)/2,h:o}}var ho=(e,t=200)=>e.marks.filter(e=>e!==null).length+e.loose.length>t,go=(e,t,n)=>n<t?t:Math.min(n,Math.max(t,e));function _o(e,t,n,r=e){let i=function(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.left+e.width,t.left+t.width),a=Math.min(e.top+e.height,t.top+t.height);return i>n&&a>r?{left:n,top:r,width:i-n,height:a-r}:null}(r,t);if(!i)return{shown:!1,x:0,y:0,side:`right`,arrow:0,fits:!1};let{width:a,height:o}=n,s=t.left+8,c=t.top+8,l=t.left+t.width-8,u=t.top+t.height-8,d=e.left+e.width,f=e.top+e.height,p=i.top+i.height/2,m=i.left+i.width/2,h=go(p-o/2,c,u-o),g=go(m-a/2,s,l-a),_={right:l-(d+12)-a,left:e.left-12-a-s,below:u-(f+12)-o,above:e.top-12-o-c},v=[`right`,`left`,`below`,`above`],y=v.find(e=>_[e]>=0)??v.reduce((e,t)=>_[t]>_[e]?t:e),b,x;switch(y){case`right`:[b,x]=[go(d+12,s,l-a),h];break;case`left`:[b,x]=[go(e.left-12-a,s,l-a),h];break;case`below`:[b,x]=[g,go(f+12,c,u-o)];break;case`above`:[b,x]=[g,go(e.top-12-o,c,u-o)]}return{shown:!0,x:b,y:x,side:y,arrow:y===`right`||y===`left`?go(p-x,14,o-14):go(m-b,14,a-14),fits:_[y]>=0}}var vo=class{constructor(e,t){this.host=e,this.o=t,this.view={k:1,x:0,y:0},this.frameH=0,this.fitK=1,this.moved=!1,this.pressed=!1,this.pan=null,this.swallowClick=!1,this.onPointerDown=e=>{this.pressed=!0,globalThis.addEventListener(`pointerup`,()=>this.pressed=!1,{once:!0}),e.button!==0||e.target.closest(`.tools`)||this.o.down()&&e.pointerType!==`mouse`||(this.pan={id:e.pointerId,px:e.clientX,py:e.clientY,x:this.view.x,y:this.view.y,far:!1})},this.onPointerMove=e=>{let t=this.pan;if(!t||t.id!==e.pointerId)return;let n=e.clientX-t.px,r=e.clientY-t.py;!t.far&&Math.hypot(n,r)<4||(t.far||(t.far=!0,e.currentTarget.setPointerCapture(e.pointerId),e.currentTarget.classList.add(`drag`)),this.setMoved(),this.setView({...this.view,x:t.x+n,y:t.y+r}))},this.onPointerUp=e=>{let t=this.pan;t&&t.id===e.pointerId&&(this.pan=null,e.currentTarget.classList.remove(`drag`),t.far&&(this.swallowClick=!0))},this.onWheel=e=>{if(!this.o.wheel()||!e.ctrlKey&&!e.metaKey)return;let t=this.o.frame();if(!t)return;e.preventDefault();let n=t.getBoundingClientRect();this.zoomBy(Math.exp(.0015*-e.deltaY),e.clientX-n.left,e.clientY-n.top)},this.onClickCapture=e=>{this.swallowClick&&(this.swallowClick=!1,e.stopPropagation(),e.preventDefault())},e.addController(this)}hostConnected(){this.host.addEventListener(`wheel`,this.onWheel,{passive:!1}),this.host.addEventListener(`click`,this.onClickCapture,{capture:!0})}hostDisconnected(){this.host.removeEventListener(`wheel`,this.onWheel),this.host.removeEventListener(`click`,this.onClickCapture,{capture:!0}),this.resize?.disconnect(),this.resize=void 0}hostUpdated(){this.resize||(this.resize=new ResizeObserver(()=>this.o.onResize()),this.resize.observe(this.host))}get transform(){return(e=>`translate(${e.x}px,${e.y}px) scale(${e.k})`)(this.view)}reset(){this.moved=!1}fit(){let e=this.o.drawing();if(!e)return;let t=this.o.frame(),n=t?.clientWidth||this.host.clientWidth,r=mo(e.w,e.h,n,e.down?1/0:Math.max(360,.7*globalThis.innerHeight)),i=t?.clientHeight??0,a=`${i}px`===(t?.style.height??`0px`)?r:mo(e.w,e.h,n,i,i);a.k!==this.fitK&&(this.fitK=a.k,this.host.requestUpdate());let o=e.down?r.h:Math.max(r.h,e.room);this.moved?o>this.frameH&&this.setHeight(o):(this.setHeight(o),a.k===this.view.k&&a.x===this.view.x&&a.y===this.view.y||this.setView({k:a.k,x:a.x,y:a.y}))}showAll(){this.moved=!1,this.fit(),this.host.requestUpdate()}zoomBy(e,t=(this.o.frame()?.clientWidth??this.host.clientWidth)/2,n=(this.o.frame()?.clientHeight??this.frameH)/2){this.setMoved(),this.setView(function(e,t,n,r,i){let a=Math.min(2.5,Math.max(i,e.k*t)),o=a/e.k;return{k:a,x:n-(n-e.x)*o,y:r-(r-e.y)*o}}(this.view,e,t,n,Math.min(1,this.fitK)/2))}reveal(e){let t=this.o.frame();if(!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=0,a=0;r.left<n.left+24?i=n.left+24-r.left:r.right>n.right-24&&(i=n.right-24-r.right),r.top<n.top+24?a=n.top+24-r.top:r.bottom>n.bottom-24&&(a=n.bottom-24-r.bottom),(i||a)&&(this.setMoved(),this.setView({...this.view,x:this.view.x+i,y:this.view.y+a}))}setMoved(){this.moved||(this.moved=!0,this.host.requestUpdate())}setHeight(e){e!==this.frameH&&(this.frameH=e,this.host.requestUpdate())}setView(e){this.view=e;let t=this.o.stage();t&&(t.style.transform=this.transform),this.o.onMove()}},yo=class{constructor(e,t){this.host=e,this.o=t,this.room=0,this.quiet=!1,this.onCardKey=e=>{if(e.key===`Tab`&&e.shiftKey&&e.target===this.actions()[0]){let t=this.itemFocus();if(!t)return;e.preventDefault(),this.focusQuietly(t)}else e.key===`Escape`&&this.focusQuietly(this.itemFocus())},this.onTabToCard=e=>{if(e.key!==`Tab`||e.shiftKey||e.defaultPrevented)return;let t=this.itemFocus();if(!t||this.focused!==t)return;let n=this.actions()[0];n&&(e.preventDefault(),n.focus())},e.addController(this)}hostConnected(){this.host.addEventListener(`keydown`,this.onTabToCard)}hostDisconnected(){this.host.removeEventListener(`keydown`,this.onTabToCard)}get root(){return this.host.shadowRoot??this.host}get focused(){return function(e){let t=e?.activeElement??null;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}(this.host.shadowRoot)}card(){return this.root.querySelector(`.insp`)}content(){return this.card()?.querySelector(`slot`)?.assignedElements({flatten:!0})??[]}actions(){return this.content().flatMap(e=>[...e.matches(`button, a[href]`)?[e]:[],...e.querySelectorAll(`button, a[href]`)])}anchor(){let e=this.root.querySelector(`.main > .frame`),t=e?.querySelector(`tr.sel > th`);if(e&&t)return{item:t,clear:t,frame:e};let n=e?.querySelector(`.mark.sel, .taskchip.sel, .node.sel, .cluster.sel`)??this.o.inner()?.querySelector(`.mark.sel`);if(!e||!n)return null;let r=n.classList.contains(`cluster`)?n.querySelector(`:scope > .hd`)??n:n;return{item:r,clear:r.closest(`.node`)??n,frame:e}}place(){let e=this.card(),t=this.o.docked(),n=e&&!t?e.querySelector(`.scroll`).scrollHeight+24+16:0;if(n!==this.room&&(n>this.o.frameH()||this.room>0)&&(this.room=n,this.o.grow()),!e||t)return;let r=this.anchor(),i=this.root.querySelector(`.main`);if(!r||!i)return void e.classList.remove(`placed`);let a=i.getBoundingClientRect(),o=e=>({left:e.left-a.left,top:e.top-a.top,width:e.width,height:e.height}),s=o(r.item.getBoundingClientRect()),c=o(r.clear.getBoundingClientRect()),l=o(r.frame.getBoundingClientRect()),u=r.frame.querySelector(`.mx`)??this.o.inner()?.querySelector(`.mx`),d=_o(s,u?o(u.getBoundingClientRect()):l,{width:0,height:0}).shown,f=e.querySelector(`.scroll`);f&&(f.style.maxHeight=`${Math.max(120,l.height-16-24)}px`);let p={width:e.offsetWidth,height:e.offsetHeight},m=_o(c,l,p,s);m.fits||r.clear===r.item||r.clear.classList.contains(`node`)||(m=_o(s,l,p)),e.classList.toggle(`placed`,m.shown&&d),e.dataset.side=m.side,e.style.left=`${m.x}px`,e.style.top=`${m.y}px`,e.style.setProperty(`--arrow`,`${m.arrow}px`)}itemFocus(){let e=this.anchor();return e?e.item.matches(`button`)?e.item:e.item.querySelector(`.name`):null}describe(){let e=[this.root,this.o.inner()].filter(e=>!!e);for(let t of e)for(let e of t.querySelectorAll(`[aria-describedby="insp"]`))e.removeAttribute(`aria-describedby`);let t=this.itemFocus(),n=this.card();t&&n&&(t.getRootNode()===n.getRootNode()?t.setAttribute(`aria-describedby`,`insp`):`ariaDescribedByElements`in t&&(t.ariaDescribedByElements=[n]));let r=this.content(),i=e=>r.map(t=>t.matches(e)?t:t.querySelector(e)).find(Boolean)??null;return[i(`h1, h2, h3, h4, h5, h6`)?.textContent?.trim()??``,i(`[data-status]`)?.textContent?.trim()??``]}focusQuietly(e){this.quiet=!0,e?.focus(),this.quiet=!1}whenReleased(e){if(!this.o.pressed())return e();globalThis.addEventListener(`pointerup`,()=>setTimeout(e),{once:!0})}revealOverSheet(){let e=this.anchor()?.item;if(!e)return;let t=e.getBoundingClientRect(),n=this.card()?.getBoundingClientRect(),r=Math.min(globalThis.innerHeight,n?.top??1/0);(t.top<0||t.bottom>r)&&e.scrollIntoView({block:`center`})}},bo=(e=14)=>k`<svg class="ic loop-ic" width=${e} height=${e} viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
182
|
+
</div>`}mark(e,t,n,r,i,a){let o=this.states[t.state],s=e.id||t.id,c=this.selected===t.id;return A`<button type="button" part="mark" class="mark ${e.id&&e.id===a?`on`:``} ${c?`sel`:``}" data-tone=${L(o?.tone)} data-shape=${o?.shape??M} data-r=${n} data-c=${r} tabindex=${i?0:-1} title=${t.tip??M} aria-label=${t.label} aria-pressed=${c} @mouseenter=${()=>this.hover=s} @focus=${()=>{this.hover=s,this.cell=[n,r],this.select(t.id)}} @blur=${()=>this.hover=null} @click=${()=>this.select(t.id)} @dblclick=${()=>this.act(t)}></button>`}onKey(e,t){let n=e.target;if(!n.classList.contains(`mark`))return;let r=Number(n.dataset.r),i=Number(n.dataset.c);if(e.key===`Enter`){let n=t[r]?.cells[i];e.preventDefault(),n&&this.act(n);return}let a=function(e,t,n,r,i=!1,a=10){let o=(t,n)=>!0===e[t]?.[n],s=t=>(e[t]??[]).findIndex(Boolean),c=t=>(e[t]??[]).lastIndexOf(!0),l=t=>{let r=e[t]??[],i=-1;return r.forEach((e,t)=>e&&(i<0||Math.abs(t-n)<Math.abs(i-n))&&(i=t)),i<0?null:[t,i]};switch(r){case`ArrowRight`:case`ArrowLeft`:{let i=r===`ArrowRight`?1:-1;for(let r=n+i;r>=0&&r<(e[t]?.length??0);r+=i)if(o(t,r))return[t,r];return null}case`ArrowDown`:case`ArrowUp`:{let i=r===`ArrowDown`?1:-1,a=((t,n,r)=>{for(let i=t;i>=0&&i<e.length;i+=n)if(o(i,r))return i;return-1})(t+i,i,n);if(a>=0)return[a,n];for(let n=t+i;n>=0&&n<e.length;n+=i)if(s(n)>=0)return l(n);return null}case`Home`:{let n=i?e.findIndex(e=>e.some(Boolean)):t;return n<0||s(n)<0?null:[n,s(n)]}case`End`:{let n=t;if(i)for(n=e.length-1;n>=0&&c(n)<0;n--);return n<0||c(n)<0?null:[n,c(n)]}case`PageDown`:case`PageUp`:{let n=r===`PageDown`?1:-1;for(let r=Math.max(0,Math.min(e.length-1,t+n*a));r!==t;r-=n)if(s(r)>=0)return l(r);return null}default:return null}}(t.map(e=>e.cells.map(e=>e!==null)),r,i,e.key,e.ctrlKey||e.metaKey);if(!a)return;e.preventDefault(),this.cell=a;let o=this.renderRoot.querySelector(`.mx`);if(o&&t.length>this.windowAt){let e=24*a[0];(e<o.scrollTop+48||e>o.scrollTop+o.clientHeight-72)&&(o.scrollTop=Math.max(0,e-o.clientHeight/2)),this.scrollRow=Math.floor(o.scrollTop/24)}this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot.querySelector(`.matrix .mark[data-r="${a[0]}"][data-c="${a[1]}"]`)?.focus())}};function no(e,t,n){for(let r=0;r<t;r++){let i=0;for(let a of e[r]??[]){if(n>=i&&n<i+a.span&&r+a.rows>t)return!0;i+=a.span}}return!1}var ro=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])},io=(e,t)=>`${e}\0${t}`;function ao(e,t,n){let r=new Set(e),i=new Map(e.map(e=>[e,[]]));for(let[e,n]of t)e!==n&&r.has(e)&&r.has(n)&&!i.get(e)?.includes(n)&&i.get(e)?.push(n);let a=new Set,o=new Map;for(let t of e){if(o.has(t))continue;o.set(t,1);let e=[[t,0]];for(;e.length;){let t=e[e.length-1],n=i.get(t[0])??[];if(t[1]<n.length){let r=n[t[1]++],i=o.get(r);i===1?a.add(io(t[0],r)):i||(o.set(r,1),e.push([r,0]))}else o.set(t[0],2),e.pop()}}let s=new Map(e.map(e=>[e,[]])),c=new Map(e.map(e=>[e,[]]));for(let[e,t]of i)for(let n of t)a.has(io(e,n))||(s.get(e)?.push(n),c.get(n)?.push(e));let l=new Map(e.map(e=>[e,c.get(e)?.length??0])),u=e.filter(e=>!l.get(e)),d=new Map;for(let e=u.shift();e!==void 0;e=u.shift()){d.set(e,n.get(e)??Math.max(0,...(c.get(e)??[]).map(e=>(d.get(e)??0)+1)));for(let t of s.get(e)??[])l.set(t,(l.get(t)??0)-1),l.get(t)||u.push(t)}return d}var oo=e=>e.startsWith(`~`);function so(e,t,n){let r=new Map;e.forEach((e,t)=>e.forEach(e=>r.set(e,t)));let i=new Map,a=new Map;for(let[e,n]of t)ro(a,e,n),ro(i,n,e);let o=new Map,s=e=>e.forEach((e,t)=>o.set(e,t)),c=e.map(e=>[...e]);c.forEach(s);let l=()=>function(e,t,n,r){let i=0,a=new Map;for(let[e,i]of t){let t=r.get(e);t!==void 0&&ro(a,t,[n.get(e)??0,n.get(i)??0])}for(let e of a.values())for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let[r,a]=e[t],[o,s]=e[n];(r-o)*(a-s)<0&&i++}return e.length?i:0}(c,t,o,r),u=c.map(e=>[...e]),d=l(),f=(e,t)=>{let r=new Map;for(let n of e){let e=(t.get(n)??[]).map(e=>o.get(e)).filter(e=>e!==void 0);r.set(n,e.length?e.reduce((e,t)=>e+t,0)/e.length:o.get(n)??0)}let i=e=>r.get(e)??0;if(!n)return[...e].sort((e,t)=>i(e)-i(t)||(o.get(e)??0)-(o.get(t)??0));let a=e.filter(e=>!oo(e)),s=e.filter(oo).sort((e,t)=>i(e)-i(t)||(o.get(e)??0)-(o.get(t)??0)),c=[],l=0;for(let e of a){for(;l<s.length&&i(s[l])<i(e);)c.push(s[l++]);c.push(e)}return[...c,...s.slice(l)]};for(let e=0;e<4;e++){let t=e%2==0,n=t?c.map((e,t)=>t).slice(1):c.map((e,t)=>t).reverse().slice(1);for(let e of n){let n=f(c[e],t?i:a);c[e]=n,s(n)}let r=l();r<d&&(d=r,u=c.map(e=>[...e]))}return l()<=d?c:u}var co=new WeakMap;function lo(e,t,n=!1){let r=co.get(e)??[],i=r.find(e=>e.prev===t&&e.down===n);if(i)return i.out;let a=function(e,t,n){let r=new Set(e.clusters.map(e=>e.id)),i=new Map(e.clusters.map(e=>[e.id,e.parent])),a=new Map;for(let t of e.nodes)t.cluster&&a.set(t.id,t.cluster);let o=[...new Set(e.stubs.map(e=>e.id))],s=new Set(o),c=e=>{let t=[],n=r.has(e)?e:a.get(e)??null;for(;n;)t.push(n),n=i.get(n)??null;return t},l=(e,t)=>{let n=c(e);if(t===``)return n[n.length-1]??e;let r=n.indexOf(t);return r<0?void 0:r===0?e:n[r-1]},u=(e,t)=>c(e).find(e=>c(t).includes(e))??``,d=[``,...e.clusters.map(e=>e.id)],f=new Map(d.map(e=>[e,[]]));for(let{id:t}of e.nodes)for(let e of d){let n=l(t,e);n===void 0||f.get(e)?.includes(n)||f.get(e)?.push(n)}let p=new Map;for(let n of d){let r=f.get(n)??[],i=n===``?t?.layers:t?.clusters[n],a=new Map;i?.forEach((e,t)=>e.forEach(e=>r.includes(e)&&a.set(e,t)));let o=e.edges.filter(e=>e.ranks&&u(e.from,e.to)===n).map(e=>[l(e.from,n),l(e.to,n)]);p.set(n,ao(r,o,a))}let m=p.get(``),h=new Map;t?.layers.forEach((e,t)=>e.forEach(e=>h.set(e,t)));let g=new Map(o.map(t=>[t,h.get(t)??Math.min(...e.stubs.filter(e=>e.id===t).map(e=>m.get(l(e.to,``))??0))-1]));if([...g.values()].some(e=>e<0)){for(let[e,t]of m)m.set(e,t+1);for(let[e,t]of g)g.set(e,t+1)}for(let[e,t]of g)m.set(e,t);let _=(e,t)=>p.get(e)?.get(t)??0,v=e=>Math.max(0,...p.get(e)?.values()??[]),y=e.edges.map(e=>((e,t)=>{let n=u(e,t);return _(n,l(e,n))>=_(n,l(t,n))})(e.from,e.to)),b=new Map;for(let e of d){let n=((e===``?t?.layers:t?.clusters[e])??[]).flat(),r=[...e===``?[...o]:[],...f.get(e)??[]];r.sort((e,t)=>{let r=n.indexOf(e),i=n.indexOf(t);return(r<0?1/0:r)-(i<0?1/0:i)});let i=Array.from({length:v(e)+1},()=>[]);for(let t of r)i[_(e,t)]?.push(t);b.set(e,i)}let x=[],S=new Set,C=(e,t,n,r)=>{let i=`~${e}|${t}|${n}|${r}`;return S.has(i)||(S.add(i),b.get(e)?.[r]?.push(i)),{id:i,in:e}},ee=(e,t,n,r)=>{let i=_(e,t),a=`~${e}|by:${t}|${n}|${r}|${i}`;return S.has(a)||(S.add(a),b.get(e)?.[i]?.push(a)),{id:a,in:e}},te=(e,t,r)=>{let o=s.has(e)?``:u(e,t),d=(p=e,s.has(p)?``:a.get(p)??``),f=e;var p;let m=[{id:e,in:d}];for(;d!==o;){let e=i.get(d)??``;m.push({id:d,in:e}),_(d,f)<v(d)&&m.push(ee(e,d,f,r)),f=d,d=e}let h=l(t,o);for(let e=_(o,f)+1;e<_(o,h);e++)m.push(C(o,f,r,e));let g=c(t),y=g.slice(0,o===``?g.length:g.indexOf(o)).reverse(),b=`>${o}:${f}`,x=o;for(let e of y){let i=l(t,e);(_(e,i)>0||n)&&m.push(ee(x,e,b,r)),m.push({id:e,in:x}),x=e}return m.push({id:t,in:x}),m};e.edges.forEach((e,t)=>{y[t]||x.push({from:e.from,to:e.to,style:e.style,steps:te(e.from,e.to,e.style)})});for(let t of e.stubs)x.push({from:t.id,to:t.to,style:t.style,steps:te(t.id,t.to,t.style)});let ne={};for(let e of d){let n=[],r=new Map((b.get(e)??[]).flatMap((e,t)=>e.map(e=>[e,t])));for(let t of x)for(let i=1;i<t.steps.length;i++){let a=t.steps[i-1],o=t.steps[i];a.in===e&&o.in===e&&r.get(a.id)!==r.get(o.id)&&n.push([a.id,o.id])}let i=e===``?!!t:!!t?.clusters[e];ne[e]=so(b.get(e)??[],n,i).map(e=>{let t=e.filter(e=>e.includes(`|by:`));return e.filter(e=>!e.includes(`|by:`)).flatMap(e=>[e,...t.filter(t=>t.includes(`|by:${e}|`))])})}let re=e=>e.map(e=>e.filter(e=>!oo(e))),ie=e.clusters.map(e=>({id:e.id,parent:e.parent,cycle:!!e.cycle,layers:re(ne[e.id]??[]).filter(e=>e.length)})),ae=re(ne[``]??[]).map(e=>e.filter(e=>!s.has(e))),oe=new Map(ie.map(e=>[e.id,e])),se=e=>e.flatMap(e=>r.has(e)?se((oe.get(e)?.layers??[]).flat()):[e]);return{drawn:se(ae.flat()),layers:ae.filter(e=>e.length),clusters:ie,back:y,slots:ne,edgePaths:x,order:{layers:re(ne[``]??[]),clusters:Object.fromEntries(ie.map(e=>[e.id,re(ne[e.id]??[])]))}}}(e,t,n);return co.set(e,[...r.slice(-3),{prev:t,down:n,out:a}]),a}function uo(e){let t=new Map(e.clusters.map(e=>[e.id,e])),n=new Map,r=e=>{let i=0,a=0;for(let o of e){let e=0,s=0;for(let i of o){let a=t.get(i),o=a?n.get(i)??n.set(i,r(a.layers)).get(i)??{span:1,stack:1}:{span:1,stack:1};e=Math.max(e,o.span),s+=o.stack}i+=e,a=Math.max(a,s)}return{span:i,stack:a}};return r(e.layers)}var fo={across:{gap:56,boxGap:40,sep:16,pointSep:12,pad:12,padEnd:24,margin:16},down:{gap:40,boxGap:32,sep:16,pointSep:12,pad:10,padEnd:24,margin:16}};function po(e,t,n){let r=[0];for(let n=1;n<e.length;n++)r.push(r[n-1]+t[n-1]);let i=[];e.forEach((e,t)=>{let a=n[t]??1;for(i.push({sum:a*(e-r[t]),w:a,n:1});i.length>1;){let e=i[i.length-1],t=i[i.length-2];if(t.sum/t.w<=e.sum/e.w)break;i.splice(-2,2,{sum:t.sum+e.sum,w:t.w+e.w,n:t.n+e.n})}});let a=[];for(let e of i)for(let t=0;t<e.n;t++)a.push(e.sum/e.w+r[a.length]);return a}function mo(e,t,n,r,i=0){if(e<=0||t<=0||n<=0)return{k:1,x:0,y:0,h:Math.max(0,t)};let a=Math.min(1,n/e),o=Math.max(i,Math.min(t*a,r)),s=Math.min(a,o/t);return{k:s,x:(n-e*s)/2,y:(o-t*s)/2,h:o}}var ho=(e,t=200)=>e.marks.filter(e=>e!==null).length+e.loose.length>t,go=(e,t,n)=>n<t?t:Math.min(n,Math.max(t,e));function _o(e,t,n,r=e){let i=function(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.left+e.width,t.left+t.width),a=Math.min(e.top+e.height,t.top+t.height);return i>n&&a>r?{left:n,top:r,width:i-n,height:a-r}:null}(r,t);if(!i)return{shown:!1,x:0,y:0,side:`right`,arrow:0,fits:!1};let{width:a,height:o}=n,s=t.left+8,c=t.top+8,l=t.left+t.width-8,u=t.top+t.height-8,d=e.left+e.width,f=e.top+e.height,p=i.top+i.height/2,m=i.left+i.width/2,h=go(p-o/2,c,u-o),g=go(m-a/2,s,l-a),_={right:l-(d+12)-a,left:e.left-12-a-s,below:u-(f+12)-o,above:e.top-12-o-c},v=[`right`,`left`,`below`,`above`],y=v.find(e=>_[e]>=0)??v.reduce((e,t)=>_[t]>_[e]?t:e),b,x;switch(y){case`right`:[b,x]=[go(d+12,s,l-a),h];break;case`left`:[b,x]=[go(e.left-12-a,s,l-a),h];break;case`below`:[b,x]=[g,go(f+12,c,u-o)];break;case`above`:[b,x]=[g,go(e.top-12-o,c,u-o)]}return{shown:!0,x:b,y:x,side:y,arrow:y===`right`||y===`left`?go(p-x,14,o-14):go(m-b,14,a-14),fits:_[y]>=0}}var vo=class{constructor(e,t){this.host=e,this.o=t,this.view={k:1,x:0,y:0},this.frameH=0,this.fitK=1,this.moved=!1,this.pressed=!1,this.pan=null,this.swallowClick=!1,this.onPointerDown=e=>{this.pressed=!0,globalThis.addEventListener(`pointerup`,()=>this.pressed=!1,{once:!0}),e.button!==0||e.target.closest(`.tools`)||this.o.down()&&e.pointerType!==`mouse`||(this.pan={id:e.pointerId,px:e.clientX,py:e.clientY,x:this.view.x,y:this.view.y,far:!1})},this.onPointerMove=e=>{let t=this.pan;if(!t||t.id!==e.pointerId)return;let n=e.clientX-t.px,r=e.clientY-t.py;!t.far&&Math.hypot(n,r)<4||(t.far||(t.far=!0,e.currentTarget.setPointerCapture(e.pointerId),e.currentTarget.classList.add(`drag`)),this.setMoved(),this.setView({...this.view,x:t.x+n,y:t.y+r}))},this.onPointerUp=e=>{let t=this.pan;t&&t.id===e.pointerId&&(this.pan=null,e.currentTarget.classList.remove(`drag`),t.far&&(this.swallowClick=!0))},this.onWheel=e=>{if(!this.o.wheel()||!e.ctrlKey&&!e.metaKey)return;let t=this.o.frame();if(!t)return;e.preventDefault();let n=t.getBoundingClientRect();this.zoomBy(Math.exp(.0015*-e.deltaY),e.clientX-n.left,e.clientY-n.top)},this.onClickCapture=e=>{this.swallowClick&&(this.swallowClick=!1,e.stopPropagation(),e.preventDefault())},e.addController(this)}hostConnected(){this.host.addEventListener(`wheel`,this.onWheel,{passive:!1}),this.host.addEventListener(`click`,this.onClickCapture,{capture:!0})}hostDisconnected(){this.host.removeEventListener(`wheel`,this.onWheel),this.host.removeEventListener(`click`,this.onClickCapture,{capture:!0}),this.resize?.disconnect(),this.resize=void 0}hostUpdated(){this.resize||(this.resize=new ResizeObserver(()=>this.o.onResize()),this.resize.observe(this.host))}get transform(){return(e=>`translate(${e.x}px,${e.y}px) scale(${e.k})`)(this.view)}reset(){this.moved=!1}fit(){let e=this.o.drawing();if(!e)return;let t=this.o.frame(),n=t?.clientWidth||this.host.clientWidth,r=mo(e.w,e.h,n,e.down?1/0:Math.max(360,.7*globalThis.innerHeight)),i=t?.clientHeight??0,a=`${i}px`===(t?.style.height??`0px`)?r:mo(e.w,e.h,n,i,i);a.k!==this.fitK&&(this.fitK=a.k,this.host.requestUpdate());let o=e.down?r.h:Math.max(r.h,e.room);this.moved?o>this.frameH&&this.setHeight(o):(this.setHeight(o),a.k===this.view.k&&a.x===this.view.x&&a.y===this.view.y||this.setView({k:a.k,x:a.x,y:a.y}))}showAll(){this.moved=!1,this.fit(),this.host.requestUpdate()}zoomBy(e,t=(this.o.frame()?.clientWidth??this.host.clientWidth)/2,n=(this.o.frame()?.clientHeight??this.frameH)/2){this.setMoved(),this.setView(function(e,t,n,r,i){let a=Math.min(2.5,Math.max(i,e.k*t)),o=a/e.k;return{k:a,x:n-(n-e.x)*o,y:r-(r-e.y)*o}}(this.view,e,t,n,Math.min(1,this.fitK)/2))}reveal(e){let t=this.o.frame();if(!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=0,a=0;r.left<n.left+24?i=n.left+24-r.left:r.right>n.right-24&&(i=n.right-24-r.right),r.top<n.top+24?a=n.top+24-r.top:r.bottom>n.bottom-24&&(a=n.bottom-24-r.bottom),(i||a)&&(this.setMoved(),this.setView({...this.view,x:this.view.x+i,y:this.view.y+a}))}setMoved(){this.moved||(this.moved=!0,this.host.requestUpdate())}setHeight(e){e!==this.frameH&&(this.frameH=e,this.host.requestUpdate())}setView(e){this.view=e;let t=this.o.stage();t&&(t.style.transform=this.transform),this.o.onMove()}},yo=class{constructor(e,t){this.host=e,this.o=t,this.room=0,this.quiet=!1,this.onCardKey=e=>{if(e.key===`Tab`&&e.shiftKey&&e.target===this.actions()[0]){let t=this.itemFocus();if(!t)return;e.preventDefault(),this.focusQuietly(t)}else e.key===`Escape`&&this.focusQuietly(this.itemFocus())},this.onTabToCard=e=>{if(e.key!==`Tab`||e.shiftKey||e.defaultPrevented)return;let t=this.itemFocus();if(!t||this.focused!==t)return;let n=this.actions()[0];n&&(e.preventDefault(),n.focus())},e.addController(this)}hostConnected(){this.host.addEventListener(`keydown`,this.onTabToCard)}hostDisconnected(){this.host.removeEventListener(`keydown`,this.onTabToCard)}get root(){return this.host.shadowRoot??this.host}get focused(){return function(e){let t=e?.activeElement??null;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}(this.host.shadowRoot)}card(){return this.root.querySelector(`.insp`)}content(){return this.card()?.querySelector(`slot`)?.assignedElements({flatten:!0})??[]}actions(){return this.content().flatMap(e=>[...e.matches(`button, a[href]`)?[e]:[],...e.querySelectorAll(`button, a[href]`)])}anchor(){let e=this.root.querySelector(`.main > .frame`),t=e?.querySelector(`tr.sel > th`);if(e&&t)return{item:t,clear:t,frame:e};let n=e?.querySelector(`.mark.sel, .taskchip.sel, .node.sel, .cluster.sel`)??this.o.inner()?.querySelector(`.mark.sel`);if(!e||!n)return null;let r=n.classList.contains(`cluster`)?n.querySelector(`:scope > .hd`)??n:n;return{item:r,clear:r.closest(`.node`)??n,frame:e}}place(){let e=this.card(),t=this.o.docked(),n=e&&!t?e.querySelector(`.scroll`).scrollHeight+24+16:0;if(n!==this.room&&(n>this.o.frameH()||this.room>0)&&(this.room=n,this.o.grow()),!e||t)return;let r=this.anchor(),i=this.root.querySelector(`.main`);if(!r||!i)return void e.classList.remove(`placed`);let a=i.getBoundingClientRect(),o=e=>({left:e.left-a.left,top:e.top-a.top,width:e.width,height:e.height}),s=o(r.item.getBoundingClientRect()),c=o(r.clear.getBoundingClientRect()),l=o(r.frame.getBoundingClientRect()),u=r.frame.querySelector(`.mx`)??this.o.inner()?.querySelector(`.mx`),d=_o(s,u?o(u.getBoundingClientRect()):l,{width:0,height:0}).shown,f=e.querySelector(`.scroll`);f&&(f.style.maxHeight=`${Math.max(120,l.height-16-24)}px`);let p={width:e.offsetWidth,height:e.offsetHeight},m=_o(c,l,p,s);m.fits||r.clear===r.item||r.clear.classList.contains(`node`)||(m=_o(s,l,p)),e.classList.toggle(`placed`,m.shown&&d),e.dataset.side=m.side,e.style.left=`${m.x}px`,e.style.top=`${m.y}px`,e.style.setProperty(`--arrow`,`${m.arrow}px`)}itemFocus(){let e=this.anchor();return e?e.item.matches(`button`)?e.item:e.item.querySelector(`.name`):null}describe(){let e=[this.root,this.o.inner()].filter(e=>!!e);for(let t of e)for(let e of t.querySelectorAll(`[aria-describedby="insp"]`))e.removeAttribute(`aria-describedby`);let t=this.itemFocus(),n=this.card();t&&n&&(t.getRootNode()===n.getRootNode()?t.setAttribute(`aria-describedby`,`insp`):`ariaDescribedByElements`in t&&(t.ariaDescribedByElements=[n]));let r=this.content(),i=e=>r.map(t=>t.matches(e)?t:t.querySelector(e)).find(Boolean)??null;return[i(`h1, h2, h3, h4, h5, h6`)?.textContent?.trim()??``,i(`[data-status]`)?.textContent?.trim()??``]}focusQuietly(e){this.quiet=!0,e?.focus(),this.quiet=!1}whenReleased(e){if(!this.o.pressed())return e();globalThis.addEventListener(`pointerup`,()=>setTimeout(e),{once:!0})}revealOverSheet(){let e=this.anchor()?.item;if(!e)return;let t=e.getBoundingClientRect(),n=this.card()?.getBoundingClientRect(),r=Math.min(globalThis.innerHeight,n?.top??1/0);(t.top<0||t.bottom>r)&&e.scrollIntoView({block:`center`})}},bo=(e=14)=>A`<svg class="ic loop-ic" width=${e} height=${e} viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
183
183
|
<path d="M12.7,9.71 A5,5 0 1 1 11.21,4.17" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"></path>
|
|
184
184
|
<path d="M12.44,5.2 L9.15,5.06 L11.73,2 z" fill="currentColor"></path>
|
|
185
|
-
</svg>`,xo=()=>
|
|
185
|
+
</svg>`,xo=()=>A`<svg class="ic in-ic" width="12" height="12" viewBox="0 0 12 12" aria-hidden="true" focusable="false">
|
|
186
186
|
<rect x="3.4" y="0.7" width="7.9" height="7.9" rx="1.6" fill="none" stroke="currentColor" stroke-width="1.2"></rect>
|
|
187
187
|
<path d="M0.7,3.6 V9.7 Q0.7,11.3 2.3,11.3 H8.4" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"></path>
|
|
188
|
-
</svg>`,So={graph:`Graph`,table:`Table`,view:`View`,zoomIn:`Zoom in`,zoomInTip:`Zoom in (Ctrl + scroll)`,zoomOut:`Zoom out`,zoomOutTip:`Zoom out (Ctrl + scroll)`,showAll:`Show all`,graphKeys:[`Tab: next node`,`Arrow keys: marks`,`Shift + arrow keys: earlier and later nodes`,`Enter: open`],tableKeys:[`Tab: next row`,`Enter: open`],matrixKeys:[`Arrow keys: marks`,`Enter: open`],clearKey:`Esc: clear selection`,upKey:``,inspector:`Selected item`,stubTip:`Outside this graph`,more:e=>`+${e}`,progress:(e,t)=>`${e} of ${t} done`,badge:`count`,solidEdge:`link`,dashedEdge:`other link`,cycle:`next round`,drill:`has an inner view`,open:`Show inside`,close:`Hide inside`,iconNames:{},nameHeader:`Name`,statusHeader:`Status`,solidHeader:`Earlier`,dashedHeader:`Dashed link from`,laterHeader:`Later`,none:`none`,inCluster:e=>`${e} in the cluster`,list:e=>new Intl.ListFormat(`en`,{type:`conjunction`}).format(e)},Co=O` :host{display:block;container-type:inline-size;}.col,.main{display:flex;flex-direction:column;}.col{height:100%;}.main{flex:auto;min-height:0;}.frame{flex:auto;position:relative;overflow:hidden;border-radius:8px;background:var(--well);box-sizing:border-box;}.gframe{cursor:grab;touch-action:none;}.gframe.drag{cursor:grabbing;}.stage{position:absolute;left:0;top:0;transform-origin:0 0;}.gframe.down{touch-action:pan-y pinch-zoom;}.view{animation:view-in 0.1s var(--ease) both;}@keyframes view-in{from{opacity:0;}}@media (prefers-reduced-motion:reduce){.view{animation:none;}}.tools{display:flex;align-items:center;gap:4px;justify-self:end;}.tools button{all:unset;cursor:pointer;min-width:22px;height:22px;padding:0 7px;box-sizing:border-box;text-align:center;font-size:11.5px;line-height:22px;color:var(--text-2);border-radius:6px;border:1px solid var(--line);}.tools button:hover:not(:disabled){color:var(--text);border-color:var(--line2);}.tools button:focus-visible,.loopchip:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;}.tools button:disabled{cursor:default;opacity:0.4;}.views{margin-left:6px;}.dag{position:relative;}.dag.unplaced{visibility:hidden;}.dag>*,.cluster>.in>*{position:absolute;}.edges{left:0;top:0;pointer-events:none;overflow:visible;z-index:0;}.edges path{fill:none;stroke:var(--line2);stroke-width:1.5;}.edges path.dashed{stroke-dasharray:5 4;}.edges path.ret,.legend svg path.ret{stroke:var(--text-2);stroke-width:2;stroke-dasharray:0.1 4;stroke-linecap:round;opacity:0.8;}.edges path.ret-tip,.legend svg path.ret-head{fill:var(--text-2);stroke:none;opacity:0.8;}.ic{display:block;flex:none;}.loop-ic{color:var(--text-2);}.in-ic{color:var(--text-muted);}.stub{z-index:1;font-family:var(--mono);font-size:11.5px;color:var(--text-muted);padding:3px 9px;border-radius:999px;border:1px solid var(--line);background:var(--card);white-space:nowrap;}.cluster{z-index:1;box-sizing:border-box;border-radius:14px;border:1px solid var(--line2);background:color-mix(in srgb,var(--text-muted) 5%,transparent);}.cluster .cluster{background:color-mix(in srgb,var(--text-muted) 6%,transparent);}.cluster>.in{position:absolute;inset:0;pointer-events:none;}.cluster>.in>*{pointer-events:auto;}.cluster>.hd{position:absolute;left:11px;top:6px;display:flex;flex-direction:column;align-items:flex-start;gap:1px;white-space:nowrap;padding-right:22px;cursor:pointer;}.cluster>.hd .line{display:flex;align-items:center;gap:8px;}.cluster>.hd .name{display:inline-flex;align-items:center;gap:5px;}.cluster.sel{outline:var(--focus-width) solid var(--accent);outline-offset:2px;}.cluster>.hd .spread{font-size:11px;color:var(--text-2);font-variant-numeric:tabular-nums;}.node{z-index:1;width:max-content;min-width:120px;box-sizing:border-box;display:flex;flex-direction:column;gap:7px;padding:8px 10px 9px;border-radius:10px;border:1px solid var(--line);background:var(--card);transition:border-color 0.3s,box-shadow 0.3s;cursor:pointer;box-shadow:var(--ex,0 0 0 0 transparent);}.node.accent{--ex:inset 3px 0 0 -1px color-mix(in srgb,var(--agent) 60%,transparent);}.node .nm{display:flex;align-items:center;min-width:0;gap:0;}.node .right{display:flex;align-items:center;gap:8px;}.node .right>.tog{margin-inline-end:0;}.cue{display:block;line-height:0;}.cluster>.cue{position:absolute;top:9px;right:10px;padding:2px;margin:-2px;}.tog{all:unset;cursor:pointer;display:inline-flex;line-height:0;padding:2px;margin:-2px;border-radius:4px;color:var(--text-2);}.tog:hover{color:var(--text);background:var(--raise);}.tog:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;}.cluster>.hd .psep{color:var(--text-muted);font-size:11px;}.cluster>.hd .part{all:unset;cursor:pointer;font-family:var(--mono);font-weight:600;font-size:12.5px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px;}.cluster>.hd .part:hover{color:var(--text);text-decoration:underline;}.cluster>.hd .part:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:2px;border-radius:3px;}.node.sel{outline:var(--focus-width) solid var(--accent);outline-offset:2px;}.node.drill{box-shadow:4px 4px 0 -1px var(--card),4px 4px 0 0 var(--line2);}.node[data-look='running']{border-color:var(--status-running);}.node.drill[data-look='running']{box-shadow:4px 4px 0 -1px var(--card),4px 4px 0 0 var(--status-running),0 0 14px var(--status-running-bg);}.node:not(.drill)[data-look='running']{box-shadow:var(--ex,0 0 0 0 transparent),0 0 14px var(--status-running-bg);}.node[data-look='failed']{border-color:color-mix(in srgb,var(--status-failed) 55%,transparent);}.node:focus-within{border-color:var(--text-2);}.hd{display:flex;align-items:center;justify-content:space-between;gap:12px;}.name{all:unset;cursor:pointer;font-family:var(--mono);font-weight:600;font-size:12.5px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px;}.name:hover{text-decoration:underline;}.name:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:2px;border-radius:3px;}.count{font-size:11px;color:var(--text-muted);font-variant-numeric:tabular-nums;white-space:nowrap;}.ex{display:flex;flex-wrap:wrap;gap:0 10px;font-size:11px;line-height:1.5;contain:inline-size;}:is(.ex,.st) .err{color:var(--status-failed);}:is(.ex,.st) .warn{color:var(--status-attention);}:is(.ex,.st) .live{color:var(--status-running);}:is(.ex,.st) .mut{color:var(--text-muted);}.marks{display:grid;grid-template-columns:repeat(var(--cols),var(--m));gap:var(--g);}.slot{width:var(--m);height:var(--m);}.taskchip.sel{outline:var(--focus-width) solid var(--accent);outline-offset:1px;}.hl .mark:not(.on){opacity:0.16;}.hl .mark.on{transform:scale(1.2);}@media (prefers-reduced-motion:reduce){.node{transition:none;}}.sbar{display:flex;width:220px;height:10px;border-radius:3px;overflow:hidden;background:var(--track);gap:1px;}.sbar i{display:block;min-width:2px;height:100%;background:var(--tone,var(--line2));}.sbar i:not([data-tone]){--tone:initial;}.sbar i[data-tone='done']{opacity:0.85;}.sbar i[data-tone='muted']{opacity:0.5;}.sbar i[data-shape='hatched']{background:repeating-linear-gradient(135deg,var(--tone-bg) 0 2px,color-mix(in srgb,var(--tone) 60%,transparent) 2px 3px);}.sbar i[data-shape='half']{background:linear-gradient(0deg,var(--tone) 50%,var(--tone-bg) 50%);}.fails{display:flex;flex-wrap:wrap;align-items:center;gap:4px;max-width:220px;font-size:11px;color:var(--text-muted);}.fails .taskchip{color:var(--status-failed);border-color:color-mix(in srgb,var(--status-failed) 45%,transparent);}.fails .taskchip:focus-visible{outline:var(--focus-width) solid var(--text);outline-offset:1px;}.hl .fails .taskchip:not(.on){opacity:0.4;}.mxframe{display:grid;grid-template-columns:minmax(0,1fr);place-items:center;padding:14px 16px;}.foot{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:6px 14px;margin-top:6px;}.legend{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:11px;color:var(--text-muted);}.legend span{display:inline-flex;align-items:center;gap:6px;}.legend .mark{--m:12px;cursor:default;animation:none;}.legend .mark:hover{transform:none;outline:none;}.legend i.mark{border-radius:3px;}.legend i.mark:is([data-shape='square'],[data-shape='hatched']){border-radius:2px;}.legend i.mark[data-shape='hatched']{background:repeating-linear-gradient(135deg,transparent 0 2px,color-mix(in srgb,var(--tone) 55%,transparent) 2px 3px);}.legend i.mark[data-shape='half']{border-radius:50%;}.legend svg path{stroke:var(--line2);stroke-width:1.5;fill:none;}.main{position:relative;min-width:0;}.sep{color:var(--text-muted);}.insp{position:absolute;left:0;top:0;z-index:6;width:272px;max-width:calc(100% - 16px);box-sizing:border-box;display:flex;flex-direction:column;gap:9px;padding:10px 12px 12px;border-radius:10px;border:1px solid var(--accent);background:var(--card);font-size:12px;overflow:visible;box-shadow:0 12px 32px color-mix(in srgb,var(--shadow) 55%,transparent);visibility:hidden;animation:insp-in 0.12s var(--ease) both;}.insp.placed{visibility:visible;}.insp .scroll{display:flex;flex-direction:column;gap:9px;min-height:0;overflow:auto;}.insp .ptr{position:absolute;width:10px;height:10px;background:var(--card);border:1px solid var(--accent);transform:rotate(45deg);}.insp[data-side='right'] .ptr{left:-6px;top:calc(var(--arrow) - 5px);border-top:0;border-right:0;}.insp[data-side='left'] .ptr{right:-6px;top:calc(var(--arrow) - 5px);border-bottom:0;border-left:0;}.insp[data-side='below'] .ptr{top:-6px;left:calc(var(--arrow) - 5px);border-bottom:0;border-right:0;}.insp[data-side='above'] .ptr{bottom:-6px;left:calc(var(--arrow) - 5px);border-top:0;border-left:0;}.insp.sheet{position:sticky;bottom:8px;width:auto;max-width:none;margin-top:8px;visibility:visible;}.insp.sheet .ptr{display:none;}@keyframes insp-in{from{opacity:0;transform:scale(0.96);}to{opacity:1;transform:none;}}.keys{grid-column:1 / -1;font-size:11px;color:var(--text-muted);visibility:hidden;}.keys span{white-space:nowrap;}:host(:focus-within) .keys{visibility:visible;}@container (max-width:560px){.foot{grid-template-columns:minmax(0,1fr);}.tools{grid-row:1;justify-self:start;flex-wrap:wrap;}.keys span{white-space:normal;}}@media not (any-pointer:fine){.keys{display:none;}}.tframe{overflow:auto;padding:0 12px 10px;background:linear-gradient(transparent,var(--well) 70%) center bottom / 100% 28px no-repeat local,radial-gradient(farthest-side at 50% 100%,color-mix(in srgb,var(--text-muted) 30%,transparent),transparent) center bottom / 100% 12px no-repeat scroll,var(--well);}table.list{width:100%;border-collapse:separate;border-spacing:0;font-size:12px;font-variant-numeric:tabular-nums;}.list th,.list td{text-align:left;vertical-align:middle;padding:6px 10px;border-bottom:1px solid var(--line);}.list .fit{width:1%;white-space:nowrap;}.list thead th{position:sticky;top:0;z-index:2;background:var(--well);color:var(--text-muted);font-weight:500;font-size:11px;white-space:nowrap;padding-top:10px;}.list tbody th{font-weight:600;}.list td{color:var(--text-2);}.list .rel>span{display:block;min-width:14ch;}.list tbody tr{cursor:pointer;}.list tbody tr:hover>*{background-color:color-mix(in srgb,var(--text-muted) 8%,transparent);}.list tbody tr.sel>*{background-color:var(--accent-bg);}.list tbody tr.sel>th{box-shadow:inset 2px 0 0 var(--accent);}.list .nm{display:inline-flex;align-items:center;gap:8px;vertical-align:middle;}.list .nm .in-ic{margin-right:-2px;}.list .name{max-width:32ch;}.loopchip{display:inline-flex;align-items:center;gap:4px;font-family:var(--sans);font-weight:400;}.loopchip .ic{color:var(--text-muted);}.list .st .n{color:var(--text);}`,wo=ei(class extends ti{constructor(){super(...arguments),this.key=j}render(e,t){return this.key=e,t}update(e,[t,n]){return t!==this.key&&(Ci(e),this.key=t),n}}),To=(e,t)=>[...e.marks.map((e,n)=>e?{m:e,series:t[n]??``}:null),...e.loose.map(e=>({m:e,series:``}))];function Eo(e,t){let n=e.marks.length+e.loose.length,r=function(e){return e<=12?{cols:Math.max(1,e),size:12}:e<=100?{cols:10,size:10}:{cols:20,size:6}}(e.marks.length?t:n);return{cols:Math.min(r.cols,Math.max(1,n)),size:r.size,gap:r.size>=10?4:2}}function Do(e){return Math.max(0,e.findIndex(e=>e!==null))}var Oo={failed:`err`,attention:`warn`,running:`live`,muted:`mut`};function ko(e,t,n){let r=e.lay?.at[t];if(!r)return`left:0;top:0`;let i=n?n.x+1:0,a=n?n.y+1:0;return`left:${r.x-i}px;top:${r.y-a}px`}function Ao(e,t,n){t.target.closest(`.mark, .taskchip, .node, .cluster`)===t.currentTarget&&(t.stopPropagation(),t.detail>=2||e.select(n))}function jo(e,t,n){t.target.closest(`.mark, .taskchip, .node, .cluster`)===t.currentTarget&&(t.stopPropagation(),e.act(n))}function Mo(e,t,n){t.key===`Enter`&&(t.preventDefault(),e.act(n))}function No(e,t,n,r){let i=r?e.words.close:e.words.open;return k`<button type="button" class="tog" part="toggle" aria-expanded=${r} aria-label=${`${i}: ${n}`} title=${i} @click=${n=>{n.stopPropagation(),e.toggle(t,!r)}} @dblclick=${e=>e.stopPropagation()}>${(e=>k`<svg class="ic tog-ic" width="12" height="12" viewBox="0 0 12 12" aria-hidden="true" focusable="false">
|
|
188
|
+
</svg>`,So={graph:`Graph`,table:`Table`,view:`View`,zoomIn:`Zoom in`,zoomInTip:`Zoom in (Ctrl + scroll)`,zoomOut:`Zoom out`,zoomOutTip:`Zoom out (Ctrl + scroll)`,showAll:`Show all`,graphKeys:[`Tab: next node`,`Arrow keys: marks`,`Shift + arrow keys: earlier and later nodes`,`Enter: open`],tableKeys:[`Tab: next row`,`Enter: open`],matrixKeys:[`Arrow keys: marks`,`Enter: open`],clearKey:`Esc: clear selection`,upKey:``,inspector:`Selected item`,stubTip:`Outside this graph`,more:e=>`+${e}`,progress:(e,t)=>`${e} of ${t} done`,badge:`count`,solidEdge:`link`,dottedEdge:`second link`,dashedEdge:`other link`,cycle:`next round`,drill:`has an inner view`,open:`Show inside`,close:`Hide inside`,iconNames:{},nameHeader:`Name`,statusHeader:`Status`,solidHeader:`Earlier`,dottedHeader:`Dotted link from`,dashedHeader:`Dashed link from`,laterHeader:`Later`,none:`none`,inCluster:e=>`${e} in the cluster`,list:e=>new Intl.ListFormat(`en`,{type:`conjunction`}).format(e)},Co=k` :host{display:block;container-type:inline-size;}.col,.main{display:flex;flex-direction:column;}.col{height:100%;}.main{flex:auto;min-height:0;}.frame{flex:auto;position:relative;overflow:hidden;border-radius:8px;background:var(--well);box-sizing:border-box;}.gframe{cursor:grab;touch-action:none;}.gframe.drag{cursor:grabbing;}.stage{position:absolute;left:0;top:0;transform-origin:0 0;}.gframe.down{touch-action:pan-y pinch-zoom;}.view{animation:view-in 0.1s var(--ease) both;}@keyframes view-in{from{opacity:0;}}@media (prefers-reduced-motion:reduce){.view{animation:none;}}.tools{display:flex;align-items:center;gap:4px;justify-self:end;}.tools button{all:unset;cursor:pointer;min-width:22px;height:22px;padding:0 7px;box-sizing:border-box;text-align:center;font-size:11.5px;line-height:22px;color:var(--text-2);border-radius:6px;border:1px solid var(--line);}.tools button:hover:not(:disabled){color:var(--text);border-color:var(--line2);}.tools button:focus-visible,.loopchip:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;}.tools button:disabled{cursor:default;opacity:0.4;}.views{margin-left:6px;}.dag{position:relative;}.dag.unplaced{visibility:hidden;}.dag>*,.cluster>.in>*{position:absolute;}.edges{left:0;top:0;pointer-events:none;overflow:visible;z-index:0;}.edges path{fill:none;stroke:var(--line2);stroke-width:1.5;}.edges path.dashed{stroke-dasharray:5 4;}.edges path.dotted,.legend svg path.dotted{stroke-dasharray:0.1 4;stroke-linecap:round;stroke-width:2;}.edges path.ret,.legend svg path.ret{stroke:var(--text-2);stroke-width:2;stroke-dasharray:0.1 4;stroke-linecap:round;opacity:0.8;}.edges path.ret-tip,.legend svg path.ret-head{fill:var(--text-2);stroke:none;opacity:0.8;}.ic{display:block;flex:none;}.loop-ic{color:var(--text-2);}.in-ic{color:var(--text-muted);}.stub{z-index:1;font-family:var(--mono);font-size:11.5px;color:var(--text-muted);padding:3px 9px;border-radius:999px;border:1px solid var(--line);background:var(--card);white-space:nowrap;}.cluster{z-index:1;box-sizing:border-box;border-radius:14px;border:1px solid var(--line2);background:color-mix(in srgb,var(--text-muted) 5%,transparent);}.cluster .cluster{background:color-mix(in srgb,var(--text-muted) 6%,transparent);}.cluster>.in{position:absolute;inset:0;pointer-events:none;}.cluster>.in>*{pointer-events:auto;}.cluster>.hd{position:absolute;left:11px;top:6px;display:flex;flex-direction:column;align-items:flex-start;gap:1px;white-space:nowrap;padding-right:22px;cursor:pointer;}.cluster>.hd .line{display:flex;align-items:center;gap:8px;}.cluster>.hd .name{display:inline-flex;align-items:center;gap:5px;}.cluster.sel{outline:var(--focus-width) solid var(--accent);outline-offset:2px;}.cluster>.hd .spread{font-size:11px;color:var(--text-2);font-variant-numeric:tabular-nums;}.node{z-index:1;width:max-content;min-width:120px;box-sizing:border-box;display:flex;flex-direction:column;gap:7px;padding:8px 10px 9px;border-radius:10px;border:1px solid var(--line);background:var(--card);transition:border-color 0.3s,box-shadow 0.3s;cursor:pointer;box-shadow:var(--ex,0 0 0 0 transparent);}.node.accent{--ex:inset 3px 0 0 -1px color-mix(in srgb,var(--agent) 60%,transparent);}.node .nm{display:flex;align-items:center;min-width:0;gap:0;}.node .right{display:flex;align-items:center;gap:8px;}.node .right>.tog{margin-inline-end:0;}.cue{display:block;line-height:0;}.cluster>.cue{position:absolute;top:9px;right:10px;padding:2px;margin:-2px;}.tog{all:unset;cursor:pointer;display:inline-flex;line-height:0;padding:2px;margin:-2px;border-radius:4px;color:var(--text-2);}.tog:hover{color:var(--text);background:var(--raise);}.tog:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:1px;}.cluster>.hd .psep{color:var(--text-muted);font-size:11px;}.cluster>.hd .part{all:unset;cursor:pointer;font-family:var(--mono);font-weight:600;font-size:12.5px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px;}.cluster>.hd .part:hover{color:var(--text);text-decoration:underline;}.cluster>.hd .part:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:2px;border-radius:3px;}.node.sel{outline:var(--focus-width) solid var(--accent);outline-offset:2px;}.node.drill{box-shadow:4px 4px 0 -1px var(--card),4px 4px 0 0 var(--line2);}.node[data-look='running']{border-color:var(--status-running);}.node.drill[data-look='running']{box-shadow:4px 4px 0 -1px var(--card),4px 4px 0 0 var(--status-running),0 0 14px var(--status-running-bg);}.node:not(.drill)[data-look='running']{box-shadow:var(--ex,0 0 0 0 transparent),0 0 14px var(--status-running-bg);}.node[data-look='failed']{border-color:color-mix(in srgb,var(--status-failed) 55%,transparent);}.node:focus-within{border-color:var(--text-2);}.hd{display:flex;align-items:center;justify-content:space-between;gap:12px;}.name{all:unset;cursor:pointer;font-family:var(--mono);font-weight:600;font-size:12.5px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px;}.name:hover{text-decoration:underline;}.name:focus-visible{outline:var(--focus-width) solid var(--focus);outline-offset:2px;border-radius:3px;}.count{font-size:11px;color:var(--text-muted);font-variant-numeric:tabular-nums;white-space:nowrap;}.ex{display:flex;flex-wrap:wrap;gap:0 10px;font-size:11px;line-height:1.5;contain:inline-size;}:is(.ex,.st) .err{color:var(--status-failed);}:is(.ex,.st) .warn{color:var(--status-attention);}:is(.ex,.st) .live{color:var(--status-running);}:is(.ex,.st) .mut{color:var(--text-muted);}.marks{display:grid;grid-template-columns:repeat(var(--cols),var(--m));gap:var(--g);}.slot{width:var(--m);height:var(--m);}.expected{display:inline-block;align-self:flex-start;width:max-content;margin-top:6px;padding:0 7px;border:1.5px dotted var(--line2);border-radius:999px;font-size:11px;line-height:18px;color:var(--text-muted);}.taskchip.sel{outline:var(--focus-width) solid var(--accent);outline-offset:1px;}.hl .mark:not(.on){opacity:0.16;}.hl .mark.on{transform:scale(1.2);}.hl .mark.on[data-link]{outline:1.5px solid var(--text-2);outline-offset:2px;}.hl .mark.on[data-link='dotted']{outline-style:dotted;}.hl .mark.on[data-link='dashed']{outline-style:dashed;}@media (prefers-reduced-motion:reduce){.node{transition:none;}}.sbar{display:flex;width:220px;height:10px;border-radius:3px;overflow:hidden;background:var(--track);gap:1px;}.sbar i{display:block;min-width:2px;height:100%;background:var(--tone,var(--line2));}.sbar i:not([data-tone]){--tone:initial;}.sbar i[data-tone='done']{opacity:0.85;}.sbar i[data-tone='muted']{opacity:0.5;}.sbar i[data-shape='hatched']{background:repeating-linear-gradient(135deg,var(--tone-bg) 0 2px,color-mix(in srgb,var(--tone) 60%,transparent) 2px 3px);}.sbar i[data-shape='half']{background:linear-gradient(0deg,var(--tone) 50%,var(--tone-bg) 50%);}.fails{display:flex;flex-wrap:wrap;align-items:center;gap:4px;max-width:220px;font-size:11px;color:var(--text-muted);}.fails .taskchip{color:var(--status-failed);border-color:color-mix(in srgb,var(--status-failed) 45%,transparent);}.fails .taskchip:focus-visible{outline:var(--focus-width) solid var(--text);outline-offset:1px;}.hl .fails .taskchip:not(.on){opacity:0.4;}.mxframe{display:grid;grid-template-columns:minmax(0,1fr);place-items:center;padding:14px 16px;}.foot{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:6px 14px;margin-top:6px;}.legend{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:11px;color:var(--text-muted);}.legend span{display:inline-flex;align-items:center;gap:6px;}.legend .mark{--m:12px;cursor:default;animation:none;}.legend .mark:hover{transform:none;outline:none;}.legend i.mark{border-radius:3px;}.legend i.mark:is([data-shape='square'],[data-shape='hatched']){border-radius:2px;}.legend i.mark[data-shape='hatched']{background:repeating-linear-gradient(135deg,transparent 0 2px,color-mix(in srgb,var(--tone) 55%,transparent) 2px 3px);}.legend i.mark[data-shape='half']{border-radius:50%;}.legend svg path{stroke:var(--line2);stroke-width:1.5;fill:none;}.main{position:relative;min-width:0;}.sep{color:var(--text-muted);}.insp{position:absolute;left:0;top:0;z-index:6;width:272px;max-width:calc(100% - 16px);box-sizing:border-box;display:flex;flex-direction:column;gap:9px;padding:10px 12px 12px;border-radius:10px;border:1px solid var(--accent);background:var(--card);font-size:12px;overflow:visible;box-shadow:0 12px 32px color-mix(in srgb,var(--shadow) 55%,transparent);visibility:hidden;animation:insp-in 0.12s var(--ease) both;}.insp.placed{visibility:visible;}.insp .scroll{display:flex;flex-direction:column;gap:9px;min-height:0;overflow:auto;}.insp .ptr{position:absolute;width:10px;height:10px;background:var(--card);border:1px solid var(--accent);transform:rotate(45deg);}.insp[data-side='right'] .ptr{left:-6px;top:calc(var(--arrow) - 5px);border-top:0;border-right:0;}.insp[data-side='left'] .ptr{right:-6px;top:calc(var(--arrow) - 5px);border-bottom:0;border-left:0;}.insp[data-side='below'] .ptr{top:-6px;left:calc(var(--arrow) - 5px);border-bottom:0;border-right:0;}.insp[data-side='above'] .ptr{bottom:-6px;left:calc(var(--arrow) - 5px);border-top:0;border-left:0;}.insp.sheet{position:sticky;bottom:8px;width:auto;max-width:none;margin-top:8px;visibility:visible;}.insp.sheet .ptr{display:none;}@keyframes insp-in{from{opacity:0;transform:scale(0.96);}to{opacity:1;transform:none;}}.keys{grid-column:1 / -1;font-size:11px;color:var(--text-muted);visibility:hidden;}.keys span{white-space:nowrap;}:host(:focus-within) .keys{visibility:visible;}@container (max-width:560px){.foot{grid-template-columns:minmax(0,1fr);}.tools{grid-row:1;justify-self:start;flex-wrap:wrap;}.keys span{white-space:normal;}}@media not (any-pointer:fine){.keys{display:none;}}.tframe{overflow:auto;padding:0 12px 10px;background:linear-gradient(transparent,var(--well) 70%) center bottom / 100% 28px no-repeat local,radial-gradient(farthest-side at 50% 100%,color-mix(in srgb,var(--text-muted) 30%,transparent),transparent) center bottom / 100% 12px no-repeat scroll,var(--well);}table.list{width:100%;border-collapse:separate;border-spacing:0;font-size:12px;font-variant-numeric:tabular-nums;}.list th,.list td{text-align:left;vertical-align:middle;padding:6px 10px;border-bottom:1px solid var(--line);}.list .fit{width:1%;white-space:nowrap;}.list thead th{position:sticky;top:0;z-index:2;background:var(--well);color:var(--text-muted);font-weight:500;font-size:11px;white-space:nowrap;padding-top:10px;}.list tbody th{font-weight:600;}.list td{color:var(--text-2);}.list .rel>span{display:block;min-width:14ch;}.list tbody tr{cursor:pointer;}.list tbody tr:hover>*{background-color:color-mix(in srgb,var(--text-muted) 8%,transparent);}.list tbody tr.sel>*{background-color:var(--accent-bg);}.list tbody tr.sel>th{box-shadow:inset 2px 0 0 var(--accent);}.list .nm{display:inline-flex;align-items:center;gap:8px;vertical-align:middle;}.list .nm .in-ic{margin-right:-2px;}.list .name{max-width:32ch;}.loopchip{display:inline-flex;align-items:center;gap:4px;font-family:var(--sans);font-weight:400;}.loopchip .ic{color:var(--text-muted);}.list .st .n{color:var(--text);}`,wo=ei(class extends ti{constructor(){super(...arguments),this.key=M}render(e,t){return this.key=e,t}update(e,[t,n]){return t!==this.key&&(Ci(e),this.key=t),n}}),To=(e,t)=>[...e.marks.map((e,n)=>e?{m:e,series:t[n]??``}:null),...e.loose.map(e=>({m:e,series:``}))];function Eo(e,t){let n=e.marks.length+e.loose.length,r=function(e){return e<=12?{cols:Math.max(1,e),size:12}:e<=100?{cols:10,size:10}:{cols:20,size:6}}(e.marks.length?t:n);return{cols:Math.min(r.cols,Math.max(1,n)),size:r.size,gap:r.size>=10?4:2}}function Do(e){return Math.max(0,e.findIndex(e=>e!==null))}var Oo={failed:`err`,attention:`warn`,running:`live`,muted:`mut`};function ko(e,t,n){let r=e.lay?.at[t];if(!r)return`left:0;top:0`;let i=n?n.x+1:0,a=n?n.y+1:0;return`left:${r.x-i}px;top:${r.y-a}px`}function Ao(e,t,n){t.target.closest(`.mark, .taskchip, .node, .cluster`)===t.currentTarget&&(t.stopPropagation(),t.detail>=2||e.select(n))}function jo(e,t,n){t.target.closest(`.mark, .taskchip, .node, .cluster`)===t.currentTarget&&(t.stopPropagation(),e.act(n))}function Mo(e,t,n){t.key===`Enter`&&(t.preventDefault(),e.act(n))}function No(e,t,n,r){let i=r?e.words.close:e.words.open;return A`<button type="button" class="tog" part="toggle" aria-expanded=${r} aria-label=${`${i}: ${n}`} title=${i} @click=${n=>{n.stopPropagation(),e.toggle(t,!r)}} @dblclick=${e=>e.stopPropagation()}>${(e=>A`<svg class="ic tog-ic" width="12" height="12" viewBox="0 0 12 12" aria-hidden="true" focusable="false">
|
|
189
189
|
<rect x="0.7" y="0.7" width="10.6" height="10.6" rx="2.2" fill="none" stroke="currentColor" stroke-width="1.2"></rect>
|
|
190
190
|
<path d=${e?`M3.5,6 H8.5`:`M3.5,6 H8.5 M6,3.5 V8.5`} fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"></path>
|
|
191
|
-
</svg>`)(r)}</button>`}var Po=(e,t=`span`)=>(e.notes??[]).map(e=>t===`span`?k`<span class=${Oo[e.tone??`neutral`]??``}>${e.text}</span>`:k`<div class=${Oo[e.tone??`neutral`]??``}>${e.text}</div>`);function Fo(e,t,n,r,i,a=!1){let{m:o}=n,{key:s,on:c}=e.lit(),l=(e=>e.series||e.m.id)(n),u=c!==null&&(n.series!==``&&n.series===s||c.has(o.id)),d=e.selected===o.id?`sel`:``,f=n=>{e.hover=l,e.active.set(t.id,r),e.pz.reveal(n.currentTarget),e.focusSelect(o.id)};if(a)return k`<button type="button" class="taskchip ${u?`on`:``} ${d}" part="mark" data-i=${r} tabindex=${i?0:-1} title=${o.tip??j} aria-label=${o.label} aria-pressed=${!!d} @mouseenter=${()=>e.hover=l} @focus=${f} @blur=${()=>e.hover=null} @click=${()=>e.select(o.id)} @dblclick=${()=>e.act(o.id)}>${o.name??(n.series||o.id)}</button>`;let p=e.states[o.state];return k`<button type="button" class="mark ${u?`on`:``} ${d}" part="mark" data-tone=${L(p?.tone)} data-shape=${p?.shape??j} data-i=${r} data-n=${o.badge??j} tabindex=${i?0:-1} title=${o.tip??j} aria-label=${o.label} aria-pressed=${!!d} @mouseenter=${()=>e.hover=l} @focus=${f} @blur=${()=>e.hover=null} @click=${()=>e.select(o.id)} @dblclick=${()=>e.act(o.id)}></button>`}function Io(e,t,n){let r=t.target;if(!r.classList.contains(`mark`)&&!r.classList.contains(`taskchip`))return;if(t.shiftKey&&t.key.startsWith(`Arrow`))return function(e,t,n){let r=t.key===`ArrowRight`||t.key===`ArrowDown`?`later`:`earlier`,i=e.lay,a=function(e,t,n,r){let i=new Map(e.drawn.map((e,t)=>[e,t])),a=[...new Set(e.edges.filter((r,i)=>!e.back[i]&&(n===`later`?r.from===t:r.to===t)).map(e=>n===`later`?e.to:e.from))],o=r(t);return a.sort((e,t)=>Math.abs(r(e)-o)-Math.abs(r(t)-o)||(i.get(e)??0)-(i.get(t)??0)),a[0]??null}({drawn:e.arr.drawn,edges:e.drawn.edges,back:e.arr.back},n.id,r,e=>{let t=i?.at[e];return t?i?.down?t.x+t.w/2:t.y+t.h/2:0});if(t.preventDefault(),!a)return;let o=e.nodes.get(a);if(!o)return;let s=n.slots[e.active.get(n.id)??Do(n.slots)]?.series??``,c=To(o,e.drawn.series),l=ho(o,e.barAt)?c.filter(t=>!!t&&e.states[t.m.state]?.tone===`failed`):c,u=s?l.findIndex(e=>e?.series===s):-1,d=u>=0?u:e.active.get(o.id)??Do(l);e.active.set(o.id,d),e.requestUpdate(),e.updateComplete.then(()=>{let t=e.renderRoot.querySelector(`.node[data-id="${CSS.escape(a)}"]`);(t?.querySelector(`[data-i="${d}"]`)??t?.querySelector(`.name`))?.focus()})}(e,t,n);let{slots:i}=n;if(t.key===`Enter`){let n=i[Number(r.dataset.i)];t.preventDefault(),n&&e.act(n.m.id);return}let a=e.active.get(n.id)??Do(i),o={ArrowRight:1,ArrowLeft:-1,ArrowDown:n.grid.cols,ArrowUp:-n.grid.cols},s;if(t.key===`Home`)s=Do(i);else if(t.key===`End`)s=i.length-1-[...i].reverse().findIndex(e=>e!==null);else{if(o[t.key]===void 0)return;{let e=o[t.key];for(s=a+e;s>=0&&s<i.length&&!i[s];)s+=Math.sign(e);if(s<0||s>=i.length)return}}t.preventDefault(),e.active.set(n.id,s),e.requestUpdate();let c=t.currentTarget;e.updateComplete.then(()=>c.querySelector(`[data-i="${s}"]`)?.focus())}var Lo=(e,t,n)=>{let r=e.states[t];return k`<i class="mark" data-tone=${L(r?.tone)} data-shape=${r?.shape??j} data-n=${n??j}></i>`},Ro={series:[],nodes:[],clusters:[],edges:[],stubs:[]},zo=class extends M{constructor(...e){super(...e),this.graph=Ro,this.states={},this.selected=null,this.highlight=null,this.order=void 0,this.key=``,this.direction=`auto`,this.view=`graph`,this.matrix=null,this.barAt=200,this.related=void 0,this.strings={},this.matrixStrings={},this.renderIcon=e=>pi(e),this.iconStyles=[],this.hover=null,this.down=!1,this.lay=null,this.announced=``,this.arr=lo(Ro),this.words=So,this.drawn={...Ro,nodes:[]},this.nodes=new Map,this.clusters=new Map,this.markSeries=new Map,this.active=new Map,this.measured=null,this.layKey=``,this.layFor=null,this.litCache=null,this.scrolled=null,this.pz=new vo(this,{frame:()=>this.renderRoot.querySelector(`.frame`),stage:()=>this.renderRoot.querySelector(`.stage`),drawing:()=>this.lay&&!this.matrix?{w:this.lay.w,h:this.lay.h,down:this.down,room:this.card.room}:null,wheel:()=>this.view!==`table`&&!this.matrix,down:()=>this.down,onMove:()=>this.card.place(),onResize:()=>{this.fit(),this.card.place()}}),this.card=new yo(this,{docked:()=>this.down,frameH:()=>this.pz.frameH,grow:()=>this.matrix?this.requestUpdate():this.fit(),pressed:()=>this.pz.pressed,inner:()=>this.matrixEl()?.renderRoot??null}),this.h=this,this.onEscape=e=>{e.key===`Escape`&&!e.defaultPrevented&&this.selected&&(e.preventDefault(),this.select(null))}}static{this.styles=[V,Jr,oi,Co]}static{this.properties={graph:{attribute:!1},states:{attribute:!1},selected:{attribute:!1},highlight:{attribute:!1},order:{attribute:!1},key:{},direction:{},view:{},matrix:{attribute:!1},barAt:{type:Number},related:{attribute:!1},strings:{attribute:!1},matrixStrings:{attribute:!1},renderIcon:{attribute:!1},iconStyles:{attribute:!1},hover:{state:!0},down:{state:!0},lay:{state:!0},announced:{state:!0}}}matrixEl(){return this.renderRoot.querySelector(`cae-mark-matrix`)}willUpdate(e){if(e.has(`key`)&&e.get(`key`)!==void 0&&(this.pz.reset(),this.active.clear()),e.has(`strings`)&&(this.words=Ar(So,this.strings)),e.has(`direction`)&&this.direction!==`auto`&&(this.down=this.direction===`down`),(e.has(`graph`)||e.has(`order`)||e.has(`down`)||e.has(`direction`))&&(this.arr=lo(this.graph,this.order,this.down),this.clusters=new Map(this.graph.clusters.map(e=>[e.id,e]))),e.has(`graph`)||e.has(`states`)||e.has(`strings`)){let e=this.graph;this.drawn={...e,nodes:e.nodes.map(e=>function(e,t,n){let{marks:r=[],loose:i=[]}=e,a={},o=0,s=0;for(let e of[...r,...i])e&&(a[e.state]=(a[e.state]??0)+1,s++,t[e.state]?.tone===`done`&&o++);return{...e,marks:r,loose:i,counts:e.counts??a,progress:e.progress??{done:o,total:s,label:n(o,s)}}}(e,this.states,this.words.progress))},this.nodes=new Map(this.drawn.nodes.map(e=>[e.id,e])),this.markSeries=new Map(this.drawn.nodes.flatMap(t=>To(t,e.series).flatMap(e=>e?[[e.m.id,e.series]]:[])))}}connectedCallback(){super.connectedCallback(),this.addEventListener(`keydown`,this.onEscape)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`keydown`,this.onEscape)}updated(e){e.has(`iconStyles`)&&this.renderRoot instanceof ShadowRoot&&mt(this.renderRoot,[...this.constructor.elementStyles,...this.iconStyles]);let t=this.matrixEl();t&&t!==this.scrolled&&(this.scrolled=t,t.renderRoot.addEventListener(`scroll`,()=>this.card.place(),{capture:!0})),this.place(),this.card.place(),e.has(`selected`)&&this.selectionChanged()}focusToggle(e,t=4){let n=this.renderRoot;if(n.querySelector(`.dag.unplaced`)&&t>0)return void this.updateComplete.then(()=>requestAnimationFrame(()=>this.focusToggle(e,t-1)));let r=this.clusters.has(e)?`.cluster[data-cluster="${CSS.escape(e)}"] > .cue .tog`:`.node[data-id="${CSS.escape(e)}"] .tog`,i=n.querySelector(r);i?this.card.focusQuietly(i):this.focusItem(e)}focusItem(e){let t=this.renderRoot,n=null;e&&this.clusters.has(e)?n=t.querySelector(`.cluster[data-cluster="${CSS.escape(e)}"] > .hd .name`):e&&(n=t.querySelector(`.node[data-id="${CSS.escape(e)}"] [tabindex="0"]`));let r=t.querySelector(`slot[name="crumbs"]`)?.assignedElements({flatten:!0})??[];this.card.focusQuietly(n??r.map(e=>e.matches(`button`)?e:e.querySelector(`button`)).find(Boolean)??t.querySelector(`.mark[tabindex="0"], .node .name`)??this.matrixEl()?.renderRoot.querySelector(`.mark[tabindex="0"]`)??null)}selectionChanged(){let[e,t]=this.card.describe(),n=e?[e,t].filter(Boolean).join(` | `):``;n!==this.announced&&(this.announced=n),this.down&&this.card.whenReleased(()=>this.card.revealOverSheet())}place(){let e=this.renderRoot.querySelector(`.dag`);if(!e)return;let t=this.graph,n=`${this.down}|${this.clientWidth}`;if(this.measured?.graph===t&&this.measured.key===n)return this.fit();this.measured={graph:t,key:n};let r=new Map;for(let t of e.querySelectorAll(`[data-id]`))r.set(t.dataset.id??``,{w:t.offsetWidth,h:t.offsetHeight});let i=this.arr,a=JSON.stringify([this.key,i.slots,i.edgePaths.map(e=>e.steps.map(e=>e.id)),this.down,[...r]]);if(a===this.layKey)return this.fit();this.layKey=a,this.layFor=this.key,this.lay=function(e,t,n=!1){let r=fo[n?`down`:`across`],i=e=>n?e.h:e.w,a=e=>n?e.w:e.h,o=new Set(e.clusters.map(e=>e.id)),s=new Map(e.clusters.map(e=>[e.id,e.parent])),c=e=>t.get(`lbl:${e}`)??{w:0,h:0},l=e=>n?{u0:c(e).h+r.pad+r.gap/2,u1:r.pad,v0:r.pad,v1:r.padEnd,minU:0,minV:c(e).w+2*r.pad}:{u0:r.pad,u1:r.pad,v0:c(e).h+r.pad,v1:r.padEnd,minU:c(e).w+2*r.pad,minV:0},u=new Map,d=e=>{if(o.has(e))return u.get(e)??{u:0,v:0};if(oo(e))return{u:0,v:0};let n=t.get(e)??{w:0,h:0};return{u:i(n),v:a(n)}},f=new Map,p=new Map,m=e=>e===``?0:1+m(s.get(e)??``),h=[``,...e.clusters.map(e=>e.id)].sort((e,t)=>m(t)-m(e)),g=(t,n)=>{let r=e.edgePaths[t]?.steps??[],i=r[n];if(oo(i.id))return 0;if(!o.has(i.id))return d(i.id).v/2;let a=r[n-1]?.in===i.id?n-1:n+1,s=r[a];return l(i.id).v0+(f.get(i.id)?.top.get(s.id)??0)+g(t,a)};for(let t of h){let n=(e.slots[t]??[]).map(e=>[...e]);p.set(t,new Map(n.flatMap((e,t)=>e.map(e=>[e,t]))));let i=n.map(e=>Math.max(0,...e.map(e=>d(e).u))),a=t===``?r.gap:r.boxGap,s=[];i.forEach((e,t)=>s.push(t?s[t-1]+i[t-1]+a:0));let c=[];e.edgePaths.forEach((e,n)=>e.steps.forEach((r,i)=>{let a=e.steps[i-1];i&&a&&a.in===t&&r.in===t&&p.get(t)?.get(a.id)!==p.get(t)?.get(r.id)&&c.push({a:a.id,b:r.id,oa:g(n,i-1),ob:g(n,i)})}));let m=(e,t)=>t===void 0?0:o.has(e)||o.has(t)||!oo(e)&&!oo(t)?r.sep:r.pointSep,h=new Map;for(let e of n){let t=0;e.forEach((n,r)=>{h.set(n,t),t+=d(n).v+m(n,e[r+1])})}let _=(e,t)=>{let n=e.map(e=>{let n=t(e);return n.length?n.reduce((e,t)=>e+t,0)/n.length:h.get(e)??0}),r=e.map((t,n)=>d(t).v+m(t,e[n+1])),i=e.map((e,t)=>oo(e)?-1:t).filter(e=>e>=0),a=po(i.map(e=>n[e]),i.map((e,t)=>t+1<i.length?((e,t)=>r.slice(e,t).reduce((e,t)=>e+t,0))(e,i[t+1]):0),i.map(()=>1));i.forEach((e,t)=>n[e]=a[t]),po(n,r,e.map(e=>oo(e)?1:1e6)).forEach((t,n)=>h.set(e[n],Math.round(100*t)/100))},v=(e,t)=>{let n=oo(e)?t:t.filter(e=>!oo(e.other));return(n.length?n:t).map(e=>e.at)},y=e=>v(e,c.filter(t=>t.b===e).map(e=>({other:e.a,at:(h.get(e.a)??0)+e.oa-e.ob}))),b=e=>v(e,c.filter(t=>t.a===e).map(e=>({other:e.b,at:(h.get(e.b)??0)+e.ob-e.oa})));for(let e=0;e<8;e++){let t=n.map((e,t)=>t);e%2&&t.reverse();for(let r of t)_(n[r],e%2?b:y)}for(let e of n)_(e,e=>[...y(e),...b(e)]);let x=h.size?Math.min(...h.values()):0;for(let[e,t]of h)h.set(e,t-x);let S=(s[s.length-1]??0)+(i[i.length-1]??0),ee=Math.max(0,...n.flat().map(e=>(h.get(e)??0)+d(e).v));if(f.set(t,{rows:n,start:s,width:i,top:h,u:S,v:ee}),t!==``){let e=l(t);u.set(t,{u:Math.max(e.u0+S+e.u1,e.minU),v:Math.max(e.v0+ee+e.v1,e.minV)})}}let _={},v=new Map,y=(e,t,r)=>{v.set(e,{u:t,v:r});let i=f.get(e);i.rows.forEach((e,a)=>e.forEach(e=>{if(oo(e))return;let s=t+i.start[a],c=r+(i.top.get(e)??0);if(_[e]=((e,t,r)=>n?{x:t,y:e,w:r.v,h:r.u}:{x:e,y:t,w:r.u,h:r.v})(s,c,d(e)),o.has(e)){let t=l(e);y(e,s+t.u0,c+t.v0)}}))};y(``,r.margin,r.margin);let b=f.get(``),x=b.u+2*r.margin,S=b.v+2*r.margin,ee=(e,t)=>{let n=f.get(e),r=(v.get(e)??{u:0,v:0}).u+(n.start[t]??0);return[r,r+(n.width[t]??0)]},te=(e,t)=>p.get(e)?.get(t)??0,ne=e=>e&&oo(e.id)?/\|by:([^|]*)\|/.exec(e.id)?.[1]??``:``,re=e.edgePaths.map((e,t)=>{let i=n=>{let r=e.steps[n];return(v.get(r.in)??{u:0,v:0}).v+(f.get(r.in)?.top.get(r.id)??0)+g(t,n)},a=e.steps.map((t,a)=>{let o=e.steps[a-1],s=e.steps[a+1],[u,p]=ee(t.in,te(t.in,t.id)),m=i(a);if(a===0)return{a:u+d(t.id).u,b:p,at:m};if(a===e.steps.length-1)return{a:u,b:u,at:m};if(oo(t.id)){let i=ne(t);if(i&&o?.id===i)return{a:ee(i,te(i,e.steps[a-2]?.id??``)+1)[0],b:p,at:m};if(i&&s?.id===i){let t=te(i,e.steps[a+2]?.id??``);return{a:u,b:t>0?ee(i,t-1)[1]:(_[i]?n?_[i].y:_[i].x:u)+c(i).h+r.pad,at:m}}return{a:u,b:p,at:m}}let h=l(t.id),g=f.get(t.id);if(o?.in===t.id){if(ne(s)===t.id){let e=ee(t.id,te(t.id,o.id)+1)[0];return{a:e,b:e,at:i(a+1)}}return{a:u+h.u0+g.u,b:p,at:m}}if(ne(o)===t.id){let e=ee(t.id,te(t.id,s?.id??``))[0];return{a:e,b:e,at:i(a+1)}}return{a:u,b:u+h.u0,at:m}});return{from:e.from,to:e.to,style:e.style,runs:a}}),ie=e.clusters.flatMap(e=>{if(!e.cycle)return[];let t=f.get(e.id),n=v.get(e.id);if(!t||!n)return[];let r=e=>{let n=(e??[]).filter(e=>!oo(e)),r=null;for(let e of n){let n=d(e),i=(t.top.get(e)??0)+n.v;(!r||i>r.v)&&(r={u:n.u,v:i})}return r},i=t.rows.map((e,t)=>e.some(e=>!oo(e))?t:-1).filter(e=>e>=0),a=i[0]??0,o=i[i.length-1]??0,s=r(t.rows[o]),c=r(t.rows[a]);if(!s||!c)return[];let l=n.u+(t.start[o]??0)+(t.width[o]??0)/2,u=n.u+(t.start[a]??0)+(t.width[a]??0)/2;if(l-u<24){let e=Math.max(12,Math.min(28,Math.min(s.u,c.u)/4));l=(l+u)/2+e,u=l-2*e}return[{box:e.id,from:l,v0:n.v+s.v,to:u,v1:n.v+c.v,band:n.v+t.v+12}]});return{w:n?S:x,h:n?x:S,at:_,edges:re,returns:ie,down:n}}(i,r,this.down),this.updateComplete.then(()=>this.fit())}fit(){if(this.direction===`auto`){let e=this.clientWidth,t=e>0&&e<640;t!==this.down&&(this.down=t)}this.pz.fit()}select(e){e!==this.selected&&R(this,`cae-select`,{id:e})}act(e){let t=this.nodes.get(e)??this.clusters.get(e)??this.findMark(e);t?.drill?this.drill(e):t&&R(this,`cae-activate`,{id:e})}findMark(e){for(let t of this.drawn.nodes)for(let n of[...t.marks,...t.loose])if(n?.id===e)return n;for(let t of this.matrix?.rows??[])for(let n of t.cells)if(n?.id===e)return n;return null}lit(){let e=this.selected,t=this.hover===null&&e!==null&&this.markSeries.has(e)?this.markSeries.get(e)||e:null,n=this.hover??t??this.highlight??null,r=this.litCache;if(r&&r.key===n&&r.graph===this.graph&&r.related===this.related)return r;let i=n===null?null:(this.related??(e=>new Set([e])))(n);return this.litCache={key:n,graph:this.graph,related:this.related,on:i},this.litCache}known(e){return this.nodes.has(e)||this.clusters.has(e)||!!this.findMark(e)}render(){let e=this.h,t=this.matrix,n=t?this.matrixView(t):this.view===`table`?function(e){let t=e.drawn,n=e.words,r=[...t.edges,...t.stubs].some(e=>e.style===`dashed`),i=e=>n.list(e)||n.none,a=!e.down&&e.laidOut&&e.pz.frameH>0?`height:${Math.round(e.pz.frameH)}px`:`max-height:max(360px, 70vh)`,o=e.arr.drawn.map(t=>e.nodes.get(t)).filter(e=>!!e);return k`<div class="frame tframe" part="frame" data-scroll="x" style=${a} @scroll=${()=>e.card.place()} @click=${t=>!t.target.closest(`tbody tr`)&&e.select(null)}>
|
|
191
|
+
</svg>`)(r)}</button>`}var Po=(e,t=`span`)=>(e.notes??[]).map(e=>t===`span`?A`<span class=${Oo[e.tone??`neutral`]??``}>${e.text}</span>`:A`<div class=${Oo[e.tone??`neutral`]??``}>${e.text}</div>`);function Fo(e,t,n,r,i,a=!1){let{m:o}=n,{key:s,on:c}=e.lit(),l=(e=>e.series||e.m.id)(n),u=c!==null&&(n.series!==``&&n.series===s||c.has(o.id)),d=u&&c!==null&&`get`in c?c.get(o.id)??null:null,f=e.selected===o.id?`sel`:``,p=n=>{e.hover=l,e.active.set(t.id,r),e.pz.reveal(n.currentTarget),e.focusSelect(o.id)};if(a)return A`<button type="button" class="taskchip ${u?`on`:``} ${f}" part="mark" data-i=${r} tabindex=${i?0:-1} title=${o.tip??M} aria-label=${o.label} aria-pressed=${!!f} @mouseenter=${()=>e.hover=l} @focus=${p} @blur=${()=>e.hover=null} @click=${()=>e.select(o.id)} @dblclick=${()=>e.act(o.id)}>${o.name??(n.series||o.id)}</button>`;let m=e.states[o.state];return A`<button type="button" class="mark ${u?`on`:``} ${f}" part="mark" data-tone=${L(m?.tone)} data-shape=${m?.shape??M} data-link=${d??M} data-i=${r} data-n=${o.badge??M} tabindex=${i?0:-1} title=${o.tip??M} aria-label=${o.label} aria-pressed=${!!f} @mouseenter=${()=>e.hover=l} @focus=${p} @blur=${()=>e.hover=null} @click=${()=>e.select(o.id)} @dblclick=${()=>e.act(o.id)}></button>`}function Io(e,t,n){let r=t.target;if(!r.classList.contains(`mark`)&&!r.classList.contains(`taskchip`))return;if(t.shiftKey&&t.key.startsWith(`Arrow`))return function(e,t,n){let r=t.key===`ArrowRight`||t.key===`ArrowDown`?`later`:`earlier`,i=e.lay,a=function(e,t,n,r){let i=new Map(e.drawn.map((e,t)=>[e,t])),a=[...new Set(e.edges.filter((r,i)=>!e.back[i]&&(n===`later`?r.from===t:r.to===t)).map(e=>n===`later`?e.to:e.from))],o=r(t);return a.sort((e,t)=>Math.abs(r(e)-o)-Math.abs(r(t)-o)||(i.get(e)??0)-(i.get(t)??0)),a[0]??null}({drawn:e.arr.drawn,edges:e.drawn.edges,back:e.arr.back},n.id,r,e=>{let t=i?.at[e];return t?i?.down?t.x+t.w/2:t.y+t.h/2:0});if(t.preventDefault(),!a)return;let o=e.nodes.get(a);if(!o)return;let s=n.slots[e.active.get(n.id)??Do(n.slots)]?.series??``,c=To(o,e.drawn.series),l=ho(o,e.barAt)?c.filter(t=>!!t&&e.states[t.m.state]?.tone===`failed`):c,u=s?l.findIndex(e=>e?.series===s):-1,d=u>=0?u:e.active.get(o.id)??Do(l);e.active.set(o.id,d),e.requestUpdate(),e.updateComplete.then(()=>{let t=e.renderRoot.querySelector(`.node[data-id="${CSS.escape(a)}"]`);(t?.querySelector(`[data-i="${d}"]`)??t?.querySelector(`.name`))?.focus()})}(e,t,n);let{slots:i}=n;if(t.key===`Enter`){let n=i[Number(r.dataset.i)];t.preventDefault(),n&&e.act(n.m.id);return}let a=e.active.get(n.id)??Do(i),o={ArrowRight:1,ArrowLeft:-1,ArrowDown:n.grid.cols,ArrowUp:-n.grid.cols},s;if(t.key===`Home`)s=Do(i);else if(t.key===`End`)s=i.length-1-[...i].reverse().findIndex(e=>e!==null);else{if(o[t.key]===void 0)return;{let e=o[t.key];for(s=a+e;s>=0&&s<i.length&&!i[s];)s+=Math.sign(e);if(s<0||s>=i.length)return}}t.preventDefault(),e.active.set(n.id,s),e.requestUpdate();let c=t.currentTarget;e.updateComplete.then(()=>c.querySelector(`[data-i="${s}"]`)?.focus())}var Lo=(e,t,n)=>{let r=e.states[t];return A`<i class="mark" data-tone=${L(r?.tone)} data-shape=${r?.shape??M} data-n=${n??M}></i>`},Ro={series:[],nodes:[],clusters:[],edges:[],stubs:[]},zo=class extends N{constructor(...e){super(...e),this.graph=Ro,this.states={},this.selected=null,this.highlight=null,this.order=void 0,this.key=``,this.direction=`auto`,this.view=`graph`,this.matrix=null,this.barAt=200,this.related=void 0,this.strings={},this.matrixStrings={},this.renderIcon=e=>pi(e),this.iconStyles=[],this.hover=null,this.down=!1,this.lay=null,this.announced=``,this.arr=lo(Ro),this.words=So,this.drawn={...Ro,nodes:[]},this.nodes=new Map,this.clusters=new Map,this.markSeries=new Map,this.active=new Map,this.measured=null,this.layKey=``,this.layFor=null,this.litCache=null,this.scrolled=null,this.pz=new vo(this,{frame:()=>this.renderRoot.querySelector(`.frame`),stage:()=>this.renderRoot.querySelector(`.stage`),drawing:()=>this.lay&&!this.matrix?{w:this.lay.w,h:this.lay.h,down:this.down,room:this.card.room}:null,wheel:()=>this.view!==`table`&&!this.matrix,down:()=>this.down,onMove:()=>this.card.place(),onResize:()=>{this.fit(),this.card.place()}}),this.card=new yo(this,{docked:()=>this.down,frameH:()=>this.pz.frameH,grow:()=>this.matrix?this.requestUpdate():this.fit(),pressed:()=>this.pz.pressed,inner:()=>this.matrixEl()?.renderRoot??null}),this.h=this,this.onEscape=e=>{e.key===`Escape`&&!e.defaultPrevented&&this.selected&&(e.preventDefault(),this.select(null))}}static{this.styles=[V,Jr,oi,Co]}static{this.properties={graph:{attribute:!1},states:{attribute:!1},selected:{attribute:!1},highlight:{attribute:!1},order:{attribute:!1},key:{},direction:{},view:{},matrix:{attribute:!1},barAt:{type:Number},related:{attribute:!1},strings:{attribute:!1},matrixStrings:{attribute:!1},renderIcon:{attribute:!1},iconStyles:{attribute:!1},hover:{state:!0},down:{state:!0},lay:{state:!0},announced:{state:!0}}}matrixEl(){return this.renderRoot.querySelector(`cae-mark-matrix`)}willUpdate(e){if(e.has(`key`)&&e.get(`key`)!==void 0&&(this.pz.reset(),this.active.clear()),e.has(`strings`)&&(this.words=Ar(So,this.strings)),e.has(`direction`)&&this.direction!==`auto`&&(this.down=this.direction===`down`),(e.has(`graph`)||e.has(`order`)||e.has(`down`)||e.has(`direction`))&&(this.arr=lo(this.graph,this.order,this.down),this.clusters=new Map(this.graph.clusters.map(e=>[e.id,e]))),e.has(`graph`)||e.has(`states`)||e.has(`strings`)){let e=this.graph;this.drawn={...e,nodes:e.nodes.map(e=>function(e,t,n){let{marks:r=[],loose:i=[]}=e,a={},o=0,s=0;for(let e of[...r,...i])e&&(a[e.state]=(a[e.state]??0)+1,s++,t[e.state]?.tone===`done`&&o++);return{...e,marks:r,loose:i,counts:e.counts??a,progress:e.progress??{done:o,total:s,label:n(o,s)}}}(e,this.states,this.words.progress))},this.nodes=new Map(this.drawn.nodes.map(e=>[e.id,e])),this.markSeries=new Map(this.drawn.nodes.flatMap(t=>To(t,e.series).flatMap(e=>e?[[e.m.id,e.series]]:[])))}}connectedCallback(){super.connectedCallback(),this.addEventListener(`keydown`,this.onEscape)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`keydown`,this.onEscape)}updated(e){e.has(`iconStyles`)&&this.renderRoot instanceof ShadowRoot&&pt(this.renderRoot,[...this.constructor.elementStyles,...this.iconStyles]);let t=this.matrixEl();t&&t!==this.scrolled&&(this.scrolled=t,t.renderRoot.addEventListener(`scroll`,()=>this.card.place(),{capture:!0})),this.place(),this.card.place(),e.has(`selected`)&&this.selectionChanged()}focusToggle(e,t=4){let n=this.renderRoot;if(n.querySelector(`.dag.unplaced`)&&t>0)return void this.updateComplete.then(()=>requestAnimationFrame(()=>this.focusToggle(e,t-1)));let r=this.clusters.has(e)?`.cluster[data-cluster="${CSS.escape(e)}"] > .cue .tog`:`.node[data-id="${CSS.escape(e)}"] .tog`,i=n.querySelector(r);i?this.card.focusQuietly(i):this.focusItem(e)}focusItem(e){let t=this.renderRoot,n=null;e&&this.clusters.has(e)?n=t.querySelector(`.cluster[data-cluster="${CSS.escape(e)}"] > .hd .name`):e&&(n=t.querySelector(`.node[data-id="${CSS.escape(e)}"] [tabindex="0"]`));let r=t.querySelector(`slot[name="crumbs"]`)?.assignedElements({flatten:!0})??[];this.card.focusQuietly(n??r.map(e=>e.matches(`button`)?e:e.querySelector(`button`)).find(Boolean)??t.querySelector(`.mark[tabindex="0"], .node .name`)??this.matrixEl()?.renderRoot.querySelector(`.mark[tabindex="0"]`)??null)}selectionChanged(){let[e,t]=this.card.describe(),n=e?[e,t].filter(Boolean).join(` | `):``;n!==this.announced&&(this.announced=n),this.down&&this.card.whenReleased(()=>this.card.revealOverSheet())}place(){let e=this.renderRoot.querySelector(`.dag`);if(!e)return;let t=this.graph,n=`${this.down}|${this.clientWidth}`;if(this.measured?.graph===t&&this.measured.key===n)return this.fit();this.measured={graph:t,key:n};let r=new Map;for(let t of e.querySelectorAll(`[data-id]`))r.set(t.dataset.id??``,{w:t.offsetWidth,h:t.offsetHeight});let i=this.arr,a=JSON.stringify([this.key,i.slots,i.edgePaths.map(e=>e.steps.map(e=>e.id)),this.down,[...r]]);if(a===this.layKey)return this.fit();this.layKey=a,this.layFor=this.key,this.lay=function(e,t,n=!1){let r=fo[n?`down`:`across`],i=e=>n?e.h:e.w,a=e=>n?e.w:e.h,o=new Set(e.clusters.map(e=>e.id)),s=new Map(e.clusters.map(e=>[e.id,e.parent])),c=e=>t.get(`lbl:${e}`)??{w:0,h:0},l=e=>n?{u0:c(e).h+r.pad+r.gap/2,u1:r.pad,v0:r.pad,v1:r.padEnd,minU:0,minV:c(e).w+2*r.pad}:{u0:r.pad,u1:r.pad,v0:c(e).h+r.pad,v1:r.padEnd,minU:c(e).w+2*r.pad,minV:0},u=new Map,d=e=>{if(o.has(e))return u.get(e)??{u:0,v:0};if(oo(e))return{u:0,v:0};let n=t.get(e)??{w:0,h:0};return{u:i(n),v:a(n)}},f=new Map,p=new Map,m=e=>e===``?0:1+m(s.get(e)??``),h=[``,...e.clusters.map(e=>e.id)].sort((e,t)=>m(t)-m(e)),g=(t,n)=>{let r=e.edgePaths[t]?.steps??[],i=r[n];if(oo(i.id))return 0;if(!o.has(i.id))return d(i.id).v/2;let a=r[n-1]?.in===i.id?n-1:n+1,s=r[a];return l(i.id).v0+(f.get(i.id)?.top.get(s.id)??0)+g(t,a)};for(let t of h){let n=(e.slots[t]??[]).map(e=>[...e]);p.set(t,new Map(n.flatMap((e,t)=>e.map(e=>[e,t]))));let i=n.map(e=>Math.max(0,...e.map(e=>d(e).u))),a=t===``?r.gap:r.boxGap,s=[];i.forEach((e,t)=>s.push(t?s[t-1]+i[t-1]+a:0));let c=[];e.edgePaths.forEach((e,n)=>e.steps.forEach((r,i)=>{let a=e.steps[i-1];i&&a&&a.in===t&&r.in===t&&p.get(t)?.get(a.id)!==p.get(t)?.get(r.id)&&c.push({a:a.id,b:r.id,oa:g(n,i-1),ob:g(n,i)})}));let m=(e,t)=>t===void 0?0:o.has(e)||o.has(t)||!oo(e)&&!oo(t)?r.sep:r.pointSep,h=new Map;for(let e of n){let t=0;e.forEach((n,r)=>{h.set(n,t),t+=d(n).v+m(n,e[r+1])})}let _=(e,t)=>{let n=e.map(e=>{let n=t(e);return n.length?n.reduce((e,t)=>e+t,0)/n.length:h.get(e)??0}),r=e.map((t,n)=>d(t).v+m(t,e[n+1])),i=e.map((e,t)=>oo(e)?-1:t).filter(e=>e>=0),a=po(i.map(e=>n[e]),i.map((e,t)=>t+1<i.length?((e,t)=>r.slice(e,t).reduce((e,t)=>e+t,0))(e,i[t+1]):0),i.map(()=>1));i.forEach((e,t)=>n[e]=a[t]),po(n,r,e.map(e=>oo(e)?1:1e6)).forEach((t,n)=>h.set(e[n],Math.round(100*t)/100))},v=(e,t)=>{let n=oo(e)?t:t.filter(e=>!oo(e.other));return(n.length?n:t).map(e=>e.at)},y=e=>v(e,c.filter(t=>t.b===e).map(e=>({other:e.a,at:(h.get(e.a)??0)+e.oa-e.ob}))),b=e=>v(e,c.filter(t=>t.a===e).map(e=>({other:e.b,at:(h.get(e.b)??0)+e.ob-e.oa})));for(let e=0;e<8;e++){let t=n.map((e,t)=>t);e%2&&t.reverse();for(let r of t)_(n[r],e%2?b:y)}for(let e of n)_(e,e=>[...y(e),...b(e)]);let x=h.size?Math.min(...h.values()):0;for(let[e,t]of h)h.set(e,t-x);let S=(s[s.length-1]??0)+(i[i.length-1]??0),C=Math.max(0,...n.flat().map(e=>(h.get(e)??0)+d(e).v));if(f.set(t,{rows:n,start:s,width:i,top:h,u:S,v:C}),t!==``){let e=l(t);u.set(t,{u:Math.max(e.u0+S+e.u1,e.minU),v:Math.max(e.v0+C+e.v1,e.minV)})}}let _={},v=new Map,y=(e,t,r)=>{v.set(e,{u:t,v:r});let i=f.get(e);i.rows.forEach((e,a)=>e.forEach(e=>{if(oo(e))return;let s=t+i.start[a],c=r+(i.top.get(e)??0);if(_[e]=((e,t,r)=>n?{x:t,y:e,w:r.v,h:r.u}:{x:e,y:t,w:r.u,h:r.v})(s,c,d(e)),o.has(e)){let t=l(e);y(e,s+t.u0,c+t.v0)}}))};y(``,r.margin,r.margin);let b=f.get(``),x=b.u+2*r.margin,S=b.v+2*r.margin,C=(e,t)=>{let n=f.get(e),r=(v.get(e)??{u:0,v:0}).u+(n.start[t]??0);return[r,r+(n.width[t]??0)]},ee=(e,t)=>p.get(e)?.get(t)??0,te=e=>e&&oo(e.id)?/\|by:([^|]*)\|/.exec(e.id)?.[1]??``:``,ne=e.edgePaths.map((e,t)=>{let i=n=>{let r=e.steps[n];return(v.get(r.in)??{u:0,v:0}).v+(f.get(r.in)?.top.get(r.id)??0)+g(t,n)},a=e.steps.map((t,a)=>{let o=e.steps[a-1],s=e.steps[a+1],[u,p]=C(t.in,ee(t.in,t.id)),m=i(a);if(a===0)return{a:u+d(t.id).u,b:p,at:m};if(a===e.steps.length-1)return{a:u,b:u,at:m};if(oo(t.id)){let i=te(t);if(i&&o?.id===i)return{a:C(i,ee(i,e.steps[a-2]?.id??``)+1)[0],b:p,at:m};if(i&&s?.id===i){let t=ee(i,e.steps[a+2]?.id??``);return{a:u,b:t>0?C(i,t-1)[1]:(_[i]?n?_[i].y:_[i].x:u)+c(i).h+r.pad,at:m}}return{a:u,b:p,at:m}}let h=l(t.id),g=f.get(t.id);if(o?.in===t.id){if(te(s)===t.id){let e=C(t.id,ee(t.id,o.id)+1)[0];return{a:e,b:e,at:i(a+1)}}return{a:u+h.u0+g.u,b:p,at:m}}if(te(o)===t.id){let e=C(t.id,ee(t.id,s?.id??``))[0];return{a:e,b:e,at:i(a+1)}}return{a:u,b:u+h.u0,at:m}});return{from:e.from,to:e.to,style:e.style,runs:a}}),re=e.clusters.flatMap(e=>{if(!e.cycle)return[];let t=f.get(e.id),n=v.get(e.id);if(!t||!n)return[];let r=e=>{let n=(e??[]).filter(e=>!oo(e)),r=null;for(let e of n){let n=d(e),i=(t.top.get(e)??0)+n.v;(!r||i>r.v)&&(r={u:n.u,v:i})}return r},i=t.rows.map((e,t)=>e.some(e=>!oo(e))?t:-1).filter(e=>e>=0),a=i[0]??0,o=i[i.length-1]??0,s=r(t.rows[o]),c=r(t.rows[a]);if(!s||!c)return[];let l=n.u+(t.start[o]??0)+(t.width[o]??0)/2,u=n.u+(t.start[a]??0)+(t.width[a]??0)/2;if(l-u<24){let e=Math.max(12,Math.min(28,Math.min(s.u,c.u)/4));l=(l+u)/2+e,u=l-2*e}return[{box:e.id,from:l,v0:n.v+s.v,to:u,v1:n.v+c.v,band:n.v+t.v+12}]});return{w:n?S:x,h:n?x:S,at:_,edges:ne,returns:re,down:n}}(i,r,this.down),this.updateComplete.then(()=>this.fit())}fit(){if(this.direction===`auto`){let e=this.clientWidth,t=e>0&&e<640;t!==this.down&&(this.down=t)}this.pz.fit()}select(e){e!==this.selected&&R(this,`cae-select`,{id:e})}act(e){let t=this.nodes.get(e)??this.clusters.get(e)??this.findMark(e);t?.drill?this.drill(e):t&&R(this,`cae-activate`,{id:e})}findMark(e){for(let t of this.drawn.nodes)for(let n of[...t.marks,...t.loose])if(n?.id===e)return n;for(let t of this.matrix?.rows??[])for(let n of t.cells)if(n?.id===e)return n;return null}lit(){let e=this.selected,t=this.hover===null&&e!==null&&this.markSeries.has(e)?this.markSeries.get(e)||e:null,n=this.hover??t??this.highlight??null,r=this.litCache;if(r&&r.key===n&&r.graph===this.graph&&r.related===this.related)return r;let i=n===null?null:(this.related??(e=>new Set([e])))(n);return this.litCache={key:n,graph:this.graph,related:this.related,on:i},this.litCache}known(e){return this.nodes.has(e)||this.clusters.has(e)||!!this.findMark(e)}render(){let e=this.h,t=this.matrix,n=t?this.matrixView(t):this.view===`table`?function(e){let t=e.drawn,n=e.words,r=[...t.edges,...t.stubs].some(e=>e.style===`dotted`),i=[...t.edges,...t.stubs].some(e=>e.style===`dashed`),a=e=>n.list(e)||n.none,o=!e.down&&e.laidOut&&e.pz.frameH>0?`height:${Math.round(e.pz.frameH)}px`:`max-height:max(360px, 70vh)`,s=e.arr.drawn.map(t=>e.nodes.get(t)).filter(e=>!!e);return A`<div class="frame tframe" part="frame" data-scroll="x" style=${o} @scroll=${()=>e.card.place()} @click=${t=>!t.target.closest(`tbody tr`)&&e.select(null)}>
|
|
192
192
|
<table class="list view" part="table">
|
|
193
193
|
<thead>
|
|
194
194
|
<tr>
|
|
195
195
|
<th scope="col" class="fit">${n.nameHeader}</th>
|
|
196
196
|
<th scope="col" class="fit">${n.statusHeader}</th>
|
|
197
197
|
<th scope="col">${n.solidHeader}</th>
|
|
198
|
-
${r?
|
|
198
|
+
${r?A`<th scope="col">${n.dottedHeader}</th>`:M}
|
|
199
|
+
${i?A`<th scope="col">${n.dashedHeader}</th>`:M}
|
|
199
200
|
<th scope="col">${n.laterHeader}</th>
|
|
200
201
|
</tr>
|
|
201
202
|
</thead>
|
|
202
203
|
<tbody>
|
|
203
|
-
${H(
|
|
204
|
+
${H(s,e=>e.id,o=>{let s=function(e,t,n,r){let i=e=>{let t=n.get(e);return t?t.cluster?r(t.label):t.label:e},a=n=>[...t.stubs.filter(t=>t.to===e.id&&t.style===n).map(e=>e.label),...t.edges.filter(t=>t.to===e.id&&t.style===n).map(e=>i(e.from))];return{solid:a(`solid`),dotted:a(`dotted`),dashed:a(`dashed`),later:[...new Set(t.edges.filter(t=>t.from===e.id).map(e=>i(e.to)))]}}(o,t,e.nodes,n.inCluster),c=o.cluster?e.clusters.get(o.cluster):void 0,l=e.selected===o.id,u=A`${(o.icons??[]).map(t=>e.renderIcon(t))}${o.drill?xo():M}`;return A`<tr class=${l?`sel`:``} part="row" data-id=${o.id} @click=${t=>!t.target.closest(`.loopchip`)&&t.detail<2&&e.select(o.id)} @dblclick=${t=>!t.target.closest(`.loopchip`)&&e.act(o.id)}>
|
|
204
205
|
<th scope="row" class="fit">
|
|
205
|
-
<span class="nm">${
|
|
206
|
+
<span class="nm">${u}<button type="button" class="name" title=${o.tip??M} aria-pressed=${l} @focus=${()=>e.focusSelect(o.id)} @keydown=${t=>{t.key===`Enter`&&(t.preventDefault(),e.act(o.id))}}>${o.label}</button>${c?.drill?A`<button type="button" class="taskchip loopchip" title=${c.chipTip??M} aria-label=${c.chipLabel??M} @click=${()=>e.drill(c.id)}>${c.cycle?bo(12):M}${c.note??c.label}</button>`:M}</span>
|
|
206
207
|
</th>
|
|
207
|
-
<td class="fit st">${function(e){let t=
|
|
208
|
-
<td class="rel"><span>${
|
|
209
|
-
${r?
|
|
210
|
-
|
|
208
|
+
<td class="fit st">${function(e){let t=A`<span class="sep" aria-hidden="true"> | </span>`;return A`<span class="n" aria-hidden="true" title=${e.progress.label}>${e.progress.done}/${e.progress.total}</span><span class="sr">${e.progress.label}</span>${Po(e).map(e=>A`${t}${e}`)}`}(o)}</td>
|
|
209
|
+
<td class="rel"><span>${a(s.solid)}</span></td>
|
|
210
|
+
${r?A`<td class="rel"><span>${a(s.dotted)}</span></td>`:M}
|
|
211
|
+
${i?A`<td class="rel"><span>${a(s.dashed)}</span></td>`:M}
|
|
212
|
+
<td class="rel"><span>${a(s.later)}</span></td>
|
|
211
213
|
</tr>`})}
|
|
212
214
|
</tbody>
|
|
213
215
|
</table>
|
|
214
|
-
</div>`}(e):function(e){let t=e.pz;return
|
|
215
|
-
<div class="stage view" part="stage" style="transform:${t.transform}">${function(e){let{on:t}=e.lit(),n=e.drawn,r=e.lay,i=new Map(n.stubs.map(e=>[e.id,e])),a=(t,n)=>{let r=e.clusters.get(t);if(r)return function(e,t,n,r){let i=e.lay?.at[t.id]??null,a=(e.arr.slots[t.id]??[]).flat().filter(e=>!oo(e)),o=i?`;width:${i.w}px;height:${i.h}px`:``,s=e.selected===t.id;return
|
|
216
|
+
</div>`}(e):function(e){let t=e.pz;return A`<div class="frame gframe ${e.down?`down`:``}" part="frame" style="height:${Math.round(t.frameH)}px" @pointerdown=${t.onPointerDown} @pointermove=${t.onPointerMove} @pointerup=${t.onPointerUp} @pointercancel=${t.onPointerUp} @click=${t=>!t.target.closest(`.node, .cluster, .stub, .tools`)&&e.select(null)}>
|
|
217
|
+
<div class="stage view" part="stage" style="transform:${t.transform}">${function(e){let{on:t}=e.lit(),n=e.drawn,r=e.lay,i=new Map(n.stubs.map(e=>[e.id,e])),a=(t,n)=>{let r=e.clusters.get(t);if(r)return function(e,t,n,r){let i=e.lay?.at[t.id]??null,a=(e.arr.slots[t.id]??[]).flat().filter(e=>!oo(e)),o=i?`;width:${i.w}px;height:${i.h}px`:``,s=e.selected===t.id;return A`<section class="cluster ${s?`sel`:``}" part="cluster" role="group" data-cluster=${t.id} style=${ko(e,t.id,n)+o} aria-label=${t.summary??t.label} @click=${n=>Ao(e,n,t.id)} @dblclick=${n=>jo(e,n,t.id)}>
|
|
216
218
|
<div class="hd" part="cluster-label" data-id=${`lbl:${t.id}`}>
|
|
217
219
|
<span class="line">
|
|
218
|
-
${function(e,t,n){let r=t.path?.[0],i=
|
|
219
|
-
${t.note?
|
|
220
|
+
${function(e,t,n){let r=t.path?.[0],i=A`<button type="button" class="name" title=${(r?.tip??t.tip)||M} aria-pressed=${n} @focus=${()=>e.focusSelect(t.id)} @keydown=${n=>Mo(e,n,t.id)}>${t.cycle?bo():M}${r?.label??t.label}</button>`;return!t.path||t.path.length<2?i:A`${i}${t.path.slice(1).map(t=>A`<span class="psep" aria-hidden="true">›</span><button type="button" class="part" title=${t.tip||M} @click=${n=>{n.stopPropagation(),e.drill(t.id)}} @dblclick=${e=>e.stopPropagation()}>${t.label}</button>`)}`}(e,t,s)}
|
|
221
|
+
${t.note?A`<span class="count">${t.note}</span>`:M}
|
|
220
222
|
</span>
|
|
221
|
-
${t.detail?
|
|
223
|
+
${t.detail?A`<span class="spread" title=${t.detailTip??M}>${t.detail}</span>`:M}
|
|
222
224
|
</div>
|
|
223
|
-
${t.toggle?
|
|
225
|
+
${t.toggle?A`<span class="cue">${No(e,t.id,t.path?.map(e=>e.label).join(` › `)??t.label,!0)}</span>`:t.drill?A`<span class="cue" aria-hidden="true">${xo()}</span>`:M}
|
|
224
226
|
<div class="in">${H(a,e=>e,e=>r(e,i))}</div>
|
|
225
|
-
</section>`}(e,r,n,(e,t)=>a(e,t));let o=i.get(t);if(o)return
|
|
227
|
+
</section>`}(e,r,n,(e,t)=>a(e,t));let o=i.get(t);if(o)return A`<span class="stub" part="stub" data-id=${o.id} style=${ko(e,o.id,n)} title=${e.words.stubTip}>${o.label}</span>`;let s=e.nodes.get(t);return s?function(e,t,n){let r=e.drawn.series,i=ho(t,e.barAt),a=To(t,r),o=i?{id:t.id,slots:a.filter(t=>!!t&&e.states[t.m.state]?.tone===`failed`),grid:{cols:8,size:12,gap:4}}:{id:t.id,slots:a,grid:Eo(t,r.length)},s=e.selected===t.id,c=(t.icons??[]).map(t=>e.renderIcon(t));return A`<section class="node ${t.drill?`drill`:``} ${t.accent?`accent`:``} ${s?`sel`:``}" part="node" role="group" data-id=${t.id} data-look=${t.look&&t.look!==`neutral`?t.look:M} aria-label=${t.summary??t.label} style="${ko(e,t.id,n)};--cols:${o.grid.cols};--m:${o.grid.size}px;--g:${o.grid.gap}px" @click=${n=>Ao(e,n,t.id)} @dblclick=${n=>jo(e,n,t.id)}>
|
|
226
228
|
<div class="hd" part="node-header">
|
|
227
|
-
<span class="nm">${c}<button type="button" class="name" part="node-name" title=${t.tip??
|
|
228
|
-
<span class="right"><span class="count" aria-hidden="true" title=${t.progress.label}>${t.progress.done}/${t.progress.total}</span>${t.toggle?No(e,t.id,t.label,!1):t.drill?
|
|
229
|
+
<span class="nm">${c}<button type="button" class="name" part="node-name" title=${t.tip??M} aria-pressed=${s} @focus=${()=>e.focusSelect(t.id)} @keydown=${n=>Mo(e,n,t.id)}>${t.label}</button></span>
|
|
230
|
+
<span class="right"><span class="count" aria-hidden="true" title=${t.progress.label}>${t.progress.done}/${t.progress.total}</span>${t.toggle?No(e,t.id,t.label,!1):t.drill?A`<span class="cue" aria-hidden="true">${xo()}</span>`:M}</span>
|
|
229
231
|
</div>
|
|
230
|
-
${i?function(e,t,n){let r=Object.keys(e.states),i=function(e,t){let n=t.reduce((t,n)=>t+(e[n]??0),0);return t.filter(t=>(e[t]??0)>0).map(t=>({state:t,n:e[t]??0,pct:100*(e[t]??0)/Math.max(1,n)}))}(t.counts,r),a=n.slots.slice(0,8),o=n.slots.length-a.length,s=Math.min(e.active.get(n.id)??0,Math.max(0,a.length-1));return
|
|
231
|
-
${i.map(t=>{let n=e.states[t.state];return
|
|
232
|
+
${i?function(e,t,n){let r=Object.keys(e.states),i=function(e,t){let n=t.reduce((t,n)=>t+(e[n]??0),0);return t.filter(t=>(e[t]??0)>0).map(t=>({state:t,n:e[t]??0,pct:100*(e[t]??0)/Math.max(1,n)}))}(t.counts,r),a=n.slots.slice(0,8),o=n.slots.length-a.length,s=Math.min(e.active.get(n.id)??0,Math.max(0,a.length-1));return A`<div class="sbar" role="img" aria-label=${r.filter(e=>t.counts[e]).map(n=>ui(e.states,n,t.counts[n]??0)).join(` | `)}>
|
|
233
|
+
${i.map(t=>{let n=e.states[t.state];return A`<i data-tone=${L(n?.tone)} data-shape=${n?.shape??M} style="width:${t.pct}%" title=${ui(e.states,t.state,t.n)}></i>`})}
|
|
232
234
|
</div>
|
|
233
|
-
${a.length?
|
|
234
|
-
${a.map((t,r)=>t?Fo(e,n,t,r,r===s,!0):
|
|
235
|
-
${o>0?
|
|
236
|
-
</div>`:
|
|
237
|
-
${t.slots.map((r,i)=>r?Fo(e,t,r,i,i===n):
|
|
235
|
+
${a.length?A`<div class="fails" @keydown=${t=>Io(e,t,{...n,slots:a,grid:{...n.grid,cols:a.length}})}>
|
|
236
|
+
${a.map((t,r)=>t?Fo(e,n,t,r,r===s,!0):M)}
|
|
237
|
+
${o>0?A`<span>${e.words.more(o)}</span>`:M}
|
|
238
|
+
</div>`:M}`}(e,t,o):function(e,t){let n=Math.min(e.active.get(t.id)??Do(t.slots),t.slots.length-1);return A`<div class="marks ${t.grid.size>=10?`big`:``}" @keydown=${n=>Io(e,n,t)}>
|
|
239
|
+
${t.slots.map((r,i)=>r?Fo(e,t,r,i,i===n):A`<span class="slot"></span>`)}
|
|
238
240
|
</div>`}(e,o)}
|
|
239
|
-
${t.
|
|
240
|
-
|
|
241
|
+
${t.expected?A`<span class="expected" part="expected" aria-hidden="true" title=${t.expected.label}>${t.expected.text}</span>`:M}
|
|
242
|
+
${t.notes?.length?A`<div class="ex" aria-hidden="true">${Po(t)}</div>`:M}
|
|
243
|
+
</section>`}(e,s,n):M},o=!!r&&n.nodes.every(e=>r.at[e.id]),s=r?.w??0,c=r?.h??0;return A`<div class="dag ${e.down?`down`:``} ${t?`hl`:``} ${o?``:`unplaced`}" style="width:${s}px;height:${c}px" @mouseleave=${()=>e.hover=null}>
|
|
241
244
|
<svg class="edges" aria-hidden="true" width=${s} height=${c}>
|
|
242
245
|
<defs>
|
|
243
246
|
<marker id="arr" viewBox="0 0 8 8" refX="8" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto">
|
|
@@ -247,738 +250,752 @@ ${t.notes?.length?k`<div class="ex" aria-hidden="true">${Po(t)}</div>`:j}
|
|
|
247
250
|
<path class="ret-tip" d="M0,0.5 L8,4 L0,7.5 z"></path>
|
|
248
251
|
</marker>
|
|
249
252
|
</defs>
|
|
250
|
-
${(r?.edges??[]).map(e=>
|
|
251
|
-
${(r?.returns??[]).map(e=>
|
|
253
|
+
${(r?.edges??[]).map(e=>j`<path class=${e.style} part="edge" d=${function(e,t=!1){let n=e=>Math.round(2*e)/2,r=(e,r)=>t?`${n(r)},${n(e)}`:`${n(e)},${n(r)}`,i=e[0];if(!i)return``;let a=`M${r(i.a,i.at)}`;return e.forEach((t,n)=>{t.b!==t.a&&(a+=` L${r(t.b,t.at)}`);let i=e[n+1];if(!i)return;if(Math.abs(i.at-t.at)<.5)return void(i.a!==t.b&&(a+=` L${r(i.a,i.at)}`));let o=(t.b+i.a)/2;a+=` C${r(o,t.at)} ${r(o,i.at)} ${r(i.a,i.at)}`}),a}(e.runs,r?.down)} marker-end="url(#arr)"></path>`)}
|
|
254
|
+
${(r?.returns??[]).map(e=>j`<path class="ret" data-cluster=${e.box} d=${function(e,t=!1,n=3){let r=e=>Math.round(2*e)/2,i=(e,n)=>t?`${r(n)},${r(e)}`:`${r(e)},${r(n)}`,a=Math.max(0,Math.min(6,(e.from-e.to)/2,e.band-e.v0-n,e.band-e.v1-n));return[`M${i(e.from,e.v0+n)}`,`L${i(e.from,e.band-a)}`,`Q${i(e.from,e.band)} ${i(e.from-a,e.band)}`,`L${i(e.to+a,e.band)}`,`Q${i(e.to,e.band)} ${i(e.to,e.band-a)}`,`L${i(e.to,e.v1+n)}`].join(` `)}(e,r?.down)} marker-end="url(#arr-ret)"></path>`)}
|
|
252
255
|
</svg>
|
|
253
256
|
${H((e.arr.slots[``]??[]).flat().filter(e=>!oo(e)),e=>e,e=>a(e,null))}
|
|
254
257
|
</div>`}(e)}</div>
|
|
255
|
-
</div>`}(e),r=this.selected;return
|
|
258
|
+
</div>`}(e),r=this.selected;return A`<div class="col">
|
|
256
259
|
<slot name="crumbs"></slot>
|
|
257
|
-
<div class="main">${n}${r&&this.querySelector(`[slot=inspector]`)&&this.known(r)?wo(r,
|
|
260
|
+
<div class="main">${n}${r&&this.querySelector(`[slot=inspector]`)&&this.known(r)?wo(r,A`<section id="insp" class="insp ${this.down?`sheet`:``}" part="inspector" aria-label=${this.words.inspector} @keydown=${this.card.onCardKey}>
|
|
258
261
|
<span class="ptr" aria-hidden="true"></span>
|
|
259
262
|
<div class="scroll"><slot name="inspector"></slot></div>
|
|
260
|
-
</section>`):
|
|
261
|
-
${function(e,t){let n=!!t||e.asTable;return
|
|
262
|
-
${function(e,t){let n=e.drawn,r=e.asTable&&!t,i=(r?[]:t?t.rows.flatMap(e=>e.cells).map(e=>e&&{state:e.state,badge:void 0}):n.nodes.flatMap(t=>To(t,n.series).map(n=>n&&{state:n.m.state,badge:ho(t,e.barAt)?void 0:n.m.badge}))).filter(e=>e!==null),a=new Set(i.map(e=>e.state)),o=i.some(e=>e.badge),s
|
|
263
|
-
<path class="ret-head" d="M4,0.8 L1.4,5 L6.6,5 z"></path></svg>`}]:[],...
|
|
264
|
-
<div class="tools">${n?
|
|
263
|
+
</section>`):M}<div class="sr" role="status">${this.announced}</div></div>
|
|
264
|
+
${function(e,t){let n=!!t||e.asTable;return A`<div class="foot">
|
|
265
|
+
${function(e,t){let n=e.drawn,r=e.asTable&&!t,i=(r?[]:t?t.rows.flatMap(e=>e.cells).map(e=>e&&{state:e.state,badge:void 0}):n.nodes.flatMap(t=>To(t,n.series).map(n=>n&&{state:n.m.state,badge:ho(t,e.barAt)?void 0:n.m.badge}))).filter(e=>e!==null),a=new Set(i.map(e=>e.state)),o=i.some(e=>e.badge),s=new Set(t||r?[]:[...n.edges,...n.stubs].map(e=>e.style)),c=s.size>1||s.size===1&&!s.has(`solid`)?[`solid`,`dotted`,`dashed`].filter(e=>s.has(e)):[],l=new Set(t?t.head.flat().flatMap(e=>e.icons??[]):n.nodes.flatMap(e=>e.icons??[])),u=!t&&!r&&n.clusters.some(e=>e.cycle),d=!t&&(!r&&n.clusters.some(e=>e.drill)||n.nodes.some(e=>e.drill)),f=Object.keys(e.states)[0]??``,p={solid:e.words.solidEdge,dotted:e.words.dottedEdge,dashed:e.words.dashedEdge};return ai([...Object.entries(e.states).filter(([e])=>a.has(e)).map(([t,n])=>({label:n.label,icon:Lo(e,t),decorative:!0})),...o?[{label:e.words.badge,icon:Lo(e,f,`2`),decorative:!0}]:[],...Object.entries(e.words.iconNames).filter(([e])=>l.has(e)).map(([t,n])=>({label:n,icon:e.renderIcon(t)})),...c.map(e=>{return{label:p[e],icon:(t=e,j`<svg width="22" height="8" aria-hidden="true"><path class=${t} d="M1,4 H21" stroke-dasharray=${t===`dashed`?`5 4`:t===`dotted`?`0.1 4`:`none`}></path></svg>`)};var t}),...u?[{label:e.words.cycle,icon:A`<svg width="24" height="12" aria-hidden="true"><path class="ret" d="M20,1.5 V5.5 Q20,9.5 16,9.5 H8 Q4,9.5 4,5.5 V5"></path>
|
|
266
|
+
<path class="ret-head" d="M4,0.8 L1.4,5 L6.6,5 z"></path></svg>`}]:[],...d?[{label:e.words.drill,icon:xo()}]:[]],{cls:`big`})}(e,t)}
|
|
267
|
+
<div class="tools">${n?M:function(e){let t=e.pz,n=e.words,r=!t.moved&&t.fitK>=1;return A`<button type="button" aria-label=${n.zoomOut} title=${n.zoomOutTip} @click=${()=>t.zoomBy(.8)}>−</button>
|
|
265
268
|
<button type="button" aria-label=${n.zoomIn} title=${n.zoomInTip} @click=${()=>t.zoomBy(1.25)}>+</button>
|
|
266
|
-
<button type="button" ?disabled=${r} @click=${()=>t.showAll()}>${n.showAll}</button>`}(e)}${function(e,t){return
|
|
267
|
-
<div class="keys" part="keys">${function(e,t){let n=e.words,r=e.selected?n.clearKey:n.upKey;return[...t?n.matrixKeys:e.asTable?n.tableKeys:n.graphKeys,r].filter(Boolean)}(e,t).map((e,t)=>
|
|
269
|
+
<button type="button" ?disabled=${r} @click=${()=>t.showAll()}>${n.showAll}</button>`}(e)}${function(e,t){return A`<cae-segmented class="views" .options=${[{value:`graph`,label:e.words.graph},{value:`table`,label:e.words.table}]} .value=${t?`table`:`graph`} label=${e.words.view} @cae-change=${t=>{t.stopPropagation(),e.showView(t.detail.value===`table`?`table`:`graph`)}}></cae-segmented>`}(e,n)}</div>
|
|
270
|
+
<div class="keys" part="keys">${function(e,t){let n=e.words,r=e.selected?n.clearKey:n.upKey;return[...t?n.matrixKeys:e.asTable?n.tableKeys:n.graphKeys,r].filter(Boolean)}(e,t).map((e,t)=>A`${t?` | `:``}<span>${e}</span>`)}</div>
|
|
268
271
|
</div>`}(e,t)}
|
|
269
|
-
</div>`}matrixView(e){let t=this.down?0:Math.round(Math.max(this.pz.frameH,this.card.room));return
|
|
272
|
+
</div>`}matrixView(e){let t=this.down?0:Math.round(Math.max(this.pz.frameH,this.card.room));return A`<div class="frame mxframe" part="frame" style=${t?`min-height:${t}px`:``}>
|
|
270
273
|
<cae-mark-matrix .matrix=${e} .states=${this.states} .selected=${this.selected} .highlight=${this.highlight} .key=${this.key} .strings=${this.matrixStrings} .renderIcon=${this.renderIcon} .iconStyles=${this.iconStyles}></cae-mark-matrix>
|
|
271
|
-
</div>`}get laidOut(){return this.layFor===this.key}get asTable(){return this.view===`table`}focusSelect(e){this.card.quiet||this.select(e)}drill(e){R(this,`cae-drill`,{id:e})}toggle(e,t){R(this,`cae-toggle`,{id:e,open:t})}showView(e){this.matrix&&e===`table`||(this.matrix||(this.view=e),R(this,`cae-view-change`,{view:e}))}},Bo=(e,t,n)=>e===1?`1 ${t}`:`${e} ${n}`,Vo={sections:`Sessions`,sectionsTip:``,loadEarlier:e=>`Show ${Bo(e,`earlier line`,`earlier lines`)}`,newBelow:e=>`Show ${Bo(e,`new event`,`new events`)}`,newInLatest:e=>`Show ${Bo(e,`new event`,`new events`)} in the latest session`,prompt:`Prompt`,assistant:`Assistant`,reasoning:`Reasoning`,characters:e=>`${e} characters`,tool:`tool`,results:e=>Bo(e,`result`,`results`),done:`done`,failed:`failed`,running:`running`,interrupted:`interrupted`,interruptedTip:`Ended with no result`,query:`query`,page:`page`,fullText:`Full text`,showAll:e=>`Show all (${e} characters)`,showLess:`Show less`},Ho=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;}:host([mode='tabs']) .scroller,:host([mode='tabs']) .newpill{display:none;}.rounds{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 10px;padding-left:2px;}.rounds-lbl{color:var(--text-muted);font-size:11.5px;font-weight:600;margin-right:4px;cursor:help;}.stab{padding:3px 11px;border:1px solid var(--line);border-radius:999px;background:var(--card);color:var(--text-muted);cursor:pointer;font-size:12px;display:inline-flex;align-items:center;}.stab:hover{border-color:var(--accent);}.stab.sel{background:var(--accent-bg);border-color:var(--accent);color:var(--text);}.stab-m{font-family:var(--mono);font-size:10.5px;color:var(--text-muted);margin-left:4px;}.stab.sel .stab-m{color:var(--text-2);}.stab .dot{width:6px;height:6px;margin-left:4px;}.stab .mk{margin-right:4px;}.stab .mk.ok{color:var(--status-done);}.stab .mk.bad{color:var(--status-failed);}.verdict{margin:6px 10px 4px 41px;padding:7px 11px;border-radius:10px;border:1px solid;font-size:12px;}.verdict[data-tone]{background:var(--tone-bg);color:var(--text);}.verdict[data-tone='attention']{border-color:color-mix(in srgb,var(--tone) 40%,transparent);}.verdict[data-tone='failed']{border-color:color-mix(in srgb,var(--tone) 45%,transparent);}.verdict b{display:block;margin-bottom:2px;}.verdict ul{margin:2px 0 0;padding-left:18px;font-family:var(--mono);font-size:11.5px;}.scroller{flex:1 1 auto;min-height:0;overflow:auto;border:1px solid var(--line);border-radius:14px;background:linear-gradient(180deg,var(--panel),var(--well));padding:4px 2px 8px;font-size:12.5px;}.back{margin:6px 10px;background:var(--raise);border:1px solid var(--line2);border-radius:8px;padding:3px 10px;cursor:pointer;color:var(--text-2);}.back:hover{border-color:var(--accent);}.inv-body{display:flex;flex-direction:column;gap:10px;}.inv-head{border:1px solid var(--line2);border-radius:12px;background:var(--raise);padding:8px 10px;margin:4px 8px 6px;}.inv-who{display:flex;flex-wrap:wrap;gap:6px;}.inv-cmdbox{margin-top:6px;}.inv-cmdbox summary,.inv-prompt summary{cursor:pointer;font-size:11px;color:var(--text-muted);}.inv-prompt summary{font-size:11.5px;}.inv-prompt summary:hover{color:var(--accent);}.inv-cmd{font-family:var(--mono);font-size:11.5px;white-space:pre-wrap;word-break:break-all;margin:4px 0 6px;max-height:160px;overflow:auto;color:var(--text);}.inv-ptext{margin-top:6px;max-height:360px;overflow:auto;}.msg{display:flex;gap:9px;padding:3px 10px;}.av{width:22px;height:22px;flex:0 0 22px;border-radius:7px;line-height:22px;font-size:11px;text-align:center;font-weight:700;}.av-a{background:var(--agent-bg);color:var(--agent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--agent) 35%,transparent);}.av-l{background:var(--raise);color:var(--text-2);}.av-t{background:var(--raise);color:var(--text-muted);}.bd{flex:1;min-width:0;background:color-mix(in srgb,var(--text) 2.5%,transparent);border:1px solid var(--line);border-radius:3px 10px 10px 10px;padding:5px 10px;}.hd{font-size:11px;font-weight:600;color:var(--text-muted);margin-bottom:1px;}.tx{color:var(--text);line-height:1.5;word-break:break-word;}.tx pre,.tx code{white-space:pre-wrap;}.tx pre{margin:0 0 4px;}.toolcard,.typing{margin-left:41px;margin-right:10px;}.toolcard{border:1px solid var(--line);border-left:3px solid var(--line2);border-radius:10px;margin-top:3px;margin-bottom:3px;overflow:hidden;background:var(--well);transition:border-color 0.3s;}.toolcard.run{border-left-color:var(--status-running);}.toolcard.err{border-left-color:var(--status-failed);}.th{display:flex;gap:9px;align-items:baseline;padding:4px 9px;cursor:pointer;}.th:hover{background:color-mix(in srgb,var(--text) 4%,transparent);}.tn{font-family:var(--mono);font-weight:600;flex:none;display:inline-flex;align-items:center;}.tn::before{content:'⚒';display:inline-grid;place-items:center;width:20px;height:20px;margin-right:7px;border-radius:6px;background:var(--raise);color:var(--text-2);font-size:11px;}.toolcard[data-tool='bash'] .tn::before{content:'❯';}.toolcard[data-tool='read'] .tn::before{content:'▤';}.toolcard[data-tool='grep'] .tn::before,.toolcard[data-tool='glob'] .tn::before{content:'⌕';}.toolcard[data-tool='edit'] .tn::before,.toolcard[data-tool='write'] .tn::before{content:'✎';}.toolcard[data-tool='task'] .tn::before,.toolcard[data-tool='agent'] .tn::before{content:'✦';color:var(--agent);}.toolcard[data-tool='web-search'] .tn::before{content:'◍';}.toolcard[data-tool='web-fetch'] .tn::before{content:'⇣';}.toolcard.revealed{box-shadow:0 0 0 1px var(--accent);}.tp{font-family:var(--mono);font-size:11.5px;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.ti{color:var(--text-muted);font-size:11px;flex:none;max-width:35%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.st-run,.st-ok,.st-err,.st-int{flex:none;white-space:nowrap;}.st-run{color:var(--status-running);display:inline-flex;align-items:center;gap:6px;}.st-ok{color:var(--text-muted);}.st-ok>[aria-hidden]{color:var(--status-done);font-weight:700;}.st-err{color:var(--status-failed);}.st-int{color:var(--status-attention);}.pdot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--status-running);animation:breathe 1.8s ease-in-out infinite;}.tb{padding:6px 9px;border-top:1px solid var(--line);background:var(--bg);}.tb pre{white-space:pre-wrap;word-break:break-word;margin:4px 0;font-family:var(--mono);font-size:12px;}.fold{max-height:220px;overflow:hidden;position:relative;}.fold.open{max-height:none;}.foldbtn{cursor:pointer;color:var(--accent);font-size:11px;background:none;border:0;padding:0;font-family:inherit;}.wq{font-size:12px;margin:2px 0 6px;}.wq b{font-family:var(--mono);font-weight:600;}.wl{color:var(--text-muted);font-size:11px;margin-right:6px;}.links{margin:0 0 6px;padding-left:30px;font-size:12px;}.links li{margin:2px 0;overflow-wrap:anywhere;}.links a{color:var(--accent);text-decoration:none;}.links a:hover{text-decoration:underline;}.rawfold>summary{cursor:pointer;color:var(--text-muted);font-size:11px;}.plink{color:var(--accent);text-decoration:none;font-family:var(--mono);overflow-wrap:anywhere;}.plink:hover{text-decoration:underline;}.host{color:var(--text-muted);font-family:var(--mono);font-size:11px;margin-left:6px;}.sysline{display:flex;gap:8px;align-items:baseline;padding:2px 10px 2px 41px;font-size:11px;color:var(--text-muted);font-family:var(--mono);}.sysline .tx{color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.typing{display:flex;align-items:center;gap:10px;padding:10px 0;}.typing .av{width:26px;height:26px;flex:0 0 26px;border-radius:9px;display:grid;place-items:center;font-size:12px;}.dots{display:inline-flex;gap:4px;padding:8px 12px;border-radius:12px;background:var(--agent-bg);}.dots i{width:6px;height:6px;border-radius:50%;background:var(--agent);animation:bounce 1.2s infinite ease-in-out;}.dots i:nth-child(2){animation-delay:0.15s;}.dots i:nth-child(3){animation-delay:0.3s;}.scroller:not(.bulk) .msg,.scroller:not(.bulk) .toolcard{animation:enter 0.35s var(--ease) both;}.newpill{position:absolute;left:50%;bottom:26px;transform:translateX(-50%);z-index:5;cursor:pointer;padding:6px 14px;border-radius:999px;border:1px solid var(--accent);background:color-mix(in srgb,var(--panel) 92%,transparent);color:var(--accent);font-size:12px;font-weight:600;box-shadow:0 10px 28px color-mix(in srgb,var(--shadow) 50%,transparent);backdrop-filter:blur(6px);animation:toast-in 0.3s var(--ease) both;}.newpill:hover{background:var(--accent-bg);}`,Uo=e=>k`${e.map(e=>k`<span class="tag ${e.look??``}" part="tag" title=${e.tip??j}><span class="tag-l">${e.label}</span>${e.value}</span>`)}`,Wo=O` .tag{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;padding:2px 9px;border-radius:7px;border:1px solid var(--line2);white-space:nowrap;color:var(--text);background:var(--raise);}.tag-l{font-size:10px;font-weight:400;color:var(--text-muted);font-family:var(--sans);}.tag.mono,.tag.quiet{font-family:var(--mono);}.tag.quiet{color:var(--text-2);font-weight:500;background:none;}`,Go=class{constructor(e){this.scroller=e,this.stick=!0,this.restored=!1,this.lastTop=0,this.gliding=!1}toBottom(e=!1){let t=this.scroller();t&&(this.gliding=e,e?t.scrollTo({top:t.scrollHeight,behavior:`smooth`}):t.scrollTop=t.scrollHeight)}read(){let e=this.scroller();if(!e||!e.clientHeight)return null;let t=e.scrollHeight-e.scrollTop-e.clientHeight<60;return this.gliding&&(e.scrollTop<this.lastTop-1||t)&&(this.gliding=!1),this.stick=t||this.gliding,this.lastTop=e.scrollTop,{stick:this.stick,top:Math.round(e.scrollTop)}}async restore(e,t){let n=this.scroller();if(e&&!e.stick&&n){this.stick=!1;let r=performance.now()+4e3;await new Promise(i=>{let a=()=>{let o=n.scrollHeight-n.clientHeight;n.scrollTop=Math.min(e.top,o),o>=e.top||performance.now()>r||t()?i():requestAnimationFrame(a)};a()}),this.lastTop=n.scrollTop}else this.stick=!0,this.toBottom();this.restored=!0}reshow(){let e=this.scroller();e&&(this.stick?this.toBottom():e.scrollTop=this.lastTop)}};function Ko(e,t,n){let r=k`<pre><code>${t.slice(0,4e3)}</code></pre>`;if(t.length<=1200)return r;let i=e.folds.has(n);return k`<div>
|
|
274
|
+
</div>`}get laidOut(){return this.layFor===this.key}get asTable(){return this.view===`table`}focusSelect(e){this.card.quiet||this.select(e)}drill(e){R(this,`cae-drill`,{id:e})}toggle(e,t){R(this,`cae-toggle`,{id:e,open:t})}showView(e){this.matrix&&e===`table`||(this.matrix||(this.view=e),R(this,`cae-view-change`,{view:e}))}},Bo=(e,t,n)=>e===1?`1 ${t}`:`${e} ${n}`,Vo={sections:`Sessions`,sectionsTip:``,loadEarlier:e=>`Show ${Bo(e,`earlier line`,`earlier lines`)}`,newBelow:e=>`Show ${Bo(e,`new event`,`new events`)}`,newInLatest:e=>`Show ${Bo(e,`new event`,`new events`)} in the latest session`,prompt:`Prompt`,assistant:`Assistant`,reasoning:`Reasoning`,characters:e=>`${e} characters`,tool:`tool`,results:e=>Bo(e,`result`,`results`),done:`done`,failed:`failed`,running:`running`,interrupted:`interrupted`,interruptedTip:`Ended with no result`,query:`query`,page:`page`,fullText:`Full text`,showAll:e=>`Show all (${e} characters)`,showLess:`Show less`},Ho=k` :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;}:host([mode='tabs']) .scroller,:host([mode='tabs']) .newpill{display:none;}.rounds{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 10px;padding-left:2px;}.rounds-lbl{color:var(--text-muted);font-size:11.5px;font-weight:600;margin-right:4px;cursor:help;}.stab{padding:3px 11px;border:1px solid var(--line);border-radius:999px;background:var(--card);color:var(--text-muted);cursor:pointer;font-size:12px;display:inline-flex;align-items:center;}.stab:hover{border-color:var(--accent);}.stab.sel{background:var(--accent-bg);border-color:var(--accent);color:var(--text);}.stab-m{font-family:var(--mono);font-size:10.5px;color:var(--text-muted);margin-left:4px;}.stab.sel .stab-m{color:var(--text-2);}.stab .dot{width:6px;height:6px;margin-left:4px;}.stab .mk{margin-right:4px;}.stab .mk.ok{color:var(--status-done);}.stab .mk.bad{color:var(--status-failed);}.verdict{margin:6px 10px 4px 41px;padding:7px 11px;border-radius:10px;border:1px solid;font-size:12px;}.verdict[data-tone]{background:var(--tone-bg);color:var(--text);}.verdict[data-tone='attention']{border-color:color-mix(in srgb,var(--tone) 40%,transparent);}.verdict[data-tone='failed']{border-color:color-mix(in srgb,var(--tone) 45%,transparent);}.verdict b{display:block;margin-bottom:2px;}.verdict ul{margin:2px 0 0;padding-left:18px;font-family:var(--mono);font-size:11.5px;}.scroller{flex:1 1 auto;min-height:0;overflow:auto;border:1px solid var(--line);border-radius:14px;background:linear-gradient(180deg,var(--panel),var(--well));padding:4px 2px 8px;font-size:12.5px;}.back{margin:6px 10px;background:var(--raise);border:1px solid var(--line2);border-radius:8px;padding:3px 10px;cursor:pointer;color:var(--text-2);}.back:hover{border-color:var(--accent);}.inv-body{display:flex;flex-direction:column;gap:10px;}.inv-head{border:1px solid var(--line2);border-radius:12px;background:var(--raise);padding:8px 10px;margin:4px 8px 6px;}.inv-who{display:flex;flex-wrap:wrap;gap:6px;}.inv-cmdbox{margin-top:6px;}.inv-cmdbox summary,.inv-prompt summary{cursor:pointer;font-size:11px;color:var(--text-muted);}.inv-prompt summary{font-size:11.5px;}.inv-prompt summary:hover{color:var(--accent);}.inv-cmd{font-family:var(--mono);font-size:11.5px;white-space:pre-wrap;word-break:break-all;margin:4px 0 6px;max-height:160px;overflow:auto;color:var(--text);}.inv-ptext{margin-top:6px;max-height:360px;overflow:auto;}.msg{display:flex;gap:9px;padding:3px 10px;}.av{width:22px;height:22px;flex:0 0 22px;border-radius:7px;line-height:22px;font-size:11px;text-align:center;font-weight:700;}.av-a{background:var(--agent-bg);color:var(--agent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--agent) 35%,transparent);}.av-l{background:var(--raise);color:var(--text-2);}.av-t{background:var(--raise);color:var(--text-muted);}.bd{flex:1;min-width:0;background:color-mix(in srgb,var(--text) 2.5%,transparent);border:1px solid var(--line);border-radius:3px 10px 10px 10px;padding:5px 10px;}.hd{font-size:11px;font-weight:600;color:var(--text-muted);margin-bottom:1px;}.tx{color:var(--text);line-height:1.5;word-break:break-word;}.tx pre,.tx code{white-space:pre-wrap;}.tx pre{margin:0 0 4px;}.toolcard,.typing{margin-left:41px;margin-right:10px;}.toolcard{border:1px solid var(--line);border-left:3px solid var(--line2);border-radius:10px;margin-top:3px;margin-bottom:3px;overflow:hidden;background:var(--well);transition:border-color 0.3s;}.toolcard.run{border-left-color:var(--status-running);}.toolcard.err{border-left-color:var(--status-failed);}.th{display:flex;gap:9px;align-items:baseline;padding:4px 9px;cursor:pointer;}.th:hover{background:color-mix(in srgb,var(--text) 4%,transparent);}.tn{font-family:var(--mono);font-weight:600;flex:none;display:inline-flex;align-items:center;}.tn::before{content:'⚒';display:inline-grid;place-items:center;width:20px;height:20px;margin-right:7px;border-radius:6px;background:var(--raise);color:var(--text-2);font-size:11px;}.toolcard[data-tool='bash'] .tn::before{content:'❯';}.toolcard[data-tool='read'] .tn::before{content:'▤';}.toolcard[data-tool='grep'] .tn::before,.toolcard[data-tool='glob'] .tn::before{content:'⌕';}.toolcard[data-tool='edit'] .tn::before,.toolcard[data-tool='write'] .tn::before{content:'✎';}.toolcard[data-tool='task'] .tn::before,.toolcard[data-tool='agent'] .tn::before{content:'✦';color:var(--agent);}.toolcard[data-tool='web-search'] .tn::before{content:'◍';}.toolcard[data-tool='web-fetch'] .tn::before{content:'⇣';}.toolcard.revealed{box-shadow:0 0 0 1px var(--accent);}.tp{font-family:var(--mono);font-size:11.5px;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.ti{color:var(--text-muted);font-size:11px;flex:none;max-width:35%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.st-run,.st-ok,.st-err,.st-int{flex:none;white-space:nowrap;}.st-run{color:var(--status-running);display:inline-flex;align-items:center;gap:6px;}.st-ok{color:var(--text-muted);}.st-ok>[aria-hidden]{color:var(--status-done);font-weight:700;}.st-err{color:var(--status-failed);}.st-int{color:var(--status-attention);}.pdot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--status-running);animation:breathe 1.8s ease-in-out infinite;}.tb{padding:6px 9px;border-top:1px solid var(--line);background:var(--bg);}.tb pre{white-space:pre-wrap;word-break:break-word;margin:4px 0;font-family:var(--mono);font-size:12px;}.fold{max-height:220px;overflow:hidden;position:relative;}.fold.open{max-height:none;}.foldbtn{cursor:pointer;color:var(--accent);font-size:11px;background:none;border:0;padding:0;font-family:inherit;}.wq{font-size:12px;margin:2px 0 6px;}.wq b{font-family:var(--mono);font-weight:600;}.wl{color:var(--text-muted);font-size:11px;margin-right:6px;}.links{margin:0 0 6px;padding-left:30px;font-size:12px;}.links li{margin:2px 0;overflow-wrap:anywhere;}.links a{color:var(--accent);text-decoration:none;}.links a:hover{text-decoration:underline;}.rawfold>summary{cursor:pointer;color:var(--text-muted);font-size:11px;}.plink{color:var(--accent);text-decoration:none;font-family:var(--mono);overflow-wrap:anywhere;}.plink:hover{text-decoration:underline;}.host{color:var(--text-muted);font-family:var(--mono);font-size:11px;margin-left:6px;}.sysline{display:flex;gap:8px;align-items:baseline;padding:2px 10px 2px 41px;font-size:11px;color:var(--text-muted);font-family:var(--mono);}.sysline .tx{color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.typing{display:flex;align-items:center;gap:10px;padding:10px 0;}.typing .av{width:26px;height:26px;flex:0 0 26px;border-radius:9px;display:grid;place-items:center;font-size:12px;}.dots{display:inline-flex;gap:4px;padding:8px 12px;border-radius:12px;background:var(--agent-bg);}.dots i{width:6px;height:6px;border-radius:50%;background:var(--agent);animation:bounce 1.2s infinite ease-in-out;}.dots i:nth-child(2){animation-delay:0.15s;}.dots i:nth-child(3){animation-delay:0.3s;}.scroller:not(.bulk) .msg,.scroller:not(.bulk) .toolcard{animation:enter 0.35s var(--ease) both;}.newpill{position:absolute;left:50%;bottom:26px;transform:translateX(-50%);z-index:5;cursor:pointer;padding:6px 14px;border-radius:999px;border:1px solid var(--accent);background:color-mix(in srgb,var(--panel) 92%,transparent);color:var(--accent);font-size:12px;font-weight:600;box-shadow:0 10px 28px color-mix(in srgb,var(--shadow) 50%,transparent);backdrop-filter:blur(6px);animation:toast-in 0.3s var(--ease) both;}.newpill:hover{background:var(--accent-bg);}`,Uo=e=>A`${e.map(e=>A`<span class="tag ${e.look??``}" part="tag" title=${e.tip??M}><span class="tag-l">${e.label}</span>${e.value}</span>`)}`,Wo=k` .tag{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;padding:2px 9px;border-radius:7px;border:1px solid var(--line2);white-space:nowrap;color:var(--text);background:var(--raise);}.tag-l{font-size:10px;font-weight:400;color:var(--text-muted);font-family:var(--sans);}.tag.mono,.tag.quiet{font-family:var(--mono);}.tag.quiet{color:var(--text-2);font-weight:500;background:none;}`,Go=class{constructor(e){this.scroller=e,this.stick=!0,this.restored=!1,this.lastTop=0,this.gliding=!1}toBottom(e=!1){let t=this.scroller();t&&(this.gliding=e,e?t.scrollTo({top:t.scrollHeight,behavior:`smooth`}):t.scrollTop=t.scrollHeight)}read(){let e=this.scroller();if(!e||!e.clientHeight)return null;let t=e.scrollHeight-e.scrollTop-e.clientHeight<60;return this.gliding&&(e.scrollTop<this.lastTop-1||t)&&(this.gliding=!1),this.stick=t||this.gliding,this.lastTop=e.scrollTop,{stick:this.stick,top:Math.round(e.scrollTop)}}async restore(e,t){let n=this.scroller();if(e&&!e.stick&&n){this.stick=!1;let r=performance.now()+4e3;await new Promise(i=>{let a=()=>{let o=n.scrollHeight-n.clientHeight;n.scrollTop=Math.min(e.top,o),o>=e.top||performance.now()>r||t()?i():requestAnimationFrame(a)};a()}),this.lastTop=n.scrollTop}else this.stick=!0,this.toBottom();this.restored=!0}reshow(){let e=this.scroller();e&&(this.stick?this.toBottom():e.scrollTop=this.lastTop)}};function Ko(e,t,n){let r=A`<pre><code>${t.slice(0,4e3)}</code></pre>`;if(t.length<=1200)return r;let i=e.folds.has(n);return A`<div>
|
|
272
275
|
<div class="fold ${i?`open`:``}">${r}</div>
|
|
273
276
|
<button type="button" class="foldbtn" @click=${()=>{i?e.folds.delete(n):e.folds.add(n),e.requestUpdate()}}>${i?e.s.showLess:e.s.showAll(t.length)}</button>
|
|
274
|
-
</div>`}var qo=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,Jo=class extends
|
|
277
|
+
</div>`}var qo=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,Jo=class extends N{constructor(...e){super(...e),this.sections=[],this.shown=null,this.live=!1,this.earlier=0,this.loading=!1,this.count=null,this.mode=`full`,this.memory=null,this.markdown=null,this.renderDetail=null,this.strings={},this.bulk=!0,this.unseen=0,this.pinned=null,this.revealed=``,this.revealPending=!1,this.follow=new Go(()=>this.scroller),this.started=!1,this.total=0,this.reloading=!1,this.lastShown=-1,this.opened=new Set,this.folds=new Set,this.openDetails=new Set,this.mdCache=new Map}static{this.styles=[V,Gr,Wo,Ho]}get shownIndex(){let e=this.sections.length;if(!e)return-1;let t=this.shown??this.pinned??e-1;return Math.max(0,Math.min(e-1,t))}reveal(e){let t=this.sections.findIndex(t=>t.items.some(t=>t.id===e));return t<0?-1:(this.setOpen(e,!0),this.pinned=null,this.revealed=e,this.revealPending=!0,this.requestUpdate(),t)}onLatest(){let e=this.sections.length;return e<2||this.shownIndex===e-1}isOpen(e){return this.memory?this.memory.isOpen(e):this.opened.has(e)}setOpen(e,t){this.memory?this.memory.setOpen(e,t):t?this.opened.add(e):this.opened.delete(e)}willUpdate(e){let t=this.count??this.sections.reduce((e,t)=>e+1+t.items.length,0);if(e.has(`sections`)){let n=e.get(`sections`)?.length??0;n&&this.sections.length>n&&this.shown===null&&this.pinned===null&&!this.follow.stick&&!this.bulk&&(this.pinned=n-1),this.reloading&&(this.reloading=!1,this.lastShown=-1,this.total=t)}if(!this.loading){if(this.started){if(t!==this.total){let e=t-this.total;this.total=t,e>0&&this.updateComplete.then(()=>{this.follow.stick&&this.onLatest()?this.follow.toBottom(!qo()):this.unseen+=e})}}else this.started=!0,this.total=t,this.afterFirst()}}async afterFirst(){await this.updateComplete,await this.follow.restore(this.memory?.scroll(),()=>!this.isConnected),requestAnimationFrame(()=>this.bulk=!1)}onScroll(){let e=this.follow.read();e&&(this.follow.stick&&this.onLatest()&&(this.unseen=0),this.follow.restored&&this.memory?.setScroll(e))}updated(e){let t=this.shownIndex;if(t!==this.lastShown){let e=this.lastShown;this.lastShown=t,e!==-1&&this.follow.restored&&(this.follow.toBottom(),qo()||this.scroller?.animate?.([{opacity:.25},{opacity:1}],{duration:240,easing:`ease-out`})),R(this,`cae-section-shown`,{index:t})}let n=e.get(`mode`);if(n&&n!==`full`&&this.mode===`full`&&this.follow.reshow(),this.revealPending){let e=this.renderRoot.querySelector(`[data-card="${CSS.escape(this.revealed)}"]`);e&&this.mode===`full`&&(this.revealPending=!1,this.follow.stick=!1,e.scrollIntoView({block:`center`}))}}pick(e){this.pinned=null,R(this,`cae-section-change`,{index:e===this.sections.length-1?null:e})}toLatest(){let e=this.sections.length;e>1&&this.shownIndex!==e-1&&(this.pinned=null,this.shown!==null&&R(this,`cae-section-change`,{index:null})),this.follow.stick=!0,this.unseen=0,this.updateComplete.then(()=>this.follow.toBottom(!0))}loadEarlier(){this.reloading=!0,R(this,`cae-load-earlier`,{})}render(){let e=Ar(Vo,this.strings),t=this.sections,n=this.shownIndex,r=t[n],i={s:e,live:this.live,revealed:this.revealed,folds:this.folds,isOpen:e=>this.isOpen(e),toggle:e=>{this.setOpen(e,!this.isOpen(e)),this.requestUpdate()},requestUpdate:()=>this.requestUpdate()};return A`${this.renderPicker(t,n,e)}
|
|
275
278
|
<div class="scroller ${this.bulk?`bulk`:``}" @scroll=${()=>this.onScroll()}>
|
|
276
|
-
${this.earlier?
|
|
277
|
-
${e.loadEarlier(this.earlier)}</button></div>`:
|
|
278
|
-
${r?wo(r.id,this.renderSection(r,n===t.length-1,e,i)):
|
|
279
|
-
${!r&&this.live?this.typing(e):
|
|
279
|
+
${this.earlier?A`<div class="meta"><button type="button" class="back" @click=${()=>this.loadEarlier()}>
|
|
280
|
+
${e.loadEarlier(this.earlier)}</button></div>`:M}
|
|
281
|
+
${r?wo(r.id,this.renderSection(r,n===t.length-1,e,i)):M}
|
|
282
|
+
${!r&&this.live?this.typing(e):M}
|
|
280
283
|
</div>
|
|
281
|
-
${this.unseen?
|
|
282
|
-
${this.onLatest()?e.newBelow(this.unseen):e.newInLatest(this.unseen)}</button>`:
|
|
283
|
-
<span class="rounds-lbl" title=${n.sectionsTip||
|
|
284
|
-
${e.map((e,n)=>{let r=e.verdict;return
|
|
285
|
-
${r?
|
|
286
|
-
${e.facts?.length?
|
|
287
|
-
${e.active?
|
|
284
|
+
${this.unseen?A`<button type="button" class="newpill" @click=${()=>this.toLatest()}>
|
|
285
|
+
${this.onLatest()?e.newBelow(this.unseen):e.newInLatest(this.unseen)}</button>`:M}`}renderPicker(e,t,n){return e.length<2?M:A`<div class="rounds" role="group" aria-label=${n.sections} part="picker">
|
|
286
|
+
<span class="rounds-lbl" title=${n.sectionsTip||M}>${n.sections}</span>
|
|
287
|
+
${e.map((e,n)=>{let r=e.verdict;return A`<button type="button" class="stab ${n===t?`sel`:``}" title=${r?.tip||M} aria-pressed=${n===t} @click=${()=>this.pick(n)}>
|
|
288
|
+
${r?A`<span class="mk ${r.tone===`done`?`ok`:`bad`}" aria-hidden="true">${r.tone===`done`?`✓`:`✕`}</span><span class="sr">${r.text}</span>`:M}${e.title}
|
|
289
|
+
${e.facts?.length?A` <span class="stab-m">${e.facts.join(` | `)}</span>`:M}
|
|
290
|
+
${e.active?A`<span class="dot" data-tone="running"></span>`:M}
|
|
288
291
|
</button>`})}
|
|
289
|
-
</div>`}renderSection(e,t,n,r){let i=e.footer;return
|
|
290
|
-
${e.tags?.length||e.details?.length?this.renderHead(e):
|
|
292
|
+
</div>`}renderSection(e,t,n,r){let i=e.footer;return A`<div class="inv-body" part="section">
|
|
293
|
+
${e.tags?.length||e.details?.length?this.renderHead(e):M}
|
|
291
294
|
${H(e.items,e=>e.id,e=>this.renderItem(e,n,r))}
|
|
292
|
-
${t&&this.live?this.typing(n):
|
|
293
|
-
${i?
|
|
295
|
+
${t&&this.live?this.typing(n):M}
|
|
296
|
+
${i?A`<div class="verdict" part="verdict" data-tone=${L(i.tone)}>
|
|
294
297
|
<b>${i.title}</b>
|
|
295
|
-
${i.list?.length?
|
|
296
|
-
</div>`:
|
|
297
|
-
</div>`}renderHead(e){return
|
|
298
|
+
${i.list?.length?A`<ul>${i.list.map(e=>A`<li>${e}</li>`)}</ul>`:i.note?A`<span class="meta">${i.note}</span>`:M}
|
|
299
|
+
</div>`:M}
|
|
300
|
+
</div>`}renderHead(e){return A`<div class="inv-head">
|
|
298
301
|
<div class="inv-who">${Uo(e.tags??[])}</div>
|
|
299
|
-
${(e.details??[]).map(t=>t.code?
|
|
300
|
-
</div>`}renderProse(e,t){let n=`${e.id}:${t.id}`,r=this.openDetails.has(n);return
|
|
302
|
+
${(e.details??[]).map(t=>t.code?A`<details class="inv-cmdbox"><summary>${t.summary}</summary><pre class="inv-cmd"><code>${t.text}</code></pre></details>`:this.renderProse(e,t))}
|
|
303
|
+
</div>`}renderProse(e,t){let n=`${e.id}:${t.id}`,r=this.openDetails.has(n);return A`<details class="inv-prompt" ?open=${r} @toggle=${e=>{let t=e.target.open;t!==this.openDetails.has(n)&&(t?this.openDetails.add(n):this.openDetails.delete(n),this.requestUpdate())}}>
|
|
301
304
|
<summary>${t.summary}</summary>
|
|
302
|
-
${r?
|
|
303
|
-
</details>`}md(e,t){if(!this.markdown)return t;let n=this.mdCache.get(e);if(n?.raw===t)return qi(n.html);let r=this.markdown(t);return this.mdCache.set(e,{raw:t,html:r}),qi(r)}bubble(e,t,n,r,i){return
|
|
305
|
+
${r?A`<div class="inv-ptext">${this.renderDetail?this.renderDetail(t):A`<div class="tx">${this.md(n,t.text)}</div>`}</div>`:M}
|
|
306
|
+
</details>`}md(e,t){if(!this.markdown)return t;let n=this.mdCache.get(e);if(n?.raw===t)return qi(n.html);let r=this.markdown(t);return this.mdCache.set(e,{raw:t,html:r}),qi(r)}bubble(e,t,n,r,i){return A`<div class="msg" part="bubble" title=${i??M}>
|
|
304
307
|
<div class="av ${t}">${e}</div>
|
|
305
308
|
<div class="bd"><div class="hd">${n}</div>${r}</div>
|
|
306
|
-
</div>`}renderItem(e,t,n){switch(e.type){case`prompt`:return this.bubble(`▸`,`av-l`,t.prompt,
|
|
309
|
+
</div>`}renderItem(e,t,n){switch(e.type){case`prompt`:return this.bubble(`▸`,`av-l`,t.prompt,A`<div class="tx meta">${t.characters(e.text.length)}</div>`,e.text.slice(0,600));case`message`:return this.bubble(`A`,`av-a`,t.assistant,A`<div class="tx">${this.md(e.id,e.text)}</div>`);case`reasoning`:return this.bubble(`✦`,`av-t`,t.reasoning,A`<div class="tx">${this.md(e.id,e.text)}</div>`);case`event`:return A`<div class="msg" part="bubble"><div class="av av-t" aria-hidden="true">${e.icon}</div><div class="bd"><div class="hd">${e.title}</div>${e.text?A`<div class="tx meta">${e.text}</div>`:M}</div></div>`;case`notice`:return A`<div class="sysline" part="notice"><span aria-hidden="true">⚙</span><span class="tx">${e.text}</span></div>`;case`tool`:return function(e,t){let{s:n}=e,r=e.isOpen(t.id),i=t.links?.length??0,a=t.status===`ok`?A`<span class="st-ok"><span aria-hidden="true">✓</span> ${n.done}</span>`:t.status===`error`?A`<span class="st-err"><span aria-hidden="true">✕</span> ${n.failed}</span>`:e.live?A`<span class="st-run"><i class="pdot"></i>${n.running}</span>`:A`<span class="st-int" title=${n.interruptedTip}><span aria-hidden="true">◌</span> ${n.interrupted}</span>`;return A`<div class="toolcard ${t.status===`running`?`run`:t.status===`error`?`err`:`ok`} ${e.revealed===t.id?`revealed`:``}" part="tool" data-tool=${t.query?`web-search`:t.page?`web-fetch`:t.icon} data-card=${t.id}>
|
|
307
310
|
<div class="th" role="button" tabindex="0" aria-expanded=${r?`true`:`false`} @click=${()=>e.toggle(t.id)} @keydown=${e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),e.currentTarget.click())}}>
|
|
308
311
|
<span class="tn">${t.name||n.tool}</span><span class="tp">${t.summary}</span><span class="ti" >${i?n.results(i):t.intent}</span >${a}
|
|
309
312
|
</div>
|
|
310
|
-
${r?
|
|
311
|
-
<span class="wl">${t.query?e.s.query:e.s.page}</span>${a?
|
|
313
|
+
${r?A`<div class="tb" part="tool-body">${function(e,t){let n=t.output,r=t.links??[],i=t.query||t.page;if(!i)return n===null?Ko(e,t.body??``,`${t.id}:cmd`):A`${t.body?Ko(e,t.body,`${t.id}:cmd`):M}${Ko(e,n,`${t.id}:out`)}`;let a=!t.query&&/^https?:\/\//.test(i);return A`<div class="wq">
|
|
314
|
+
<span class="wl">${t.query?e.s.query:e.s.page}</span>${a?A`<a class="plink" href=${i} target="_blank" rel="noopener noreferrer">${i}</a>`:A`<b>${i}</b>`}
|
|
312
315
|
</div>
|
|
313
|
-
${r.length?
|
|
314
|
-
${r.map(e=>
|
|
315
|
-
</ol>`:
|
|
316
|
-
${n===null?
|
|
317
|
-
</div>`}(n,e)}}typing(e){return
|
|
318
|
-
`)[0]||``).trim();return n.length>100?`${n.slice(0,100)}…`:n}function
|
|
319
|
-
`)}var
|
|
316
|
+
${r.length?A`<ol class="links">
|
|
317
|
+
${r.map(e=>A`<li><a href=${e.url} target="_blank" rel="noopener noreferrer">${e.title}</a><span class="host">${function(e){try{return new URL(e).host}catch{return``}}(e.url)}</span></li>`)}
|
|
318
|
+
</ol>`:M}
|
|
319
|
+
${n===null?M:r.length?A`<details class="rawfold"><summary>${e.s.fullText}</summary>${Ko(e,n,`${t.id}:out`)}</details>`:Ko(e,n,`${t.id}:out`)}`}(e,t)}</div>`:M}
|
|
320
|
+
</div>`}(n,e)}}typing(e){return A`<div class="typing"><span class="av av-a">A</span><span class="dots"><i></i><i></i><i></i></span><span class="meta">${e.running}</span></div>`}};U([F({attribute:!1})],Jo.prototype,`sections`,void 0),U([F({attribute:!1})],Jo.prototype,`shown`,void 0),U([F({type:Boolean})],Jo.prototype,`live`,void 0),U([F({type:Number})],Jo.prototype,`earlier`,void 0),U([F({type:Boolean})],Jo.prototype,`loading`,void 0),U([F({attribute:!1})],Jo.prototype,`count`,void 0),U([F({reflect:!0})],Jo.prototype,`mode`,void 0),U([F({attribute:!1})],Jo.prototype,`memory`,void 0),U([F({attribute:!1})],Jo.prototype,`markdown`,void 0),U([F({attribute:!1})],Jo.prototype,`renderDetail`,void 0),U([F({attribute:!1})],Jo.prototype,`strings`,void 0),U([I()],Jo.prototype,`bulk`,void 0),U([I()],Jo.prototype,`unseen`,void 0),U([I()],Jo.prototype,`pinned`,void 0),U([I()],Jo.prototype,`revealed`,void 0),U([bn(`.scroller`)],Jo.prototype,`scroller`,void 0);var Yo=new Map;function G(e,t=!1,n=An()){if(!e)return``;let r=new Date(e);return Number.isNaN(r.getTime())?e:function(e,t){let n=`${e}|${t}`,r=Yo.get(n);return r||(r=new Intl.DateTimeFormat(e,{...t?{month:`short`,day:`numeric`}:{},hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}),Yo.set(n,r)),r}(n,t).format(r)}function Xo(e,t=Date.now()){let n=Date.parse(e||``);if(Number.isNaN(n))return``;let r=Math.max(0,(t-n)/1e3);return D(r<60?`just now`:r<3600?E`${Math.floor(r/60)}m ago`:r<86400?E`${Math.floor(r/3600)}h ago`:E`${Math.floor(r/86400)}d ago`)}var Zo=e=>e.charAt(0).toLocaleUpperCase(An())+e.slice(1),Qo=(...e)=>e.filter(e=>!!e),K=(...e)=>Qo(...e).join(` | `),$o=new Map;function q(e,t=An()){let n=$o.get(t);return n||(n=new Intl.ListFormat(t,{type:`conjunction`}),$o.set(t,n)),n.format(e)}var J=(e,t=` · `)=>`${e.kind??``}${e.unit?t+e.unit:``}`;function es(e){let t=(e||``).trim();if(!t)return``;let n=(t.split(`
|
|
321
|
+
`)[0]||``).trim();return n.length>100?`${n.slice(0,100)}…`:n}function Y(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 X(e){return e==null?`—`:e===0?`$0`:e<.001?`<$0.001`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function ts(e){let t=new Set(e.map(e=>e.usage_unknown??``));return t.has(`tokens`)?`tokens`:t.has(`calls`)?`calls`:``}function ns(e){return e===`calls`?{label:D(`Tokens per API call unknown`),tip:D(`Only the token totals that the coding agent printed are known, not the tokens of each API call (usage_unknown)`)}:e===`tokens`?{label:D(`Tokens unknown`),tip:D(`The tokens of an agent session that ran are not known (usage_unknown)`)}:null}function rs(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 is(e){switch(e){case`done`:return D(`done`,{id:`outcome-done`});case`recovered`:return D(`done after retrying`);case`partial`:return D(`partly done`,{id:`outcome-partial`});case`failed`:return D(`failed`);case`not_started`:return D(`not started`);case`running`:return D(`running`);case`waiting`:return D(`waiting`);case`skipped`:return D(`skipped`);case`cancelled`:return D(`cancelled`,{id:`outcome-cancelled`})}}var as=(e,t)=>e!==`waiting`||t?is(e):D(`not run`);function Z(e,t){switch(e){case`done`:return D(E`${t} done`);case`recovered`:return D(E`${t} done after retrying`);case`partial`:return D(E`${t} partly done`);case`failed`:return D(E`${t} failed`);case`not_started`:return D(E`${t} not started`);case`running`:return D(E`${t} running`);case`waiting`:return D(E`${t} waiting`);case`skipped`:return D(E`${t} skipped`);case`cancelled`:return D(E`${t} cancelled`);case`not_run`:return D(E`${t} not run`)}}function os(e,t){return e>0?t:`neutral`}function ss(e,t){return e===`running`?`running`:e===`unresponsive`?`attention`:t?.total?t.failed?`failed`:t.not_started||t.partial?`attention`:`done`:`neutral`}var cs={completed:`done`,partial:`attention`,invalid_input:`attention`,skipped:`muted`,cancelled:`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`},ls=(Object.keys(cs),e=>e!=null&&Object.hasOwn(cs,e));function us(e){return ls(e)?cs[e]:`failed`}function ds(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`:case`cancelled`:return`muted`}}function fs(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 ps=e=>e===`waiting`?`pending`:Yr(ds(e));function Q(e,t){return e?ls(e)?function(e,t){switch(e){case`completed`:return D(`done`,{id:`stop-completed`});case`skipped`:return D(`skipped`);case`cancelled`:return D(`cancelled`,{id:`stop-cancelled`});case`partial`:return D(`partly done`,{id:`stop-partial`});case`invalid_input`:{let e=new Set(Re(t).map(e=>e.problem));return e.size===1&&e.has(`missing`)?D(`not started (input missing)`):e.size===1&&e.has(`checks`)?D(`not started (input failed checks)`):e.size===1&&e.has(`failed`)?D(`not started (earlier task failed)`):e.size===2&&e.has(`missing`)&&e.has(`checks`)?D(`not started (input missing and input failed checks)`):D(`not started`,{id:`stop-invalid-input`})}case`invalid_output`:return D(`failed checks`);case`timeout`:return D(`timed out`);case`max_turns`:return D(`turn limit reached`);case`budget`:return D(`cost limit reached`);case`context_budget`:return D(`context limit reached`);case`stalled`:return D(`stalled (no events)`);case`auth_failed`:return D(`authentication failed`);case`api_error`:return D(`API error`);case`rate_limited`:return D(`rate limited`);case`refused`:return D(`refused by the model`);case`aborted`:return D(`aborted`);case`denied`:return D(`permission denied`);case`error`:return D(`error`);case`no_output`:return D(`ended without a result`);case`launch_failed`:return D(`agent session did not start`);case`credential_mismatch`:return D(`wrong identity used`)}}(e,t):D(E`unknown (${e})`):`—`}function ms(e,t,n){return t===`failed`?D(n?E`input ${e} is the output of failed task ${n.name}`:E`input ${e} is the output of a failed task`):t===`checks`?D(n?E`input ${e} from ${n.name} failed checks`:E`input ${e} failed checks`):n?n.outcome===`failed`?D(E`input ${e} is missing because ${n.name} failed`):n.outcome===`not_started`?D(E`input ${e} is missing because ${n.name} did not start`):n.outcome&&g(n.outcome)?D(E`input ${e} from ${n.name} is missing`):D(E`input ${e} is missing because ${n.name} did not finish`):D(E`input ${e} is missing`)}function hs(e,t,n,r){let i=e.attempts[e.attempts.length-1];if(i?.stop===`invalid_input`){let e=Re(i.reason)[0];if(!e)return T(i.reason,n);let a=e.producer||r?.(e.path)||``,o=a?t.get(a):void 0;return ms(T(e.path,n),e.problem,o?{name:J(o),outcome:o.outcome}:void 0)}let a=e.cause?t.get(e.cause):void 0;return a?D(E`earlier task ${J(a)} failed`):``}var gs=()=>D(`An attempt after a failed attempt (retries)`),_s=e=>D(E`Attempt ${(e??0)+1}`);function vs(e){let t=ce(e),n=e.map((e,n)=>t[n]?K(_s(e.attempt),D(`resumed run`)):_s(e.attempt));return n.map((t,r)=>n.indexOf(t)===n.lastIndexOf(t)?t:K(t,G(e[r]?.ts)))}function ys(e){return e<=0?``:D(e===1?`1 correction`:E`${e} corrections`)}var bs=e=>D(E`Pass ${e}`),xs=e=>D(e<=1?`1 pass`:E`up to ${e} passes`),Ss=e=>D(e<=1?`1 pass`:E`${e} passes`),Cs=e=>e.map(([e,t])=>D(e<=1?E`1 pass: ${t}`:E`${e} passes: ${t}`)).join(` | `),ws=()=>D(`loop`),Ts=e=>e?e===`ambient`?D(`default`):e:``,Es=e=>e===`ambient`?D(`local credentials (ambient)`):``,Ds=e=>e==null?`—`:`${Math.round(e)}%`;function Os(e,t){if(!e||e===`allowed`)return``;let n=e.split(`,`),r=n.some(e=>[`rejected`,`exhausted`,`quota`,`blocked`].includes(e))?D(`limit reached`):n.every(e=>[`allowed_warning`,`warning`].includes(e))?D(`near the limit`):D(E`unknown (${e})`);return t?K(r,ks(t)):r}function ks(e){if(e===`five_hour`)return D(`5-hour`);if(e===`seven_day`)return D(`weekly`);let t=/^(five_hour|seven_day)_(.+)$/.exec(e);return t?t[1]===`five_hour`?D(E`5-hour (${t[2]})`):D(E`weekly (${t[2]})`):e}var As=e=>D(E`account ${e.slice(0,6)}`),js=e=>K(D(E`weekly ${Ds(e.seven_day_pct)}`),D(E`5-hour ${Ds(e.five_hour_pct)}`));function Ms(e){let t=[e.seven_day_resets_at?D(E`Weekly usage ${Ds(e.seven_day_pct)} (resets ${G(e.seven_day_resets_at,!0)})`):D(E`Weekly usage ${Ds(e.seven_day_pct)}`),e.five_hour_resets_at?D(E`5-hour usage ${Ds(e.five_hour_pct)} (resets ${G(e.five_hour_resets_at,!0)})`):D(E`5-hour usage ${Ds(e.five_hour_pct)}`),...Object.entries(e.windows??{}).filter(([e])=>e!==`five_hour`&&e!==`seven_day`).map(([e,t])=>D(E`${Zo(ks(e))} usage ${Ds(t.pct)}`)),D(E`Reported ${G(e.observed_at,!0)}`)],n=Os(e.status,e.status_window);return n&&t.push(D(E`Status: ${n}`)),e.threshold_pct!=null&&t.push(D(E`Warning threshold: ${Ds(e.threshold_pct)}`)),e.overage_status&&t.push(D(E`Extra usage: ${function(e){return e===`allowed`||e===`allowed_warning`?D(`allowed`):e===`rejected`?D(`not allowed`):e}(e.overage_status)}`)),e.account&&t.push(D(E`Account: ${e.account}`)),t.join(`
|
|
322
|
+
`)}var Ns=e=>K(js(e),Ts(e.credential));function Ps(e){let t=e[0];if(!t)return``;let n=e.length-1;return n?K(Ns(t.last),D(n===1?`1 more account`:E`${n} more accounts`)):js(t.last)}var Fs=e=>e.map(e=>e.credential?`${Ts(e.credential)}\n${Ms(e.last)}`:Ms(e.last)).join(`
|
|
320
323
|
|
|
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>
|
|
324
|
+
`);function Is(e,t){return D(e===`seven_day`?E`Weekly usage ${Ds(t)}`:E`5-hour usage ${Ds(t)}`)}var Ls=e=>e==null?`—`:`${Number(e.toFixed(2))}%`,Rs=e=>D(E`limit ${Ls(e)}`),zs=e=>K(D(`Authentication failed`),e.model??``);function Bs(e){return e.stop?zs(e):e.rule?D(E`Usage rule: ${e.rule}`):K(Is(e.window??``,e.pct),Rs(e.cap),e.until?D(E`until ${G(e.until,!0)}`):``)}var Vs=e=>K(D(E`Identity ${Ts(e.credential)} paused`),Bs(e));function Hs(e){let t=new Set;return e.filter(e=>!t.has(e.credential)&&t.add(e.credential))}function Us(e,t=``,n=``){let r=n?n.slice(n.lastIndexOf(`.`)+1):``;switch(e?.cause){case`deadline`:return D(r?E`Past the deadline of ${r}`:`Past the deadline`);case`grace_window`:return D(r?E`Past the deadline of ${r} and its finishing time`:`Past the deadline and its finishing time`);case`cannot_finish`:return K(D(r?E`Cannot finish before the deadline of ${r}`:`Cannot finish before the deadline`),e.need_s==null?``:D(E`needs ${B(e.need_s)}`),e.left_s==null?``:D(E`${B(e.left_s)} left`));case`dependency_not_queued`:return D(`An earlier task was never scheduled`);case`dependency_deferred`:return D(`An earlier task was not run`);case`rest`:{let n=Hs(e.rests??[]);return n.length?n.length===1?Vs(n[0]):K(Vs(n[0]),D(E`+${n.length-1} paused identities`)):t}default:return t}}var Ws=e=>D(E`${e.model||e.route||`—`} (identity paused)`);function Gs(e){if(!e||e.five_hour_pct==null&&e.seven_day_pct==null)return``;let t=K(e.seven_day_pct==null?``:D(E`weekly ${Ls(e.seven_day_pct)}`),e.five_hour_pct==null?``:D(E`5-hour ${Ls(e.five_hour_pct)}`));return D(E`Limits: ${t}`)}var Ks=()=>D(`A new agent session on the next model after a failed one (Router hops)`),qs=e=>e.model||e.route||`—`;function Js(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(Ws),...e.map((t,n)=>n<e.length-1?D(E`${qs(t)} (${Q(t.stop)})`):qs(t))].join(` → `);return t==null?i:`${i} | ${B(t)}`}function Ys(e){switch(e){case`valid`:return D(`passed`);case`invalid`:return D(`failed checks`);case`refused`:return D(`not written (task not started)`);case`failed`:return D(`not written (task failed)`);case`running`:return D(`not written yet (task running)`);case`pending`:return D(`not written yet (task waiting)`)}}function Xs(e){return e===`failed`?D(`The task failed before it wrote a file that passes its checks`):``}var Zs=()=>D(`Another round in the same agent session after failed checks (rounds)`);function Qs(e,t){let n=(e??1)-1;return n<1?``:D(t?n===1?`after 1 correction`:E`after ${n} corrections`:n===1?`1 correction`:E`${n} corrections`)}function $s(e,t,n){let r=e.errors??[],i=Re(`invalid input: ${r.map(e=>e.replace(/^invalid input:\s*/,``)).join(`; `)}`)[0];if(!i)return r[0]?Zo(T(r[0],t)):``;let a=n?.(i.path);return Zo(ms(T(i.path,t),i.problem,a))}var ec=(e,t)=>e.ready?Ie(e.journal):t.quota??[],tc=e=>D(E`Agent sessions played from the recordings in ${e} (replay)`),nc=e=>!!e?.replay&&!e.stub,rc=()=>D(`replayed`),ic=()=>D(`Played from a recording (replayed)`);function ac(e){return e?.replay&&nc(e)?{text:D(`replay and new sessions`),title:(t=e.replay,D(E`Agent sessions played from the recordings in ${t}, and new agent sessions recorded there (replay, record_missing)`))}:e?.replay?{text:D(`replay`),title:tc(e.replay)}:e?.stub?{text:D(`stub agent`),title:D(`Tasks played by the stub agent with scripted replies (stub)`)}:null;var t}var oc=()=>D(`no report from host`),sc=e=>e.up?D(`up`):D(`no report`),cc=e=>e?.last_seen?D(E`Last report ${G(e.last_seen,!0)}`):``,lc=e=>D(e?E`Host ${e}`:`No host id`),uc=e=>D(e===1?`1 run`:E`${e} runs`);function dc(e){let t=e.filter(e=>!e.up).length;return K(e.length===1?D(`1 host`):D(E`${e.length} hosts`),t?D(E`${t} with no report`):``)}var fc=e=>({empty:e,sortAscending:D(`Sort ascending`),sortDescending:D(`Sort descending`)}),pc=()=>D(`Names this task holds while it runs (claims)`);function mc(e){switch(e){case`running`:return D(`running`,{id:`service-running`});case`stopped`:return D(`stopped`);case`failed`:return D(`did not start`);default:return D(`stop not recorded`)}}var hc=()=>D(`A deadline of its own (time_box)`),gc=()=>D(`Custom column (row_extras)`);function _c(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 vc(e,t){let n=e;return t.filter(e=>n[e]!==null&&n[e]!==void 0&&n[e]!==``).map(e=>[e,_c(n[e])])}function yc(e){switch(e){case`cost`:return D(`Cost`);case`tokens`:return D(`Tokens`);case`time`:return D(`Time`);case`sessions`:return D(`Agent sessions`)}}function bc(e){switch(e){case`cost`:return D(`Reported by the coding agent`);case`tokens`:return D(`Input, output, cache read and cache write`);case`time`:return D(`Time of the agent sessions, summed`);case`sessions`:return D(`Agent sessions started on the model`)}}function xc(e,t){switch(t){case`cost`:return e.cost_usd===null||e.cost_usd===void 0?`—`:X(e.cost_usd);case`tokens`:return Y(ke(e));case`time`:return B(e.wall_s??0);case`sessions`:return String(e.sessions)}}function Sc(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 Cc=e=>String(Math.round(100*e)/100);function wc(e){switch(e){case`usd`:return X;case`pct`:return Sc;case`duration`:return B;case`tokens`:return Y;default:return Cc}}function Tc(e,t){return e==null||e===``?`—`:t===`datetime`&&typeof e==`string`?G(e,!0)||e:typeof e==`number`?wc(t)(e):typeof e==`boolean`?String(e):typeof e==`string`?e:JSON.stringify(e)}var Ec=e=>D(E`Exported ${G(e.exported_at,!0)}`);function Dc(e){return e===`transcripts`?D(`transcripts`):e===`processes`?D(`processes`):e}var Oc=e=>D(E`Not in this export: ${q(e.left_out.map(Dc))}`),kc=()=>D(`not in this export`),Ac=()=>D(`Trends`),jc=()=>D(`Totals of the runs in a period`);function Mc(e,t=An()){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 Nc=e=>D(E`${e} days`);function Pc(e=An()){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 Fc=()=>({runs:D(`Runs`,{id:`trends-runs`}),attempts:D(`Attempts`),done:D(`Done`),cost:D(`Cost`),tokens:D(`Tokens`),time:D(`Time`),costByDay:D(`Cost by day`),costByDayTip:D(`Reported by the coding agent, on the day each attempt ended`),kinds:D(`Kinds`),kind:D(`Kind`),group:D(`Group`),tasks:D(`Tasks`),tasksDone:D(`Tasks done`),partial:D(`Partly done`,{id:`trends-partial`}),medianTime:D(`Median time`),totalTime:D(`Total time`),models:D(`Models`),model:D(`Model`),sessions:D(`Agent sessions`),calls:D(`API calls`),input:D(`Input`),output:D(`Output`),cacheRead:D(`Cache read`),cacheWrite:D(`Cache write`),outcomes:D(`Attempts not done`),outcome:D(`Outcome`),denials:D(`Denied tool calls`),toolCalls:D(`Tool calls`),pythonKinds:D(`Python tasks`),tool:D(`Tool`),usage:D(`Subscription usage`),usageTip:D(`The highest reading of each day`),deferred:D(`Not run`),cause:D(`Cause`),task:D(`Task`),when:D(`When`),rests:D(`Paused identities`),identity:D(`Identity`),event:D(`Event`),starts:D(`Run starts`),startsTip:D(`By weekday and hour, in the period's time zone`),run:D(`Run`),started:D(`Started`),trendPanels:D(`Custom views`)}),Ic=(e,t)=>`${e} | ${t}`,Lc=e=>{let t=/^(\S+) rests\b/.exec(e)?.[1];return D(t?E`Identity ${t} paused`:`Identity paused`)},Rc=(e,t)=>`${e} | ${t}`,zc=e=>e?D(E`Priority ${e}`):``,Bc=()=>D(`Tie-breaker in the queue's order (priority)`),Vc=()=>D(`Peak context`),Hc=()=>D(`Largest input of one API call, cache read and cache write included (peak_context)`);function Uc(e){let t=e.usage?.peak_context;return t==null?``:D(E`Peak context: ${function(e,t){let n=t?Math.round(100*e/t):null;return K(Y(e),n===null?``:D(E`${n}% of the context limit ${Y(t)}`))}(t,e.context_budget)}`)}function Wc(e){let t=e.usage?.peak_context,n=e.context_budget;return D(t!=null&&n?E`near the context limit (${Math.round(100*t/n)}%)`:`near the context limit`)}var Gc=()=>D(`Peak context above the warning threshold (context_warned)`),Kc=(e,t)=>t?`${e} / ${t}`:e,qc=e=>K(Kc(e.agent,e.model),e.credential?D(E`identity ${Ts(e.credential)}`):``,e.reason,e.kinds.length?D(E`kinds ${q(e.kinds)}`):``),Jc=e=>K(e.kind,`${Kc(e.from_agent,e.from_model)} → ${Kc(e.to_agent,e.to_model)}`),Yc=()=>D(`No available model`),Xc=()=>D(`Must stay unchanged`),Zc=()=>D(`Parts of the output file kept as before the task (preserve)`),Qc=()=>D(`Safety stops`),$c=e=>D(e===1?`1 safety stop`:E`${e} safety stops`),el=()=>D(`A safety classifier stopped part of the agent session, and the session went on (safety_stops)`);function tl(e){switch(e){case`response`:return D(`model response`);case`tool`:return D(`tool request`);case`unread`:return D(`unrecognized`);default:return e||`—`}}var nl=e=>K(tl(e.part),e.model,e.category,e.tool,G(e.ts,!0));function rl(e){switch(e){case`given_from`:return D(`given output`,{id:`edge-given`});case`after`:return D(`runs after`,{id:`edge-after`});case`created_from`:return D(`created after result`,{id:`edge-created`})}}function il(e){switch(e){case`passed`:return D(`same content at the start`);case`refused`:return D(`changed before the start`);case`not_checked`:return D(`not checked`,{id:`input-file-not-checked`})}}function al(e,t){let n=e[t];if(!n?.rerun)return null;let r=n.fingerprint_parts??{},i=e.slice(0,t).reverse().find(e=>Object.keys(e.fingerprint_parts??{}).length)?.fingerprint_parts??{},a=Object.keys(r).length&&Object.keys(i).length?[...new Set([...Object.keys(r),...Object.keys(i)])].filter(e=>r[e]!==i[e]):[];return{text:n.rerun,changed:a,divergence:n.rerun.startsWith(`divergence`)}}function ol(e){switch(e){case`definition`:return D(`definition`,{id:`part-definition`});case`params`:return D(`params`,{id:`part-params`});case`outside`:return D(`outside state`);case`output_of`:return D(`the file it fills in`);case`input_files`:return D(`input files`,{id:`part-input-files`});default:return e}}var sl=()=>D(`divergence`);function cl(e){return K(D(`Ran again after a resume`),e.divergence?sl():``,e.changed.length?D(E`Changed: ${q(e.changed.map(ol))}`):e.divergence?``:e.text)}function ll(e,t=``){let n=e.raised_at;return n?`${T(n.file,t)}:${n.line}`:``}function ul(e,t=``){let n=(e=>e.slice(e.lastIndexOf(`.`)+1)||e)(e.function),r=ll(e,t);return D(r?E`This failure stopped ${n} at ${r}`:E`This failure stopped ${n}`)}function dl({url:e,failure:t,status:n,type:r}){let i=t===`network`?D(`network error, no response`):t===`status`?D(E`the response status is ${n}`):r.includes(`html`)?D(`the response is HTML, not JSON`):D(`the response is not JSON`);return D(E`No monitor API at ${e}: ${i}`)}function fl(e,t){let n=J(e),r=T(e.reason,t).slice(0,110);if(e.stop===`invalid_input`)return[`attention`,D(E`${n}: not started`),r];if(se(e))return[`failed`,D(E`${n}: ${Q(e.stop)}`),r];if(e.stop===`partial`)return[`attention`,D(E`${n}: ${Q(e.stop)}`),r];let i=Js(e.hops,e.wall_s,e.skipped_hops);return i?[`agent`,D(E`${n}: model switch`),i.slice(0,110)]:[`done`,D(E`${n}: done`),K(B(e.wall_s),e.model)]}z(`cae-segmented`,Ei);var pl={done:`✓`,failed:`✕`,attention:`◌`,running:`●`,agent:`✦`},ml=class extends N{constructor(...e){super(...e),this.toasts=[],this.next=0}static{this.styles=[V,k` :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=>A`<p>${K(e.title,e.sub)}</p>`);return A`<div class="sr" role="status" aria-live="polite">${e(!1)}</div>
|
|
322
325
|
<div class="sr" role="alert" aria-live="assertive">${e(!0)}</div>
|
|
323
326
|
<div aria-hidden="true" style="display:contents">
|
|
324
|
-
${H(this.toasts,e=>e.id,e=>
|
|
325
|
-
<span class="ti">${
|
|
326
|
-
<div><b>${e.title}</b>${e.sub?
|
|
327
|
+
${H(this.toasts,e=>e.id,e=>A`<div class="toast ${e.kind===`agent`?`agent`:``} ${e.out?`out`:``}" data-tone=${e.kind===`agent`?M:e.kind}>
|
|
328
|
+
<span class="ti">${pl[e.kind]}</span>
|
|
329
|
+
<div><b>${e.title}</b>${e.sub?A`<span class="sub">${e.sub}</span>`:M}</div>
|
|
327
330
|
</div>`)}
|
|
328
|
-
</div>`}};U([
|
|
329
|
-
<summary>${
|
|
330
|
-
${
|
|
331
|
-
</details>`;if(!n)return t.exists?r:
|
|
332
|
-
<summary>${K(function(e){let t=Array.isArray(e.content)?e.content.length:0;return
|
|
333
|
-
${
|
|
334
|
-
</details>`;return
|
|
335
|
-
${t.exists?e:
|
|
336
|
-
${
|
|
337
|
-
${r}`:n.length?
|
|
338
|
-
`);return
|
|
339
|
-
${(t===`output`?[[
|
|
340
|
-
</dl>`}var
|
|
331
|
+
</div>`}};U([I()],ml.prototype,`toasts`,void 0),ml=U([P(`ca-toasts`)],ml);var hl=k` :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 gl(e){return[...[{id:`overview`,label:D(`Overview`),icon:`◎`},{id:`tasks`,label:D(`Tasks`,{id:`tab-tasks`}),icon:`≡`},{id:`journal`,label:D(`History`),icon:`▤`,tip:`journal.jsonl`},{id:`outputs`,label:D(`Outputs`),icon:`▣`},{id:`definitions`,label:D(`Definitions`),icon:`⌘`},{id:`procs`,label:D(`Processes`),icon:`⚙`},{id:`stream`,label:D(`Task detail`),icon:`✦`}].map(e=>({...e,panel:!1})),...e.filter(he).map(e=>({id:`panel:${e.name}`,label:e.title||e.name,icon:e.icon||`▤`,tip:e.description?D(E`${e.description} (custom view)`):D(`Custom view`),panel:!0}))]}var _l=e=>`tab-${e}`;function vl(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 yl=k` 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 $(e,t,n,{bubbles:r=!0}={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:r,composed:!0}))}function bl(e,t,n){return n.key?A`<button type="button" class="taskchip" title=${n.key} @click=${t=>{t.stopPropagation(),$(e,`ca-open-task`,{key:n.key,...w(n)?{view:`output`}:{}})}}>${t}</button>`:A`<span class="taskchip">${t}</span>`}function xl(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 Sl=e=>/^RootModel\[(.+)\]$/.exec(e)?.[1]??null,Cl=e=>/^Rows\[(.+)\]$/.exec(e)?.[1]??null;function wl(e){let t=e.file.content;return e.file.exists&&typeof t==`object`&&t&&!Array.isArray(t)?t:null}function Tl(e){if(!e.fields.length&&(e.schema_name===`text`||Sl(e.schema_name)!==null))return null;let t=wl(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:D(`missing`),tip:D(`A required field that is not in the file`)}:{...n,hasValue:!1,verdict:`none`,verdictLabel:D(`absent (optional)`)};let r=t[e.name];return xl(e.type,r)?{...n,hasValue:!0,value:r,verdict:`pass`,verdictLabel:D(`passed`)}:{...n,hasValue:!0,value:r,verdict:`fail`,verdictLabel:D(`wrong type`),tip:D(E`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:D(`not in the schema`),extra:!0,hasValue:!0,value:t?.[e],verdict:`warn`,verdictLabel:D(`extra field`),tip:D(`Not in the schema`)}))]}function El(){return{name:D(`Field`),expected:D(`Expected`),actual:D(`In the file`),verdict:D(`Check`),optional:D(`optional`),items:e=>D(e===1?`1 item`:E`${e} items`),object:D(`object`)}}function Dl(e){let t=!!e.file.exists;return $r(`ct-chip`,{text:t?D(`found`):e.required?D(`missing (required)`):D(`missing (optional)`),tone:t?`done`:e.required?`failed`:`muted`})}function Ol(e,t){return $r(`ct-chip`,e?{text:t===void 0?Ys(e):A`${Ys(e)} <b>${t}</b>`,tone:fs(e),title:Xs(e)}:{text:`—`})}function kl(e){let t=e.content;return typeof t==`object`&&t?A`<cae-json-tree .value=${t}></cae-json-tree>`:A`<pre class="jtree">${typeof t==`string`?t:D(`Not JSON`)}</pre>`}function Al(e){let t=e.file,n=Tl(e),r=A`<details class="ct-raw">
|
|
332
|
+
<summary>${jl(t)}</summary>
|
|
333
|
+
${kl(t)}
|
|
334
|
+
</details>`;if(!n)return t.exists?r:A``;if(e.format===`jsonl`){let e=A`<details class="ct-raw">
|
|
335
|
+
<summary>${K(function(e){let t=Array.isArray(e.content)?e.content.length:0;return D(t===1?`1 row`:E`${t} rows`)}(t),`${t.size??0} B`,t.mtime?D(E`written ${G(t.mtime,!0)}`):``,t.truncated?D(`truncated`):``)}</summary>
|
|
336
|
+
${kl(t)}
|
|
337
|
+
</details>`;return A`<cae-check-table .rows=${n} .showValues=${!1} .strings=${El()}></cae-check-table>
|
|
338
|
+
${t.exists?e:M}`}return t.exists?A`<cae-check-table .rows=${n} .strings=${El()}></cae-check-table>
|
|
339
|
+
${wl(e)?M:A`<div class="meta note">${D(`Not a JSON object`)}</div>`}
|
|
340
|
+
${r}`:n.length?A`<cae-check-table .rows=${n} .showValues=${!1} .strings=${El()}></cae-check-table>`:A``}z(`cae-json-tree`,Di);var jl=e=>K(D(`Whole file`),`${e.size??0} B`,e.mtime?D(E`written ${G(e.mtime,!0)}`):``,e.truncated?D(`truncated`):``);function Ml(e){let t=Sl(e.schema_name),n=e.schema_name===`text`||t===`str`?D(`text`):t??Cl(e.schema_name)??e.schema_name;return A`<b class="jmono" title=${e.schema_ref||e.schema_name}>${n}</b>`}function Nl(e){let t=e.schema_ref||e.schema_name;if(e.schema_name===`text`)return D(`text file`);if(e.format===`jsonl`)return D(A`JSON Lines, one object of schema ${Ml(e)} per line`);let n=Sl(e.schema_name);return n===`str`?A`<span title=${t}>${D(`text (JSON string)`)}</span>`:n?A`<span title=${t}>${D(E`JSON value of type ${n}`)}</span>`:D(A`JSON object, schema ${Ml(e)}`)}function Pl(e,t){let n=Nl(e),r=function(e){let t=e.validators??[];if(!t.length)return null;let n=(e.errors??[]).join(`
|
|
341
|
+
`);return A`${t.map((t,r)=>A`${r?`, `:``}<span class="jmono">${t}</span> ${(t=>e.status===`valid`?Ya(`pass`,D(`passed`)):n.includes(t)?Ya(`fail`,D(`failed checks`)):M)(t)}`)}`}(e);return A`<dl class="conds">
|
|
342
|
+
${(t===`output`?[[D(`Format`),n],...r?[[D(`Other checks`),r,D(`Checks beyond the schema (validators)`)]]:[],[D(`Must be written during the task`),e.fresh?D(`yes`):D(`no`),e.fresh?D(`A file from before the task does not count`):D(`A file from before the task counts`)],...e.preserve?.length?[[Xc(),A`<span class="jmono">${e.preserve.join(`, `)}</span>`,Zc()]]:[]]:[[D(`Format`),n],...r?[[D(`Other checks`),r,D(`Checks beyond the schema (validators)`)]]:[],[D(`Check time`),D(`when the task starts`)],[D(`Required`),e.required?D(`yes`):D(`no`)]]).map(([e,t,n])=>A`<dt>${e}</dt><dd title=${n??``}>${t}</dd>`)}
|
|
343
|
+
</dl>`}var Fl=k` .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);}`,Il=k` ${Fl} ${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 Ll=class extends N{constructor(...e){super(...e),this.procs=null}static{this.styles=[V,k` :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?A`<div class="ptree2">${this.node(e,0)}</div>`:A`<div class="meta">${D(`No running processes`)}</div>`}node(e,t){let n=e.full_cmd||e.cmd||``,r=(e.cmd||n).split(` `).slice(0,3).join(` `);return A`<div class="pt-n ${/\b(claude|omp)\b/.test(n)?`llm`:``} ${t?``:`root`}" style="--d:${t}" title=${n}>
|
|
341
344
|
<span class="pt-pid">${e.pid}</span>
|
|
342
|
-
<span class="pt-cmd">${e.key?
|
|
345
|
+
<span class="pt-cmd">${e.key?A`<b>${J(e)}</b> `:M}${r.length>70?`${r.slice(0,70)}…`:r}</span>
|
|
343
346
|
<cae-elapsed class="pt-age" .since=${Ir.at(`p:${e.pid}`,e.age_s)}></cae-elapsed>
|
|
344
347
|
</div>
|
|
345
|
-
${(e.children??[]).map(e=>this.node(e,t+1))}`}};function
|
|
346
|
-
${
|
|
347
|
-
</div>`}render(){if(!
|
|
348
|
-
${H(e,e=>e.id,e=>
|
|
349
|
-
<span class="num">${K(
|
|
348
|
+
${(e.children??[]).map(e=>this.node(e,t+1))}`}};function Rl(e){let t=e.filter(f),n=t.filter(w),r=t.filter(e=>!w(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 zl(e){return e.startsWith(`task:`)?{key:e.slice(5)}:{stop:e.replace(/^history:/,``)}}function Bl(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`?Re(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?D(`Earlier task failed`):``,t?D(`Input missing`):``,n?D(`Input failed checks`):``)}U([F({attribute:!1})],Ll.prototype,`procs`,void 0),Ll=U([P(`ca-proc-tree`),O()],Ll),z(`cae-stat-tiles`,_a),z(`cae-count`,la);var Vl=(e,t)=>({id:`history:${e}`,label:t});function Hl(e,t,n,r){let i=t.length===1?t[0]:void 0;if(!i)return Vl(n,r);let a=e.find(e=>e.key===i);return{id:`task:${i}`,label:a?J(a):i}}function Ul(e,t){let n=Rl(e),{outcomes:r,counts:i}=t,a=[{text:Z(`done`,i.doneTotal),tone:`neutral`},{text:i.skipped?Z(`skipped`,i.skipped):``,tone:`neutral`},{text:i.failed?Z(`failed`,i.failed):``,tone:os(i.failed,`failed`)},{text:i.not_started?Z(`not_started`,i.not_started):``,tone:os(i.not_started,`attention`)},{text:i.partial?Z(`partial`,i.partial):``,tone:os(i.partial,`attention`)},{text:i.cancelled?Z(`cancelled`,i.cancelled):``,tone:`neutral`}];return[{id:`tasks`,label:D(`Tasks`,{id:`tasks`}),value:i.total,sub:[a]},{id:`attempts`,label:D(`Attempts`),value:n.attempts,sub:[Qo(n.launches===1?D(`1 agent session`):D(E`${n.launches} agent sessions`),n.python===1?D(`1 Python task attempt`):D(E`${n.python} Python task attempts`))],tip:D(`Attempts that ran, retries included (journal.jsonl)`)},...Wl(e),{id:`bad`,tone:os(n.bad,`failed`),label:D(`Failed attempts`),value:n.bad,sub:[n.bad?[]:[D(`All attempts done`)]],...n.bad?{action:Vl(`bad`,D(`Failed attempts in history`))}:{}},{id:`notstarted`,tone:os(i.not_started,`attention`),label:D(`Not started`),value:i.not_started,sub:[i.not_started?Bl(r.values()):[D(`All tasks started`)]],...i.not_started?{action:Vl(`invalid_input`,D(`Tasks not started in history`))}:{}},{id:`wall`,label:D(`Agent session time`),value:B(n.launchWall),sub:[[D(E`Python tasks: ${B(n.pythonWall)}`)]],tip:D(`Summed over agent sessions, including sessions that ran at once`)},{id:`retry`,label:D(`Retries`),value:n.retries,sub:[[n.retries?n.retriedTasks===1?D(`1 task retried`):D(E`${n.retriedTasks} tasks retried`):D(`No retries`)]],tip:gs(),...n.retries?{action:Hl(e,n.retriedKeys,`retried`,D(`Retried tasks in history`))}:{}},{id:`ct`,label:D(`Corrections`),value:n.fixups,sub:[[n.fixups?n.fixupTasks===1?D(`1 task with a correction`):D(E`${n.fixupTasks} tasks with corrections`):D(`No corrections`)]],tip:Zs(),...n.fixups?{action:Hl(e,n.fixupKeys,`fixup`,D(`Attempts with corrections in history`))}:{}},{id:`fo`,label:D(`Model switches`),value:n.switches,sub:[[n.switches?n.switchTasks===1?D(`1 task with a model switch`):D(E`${n.switchTasks} tasks with model switches`):D(`No model switches`)]],tip:Ks()}]}function Wl(e){let t=Ee(e);if(!t)return[];let n=Oe(e)[0];return[{id:`cost`,label:D(`Cost`),value:X(t.cost),sub:n&&n.share!==null?[[D(E`Highest cost: ${n.kind}`)],Qo(X(n.spend.cost),D(E`${Math.round(100*n.share)}% of the total`))]:[[]],tip:D(`Reported by the coding agent`)},{id:`tokens`,label:D(`Tokens`),value:Y(we(t)),sub:[Qo(D(E`${Y(t.input)} input`),D(E`${Y(t.output)} output`),D(E`${Y(t.cache_read+t.cache_creation)} cache`))],tip:K(D(E`${Y(t.cache_read)} cache read`),D(E`${Y(t.cache_creation)} cache write`),t.calls===1?D(`1 API call`):D(E`${t.calls} API calls`))}]}var Gl=class extends N{constructor(...e){super(...e),this.journal=[],this.plan={nodes:[],groups:[]},this.onAction=e=>{e.stopPropagation();let t=zl(e.detail.action);`key`in t?$(this,`ca-open-task`,{key:t.key}):$(this,`ca-navigate`,{tab:`journal`,stop:t.stop})}}static{this.styles=k` :host{display:block;}`}render(){return A`<cae-stat-tiles exportparts="tiles, tile, label, value, sub, action" .tiles=${Ul(this.journal,S(this.journal,this.plan))} @cae-action=${this.onAction}></cae-stat-tiles>`}};U([F({attribute:!1})],Gl.prototype,`journal`,void 0),U([F({attribute:!1})],Gl.prototype,`plan`,void 0),Gl=U([P(`ca-kpis`),O()],Gl);var Kl=[`input`,`cache_read`,`cache_creation`,`output`],ql=class extends N{constructor(...e){super(...e),this.journal=[],this.top=5}static{this.styles=[V,oi,k` :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 D(`input`);case`cache_read`:return D(`cache read`);case`cache_creation`:return D(`cache write`);case`output`:return D(`output`)}}bar(e,t){let n=we(e),r=t?100*n/t:0;return A`<div class="bar" title=${K(...Kl.map(t=>`${this.partLabel(t)} ${Y(e[t])}`))} style="width:${Math.max(r,.5).toFixed(2)}%">
|
|
349
|
+
${Kl.map(t=>e[t]&&n?A`<i class="seg-${t}" style="width:${(100*e[t]/n).toFixed(2)}%"></i>`:M)}
|
|
350
|
+
</div>`}render(){if(!Ee(this.journal))return A`<div class="meta">${D(`No tokens reported`)}</div>`;let e=Oe(this.journal),t=Math.max(1,...e.map(e=>we(e.spend))),n=(r=this.journal,De(r,e=>e.key)).slice(0,this.top);var r;return A`<div class="kinds">
|
|
351
|
+
${H(e,e=>e.id,e=>A`<span class="kind" title=${e.id}>${e.id}</span>${this.bar(e.spend,t)}
|
|
352
|
+
<span class="num">${K(Y(we(e.spend)),X(e.spend.cost))}</span>
|
|
350
353
|
<span class="num share">${e.share===null?``:`${Math.round(100*e.share)}%`}</span>`)}
|
|
351
354
|
</div>
|
|
352
|
-
${ai(
|
|
353
|
-
<h4>${
|
|
355
|
+
${ai(Kl.map(e=>({label:this.partLabel(e),cls:`seg-${e}`})))}
|
|
356
|
+
<h4>${D(`Most expensive tasks`)}</h4>
|
|
354
357
|
<div class="top">
|
|
355
|
-
${n.map(e=>
|
|
356
|
-
<span class="num">${
|
|
357
|
-
<span class="num">${
|
|
358
|
-
<span class="num share">${e.share===null?``:E
|
|
359
|
-
</div>`}};U([
|
|
360
|
-
<cae-segmented label=${
|
|
361
|
-
</div>`:
|
|
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
|
|
363
|
-
<div class="share-bar" role="list" aria-label=${t.label||
|
|
364
|
-
${n.map((e,t)=>
|
|
358
|
+
${n.map(e=>A`<a class="lnk" href="#" title=${e.id} @click=${t=>{t.preventDefault(),$(this,`ca-open-task`,{key:e.id})}}>${J(e)}</a>
|
|
359
|
+
<span class="num">${Y(we(e.spend))}</span>
|
|
360
|
+
<span class="num">${X(e.spend.cost)}</span>
|
|
361
|
+
<span class="num share">${e.share===null?``:D(E`${Math.round(100*e.share)}%`)}</span>`)}
|
|
362
|
+
</div>`}};U([F({attribute:!1})],ql.prototype,`journal`,void 0),U([F({type:Number})],ql.prototype,`top`,void 0),ql=U([P(`ca-spend-breakdown`),O()],ql);var Jl=6,Yl=`var(--meter)`,Xl=e=>`${e.agent}/${e.model}`;function Zl(e){let t=e.length>6?5:6;return new Map(e.map((e,n)=>[Xl(e),n<t?`var(--series-${n+1})`:Yl]))}function Ql(e,t){let n=Zl(e),r=[],i=0;for(let a of e){let e=Ae(a,t)??0,o=n.get(Xl(a));o===`var(--meter)`?i+=e:r.push({id:Xl(a),label:a.model,value:e,color:o,text:xc(a,t)})}return e.length>6&&r.push({id:`other`,label:D(`Other models`),value:i,color:Yl}),r}function $l(e,t){let n=Zl(e),r=e.map(e=>Ae(e,t)??0),i=si(r),a=r.some(e=>e>0);return e.map((e,t)=>({id:Xl(e),usage:e,colour:n.get(Xl(e)),share:a?ci(i[t],r[t]):`—`}))}var eu=[`cost`,`tokens`,`time`,`sessions`],tu=class extends N{constructor(...e){super(...e),this.models=[],this.measure=``}static{this.styles=[V,li,k` :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=je(this.models);return this.measure&&e.includes(this.measure)?this.measure:e[0]??`sessions`}render(){if(!this.models.length)return A`<div class="meta">${D(`No agent sessions`)}</div>`;let e=this.chosen(),t=je(this.models),n=$l(this.models,e),r=this.models.some(e=>e.peak_context!=null);return A`${t.length>1?A`<div class="head">
|
|
363
|
+
<cae-segmented label=${D(`Measure`)} .value=${e} .options=${t.map(e=>({value:e,label:yc(e),title:bc(e)}))} @cae-change=${e=>this.measure=e.detail.value}></cae-segmented>
|
|
364
|
+
</div>`:M}
|
|
365
|
+
${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 A`<div class="share" part="share">
|
|
366
|
+
<div class="share-bar" role="list" aria-label=${t.label||M}>
|
|
367
|
+
${n.map((e,t)=>A`<span class="share-seg" role="listitem" tabindex="0" aria-label=${o(e,t)} data-id=${e.id} data-edge=${t===0?`start`:t===n.length-1?`end`:M} style=${ii({flexGrow:String(e.value/i),background:e.color})} ><span class="share-tip" aria-hidden="true">${o(e,t)}</span></span>`)}
|
|
365
368
|
</div>
|
|
366
369
|
<div class="share-names" aria-hidden="true">
|
|
367
|
-
${n.map((e,t)=>
|
|
370
|
+
${n.map((e,t)=>A`<span style=${ii({flexGrow:String(e.value/i)})} >${e.value/i>=a?A`<b>${e.label}</b> ${ci(r[t],e.value)}`:M}</span>`)}
|
|
368
371
|
</div>
|
|
369
|
-
</div>`}(
|
|
370
|
-
<div class="wrap" data-scroll="x" tabindex="0" role="region" aria-label=${
|
|
372
|
+
</div>`}(Ql(this.models,e),{label:yc(e)})}
|
|
373
|
+
<div class="wrap" data-scroll="x" tabindex="0" role="region" aria-label=${D(`Models`)}>
|
|
371
374
|
<table>
|
|
372
375
|
<thead>
|
|
373
376
|
<tr>
|
|
374
|
-
<th scope="col">${
|
|
375
|
-
<th scope="col" class="on" title=${
|
|
376
|
-
${
|
|
377
|
-
<th scope="col">${
|
|
378
|
-
${r?
|
|
377
|
+
<th scope="col">${D(`Model`)}</th>
|
|
378
|
+
<th scope="col" class="on" title=${yc(e)}>${D(`Share`)}</th>
|
|
379
|
+
${eu.map(t=>A`<th scope="col" class=${t===e?`on`:M} title=${bc(t)}>${yc(t)}</th>`)}
|
|
380
|
+
<th scope="col">${D(`API calls`)}</th>
|
|
381
|
+
${r?A`<th scope="col" title=${Hc()}>${Vc()}</th>`:M}
|
|
379
382
|
</tr>
|
|
380
383
|
</thead>
|
|
381
384
|
<tbody>
|
|
382
|
-
${H(n,e=>e.id,t=>
|
|
385
|
+
${H(n,e=>e.id,t=>A`<tr>
|
|
383
386
|
<td>
|
|
384
387
|
<span class="model"><i style=${ii({background:t.colour})}></i><b>${t.usage.model}</b><small>${t.usage.agent}</small></span>
|
|
385
388
|
</td>
|
|
386
389
|
<td class="share">${t.share}</td>
|
|
387
|
-
${
|
|
390
|
+
${eu.map(n=>A`<td class=${n===e?`on`:M}>${xc(t.usage,n)}</td>`)}
|
|
388
391
|
<td>${t.usage.calls??0}</td>
|
|
389
|
-
${r?
|
|
392
|
+
${r?A`<td>${t.usage.peak_context==null?`—`:Y(t.usage.peak_context)}</td>`:M}
|
|
390
393
|
</tr>`)}
|
|
391
394
|
</tbody>
|
|
392
395
|
</table>
|
|
393
|
-
</div>`}};U([
|
|
394
|
-
<span class="bar ${u}" title=${d?`${
|
|
396
|
+
</div>`}};U([F({attribute:!1})],tu.prototype,`models`,void 0),U([I()],tu.prototype,`measure`,void 0),tu=U([P(`ca-model-usage`),O()],tu);var nu=class extends N{static{this.styles=[V,k` :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 M;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?``:Rs(i);return A`<span class="name">${t}</span>
|
|
397
|
+
<span class="bar ${u}" title=${d?`${Ds(a)} → ${Ds(o)} | ${d}`:`${Ds(a)} → ${Ds(o)}`}>
|
|
395
398
|
<i class="before" style="width:${s}%"></i>
|
|
396
399
|
<i class="during" style="left:${s}%;width:${c-s}%"></i>
|
|
397
|
-
${i==null?
|
|
400
|
+
${i==null?M:A`<i class="cap" style="left:${Math.min(100,i)}%" aria-hidden="true"></i>`}
|
|
398
401
|
</span>
|
|
399
|
-
<span class="val ${u}">${
|
|
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
|
|
401
|
-
<div class="acct-h"><i>${
|
|
402
|
+
<span class="val ${u}">${Ds(a)} → <b>${Ds(o)}</b>${d?A` <span class="lim">| ${d}</span>`:M}</span>
|
|
403
|
+
<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 D(`reset`);let r=(n-t)/36e5,i=r>=48?D(E`${Math.floor(r/24)}d ${Math.floor(r%24)}h`):B((n-t)/1e3);return D(E`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?D(E`paused until ${G(n.until,!0)}`):D(`paused`),tone:`attention`,title:Bs(n)}):M}render(){let e=this.accounts??Ie(this.journal);if(!e.length&&!this.rests.length)return M;let t=new Map(this.caps.map(e=>[e.credential,e]));return A`${this.rule?A`<div class="rule" title="quota_rule">${D(`Usage rule`)} <code>${this.rule}</code></div>`:M}${e.map(n=>{let r=Os(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 A`<div class="acct">
|
|
404
|
+
<div class="acct-h"><i>${D(`Identity`)}</i><b>${Ts(n.credential)||`—`}</b>${o?A`<i title=${D(E`Account: ${n.account??``}`)}>${As(n.account??``)}</i>`:M}${r?Zr({text:r,tone:`attention`,title:n.last.status,mark:null}):M}${this.paused(a)}${i?A`<i title="max_five_hour_pct, max_seven_day_pct">${Gs(i)}</i>`:M}</div>
|
|
402
405
|
<div class="rows">
|
|
403
|
-
${this.row(`seven_day`,
|
|
404
|
-
${this.row(`five_hour`,
|
|
406
|
+
${this.row(`seven_day`,D(`Weekly usage`),n.first,n.last,i?.seven_day_pct)}
|
|
407
|
+
${this.row(`five_hour`,D(`5-hour usage`),n.first,n.last,i?.five_hour_pct)}
|
|
405
408
|
</div>
|
|
406
409
|
${this.restList(a)}
|
|
407
|
-
</div>`})}${this.unread(e,t)}`}restList(e){return e.length?
|
|
408
|
-
<div class="acct-h"><i>${
|
|
410
|
+
</div>`})}${this.unread(e,t)}`}restList(e){return e.length?A`<ul class="rests" title="rests.jsonl">${e.map(e=>A`<li>${function(e){let t=e.ended?D(E`Paused ${G(e.since)} → ${G(e.ended)}`):D(E`Paused since ${G(e.since)}`);return e.stop?K(t,zs(e)):K(t,e.rule?D(E`Usage rule: ${e.rule}`):K(Is(e.window??``,e.pct),Rs(e.cap)))}(e)}</li>`)}</ul>`:M}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 A`<div class="acct">
|
|
411
|
+
<div class="acct-h"><i>${D(`Identity`)}</i><b>${Ts(e)}</b>${this.paused(n)}${r?A`<i title="max_five_hour_pct, max_seven_day_pct">${Gs(r)}</i>`:M}</div>
|
|
409
412
|
${this.restList(n)}
|
|
410
|
-
</div>`})}};U([
|
|
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
|
|
412
|
-
${Qr({text:
|
|
413
|
-
<div><span class="name" title="services.jsonl">${t.name}</span>${t.address?
|
|
414
|
-
<div class="facts">${function(e){return e.start_error?K(G(e.started_at),e.start_error):K(E
|
|
415
|
-
${t.key?
|
|
413
|
+
</div>`})}};U([F({attribute:!1})],nu.prototype,`journal`,void 0),U([F({attribute:!1})],nu.prototype,`accounts`,void 0),U([F({attribute:!1})],nu.prototype,`caps`,void 0),U([F({attribute:!1})],nu.prototype,`rests`,void 0),U([F()],nu.prototype,`rule`,void 0),U([F({type:Boolean})],nu.prototype,`live`,void 0),nu=U([P(`ca-quota`),O()],nu);var ru={running:`running`,stopped:`done`,failed:`failed`,unknown:`muted`},iu=class extends N{constructor(...e){super(...e),this.services=[],this.nodes=[],this.live=!1}static{this.styles=[V,k` :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 A`<div class="meta">${D(`No services`)}</div>`;let e=new Map(this.nodes.map(e=>[e.key,e]));return A`<ul>
|
|
414
|
+
${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 A`<li>
|
|
415
|
+
${Qr({text:mc(n),tone:ru[n]})}
|
|
416
|
+
<div><span class="name" title="services.jsonl">${t.name}</span>${t.address?A` <span class="addr">${t.address}</span>`:M}</div>
|
|
417
|
+
<div class="facts">${function(e){return e.start_error?K(G(e.started_at),e.start_error):K(D(E`Started ${G(e.started_at)} in ${B(e.start_s??0)}`),e.stopped_at?D(E`Stopped ${G(e.stopped_at)}`):``,function(e){switch(e){case`run_end`:return D(`The run ended`);case`interrupted`:return D(`The run was stopped by a signal`);default:return``}}(e.stop_cause),e.stop_error?D(`Stop failed`):``,e.stop_error)}(t)}</div>
|
|
418
|
+
${t.key?A`<div class="by">${bl(this,r?J(r):t.key,r??{key:t.key})}</div>`:M}
|
|
416
419
|
</li>`})}
|
|
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
|
|
419
|
-
`),drill:!!n.flow}})(n,t))})),value:{label:
|
|
420
|
+
</ul>`}};U([F({attribute:!1})],iu.prototype,`services`,void 0),U([F({attribute:!1})],iu.prototype,`nodes`,void 0),U([F({type:Boolean})],iu.prototype,`live`,void 0),iu=U([P(`ca-services`),O()],iu),z(`cae-mark-matrix`,to),z(`cae-layered-graph`,zo);var au=`loop:`,ou=[`given`,`after`,`created`],su=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])},cu=e=>typeof e==`string`;function lu(e){let t=e.flow_calls;return Array.isArray(t)&&t.length!==0?new Map(t.filter(e=>e&&cu(e.id)&&cu(e.function)).map(e=>[e.id,e])):null}var uu=new WeakMap;function du(e){let t=uu.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`||!cu(t.function))break;let r=(Array.isArray(t.loops)?t.loops:[]).filter(e=>!!e&&typeof e.line==`number`);n.push({function:t.function,file:cu(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(cu):[],call:cu(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:lu(e),unitRank:r,labels:new Map(e.groups.map(e=>[e.id,e.label]))};return uu.set(e,i),i}var fu=(e,t)=>t.every((t,n)=>e[n]===t),pu=e=>e.slice(e.lastIndexOf(`.`)+1)||e,mu=(e,t)=>t>0?e.frames[t-1]?.loops??[]:[],hu=(e,t)=>t>0?e.frames[t-1]?.passes??[]:[];function gu(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 _u=e=>e.map((t,n)=>`${au}${e.slice(0,n+1).join(`.`)}`);function vu(e,t){let n=mu(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 yu(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 bu={failed:7,running:6,blocked:5,partial:4,pending:3,cancelled:2,skipped:1,done:0},xu=e=>e.reduce((e,t)=>bu[t.state]>bu[e]?t.state:e,`done`),Su=e=>e.reduce((e,t)=>bu[t]>bu[e]?t:e,`done`);function Cu(e){let t=e.filter(w).length;return t===0?`agent`:t===e.length?`python`:`mixed`}var wu={running:`running`,returned:`done`,raised:`failed`,closed:`failed`},Tu=e=>e?.state===`raised`||e?.state===`closed`;function Eu(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:xu(n),count:n.length,keys:n.map(e=>e.key)}}function Du(e){let t=new Map,n=[];for(let r of e)r.n.unit?su(t,r.n.unit,r):n.push(Eu([r],``));return{byUnit:new Map([...t].map(([e,t])=>[e,Eu(t,e)])),single:n}}function Ou(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=xu(e.tasks.map(e=>e.n));return n&&wu[n.state]?Su([wu[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(Tu),u={key:c?.id??``,unit:t,state:Su(a),count:s.length,keys:s,flow:n,counts:ku(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}=yu(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?su(a,e.unit,e):o.push(i([e],``));let c=r?s.filter(e=>e.own&&Tu(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 ku(e){let t={total:e.length,done:0,partial:0,failed:0,running:0,pending:0,skipped:0,blocked:0,cancelled:0};for(let n of e)t[n.n.state]+=1;return t}function Au(e,t){let n=new Map;for(let r of e){let e=r.n.unit||``,i=n.get(e);(!i||gu(hu(r,t),i)>0)&&n.set(e,hu(r,t))}return e.filter(e=>gu(hu(e,t),n.get(e.n.unit||``)??[])===0)}function ju(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(hu(r,t).join(`.`))}return new Map([...n].map(([e,t])=>[e,t.size]))}var Mu=(e,t)=>t&&t>1?{...e,passes:t}:e;function Nu(e,t){let n=du(e);return Pu(n,t,n.tasks.filter(e=>fu(e.path,t)))}function Pu(e,t,n){let r=t.length,i=new Map,a=new Map;for(let e of n){let t=vu(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=_u(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?Au(t.tasks,r):t.tasks;s.set(t.id,a);let u=t.type===`kind`?Du(a):Ou(a,r,t.name,e.calls);if(i){let e=ju(t.tasks,r);u.byUnit=new Map([...u.byUnit].map(([t,n])=>[t,Mu(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=_u(e.loops);for(let n of e.tasks){let e=hu(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=vu(n,i);return{id:`stub:${i}:${a.id}`,label:a.type===`kind`?e.labels.get(a.name)??a.name:pu(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!==`created`&&p.add(n));if(s!==void 0){let a=e.byKey.get(i),c=mu(a,r),l=mu(t,r),u=0;for(;u<c.length&&c[u]===l[u];)u++;let d=gu(hu(a,r).slice(0,u),hu(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.given_from??[])i(e,`given`);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=>!Iu(e.type).some(t=>m.has(`${e.from}\0${e.to}\0${t}`))).sort((e,t)=>_(`${e.from}\0${e.to}\0${e.type}`,`${t.from}\0${t.to}\0${t.type}`)),y=[...h.values()].filter(e=>!Iu(e.type).some(t=>h.has(`${e.id}\0${e.to}\0${t}`))).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:pu(n.name),layer:[...t],kinds:[...new Set(n.tasks.map(e=>e.n.kind))],executor:n.type===`flow`?null:Cu(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:ku(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 Fu=e=>e===`given`?`solid`:e===`after`?`dotted`:`dashed`,Iu=e=>ou.slice(0,ou.indexOf(e));function Lu(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:Fu(e.type),ranks:e.samePass})),stubs:e.stubs.map(e=>({id:e.id,to:e.to,style:Fu(e.type)}))}}function Ru(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 zu=`fx::`,Bu=(e,t)=>`${e.join(`/`)}/${t}`,Vu=e=>e?.state===`raised`||e?.state===`closed`;function Hu(e,t,n=!1){let r=t.length,i=new Map,a=new Set;if(e.calls)for(let t of e.calls.values())Vu(t)&&a.add(t.id);for(let o of e.tasks){if(!fu(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=vu(o,t),l=o.path.slice(0,t),u=Bu(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,cancelled: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,w(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=vu(o,t+1);d.kids.add(f.id),f.type===`flow`&&d.fns.add(Bu(o.path.slice(0,t+1),f.id)),c=u}}return i}function Uu(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 Wu=(e,t=new Set)=>e.agent>0||e.failed>0||e.errors||e.running>0||e.stuck>0||t.has(e.key),Gu=(e,t)=>Uu(e,t)-1.5*e.depth;function Ku(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:Gu(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)&&Wu(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 qu(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 Ju(e,t,n){let r=du(e),i=t.length,a=r.tasks.filter(e=>fu(e.path,t)),o=Hu(r,t,n.live),s=new Set(a.map(e=>vu(e,i).id)).size,c=n.sel?qu(n.sel,o):n.toward,{open:l,auto:u}=Ku(o,s,{...n,toward:c}),d=Yu(r,t,a,o,l),f=e=>uo(lo(Lu(e))).span;if(n.maxSpan&&!n.all)for(;u.length&&f(d)>n.maxSpan;)l.delete(u.pop()),d=Yu(r,t,a,o,l);return{model:d,open:l,stats:o}}function Yu(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=Bu(e.path.slice(0,t),vu(e,t).id);if(!i.has(r))break;n=r,su(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,Pu(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):`${zu}${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:`${zu}${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(Bu(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,vu(e,t.depth).id)},b=e=>e.path.slice(0,o.get(e.n.key).depth),x=new Set,S=new Map,C=new Map;for(let r of n){let n=y(r),i=(i,o)=>{let s=e.byKey.get(i);if(!s)return;if(fu(s.path,t)){let e=y(s);if(e===n)return void(o!==`created`&&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=mu(s,a),l=mu(r,a),u=0;for(;u<c.length&&c[u]===l[u];)u++;let d=gu(hu(s,a).slice(0,u),hu(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=vu(s,c),u={id:`stub:${c}:${l.id}`,label:l.type===`kind`?e.labels.get(l.name)??l.name:pu(l.name)},d=`${u.id}\0${n}\0${o}`;(C.get(d)??C.set(d,{...u,to:n,type:o,tasks:new Set}).get(d))?.tasks.add(r.n.key)};for(let e of r.n.given_from??[])i(e,`given`);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 ee=[...S.values()].filter(e=>!Iu(e.type).some(t=>S.has(`${e.from}\0${e.to}\0${t}`))).map(e=>({from:e.from,to:e.to,tasks:e.tasks.size,type:e.type,samePass:e.samePass,back:!1})),te=[...C.values()].filter(e=>!Iu(e.type).some(t=>C.has(`${e.id}\0${e.to}\0${t}`))).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:ee,stubs:te,units:_}}function Xu(e){let t=new Map,n=new Map;for(let r of e){let e=Zu(r);t.set(r.key,e);for(let t of e)(n.get(t.key)??n.set(t.key,[]).get(t.key))?.push({key:r.key,type:t.type})}return{byKey:new Map(e.map(e=>[e.key,e])),earlier:t,later:n}}function Zu(e){let t=new Map;for(let n of e.given_from??[])t.set(n,`given`);for(let n of e.after??[])t.has(n)||t.set(n,`after`);for(let n of e.created_from??[])t.has(n)||t.set(n,`created`);return[...t].map(([e,t])=>({key:e,type:t}))}var Qu=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function $u(e,t){let n=new Map;for(let r of e?.entries??[]){if(!r.remaining)continue;let e=t.nodes.find(e=>e.type===`kind`?e.name===r.group&&Qu(e.layer,r.flow):r.flow.length>e.layer.length&&Qu(e.layer,r.flow.slice(0,e.layer.length))&&r.flow[e.layer.length]===e.name);e&&n.set(e.id,(n.get(e.id)??0)+r.remaining)}return n}function ed(e,t){let n=new Set(t.nodes.map(e=>`${e.group}\0${(e.flow??[]).map(e=>e.function).join(`\0`)}`)),r=new Map;for(let t of e?.entries??[])t.remaining&&!n.has(`${t.group}\0${t.flow.join(`\0`)}`)&&r.set(t.group,(r.get(t.group)??0)+t.remaining);return[...r].map(([e,t])=>({group:e,remaining:t}))}var td=e=>!!e?.earlier_run&&e.remaining>0;function nd(e,t,n,r,i=Nu(e,t)){let{drafts:a,ix:o}=i,s=Ru(i.model,lo(Lu(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=>hu(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&&gu(e,t)===0,_=(e,t)=>{let n=t.length;return[...new Set(h(e).map(p).filter(e=>e.length>n&&gu(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)),C=Array.from({length:S},()=>[]),ee=(e,t)=>{let n=C[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)ee(n,t+1)};for(let e of v)ee(e,0);let te=h(c),ne=new Set(te.map(e=>e.n.unit||``)),re=[...s.units.filter(e=>ne.has(e)),...ne.has(``)?[``]:[]],ie=new Map;return y.forEach((e,t)=>{for(let n of a.get(e.node.id)?.tasks??[])g(p(n),e.passes)&&su(ie,`${t}\0${n.n.unit||``}`,n)}),{box:c,columns:y,head:C,rows:re.map(e=>{let t=y.map((t,n)=>{let r=ie.get(`${n}\0${e}`);return r?.length?((e,t,n)=>{let r=a.get(e.node.id);if(r.type===`kind`)return Eu(t,n);let i=Ou(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(te.filter(t=>(t.n.unit||``)===e).map(e=>hu(e,l).slice(0,u+1).join(`.`))).size,state:Su(t.filter(e=>e!==null).map(e=>e.state)),cells:t}})}}function rd(e,t){let n=new Map(e.map((e,t)=>[e,t])),r=e=>t===`passes`?-e.passes:t===`state`?-bu[e.state]:0;return[...e].sort((e,t)=>r(e)-r(t)||(n.get(e)??0)-(n.get(t)??0))}var id=(e,t,n=[])=>`${e}${n.length?`|${n.join(`.`)}`:``}#${t.unit||t.key}`;function ad(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 od=[`done`,`partial`,`running`,`pending`,`failed`,`blocked`,`skipped`,`cancelled`],sd={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`},cancelled:{tone:`muted`,shape:`ring`}};function cd(e){return Object.fromEntries(od.map(t=>[t,{...sd[t],label:ld(t,e),rank:bu[t],count:n=>ud(t,n,e)}]))}function ld(e,t){return as(h(e),t)}function ud(e,t,n){let r=h(e);return Z(r!==`waiting`||n?r:`not_run`,t)}function dd(e){return D(E`${e.done} of ${e.total} tasks done`)}function fd(e,t){return[`failed`,`blocked`,`partial`,`running`,`pending`,`cancelled`,`skipped`].filter(t=>e[t]).map(n=>ud(n,e[n],t))}function pd(e,t){let n=e.counts,r=[];return n.failed&&r.push([`err`,ud(`failed`,n.failed,t)]),e.errors&&r.push([`err`,e.errors===1?D(`1 flow call stopped with an error`):D(E`${e.errors} flow calls stopped with an error`)]),n.blocked&&r.push([`warn`,ud(`blocked`,n.blocked,t)]),n.partial&&r.push([`warn`,ud(`partial`,n.partial,t)]),n.running&&r.push([`live`,ud(`running`,n.running,t)]),n.pending&&r.push([`mut`,ud(`pending`,n.pending,t)]),n.skipped&&r.push([`mut`,ud(`skipped`,n.skipped,t)]),r}function md(e,t){let n=t?t.slice(t.lastIndexOf(`/`)+1):``;return n?`${n}:${e}`:D(E`line ${e}`)}function hd(e){return e.executor===`agent`?D(`Agent task`):e.executor===`python`?D(`Python task`):e.executor===`mixed`?K(D(`Agent task`),D(`Python task`)):``}function gd(e){return e.type===`flow`?K(D(E`Function ${e.name}`),e.timeBox?D(E`Deadline ${B(e.timeBox.deadline_s)}`):``,dd(e.counts)):K(e.label,hd(e),dd(e.counts))}function _d(e,t){let n=e=>{let n=t.nodes.find(t=>t.id===e);return n?n.box?D(E`${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{given:r(`given`),order:r(`after`),created:r(`created`),feeds:[...new Set(t.edges.filter(t=>t.from===e.id).map(e=>n(e.to)))]}}function vd(e,t,n){let r=e.counts,{given:i,order:a,created:o,feeds:s}=_d(e,t);return[e.type===`flow`?K(D(E`Function ${e.label}`),dd(r)):K(e.label,hd(e),dd(r)),...pd(e,n).map(([,e])=>e),i.length?D(E`Given output of: ${q(i)}`):``,a.length?D(E`Runs after: ${q(a)}`):``,o.length?D(E`Created after: ${q(o)}`):``,s.length?D(E`Later tasks: ${q(s)}`):``].filter(Boolean).join(`. `)}function yd(e,t,n,r=``){let i=t.flow?void 0:n.task,a=J({kind:t.count===1&&i?i.kind:e,unit:t.unit}),o=t.flow||t.state!==`blocked`?``:n.causeOf(t.key),s=o?D(E`Not started: ${o}`):ld(t.state,n.live),c=i?.attempts??1,l=c>1?D(E`${c} attempts`):``;return{name:a,parts:[s,r,t.passes?Ss(t.passes):``,l,t.flow||t.count>1?D(E`${t.count} tasks`):``,...t.counts?fd(t.counts,n.live):[],...t.error===void 0?[]:[D(`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?D(E`Flow call ${t.key}`):t.key}}var bd={err:`failed`,warn:`attention`,live:`running`,mut:`muted`};function xd(e){return t=>{let{outcomes:n}=S(e.journal,e.plan),r=n.get(t);return r?hs(r,n,e.run):``}}var Sd=e=>{let t=xd(e);return n=>({task:e.links.byKey.get(n.key),causeOf:t,live:e.live})},Cd=e=>D(E`Loop at ${md(e.loop,e.file)}`),wd=e=>e.executor===`mixed`?[`agent`,`python`]:e.executor?[e.executor]:[];function Td(e,t,n=!1){let r=Sd(t),i=(e,t)=>{let{name:n,parts:i}=yd(e.label,t,r(t));return{id:id(e.id,t),state:t.state,label:K(n,...i),tip:[n,i[0]??``].filter(Boolean).join(`
|
|
421
|
+
`),...t.passes?{badge:String(t.passes)}:{},name:t.unit||t.key,drill:!!t.flow}},a=$u(t.forecast,e),o=e.nodes.map(r=>{let o=r.counts,s=a.get(r.id),c=s?function(e){return{text:D(E`+${e}`),label:D(e===1?`1 more task expected (forecast)`:E`${e} more tasks expected (forecast)`)}}(s):null;return{id:r.id,label:r.label,tip:gd(r),summary:c?K(vd(r,e,t.live),c.label):vd(r,e,t.live),...c?{expected:c}:{},cluster:r.box,icons:wd(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:o,progress:{done:o.done,total:o.total,label:dd(o)},notes:pd(r,t.live).map(([e,t])=>({text:t,tone:bd[e]})),look:o.failed||r.errors?`failed`:o.running?`running`:o.done+o.skipped===o.total?`done`:void 0,...r.type===`flow`&&n?{toggle:`closed`}:{}}}),s=e.fns.map(n=>{let r=n.parts[0].node,i=n.parts.map(e=>e.node.label).join(` › `),a=r.counts,o=pd(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,vd(r,e,t.live)),chipLabel:D(E`Inside ${i}`),chipTip:K(D(`Function`),i),drill:!0,cycle:!1,toggle:`open`,path:n.parts.map(e=>({id:e.id,label:e.node.label,tip:e.node.name}))}}),c=e.boxes.map(e=>{let t=Cd(e),n=e.spread.length>1?Cs(e.spread):``,r=xs(e.passes);return{id:e.id,parent:e.parent,label:ws(),tip:K(ws(),t),note:r,...n?{detail:n,detailTip:D(`Units by number of passes`)}:{},summary:K(t,r,n),chipLabel:K(D(E`Passes of the loop at ${md(e.loop,e.file)}`),r),chipTip:K(t,r),drill:!0,cycle:!0}});return{series:e.units,nodes:o,clusters:[...c,...s],edges:e.edges.map(e=>({from:e.from,to:e.to,style:Fu(e.type),weight:e.tasks,ranks:e.samePass})),stubs:e.stubs.map(e=>({id:e.id,label:e.label,to:e.to,style:Fu(e.type),weight:e.tasks}))}}function Ed(e,t,n){let r=Nu(e,t);return{input:Td(r.model,{...n,plan:e}),proj:r}}function Dd(e,t,n){let r=Sd(n),i=e.box,a=Cd(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:bs(e.pass),tip:e.box.id===i.id?Cd(e.box):D(E`Nested loop at ${md(e.box.loop,e.box.file)}`),span:e.span,rows:e.rows,type:`group`};if(e.type===`loop`)return{id:e.box.id,label:ws(),tip:D(E`Nested loop at ${md(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?D(E`Function ${t.name}`):K(t.label,hd(t)),summary:n?t.label:K(t.label,hd(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,xs(i.passes)),facts:[xs(i.passes),i.spread.length>1?Cs(i.spread):``,D(o===1?`1 unit`:E`${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:rd(e.rows,t).map(t=>({id:t.unit,label:t.unit||D(`No unit`),tip:t.unit||D(`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}=yd(a,n,r(n),q(o.map(bs)));return{id:id(i?.node.id??``,n,o),state:n.state,label:K(s,...c),tip:[s,c[0]??``].filter(Boolean).join(`
|
|
422
|
+
`),drill:!!n.flow}})(n,t))})),value:{label:D(`Passes`),tip:D(`Passes of this loop`)},sorts:[{id:`order`,label:D(`Scheduled order`)},{id:`passes`,label:D(`Number of passes`)},{id:`state`,label:D(`Status`,{id:`status`})}],sort:t}}function Od(e,t,n,r,i,a,o){let s=nd(e,t,n,r,o);return s&&{input:Dd(s,i,{...a,plan:e}),matrix:s}}function kd(e,t=[],n,r=!1){let{model:i}=Nu(e,t);return Ru(i,lo(Lu(i),n,r))}function Ad(e){let t=du(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(!fu(r.path,n))continue;let t=vu(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=yu(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 jd(e){let t=e[e.length-1];return t?.startsWith(`loop:`)?{path:e.slice(0,-1),loop:t}:{path:[...e],loop:null}}function Md(e,t){let{path:n,loop:r}=jd(t),i=du(e),a=t=>!r||Nu(e,t).model.boxes.some(e=>e.id===r);if(i.tasks.some(e=>fu(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=>pu(e)===o),u=l.length===1?l[0]:null;return u&&a(u)?r?[...u,r]:u:null}function Nd(e,t){if(e.length<=t.length)return null;let n=e.slice(0,-1);return n.length<=t.length?[]:n}function Pd(e,t,n){return pi((e=>e?`⚙`:`✦`)(e),t,{cls:n??`k-ic `+(e?``:`llm`)})}var Fd=k` .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 Id(e,t){t!==e.sel&&$(e.el,`ca-navigate`,{sel:t})}function Ld(e,t,n=e.unit){let r=t.join(`/`);$(e.el,`ca-navigate`,{layer:r===e.auto.join(`/`)?``:r,unit:n})}function Rd(e,t){$(e.el,`ca-navigate`,{tab:`tasks`,kind:t.kinds.length===1?t.kinds[0]:``})}function zd(e,t,n){if(t.flow)return Ld(e,[...n?.layer??e.graph.path,t.flow],t.unit||e.unit);let r=e.links.byKey.get(t.key);$(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 Bd(e,t){return t.type===`mark`?zd(e,t.mark,t.node):t.type===`box`?Ld(e,[...t.box.layer,t.box.local]):t.node.type===`flow`?Ld(e,[...t.node.layer,t.node.name]):void Rd(e,t.node)}function Vd(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=>pd({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 A`<li>
|
|
420
423
|
<div class="orow ${u?`cur`:``} ${t.parts.some(t=>e.selected(t.id))?`sel`:``}">
|
|
421
|
-
${t.kids.length?
|
|
422
|
-
<button type="button" class="oname" title=${t.tip||
|
|
423
|
-
${t.type===`loop`?bo(12):
|
|
424
|
+
${t.kids.length?A`<button type="button" class="odisc" aria-expanded=${i} aria-label=${D(i?E`Fold ${t.label}`:E`Unfold ${t.label}`)} @click=${()=>e.expand(t.id,!i)}><span aria-hidden="true">${i?`▾`:`▸`}</span></button>`:A`<span class="odisc" aria-hidden="true"></span>`}
|
|
425
|
+
<button type="button" class="oname" title=${t.tip||M} aria-current=${d?`location`:M} @click=${n=>n.detail<2&&e.pick(t)} @dblclick=${()=>e.enter(t)} @keydown=${n=>{n.key===`Enter`&&(n.preventDefault(),e.enter(t))}}>
|
|
426
|
+
${t.type===`loop`?bo(12):M}<span class="ol">${t.label}</span>
|
|
424
427
|
<span class="obar" aria-hidden="true"><i style="width:${o}%"></i></span>
|
|
425
|
-
<span class="ocount" title=${
|
|
428
|
+
<span class="ocount" title=${dd(a)}>${a.done}/${a.total}</span>
|
|
426
429
|
</button>
|
|
427
|
-
${l.length?
|
|
430
|
+
${l.length?A`<div class="onote">${l.map(([e,t])=>A`<span class=${e}>${t}</span>`)}</div>`:M}
|
|
428
431
|
</div>
|
|
429
|
-
${i?
|
|
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
|
|
432
|
-
${n.length?
|
|
432
|
+
${i?A`<ul>${t.kids.map(e=>r(e,c))}</ul>`:M}
|
|
433
|
+
</li>`};return A`<nav class="outline" aria-label=${D(`Outline of the flow`)}><ul class="otree">${n.map(e=>r(e))}</ul></nav>`}var Hd=[V,Fd,Jr,k` :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;}.forecast{font-size:12px;color:var(--text-muted);margin:0 0 8px;display:flex;flex-wrap:wrap;align-items:center;gap:4px;}.forecast .expected-mark{display:inline-block;width:18px;height:10px;border:1.5px dotted var(--line2);border-radius:999px;margin-right:4px;}.unawaited{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 8px;}.card .down{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px;}.whole,.whole>.g{display:flex;flex-direction:column;flex:auto;min-height:0;min-width:0;}.whole.side{display:grid;grid-template-columns:minmax(200px,282px) minmax(0,1fr);gap:14px;align-items:start;}.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;}`],Ud=[Fd,k` .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;}`],Wd=e=>Math.max(14,Math.min(60,Math.round(e/34))),Gd=e=>Math.max(8,Math.min(16,Math.round(e/105))),Kd=(e,t)=>t>0&&t/(180*e)<.6,qd=`*all`,Jd=`*none`,Yd={...lo({nodes:[],clusters:[],edges:[],stubs:[]}),path:[],nodes:[],boxes:[],fns:[],edges:[],stubs:[],units:[]},Xd=class extends N{constructor(...e){super(...e),this.plan={nodes:[],groups:[]},this.forecast=null,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=Yd,this.input={series:[],nodes:[],clusters:[],edges:[],stubs:[]},this.prevOrder=void 0,this.matrix=null,this.matrixIn=null,this.orders=new Map,this.links=Xu([]),this.states=cd(!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=Nd(this.segments,this.auto);t&&(e.preventDefault(),this.refocus=!0,this.cameFrom=this.segments[this.segments.length-1]??``,Ld(this.h,t))},this.onSelect=e=>Id(this.h,e.detail.id??``),this.onActivate=e=>{let t=ad(this.graph,this.matrix,e.detail.id);t?.type===`mark`?zd(this.h,t.mark,t.node):t?.type===`node`&&Rd(this.h,t.node)},this.onDrill=e=>{let t=ad(this.graph,this.matrix,e.detail.id);t&&Bd(this.h,t)},this.onView=e=>{e.detail.view===`graph`&&this.matrix&&function(e){let t=e.segments[e.segments.length-1]??``,n=Nd(e.segments,e.auto)??[],r=e.auto.join(`/`);$(e.el,`ca-navigate`,{layer:n.join(`/`)===r?``:n.join(`/`),unit:e.unit,sel:t})}(this.h)}}static{this.styles=Hd}static{this.properties={plan:{attribute:!1},forecast:{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=Xu(this.plan.nodes)),(e.has(`plan`)||e.has(`live`))&&(this.flowStats=Hu(du(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:pu(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=`${au}${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:D(E`Loop at ${md(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,cancelled: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&&!jd(this.segments).loop&&!ad(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=Ad(this.plan),this.segments=this.layer?this.layer.split(`/`):this.auto,this.layer&&this.plan.nodes.length){let e=Md(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}=jd(this.segments);if(t)this.proj=Nu(this.plan,e),this.model=this.proj.model;else{let t=this.memory(),n=this.openMode(),r=Ju(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:Gd(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=An(),i=n||e.has(`journal`)||e.has(`live`)||e.has(`forecast`)||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}=jd(this.segments),o={plan:this.plan,journal:this.journal,run:this.run,live:this.live,links:this.links,forecast:this.forecast};if(e){this.locale=t,this.states=cd(this.live),this.input=Td(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=Ru(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=>[id(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 Map(r.map(e=>[e,null]));for(let[e,n]of ou.entries()){let a=new Set(ou.slice(0,e+1));for(let e of[t.earlier,t.later]){let t=new Set(r),o=[...r];for(let r=o.pop();r!==void 0;r=o.pop())for(let s of e.get(r)??[])a.has(s.type)&&!t.has(s.key)&&(t.add(s.key),i.has(s.key)||i.set(s.key,n),o.push(s.key))}}return i}(e.nodes,t,i.get(n)??n),c=new Map;for(let[e,t]of r){let n=t.keys.filter(e=>s.has(e)).map(e=>s.get(e)??null);if(!n.length)continue;let r=ou.find(e=>n.includes(e));c.set(e,n.includes(null)||!r?null:Fu(r))}return a.set(n,c),c}}(this.plan,this.links,this.graph)}let s=a&&r?Od(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?Wd(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(qd)?`all`:e.has(Jd)?`none`:`auto`}setMode(e){let{opened:t,closed:n}=this.memory();t.clear(),n.clear(),e===`all`&&t.set(qd,!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 Bu(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?`${zu}${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,$(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 A`<div class="blank" style="padding:24px">${this.live?D(`No tasks scheduled yet`):D(`No tasks scheduled`)}</div>`;let e=this.wide&&this.tree.length>0,t=this.tree.length?e?Vd(this.oh,this.tree):A`<details class="odet"><summary>${D(`Outline of the flow`)}</summary>${Vd(this.oh,this.tree)}</details>`:M;return A`<div class="whole ${e?`side`:``}">${t}<div class="g">${this.renderGraph()}</div></div>`}renderGraph(){let e=ad(this.graph,this.matrix,this.sel),t=this.graph.nodes.some(e=>e.type===`flow`);return A`<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=D(`Enter: open`);return{graph:D(`Graph`,{id:`view-graph`}),table:D(`Table`,{id:`view-table`}),view:D(`View`),zoomIn:D(`Zoom in`),zoomInTip:D(`Zoom in (Ctrl + scroll)`),zoomOut:D(`Zoom out`),zoomOutTip:D(`Zoom out (Ctrl + scroll)`),showAll:D(`Show all`),graphKeys:[D(`Tab: next node`),D(`Arrow keys: marks`),D(`Shift + arrow keys: earlier and later tasks`),n],tableKeys:[D(`Tab: next row`),n],matrixKeys:[D(`Arrow keys: marks`),n],clearKey:D(`Esc: clear selection`),upKey:e?D(`Esc: up a level`):``,inspector:D(`Selected item`),stubTip:D(`Outside this layer`),more:e=>D(E`+${e}`),badge:D(`number of passes`),solidEdge:rl(`given_from`),dottedEdge:rl(`after`),dashedEdge:rl(`created_from`),cycle:D(`next pass`),drill:D(`has a level below`),open:D(`Show inside`),close:D(`Hide inside`),iconNames:{agent:D(`agent task`),python:D(`Python task`)},nameHeader:D(t?`Kind or function`:`Kind`),statusHeader:D(`Status`,{id:`status`}),solidHeader:D(`Given output of`),dottedHeader:D(`Runs after`),dashedHeader:D(`Created after`),laterHeader:D(`Later tasks`),none:D(`none`,{id:`none`}),inCluster:e=>D(E`${e} in the loop`),list:e=>q(e)}}(!!Nd(this.segments,this.auto),t)} .matrixStrings=${{sortBy:D(`Sort units`),rowsHeader:D(`Unit`)}} .renderIcon=${Zd} .iconStyles=${Ud} @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}>
|
|
434
|
+
<div slot="crumbs">${function(e,t=null){let n=e.segments,r=e.unit;if(!n.length&&!r&&!t)return M;let{path:i,loop:a}=jd(n),o=[...i.map((e,t)=>({name:pu(e),tip:e,to:i.slice(0,t+1)})),...(a?a.slice(5).split(`.`):[]).map((t,n,r)=>{let a=au+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:D(s?E`Loop at ${md(t,o)}`:`Loop`),tip:s&&o?`${o}:${t}`:``,to:[...i,a]}})];return A`<div class="bar">
|
|
435
|
+
${n.length?A`<nav aria-label=${D(`Pipeline layer`)}>
|
|
433
436
|
<ol class="crumbs">
|
|
434
|
-
<li><button type="button" @click=${()=>
|
|
435
|
-
${o.map((t,n)=>
|
|
436
|
-
${n===o.length-1?
|
|
437
|
+
<li><button type="button" @click=${()=>Ld(e,[])}>${D(`Pipeline`)}</button></li>
|
|
438
|
+
${o.map((t,n)=>A`<li><span class="sep" aria-hidden="true">›</span>
|
|
439
|
+
${n===o.length-1?A`<span aria-current="page" title=${t.tip||M}>${t.name}</span>`:A`<button type="button" title=${t.tip||M} @click=${()=>Ld(e,t.to)}>${t.name}</button>`}</li>`)}
|
|
437
440
|
</ol>
|
|
438
|
-
</nav>`:
|
|
439
|
-
${r?
|
|
440
|
-
<button type="button" class="switch" @click=${()
|
|
441
|
-
${t??
|
|
442
|
-
</div>`}(this.h,
|
|
443
|
-
|
|
441
|
+
</nav>`:M}
|
|
442
|
+
${r?A`<span class="pin">${D(E`Unit: ${r}`)}
|
|
443
|
+
<button type="button" class="switch" @click=${()=>$(e.el,`ca-navigate`,{unit:``})}>${D(`Clear highlight`)}</button></span>`:M}
|
|
444
|
+
${t??M}
|
|
445
|
+
</div>`}(this.h,jd(this.segments).loop?null:function(e,t){let n=(n,r)=>A`<button type="button" class="switch" aria-pressed=${e===n} @click=${()=>t(e===n?`auto`:n)}>${r}</button>`;return A`<span class="opens">${n(`all`,D(`Show all inside`))}${n(`none`,D(`Hide all inside`))}</span>`}(this.openMode(),e=>this.setMode(e)))}${function(e){if(!e)return M;let t=e.split(`/`),n=t[t.length-1]||e;return A`<div class="missing" role="status" title=${e}>${D(A`No layer <code>${n}</code> in this run`)}</div>`}(this.missing)}${this.segments.join(`/`)===this.auto.join(`/`)?A`${function(e,t){if(!td(t))return M;let n=(r=ed(t,e)).length?D(E`Not in the plan yet: ${q(r.map(e=>`${e.group} +${e.remaining}`))}`):``;var r,i;return A`<div class="forecast" title=${i=t,D(E`Tasks this run is expected to create and has not yet, from the run ${i.earlier_run} of the same flow (forecast)`)}><span class="expected-mark" aria-hidden="true"></span>${function(e){return K(e.remaining===1?D(`Forecast: 1 more task`):D(E`Forecast: ${e.remaining} more tasks`),e.wall_s?D(E`${B(e.wall_s)} of task time`):``,e.cost_usd!==null&&e.cost_usd!==void 0?X(e.cost_usd):``)}(t)}${n?A`<span class="sep" aria-hidden="true"> | </span>${n}`:M}</div>`}(this.plan,this.forecast)}${function(e){let t=[...new Set((e.plan.flow_calls??[]).filter(e=>e.parent===null).flatMap(e=>e.unawaited??[]))];return t.length?A`<div class="unawaited" title=${D(`Tasks whose result no flow awaited, ordered a task after or returned (unawaited); they ran for their output files and changes`)}>
|
|
446
|
+
<span class="meta">${n=t.length,D(n===1?`1 task not awaited`:E`${n} tasks not awaited`)}</span>
|
|
447
|
+
${t.map(t=>{let n=e.links.byKey.get(t);return bl(e.el,n?J(n):t,n??{key:t})})}
|
|
448
|
+
</div>`:M;var n}(this.h)}`:M}</div>
|
|
449
|
+
${e?function(e,t){return A`<div slot="inspector" class="card">${function(e,t){let n=(e,t)=>A`<dt>${e}</dt><dd>${t}</dd>`,r=(e,t,n=!1)=>A`<button type="button" class="go ${n?`primary`:``}" @click=${t}>${e}</button>`,i=A`<button type="button" class="switch" @click=${()=>Id(e,``)}>${D(`Clear selection`)}</button>`,a=e=>e.length?q(e):D(`none`,{id:`none`});if(t.type===`box`){let a=t.box,o=md(a.loop,a.file);return A`<h4 title=${a.file?`${a.file}:${a.loop}`:M}>${bo(16)}${D(E`Loop at ${o}`)}</h4>
|
|
444
450
|
<dl>
|
|
445
|
-
${n(
|
|
446
|
-
${a.spread.length>1?n(
|
|
451
|
+
${n(D(`Passes`),xs(a.passes))}
|
|
452
|
+
${a.spread.length>1?n(D(`Units by number of passes`),Cs(a.spread)):M}
|
|
447
453
|
</dl>
|
|
448
|
-
<div class="acts">${r(E
|
|
449
|
-
|
|
454
|
+
<div class="acts">${r(D(E`Passes of the loop at ${o}`),()=>Bd(e,t),!0)}${i}</div>`}if(t.type===`node`){let o=t.node,s=o.counts,{given:c,order:l,created:u,feeds:d}=_d(o,e.graph),f=function(e,t,n,r,i){let a=!n.length&&!r.length&&!i.length;return A`${n.length||a?e(D(`Given output of`),t(n)):M}
|
|
455
|
+
${r.length?e(D(`Runs after`),t(r)):M}
|
|
456
|
+
${i.length?e(D(`Created after`),t(i)):M}`}(n,a,c,l,u),p=pd(o,e.live).map(([e,t])=>A`<div class=${e}>${t}</div>`);return o.type===`flow`?A`<h4 title=${o.name}>${xo()}${o.label}</h4>
|
|
457
|
+
<div class="sub">${D(`Function`)}</div>
|
|
450
458
|
<dl>
|
|
451
|
-
${n(
|
|
452
|
-
${o.timeBox?n(
|
|
453
|
-
${n(
|
|
454
|
-
${
|
|
455
|
-
${
|
|
456
|
-
${n(E(`Later tasks`),a(u))}
|
|
459
|
+
${n(D(`Flow calls`),o.calls)}
|
|
460
|
+
${o.timeBox?n(D(`Deadline`),A`<span title=${hc()}>${function(e){let t=e.finishing_kinds??[];return K(B(e.deadline_s),e.grace_s&&t.length?D(E`finishing time ${B(e.grace_s)}`):``,t.length?D(E`finishing kinds: ${q(t)}`):``)}(o.timeBox)}</span>`):M}
|
|
461
|
+
${n(D(`Tasks`,{id:`tasks`}),A`${dd(s)}${p}`)}
|
|
462
|
+
${f}
|
|
463
|
+
${n(D(`Later tasks`),a(d))}
|
|
457
464
|
</dl>
|
|
458
|
-
<div class="acts">${r(E
|
|
459
|
-
<div class="sub">${
|
|
465
|
+
<div class="acts">${r(D(E`Inside ${o.label}`),()=>Bd(e,t),!0)}${i}</div>`:A`<h4>${o.executor&&o.executor!==`mixed`?Pd(o.executor===`python`):M}${o.label}</h4>
|
|
466
|
+
<div class="sub">${hd(o)}</div>
|
|
460
467
|
<dl>
|
|
461
|
-
${o.kinds.length>1?n(
|
|
462
|
-
${n(
|
|
463
|
-
${
|
|
464
|
-
${
|
|
465
|
-
${n(E(`Later tasks`),a(u))}
|
|
468
|
+
${o.kinds.length>1?n(D(`Kinds`),q(o.kinds)):M}
|
|
469
|
+
${n(D(`Tasks`,{id:`tasks`}),A`${dd(s)}${p}`)}
|
|
470
|
+
${f}
|
|
471
|
+
${n(D(`Later tasks`),a(d))}
|
|
466
472
|
</dl>
|
|
467
|
-
<div class="acts">${r(E
|
|
473
|
+
<div class="acts">${r(D(E`Tasks of ${o.label}`),()=>Bd(e,t),!0)}${i}</div>`}let{node:o,mark:s,passes:c}=t,l=s.flow||s.count!==1?void 0:e.links.byKey.get(s.key),u=J({kind:l?.kind??o.label,unit:s.unit}),d=s.flow||s.state!==`blocked`?``:xd(e)(s.key),p=A`<span data-status class=${s.state===`failed`?`err`:s.state===`blocked`||s.state===`partial`?`warn`:``}>${ld(s.state,e.live)}</span>`,m=cd(e.live)[s.state],h=A`<h4 title=${s.flow?D(E`Flow call ${s.key}`):s.key}><i class="mark" data-tone=${L(m?.tone)} data-shape=${m?.shape??M} aria-hidden="true"></i>${u}</h4>`,g=c.length?q(c.map(bs)):s.passes?Ss(s.passes):``;if(s.flow){let a=s.counts;return A`${h}
|
|
468
474
|
<dl>
|
|
469
|
-
${n(
|
|
470
|
-
${
|
|
471
|
-
${s.deadlineAt?n(
|
|
472
|
-
${a?n(
|
|
473
|
-
${s.error===void 0?
|
|
475
|
+
${n(D(`Status`,{id:`status`}),p)}
|
|
476
|
+
${g?n(D(`Pass`),g):M}
|
|
477
|
+
${s.deadlineAt?n(D(`Deadline`),A`<span title=${hc()}>${_=s.deadlineAt,G(_,!0)}</span>`):M}
|
|
478
|
+
${a?n(D(`Tasks`,{id:`tasks`}),A`${dd(a)}${fd(a,e.live).map(e=>A`<div>${e}</div>`)}`):M}
|
|
479
|
+
${s.error===void 0?M:n(D(`Error`),A`<span class="err">${s.error||D(`Flow call stopped with an error`)}</span>`)}
|
|
480
|
+
${function(e,t,n){let r=e.plan.flow_calls?.find(e=>e.id===n);if(!r||r.state!==`raised`)return M;let i=r.raised_by?e.links.byKey.get(r.raised_by):void 0,a=i?J(i):r.raised_by??``,o=function(e,t,n=``){let r=ll(e,n);return t?D(r?E`Stopped at ${r} by the failure of ${t}`:E`Stopped by the failure of ${t}`):r?D(E`Stopped at ${r}`):``}(r,a,e.run);return o?t(D(`Stopped`,{id:`flow-call-stopped`}),A`<div>${o}</div>${r.raised_by?A`<div class="down">${bl(e.el,a,i??{key:r.raised_by})}</div>`:M}`):M}(e,n,s.key)}
|
|
474
481
|
</dl>
|
|
475
|
-
<div class="acts">${r(E
|
|
482
|
+
<div class="acts">${r(D(E`Inside ${pu(s.flow)}`),()=>Bd(e,t),!0)}${i}</div>`}var _;let v=e.journal.filter(e=>s.keys.includes(e.key)).filter(f),y=v.map(e=>e.cost_usd).filter(e=>typeof e==`number`),b=v.reduce((e,t)=>e+(t.wall_s??0),0);return A`${h}
|
|
476
483
|
<dl>
|
|
477
|
-
${n(
|
|
478
|
-
${
|
|
479
|
-
${s.count>1?n(
|
|
480
|
-
${n(
|
|
481
|
-
${n(
|
|
482
|
-
${n(
|
|
484
|
+
${n(D(`Status`,{id:`status`}),d?A`${p}<div>${d}</div>`:p)}
|
|
485
|
+
${g?n(D(`Pass`),g):M}
|
|
486
|
+
${s.count>1?n(D(`Tasks`,{id:`tasks`}),D(E`${s.count} tasks`)):M}
|
|
487
|
+
${n(D(`Attempts`),v.length||D(`none`,{id:`none`}))}
|
|
488
|
+
${n(D(`Time`),v.length?B(b):D(`none`,{id:`none`}))}
|
|
489
|
+
${n(D(`Cost`),y.length?X(y.reduce((e,t)=>e+t,0)):`—`)}
|
|
490
|
+
${l?function(e,t,n){let r=(e.plan.flow_calls??[]).filter(e=>e.raised_by===n);return r.length?t(D(`Stopped`,{id:`flow-call-stopped`}),r.map(t=>A`<div>${ul(t,e.run)}</div>`)):M}(e,n,l.key):M}
|
|
483
491
|
</dl>
|
|
484
|
-
<div class="acts">${r(
|
|
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">${
|
|
492
|
+
<div class="acts">${r(D(`Task detail`),()=>Bd(e,t),!0)}${o.kinds.length===1?r(D(E`Tasks of ${o.label}`),()=>Rd(e,o)):M}${i}</div>`}(e,t)}</div>`}(this.h,e):M}
|
|
493
|
+
</cae-layered-graph>`}graphWidth(){let e=this.clientWidth||1200;return this.tree.length&&e>=1500?e-300:e}currentKeys(){let{path:e}=jd(this.segments),t=new Set;for(let n of this.flowStats.values()){let r=n.layer.length;r<e.length&&fu(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}=jd(this.segments);if(e.layer.length<t.length||!fu(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:`${zu}${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}=jd(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=Qd(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}=jd(e.segments),r=e.flowStats.get(t);return!!r&&r.layer.length===n.length-1&&fu(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;$(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++,Id(e.h,n.id)},enter(t){let n=t.parts[t.parts.length-1]??t;Ld(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}}}};Xd=U([P(`ca-pipeline-graph`),O()],Xd);var Zd=e=>Pd(e===`python`);function Qd(e,t){for(let n of e){if(n.id===t)return n;let e=Qd(n.kids,t);if(e)return e}}function $d(e){if(!e||e.policy===`off`)return[];let t=[...(e.stopped??[]).map(e=>({label:Yc(),text:e,tone:`failed`,tip:``})),...(e.kept??[]).map(e=>({label:Yc(),text:K(e.kind,Kc(e.agent,e.model),e.reason),tone:`attention`,tip:D(`A kind with no available model, run on its own model (kept)`)})),...(e.substituted??[]).map(e=>({label:D(`Model replaced`),text:Jc(e),tone:`attention`,tip:D(`A kind with no available model, run on the first model that answered (substitute)`)})),...(e.dropped??[]).map(e=>({label:D(`Unavailable`),text:qc(e),tone:`muted`,tip:``}))];return t.length?t:[{label:``,text:D(`all models available`),tone:`neutral`,tip:``}]}var ef={failed:`✕`,attention:`◌`,done:`✓`,running:``,muted:`■`,neutral:`■`},tf=class extends N{constructor(...e){super(...e),this.procs=null,this.plan={nodes:[],groups:[]}}static{this.styles=[V,qr,k` :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[D(`Ended before the first agent session`),`failed`];if(!this.plan.nodes.length)return[D(`Not running`),`neutral`];let e=ee(this.plan);return e.failed?[e.failed===1?D(`Finished with 1 task failed`):D(E`Finished with ${e.failed} tasks failed`),`failed`]:e.left?[e.left===1?D(`Finished with 1 task not done`):D(E`Finished with ${e.left} tasks not done`),`attention`]:e.notStarted?[e.notStarted===1?D(`Finished with 1 task not started`):D(E`Finished with ${e.notStarted} tasks not started`),`attention`]:[D(`Finished`),`done`]}render(){let e=this.procs,t=this.summary;if(!e?.alive){let e=ne(t)===`unresponsive`,[r,i]=e?[Zo(oc()),`attention`]:this.stateTitle(),a=e?null:te(t);return A`<div class="drv off">
|
|
494
|
+
<div class="drv-ic" data-tone=${L(i)} aria-hidden="true">${ef[i]}</div>
|
|
487
495
|
<div>
|
|
488
|
-
<div class="drv-t tone-text" data-tone=${i===`done`?
|
|
489
|
-
<div class="meta">${K(this.plan.preflight?.stopped?.length?(n=this.plan.preflight.stopped,E
|
|
496
|
+
<div class="drv-t tone-text" data-tone=${i===`done`?M:L(i)}>${r}</div>
|
|
497
|
+
<div class="meta">${K(this.plan.preflight?.stopped?.length?(n=this.plan.preflight.stopped,D(E`No available model for ${q(n)}`)):``,e?cc(this.host):``,D(t?.last_ts?e?E`Last activity ${G(t.last_ts,!0)}`:E`Ended ${G(t.last_ts,!0)}`:`No activity`),a==null?``:D(E`Took ${B(a)}`),t?.run_group?D(E`Run group ${t.run_group}`):``,e?lc(t?.host_id??``):``)}</div>
|
|
490
498
|
${this.preflight()}
|
|
491
499
|
</div>
|
|
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=[[
|
|
500
|
+
</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=[[D(`PID`),e.pid??`—`],[D(`Run group`),e.run_group],[D(`Running at once (limit)`),e.max_workers||`—`],[D(`Started`),G(e.started_at,!0)]];return A`<div class="drv on">
|
|
493
501
|
<div class="drv-ic"><span class="spin"></span></div>
|
|
494
502
|
<div style="min-width:0">
|
|
495
|
-
<div class="drv-t">${
|
|
496
|
-
<div class="drv-facts">${a.map(([e,t])=>
|
|
503
|
+
<div class="drv-t">${D(`Running`)} <cae-elapsed class="drv-up" .since=${i}></cae-elapsed></div>
|
|
504
|
+
<div class="drv-facts">${a.map(([e,t])=>A`<span><i>${e}</i>${t}</span>`)}</div>
|
|
497
505
|
${this.preflight()}
|
|
498
|
-
<details class="drv-cmd"><summary>${
|
|
506
|
+
<details class="drv-cmd"><summary>${D(`Command line`)}</summary><code>${e.argv.join(` `)}</code></details>
|
|
499
507
|
</div>
|
|
500
|
-
</div>`}preflight(){let e=this.plan.preflight,t
|
|
501
|
-
<div class="pf-h" title=${n=e.policy,E
|
|
508
|
+
</div>`}preflight(){let e=this.plan.preflight,t=$d(e);return e&&t.length?A`<div class="pf">
|
|
509
|
+
<div class="pf-h" title=${n=e.policy,D(E`One request to each model before the first agent session (preflight, policy ${n})`)}>${D(`Model availability`)}</div>
|
|
502
510
|
<dl class="pf-rows">
|
|
503
|
-
${t.map(e=>
|
|
511
|
+
${t.map(e=>A`<dt data-tone=${L(e.tone)} title=${e.tip||M}>${e.label}</dt><dd class="jmono">${e.text}</dd>`)}
|
|
504
512
|
</dl>
|
|
505
|
-
</div>`:
|
|
506
|
-
`)}let i=
|
|
507
|
-
`)}function
|
|
508
|
-
${H(e,e=>e.id,e=>{let t=
|
|
513
|
+
</div>`:M;var n}};U([F({attribute:!1})],tf.prototype,`procs`,void 0),U([F({attribute:!1})],tf.prototype,`summary`,void 0),U([F({attribute:!1})],tf.prototype,`plan`,void 0),U([F({attribute:!1})],tf.prototype,`host`,void 0),tf=U([P(`ca-run-driver`),O()],tf),z(`cae-lanes`,ba);var nf=216e5,rf=e=>new Date(e).toLocaleTimeString(An(),{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`});function af(){return{py:{label:D(`Python task`),color:`var(--meter)`},llm:{label:D(`Agent task`),color:`var(--agent)`},run:{label:D(`running`),color:`var(--status-running)`,pattern:`striped`,group:1},bad:{label:D(`failed`),color:`var(--status-failed)`,pattern:`hatched`,group:1},idle:{label:D(`not started`),color:`var(--line2)`,pattern:`outline`,group:1}}}function of(e,t,n,r){if(!f(e)){let t=n.get(e.key),i=e.stop===`invalid_input`&&t?hs(t,n,r):``;return[J(e),i?D(E`Not started: ${i}`):Q(e.stop,e.reason),e.key].join(`
|
|
514
|
+
`)}let i=Js(e.hops,null,e.skipped_hops),a=e.reason&&!e.ok?T(e.reason,r):``;return[J(e),K(Q(e.stop),B(e.wall_s),D(E`ended ${rf(t)}`)),i?D(E`Model switch: ${i}`):e.model?D(E`Model ${e.model}`):``,a,e.key].filter(Boolean).join(`
|
|
515
|
+
`)}function sf(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?w(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:of(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-nf),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${D(`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 cf=class extends N{constructor(...e){super(...e),this.journal=[],this.plan=null,this.procs=null,this.live=!1,this.run=``}static{this.styles=[V,k`:host{display:block;}`]}render(){let e=Date.now(),t=this.live?fe(this.procs).map(t=>({kind:t.kind,cls:t.cls,t0:Ir.at(t.id,t.ageS,e)})):[],n=sf(this.journal,t,S(this.journal,this.plan).outcomes,this.run);return n?wo(this.run,A`<cae-lanes .lanes=${n.lanes} .barStyles=${af()} .omitted=${n.omitted} ?live=${this.live} locale=${An()} .strings=${{omitted:e=>D(e===1?`1 older attempt not shown`:E`${e} older attempts not shown`)}}></cae-lanes>`):A`<div class="blank" style="padding:28px"><span class="ic" aria-hidden="true">⏱</span>${this.live?D(`No finished attempts yet`):D(`No finished attempts`)}</div>`}};U([F({attribute:!1})],cf.prototype,`journal`,void 0),U([F({attribute:!1})],cf.prototype,`plan`,void 0),U([F({attribute:!1})],cf.prototype,`procs`,void 0),U([F({type:Boolean})],cf.prototype,`live`,void 0),U([F()],cf.prototype,`run`,void 0),cf=U([P(`ca-timeline`),O()],cf);var lf=class extends N{constructor(...e){super(...e),this.procs=null,this.live=!1}static{this.styles=[V,k` :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?fe(this.procs):[],t=Math.max(this.procs?.max_workers||1,e.length),n=Array.from({length:t-e.length},(e,t)=>t);return A`<div class="wks" style="--n:${Math.min(t,6)}">
|
|
516
|
+
${H(e,e=>e.id,e=>{let t=A`<span class="wk-top">${Pd(e.cls!==`llm`,e.cls===`llm`?D(`Agent task`):D(`Python task`),`wk-ic`)}<b>${e.kind}</b>
|
|
509
517
|
<cae-elapsed class="wk-el" .since=${Ir.at(e.id,e.ageS)}></cae-elapsed></span>
|
|
510
518
|
<span class="meta">${e.detail}</span>
|
|
511
|
-
<span class="wk-bar"><i></i></span>`;return e.key?
|
|
512
|
-
${n.map(()=>
|
|
513
|
-
</div>`}};U([
|
|
519
|
+
<span class="wk-bar"><i></i></span>`;return e.key?A`<button type="button" class="wk ${e.cls}" @click=${()=>$(this,`ca-open-task`,{key:e.key})}>${t}</button>`:A`<div class="wk ${e.cls}">${t}</div>`})}
|
|
520
|
+
${n.map(()=>A`<div class="wk idle"><div class="wk-top"><b>${D(`Idle`)}</b></div></div>`)}
|
|
521
|
+
</div>`}};U([F({attribute:!1})],lf.prototype,`procs`,void 0),U([F({type:Boolean})],lf.prototype,`live`,void 0),lf=U([P(`ca-workers`),O()],lf);var uf=[`invalid`,`refused`,`failed`,`running`,`pending`,`valid`];function df(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=me(t),n=e?df(e):``;if(n)return n}return``}function ff(e){if(e===void 0)return D(`Loading…`);let t=me(e);if(t)return df(t);if(typeof e!=`object`||!e)return JSON.stringify(e);let n=Object.keys(e);if(!n.length)return D(`none`,{id:`none`});let r=`${n.slice(0,4).join(`, `)}${n.length>4?`, …`:``}`;return D(Array.isArray(e)?E`${n.length} items: ${r}`:E`${n.length} keys: ${r}`)}var pf=class extends N{constructor(...e){super(...e),this.run=``,this.layer=``,this.unit=``,this.sel=``}static{this.styles=[V,k` :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){$(this,`ca-navigate`,{tab:e})}open(e){$(this,`ca-open-task`,{key:e.key,...w(e)?{view:`output`}:{}})}render(){let e=this.state,t=de(e,this.summary),n=t?fe(e.procs).length:0,r=e.procs?.max_workers||null,i=this.info.panels.filter(he),a=t&&n>0;return A`<div class="ov">
|
|
514
522
|
<div class="band status">
|
|
515
523
|
<div class="stack">
|
|
516
524
|
<section class="panel enter">
|
|
517
|
-
<h3>${
|
|
525
|
+
<h3>${D(`Run`)}</h3>
|
|
518
526
|
<ca-run-driver .procs=${e.procs} .summary=${this.summary} .plan=${e.plan} .host=${this.host}></ca-run-driver>
|
|
519
527
|
</section>
|
|
520
|
-
${t&&!a?this.runningCard(t,n,r):
|
|
528
|
+
${t&&!a?this.runningCard(t,n,r):M}
|
|
521
529
|
</div>
|
|
522
530
|
<section class="panel enter problems">
|
|
523
|
-
<h3>${
|
|
524
|
-
<span class="r"><a class="lnk" href="#" @click=${e=>this.nav(e,()
|
|
531
|
+
<h3>${D(`Problems`)}
|
|
532
|
+
<span class="r"><a class="lnk" href="#" @click=${e=>this.nav(e,()=>$(this,`ca-navigate`,{tab:`journal`,stop:`bad`}))}>${D(`Failed attempts in history`)}</a></span></h3>
|
|
525
533
|
${this.problems(t)}
|
|
526
534
|
</section>
|
|
527
535
|
<section class="panel enter outputs">
|
|
528
|
-
<h3 title=${
|
|
529
|
-
<span class="r"><a class="lnk" href="#" @click=${e=>this.nav(e,()=>this.go(`outputs`))}>${
|
|
536
|
+
<h3 title=${D(`Checked files (OutputContract, InputContract)`)}>${D(`Outputs`)}
|
|
537
|
+
<span class="r"><a class="lnk" href="#" @click=${e=>this.nav(e,()=>this.go(`outputs`))}>${D(`All outputs`)}</a></span></h3>
|
|
530
538
|
${this.outputs()}
|
|
531
539
|
</section>
|
|
532
|
-
${a?
|
|
540
|
+
${a?A`<div class="row">${this.runningCard(t,n,r)}</div>`:M}
|
|
533
541
|
</div>
|
|
534
542
|
<section class="panel enter">
|
|
535
|
-
<h3 title=${
|
|
543
|
+
<h3 title=${D(`Every task the run scheduled, by kind (plan.jsonl)`)}>${D(`Pipeline`)}
|
|
536
544
|
<span class="r">${this.progressLine(t)}</span></h3>
|
|
537
|
-
<ca-pipeline-graph .plan=${e.plan} .journal=${e.journal} .run=${this.run} .layer=${this.layer} .unit=${this.unit} .sel=${this.sel} ?live=${t}></ca-pipeline-graph>
|
|
545
|
+
<ca-pipeline-graph .plan=${e.plan} .forecast=${e.forecast} .journal=${e.journal} .run=${this.run} .layer=${this.layer} .unit=${this.unit} .sel=${this.sel} ?live=${t}></ca-pipeline-graph>
|
|
538
546
|
</section>
|
|
539
547
|
<section class="panel enter">
|
|
540
|
-
<h3 title=${
|
|
548
|
+
<h3 title=${D(`Counted from every finished attempt (journal.jsonl)`)}>${D(`Totals`)}</h3>
|
|
541
549
|
<ca-kpis .journal=${e.journal} .plan=${e.plan}></ca-kpis>
|
|
542
550
|
</section>
|
|
543
551
|
<div class="band parts">
|
|
544
|
-
${t?
|
|
545
|
-
<h3>${
|
|
546
|
-
<span class="r"><a class="lnk" href="#" @click=${e=>this.nav(e,()=>this.go(`procs`))}>${
|
|
552
|
+
${t?A`<section class="panel enter">
|
|
553
|
+
<h3>${D(`Process tree`)}
|
|
554
|
+
<span class="r"><a class="lnk" href="#" @click=${e=>this.nav(e,()=>this.go(`procs`))}>${D(`All processes`)}</a></span></h3>
|
|
547
555
|
<ca-proc-tree .procs=${e.procs}></ca-proc-tree>
|
|
548
|
-
</section>`:
|
|
549
|
-
${
|
|
550
|
-
<h3 title=${
|
|
556
|
+
</section>`:M}
|
|
557
|
+
${Ee(e.journal)?A`<section class="panel enter">
|
|
558
|
+
<h3 title=${D(`Reported by the coding agents`)}>${D(`Tokens and cost by kind`)}</h3>
|
|
551
559
|
<ca-spend-breakdown .journal=${e.journal}></ca-spend-breakdown>
|
|
552
|
-
</section>`:
|
|
553
|
-
${e.plan.models?.length?
|
|
554
|
-
<h3 title=${
|
|
555
|
-
<span class="r">${e.plan.models.length===1?
|
|
560
|
+
</section>`:M}
|
|
561
|
+
${e.plan.models?.length?A`<section class="panel enter">
|
|
562
|
+
<h3 title=${D(`What the agent sessions spent on each model, each model of a model switch counted separately (Plan.models)`)}>${D(`Models`)}
|
|
563
|
+
<span class="r">${e.plan.models.length===1?D(`1 model`):D(E`${e.plan.models.length} models`)}</span></h3>
|
|
556
564
|
<ca-model-usage .models=${e.plan.models}></ca-model-usage>
|
|
557
|
-
</section>`:
|
|
558
|
-
${
|
|
559
|
-
<h3 title=${
|
|
560
|
-
${
|
|
565
|
+
</section>`:M}
|
|
566
|
+
${Ie(e.journal).length||e.plan.rests?.length?A`<section class="panel enter">
|
|
567
|
+
<h3 title=${D(`Account-wide | read at each agent session start`)}>
|
|
568
|
+
${D(`Subscription usage`)}<span class="r">${D(`Per account, first → last reading`)}</span></h3>
|
|
561
569
|
<ca-quota .journal=${e.journal} .caps=${e.plan.quota_caps??[]} .rests=${e.plan.rests??[]} .rule=${e.plan.quota_rule??``} ?live=${t}></ca-quota>
|
|
562
|
-
</section>`:
|
|
563
|
-
${e.plan.services?.length?
|
|
564
|
-
<h3 title=${
|
|
570
|
+
</section>`:M}
|
|
571
|
+
${e.plan.services?.length?A`<section class="panel enter">
|
|
572
|
+
<h3 title=${D(`A long-lived helper that the tasks holding one lock share (services.jsonl)`)}>${D(`Services`)}</h3>
|
|
565
573
|
<ca-services .services=${e.plan.services} .nodes=${e.plan.nodes} ?live=${t}></ca-services>
|
|
566
|
-
</section>`:
|
|
567
|
-
${e.cursor?
|
|
568
|
-
<h3 title=${
|
|
574
|
+
</section>`:M}
|
|
575
|
+
${e.cursor?A`<section class="panel enter">
|
|
576
|
+
<h3 title=${D(`Stage and step per unit (CursorStore)`)}>${D(`Resume cursor`)}</h3>
|
|
569
577
|
${this.cursor()}
|
|
570
|
-
</section>`:
|
|
578
|
+
</section>`:M}
|
|
571
579
|
</div>
|
|
572
|
-
${i.length?
|
|
573
|
-
<h3 title=${
|
|
580
|
+
${i.length?A`<section class="panel enter views">
|
|
581
|
+
<h3 title=${D(`monitor.Panel`)}>${D(`Custom views`)}</h3>
|
|
574
582
|
${this.panelCards(i)}
|
|
575
|
-
</section>`:
|
|
583
|
+
</section>`:M}
|
|
576
584
|
<section class="panel enter">
|
|
577
|
-
<h3>${
|
|
585
|
+
<h3>${D(`Timeline`)}
|
|
578
586
|
<span class="r">${this.triesLine()}</span></h3>
|
|
579
587
|
<ca-timeline .journal=${e.journal} .plan=${e.plan} .procs=${e.procs} .live=${t} .run=${this.run}></ca-timeline>
|
|
580
588
|
</section>
|
|
581
|
-
</div>`}runningCard(e,t,n){return
|
|
582
|
-
<h3 title=${
|
|
583
|
-
${e?
|
|
584
|
-
${t?
|
|
585
|
-
</section>`}outputs(){let{contracts:e,tally:t}=this.state.outputs;if(!e.length)return
|
|
586
|
-
${n.length?n.map(e=>
|
|
589
|
+
</div>`}runningCard(e,t,n){return A`<section class="panel enter">
|
|
590
|
+
<h3 title=${D(`Limit: max_concurrent`)}>${D(`Running tasks`)}
|
|
591
|
+
${e?A`<span class="r">${D(n?E`${t} of ${n} running at once`:E`${t} running at once`)}</span>`:M}</h3>
|
|
592
|
+
${t?A`<ca-workers .procs=${this.state.procs} .live=${e}></ca-workers>`:A`<div class="meta">${D(`No tasks running`)}</div>`}
|
|
593
|
+
</section>`}outputs(){let{contracts:e,tally:t}=this.state.outputs;if(!e.length)return A`<div class="meta">${D(`No output files`)}</div>`;let n=uf.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 A`<div class="ct-row">
|
|
594
|
+
${n.length?n.map(e=>Ol(e,t[e])):A`<span class="meta">${D(`No checked files`)}</span>`}
|
|
587
595
|
</div>
|
|
588
|
-
${i.map(([e,t])=>
|
|
589
|
-
${Qr({text:t.status?
|
|
590
|
-
<b class="jmono" title=${e.key}>${
|
|
591
|
-
<span class="meta">${
|
|
592
|
-
<span class="meta" title=${
|
|
596
|
+
${i.map(([e,t])=>A`<button type="button" class="fl ofl" @click=${()=>this.go(`outputs`)}>
|
|
597
|
+
${Qr({text:t.status?Ys(t.status):`—`,tone:fs(t.status),title:t.status?Xs(t.status):null})}
|
|
598
|
+
<b class="jmono" title=${e.key}>${J({kind:e.kind,unit:e.unit===e.key?``:e.unit})}</b>
|
|
599
|
+
<span class="meta">${Nl(t)}</span>
|
|
600
|
+
<span class="meta" title=${T(t.errors?.[0]||t.path,this.run)}>${T(t.errors?.[0]||t.path,this.run)}</span>
|
|
593
601
|
</button>`)}
|
|
594
|
-
${r.length>i.length?
|
|
595
|
-
${a?
|
|
596
|
-
${n.length||e.stage?
|
|
602
|
+
${r.length>i.length?A`<div class="more"><a class="lnk" href="#" @click=${e=>this.nav(e,()=>this.go(`outputs`))}>${r.length-i.length===1?D(`1 more output`):D(E`${r.length-i.length} more outputs`)}</a></div>`:M}
|
|
603
|
+
${a?A`<div class="meta more">${D(a===1?`1 output not written (task not started)`:E`${a} outputs not written (tasks not started)`)}</div>`:M}`}progressLine(e){let t=this.state.plan,n=ee(t);if(e||n.left){let e=function(e){let t=e.groups.reduce((e,t)=>e+t.total,0),n=e.groups.reduce((e,t)=>e+t.done,0),r=e.groups.reduce((e,t)=>e+(t.partial??0),0),i=e.groups.reduce((e,t)=>e+t.skipped,0),a=e.groups.reduce((e,t)=>e+(t.cancelled??0),0);return{total:t,done:n,partial:r,skipped:i,cancelled:a,pct:Math.round(100*(n+r+i+a)/Math.max(1,t))}}(t);return K(D(E`${e.pct}%`),D(E`${e.done} of ${e.total} tasks done`),e.partial?Z(`partial`,e.partial):``,e.skipped?Z(`skipped`,e.skipped):``,e.cancelled?Z(`cancelled`,e.cancelled):``)}return K(Z(`done`,n.done),n.skipped?Z(`skipped`,n.skipped):``,n.failed?Z(`failed`,n.failed):``,n.notStarted?Z(`not_started`,n.notStarted):``,n.partial?Z(`partial`,n.partial):``,n.cancelled?Z(`cancelled`,n.cancelled):``)}triesLine(){let{tries:e,notStarted:t}=S(this.state.journal,this.state.plan).tries;return K(D(e===1?`1 attempt`:E`${e} attempts`),t?Z(`not_started`,t):``)}nav(e,t){e.preventDefault(),t()}cursor(){let e=this.state.cursor,t=Object.entries(e?.units??{});if(!e||!e.stage&&!t.length)return A`<div class="meta">${D(`No resume cursor`)}</div>`;let n=e.completed_stages??[];return A`<div class="chips" style="margin-bottom:10px">
|
|
604
|
+
${n.length||e.stage?A`${n.map(e=>A`<span class="chip" data-tone="done"><span aria-hidden="true">✓</span><span class="sr">${D(`done`,{id:`stage-done`})}</span> ${e}</span>`)}${e.stage?A`<span class="chip" data-tone="running"><span class="sr">${D(`current`)}</span>${e.stage}</span>`:M}`:A`<span class="meta">${D(`No stage`)}</span>`}
|
|
597
605
|
</div>
|
|
598
|
-
${t.length?
|
|
599
|
-
${t.map(([e,t])=>
|
|
606
|
+
${t.length?A`<div class="cur-units">
|
|
607
|
+
${t.map(([e,t])=>A`<div class="cu">
|
|
600
608
|
<span class="jmono">${e}</span>
|
|
601
|
-
<span class="meta">${K(t.step||`—`,t.loop_pass?E
|
|
602
|
-
<span class="cu-bar" title=${t.completed.length===1?
|
|
603
|
-
${t.inflight.length?Zr({text:
|
|
604
|
-
`)}):
|
|
609
|
+
<span class="meta">${K(t.step||`—`,t.loop_pass?D(E`pass ${t.loop_pass}`):``)}</span>
|
|
610
|
+
<span class="cu-bar" title=${t.completed.length===1?D(`1 step done`):D(E`${t.completed.length} steps done`)}><i style="width:${Math.min(100,12*(t.completed.length+1))}%"></i></span>
|
|
611
|
+
${t.inflight.length?Zr({text:D(`running`),tone:`running`,title:t.inflight.join(`
|
|
612
|
+
`)}):M}
|
|
605
613
|
</div>`)}
|
|
606
|
-
</div>`:
|
|
607
|
-
${H(e,e=>e.name,e=>{let t=
|
|
614
|
+
</div>`:M}`}panelCards(e){return A`<div class="pcards">
|
|
615
|
+
${H(e,e=>e.name,e=>{let t=ff(this.state.panels[e.name]);return A`<button type="button" class="pcard" @click=${()=>this.go(`panel:${e.name}`)}>
|
|
608
616
|
<span class="pc-ic" aria-hidden="true">${e.icon||`▤`}</span>
|
|
609
617
|
<div>
|
|
610
618
|
<b>${e.title||e.name}</b>
|
|
611
|
-
${e.description?
|
|
612
|
-
${t?
|
|
619
|
+
${e.description?A`<div class="meta">${e.description}</div>`:M}
|
|
620
|
+
${t?A`<div class="pc-peek">${t}</div>`:M}
|
|
613
621
|
</div>
|
|
614
|
-
<span class="pc-go">${
|
|
622
|
+
<span class="pc-go">${D(`Show view`)}</span>
|
|
615
623
|
</button>`})}
|
|
616
|
-
</div>`}nameButton(e){return
|
|
617
|
-
<span>${e.length===1?
|
|
618
|
-
${e.slice(0,4).map(e=>
|
|
619
|
-
${e.length>4?
|
|
620
|
-
</div>`:
|
|
621
|
-
${Qr({text:
|
|
624
|
+
</div>`}nameButton(e){return A`<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 J(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=A`<div class="ok"><span aria-hidden="true">✓</span>${D(`No problems`)}</div>`;if(!s&&!o.length)return c;let l=e=>T(e.attempts[e.attempts.length-1]?.reason||`—`,this.run),u=e=>e.length?A`<div class="stopped">
|
|
625
|
+
<span>${e.length===1?D(`1 later task not started`):D(E`${e.length} later tasks not started`)}</span>
|
|
626
|
+
${e.slice(0,4).map(e=>bl(this,this.name(e),e))}
|
|
627
|
+
${e.length>4?A`<span>${D(E`${e.length-4} more`)}</span>`:M}
|
|
628
|
+
</div>`:M,d=(e,t,n)=>e>t?A`<div class="more"><a class="lnk" href="#" @click=${e=>this.nav(e,()=>$(this,`ca-navigate`,{tab:`journal`,stop:n}))}>${D(e-t===1?`1 more in history`:E`${e-t} more in history`)}</a></div>`:M;return A`${s?M:c}${H(r.slice(0,5),e=>e.task.key,e=>{let t=e.task.attempts[e.task.attempts.length-1];return A`<div class="fl" @click=${t=>this.openRow(t,e.task)}>
|
|
629
|
+
${Qr({text:is(`failed`),tone:`failed`})}
|
|
622
630
|
${this.nameButton(e.task)}<span class="meta">${G(t?.ts,!0)}</span>
|
|
623
|
-
<div class="meta" title=${l(e.task)}>${
|
|
631
|
+
<div class="meta" title=${l(e.task)}>${Q(t?.stop)}: ${l(e.task)}</div>
|
|
624
632
|
${u(e.stopped)}
|
|
625
633
|
</div>`})}
|
|
626
634
|
${d(r.length,5,`bad`)}
|
|
627
|
-
${H(i.slice(0,5),e=>e.key,e=>
|
|
628
|
-
${Qr({text:
|
|
635
|
+
${H(i.slice(0,5),e=>e.key,e=>A`<div class="fl" @click=${t=>this.openRow(t,e)}>
|
|
636
|
+
${Qr({text:is(`not_started`),tone:`attention`})}
|
|
629
637
|
${this.nameButton(e)}<span></span>
|
|
630
|
-
${this.metaLine(
|
|
638
|
+
${this.metaLine(hs(e,t,this.run)?Zo(hs(e,t,this.run)):l(e))}
|
|
631
639
|
</div>`)}
|
|
632
640
|
${d(i.length,5,`invalid_input`)}
|
|
633
|
-
${H(a.slice(0,5),e=>e.key,e=>
|
|
634
|
-
${Qr({text:
|
|
641
|
+
${H(a.slice(0,5),e=>e.key,e=>A`<div class="fl" @click=${t=>this.openRow(t,e)}>
|
|
642
|
+
${Qr({text:is(`partial`),tone:ds(`partial`)})}
|
|
635
643
|
${this.nameButton(e)}<span></span>
|
|
636
644
|
${this.metaLine(l(e))}
|
|
637
645
|
</div>`)}
|
|
638
646
|
${d(a.length,5,`partial`)}
|
|
639
|
-
${o.length?
|
|
640
|
-
${H(o.slice(0,3),e=>e.key,e=>{let t=e.tries.filter(e=>!e.ok).length,n=e.tries.length;return
|
|
641
|
-
${Qr({text:
|
|
647
|
+
${o.length?A`<h4 class="sub">${Zo(is(`recovered`))} <span class="r">${o.length}</span></h4>`:M}
|
|
648
|
+
${H(o.slice(0,3),e=>e.key,e=>{let t=e.tries.filter(e=>!e.ok).length,n=e.tries.length;return A`<div class="fl muted" @click=${t=>this.openRow(t,e)}>
|
|
649
|
+
${Qr({text:is(`recovered`),tone:ds(`recovered`)})}
|
|
642
650
|
${this.nameButton(e)}<span></span>
|
|
643
|
-
<div class="meta">${
|
|
651
|
+
<div class="meta">${D(t===1?E`Done on attempt ${n} | 1 failed attempt`:E`Done on attempt ${n} | ${t} failed attempts`)}</div>
|
|
644
652
|
</div>`})}
|
|
645
653
|
${d(o.length,3,`retried`)}
|
|
646
|
-
${this.nextStep(e,s)}`}metaLine(e){return
|
|
647
|
-
${
|
|
648
|
-
${e.unit?
|
|
649
|
-
${e.claims?.length?
|
|
650
|
-
${e.priority?
|
|
651
|
-
</span>`;var i}},{id:`attempts`,header:
|
|
652
|
-
`):``}(t.deferredCause)||t.deferred:``;return
|
|
653
|
-
${
|
|
654
|
-
`)||
|
|
655
|
-
`)||
|
|
656
|
-
`):``)||
|
|
657
|
-
`)}>${p}</span>`:
|
|
658
|
-
`)} >${
|
|
659
|
-
${
|
|
660
|
-
${t?i(`fixup`,
|
|
661
|
-
${n?i(`retried`,
|
|
662
|
-
${r?i(`replayed`,
|
|
654
|
+
${this.nextStep(e,s)}`}metaLine(e){return A`<div class="meta" title=${e}>${e}</div>`}nextStep(e,t){if(e||!t)return M;let n=S(this.state.journal,this.state.plan).counts,r=n.total-n.finished+n.partial;return r?A`<div class="next" title="resume=True">${D(E`${r} of ${n.total} tasks not done`)}</div>`:M}};function mf(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([F({attribute:!1})],pf.prototype,`state`,void 0),U([F({attribute:!1})],pf.prototype,`summary`,void 0),U([F({attribute:!1})],pf.prototype,`host`,void 0),U([F({attribute:!1})],pf.prototype,`info`,void 0),U([F()],pf.prototype,`run`,void 0),U([F()],pf.prototype,`layer`,void 0),U([F()],pf.prototype,`unit`,void 0),U([F()],pf.prototype,`sel`,void 0),pf=U([P(`ca-overview`),O()],pf),z(`cae-data-table`,ha);var hf={failed:0,not_started:1,partial:2,running:3,waiting:4};function gf(e){return e.map((e,t)=>({t:e,i:t})).sort((e,t)=>(hf[e.t.outcome]??9)-(hf[t.t.outcome]??9)||t.t.last_ts.localeCompare(e.t.last_ts)||e.i-t.i).map(e=>e.t)}var _f=[`key`,`unit`,`stop`,`kind`,`route`,`reason`],vf=e=>new Set(m(e).map(e=>e.key)),yf=e=>(e.rounds??1)>1;function bf(e,t,n,r){let i=r.toLowerCase(),a=n===`retried`?vf(e):null;return e.filter(e=>!(n===`bad`&&!se(e))&&!(n===`fixup`&&!yf(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||_f.some(t=>String(e[t]??``).toLowerCase().includes(i))))}function xf(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 Sf(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 Cf=()=>D(`none`,{id:`none`});function wf(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)Te(r.get(t.key)??r.set(t.key,Ce()).get(t.key),t);let i=e=>e.tries.length>0,a=(e,t)=>{if(!i(e))return A`<span class="jdim">${Cf()}</span>`;let n=r.get(e.key);return n?.reported?t(n):A`<span class="jdim">—</span>`};return[{id:`task`,header:D(`Task`),tip:D(`Kind · unit`),width:`minmax(220px, 0.6fr)`,rowHeader:!0,text:e=>e.key,cell:e=>{let n=w(e),r=e.pass!==null&&(t.get(`${e.kind}|${e.unit}`)??0)>1?e.pass:null;return A`<span class="grow jmono" title=${e.key}>
|
|
655
|
+
${Pd(n,D(n?`Python task`:`Agent task`))}${e.kind}
|
|
656
|
+
${e.unit?A`<span class="jdim">· ${e.unit}</span>`:M}${r===null?M:A`<span class="pass">${bs(r)}</span>`}
|
|
657
|
+
${e.claims?.length?A`<span class="jdim also" title=${i=e.claims,K(pc(),q(i))}>${(e=>e.length>2?D(E`Locks ${e.length} names`):D(E`Locks ${q(e)}`))(e.claims)}</span>`:M}
|
|
658
|
+
${e.priority?A`<span class="jdim also" title=${Bc()}>${zc(e.priority)}</span>`:M}
|
|
659
|
+
</span>`;var i}},{id:`attempts`,header:D(`Attempts`),tip:D(`Attempts that ran`),align:`end`,width:`64px`,cell:e=>e.tries.length},{id:`time`,header:D(`Time`),tip:D(`Summed over all attempts`),align:`end`,width:`132px`,cell:e=>A`<span class="wall">${i(e)?A`${B(e.wall_s)}<span class="jdur"><i class=${w(e)?``:`llm`} style="width:${Math.max(4,Math.round(100*e.wall_s/n))}%"></i></span>`:A`<span class="jdim">${Cf()}</span><span class="jdur" style="visibility:hidden"></span>`}</span>`},{id:`tokens`,header:D(`Tokens`),tip:D(`Input and output, summed over all attempts`),align:`end`,width:`72px`,cell:e=>a(e,e=>A`<span title=${K(D(E`Cache read ${Y(e.cache_read)}`),D(E`Cache write ${Y(e.cache_creation)}`))}>${Y(e.input+e.output)}</span>`)},{id:`cost`,header:D(`Cost`),tip:D(`Reported by the coding agent`),align:`end`,width:`72px`,cell:e=>a(e,e=>X(e.cost))},{id:`ended`,header:D(`Last attempt ended`),align:`end`,width:`128px`,cell:e=>A`<span class="meta">${i(e)?G(e.tries[e.tries.length-1]?.ts,!0):Cf()}</span>`},{id:`status`,header:D(`Status`,{id:`status`}),width:`minmax(240px, 1fr)`,cell:t=>{let n=function(e,t){return e.outcome===`not_started`?hs(e,t.outcomes,t.run):e.outcome===`partial`?T(e.attempts[e.attempts.length-1]?.reason??``,t.run):e.outcome===`waiting`&&e.deferred?Us(e.deferredCause,e.deferred,e.deferredIn):e.outcome===`waiting`?function(e){let t=e[0];return t?e.length===1?D(E`waits for output of ${J(t)}`):D(E`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`?Hs(e.rests??[]):[];return t.length>1?t.map(Vs).join(`
|
|
660
|
+
`):``}(t.deferredCause)||t.deferred:``;return A`${Zr({text:as(t.outcome,e.live&&!t.deferred),tone:ds(t.outcome),mark:ps(t.outcome),title:t.last_stop})}${n?A`<span class="cause" title=${r||M}>${n}</span>`:M}`}}]}var Tf=[Kr,Fd,k` 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;}}`],Ef=class extends N{constructor(...e){super(...e),this.journal=[],this.plan=null,this.kind=``,this.q=``,this.live=!1,this.run=``}static{this.styles=[V,k`:host{display:block;margin-top:4px;}`]}open(e,t){let n=e.find(e=>e.key===t);n&&$(this,`ca-open-task`,w(n)?{key:t,view:`output`}:{key:t})}render(){let e=this.plan?S(this.journal,this.plan):null,t=e?.rows??[],n=gf(mf(t,this.kind,this.q));return n.length?A`<cae-data-table .columns=${wf({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":w(e)?`python`:`agent`})} .cellStyles=${Tf} .caption=${D(`Tasks`,{id:`tab-tasks`})} .strings=${fc(D(`No tasks`))} @cae-activate=${e=>this.open(n,e.detail.id)} ></cae-data-table>`:A`<div class="blank"><span class="ic" aria-hidden="true">≡</span>${t.length?D(`No tasks match the filter`):D(`No tasks`)}</div>`}};function Df(e){return e===`invalid_input`?is(`not_started`):Q(e)}function Of(e){let t=Math.max(1,...e.rows.map(e=>e.wall_s||0)),n=Sf(e.journal),r=new Map(e.journal.map((e,t)=>[e,t]));return[{id:`ended`,header:D(`Ended`),width:`64px`,cell:e=>A`<span class="jmono" title=${G(e.ts,!0)}>${G(e.ts)}</span>`},{id:`task`,header:D(`Task`),width:`minmax(130px,0.8fr)`,rowHeader:!0,text:e=>e.key,cell:e=>{let t=w(e);return A`<span class="jmono" title=${e.key}>${Pd(t,D(t?`Python task`:`Agent task`),``)}
|
|
661
|
+
${J(e)}</span>`}},{id:`outcome`,header:D(`Outcome`),tip:D(`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?ys((t.rounds??1)-1):``,o=e.replayMarks&&t.replayed?rc():``;return Qr({text:A`<span class="nw">${Df(t.stop)}</span>${i||a||o?A`<span class="sub" title=${o?ic():M}>${K(i?_s(t.attempt):``,a,o)}</span>`:M}`,tone:us(t.stop),cls:`two`,title:t.stop})}},{id:`agent`,header:D(`Agent, model, identity`),width:`minmax(150px,1fr)`,cell:e=>A`<span class="jmono jdim two" title=${K(e.route,Js(e.hops,null,e.skipped_hops))||M}>${f(e)?A`<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 M;let n=(e.quota??[])[0],r=n?D(E`Usage at session start (account-wide): ${Ns(n)}`):``,i=n&&t.length===1&&(n.credential??``)===t[0],a=n?i?js(n):Ns(n):``;return A`<span class="sub" title=${[r,...t.map(Es)].filter(Boolean).join(`
|
|
662
|
+
`)||M}>${t.map(e=>Ts(e)).join(` → `)}${n?A` <span class="q">${a}</span>`:M}</span>`}(e)}`:`—`}</span>`},{id:`tokens`,header:D(`Tokens`),tip:D(`Input / output | cache read / cache write`),align:`end`,width:`92px`,cell:e=>{let t=e.usage;return A`<span class="two" title=${[t?.resident==null?``:D(E`Input of the first API call: ${Y(t.resident)}`),Uc(e)].filter(Boolean).join(`
|
|
663
|
+
`)||M}>${t?A`<span>${Y(t.input)} / ${Y(t.output)}</span><span class="sub">${Y(t.cache_read)} / ${Y(t.cache_creation)}</span>`:A`<span class="jdim">—</span>`}</span>`}},{id:`cost`,header:D(`Cost`),tip:D(`Reported by the coding agent`),align:`end`,width:`60px`,cell:e=>{let t=e.hops??[];return A`<span class="cost" title=${(t.length>1?t.map(e=>K(e.model||e.route||`—`,Ts(e.credential)||`—`,X(e.cost_usd),Q(e.stop))).join(`
|
|
664
|
+
`):``)||D(`Reported by the coding agent`)}>${X(e.cost_usd)}</span>`}},{id:`time`,header:D(`Time`),align:`end`,width:`76px`,cell:e=>{let n=w(e);return f(e)?A`${B(e.wall_s)}<span class="jdur"><i class=${se(e)?`bad`:n?``:`llm`} style="width:${Math.max(2,Math.round(100*(e.wall_s||0)/t))}%"></i></span>`:`—`}},{id:`reason`,header:D(`Reason`),width:`minmax(200px,2.2fr)`,cell:t=>{let i=rs([t]),a=ns(ts([t])),o=t.safety_stops??[];return A`<span class="jwhy" title=${t.reason||M}>${(t=>{let i=f(t),a=Js(t.hops,null,t.skipped_hops),o=e.run||t.run_id||``,s=e.outcomes.get(t.key),c=t.stop===`invalid_input`&&s?hs({attempts:[t],cause:null},e.outcomes,o):``,l=c?Zo(c):t.ok&&i&&t.stop!==`partial`||!t.reason?``:T(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?D(E`Task done on attempt ${u}`):``,p=t.context_warned?Wc(t):``;return a||l||d||p?A`${a?A`<span class="nw" title=${D(`Model switch`)}>${a}</span><br />`:M}${l?A`${l}<br />`:M}${d?A`<span class="later">${d}</span>${p?A`<br />`:M}`:M}${p?A`<span class="tone-text" data-tone="attention" title=${[Gc(),Uc(t)].filter(Boolean).join(`
|
|
665
|
+
`)}>${p}</span>`:M}`:A`<span class="jdim">—</span>`})(t)}${o.length?A` <span class="tone-text nw" data-tone="attention" title=${[el(),...o.map(nl)].join(`
|
|
666
|
+
`)} >${$c(o.length)}</span >`:M}${i?A` <span class="unread nw" title=${D(E`Event types this contraagent version does not know (unread_events): ${i}`)} ><span aria-hidden="true">⚠</span> ${D(`Unrecognized events`)}</span >`:M}${a?A` <span class="unread nw" title=${a.tip}><span aria-hidden="true">⚠</span> ${a.label}</span>`:M}</span>`}},...(e.extras??[]).map(e=>({id:`x:${e}`,header:e,tip:gc(),width:`minmax(80px,0.6fr)`,text:t=>_c(t[e]),cell:t=>{let n=_c(t[e]);return n===`—`?A`<span class="jdim">—</span>`:A`<span class="jmono" title=${n}>${n}</span>`}}))]}U([F({attribute:!1})],Ef.prototype,`journal`,void 0),U([F({attribute:!1})],Ef.prototype,`plan`,void 0),U([F()],Ef.prototype,`kind`,void 0),U([F()],Ef.prototype,`q`,void 0),U([F({type:Boolean})],Ef.prototype,`live`,void 0),U([F()],Ef.prototype,`run`,void 0),Ef=U([P(`ca-task-table`),O()],Ef);var kf=[Kr,Fd,k` 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);}`],Af=class extends N{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,k` :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=>le(e)===t);n&&$(this,`ca-open-task`,w(n)?{key:n.key,view:`output`}:{key:n.key})}render(){let e=bf(this.rows,this.kind,this.stop,this.q).reverse(),t=this.rows.filter(yf).length,n=vf(this.rows).size,r=this.replayMarks?this.rows.filter(e=>e.replayed).length:0,i=(e,t,n,r,i=`neutral`)=>A`<button type="button" class="jchip ${this.stop===e?`on`:``}" data-tone=${L(i)} data-mark=${Yr(i)??M} aria-pressed=${this.stop===e} title=${r} @click=${()=>$(this,`ca-filter`,{stop:this.stop===e?``:e})}>${t} <b>${n}</b></button>`,a=Of({run:this.run,outcomes:S(this.rows,this.plan).outcomes,journal:this.rows,rows:e,extras:this.extras,replayMarks:this.replayMarks});return A`<div class="jtally">
|
|
667
|
+
${xf(this.rows).map(([e,t])=>i(e,Df(e),t,e,us(e)))}
|
|
668
|
+
${t?i(`fixup`,D(`attempts with corrections`),t,Zs()):M}
|
|
669
|
+
${n?i(`retried`,D(`tasks retried`),n,gs()):M}
|
|
670
|
+
${r?i(`replayed`,D(`attempts replayed`),r,ic()):M}
|
|
663
671
|
</div>
|
|
664
|
-
<cae-data-table .columns=${a} .rows=${e} .rowKey=${
|
|
665
|
-
<span>${
|
|
672
|
+
<cae-data-table .columns=${a} .rows=${e} .rowKey=${le} .rowTone=${e=>f(e)&&se(e)?`failed`:void 0} .rowAttrs=${e=>({"data-executor":w(e)?`python`:`agent`,...f(e)?{}:{"data-ran":`false`},...this.fresh.has(le(e))?{"data-fresh":``}:{}})} .cellStyles=${kf} .caption=${D(`History`)} .strings=${fc(D(`No finished attempts`))} @cae-activate=${t=>this.open(e,t.detail.id)} ></cae-data-table>`}};U([F({attribute:!1})],Af.prototype,`rows`,void 0),U([F({attribute:!1})],Af.prototype,`plan`,void 0),U([F({attribute:!1})],Af.prototype,`fresh`,void 0),U([F()],Af.prototype,`kind`,void 0),U([F()],Af.prototype,`stop`,void 0),U([F()],Af.prototype,`q`,void 0),U([F()],Af.prototype,`run`,void 0),U([F({attribute:!1})],Af.prototype,`extras`,void 0),U([F({type:Boolean,attribute:`replay-marks`})],Af.prototype,`replayMarks`,void 0),Af=U([P(`ca-journal-table`),O()],Af);var jf=[`invalid`,`refused`,`failed`,`running`,`pending`,`valid`];function Mf(e){let t=e?.tally,n=t?jf.filter(e=>t[e]):[];return n.length?n.map(e=>Ol(e,t?.[e])):A`<span class="meta">${D(`No checked files`)}</span>`}var Nf=e=>e.split(`/`).slice(-2).join(`/`),Pf=e=>J({kind:e.kind||e.key,unit:e.unit&&e.unit!==e.key?e.unit:``}),Ff=e=>e?jf.indexOf(e):jf.length,If=class extends N{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:Pf(t),written:!!n.file.exists,outcome:this.outcomes.get(t.key)?.outcome}}}}static{this.styles=[V,Il,Fd,k` :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 A`<div class="blank"><span class="ic" aria-hidden="true">▣</span><b>${D(`No checked files`)}</b>
|
|
673
|
+
<span>${D(`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])=>Ff(t.status)-Ff(r.status)||e.key.localeCompare(n.key)),n=e.flatMap(e=>(e.inputs??[]).map(t=>[e,t]));return A`<div class="g12">
|
|
666
674
|
<section class="panel c12">
|
|
667
|
-
<h3 title=${
|
|
668
|
-
<span class="r">${
|
|
669
|
-
<div class="ct-row">${
|
|
675
|
+
<h3 title=${D(`OutputContract`)}>${D(`Outputs`)}
|
|
676
|
+
<span class="r">${D(`Files each task must write`)}</span></h3>
|
|
677
|
+
<div class="ct-row">${Mf(this.outputs)}</div>
|
|
670
678
|
${H(t,([e,t])=>`out|${e.key}|${t.path}`,([e,t])=>this.outRow(e,t))}
|
|
671
679
|
</section>
|
|
672
|
-
${n.length?
|
|
673
|
-
<h3 title=${
|
|
674
|
-
<span class="r">${
|
|
680
|
+
${n.length?A`<section class="panel c12">
|
|
681
|
+
<h3 title=${D(`InputContract`)}>${D(`Inputs`)}
|
|
682
|
+
<span class="r">${D(`Files each task reads`)}</span></h3>
|
|
675
683
|
${H(n,([e,t])=>`in|${e.key}|${t.path}`,([e,t])=>this.inRow(e,t))}
|
|
676
|
-
</section>`:
|
|
677
|
-
</div>`}details(e,t,n){return
|
|
684
|
+
</section>`:M}
|
|
685
|
+
</div>`}details(e,t,n){return A`<details class="ct" ?open=${this.open.has(e)} @toggle=${t=>this.open.set(e,t.target.open)}>
|
|
678
686
|
<summary class="ct-sum">${t}</summary>
|
|
679
687
|
<div class="ct-body">${n}</div>
|
|
680
|
-
</details>`}link(e,t,n){return
|
|
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?
|
|
688
|
+
</details>`}link(e,t,n){return A`<a class="lnk" href="#" @click=${n=>{n.preventDefault(),$(this,`ca-open-task`,{key:e,view:t})}}>${n}</a>`}who(e){let t=w(e);return A`${Pd(t,D(t?`Python task`:`Agent task`))}
|
|
689
|
+
<b class="jmono" title=${e.key}>${Pf(e)}</b>`}reasonOf(e){for(let t=this.journal.length-1;t>=0;t--){let n=this.journal[t];if(n?.key===e)return T(n.reason,this.run)}return``}outRow(e,t){if(t.status===`refused`)return A`<div class="one">
|
|
690
|
+
${Ol(`refused`)}${this.who(e)}
|
|
691
|
+
<span class="why">${$s(t,this.run,this.producerOf)}</span>
|
|
692
|
+
</div>`;let n=t.file,r=t.status,i=t.rounds??0,a=t.errors??[],o=Pf(e);return this.details(`out|${e.key}|${t.path}`,A`${Ol(r)}
|
|
693
|
+
${i>1?A`<span class="meta" title=${Zs()}>${Qs(i,r===`valid`)}</span>`:M}
|
|
686
694
|
${this.who(e)}
|
|
687
|
-
<span class="jmono jdim ct-path" title=${t.path}>${
|
|
688
|
-
${r===`failed`&&this.reasonOf(e.key)?
|
|
689
|
-
<span class="meta ct-f">${n.exists?`${n.size??0} B`:r?
|
|
690
|
-
${
|
|
691
|
-
${a.length?
|
|
692
|
-
`)}</pre>`:
|
|
695
|
+
<span class="jmono jdim ct-path" title=${t.path}>${Nf(t.path)}</span>
|
|
696
|
+
${r===`failed`&&this.reasonOf(e.key)?A`<span class="why">${this.reasonOf(e.key)}</span>`:M}
|
|
697
|
+
<span class="meta ct-f">${n.exists?`${n.size??0} B`:r?M:D(`No file`)}</span>`,A`${Pl(t,`output`)}
|
|
698
|
+
${Al(t)}
|
|
699
|
+
${a.length?A`<h4>${D(`Errors`)}</h4><pre class="ct-err">${a.map(e=>T(e,this.run)).join(`
|
|
700
|
+
`)}</pre>`:M}
|
|
693
701
|
<div class="ct-links">
|
|
694
|
-
${this.link(e.key,`output`,E
|
|
695
|
-
${
|
|
696
|
-
</div>`)}inRow(e,t){let n=t.file,r=!!n.exists;return this.details(`in|${e.key}|${t.path}`,
|
|
702
|
+
${this.link(e.key,`output`,D(E`${o}: input and output`))}
|
|
703
|
+
${w(e)?M:A`<br />${this.link(e.key,`transcript`,D(E`${o}: transcript`))}`}
|
|
704
|
+
</div>`)}inRow(e,t){let n=t.file,r=!!n.exists;return this.details(`in|${e.key}|${t.path}`,A`${Dl(t)}
|
|
697
705
|
${this.who(e)}
|
|
698
|
-
<span class="jmono jdim ct-path" title=${t.path}>${
|
|
699
|
-
<span class="meta ct-f">${r?`${n.size??0} B`:
|
|
700
|
-
${
|
|
701
|
-
<div class="ct-links">${this.link(e.key,`input`,E
|
|
702
|
-
${o.length?
|
|
703
|
-
${o.map(e=>
|
|
706
|
+
<span class="jmono jdim ct-path" title=${t.path}>${Nf(t.path)}</span>
|
|
707
|
+
<span class="meta ct-f">${r?`${n.size??0} B`:D(`No file`)}</span>`,A`${Pl(t,`input`)}
|
|
708
|
+
${Al(t)}
|
|
709
|
+
<div class="ct-links">${this.link(e.key,`input`,D(E`${Pf(e)}: input`))}</div>`)}};U([F({attribute:!1})],If.prototype,`outputs`,void 0),U([F()],If.prototype,`run`,void 0),U([F({attribute:!1})],If.prototype,`journal`,void 0),U([F({attribute:!1})],If.prototype,`plan`,void 0),If=U([P(`ca-contracts`),O()],If);var Lf=e=>e.replace(/\$\{?([A-Za-z_]\w*)\}?/g,`<span class="pv">$&</span>`).replace(/\{\{contract\}\}/g,`<span class="pv pc">{{contract}}</span>`);function Rf(e){let t=e.match(/^(TELEMETRY [^\n]*)\n+([\s\S]*)$/);return t?{head:t[1]??``,body:t[2]??``}:{head:``,body:e}}var zf=new Set([`instructions`,`schema`,`agent`]),Bf=class extends N{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,Fl,k` :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 A`<div class="blank"><span class="ic" aria-hidden="true">⌘</span><b>${D(`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||``,D(`from the final message`)):e.output||``,r=e.preserve??[],i=[...e.base_kind?[[D(`Implementation of`),A`<span class="jmono" title=${D(`A kind that other kinds implement (base_kind)`)}>${e.base_kind}</span>`]]:[],[D(`Role`),e.role||D(`none`,{id:`none`})],[t.length>1?D(`Plugin directories`):D(`Plugin directory`),t.length?A`${t.map((e,t)=>A`${t?`, `:``}<span class="jmono" title=${e}>${(e=>{let t=e.split(`/`).filter(Boolean);return t.length>2?`…/${t.slice(-2).join(`/`)}`:e})(e)}</span>`)}`:D(`none`,{id:`none`})],[D(`Parameters`),e.params||D(`none`,{id:`none`})],[D(`Output`,{id:`definition-output`}),e.output_of?A`<span title=${D(`The kind whose output file this task writes (output_of)`)}>${K(n,(a=e.output_of,D(E`output of ${a}`)))}</span>`:n||D(`none`,{id:`none`})],...r.length?[[Xc(),A`<span class="jmono" title=${Zc()}>${r.join(`, `)}</span>`]]:[],...(e.validators||[]).length?[[D(`Other checks`),(e.validators||[]).join(`, `)]]:[],...Array.isArray(e.tools)&&e.tools.length===0?[[D(`Tools`),D(`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 A`<div class="drv-facts" style="margin-bottom:10px">${i.map(([e,t])=>A`<span><i>${e}</i>${t}</span>`)}</div>
|
|
710
|
+
${o.length?A`<h4 class="sect-h">${D(`Checked files`)}</h4>
|
|
711
|
+
${o.map(e=>A`<div class="ct-in">
|
|
704
712
|
<span class="ct-chip">${e.io}</span><span class="jmono">${e.path}</span>
|
|
705
|
-
<span class="meta" title=${
|
|
706
|
-
</div>`)}`:
|
|
707
|
-
${c.length?
|
|
708
|
-
`).length:0,i=e.retry_on??[],a=[[
|
|
713
|
+
<span class="meta" title=${D(`The schema the file is checked against`)}>${D(E`Schema ${e.schema}`)}</span>
|
|
714
|
+
</div>`)}`:M}
|
|
715
|
+
${c.length?A`<h4 class="sect-h">${D(`Files`)}</h4>${c.map(t=>this.file(t,s(t),!!e.role))}`:A`<div class="meta">${D(A`No files | defined in Python code (<code>TaskAdapter</code>)`)}</div>`}`}python(e){let t=(e.files||[]).find(e=>e.part===`source`),n=e.line??1,r=t?t.text.replace(/\n$/,``).split(`
|
|
716
|
+
`).length:0,i=e.retry_on??[],a=[[D(`Parameters`),e.params&&e.params!==`none`?e.params:D(`none`,{id:`none`})],[D(`Output`,{id:`definition-output`}),e.output&&e.output!==`none`?e.output:D(`none`,{id:`none`})],...(e.validators||[]).length?[[D(`Other checks`),(e.validators||[]).join(`, `)]]:[],...e.retries?[[D(`Retries`),A`<span title=${gs()}>${o=e.retries,D(E`up to ${o}`)}</span>`]]:[],...e.retries&&i.length?[[D(`Retried exceptions`),A`<span class="jmono" title=${D(`Exceptions that give another attempt (retry_on)`)}>${i.join(`, `)}</span>`]]:[]];var o;return A`${e.signature?A`<div class="py-sig hl">${qi(Gi(`def ${e.signature}`,`python`))}</div>`:M}
|
|
709
717
|
<div class="py-where">
|
|
710
|
-
${e.function??e.kind}${e.file?
|
|
718
|
+
${e.function??e.kind}${e.file?A` | <span title=${e.file}>${e.file.replace(/^.*\//,``)}${e.line?`:${e.line}`:``}</span>`:M}
|
|
711
719
|
</div>
|
|
712
|
-
${e.doc?
|
|
713
|
-
<div class="drv-facts" style="margin-bottom:12px">${a.map(([e,t])=>
|
|
714
|
-
${t?
|
|
720
|
+
${e.doc?A`<div class="py-doc">${e.doc}</div>`:M}
|
|
721
|
+
<div class="drv-facts" style="margin-bottom:12px">${a.map(([e,t])=>A`<span><i>${e}</i>${t}</span>`)}</div>
|
|
722
|
+
${t?A`<h4 class="sect-h">${D(`Source`)}</h4>
|
|
715
723
|
<div class="src">
|
|
716
724
|
<pre class="ln">${Array.from({length:r},(e,t)=>n+t).join(`
|
|
717
725
|
`)}</pre>
|
|
718
726
|
<pre class="hl">${qi(Gi(t.text.replace(/\n$/,``),`python`))}</pre>
|
|
719
|
-
</div>`:
|
|
727
|
+
</div>`:M}`}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:zf.has(e.part),c=this.open.has(r)||s&&!this.open.has(`closed:${r}`);return A`<div class="df">
|
|
720
728
|
<div class="df-hd">
|
|
721
729
|
<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
730
|
<span class="tag">${e.part}</span><span class="jmono">${e.path}</span>
|
|
723
|
-
${t?
|
|
731
|
+
${t?A`<span class="ct-chip">${D(`Role of this kind`)}</span>`:M}
|
|
724
732
|
</button>
|
|
725
|
-
${i?
|
|
733
|
+
${i?A`<button type="button" class="df-tog" @click=${()=>{this.source.set(r,!this.source.has(r)),this.requestUpdate()}}>${D(o?`Show rendered`:`Show source`)}</button>`:M}
|
|
726
734
|
</div>
|
|
727
|
-
${c?o?
|
|
728
|
-
</div>`;var l}};U([
|
|
735
|
+
${c?o?A`<pre class="df-text"><code class="hl">${qi(a?(l=e.text,Lf(jr(l))):Gi(e.text,e.path))}</code></pre>`:qi($i(e.text,a?Lf:void 0)):M}
|
|
736
|
+
</div>`;var l}};U([F({attribute:!1})],Bf.prototype,`definition`,void 0),U([F()],Bf.prototype,`memory`,void 0),Bf=U([P(`ca-definition`),O()],Bf);var Vf=class extends N{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,k` :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=>!w(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=>w(e)).map(e=>e.kind))].filter(t=>!e.some(e=>e.kind===t));if(!e.length&&!n.length)return A`<div class="blank"><span class="ic" aria-hidden="true">⌘</span><b>${this.live?D(`No definitions yet`):D(`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(D(r===1?`1 task`:E`${r} tasks`),D(i===1?`1 attempt`:E`${i} attempts`))};return A`<div class="defs">
|
|
729
737
|
<div class="deflist">
|
|
730
|
-
${H(e,e=>e.kind,e=>{return
|
|
738
|
+
${H(e,e=>e.kind,e=>{return A`<button type="button" class="defitem ${e.kind===a?`sel`:``}" aria-current=${e.kind===a?`true`:M} @click=${()=>$(this,`ca-navigate`,{def:e.kind})}>
|
|
731
739
|
<b class="jmono">${e.kind}</b>
|
|
732
|
-
<span class="meta words">${di([...e.base_kind?[(t=e.base_kind,E
|
|
740
|
+
<span class="meta words">${di([...e.base_kind?[(t=e.base_kind,D(E`Implementation of ${t}`))]:[],e.executor===`python`?`Python`:e.role?D(E`Role ${e.role}`):D(`No role`),...o(e.kind)])}</span>
|
|
733
741
|
</button>`;var t})}
|
|
734
|
-
${H(n,e=>e,e=>
|
|
742
|
+
${H(n,e=>e,e=>A`<button type="button" class="defitem ${e===a?`sel`:``}" aria-current=${e===a?`true`:M} @click=${()=>$(this,`ca-navigate`,{def:e})}>
|
|
735
743
|
<b class="jmono">${e}</b>
|
|
736
744
|
<span class="meta words">${di([`Python`,...o(e)])}</span>
|
|
737
745
|
</button>`)}
|
|
738
746
|
</div>
|
|
739
747
|
<section class="panel">
|
|
740
|
-
${i?
|
|
741
|
-
${i.kind}<span class="r">${i.executor===`python`?
|
|
748
|
+
${i?A`<h3 title=${D(`As recorded when its first task started (definitions/<kind>.json)`)}>
|
|
749
|
+
${i.kind}<span class="r">${i.executor===`python`?D(`Python task`):i.plugin?D(E`Plugin ${i.name||``}`):D(`Defined in Python code`)}</span>
|
|
742
750
|
</h3>
|
|
743
|
-
<ca-definition .definition=${i} memory="definition:${i.kind}"></ca-definition>`:
|
|
751
|
+
<ca-definition .definition=${i} memory="definition:${i.kind}"></ca-definition>`:A`<h3>${a}<span class="r">${D(`Python task`)}</span></h3>
|
|
744
752
|
<ca-definition .definition=${null}></ca-definition>`}
|
|
745
753
|
</section>
|
|
746
|
-
</div>`}};U([
|
|
754
|
+
</div>`}};U([F({attribute:!1})],Vf.prototype,`client`,void 0),U([F()],Vf.prototype,`run`,void 0),U([F({type:Boolean})],Vf.prototype,`live`,void 0),U([F({attribute:!1})],Vf.prototype,`journal`,void 0),U([F({attribute:!1})],Vf.prototype,`plan`,void 0),U([F({attribute:!1})],Vf.prototype,`selected`,void 0),U([I()],Vf.prototype,`defs`,void 0),Vf=U([P(`ca-definitions`),O()],Vf);var Hf=class extends N{constructor(...e){super(...e),this.procs=null,this.unresponsive=!1,this.exported=!1}static{this.styles=[V,k` :host{display:block;}.cmd{word-break:break-all;}`]}open(e){$(this,`ca-open-task`,{key:e})}render(){let e=this.procs;if(!e?.alive){let e=this.exported?kc():this.unresponsive?oc():D(`not running`);return A`<div class="blank"><span class="ic" aria-hidden="true">⚙</span><b>${K(D(`No processes`),e)}</b></div>`}let t=e.python_tasks;return A`<div class="g12">
|
|
747
755
|
<section class="panel c12">
|
|
748
|
-
<h3 title=${
|
|
749
|
-
${e.launches.length?H(e.launches,e=>e.key,e=>
|
|
750
|
-
<button type="button" class="fl-name jmono" @click=${()=>this.open(e.key)}>${
|
|
751
|
-
<span class="meta">${K(E
|
|
756
|
+
<h3 title=${D(`One per task (Backend.run)`)}>${D(`Agent sessions running`)} <span class="r">${e.launches.length}</span></h3>
|
|
757
|
+
${e.launches.length?H(e.launches,e=>e.key,e=>A`<div class="fl" @click=${t=>!t.target.closest(`button`)&&this.open(e.key)}>
|
|
758
|
+
<button type="button" class="fl-name jmono" @click=${()=>this.open(e.key)}>${J(e)}</button>
|
|
759
|
+
<span class="meta">${K(D(E`PID ${e.pid}`),D(E`Model ${e.model||`—`}`),e.role?D(E`Role ${e.role}`):``)} |
|
|
752
760
|
<cae-elapsed .since=${Ir.at(`c:${e.key}`,e.age_s)}></cae-elapsed></span>
|
|
753
|
-
<div class="meta mono cmd">${(e.full_cmd||
|
|
754
|
-
</div>`):
|
|
761
|
+
<div class="meta mono cmd">${(e.full_cmd||D(`In the pipeline process`)).slice(0,400)}</div>
|
|
762
|
+
</div>`):A`<div class="meta">${D(`No agent sessions`)}</div>`}
|
|
755
763
|
</section>
|
|
756
|
-
${t.length?
|
|
757
|
-
<h3 title=${
|
|
758
|
-
${H(t,e=>e.key,e=>
|
|
759
|
-
<b class="jmono">${
|
|
760
|
-
<span class="meta">${E
|
|
764
|
+
${t.length?A`<section class="panel c12">
|
|
765
|
+
<h3 title=${D(`Functions in the pipeline process`)}>${D(`Python tasks running`)} <span class="r">${t.length}</span></h3>
|
|
766
|
+
${H(t,e=>e.key,e=>A`<div class="fl">
|
|
767
|
+
<b class="jmono">${J(e)}</b>
|
|
768
|
+
<span class="meta">${D(E`PID ${e.pid}`)} | <cae-elapsed .since=${Ir.at(`p:${e.key}`,e.age_s)}></cae-elapsed></span>
|
|
761
769
|
</div>`)}
|
|
762
|
-
</section>`:
|
|
763
|
-
<section class="panel c12"><h3>${
|
|
764
|
-
</div>`}};U([
|
|
770
|
+
</section>`:M}
|
|
771
|
+
<section class="panel c12"><h3>${D(`Process tree`)}</h3><ca-proc-tree .procs=${e}></ca-proc-tree></section>
|
|
772
|
+
</div>`}};U([F({attribute:!1})],Hf.prototype,`procs`,void 0),U([F({type:Boolean})],Hf.prototype,`unresponsive`,void 0),U([F({type:Boolean})],Hf.prototype,`exported`,void 0),Hf=U([P(`ca-procs-view`),O()],Hf),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 Uf=[`failed`,`attention`,`done`,`running`,`muted`,`neutral`],Wf=e=>typeof e._tone==`string`&&Uf.includes(e._tone)?e._tone:void 0,Gf=new Set([`usd`,`pct`,`duration`,`tokens`,`number`]),Kf=e=>typeof e==`string`?e:JSON.stringify(e),qf=[Kr,k` 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;}`],Jf=class extends N{constructor(...e){super(...e),this.baseUrl=``,this.label=``,this.sorts=new Map,this.picks=new Map}static{this.styles=[V,Gr,k` :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=me(this.body);return e?this.draw(e,`0`):A`<cae-json-tree .value=${this.body??{}}></cae-json-tree>`}draw(e,t){let n=this.content(e,t),r=e.anchor||M;return e.title?e.collapsed?A`<details class="block" data-anchor=${r} tabindex=${e.anchor?-1:M}><summary>${e.title}</summary>${n}</details>`:A`<div class="block" data-anchor=${r} tabindex=${e.anchor?-1:M}><h4>${e.title}</h4>${n}</div>`:A`<div class="block" data-anchor=${r} tabindex=${e.anchor?-1:M}>${n}</div>`}code(e,t){return A`<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:D(`Copy`),copied:D(`Copied`),wrap:D(`Wrap lines`),empty:D(`No text`),cut:(e,t)=>D(E`First ${e.toLocaleString(An())} of ${t.toLocaleString(An())} 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)),A`<iframe class="embed" src=${n.href} title=${e.title||this.label} style=${e.height?`height:${e.height}px`:M}></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=A`<cae-tree class="tree" .items=${n} .selected=${s?.code?o:null} .label=${e.title??``} .strings=${{empty:D(`No items`)}} @cae-select=${e=>this.choose(t,e.detail.id,r)}></cae-tree>`;return c?A`<div class="pair">
|
|
765
773
|
${l}
|
|
766
|
-
<div class="pane">${s?.code?this.code(s.code,o??``):
|
|
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
|
|
774
|
+
<div class="pane">${s?.code?this.code(s.code,o??``):A`<div class="meta">${D(`No selection`)}</div>`}</div>
|
|
775
|
+
</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?$(this,`ca-navigate`,{page:``,...t,tab:`panel:${e.panel}`}):e.task&&$(this,`ca-navigate`,{page:``,...t,tab:`stream`,key:e.task,view:`transcript`,round:null})}content(e,t){let n={empty:D(`No values`),showTable:D(`Show table`),showChart:D(`Show chart`),label:D(`Label`),other:D(`Other`),total:D(`Total`),none:`—`,scale:(e,t)=>D(E`${e} to ${t}`)};switch(e.type){case`blocks`:return A`${e.blocks.map((e,n)=>{let r=me(e);return r?this.draw(r,`${t}.${n}`):A`<div class="block"><cae-json-tree .value=${e}></cae-json-tree></div>`})}`;case`tiles`:return A`<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 A`<cae-column-chart .label=${e.title??``} .x=${e.x} .series=${e.series} ?stacked=${!!e.stacked} .format=${wc(e.unit)} .strings=${n}></cae-column-chart>`;case`lines`:return A`<cae-line-chart .label=${e.title??``} .x=${e.x} .series=${e.series} .format=${wc(e.unit)} .strings=${n}></cae-line-chart>`;case`heatmap`:return A`<cae-heatmap .label=${e.title??``} .x=${e.x} .y=${e.y} .values=${e.values} .format=${wc(e.unit)} .strings=${n}></cae-heatmap>`;case`hbars`:return A`<cae-bar-chart .label=${e.title??``} .bars=${e.bars.map(e=>({label:e.label,value:e.value,tone:e.tone??void 0}))} .format=${wc(e.unit)} .strings=${n}></cae-bar-chart>`;case`status_grid`:return A`<cae-state-grid .label=${e.title??``} .x=${e.x} .y=${e.y} .cells=${e.cells} .strings=${n}></cae-state-grid>`;case`note`:return A`<div class="note" data-tone=${e.tone&&e.tone!==`neutral`?e.tone:M}>${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 A`${M}`}var r}table(e,t){let n=(s=e).columns.map((e,t)=>{let n=e.format?Gf.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:Kf(e).localeCompare(Kf(t))}(t[e.id],n[e.id]),text:t=>Tc(t[e.id],e.format),cell:t=>{let n=t[e.id],i=Tc(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?A`<a href=${a} target="_blank" rel="noopener noreferrer">${i}</a>`:e.bar&&typeof n==`number`?A`${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 A`<cae-data-table .columns=${n} .rows=${o} .rowKey=${e=>i.get(e)??``} .rowTone=${Wf} .activatable=${!1} .sort=${a} .cellStyles=${qf} .caption=${e.title??``} .strings=${fc(D(`No rows`))} @cae-sort=${e=>this.sorts=new Map(this.sorts).set(t,e.detail)} ></cae-data-table>`}};U([F({attribute:!1})],Jf.prototype,`body`,void 0),U([F({attribute:`base-url`})],Jf.prototype,`baseUrl`,void 0),U([F()],Jf.prototype,`label`,void 0),U([I()],Jf.prototype,`sorts`,void 0),U([I()],Jf.prototype,`picks`,void 0),Jf=U([P(`ca-panel-body`),O()],Jf);var Yf=class extends N{constructor(...e){super(...e),this.name=``,this.baseUrl=``}static{this.styles=[V,k` :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?A`<div class="blank"><span class="ic" aria-hidden="true">…</span>${D(`Loading…`)}</div>`:A`<div class="blank"><span class="ic" aria-hidden="true">▤</span>${D(E`No custom view named ${this.name}`)}</div>`;let e=this.panel;return A`<section class="panel">
|
|
768
776
|
<h3><span class="tab-ic" aria-hidden="true">${e?.icon||`▤`}</span>${e?.title||this.name}
|
|
769
|
-
<span class="r">${
|
|
770
|
-
${e?.description?
|
|
771
|
-
${
|
|
772
|
-
</section>`}};U([
|
|
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=>
|
|
775
|
-
`);return[{label:
|
|
777
|
+
<span class="r">${D(`Custom view`)}</span></h3>
|
|
778
|
+
${e?.description?A`<div class="meta desc">${e.description}</div>`:M}
|
|
779
|
+
${me(this.data)?A`<ca-panel-body .body=${this.data} base-url=${this.baseUrl} label=${e?.title||this.name}></ca-panel-body>`:A`<cae-json-tree .value=${this.data}></cae-json-tree>`}
|
|
780
|
+
</section>`}};U([F()],Yf.prototype,`name`,void 0),U([F({attribute:!1})],Yf.prototype,`panel`,void 0),U([F({attribute:!1})],Yf.prototype,`data`,void 0),U([F({attribute:`base-url`})],Yf.prototype,`baseUrl`,void 0),Yf=U([P(`ca-panel-view`),O()],Yf);var Xf=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 Zf(e){let t=[],n=!1;for(let r of(e||``).split(`
|
|
781
|
+
`))/^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 Qf=e=>!!e&&(e.prompt||``).startsWith(`The output file(s) you wrote do not pass their checks.`);function $f(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&&Qf(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=Zf(e[i+1]?.prompt));let o=n.get(t.tryNo)??null;t.row=o,t.result=o?o.ok?`ok`:`failed`:null}),r}var ep=e=>/\[([\w.-]+)\]/.exec(e)?.[1]??``;function tp(e){let t=/\[([\w.-]+)\]\s*(.*)$/.exec(e);return t?`${t[1]}: ${t[2]}`:e}function np(e,t,n=_s(e.tryNo-1)){return t>1?e.fixupNo?K(n,D(E`correction ${e.fixupNo}`)):e.hopNo?K(n,D(`model switch`)):n:e.fixupNo?D(E`Correction ${e.fixupNo}`):e.hopNo?D(`Model switch`):_s(0)}function rp(e){let t=e.model||D(`model`);return e.switchedTo?D(E`${t}: ${Q(e.switchedStop)} → ${e.switchedTo}`):D(E`${t}: ${Q(e.switchedStop)} → next model`)}var ip={claude:`Claude Code`,omp:`omp`,codex:`Codex`,opencode:`opencode`,gemini:`Gemini CLI`};function ap(e){let t=String(e||``).split(`/`).pop()??``;return ip[t]??t}var op=(e,t)=>{let n=e.indexOf(t);return n>=0?e[n+1]??``:``};function sp(e){let t=e.argv,n=/TELEMETRY [^\n]*role=([\w:-]+)/.exec(e.prompt||``)?.[1];return{agent:ap(t[0]),model:op(t,`--model`)||op(t,`-m`),role:n&&n!==`-`?n:``}}function cp(e){if(!e)return[];let t=[];return e.agent&&t.push({label:D(`coding agent`),value:e.agent,tip:D(`The CLI that ran the task (claude, omp)`)}),e.model&&t.push({label:D(`model`),value:e.model,tip:D(`The model the agent session ran on`),look:`mono`}),e.role&&t.push({label:D(`role`),value:e.role,tip:D(`The agent definition the coding agent ran as (agents/<role>.md)`),look:`quiet`}),t}function lp(e){let t=e.prompt||``,n=e.prompt_truncated||0;return[{id:`cmd`,code:!0,summary:D(`Command line`),text:e.argv.join(` `)},{id:`prompt`,summary:D(n?E`Prompt (${t.length} characters; ${n} characters not saved)`:E`Prompt (${t.length} characters)`),text:t+(n?`\n\n${D(E`(${n} characters not saved)`)}`:``)}]}function up(e,t){if(e.result===`rejected`)return{tone:`attention`,title:D(`Output failed checks`),list:e.rejectedWith.map(e=>T(e,t)),note:D(`Sent in the correction prompt`)};if(e.result===`switched`)return{tone:`failed`,title:rp(e)};if(e.result===`failed`&&e.row){let n=T(e.row.reason,t)||Q(e.row.stop);return{tone:`failed`,title:D(E`Attempt ${e.tryNo} failed: ${n}`)}}}function dp(e,t,n){let r=t[t.length-1]?.tryNo??1,i=vs(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[`✓`,D(`passed`),D(`Output passed checks`)];case`rejected`:return[`✕`,D(`failed checks`),D(`Output failed checks`)];case`switched`:return[`✕`,Q(e.switchedStop),rp(e)];case`failed`:return[`✕`,D(`failed`),T(e.row?.reason,t)||Q(e.row?.stop)];default:return[``,``,``]}}(s,n.run):[``,``,``],d=e.who?.model;return{id:e.id,title:s?np(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?cp(e.who):[],details:e.launch?lp(e.launch):[],items:e.items.map(e=>e.type===`event`?{...e,title:D(`API request sent again`)}:e),footer:s&&up(s,n.run)}})}var fp=/\{\s*"title"\s*:\s*"((?:[^"\\]|\\.)*)"\s*,\s*"url"\s*:\s*"(https?:\/\/[^"\s]+)"/g,pp=/^\s*\[\d+\]\s+(.+)\n\s*(https?:\/\/\S+)/gm,mp=/https?:\/\/[^\s"'<>)\]]+/g;function hp(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(fp)){let t=e[1]??``;try{t=JSON.parse(`"${t}"`)}catch{}i(t,e[2]??``)}if(!n.length)for(let e of t.matchAll(pp))i(e[1]??``,e[2]??``);if(!n.length)for(let e of t.matchAll(mp))i(``,e[0].replace(/[.,;:!?]+$/,``));return n}var gp=()=>({rounds:[],tools:new Map,next:0}),_p=/session init:.*?model=([\w.\-:]+)/;function vp(e){return`i`+e.next++}function yp(e,t){let n={id:`r${e.rounds.length}`,launch:t,who:t?sp(t):null,items:[]};return e.rounds.push(n),n}function bp(e){return e.rounds[e.rounds.length-1]??yp(e,null)}function xp(e,t){t?e.name=t:e.name||=`tool`,e.icon=(e.name.split(/[_:]/).pop()??``).toLowerCase()}function Sp(e,t,n){let r=n?e.tools.get(n):void 0;return r||(r={type:`tool`,id:n?`call:${n}`:vp(e),call:n,name:``,icon:``,summary:``,intent:``,body:``,output:null,status:`running`},n&&e.tools.set(n,r),t.items.push(r)),r}function Cp(e,t){let n=0;for(let i of t){let t=r(i);if(!t)continue;if(t.type===`launch`){yp(e,t),n++;continue}let a=bp(e);switch(t.type){case`message_start`:case`message_end`:if(t.role!==`user`||!t.text)continue;a.items.push({type:`prompt`,id:vp(e),text:t.text});break;case`turn_end`:if(!t.thinking)continue;a.items.push({type:`reasoning`,id:vp(e),text:t.thinking});break;case`acall`:case`tool_execution_start`:case`tool_execution_update`:{let n=Sp(e,a,t.call);n.output===null?(xp(n,t.tool),n.summary=es(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=es(t.cmd));break}case`aresult`:case`tool_execution_end`:{let n=Sp(e,a,t.call);if(n.output!==null&&!t.out)break;xp(n,t.tool),n.status=t.err?`error`:`ok`,!n.summary&&n.body&&(n.summary=es(n.body)),n.output=t.out||`(no output)`,n.query&&(n.links=hp(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:vp(e),text:t.delta});break}case`auto_retry_start`:a.items.push({type:`event`,id:vp(e),icon:`↻`,title:``,text:t.err??``});break;case`notice`:{let n=_p.exec(t.text||``)?.[1];n&&(a.who??={agent:``,model:``,role:``},a.who.model||(a.who.model=n)),a.items.push({type:`notice`,id:vp(e),text:(t.text||``).replace(/\s+/g,` `).trim()});break}}n++}return n}var wp=class{constructor(e){this.host=e,this.model=gp(),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=gp(),this.behind=0,this.count=0,this.ready=!1,t&&`events`in t)this.count=Cp(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+=Cp(this.model,e),this.version++)}onPage(e,t){t===this.generation&&(!this.ready&&e.behind&&(this.behind=e.behind),this.count+=Cp(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=gp(),Cp(this.model,a.events),this.version++,this.host.requestUpdate())}};function Tp(e){return A`<cae-markdown .text=${e} .split=${Rf} .strings=${{showRendered:D(`Show rendered`),showSource:D(`Show source`)}}></cae-markdown>`}z(`cae-markdown`,ta);var Ep=class extends N{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 wp(this),this.memory=null,this.drawn=null,this.lastSent=``,this.fed=null}static{this.styles=k` :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,An()];if(this.drawn?.key.every((e,n)=>e===t[n]))return this.drawn;let n=this.feed.model,r=$f(n.rounds.map(e=>e.launch),this.rows);return this.drawn={key:t,rounds:r,sections:dp(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,A`<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=>Tp(e.text)} .strings=${{sections:D(`Agent sessions`),sectionsTip:[`${D(`Retry`)}: ${gs()}`,`${D(`Correction`)}: ${Zs()}`,`${D(`Model switch`)}: ${Ks()}`].join(`
|
|
782
|
+
`),loadEarlier:e=>D(e===1?`Show 1 earlier line`:E`Show ${e} earlier lines`),newBelow:e=>D(e===1?`Show 1 new event`:E`Show ${e} new events`),newInLatest:e=>D(e===1?`Show 1 new event in the running agent session`:E`Show ${e} new events in the running agent session`),prompt:D(`Prompt`),assistant:D(`Assistant`),reasoning:D(`Reasoning`),characters:e=>D(E`${e} characters`),tool:D(`tool`),results:e=>D(e===1?`1 result`:E`${e} results`),done:D(`done`,{id:`tool-done`}),failed:D(`failed`),running:D(`running`),interrupted:D(`interrupted`),interruptedTip:D(`The run ended before the tool call returned`),query:D(`query`),page:D(`page`),fullText:D(`Full text`),showAll:e=>D(E`Show all (${e} characters)`),showLess:D(`Show less`)}} @cae-section-change=${e=>{e.stopPropagation(),$(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,$(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([F({attribute:!1})],Ep.prototype,`events`,void 0),U([F()],Ep.prototype,`run`,void 0),U([F({attribute:!1})],Ep.prototype,`stream`,void 0),U([F({attribute:`base-url`})],Ep.prototype,`baseUrl`,void 0),U([F({attribute:!1})],Ep.prototype,`client`,void 0),U([F({type:Boolean})],Ep.prototype,`live`,void 0),U([F({attribute:!1})],Ep.prototype,`round`,void 0),U([F({attribute:!1})],Ep.prototype,`rows`,void 0),U([F({reflect:!0})],Ep.prototype,`mode`,void 0),U([I()],Ep.prototype,`shown`,void 0),U([bn(`cae-transcript`)],Ep.prototype,`view`,void 0),Ep=U([P(`ca-transcript`),O()],Ep);var Dp=e=>w(e.io)||e.rows.some(w),Op=e=>!Dp(e)&&(!!e.stream||e.launches.length>0||e.rows.some(f)),kp=e=>e.live?`running`:e.outcomes.get(e.detail.key)?.outcome??p(void 0,e.detail.rows),Ap=(e,t)=>e.detail.io.upstream.find(e=>e.outputs.some(e=>e.path===t)),jp=e=>t=>{let n=Ap(e,t);if(!n)return;let r=n.outputs.find(e=>e.path===t);return{name:J(n),written:!!r?.file.exists,outcome:e.outcomes.get(n.key)?.outcome}},Mp=e=>ys((e.rounds||1)-1),Np=(e,t)=>A`<a class="lnk" href="#" @click=${n=>{n.preventDefault(),$(e.host,`ca-open-task`,{key:t.key})}}>${J(t)}</a>`,Pp=new Set([`key`,`rows`,`launches`,`stream`,`task_detail_error`,`definition`,`io`,`row_extras`]);function Fp(e){for(let t=e.launches.length-1;t>=0;t--){let n=e.launches[t],r=n?sp(n).model:``;if(r)return r}return``}function Ip(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=[D(`Account or API key the coding agent used (credential)`),...t.map(Es)].filter(Boolean).join(`
|
|
783
|
+
`);return[{label:D(`identity`),value:q(t.map(Ts)),tip:n,look:`quiet`}]}function Lp(e,t,n=``,r={}){let i=t===`output`?A`${Ol(e.status)}${(e.rounds??0)>1?A` <span class="meta" title=${Zs()}>${Qs(e.rounds,e.status===`valid`)}</span>`:M}`:Dl(e),a=A`<div class="io-hd">${r.chip??i}<span class="jmono ct-path" title=${e.path}>${T(e.path,n)}</span></div>${r.origin?A`<div class="meta io-from">${r.origin}</div>`:M}`;if(t===`output`&&e.status===`refused`)return A`<div class="io-card one">${a}<div class="meta">${$s(e,n,r.producerOf)}</div></div>`;if(t===`output`&&e.status===`failed`&&!e.file.exists)return A`<div class="io-card one">${a}</div>`;let o=e.errors??[];return A`<div class="io-card">
|
|
776
784
|
${a}
|
|
777
|
-
${
|
|
778
|
-
${
|
|
779
|
-
${o.length?
|
|
780
|
-
`)}</pre>`:
|
|
781
|
-
</div>`}var
|
|
785
|
+
${Pl(e,t)}
|
|
786
|
+
${Al(e)}
|
|
787
|
+
${o.length?A`<h4>${D(`Errors`)}</h4><pre class="ct-err">${o.map(e=>T(e,n)).join(`
|
|
788
|
+
`)}</pre>`:M}
|
|
789
|
+
</div>`}var Rp=e=>!e.file.exists||e.status!=null&&e.status!==`valid`,zp=e=>Zr({text:is(e),tone:ds(e),mark:ps(e)});function Bp(e){return e.map(e=>A`<span class="lineage" data-lineage=${e} title=${function(e){switch(e){case`given_from`:return D(`Its output is in the params of the later task (given_from)`);case`after`:return D(`The later task waits for it and is not given its output (after)`);case`created_from`:return D(`Its result reached the flow call just before the flow call created the later task (created_from)`)}}(e)}>${rl(e)}</span>`)}var Vp=k` :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;flex-wrap:wrap;align-items:center;gap:4px 10px;margin:2px 0 6px;}.down{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:6px;}.lineage{font-size:11px;color:var(--text-2);border:1.5px solid var(--line2);border-radius:999px;padding:0 7px;white-space:nowrap;}.lineage[data-lineage='after']{border-style:dotted;}.lineage[data-lineage='created_from']{border-style:dashed;}.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;}`,Hp=class extends N{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 Xf(this),this.launches=[],this.shownRound=-1,this.rounds=[],this.outcomes=new Map}static{this.styles=[V,Il,Wo,Fd,Vp]}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);$(this,`ca-navigate`,n?{view:`transcript`,round:n.round}:{view:`transcript`})}render(){let e=this.taskKey;if(!e)return A`<div class="blank"><span class="ic" aria-hidden="true">✦</span><b>${D(`No task selected`)}</b></div>`;let t=this.detail.value;if(!t)return A`<div class="taskmeta meta"><strong>${e}</strong> ${D(`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 A`${function(e,t,n){let r=e.detail,i=e.live,{rows:a,launches:o}=r,s=Dp(r),c=Op(r),l=a.slice().sort((e,t)=>String(e.ts).localeCompare(String(t.ts))),d=l[l.length-1],p=o[0],m={agent:ap(p?.cmd?p.cmd.split(` `)[0]:d?.agent),model:p?.model||d?.model||Fp(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=ns(ts(_)),y=Object.entries(r).filter(([e])=>!Pp.has(e)),[b,x]=function(e){let t=e.detail.rows,n=t.filter(f),r=t[t.length-1],i=kp(e);switch(i){case`running`:return[D(`Running`),`neutral`];case`waiting`:{let t=e.plan?.nodes.find(t=>t.key===e.detail.key),n=t?.deferred?Us(t.deferred_cause,t.deferred,u(e.plan,t.deferred_cause)):``;return n?[D(E`Not run: ${n}`),`attention`]:[D(`Waiting`),`muted`]}case`skipped`:return[D(`Skipped`),`muted`];case`not_started`:{let t=function(e){let t=e.detail,n=hs(e.outcomes.get(t.key)??{attempts:t.rows,cause:null},e.outcomes,e.run,t=>Ap(e,t)?.key);if(n)return n;let r=Re(t.rows[t.rows.length-1]?.reason)[0],i=r?Ap(e,r.path):void 0;return r?ms(T(r.path,e.run),r.problem,i?{name:J(i)}:void 0):``}(e);return[D(t?E`Not started: ${t}`:`Not started`),`attention`]}case`partial`:{let t=r?.reason&&ls(r.reason)?Q(r.reason):T(r?.reason,e.run);return[D(t?E`Partly done: ${t}`:`Partly done`),`attention`]}case`failed`:{let t=T(r?.reason,e.run)||Q(r?.stop);return[n.length>1?D(E`Failed on all ${n.length} attempts: ${t}`):D(E`Failed: ${t}`),`failed`]}}if(!r)return[is(i),`neutral`];let a=n.filter(e=>!e.ok);if(a.length){let t=T(a[0]?.reason,e.run)||Q(a[0]?.stop);return[a.length===1?D(E`Done on attempt ${n.length} | 1 failed attempt | first failure: ${t}`):D(E`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]?tp(T(t[0],e.run)):``;return n?[D(o===1?E`Done after 1 correction | first failed check: ${n}`:E`Done after ${o} corrections | first failed check: ${n}`),`neutral`]:[D(o===1?`Done after 1 correction`:E`Done after ${o} corrections`),`neutral`]}let s=Js(r.hops,null,r.skipped_hops);return s?[D(E`Done after a model switch: ${s}`),`neutral`]:[D(`Done`),`neutral`]}(e),S=D(s?`Python task`:`Agent task`),C=e.plan?.nodes.find(e=>e.key===r.key);return A`<div class="taskmeta">
|
|
782
790
|
<div class="tm-head">
|
|
783
|
-
${
|
|
791
|
+
${Pd(s,S,`tm-av `+(s?`py`:``))}
|
|
784
792
|
<div style="min-width:0">
|
|
785
|
-
<div class="tm-name" title=${t}>${g?
|
|
786
|
-
<div class="verdict" data-tone=${L(
|
|
787
|
-
${
|
|
788
|
-
${
|
|
789
|
-
</div>`:
|
|
790
|
-
${
|
|
791
|
-
${
|
|
792
|
-
${
|
|
793
|
-
${
|
|
794
|
-
${
|
|
795
|
-
</
|
|
796
|
-
|
|
797
|
-
${
|
|
798
|
-
|
|
799
|
-
<
|
|
800
|
-
<span>${e.
|
|
801
|
-
|
|
802
|
-
${
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
793
|
+
<div class="tm-name" title=${t}>${g?J(g):C?J(C):t.replace(/^python:/,``)} ${i?Zr({text:D(`running`),tone:`running`}):M}</div>
|
|
794
|
+
<div class="verdict" data-tone=${L(x)}>${b}</div>
|
|
795
|
+
${C?.claims?.length?A`<div class="meta" title=${pc()}>
|
|
796
|
+
${D(`Locks`)} ${C.claims.map(e=>Zr({text:e}))}
|
|
797
|
+
</div>`:M}
|
|
798
|
+
${C?.priority?A`<div class="meta" title=${Bc()}>${zc(C.priority)}</div>`:M}
|
|
799
|
+
${function(e,t){let n=e.map(e=>!!e.rerun).lastIndexOf(!0),r=n>=0?al(e,n):t?{text:t,changed:[],divergence:t.startsWith(`divergence`)}:null;return r?A`<div class="meta rerun" title=${r.text}>${cl(r)}${r.divergence?A` <span class="divergence" title=${D(`The flow gave other params for the same outputs of the tasks before it (divergence): a clock, randomness, outside state or changed flow code`)}>${Zr({text:sl(),tone:`attention`})}</span>`:M}</div>`:M}(a,C?.rerun)}
|
|
800
|
+
${function(e){let t=(e.plan?.flow_calls??[]).filter(t=>t.raised_by===e.detail.key);return t.length?A`${t.map(t=>A`<div class="meta stopped" title=${t.error??``}>${ul(t,e.run)}</div>`)}`:M}(e)}
|
|
801
|
+
${c?A`<div class="whos">
|
|
802
|
+
${Uo([...cp(m),...Ip(_)])}
|
|
803
|
+
${h.length?A`<span class="meta">${D(h.length===1?E`Earlier attempts used model ${h[0]??``}`:E`Earlier attempts used models ${q(h)}`)}</span>`:M}
|
|
804
|
+
</div>`:M}
|
|
805
|
+
${o.length?A`<div class="meta">${o.length===1?D(`1 agent session running`):D(E`${o.length} agent sessions running`)}</div>`:M}
|
|
806
|
+
${function(e,t){if(!e)return M;let n=function(e){let t=null;for(let n of e){let e=n.usage?.peak_context;e!=null&&(t===null||e>(t.usage?.peak_context??0))&&(t=n)}return t}(t),r=t.find(e=>e.context_warned);return A`<div class="spend">
|
|
807
|
+
<b title=${D(`Reported by the coding agent`)}>${X(e.cost)}</b>
|
|
808
|
+
<span>${D(E`Tokens: ${Y(e.input)} input, ${Y(e.output)} output, ${Y(e.cache_read)} cache read, ${Y(e.cache_creation)} cache write`)}</span>
|
|
809
|
+
<span>${e.calls===1?D(`1 API call`):D(E`${e.calls} API calls`)}</span>
|
|
810
|
+
${n?A`<span title=${Hc()}>${Uc(n)}</span>`:M}
|
|
811
|
+
${r?A`<span class="tone-text" data-tone="attention" title=${Gc()}>${Wc(r)}</span>`:M}
|
|
812
|
+
</div>`}(Ee(a),_)}
|
|
813
|
+
${function(e,t){let n=Pe(e.journal.length?e.journal:t),r=t[0],i=t[t.length-1],a=r?Le(r,n).start:null;if(!a||!i)return M;let o=Le(i,n).next;return A`<div class="spend quota">
|
|
814
|
+
<span title=${Ms(a)}>${D(E`Usage at session start: ${js(a)}`)}</span>
|
|
815
|
+
${o?A`<span title=${Ms(o)}>${D(E`Usage after this task: ${js(o)}`)}</span>`:M}
|
|
807
816
|
</div>`}(e,_)}
|
|
808
817
|
</div>
|
|
809
818
|
</div>
|
|
810
|
-
${_.length?
|
|
811
|
-
`),
|
|
812
|
-
${(e=>e.stop===`partial`?
|
|
813
|
-
</span>`}(e,_[n],t,c,r.row_extras??[]))}</div>`:
|
|
814
|
-
${function(e,t){let n=e[e.length-1],r=n?
|
|
815
|
-
${function(e,t){let n=e.flatMap(e=>e.web_queries??[]),r=new Map;return n.length?
|
|
816
|
-
<summary>${n.length===1?
|
|
819
|
+
${_.length?A`<div class="runchips">${vs(_).map((t,n)=>function(e,t,n,r,i){let a=t.stop===`partial`?`part`:t.ok?`ok`:`bad`,o=e.detail.rows,s=al(o,o.indexOf(t)),c=!!e.replayMarks&&!!t.replayed,l=T(t.reason,e.run),u=Js(t.hops,null,t.skipped_hops),d=t.safety_stops?.length?$c(t.safety_stops.length):``,f=[D(E`Ended ${G(t.ts,!0)}`),Mp(t),r&&t.model?D(E`Model ${t.model}`):``,u?D(E`Model switch: ${u}`):``,Uc(t),t.context_warned?Wc(t):``,l,t.route||``,c?ic():``,s?cl(s):``,...vc(t,i).map(([e,t])=>`${e}: ${t}`)].filter(Boolean).join(`
|
|
820
|
+
`),p=t.cost_usd!==null&&t.cost_usd!==void 0?X(t.cost_usd):``;return A`<span class="runchip ${a}" title=${f}>
|
|
821
|
+
${(e=>e.stop===`partial`?A`<span aria-hidden="true">◌</span><span class="sr">${is(`partial`)}</span>`:A`<span aria-hidden="true">${e.ok?`✓`:`✕`}</span><span class="sr">${e.ok?D(`passed`):D(`failed`)}</span>`)(t)} ${K(n,Q(t.stop,t.reason),B(t.wall_s),p,d,c?rc():``,s?.divergence?sl():``)}
|
|
822
|
+
</span>`}(e,_[n],t,c,r.row_extras??[]))}</div>`:M}
|
|
823
|
+
${function(e,t){let n=e[e.length-1],r=n?vc(n,t):[];if(!r.length)return M;let i=gc();return A`<div class="whos">${Uo(r.map(([e,t])=>({label:e,value:t,tip:i,look:`quiet`})))}</div>`}(_,r.row_extras??[])}
|
|
824
|
+
${function(e,t){let n=e.flatMap(e=>e.web_queries??[]),r=new Map;return n.length?A`<details class="io-fold">
|
|
825
|
+
<summary>${n.length===1?D(`1 web search`):D(E`${n.length} web searches`)}</summary>
|
|
817
826
|
<ol class="meta searches">
|
|
818
|
-
${n.map(e=>{let n=r.get(e)??0;return r.set(e,n+1),
|
|
827
|
+
${n.map(e=>{let n=r.get(e)??0;return r.set(e,n+1),A`<li><button class="qlink jmono" @click=${()=>t(e,n)}>
|
|
819
828
|
${e}
|
|
820
829
|
</button></li>`})}
|
|
821
830
|
</ol>
|
|
822
|
-
</details>`:
|
|
823
|
-
${function(e){let t=
|
|
824
|
-
<summary title=${
|
|
825
|
-
<ul class="meta searches jmono">${r.map(e=>
|
|
826
|
-
</details>`:
|
|
827
|
-
${function(e){let t=
|
|
828
|
-
<summary title=${
|
|
829
|
-
<ul class="meta searches">${r.map(e=>
|
|
831
|
+
</details>`:M}(_,n)}
|
|
832
|
+
${function(e){let t=vs(e),n=e.filter(e=>e.changes).length,r=e.flatMap((e,r)=>{let i=e.changes;if(!i)return[];let a=n>1?t[r]??``:``,o=new Set(i.removed),s=new Set(i.kept),c=(e,t)=>(e??[]).map(e=>K(a,e,function(e){switch(e){case`created`:return D(`created`);case`modified`:return D(`modified`);case`deleted`:return D(`deleted`);case`removed`:return D(`created, removed after the failed attempt`);case`kept`:return D(`created, kept after the failed attempt`)}}(((e,t)=>o.has(e)?`removed`:s.has(e)?`kept`:t)(e,t))));return[...c(i.created,`created`),...c(i.modified,`modified`),...c(i.deleted,`deleted`)]});return n?r.length?A`<details class="io-fold">
|
|
833
|
+
<summary title=${D(`Files under the task's declared patterns that its attempts created, modified or deleted (changes)`)}>${i=r.length,D(i===1?`1 changed file`:E`${i} changed files`)}</summary>
|
|
834
|
+
<ul class="meta searches jmono">${r.map(e=>A`<li>${e}</li>`)}</ul>
|
|
835
|
+
</details>`:A`<div class="meta">${D(`No changed files`)}</div>`:M;var i}(_)}
|
|
836
|
+
${function(e){let t=vs(e),n=e.filter(e=>e.safety_stops?.length).length;if(!n)return M;let r=e.flatMap((e,r)=>(e.safety_stops??[]).map(e=>K(n>1?t[r]??``:``,nl(e))));return A`<details class="io-fold">
|
|
837
|
+
<summary title=${el()}>${$c(r.length)}</summary>
|
|
838
|
+
<ul class="meta searches">${r.map(e=>A`<li>${e}</li>`)}</ul>
|
|
830
839
|
</details>`}(_)}
|
|
831
|
-
${
|
|
832
|
-
<span aria-hidden="true">⚠</span> ${E
|
|
833
|
-
</div>`:
|
|
834
|
-
${
|
|
835
|
-
${
|
|
836
|
-
|
|
837
|
-
<
|
|
840
|
+
${rs(_)?A`<div class="meta unread" title=${D(`Event types this contraagent version does not know (unread_events)`)}>
|
|
841
|
+
<span aria-hidden="true">⚠</span> ${D(E`Unrecognized events: ${rs(_)}`)}
|
|
842
|
+
</div>`:M}
|
|
843
|
+
${v?A`<div class="meta unread" title=${v.tip}><span aria-hidden="true">⚠</span> ${v.label}</div>`:M}
|
|
844
|
+
${r.task_detail_error?A`<div class="meta v-bad">${D(E`The task_detail callback failed: ${r.task_detail_error??``}`)}</div>`:M}
|
|
845
|
+
${o.map(e=>A`<details class="launch">
|
|
846
|
+
<summary>${K(D(E`Process ${e.pid??`—`}`),e.key||``)}</summary>
|
|
847
|
+
<div class="meta">${K(D(E`Plugin ${e.plugin||D(`none`,{id:`none`})}`),D(E`Model ${e.model||`—`}`),D(E`Role ${e.role||D(`none`,{id:`none`})}`))}</div>
|
|
838
848
|
</details>`)}
|
|
839
|
-
${
|
|
849
|
+
${y.map(([e,t])=>A`<details class="io-fold"><summary>${e}</summary><cae-json-tree .value=${t}></cae-json-tree></details>`)}
|
|
840
850
|
</div>`}(n,e,(e,t)=>this.revealSearch(e,t))} ${this.renderViews(t,r)}
|
|
841
|
-
${t.stream?
|
|
842
|
-
${t?
|
|
843
|
-
${r===`transcript`?
|
|
844
|
-
${tr.filter(e=>!(r&&e===`transcript`)).map(e=>{let n={transcript:
|
|
845
|
-
${n}${i[e]?
|
|
851
|
+
${t.stream?A`<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=kp(e);if(n===`not_started`){let t=function(e){let t=e.detail,n=Re(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?Ap(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 A`<div class="blank notrans"><span class="ic" aria-hidden="true">⊘</span><b>${K(D(`No transcript`),is(n))}</b>
|
|
852
|
+
${t?A`<span>${D(A`Earlier task ${bl(e.host,J(t),t)}`)}</span>`:M}</div>`}if(e.exported&&Op(t))return A`<div class="blank notrans"><span class="ic" aria-hidden="true">✦</span><b>${K(D(`No transcript`),kc())}</b></div>`;if(Op(t))return A`<div class="blank notrans"><span class="ic" aria-hidden="true">✦</span><b>${K(D(`No transcript`),D(`not saved (keep_transcripts = false)`))}</b></div>`;let r=n===`waiting`&&!!e.plan?.nodes.find(e=>e.key===t.key)?.deferred;return A`<div class="blank notrans"><span class="ic" aria-hidden="true">✦</span><b>${K(D(`No transcript`),r?as(n,!1):is(n))}</b></div>`}(n):M}
|
|
853
|
+
${r===`transcript`?M:A`<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.input_files??[]).map(e=>e.path),...n.upstream.filter(Up).flatMap(e=>e.outputs.map(e=>e.path))]).size+Object.keys(n.params).length,output:n.outputs.length};return A`<div class="tviews" role="tablist">
|
|
854
|
+
${tr.filter(e=>!(r&&e===`transcript`)).map(e=>{let n={transcript:D(`Transcript`),input:D(`Input`),output:D(`Output`,{id:`view-output`}),definition:D(`Definition`)}[e];return A`<button type="button" role="tab" aria-selected=${e===t} class="tview ${e===t?`sel`:``}" @click=${()=>$(this,`ca-navigate`,{view:e})}>
|
|
855
|
+
${n}${i[e]?A`<span class="badge">${i[e]}</span>`:M}
|
|
846
856
|
</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(
|
|
848
|
-
${r.length?
|
|
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
|
|
857
|
+
</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(Rp));return{files:n,earlier:[...r].sort((e,t)=>i(t)-i(e))}}(n);return A`<h4 class="sect-h">${D(`Parameters`)}</h4>
|
|
858
|
+
${r.length?A`<table class="ct-fields params">
|
|
859
|
+
${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 A`<tr>
|
|
850
860
|
<td class="jmono">${t}</td>
|
|
851
|
-
<td>${typeof r==`object`&&r?
|
|
852
|
-
<td>${i?
|
|
861
|
+
<td>${typeof r==`object`&&r?A`<cae-json-tree .value=${r} .open=${0}></cae-json-tree>`:A`<span class="jmono">${(e=>typeof e==`string`?e:JSON.stringify(e)??String(e))(r)}</span>`}</td>
|
|
862
|
+
<td>${i?A`<span class="from">${D(A`From ${Np(e,i)}`)}</span>`:M}</td>
|
|
853
863
|
</tr>`})}
|
|
854
|
-
</table>`:
|
|
855
|
-
<h4 class="sect-h">${
|
|
856
|
-
${
|
|
857
|
-
<
|
|
858
|
-
|
|
859
|
-
${
|
|
860
|
-
|
|
861
|
-
${i?
|
|
864
|
+
</table>`:A`<div class="meta">${D(`No parameters`)}</div>`}
|
|
865
|
+
<h4 class="sect-h">${D(`Input files`)}</h4>
|
|
866
|
+
${n.input_files?.length?n.input_files.map(t=>function(e,t){let n=t.check===`passed`?`done`:t.check===`refused`?`failed`:`neutral`,r=t.check===`passed`?`done`:t.check===`refused`?`failed`:`pending`,i=t.writer?e.detail.io.upstream.find(e=>e.key===t.writer)??e.outcomes.get(t.writer):void 0,a=t.writer?A`<span>${D(A`Output of ${Np(e,i??{key:t.writer,kind:t.writer,unit:``})}`)}</span>`:M;return A`<div class="io-card one infile">
|
|
867
|
+
<div class="io-hd">${Zr({text:il(t.check),tone:n,mark:r})}<span class="jmono ct-path" title=${t.path}>${T(t.path,e.run)}</span></div>
|
|
868
|
+
<div class="meta io-from"><span title=${t.sha256}>${K(D(E`Param ${t.param}`),`sha256 ${t.sha256.slice(0,12)}`)}</span>${t.writer?A` | ${a}`:M}</div>
|
|
869
|
+
${t.reason?A`<div class="meta err">${t.reason}</div>`:M}
|
|
870
|
+
</div>`}(e,t)):A`<div class="meta">${D(`No input files`)}</div>`}
|
|
871
|
+
${i.length?A`<h4 class="sect-h">${D(`Checked files it reads`)}</h4>
|
|
872
|
+
${i.map(t=>function(e,t){let n=t.from,r=n?e.outcomes.get(n.key)?.outcome:void 0,i=n?A`<span>${D(A`Output of ${Np(e,n)}`)}</span>${r&&r!==`done`?zp(r):M}`:D(`File from before the run`),a=t.out?.status;if(!a)return Lp(t.spec,`input`,e.run,{origin:i});let o=Ol(a);return Lp({...t.spec,status:a},`input`,e.run,{origin:i,chip:o})}(e,t))}`:M}
|
|
873
|
+
<h4 class="sect-h">${D(`Earlier tasks`)}</h4>
|
|
874
|
+
${a.length?a.map(t=>function(e,t){let n=t.task,r=w(n)?D(`Python task`):D(`Agent task`),i=e.outcomes.get(n.key)?.outcome,a=n.outputs.length,o=a?K(D(a===1?`1 output file`:E`${a} output files`),t.read?t.read===1?D(`1 read by this task`):D(E`${t.read} read by this task`):``):D(`No output files`),s=A`<div class="up-hd">
|
|
875
|
+
${Pd(w(n),r)}
|
|
876
|
+
${Np(e,n)}
|
|
877
|
+
${i?zp(i):M}
|
|
878
|
+
${Bp(n.lineage??[])}
|
|
862
879
|
<span class="meta">${o}</span>
|
|
863
|
-
</div>`;if(!t.rest.length)return
|
|
864
|
-
${
|
|
865
|
-
${l?
|
|
866
|
-
${n.outputs.length?n.outputs.map(t=>
|
|
867
|
-
${r?
|
|
880
|
+
</div>`;if(!t.rest.length)return A`<div class="upstream">${s}</div>`;let c=t.rest.map(t=>Lp(t,`output`,e.run,{producerOf:jp(e)}));return t.rest.some(Rp)?A`<div class="upstream">${s}${c}</div>`:A`<details class="upstream"><summary>${s}</summary>${c}</details>`}(e,t)):A`<div class="meta">${D(`No earlier tasks`)}</div>`}
|
|
881
|
+
${Dp(t)?M: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=vs(o),c=ce(o),l=e.launches[r]?.prompt??``,u=kp(e);return A`<h4 class="sect-h">${D(`Prompt`)}${n>1&&i?A` <span class="meta">${np(i,a,s[i.tryNo-1])}: ${function(e,t=!1){return e.fixupNo?D(`same agent session, after failed checks`):e.hopNo?D(`new agent session on the next model`):e.tryNo>1&&t?D(`new agent session in the resumed run`):e.tryNo>1?D(E`new agent session after attempt ${e.tryNo-1} failed`):D(`first agent session`)}(i,c[i.tryNo-1]!==c[i.tryNo-2])}</span>`:M}</h4>
|
|
882
|
+
${l?Tp(l):A`<div class="meta">${t.stream?D(`Loading…`):Op(t)?K(D(`No prompt`),D(`not saved (keep_transcripts = false)`)):K(D(`No prompt`),is(u))}</div>`}`}(e)}`}(e):t===`output`?function(e){let t=e.detail,n=t.io,r=t.rows[t.rows.length-1];return A`<h4 class="sect-h">${D(`Output files`)}</h4>
|
|
883
|
+
${n.outputs.length?n.outputs.map(t=>Lp(t,`output`,e.run,{producerOf:jp(e)})):A`<div class="meta">${D(`No output files`)}</div>`}
|
|
884
|
+
${r?A`<h4 class="sect-h">${D(`Outcome`)}</h4>
|
|
868
885
|
<div class="ct-in">
|
|
869
|
-
${Zr({text:
|
|
870
|
-
${f(r)?
|
|
871
|
-
</div>`:
|
|
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
|
|
886
|
+
${Zr({text:Q(r.stop,r.reason),tone:us(r.stop)})}
|
|
887
|
+
${f(r)?A`<span class="meta">${K(_s(r.attempt),B(r.wall_s),Mp(r))}</span>`:M}
|
|
888
|
+
</div>`:M}
|
|
889
|
+
${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 M;let r=A`<td class="jdim">—</td>`,i=Pe(e.journal.length?e.journal:t),a=n.some(e=>(e.quota??[]).length),o=A`<td class="l jdim">—</td>`,s=(e,t)=>e?A`<td class="l" title=${Ms(e)}>${(e.credential??``)===(t??``)?js(e):Ns(e)}</td>`:o;return A`<h4 class="sect-h">${D(`Tokens and cost`)}</h4>
|
|
873
890
|
<div class="usage-wrap" data-scroll="x"><table class="usage">
|
|
874
891
|
<tr>
|
|
875
|
-
<th class="l"></th><th>${
|
|
876
|
-
<th>${
|
|
877
|
-
${a?
|
|
878
|
-
<th class="l" title=${
|
|
892
|
+
<th class="l"></th><th>${D(`Input`)}</th><th>${D(`Output`,{id:`tokens-output`})}</th><th>${D(`Cache read`)}</th><th>${D(`Cache write`)}</th>
|
|
893
|
+
<th>${D(`API calls`)}</th><th title=${D(`Reported by the coding agent`)}>${D(`Cost`)}</th><th class="l">${D(`Identity`)}</th>
|
|
894
|
+
${a?A`<th class="l" title=${D(`Subscription usage when the agent session started (account-wide)`)}>${D(`Usage at start`)}</th>
|
|
895
|
+
<th class="l" title=${D(`The first reading of the same account after this attempt ended`)}>${D(`Usage after`)}</th>`:M}
|
|
879
896
|
</tr>
|
|
880
|
-
${n.map(e=>{let t=e.usage,n=e.hops??[];return
|
|
881
|
-
<td class="l">${
|
|
882
|
-
${t?
|
|
883
|
-
<td>${
|
|
884
|
-
${a?
|
|
897
|
+
${n.map(e=>{let t=e.usage,n=e.hops??[];return A`<tr>
|
|
898
|
+
<td class="l">${_s(e.attempt)}</td>
|
|
899
|
+
${t?A`<td>${Y(t.input)}</td><td>${Y(t.output)}</td><td>${Y(t.cache_read)}</td><td>${Y(t.cache_creation)}</td><td>${t.calls}</td>`:A`${r}${r}${r}${r}${r}`}
|
|
900
|
+
<td>${X(e.cost_usd)}</td><td class="l" title=${Es(e.credential)||M}>${Ts(e.credential)||`—`}</td>
|
|
901
|
+
${a?A`${s(Le(e,i).start,e.credential)}${s(Le(e,i).next,e.credential)}`:M}
|
|
885
902
|
</tr>
|
|
886
|
-
${n.length>1?n.map(e=>
|
|
887
|
-
<td class="l">${K(e.model||e.route||`—`,
|
|
903
|
+
${n.length>1?n.map(e=>A`<tr class="hop">
|
|
904
|
+
<td class="l">${K(e.model||e.route||`—`,Q(e.stop))}</td>
|
|
888
905
|
<td></td><td></td><td></td><td></td><td></td>
|
|
889
|
-
<td>${
|
|
890
|
-
${a?
|
|
891
|
-
</tr>`):
|
|
906
|
+
<td>${X(e.cost_usd)}</td><td class="l" title=${Es(e.credential)||M}>${Ts(e.credential)||`—`}</td>
|
|
907
|
+
${a?A`<td></td><td></td>`:M}
|
|
908
|
+
</tr>`):M}`})}
|
|
892
909
|
</table></div>`}(e,t.rows)}
|
|
893
|
-
<h4 class="sect-h">${
|
|
894
|
-
${n.downstream.length?
|
|
910
|
+
<h4 class="sect-h">${D(`Later tasks`)}</h4>
|
|
911
|
+
${n.downstream.length?function(e,t){let n=[`given_from`,`after`,`created_from`];return[...n,null].map(e=>[e,t.filter(t=>(e=>n.find(t=>(e.lineage??[]).includes(t))??null)(t)===e)]).filter(([,e])=>e.length).map(([t,n])=>A`<div class="down">${t?Bp([t]):M}${n.map(t=>bl(e.host,J(t),t))}</div>`)}(e,n.downstream):A`<div class="meta">${D(`No later tasks`)}</div>`}`}(e):(e=>A`<ca-definition .definition=${e.detail.definition??null} memory="task-definition"></ca-definition>`)(e)}};U([F({attribute:!1})],Hp.prototype,`client`,void 0),U([F({attribute:`base-url`})],Hp.prototype,`baseUrl`,void 0),U([F()],Hp.prototype,`run`,void 0),U([F({attribute:!1})],Hp.prototype,`taskKey`,void 0),U([F()],Hp.prototype,`view`,void 0),U([F({attribute:!1})],Hp.prototype,`round`,void 0),U([F({type:Boolean})],Hp.prototype,`live`,void 0),U([F({attribute:!1})],Hp.prototype,`journal`,void 0),U([F({attribute:!1})],Hp.prototype,`plan`,void 0),U([F({type:Boolean})],Hp.prototype,`exported`,void 0),U([F({type:Boolean,attribute:`replay-marks`})],Hp.prototype,`replayMarks`,void 0),U([bn(`ca-transcript`)],Hp.prototype,`transcriptEl`,void 0),U([I()],Hp.prototype,`launches`,void 0),U([I()],Hp.prototype,`shownRound`,void 0),U([I()],Hp.prototype,`rounds`,void 0),Hp=U([P(`ca-task-view`),O()],Hp);var Up=e=>!e.lineage?.length||e.lineage.some(e=>e!==`created_from`),Wp=class extends N{constructor(){super(),new Fr(this)}createRenderRoot(){return this}render(){return new Date().toLocaleTimeString(An(),{hour12:!1})}};Wp=U([P(`ca-clock`),O()],Wp);var Gp=()=>D(`Runs`,{id:`col-runs`}),Kp=class extends N{constructor(...e){super(...e),this.hosts=null}static{this.styles=[V,k` :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 A`<tr>
|
|
895
912
|
<th scope="row">${e.host_id}</th>
|
|
896
|
-
<td data-label=${
|
|
897
|
-
<td data-label=${
|
|
898
|
-
<td data-label=${
|
|
899
|
-
<td data-label=${
|
|
900
|
-
</tr>`;var n}render(){let e=this.hosts?.hosts??[],t=this.hosts?.quota??[];return
|
|
913
|
+
<td data-label=${D(`Status`)}>${Qr({text:sc(e),tone:t?`attention`:`done`})}</td>
|
|
914
|
+
<td data-label=${D(`Last report`)} class="num" title=${e.last_seen}>${G(e.last_seen,!0)||`—`}</td>
|
|
915
|
+
<td data-label=${D(`Report interval`)} class="num">${e.interval_s==null?`—`:B(e.interval_s)}</td>
|
|
916
|
+
<td data-label=${Gp()} class="runs" ><span>${uc(e.runs)}${e.running?A` | ${D(E`${e.running} running`)}`:M}${e.unresponsive?A` | <span class="tone-text" data-tone="attention">${n=e.unresponsive,D(E`${n} with no report from host`)}</span>`:M}</span></td >
|
|
917
|
+
</tr>`;var n}render(){let e=this.hosts?.hosts??[],t=this.hosts?.quota??[];return A`<div class="g12">
|
|
901
918
|
<section class="panel c12 enter">
|
|
902
|
-
<h3>${
|
|
903
|
-
${e.length?
|
|
919
|
+
<h3>${D(`Hosts`)}<span class="r">${dc(e)}</span></h3>
|
|
920
|
+
${e.length?A`<table>
|
|
904
921
|
<thead><tr>
|
|
905
|
-
<th scope="col">${
|
|
906
|
-
<th scope="col">${
|
|
922
|
+
<th scope="col">${D(`Host`)}</th><th scope="col">${D(`Status`)}</th><th scope="col">${D(`Last report`)}</th>
|
|
923
|
+
<th scope="col">${D(`Report interval`)}</th><th scope="col">${Gp()}</th>
|
|
907
924
|
</tr></thead>
|
|
908
925
|
<tbody>${e.map(e=>this.row(e))}</tbody>
|
|
909
|
-
</table>`:
|
|
926
|
+
</table>`:A`<div class="meta">${D(`No hosts`)}</div>`}
|
|
910
927
|
</section>
|
|
911
|
-
${t.length?
|
|
912
|
-
<h3 title=${
|
|
913
|
-
${
|
|
928
|
+
${t.length?A`<section class="panel c12 enter">
|
|
929
|
+
<h3 title=${D(`Account-wide | read at each agent session start`)}>
|
|
930
|
+
${D(`Subscription usage`)}<span class="r">${D(`Per account, first → last reading`)}</span></h3>
|
|
914
931
|
<ca-quota .accounts=${t} .rests=${t.flatMap(e=>e.rests??[])} live></ca-quota>
|
|
915
|
-
</section>`:
|
|
916
|
-
</div>`}};U([
|
|
917
|
-
${this.hub?
|
|
932
|
+
</section>`:M}
|
|
933
|
+
</div>`}};U([F({attribute:!1})],Kp.prototype,`hosts`,void 0),Kp=U([P(`ca-hosts`),O()],Kp);var qp=e=>`run-${e}`,Jp=class extends N{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,k` :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`,D(`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 oe(t,this.hosts).map(({hostId:e,host:t,runs:n})=>{let r=e||lc(``),i=t?(e=>!e.up&&e.last_seen?D(E`no report since ${G(e.last_seen,!0)}`):sc(e))(t):``,a=uc(n.length);return[K(r,i,a),A`<b>${r}</b>${t?Qr({text:i,tone:t.up?`done`:`attention`,title:cc(t)}):M}<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[[D(`Running`),t.filter(e=>e.running)],[D(`Last 24 hours`),t.filter(e=>!e.running&&!n(e))],[D(`Older`),t.filter(n)]].map(([e,t])=>[e,A`${e} <span class="n">${t.length}</span>`,t])}pick(e){this.close(),typeof e==`string`?e!==this.page&&$(this,`ca-navigate`,{page:e,run:``}):(e.run!==this.current||this.page)&&$(this,`ca-select-run`,{run:e.run})}close(){$(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?M:qp(this.kb),a=A`<input placeholder=${D(`Search runs`)} aria-label=${D(`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 A`<div class="search" @keydown=${e=>this.onDialogKey(e)}>
|
|
934
|
+
${this.hub?A`<div class="row">${a}${this.hostFilter()}</div>`:a}
|
|
918
935
|
<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
936
|
</div>
|
|
920
937
|
<div class="list" @mousedown=${e=>e.preventDefault()}>
|
|
921
|
-
${r.length?
|
|
938
|
+
${r.length?A`<div id="runs" role="listbox" aria-label=${D(`Runs`)}>
|
|
922
939
|
${n.map(e=>this.item(e,o++))}
|
|
923
|
-
${e.map(([e,t,n])=>
|
|
940
|
+
${e.map(([e,t,n])=>A`<div role="group" aria-label=${e}>
|
|
924
941
|
<div class="group${this.hub?` host`:``}" aria-hidden="true">${t}</div>
|
|
925
942
|
${n.map(e=>this.item(e,o++))}
|
|
926
943
|
</div>`)}
|
|
927
|
-
</div>`:
|
|
928
|
-
</div>`}hostFilter(){return
|
|
929
|
-
<option value="" ?selected=${!this.host}>${
|
|
930
|
-
${
|
|
931
|
-
</select>`}counts(e){let t=e.tasks,n=[E
|
|
932
|
-
${typeof e==`string`?n===`hosts`?
|
|
944
|
+
</div>`:A`<div class="blank"><span>${D(`No runs match the search`)}</span></div>`}
|
|
945
|
+
</div>`}hostFilter(){return A`<select aria-label=${D(`Host`)} title=${D(`Host`)} @change=${e=>{this.host=e.target.value,this.kb=-1}}>
|
|
946
|
+
<option value="" ?selected=${!this.host}>${D(`All hosts`)}</option>
|
|
947
|
+
${oe(this.runs,this.hosts).map(e=>A`<option value=${e.hostId} ?selected=${e.hostId===this.host}>${e.hostId||lc(``)}</option>`)}
|
|
948
|
+
</select>`}counts(e){let t=e.tasks,n=[D(E`${t.done} of ${t.total} tasks done`)];t.failed&&n.push(Z(`failed`,t.failed)),t.not_started&&n.push(Z(`not_started`,t.not_started)),t.partial&&n.push(Z(`partial`,t.partial)),t.skipped&&n.push(Z(`skipped`,t.skipped)),t.cancelled&&n.push(Z(`cancelled`,t.cancelled)),t.running&&n.push(Z(`running`,t.running)),t.waiting&&n.push(Z(`waiting`,t.waiting)),t.not_run&&n.push(Z(`not_run`,t.not_run));let r=(e=>te(e))(e);r!=null&&n.push(D(E`took ${B(r)}`)),e.cost_usd!==null&&e.cost_usd!==void 0&&n.push(X(e.cost_usd));let i=Ps(e.quota??[]);return i&&n.push(i),K(...n)}when(e){let t=ne(e),n=G(e.last_ts,!0),r=t===`unresponsive`;return A`<span class="when" data-tone=${r?`attention`:M} data-mark=${r?`pending`:M} title=${r?K(cc(re(this.hosts,e)),D(E`Last activity ${n}`)):n} >${t===`running`?D(`running`):r?oc():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 A`<div class=${`item${r?` cur`:``}${t===this.kb?` kb`:``}`} id=${qp(t)} role="option" aria-selected=${t===this.kb?`true`:`false`} aria-current=${r?n?`page`:`true`:M} @click=${()=>this.pick(e)}>
|
|
949
|
+
${typeof e==`string`?n===`hosts`?A`<span aria-hidden="true">⊞</span><span class="nm">${D(`Hosts`)}</span><span class="when page">${dc(this.hosts)}</span>`:A`<span aria-hidden="true">▥</span><span class="nm">${Ac()}</span><span class="when page">${jc()}</span>`:A`<span class="dot" data-tone=${L(ss(ne(e),e.tasks))} aria-hidden="true"></span><span class="nm" title=${this.hub?e.run:M}>${this.hub?ie(e):e.run}${ac(e)?A` ${Zr({...ac(e),tone:`muted`})}`:M}</span>
|
|
933
950
|
${this.when(e)}
|
|
934
951
|
<span class="sub">
|
|
935
|
-
${e.run_group&&e.run_group!==
|
|
952
|
+
${e.run_group&&e.run_group!==ie(e)?A`<span>${D(E`Run group ${e.run_group}`)}</span>`:M} <span title=${Fs(e.quota??[])}>${this.counts(e)}</span>
|
|
936
953
|
</span>`}
|
|
937
|
-
</div>`}};function
|
|
938
|
-
${n}<span>${
|
|
939
|
-
</button>`}render(){let e=hr.filter(e=>e===`system`||!gr.includes(e));return
|
|
954
|
+
</div>`}};function Yp(e){return e===`system`?D(`System`):e===`high-contrast`?D(`High contrast`):vr[e].label}U([F({attribute:!1})],Jp.prototype,`runs`,void 0),U([F()],Jp.prototype,`current`,void 0),U([F({type:Boolean,reflect:!0})],Jp.prototype,`open`,void 0),U([F({type:Boolean})],Jp.prototype,`hub`,void 0),U([F({attribute:!1})],Jp.prototype,`hosts`,void 0),U([F()],Jp.prototype,`page`,void 0),U([I()],Jp.prototype,`q`,void 0),U([I()],Jp.prototype,`host`,void 0),U([I()],Jp.prototype,`kb`,void 0),U([bn(`input`)],Jp.prototype,`input`,void 0),U([bn(`select`)],Jp.prototype,`select`,void 0),Jp=U([P(`ca-run-picker`),O()],Jp);var Xp=class extends N{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,k` :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,$(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`?A`<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 A`<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 A`<button type="button" class="item" role="menuitemradio" aria-checked=${t?`true`:`false`} tabindex="-1" data-theme=${e} @click=${()=>this.choose(e)}>
|
|
955
|
+
${n}<span>${Yp(e)}${e===`system`?A`<span class="meta sub">${vr[this.system].label}</span>`:M}</span><span class="rd" aria-hidden="true"></span>
|
|
956
|
+
</button>`}render(){let e=hr.filter(e=>e===`system`||!gr.includes(e));return A`<button type="button" class="trig" aria-haspopup="menu" aria-expanded=${this.open?`true`:`false`} aria-controls="menu" title=${D(E`Theme: ${Yp(this.value)}`)} @click=${()=>this.open=!this.open} @keydown=${e=>this.onTrigKey(e)}>
|
|
940
957
|
<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
|
-
${
|
|
958
|
+
${D(`Theme`)}
|
|
942
959
|
</button>
|
|
943
|
-
${this.open?
|
|
960
|
+
${this.open?A`<div id="menu" class="menu" role="menu" aria-label=${D(`Theme`)} @keydown=${e=>this.onMenuKey(e)}>
|
|
944
961
|
${e.map(e=>this.item(e))}
|
|
945
962
|
<div role="separator"></div>
|
|
946
963
|
<div role="group" aria-labelledby="grp-editor">
|
|
947
|
-
<div class="grp" id="grp-editor">${
|
|
964
|
+
<div class="grp" id="grp-editor">${D(`Editor themes`)}</div>
|
|
948
965
|
${gr.map(e=>this.item(e))}
|
|
949
966
|
</div>
|
|
950
|
-
</div>`:
|
|
967
|
+
</div>`:M}`}};U([F()],Xp.prototype,`value`,void 0),U([F()],Xp.prototype,`system`,void 0),U([I()],Xp.prototype,`open`,void 0),U([bn(`.trig`)],Xp.prototype,`trig`,void 0),Xp=U([P(`ca-theme-switch`),O()],Xp);var Zp=e=>(e.input??0)+(e.output??0)+(e.cache_read??0)+(e.cache_creation??0);function Qp(e,t){if(!e.totals.runs)return[];let n=Fc(),r=e.period.days.map(e=>Mc(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=Ts(r)||r||`—`;return n&&(t.get(r)?.size??0)>1?`${i} | ${As(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)}%`:`—`,D(E`Done ${l}`)),...o.partial?[Z(`partial`,o.partial)]:[]]]},{id:`cost`,label:n.cost,value:o.cost_usd==null?`—`:X(o.cost_usd),sub:s&&o.cost_usd!=null?[[(c=X(o.cost_usd/s),D(E`${c} a day`))]]:[]},{id:`tokens`,label:n.tokens,value:Y(Zp(o.tokens)),sub:[[`${n.input} ${Y(o.tokens.input)} | ${n.output} ${Y(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:Zp(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`,Ic(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:Vc(),align:`end`,format:`tokens`,tip:Hc()}]:[]],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:Rc(a(e.credential,e.account),ks(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:Q(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:Qc(),columns:[{id:`part`,label:D(`Stopped part`),tip:el()},{id:`model`,label:n.model},{id:`count`,label:Qc(),align:`end`,format:`number`,bar:!0},{id:`kinds`,label:n.kinds}],rows:e.safety_stops.map(e=>({part:tl(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:Ic(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`?Lc(e.reason):Us({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`?D(`ended`):t===`start`?D(`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:Pc(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 $p=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`;function em(e,t){let n=new Date(`${e}T00:00:00Z`);return n.setUTCDate(n.getUTCDate()-t),n.toISOString().slice(0,10)}function tm(e,t=new Date){let n=e.tz||$p();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:em(r,Math.max(1,e.days)-1),to:r}})(),tz:n,...e.group?{run_group:e.group}:{}}}var nm=e=>[``,...new Set(e.filter(e=>e.scope===`trends`&&e.tab).map(e=>e.tab))],rm=class extends N{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,k` :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){$(this,`ca-navigate`,e)}render(){let e=this.view,t=this.panels.filter(e=>e.scope===`trends`),n=nm(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 A`<h2 class="sr">${Ac()}</h2>
|
|
951
968
|
${this.controls()}
|
|
952
|
-
${e?.error?
|
|
953
|
-
${n.length>1?
|
|
954
|
-
${e.map((e,n)=>
|
|
955
|
-
</div>`}updated(){let e=
|
|
956
|
-
${n&&!r.length?
|
|
957
|
-
${H(s,e=>e.id,e=>
|
|
958
|
-
${a.length?
|
|
959
|
-
${H(c,e=>e.id,e=>
|
|
960
|
-
${this.trendPanels(e,t?.panels??{},!0)}`}controls(){let e=this.view?.data,t=e?
|
|
961
|
-
<cae-segmented label=${
|
|
962
|
-
${this.days===0?
|
|
963
|
-
<label>${
|
|
964
|
-
<label>${
|
|
969
|
+
${e?.error?A`<p class="err" role="alert">${D(`No answer from the monitor`)} | ${e.error.message}</p>`:M}
|
|
970
|
+
${n.length>1?A`${this.tabList(n,r)}<div role="tabpanel" id="trends-tabpanel" aria-labelledby=${`trends-tab-${n.indexOf(r)}`}>${a}</div>`:a}`}tabList(e,t){return A`<div class="tabs" role="tablist" aria-label=${Ac()}>
|
|
971
|
+
${e.map((e,n)=>A`<button type="button" role="tab" class="tab" id=${`trends-tab-${n}`} aria-selected=${e===t?`true`:`false`} aria-controls="trends-tabpanel" @click=${()=>e!==t&&$(this,`ca-navigate`,{trendsTab:e})}>${e||D(`Summary`)}</button>`)}
|
|
972
|
+
</div>`}updated(){let e=nm(this.panels);this.tabFocus.set(Math.max(0,e.indexOf(this.tab)))}trends(e){let t=this.view,n=t?.data??null,r=n?Qp(n,An()):[],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)=>A`<section class="panel" data-section=${t}><ca-panel-body .body=${e}></ca-panel-body></section>`;return A`${!n&&t?.loading?A`<p class="loading">${D(`Loading…`)}</p>`:M}
|
|
973
|
+
${n&&!r.length?A`<div class="blank small"><span>${D(`No runs in this period`)}</span></div>`:M}
|
|
974
|
+
${H(s,e=>e.id,e=>A`<div class="wide">${l(e.body,e.id)}</div>`)}
|
|
975
|
+
${a.length?A`<div class="pairs">${H(a,e=>e.id,e=>l(e.body,e.id))}</div>`:M}
|
|
976
|
+
${H(c,e=>e.id,e=>A`<div class="wide">${l(e.body,e.id)}</div>`)}
|
|
977
|
+
${this.trendPanels(e,t?.panels??{},!0)}`}controls(){let e=this.view?.data,t=e?A`<span class="period">${function(e,t,n,r=An()){let i=t.slice(0,4);return D(E`${Mc(e,r)} to ${Mc(t,r)}, ${i} | ${n}`)}(e.period.from,e.period.to,e.period.tz)}</span>`:M;if(this.exported)return A`<div class="controls"><span class="meta">${D(`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 A`<div class="controls">
|
|
978
|
+
<cae-segmented label=${D(`Period`)} .value=${n} .options=${[...nr.map(e=>({value:String(e),label:Nc(e)})),{value:`dates`,label:D(`Dates`)}]} @cae-change=${e=>e.detail.value===`dates`?this.go({days:0,from:this.from||em(r,(this.days||14)-1),to:this.to||r}):this.go({days:Number(e.detail.value),from:``,to:``})}></cae-segmented>
|
|
979
|
+
${this.days===0?A`<label>${D(`From`)} <input type="date" .value=${this.from} max=${this.to||M} @change=${e=>this.go({days:0,from:e.target.value,to:this.to})} /></label>
|
|
980
|
+
<label>${D(`To`)} <input type="date" .value=${this.to} min=${this.from||M} @change=${e=>this.go({days:0,from:this.from,to:e.target.value})} /></label>`:M}
|
|
981
|
+
<label>${D(`Time zone`)}
|
|
965
982
|
<select @change=${e=>this.go({tz:e.target.value})}>
|
|
966
|
-
${i.map(e=>
|
|
983
|
+
${i.map(e=>A`<option value=${e} ?selected=${e===(this.tz||i[0])}>${e}</option>`)}
|
|
967
984
|
</select></label>
|
|
968
|
-
${this.groups.length>1?
|
|
985
|
+
${this.groups.length>1?A`<label>${D(`Run group`)}
|
|
969
986
|
<select @change=${e=>this.go({group:e.target.value})}>
|
|
970
|
-
<option value="" ?selected=${!this.group}>${
|
|
971
|
-
${this.groups.map(e=>
|
|
972
|
-
</select></label>`:
|
|
987
|
+
<option value="" ?selected=${!this.group}>${D(`All run groups`)}</option>
|
|
988
|
+
${this.groups.map(e=>A`<option value=${e} ?selected=${e===this.group}>${e}</option>`)}
|
|
989
|
+
</select></label>`:M}
|
|
973
990
|
${t}
|
|
974
|
-
${this.view?.loading&&e?
|
|
975
|
-
</div>`}trendPanels(e,t,n){return e.length?
|
|
976
|
-
${e.map(e=>
|
|
977
|
-
<h3>${e.icon} ${e.title||e.name}${e.description?
|
|
978
|
-
${t[e.name]?
|
|
979
|
-
</section>`)}`:
|
|
991
|
+
${this.view?.loading&&e?A`<span class="loading" aria-live="polite">${D(`Loading…`)}</span>`:M}
|
|
992
|
+
</div>`}trendPanels(e,t,n){return e.length?A`${n?A`<h3 class="sect-h">${Fc().trendPanels}</h3>`:M}
|
|
993
|
+
${e.map(e=>A`<section class="panel wide" data-panel=${e.name}>
|
|
994
|
+
<h3>${e.icon} ${e.title||e.name}${e.description?A`<span class="r">${e.description}</span>`:M}</h3>
|
|
995
|
+
${t[e.name]?A`<ca-panel-body .body=${t[e.name]}></ca-panel-body>`:A`<p class="loading">${D(`Loading…`)}</p>`}
|
|
996
|
+
</section>`)}`:M}};U([F({attribute:!1})],rm.prototype,`view`,void 0),U([F({type:Number})],rm.prototype,`days`,void 0),U([F()],rm.prototype,`from`,void 0),U([F()],rm.prototype,`to`,void 0),U([F()],rm.prototype,`tz`,void 0),U([F()],rm.prototype,`group`,void 0),U([F({attribute:!1})],rm.prototype,`groups`,void 0),U([F({attribute:!1})],rm.prototype,`panels`,void 0),U([F({type:Boolean})],rm.prototype,`exported`,void 0),U([F()],rm.prototype,`tab`,void 0),rm=U([P(`ca-trends`),O()],rm);var im=class extends N{static{this.styles=[Dr,V,yl,hl]}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=kn(),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/${ye(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/${ye(be(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/${ye(be(t))}.json`)),panel:(e,t)=>o(s(e,`panels/${ye(t)}.json`)),trends:()=>o(`trends.json`),trendsPanel:e=>o(`trends/panels/${ye(e)}.json`)}}(new URL(this.exportUrl,this.ownerDocument.baseURI).href);this.store=new ve({client:e,openRunFeed:Se(e),runsEveryMs:0})}else this.store=new ve({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(...fl(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(dl(e.error)),this.snap=e,this.live=de(e.state,ue(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(tm(n))===JSON.stringify(tm(e));e.page===`trends`?r||this.store.loadTrends(tm(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=gl(this.snap.info.panels)[Number(e.key)-1];t&&this.navigate({tab:t.id})}}selectedTab(){return gl(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=D(E`${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())),vl(this.renderRoot),this.main&&this.mainScroll.attach(this.main),this.pendingScroll&&=(this.pendingScroll===`push`?this.mainScroll.reset():this.mainScroll.restore(),null),this.snap&&this.viewRoute&&this.mainScroll.update(this.complete())}complete(){let{snap:e,viewRoute:t}=this;return t.page===`hosts`?e.hosts!==null:t.page===`trends`?!!e.trends?.data&&!e.trends.loading:e.run===t.run&&e.state.ready}observeNav(){let e=this.renderRoot.querySelector(`nav`);e&&typeof ResizeObserver<`u`&&this.navObserved!==e&&(this.navObserver?this.navObserver.disconnect():this.navObserver=new ResizeObserver(()=>vl(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 M;let{snap:e,viewRoute:t}=this,n=fe(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 A`
|
|
980
997
|
<header>
|
|
981
|
-
${u=e.info.title,
|
|
998
|
+
${u=e.info.title,A`<div class="brand">
|
|
982
999
|
<svg viewBox="12 12 96 96" aria-hidden="true">
|
|
983
1000
|
<defs>
|
|
984
1001
|
<linearGradient id="brand-spark" x1="0" y1="0" x2="1" y2="1">
|
|
@@ -996,43 +1013,43 @@ ${u=e.info.title,k`<div class="brand">
|
|
|
996
1013
|
</svg>
|
|
997
1014
|
<span title=${u}>${u}</span>
|
|
998
1015
|
</div>`}
|
|
999
|
-
<button type="button" class="runbtn" title=${
|
|
1016
|
+
<button type="button" class="runbtn" title=${D(a?`Switch run (r)`:`Switch run`)} aria-haspopup="dialog" aria-expanded=${this.pickerOpen?`true`:`false`} @click=${()=>this.pickerOpen=!this.pickerOpen}>
|
|
1000
1017
|
${s?this.hostsLabel():c?this.trendsLabel():this.runLabel(o,r)}
|
|
1001
1018
|
<span class="chev" aria-hidden="true">▾</span>
|
|
1002
1019
|
</button>
|
|
1003
1020
|
<div class="hdr-right">
|
|
1004
|
-
${((e,t)=>
|
|
1021
|
+
${((e,t)=>A`<span class="nowline">${t.length?D(A`Running ${t.slice(0,3).map(t=>bl(e,J(t),{key:t.key}))}${t.length>3?A` <span>+${t.length-3}</span>`:M}`):M}</span>`)(this,n)}
|
|
1005
1022
|
<ca-theme-switch .value=${this.themes.choice} .system=${this.themes.system}></ca-theme-switch>
|
|
1006
|
-
${this.locales?
|
|
1007
|
-
${e.info.export?Zr({text:
|
|
1023
|
+
${this.locales?A`<cae-segmented class="langs" label=${D(`Language`)} .value=${An()} .options=${En.map(e=>({value:e,label:Dn[e],lang:e}))} @cae-change=${e=>Nn(e.detail.value)&&this.pickLocale(e.detail.value)}></cae-segmented>`:M}
|
|
1024
|
+
${e.info.export?Zr({text:Ec(e.info.export),tone:`muted`,title:Oc(e.info.export)}):(e=>{let t=D(e?`Connected to the monitor server`:`Not connected to the monitor server`);return A`<span role="img" aria-label=${t} title=${t}><span class="live-dot ${e?``:`off`}"></span></span>`})(e.connected)}
|
|
1008
1025
|
<ca-clock class="clock"></ca-clock>
|
|
1009
1026
|
</div>
|
|
1010
1027
|
<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
1028
|
</header>
|
|
1012
|
-
${s?
|
|
1013
|
-
<main id="main" class=${t.tab===`stream`?`stream`:``} role="tabpanel" aria-labelledby=${i>=0?
|
|
1029
|
+
${s?A`${this.renderApiError()}<main id="main"><ca-hosts .hosts=${e.hosts}></ca-hosts></main>`:c?A`${this.renderApiError()}<main id="main"><ca-trends .view=${e.trends} days=${t.days} from=${t.from} to=${t.to} tz=${t.tz||$p()} 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>`:A`${this.renderTabs(r,n.length)} ${this.renderBar(r)} ${this.renderApiError()}
|
|
1030
|
+
<main id="main" class=${t.tab===`stream`?`stream`:``} role="tabpanel" aria-labelledby=${i>=0?_l(i):M} >${function({snap:e,viewRoute:t,derived:n,q:r,client:i,baseUrl:a}){let{state:o}=e;if(!t.run)return A`<div class="blank">${e.runsLoaded&&!e.error?A`<span class="ic" aria-hidden="true">✦</span><b>${D(`No runs yet`,{id:`no-runs-yet`})}</b>`:M}</div>`;let s=ue(e.runs,e.run),c=de(o,s);switch(t.tab){case`overview`:return A`<ca-overview .state=${o} .summary=${s} .host=${re(e.hosts?.hosts,s)} .info=${e.info} .run=${t.run} .layer=${t.layer} .unit=${t.unit} .sel=${t.sel}></ca-overview>`;case`tasks`:return A`<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 A`<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=${nc(s)}></ca-journal-table>`;case`outputs`:return A`<ca-contracts .run=${t.run} .outputs=${o.outputs} .journal=${o.journal} .plan=${o.plan}></ca-contracts>`;case`definitions`:return A`<ca-definitions .client=${i} .run=${t.run} .journal=${o.journal} .plan=${o.plan} .live=${c} .selected=${t.def}></ca-definitions>`;case`procs`:return A`<ca-procs-view .procs=${o.procs} ?unresponsive=${ne(s,!!o.procs?.alive)===`unresponsive`} ?exported=${!!e.info.export}></ca-procs-view>`;case`stream`:return A`<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=${nc(s)}></ca-task-view>`;default:{let n=t.tab.slice(6);return A`<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
1031
|
<ca-toasts></ca-toasts>
|
|
1015
|
-
`;var l,u}runLabel(e,t){let{snap:n,viewRoute:r}=this,i=
|
|
1016
|
-
<span class="rn" title=${s?r.run:
|
|
1017
|
-
${s?
|
|
1018
|
-
${a===`unresponsive`?Zr({text:
|
|
1019
|
-
${
|
|
1020
|
-
<span class="rs" title=${i?
|
|
1021
|
-
<span class="rn">${
|
|
1022
|
-
<div class="tabs" role="tablist" aria-label=${
|
|
1023
|
-
${e.map((a,o)=>{let s=n(a.id),c=a.id===t;return
|
|
1024
|
-
<button type="button" role="tab" id=${
|
|
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]!==``?
|
|
1032
|
+
`;var l,u}runLabel(e,t){let{snap:n,viewRoute:r}=this,i=ue(n.runs,n.run),a=ne(i,!!n.state.procs?.alive),o=ss(a,i?.tasks),s=e?i?.host_id??``:``;return A`<span class="dot" data-tone=${L(o)} aria-hidden="true"></span>
|
|
1033
|
+
<span class="rn" title=${s?r.run:M}>${i&&s?ie(i):r.run||`—`}</span>
|
|
1034
|
+
${s?A`<span class="hostchip" title=${lc(s)}><span class="sr">${lc(s)}</span><span aria-hidden="true">${s}</span></span>`:M}
|
|
1035
|
+
${a===`unresponsive`?Zr({text:oc(),tone:`attention`,title:cc(re(n.hosts?.hosts,i))}):M}
|
|
1036
|
+
${ac(i)?Zr({...ac(i),tone:`muted`}):M}
|
|
1037
|
+
<span class="rs" title=${i?Fs(ec(n.state,i)):``}>${i?function(e,t,n=S(e.journal,e.plan)){let r=te(t),i=e.ready?Ee(e.journal)?.cost:t.cost_usd,a=i==null?``:X(i),o=Ps(ec(e,t)),s=K(r==null?``:D(E`took ${B(r)}`),a,o,t.running?D(`running`):``);if(!e.ready)return s;let c=n.counts,l=t.tasks.not_run?Z(`not_run`,t.tasks.not_run):``;return K(D(E`${c.doneTotal} of ${c.total} tasks done`),l,s)}(n.state,i,t):``}</span>`}trendsLabel(){return A`<span class="dot" data-tone="neutral" aria-hidden="true"></span><span class="rn">${Ac()}</span><span class="rs">${jc()}</span>`}hostsLabel(){let e=this.snap.hosts?.hosts??[];return A`<span class="dot" data-tone=${L(e.some(e=>!e.up)?`attention`:`neutral`)} aria-hidden="true"></span>
|
|
1038
|
+
<span class="rn">${D(`Hosts`)}</span><span class="rs">${dc(e)}</span>`}renderApiError(){let{error:e}=this.snap;return A`<p class="api-error" role="alert">${e?A`<span class="ic" aria-hidden="true">✕</span> ${dl(e)}`:M}</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 A`<nav data-scroll="x">
|
|
1039
|
+
<div class="tabs" role="tablist" aria-label=${D(`Views`)}>
|
|
1040
|
+
${e.map((a,o)=>{let s=n(a.id),c=a.id===t;return A`${a.panel&&!e[o-1]?.panel?A`<span class="tab-sep" aria-hidden="true" title=${D(`Custom views`)}></span>`:M}
|
|
1041
|
+
<button type="button" role="tab" id=${_l(o)} aria-selected=${c?`true`:`false`} aria-controls=${i} class="tab ${a.panel?`panel-tab`:``} ${c?`sel`:``}" title=${a.tip??M} @click=${()=>r(a.id)}>
|
|
1042
|
+
<span class="tab-ic" aria-hidden="true">${a.icon}</span><span class="tab-label" data-label=${a.label}>${a.label}</span>${s&&s[0]!==``?A`<span class="badge" data-tone=${L(s[1])}>${s[0]}</span>`:M}
|
|
1026
1043
|
</button>`})}
|
|
1027
1044
|
</div>
|
|
1028
1045
|
<span class="tab-ind init" aria-hidden="true"></span>
|
|
1029
|
-
${a?
|
|
1030
|
-
<span class="kbd">r</span> ${
|
|
1031
|
-
</nav>`}(
|
|
1032
|
-
<select title=${
|
|
1033
|
-
<option value="" ?selected=${!t.kind}>${
|
|
1034
|
-
${r.map(e=>
|
|
1046
|
+
${a?A`<span class="tabhint meta" role="note" aria-label=${D(`Keyboard shortcuts`)} ><span aria-hidden="true"><span class="kbd">1</span>–<span class="kbd">${Math.min(9,e.length)}</span> ${D(`Tabs`)} |
|
|
1047
|
+
<span class="kbd">r</span> ${D(`Runs`)} | <span class="kbd">/</span> ${D(`Filter`)}</span></span >`:M}
|
|
1048
|
+
</nav>`}(gl(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 M;let{counts:n,kinds:r}=e,i=n.total;return A`<div class="bar">
|
|
1049
|
+
<select title=${D(`Kind`)} aria-label=${D(`Kind`)} @change=${e=>this.navigate({kind:e.target.value})}>
|
|
1050
|
+
<option value="" ?selected=${!t.kind}>${D(`All kinds`)}</option>
|
|
1051
|
+
${r.map(e=>A`<option ?selected=${e===t.kind}>${e}</option>`)}
|
|
1035
1052
|
</select>
|
|
1036
|
-
<input placeholder=${
|
|
1037
|
-
<span class="meta">${t.tab===`journal`?function({tries:e,notStarted:t}){return K(
|
|
1038
|
-
</div>`}};U([
|
|
1053
|
+
<input placeholder=${D(`Filter`)} aria-label=${D(`Text filter`)} size="22" title=${this.shortcutScope===`off`?D(`Text filter`):D(`Text filter (/)`)} .value=${this.qDraft??t.q} @input=${e=>this.setQ(e.target.value)} />
|
|
1054
|
+
<span class="meta">${t.tab===`journal`?function({tries:e,notStarted:t}){return K(D(e===1?`1 attempt`:E`${e} attempts`),t?Z(`not_started`,t):``)}(e.tries):D(i===1?`1 task`:E`${i} tasks`)}</span>
|
|
1055
|
+
</div>`}};U([F({attribute:`base-url`})],im.prototype,`baseUrl`,void 0),U([F({attribute:`export`})],im.prototype,`exportUrl`,void 0),U([F()],im.prototype,`history`,void 0),U([F()],im.prototype,`shortcuts`,void 0),U([F()],im.prototype,`run`,void 0),U([F()],im.prototype,`locale`,void 0),U([F()],im.prototype,`theme`,void 0),U([F({type:Boolean,reflect:!0})],im.prototype,`live`,void 0),U([I()],im.prototype,`snap`,void 0),U([I()],im.prototype,`viewRoute`,void 0),U([I()],im.prototype,`pickerOpen`,void 0),U([I()],im.prototype,`qDraft`,void 0),U([bn(`main`)],im.prototype,`main`,void 0),U([bn(`ca-toasts`)],im.prototype,`toasts`,void 0),U([bn(`.runbtn`)],im.prototype,`runBtn`,void 0),U([bn(`ca-run-picker`)],im.prototype,`picker`,void 0),im=U([P(`ca-monitor`),O()],im);export{er as BUILTIN_TABS,Wp as CaClock,If as CaContracts,Bf as CaDefinition,Vf as CaDefinitions,Kp as CaHosts,Af as CaJournalTable,Gl as CaKpis,tu as CaModelUsage,im as CaMonitor,pf as CaOverview,Jf as CaPanelBody,Yf as CaPanelView,Xd as CaPipelineGraph,Ll as CaProcTree,Hf as CaProcsView,nu as CaQuota,tf as CaRunDriver,Jp as CaRunPicker,iu as CaServices,ql as CaSpendBreakdown,Ef as CaTaskTable,Hp as CaTaskView,cf as CaTimeline,ml as CaToasts,Ep as CaTranscript,lf as CaWorkers,rr as DEFAULT_VIEW_ROUTE,Dn as LOCALE_NAMES,au as LOOP_SEGMENT,Yl as OTHER_COLOUR,Jl as SERIES_COLOURS,tr as TASK_VIEWS,nf as TIMELINE_WINDOW_MS,nr as TREND_DAYS,ur as ViewRouter,ap as agentLabel,En as allLocales,cr as applyPatch,Cp as applyTranscriptEvents,Sf as attemptFacts,Ad as autoLayer,Wd as budgetFor,tp as checkMessage,ep as checkName,Tl as checkRowsFromContract,El as checkTableStrings,Fn as chooseLocale,Ku as chooseOpen,$f as classifyRounds,Ju as compound,kn as configureLocales,wl as contentObject,Mf as ctChips,Gu as doi,$ as emit,gp as emptyTranscript,jr as esc,$u as expectedByNode,Qo as factList,K as facts,bf as filterJournal,mf as filterTasks,es as firstLine,Zf as fixupErrors,B as fmtDur,td as forecastShown,sr as formatViewRoute,An as getLocale,Ed as graphFromPlan,Td as graphInput,yf as hadFixup,Uu as interest,Qf as isFixup,lr as isNewPlace,Of as journalColumns,xf as journalTally,J as kindUnit,zl as kpiAction,Ul as kpiTiles,Rl as kpis,af as laneStyles,sf as lanesFromJournal,sp as launchWho,kd as layerGraph,q as listText,G as localTime,id as markSel,Od as matrixFromPlan,Dd as matrixInput,Zl as modelColours,Xl as modelId,$l as modelRows,ed as notInPlan,Wu as notable,Nd as parentLayer,ad as parseSelection,or as parseViewRoute,nd as passMatrix,Bu as placeKey,Hu as placeStats,Pn as preferredLocale,$d as preflightRows,Xo as relAgo,Md as resolveLayer,vf as retriedKeys,Sl as rootOf,Cl as rowOf,fl as rowToast,Zo as sentence,jn as setLocale,Ql as shareParts,Df as shortStop,rd as sortPassRows,gf as sortTasks,Gd as spanFor,jd as splitLayer,wf as taskColumns,Pf as taskName,cd as taskStateStyles,Y as tokenCount,Kd as tooWide,qu as towardOf,dp as transcriptSections,Qp as trendSections,xl as typeOk,rs as unreadEvents,ts as usageUnknown,ns as usageUnknownWords,X as usd,hp as webResults,cp as whoTags};
|