@coreplane/switchboard 1.234.0 → 1.235.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/deploy/cloudflare-resident/gc.ts +6 -9
- package/dist/assets/deploy/cloudflare-resident/worker.ts +125 -78
- package/dist/assets/deploy/cloudflare-sandbox/worker.ts +82 -13
- package/dist/assets/package-lock.json +3 -3
- package/dist/assets/package.json +1 -1
- package/dist/assets/source.json +3 -3
- package/dist/assets/src/core/runEvents.ts +7 -0
- package/dist/assets/src/execution/residentCleanliness.ts +24 -0
- package/dist/assets/src/execution/residentDiskBudget.ts +7 -6
- package/dist/assets/src/execution/sandboxErrors.ts +5 -0
- package/dist/assets/src/execution/sandboxIdle.ts +220 -0
- package/dist/assets/web/dist/.vite/manifest.json +26 -25
- package/dist/assets/web/dist/assets/{ResidentDetailPage-C_WNBUao.js → ResidentDetailPage-DSpsye5e.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentsIndexPage-D1sTyaZ_.js → ResidentsIndexPage-CT8fI1M3.js} +1 -1
- package/dist/assets/web/dist/assets/RunFoldRow-Cqh8pTXC.js +9 -0
- package/dist/assets/web/dist/assets/RunRoutePage-oN9GkVEA.js +6 -0
- package/dist/assets/web/dist/assets/{RunsIndexPage-H6GkSv0a.js → RunsIndexPage-sjXr8iCV.js} +1 -1
- package/dist/assets/web/dist/assets/{ScheduledPage-BLcPzm1S.js → ScheduledPage-Tz__zLzi.js} +1 -1
- package/dist/assets/web/dist/assets/{StatusDot-Ct6AtHhS.js → StatusDot-D14iJMy7.js} +1 -1
- package/dist/assets/web/dist/assets/{Tooltip-qol5Boof.js → Tooltip-B0Ob5MQ4.js} +1 -1
- package/dist/assets/web/dist/assets/UnitRoutePage-CbKCL58v.js +1 -0
- package/dist/assets/web/dist/assets/{dist-DwtJj-ou.js → dist-pOdUzj6D.js} +1 -1
- package/dist/assets/web/dist/assets/{main-CRtlGxRm.js → main-D3lG-yQ9.js} +2 -2
- package/dist/cli.js +84 -25
- package/package.json +1 -1
- package/dist/assets/web/dist/assets/RunFoldRow-C_bcTSjA.js +0 -5
- package/dist/assets/web/dist/assets/RunRoutePage-BWTi_6PG.js +0 -10
- package/dist/assets/web/dist/assets/UnitRoutePage-CIhTEwN7.js +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{n as e,r as t}from"./AppShell-lYVcj-k7.js";import{Ci as n,Gn as r,Mr as i,Qn as a,Rn as o,Wt as s,Xt as c,_n as l,ci as u,cn as d,gn as f,ir as p,ln as m,oi as h,on as g,sn as _,un as v,ur as y,vi as b,wi as x,xi as S,yn as C}from"./seed-DeKSHrt2.js";import{n as w}from"./wallClock-61NpVkY6.js";import{t as T}from"./StatusDot-D14iJMy7.js";import{r as E,t as D}from"./indexFormat-B-pd4r7Y.js";import{A as O,D as k,E as A,O as j,T as M,a as N,b as P,c as F,g as I,l as L,m as R,o as z,t as B,v as ee,w as te,y as ne}from"./indexRow-Bnj883ii.js";import{t as V}from"./localIso-L06jV29p.js";function re(e){let t=new Date(e),n=t.getHours(),r=e=>String(e).padStart(2,`0`),i=new Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value;return`${n%12==0?12:n%12}:${r(t.getMinutes())}:${r(t.getSeconds())} ${n<12?`AM`:`PM`}${i?` ${i}`:``}`}function H(e){return e>0?e<1024?`${e} B`:e<1048576?`${(Math.round(e/102.4)/10).toFixed(1)} KB`:e<1073741824?`${(Math.round(e/104857.6)/10).toFixed(1)} MB`:`${(Math.round(e/107374182.4)/10).toFixed(1)} GB`:`0 B`}function ie(e,t){let n=e.ownerDocument;e.textContent=``;let r=String(t??``).replace(/\r\n?/g,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`),i=/^(\s*)([-*]|\d+[.)])\s+(.*)$/,a=/^(```|#{1,6}\s|>)/;function o(e,t){let r=n.createElement(t);return e.appendChild(r),r}function s(e,t){t&&e.appendChild(n.createTextNode(t))}function c(e){let t=e.trim();return t[0]===`|`&&(t=t.slice(1)),t[t.length-1]===`|`&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function l(e){let t=e.trim();return t.indexOf(`|`)<0||!/^[\s:|-]+$/.test(t)?!1:c(t).every(e=>/^:?-+:?$/.test(e))}function u(e,t){let n=e[t];return n.indexOf(`|`)<0||l(n)||t+1>=e.length||!l(e[t+1])?!1:c(n).length===c(e[t+1]).length}function d(e,t){let n=0,r=``,i=()=>{s(e,r),r=``};for(;n<t.length;){let a=t[n];if(a==="`"){let r=t.indexOf("`",n+1);if(r>n+1){i(),o(e,`code`).textContent=t.slice(n+1,r),n=r+1;continue}}else if(a===`*`&&t[n+1]===`*`){let r=t.indexOf(`**`,n+2);if(r>n+2){i(),d(o(e,`strong`),t.slice(n+2,r)),n=r+2;continue}}else if(a===`*`||a===`_`){let r=n>0?t[n-1]:``;if(/\S/.test(t[n+1]||``)&&!/\w/.test(r)){let r=-1;for(let e=n+2;e<t.length;e++)if(t[e]===a&&/\S/.test(t[e-1])&&!/\w/.test(t[e+1]||``)){r=e;break}if(r>0){i(),d(o(e,`em`),t.slice(n+1,r)),n=r+1;continue}}}else if(a===`[`){let r=/^\[([^\]\n]+)\]\(([^)\s]+)\)/.exec(t.slice(n));if(r&&/^https?:\/\//i.test(r[2])){i();let t=o(e,`a`);t.setAttribute(`href`,r[2]),t.setAttribute(`rel`,`noopener noreferrer`),t.setAttribute(`target`,`_blank`),d(t,r[1]),n+=r[0].length;continue}}r+=a,n++}i()}function f(e,t,n=0){let r=0;for(;r<t.length;){let s=t[r];if(/^\s*$/.test(s)){r++;continue}if(/^```/.test(s)){let n=[];for(r++;r<t.length&&!/^```\s*$/.test(t[r]);)n.push(t[r++]);r++,o(o(e,`pre`),`code`).textContent=n.join(`
|
|
4
|
+
`);continue}let l=/^(#{1,6})\s+(\S.*?)\s*$/.exec(s);if(l){d(o(e,`h`+l[1].length),l[2]),r++;continue}if(s[0]===`>`&&n<8){let i=[];for(;r<t.length&&t[r][0]===`>`;)i.push(t[r++].replace(/^>\s?/,``));f(o(e,`blockquote`),i,n+1);continue}if(u(t,r)){let n=c(s),i=o(e,`table`),a=o(o(i,`thead`),`tr`);for(let e of n)d(o(a,`th`),e);r+=2;let l=null;for(;r<t.length&&t[r].indexOf(`|`)>=0&&!u(t,r);){l||=o(i,`tbody`);let e=c(t[r]),a=o(l,`tr`);for(let t=0;t<n.length;t++)d(o(a,`td`),t<e.length?e[t]:``);r++}continue}if(i.test(s)){let n=[],a;for(;r<t.length&&(a=i.exec(t[r]))!==null;)n.push({indent:a[1].length,ordered:/^\d/.test(a[2]),text:a[3]}),r++;let s=n[0].indent,c=o(e,n[0].ordered?`ol`:`ul`),l=null,u=null;for(let e of n)e.indent>s&&l?(u||=o(l,e.ordered?`ol`:`ul`),d(o(u,`li`),e.text)):(l=o(c,`li`),u=null,d(l,e.text));continue}let p=[];for(;r<t.length&&!/^\s*$/.test(t[r])&&!a.test(t[r])&&!i.test(t[r])&&!u(t,r);)p.push(t[r++]);p.length===0&&p.push(t[r++]),d(o(e,`p`),p.join(`
|
|
5
|
+
`))}}f(e,r)}var U=C({__name:`MarkdownText`,props:{text:{}},setup(e){let t=e,n=u(null);function r(){let e=n.value;if(e)try{ie(e,t.text)}catch{e.textContent=t.text}}return a(r),i(()=>t.text,r),(e,t)=>(p(),v(`div`,{ref_key:`root`,ref:n,class:`md prose prose-sm prose-neutral dark:prose-invert min-w-0 max-w-none flex-1 whitespace-pre-wrap break-words font-sans text-[0.875rem] leading-normal [&_a]:font-medium [&_a]:decoration-(--ui-text-dimmed) [&_a]:underline-offset-[3px] [&_a:hover]:decoration-current [&_blockquote]:my-1.5 [&_h1]:font-medium [&_h1]:tracking-tight [&_h2]:font-medium [&_h2]:tracking-tight [&_h3]:font-medium [&_h3]:tracking-tight [&_h4]:font-medium [&_strong]:font-medium [&_li>ol]:my-0.5 [&_li>ul]:my-0.5 [&_li]:my-0.5 [&_li]:whitespace-pre-wrap [&_ol]:my-1.5 [&_ol]:whitespace-normal [&_p]:my-1.5 [&_pre]:my-2 [&_pre]:whitespace-pre [&_table]:whitespace-normal [&_ul]:my-1.5 [&_ul]:whitespace-normal`},null,512))}}),ae={},oe={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function se(e,t){return p(),v(`svg`,oe,[...t[0]||=[_(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z`},null,-1)]])}var ce=t(ae,[[`render`,se]]);function le(){let e=[],t=null,n=0,r=[];function i(e){return typeof e==`number`&&isFinite(e)?e:void 0}function a(e){return typeof e==`string`?e:``}function o(n){let r={index:e.length,calls:[]};return n&&(r.narration=n),e.push(r),t=r,r}function s(e){return e<1e3?String(e):e<1e6?(Math.round(e/100)/10).toFixed(1)+`k`:(Math.round(e/1e5)/10).toFixed(1)+`M`}function c(e){let t=/\((\d+) chars(?:, (\d+) lines)?\)$/.exec(e.summary);if(t)return t[2]?Number(t[2]):1;if(e.output)return e.output.split(`
|
|
6
|
+
`).length}function l(e){let t=[],n=e.result;if(!n)return t;n.infra?t.push(`sandbox error`):e.shell?t.push(n.exitCode===void 0?n.ok?`exit 0`:`error`:`exit `+n.exitCode):n.ok||t.push(`error`);let r=c(n);return r!==void 0&&r>1&&t.push(r+` lines`),e.durationMs!==void 0&&t.push(O(e.durationMs,`precise`)),t}function u(e,t){let n={ok:t.ok===!0,infra:t.infra===!0,summary:a(t.summary),output:a(t.output),at:i(t.at)},o=i(t.exitCode);o!==void 0&&(n.exitCode=o),e.result=n;let s=r.indexOf(e);s!==-1&&r.splice(s,1),e.status=n.infra?`infra`:n.ok?`ok`:`failed`,e.status!==`ok`&&(e.tags=e.tags.concat(e.status)),e.startedAt!==void 0&&n.at!==void 0&&n.at>=e.startedAt&&(e.durationMs=n.at-e.startedAt),e.facts=l(e)}let d=[[`tests`,/\b(npm|pnpm|yarn|bun)\s+(run\s+)?test\b|\b(vitest|jest|pytest|mocha|go test|cargo test)\b/],[`build`,/\b(npm|pnpm|yarn|bun)\s+run\s+(build|typecheck|lint)\b|\b(tsc|make|cargo build|go build|eslint|prettier)\b/],[`install`,/\b(npm|pnpm|yarn|bun)\s+(i|install|ci|add)\b|\bpip3?\s+install\b|\bapt(-get)?\s+install\b|\bbrew\s+install\b/],[`git`,/(^|[\s;&|(])(git|gh)\s/],[`network`,/(^|[\s;&|(])(curl|wget)\s/],[`read`,/(^|[\s;&|(])(cat|sed|head|tail|less|ls|find|grep|rg|wc|tree|pwd|echo|env|which|stat|file|diff)\b/]];function f(e){let t=e.replace(/^(\s*cd\s+("[^"]*"|'[^']*'|\S+)\s*(&&|;)\s*)+/,``);return t.trim()?t:e}function p(e){let t=f(e);for(let[e,n]of d)if(n.test(t))return e;return`shell`}function m(e,t){let n=t?f(e):e,r=n.indexOf(`
|
|
7
|
+
`),i=r===-1?n:n.slice(0,r).trimEnd();return i.length<e.length?i+` …`:i}function h(e,t){let o=a(e.tool),s=o===`bash`,c=t||o,l=s&&c.startsWith(`$ `)?c.slice(2):!s&&c.startsWith(o+` `)?c.slice(o.length+1):c,u={id:a(e.callId)||`c`+ ++n,tool:o,title:l,headline:m(l,s),shell:s,quiet:o===`update_status`,tags:[s?p(l):o],status:`running`,startedAt:i(e.at),facts:[]};return r.push(u),u}function g(t){for(let n=e.length-1;n>=0;n--)for(let r of e[n].calls)if(r.id===t)return{step:e[n],call:r};return null}function _(t){let n=a(t.callId);if(!n)return null;for(let t=e.length-1;t>=0;t--)for(let r of e[t].calls)if(r.id===n&&!r.result)return{step:e[t],call:r};return null}function v(e){if(!e||typeof e!=`object`)return[];let n=e;switch(n.type){case`input`:{let e={kind:`input`,text:a(n.text),messageId:a(n.messageId),at:i(n.at)},t=n.source;if(t&&typeof t==`object`){let n=t,r={};a(n.url)&&(r.url=a(n.url)),a(n.channel)&&(r.channel=a(n.channel)),a(n.user)&&(r.user=a(n.user)),a(n.run)&&(r.run=a(n.run)),Object.keys(r).length>0&&(e.source=r)}return[e]}case`answer`:return[{kind:`answer`,text:a(n.text),at:i(n.at)}];case`pr_opened`:{let e=i(n.number);return!a(n.url)||e===void 0||!Number.isInteger(e)||e<=0?[]:[{kind:`pr_opened`,url:a(n.url),number:e,created:n.created===!0,at:i(n.at)}]}case`run_meta`:{if(!a(n.agent))return[];let e={kind:`meta`,agent:a(n.agent),model:a(n.model),at:i(n.at)};return a(n.effort)&&(e.effort=a(n.effort)),a(n.repo)&&(e.repo=a(n.repo)),a(n.ref)&&(e.ref=a(n.ref)),i(n.pr)!==void 0&&Number.isInteger(n.pr)&&n.pr>0&&(e.pr=n.pr),/^[0-9a-f]{7,40}$/i.test(a(n.headSha))&&(e.headSha=a(n.headSha)),[e]}case`context`:return[{kind:`context`,text:a(n.text),at:i(n.at)}];case`reference`:{let e=i(n.messages);return!a(n.url)||!a(n.channelName)||e===void 0?[]:[{kind:`reference`,url:a(n.url),channelName:a(n.channelName),messages:e,text:a(n.text),at:i(n.at)}]}case`notes`:return[{kind:`note`,text:a(n.text),noteKind:`notes`,at:i(n.at)}];case`replay_note`:return[{kind:`replay_note`,text:a(n.summary)}];case`run_note`:return[{kind:`note`,text:a(n.summary),noteKind:a(n.kind),mode:a(n.mode)||void 0,at:i(n.at)}];case`assistant`:return[{kind:`step`,step:o({text:a(n.text),at:i(n.at)})}];case`review_artifact`:return[];case`span_start`:{let e=a(n.name),t=a(n.spanId);return!e||!t||e.startsWith(`tool.`)||e.startsWith(`mcp.`)||e===`model.turn`?[]:[{kind:`span`,spanId:t,name:e,open:!0,at:i(n.at)}]}case`span_end`:{let e=a(n.name),r=a(n.spanId),o=i(n.durationMs);if(!e||!r||o===void 0)return[];let c=n.status===`error`?`error`:`ok`,u=typeof n.attrs==`object`&&n.attrs!==null?n.attrs:{};if(e===`model.turn`){t=null;let e=[],c=i(u.inputTokens),l=i(u.outputTokens),d=i(u.cacheReadTokens);c!==void 0&&e.push(s(c)+` in`),l!==void 0&&e.push(s(l)+` out`),d!==void 0&&e.push(s(d)+` cached`);let f=i(u.ttftMs);f!==void 0&&e.push(`first token `+O(f,`precise`));let p=i(u.thinkingMs);p!==void 0&&e.push(`thinking `+O(p,`precise`));let m=i(u.textMs);m!==void 0&&e.push(`writing `+O(m,`precise`));let h=a(u.model);return[{kind:`turn`,spanId:r,label:`Thought for `+O(o,`precise`),facts:e,durationMs:o,...h?{model:h}:{},at:i(n.at)}]}if(e.startsWith(`tool.`)||e.startsWith(`mcp.`)){if(!e.startsWith(`tool.`))return[];let t=a(u.callId);if(!t)return[];let n=g(t);return!n||n.call.durationMs!==void 0?[]:(n.call.durationMs=o,n.call.facts=l(n.call),[{kind:`result`,step:n.step,call:n.call}])}let d=i(n.startedAt);return[{kind:`span`,spanId:r,name:e,open:!1,durationMs:o,status:c,at:i(n.at),...d===void 0?{}:{startedAt:d}}]}case`artifact`:{let e=a(n.key),t=a(n.name);if(!e||!t)return[];let r={key:e,name:t,size:i(n.size)??0,contentType:a(n.contentType),at:i(n.at)},o=a(n.messageId),s=a(n.callId),c=n.direction===`in`&&o?{...r,direction:`in`,messageId:o}:n.direction===`out`&&s?{...r,direction:`out`,callId:s}:void 0;return c?[{kind:`artifact`,artifact:c}]:[]}case`skill_use`:{let e=a(n.skill);if(!e)return[];let r=[];t||r.push({kind:`step`,step:o()});let s=a(n.source),c={name:e,description:a(n.description),agent:a(n.agent),bodyBytes:i(n.bodyBytes)??0,at:i(n.at)};return/^https?:\/\//.test(s)&&(c.source=s),r.push({kind:`skill`,step:t,skill:c}),r}case`tool_call`:{let e=[];t||e.push({kind:`step`,step:o()});let r=h(n,a(n.summary));return t.calls.push(r),e.push({kind:`call`,step:t,call:r}),e}case`tool_result`:{let e=_(n);if(e)return u(e.call,n),[{kind:`result`,step:e.step,call:e.call}];let r=[];t||r.push({kind:`step`,step:o()});let i=h(n,``);return i.startedAt=void 0,u(i,n),t.calls.push(i),r.push({kind:`call`,step:t,call:i}),r}default:return[]}}function y(){return r.length>0?r[0]:null}return{push:v,pending:y,steps:()=>e}}new Set(`request,slack.receive,dispatch.history,dispatch.admission,dispatch.ack_card,dispatch.gate.repo,dispatch.gate.pr_head,dispatch.workspace.attach,dispatch.gate.attached_head,dispatch.mcp_discovery,dispatch.compose,dispatch.channel_visibility,dispatch.repo_context,dispatch.memory_read,dispatch.refuse,dispatch.ship_preflight,dispatch.ledger_claim,dispatch.route,run.agent,run.command,run.reading_diff,run.settle_reviewed_head,run.description_turn,run.verdict_turn,run.observe_workspace,run.pr_post_step,run.review_post_step,run.reading_diff_join,run.pr_description_join,model.turn,ship.round,post.card_close,post.reply`.split(`,`));var ue=new Set([`slack.receive`,`dispatch.history`,`dispatch.admission`,`dispatch.ack_card`,`dispatch.gate.repo`,`dispatch.gate.pr_head`,`dispatch.workspace.attach`,`dispatch.gate.attached_head`,`dispatch.mcp_discovery`,`dispatch.compose`,`dispatch.channel_visibility`,`dispatch.repo_context`,`dispatch.memory_read`,`dispatch.refuse`,`dispatch.ship_preflight`,`dispatch.ledger_claim`,`dispatch.route`]),de=new Set([`run.observe_workspace`,`run.pr_post_step`,`run.review_post_step`,`run.reading_diff_join`,`run.pr_description_join`]),fe=new Set([`request`,`run.agent`,`ship.round`,`run.settle_reviewed_head`,`run.description_turn`,`run.verdict_turn`,`post.card_close`,`post.reply`]),pe=new Set([`run.reading_diff`]);function W(e,t){if(pe.has(e))return{kind:`background`};if(fe.has(e))return{kind:`uncounted`};if(e===`model.turn`)return{kind:`counted`,bucket:`thinking`};if(e===`run.command`||e.startsWith(`run.command.`))return{kind:`counted`,bucket:t===`command`?`tools`:`getting_ready`};if(ue.has(e)||e.startsWith(`dispatch.workspace.attach.`))return{kind:`counted`,bucket:`getting_ready`};if(de.has(e))return{kind:`counted`,bucket:`finishing_up`};if(e.startsWith(`tool.`)||e.startsWith(`mcp.`))return{kind:`counted`,bucket:`tools`}}var G={clone:`cloning the repo`,"checkout-clone":`cloning the checkout`,"worktree-clone":`cloning the worktree`,"worktree-detach":`checking out the expected commit`,"op-clone":`cloning the op tree`,fetch:`fetching the branch`,"wake-fetch":`fetching the latest commits`,"reclaim-fetch":`fetching to reclaim the mirror`,"for-each-ref":`listing the branches`,checkout:`checking out the branch`,"checkout-update":`updating the checkout`,"rev-parse":`reading the commit`,"cat-file":`checking the mirror for the commit`,"show-ref":`reading the branch tip`,"detect-default-branch":`detecting the default branch`,git:`a git command`,"git-setup":`configuring git`,"stage-perms":`securing the credential stage`,install:`installing dependencies`,build:`building`,test:`running the tests`,"clear-markers":`clearing the build markers`,"lockfile-key":`hashing the lockfile`,"deps-store-dir":`preparing the dependency store`,"deps-scratch":`cloning a scratch tree for the dependency install`,"deps-install":`installing the dependency store`,"deps-harden":`locking down the installed dependencies`,"deps-commit":`recording the installed dependencies`,"deps-adopt":`adopting the dependency store`,"deps-restore-scratch":`restoring dependencies to scratch`,"deps-restore-chown":`setting the restored dependencies' owner`,"deps-restore-commit":`recording the restored dependencies`,"deps-scratch-chown":`setting the dependency scratch owner`,"deps-evict":`evicting an old dependency store`,"unlink-deps-view":`unlinking the dependency view`,"clear-installing-marker":`clearing the install marker`,chown:`setting the workspace owner`,"worktree-chown":`setting the worktree owner`,"op-chown":`setting the op tree's owner`,"worktree-clean":`cleaning the worktree`,"clean-workspace":`cleaning the workspace`,"clean-before-restore":`cleaning before the restore`,"unmount-restores":`unmounting earlier restores`,"mirror-restore-extract":`extracting the mirror snapshot`,"checkout-restore-extract":`extracting the checkout snapshot`,"deps-restore-extract":`extracting the dependency snapshot`,evict:`evicting a stale tree`,"thread-dir":`preparing a directory`,"threads-dir":`preparing a directory`,"op-dir":`preparing a directory`,"ops-dir":`preparing a directory`,"stage-dir":`preparing a directory`,stat:`checking a file`,"boot-id":`reading the container's identity`,touch:`touching a marker`,nproc:`counting CPUs`,mutex_wait:`waiting for the workspace`,kill:`stopping the previous step`};Object.keys(G);function me(e){return Object.prototype.hasOwnProperty.call(G,e)?e:void 0}function he(e){let t=me(e);if(t!==void 0)return G[t];if(e.endsWith(`-stale-sweep`)){let t=me(e.slice(0,-12));if(t!==void 0)return`clearing leftovers before ${G[t]}`}}var ge={request:`the request`,"slack.receive":`receiving`,"dispatch.history":`reading the thread`,"dispatch.admission":`checking the thread`,"dispatch.ack_card":`posting the status card`,"dispatch.gate.repo":`checking the repo`,"dispatch.gate.pr_head":`checking the PR`,"dispatch.workspace.attach":`attaching the workspace`,"dispatch.gate.attached_head":`checking out the branch`,"dispatch.mcp_discovery":`loading tools`,"dispatch.compose":`preparing the prompt`,"dispatch.channel_visibility":`checking the channel`,"dispatch.repo_context":`reading the repo's context`,"dispatch.memory_read":`recalling memory`,"dispatch.refuse":`refusing`,"dispatch.ship_preflight":`checking the ship request`,"dispatch.ledger_claim":`claiming the run's row`,"dispatch.route":`picking the preset`,"run.agent":`the agent loop`,"run.command":`the command`,"run.reading_diff":`reading the diff (in parallel)`,"run.settle_reviewed_head":`re-checking the moved branch`,"run.description_turn":`asking for the PR description`,"run.verdict_turn":`asking for the verdict`,"run.observe_workspace":`checking the workspace`,"run.pr_post_step":`posting the PR`,"run.review_post_step":`posting the review`,"run.reading_diff_join":`waiting for the diff`,"run.pr_description_join":`waiting for the PR description`,"model.turn":`a model turn`,"ship.round":`a ship round`,"post.card_close":`closing the card`,"post.reply":`posting the reply`},_e=`a Switchboard step`;function K(e){if(e in ge)return ge[e];if(e.startsWith(`tool.`))return e.slice(5)||`a Switchboard step`;if(e.startsWith(`mcp.`)){let t=e.slice(e.lastIndexOf(`.`)+1);return t&&t!==`mcp`?t:_e}for(let t of[`dispatch.workspace.attach.`,`run.command.`])if(e.startsWith(t))return he(e.slice(t.length))??`a Switchboard step`;return _e}var ve=`A-Za-z0-9:@._-`;RegExp(`^[${ve}]{1,128}$`),RegExp(`[^${ve}]`,`g`);function q(e){return e.type===`span_start`||e.type===`span_end`}function ye(e,t){return/^[A-Za-z0-9_-]{1,64}$/.test(e)?`synth:${e}`:`synth:${t}`}function be(e){let t=[];for(let n of e)n.type===`span_end`&&n.name===`run.agent`&&t.push({spanId:n.spanId,startedAt:n.startedAt,endedAt:n.startedAt+n.durationMs});return t}function J(e,t){let n;for(let r of e)r.startedAt<=t&&t<=r.endedAt&&(!n||r.endedAt-r.startedAt<n.endedAt-n.startedAt)&&(n=r);return n?.spanId}function xe(e){let t=be(e),n=new Set;for(let t of e){if(!q(t))continue;let e=t.attrs??{};t.name.startsWith(`tool.`)&&typeof e.callId==`string`&&n.add(e.callId)}let r=[],i=new Map;return e.forEach((e,a)=>{switch(e.type){case`tool_call`:{let o=e.callId;if(o===void 0||e.at===void 0||n.has(o)){r.push(e);return}let s=ye(o,a);r.push(Se(s,`tool.${e.tool}`,e.at,J(t,e.at),{callId:o}),e),i.set(o,{spanId:s,startedAt:e.at});return}case`tool_result`:{if(r.push(e),e.callId===void 0)return;let n=i.get(e.callId);if(!n)return;i.delete(e.callId);let a=e.at??n.startedAt,o={ok:e.ok,callId:e.callId};e.exitCode!==void 0&&(o.exitCode=e.exitCode),e.infra&&(o.infra=!0),r.push(Ce(n.spanId,`tool.${e.tool}`,n.startedAt,Math.max(0,a-n.startedAt),J(t,n.startedAt),o,e.ok?`ok`:`error`));return}default:r.push(e)}}),r}function Se(e,t,n,r,i){return{type:`span_start`,spanId:e,...r===void 0?{}:{parentSpanId:r},name:t,...i?{attrs:i}:{},at:n}}function Ce(e,t,n,r,i,a,o=`ok`){return{type:`span_end`,spanId:e,...i===void 0?{}:{parentSpanId:i},name:t,startedAt:n,durationMs:r,status:o,...a?{attrs:a}:{},at:n+r}}function we(e,t,n){let r=e.get(t.spanId);if(t.type===`span_start`){if(r)return;e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?{}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.at??0,attrs:t.attrs??{}});return}e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?r?.parentSpanId===void 0?{}:{parentSpanId:r.parentSpanId}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.startedAt,endedAt:t.startedAt+t.durationMs,durationMs:t.durationMs,status:t.status,...t.error===void 0?{}:{errorMessage:t.error},attrs:{...r?.attrs??{},...t.attrs??{}}})}function Te(){let e,t,n=[];return{push(r){e?t&&r.seq!==void 0&&t.seq!==void 0&&r.seq>t.seq+1&&t.at!==void 0&&r.at!==void 0&&n.push({kind:`gap`,fromSeq:t.seq+1,toSeq:r.seq-1,from:Math.min(t.at,r.at),to:Math.max(t.at,r.at)}):e={seq:r.seq??1,at:r.at},r.type===`run_note`&&r.kind===`spans_dropped`&&r.from!==void 0&&r.to!==void 0&&r.to>=r.from&&n.push({kind:`note`,from:r.from,to:r.to}),t={seq:r.seq,at:r.at}},losses(t={}){let r=t.elided??[],i=(e,t)=>r.some(n=>n.fromSeq<=e&&t<=n.toSeq),a=[];e&&e.seq>1&&t.windowStart!==void 0&&e.at!==void 0&&e.at>t.windowStart&&a.push({from:t.windowStart,to:e.at,kind:`lost`});for(let e of n)a.push(e.kind===`note`?{from:e.from,to:e.to,kind:`lost`}:{from:e.from,to:e.to,kind:i(e.fromSeq,e.toSeq)?`elided`:`lost`});return a}}}var Ee=[/\bslack[\s-]?only\b/i,/\bpost\s*[:=]\s*(?:off|no|false|none)\b/i,/\bno[\s-]post\b/i,/\b(?:don['’]?t|do\s+not|never|skip|without)\s+(?:\w+\s+){0,2}?(?:post|comment)(?:ing|s)?\b/i,/\bno\s+need\s+to\s+(?:post|comment)\b/i];function De(e){return Ee.some(t=>t.test(e))}var Oe=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ke=/^[0-9a-f]{7,40}$/,Ae=/^(?![.-])(?!.*\.\.)(?!.*\/\/)(?!.*@\{)(?!.*\.lock$)(?!.*[./]$)[\w][\w./-]*$/;function Y(e){return e&&Oe.test(e)?`https://github.com/${e}`:void 0}function X(e,t){let n=Y(e);if(!(!n||t===void 0||!Number.isInteger(t)||t<=0))return`${n}/pull/${t}`}function je(e,t){let n=Y(e);if(n&&t&&Ae.test(t))return`${n}/tree/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function Me(e,t){let n=Y(e);if(n&&t&&ke.test(t))return`${n}/commit/${t}`}function Ne(e){return e.slice(0,7)}function Pe(e){if(e===`slack.receive`||e.startsWith(`dispatch.`))return`getting_ready`;let t=W(e,`agent`);return t?.kind===`counted`&&t.bucket===`finishing_up`?`finishing_up`:void 0}function Fe(e){return e===`request`||e===`run.agent`}var Ie={getting_ready:`Getting ready`,finishing_up:`Finishing up`};function Le(e){let t=e.rows.length,n=`${t} step${t===1?``:`s`}`,r=Ie[e.phase];if(t===0||e.rows.some(e=>e.open||e.at===void 0||e.durationMs===void 0))return`${r} · ${n}`;let i=Math.min(...e.rows.map(e=>e.at)),a=Math.max(...e.rows.map(e=>e.at+e.durationMs));return`${r} · ${n} · ${O(Math.max(0,a-i),`precise`)}`}function Re(e){let t=e.split(`
|
|
8
|
+
`),n=t.indexOf(`<<<UNTRUSTED`),r=t.lastIndexOf(`UNTRUSTED>>>`);return(n>=0&&r>n?t.slice(n+1,r):t.slice(1)).filter(e=>e.length>0)}function ze(e,t){let n=t.split(`/`).map(encodeURIComponent).join(`/`);return`${e.urlBase}${n}${e.token?`?t=${encodeURIComponent(e.token)}`:``}`}function Be(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{fromSeq:n,toSeq:r}=t,i=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;return!i(n)||!i(r)||n>r?null:{fromSeq:n,toSeq:r}}function Ve(e){let t=e.toSeq-e.fromSeq+1,n=t===1?`event ${e.fromSeq}`:`events ${e.fromSeq}–${e.toSeq}`;return`${t} ${t===1?`event`:`events`} not loaded (${n}) — the record has them`}function He(e,t,n){let r=!!e.model&&t!==null&&tt(e.model,t),i=r?t:e.model??t??void 0,a=!!e.model&&t!==null&&!r;return{spanId:e.spanId,label:e.label,chip:e.label.replace(/^Thought for /,``),quick:e.durationMs<6e4,durationMs:e.durationMs,facts:e.facts,...i?{model:i}:{},switched:a,showModel:!!i&&(!n||a),at:e.at}}function Ue(e){let t=`${e.n} tool call${e.n===1?``:`s`}`;if(e.n===0)return`no tool calls`;if(e.ok===e.n)return`${t}, all succeeded`;if(e.running===e.n)return`${t}, all running`;let n=[];return e.bad&&n.push(`${e.bad} failed`),e.infra&&n.push(`${e.infra} sandbox error${e.infra===1?``:`s`}`),e.running&&n.push(`${e.running} still running`),`${t}, ${n.join(`, `)}`}function We(e){let{meta:t,prOpened:n}=e,r=t?.repo&&Y(t.repo)?t.repo:void 0;if(t?.agent===`review`){if(De(e.requestText))return{text:`verdict, Slack only`};if(r&&t.pr!==void 0){let e=X(r,t.pr);return e?{text:`verdict for ${r}#${t.pr}`,href:e}:{text:`verdict`}}return{text:`verdict`}}if(t?.agent===`coding`&&n){let e=n.created?`pull request opened`:`pull request updated`,t=r?X(r,n.number):void 0;return t?{text:`${e} ${r}#${n.number}`,href:t}:{text:e}}return t?.agent===`command`?{text:`output`}:{text:`answer`}}function Ge(e,t){return{id:e.id,tool:e.tool,title:e.title,headline:e.headline,shell:e.shell,status:e.status,facts:[...e.facts],startedAt:e.startedAt,output:e.result?e.result.output||e.result.summary:``,hasResult:e.result!==void 0,chipOnly:!e.shell&&e.title===e.tool,durationMs:e.durationMs,exitCode:e.result?.exitCode,timedOut:j(e.result?.exitCode),open:t}}function Ke(e={}){let t=e.openTags&&e.openTags.length>0?e.openTags:[`failed`,`infra`],n=le(),r=h({request:null,meta:null,context:[],references:[],log:[],reply:null,prOpened:null,placeholder:!0,allOpen:!1,stopMode:null,model:null,firstAt:null,lastAt:null,lastAtWall:null,elided:[],traceVersion:0}),i=Te(),a=new Map,o=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,f=new Map,p=new Set,m=null,g=!1,_=-1,v=0,y=e=>`${e}-${v++}`;function b(e){return t.includes(`all`)?!0:e.some(e=>t.includes(e))}function x(e){let t=0,n=0,r=0;for(let i of e.items)i.kind===`call`&&(i.call.status===`failed`?t++:i.call.status===`infra`?n++:i.call.status===`running`&&r++);return{bad:t,infra:n,running:r}}function S(e){let{bad:t,infra:n,running:r}=x(e);(t||n||r)&&(e.groupOpen=!0)}function C(e){let t=o.get(_);t&&(t.live=!1),_=e.index;let n=m;m=null;let i=h({kind:`step`,key:y(`step`),index:e.index,at:e.narration?e.narration.at:n?.at,turn:n,narration:e.narration?e.narration.text:null,note:`no commentary`,items:[],live:!0,manual:!1,groupOpen:!0});return o.set(e.index,i),r.log.push(i),i}function T(e){return o.get(e.index)??C(e)}function E(e,t){let n=T(e);if(t.quiet){p.add(t.id),n.items.push({kind:`quiet`,at:t.startedAt,text:`✎ ${t.tool===`update_status`?`status checklist updated`:t.title}`}),S(n);return}let i=h(Ge(t,r.allOpen||b(t.tags)));u.set(t.id,i),d.set(t.id,n),n.items.push({kind:`call`,call:i}),S(n)}function D(e,t){if(p.has(t.id)){let t=o.get(e.index);t&&S(t);return}let n=u.get(t.id);if(!n){E(e,t);return}Object.assign(n,Ge(t,n.open)),b(t.tags)&&(n.open=!0);let r=o.get(e.index);r&&S(r)}function O(e,t){m&&=(r.log.push({kind:`turn`,key:y(`turn`),turn:m,note:e,...t===void 0?{}:{noteHref:t}}),null)}let k=new Map,A=h([]);function j(e){if(e.direction===`in`){k.get(e.messageId)?.files.push(e);return}A.push(e);let t=u.get(e.callId);t&&((t.files??=[]).push(e),t.open=!0)}function M(e){switch(r.placeholder=!1,e.kind){case`input`:{let t={text:e.text,messageId:e.messageId,at:e.at,...e.source?{source:e.source}:{},files:[]};r.request?r.log.push({kind:`followup`,key:y(`followup`),input:t}):r.request=t,k.set(t.messageId,t);return}case`step`:C(e.step);return;case`call`:E(e.step,e.call);return;case`result`:D(e.step,e.call);return;case`turn`:O(``),m=He(e,r.model,g),m.model&&(g=!0),e.model&&!(r.model!==null&&tt(e.model,r.model))&&(r.model=e.model);return;case`meta`:r.model===null&&e.model&&(r.model=e.model),r.meta={agent:e.agent,model:e.model,...e.effort?{effort:e.effort}:{},...e.repo?{repo:e.repo}:{},...e.ref?{ref:e.ref}:{},...e.pr===void 0?{}:{pr:e.pr},...e.headSha?{headSha:e.headSha}:{}};return;case`pr_opened`:r.prOpened={url:e.url,number:e.number,created:e.created};return;case`skill`:T(e.step).items.push({kind:`skill`,skill:e.skill});return;case`artifact`:j(e.artifact);return;case`context`:r.context.push({key:y(`ctx`),at:e.at,text:e.text});return;case`reference`:r.references.push({key:y(`ref`),at:e.at,url:e.url,channelName:e.channelName,messages:e.messages,text:e.text});return;case`note`:if(e.noteKind===`follow_up`)return;r.log.push({kind:`note`,key:y(`note`),at:e.at,replay:!1,text:e.text,noteKind:e.noteKind}),(e.noteKind===`stop_requested`||e.noteKind===`stopped`)&&(e.mode===`soft`||e.mode===`hard`)&&B(e.mode);return;case`replay_note`:r.log.push({kind:`note`,key:y(`note`),replay:!0,text:e.text});return;case`span`:{if(Fe(e.name)){e.name===`run.agent`&&e.open&&N(`getting_ready`);return}e.name.startsWith(`post.`)&&e.open&&N(`finishing_up`);let t=s.get(e.spanId);if(t){t.open=e.open,e.durationMs!==void 0&&(t.durationMs=e.durationMs),e.status&&(t.status=e.status);return}let n=h({kind:`span`,key:y(`span`),spanId:e.spanId,text:K(e.name),open:e.open,...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.status?{status:e.status}:{},at:e.open?e.at:e.startedAt??e.at});s.set(e.spanId,n);let i=Pe(e.name);if(i){let t=l.get(i);t||(t={group:h({kind:`phase`,phase:i,key:y(i),rows:[],open:!0}),toggled:!1},l.set(i,t),r.log.push(t.group)),t.group.rows.push(n),c.set(e.spanId,t.group);return}r.log.push(n);return}case`answer`:O(`wrote the reply`,`#reply`),r.reply={text:e.text,at:e.at,files:A};return}}function N(e){let t=l.get(e);t&&!t.toggled&&(t.group.open=!1)}function P(e){let t=e,s=t?.type===`span_start`||t?.type===`span_end`;if(t&&typeof t.type==`string`){let t=e;i.push(t),q(t)&&we(a,t,``),r.traceVersion++}t&&!s&&typeof t.at==`number`&&((r.firstAt===null||t.at<r.firstAt)&&(r.firstAt=t.at),(r.lastAt===null||t.at>=r.lastAt)&&(r.lastAt=t.at,r.lastAtWall=w()));for(let t of n.push(e))M(t);let c=e;if((c?.type===`tool_call`||c?.type===`tool_result`)&&typeof c.logIndex==`number`&&!f.has(c.logIndex)){let e=(typeof c.callId==`string`?d.get(c.callId):void 0)??o.get(_);e&&f.set(c.logIndex,e)}}function F(e){if(e.turn)return`span-${e.turn.spanId}`;let t=e.items.find(e=>e.kind===`call`);return t?.kind===`call`?`call-${t.call.id}`:void 0}function I(e){let t=f.get(e);if(!t){let n=-1;for(let[r,i]of f)r<e&&r>n&&(n=r,t=i)}if(!t)return;let n=F(t);return n===void 0?void 0:{step:t,anchor:n}}function L(){for(let e of u.values())if(e.status===`running`)return e;return null}function R(e){r.allOpen=e;for(let t of l.values())t.group.open=e,t.toggled=!0;for(let t of u.values())t.open=e}function z(e){if(e.startsWith(`call-`)){let t=e.slice(5),n=d.get(t);return!n||!u.has(t)?!1:(n.manual=!0,n.groupOpen=!0,!0)}if(e.startsWith(`span-`)){let t=e.slice(5),n=c.get(t);if(n){n.open=!0;let e=l.get(n.phase);return e&&(e.toggled=!0),!0}if(s.has(t))return!0;for(let e of r.log)if(e.kind===`step`&&e.turn?.spanId===t||e.kind===`turn`&&e.turn.spanId===t)return!0}return!1}function B(e){r.stopMode=e}function ee(e){r.elided.push(e),r.log.push({kind:`note`,key:y(`note`),replay:!0,text:Ve(e)}),r.placeholder=!1,r.traceVersion++}return{state:r,handle:P,noteElided:ee,spanSet:()=>[...a.values()],losses:e=>i.losses({windowStart:e,elided:r.elided}),pendingCall:L,flushPendingTurn:O,closePhases(){N(`getting_ready`),N(`finishing_up`)},setAllOpen:R,togglePhase(e){e.open=!e.open;let t=l.get(e.phase);t&&(t.toggled=!0)},reveal:z,landing:I,callHeadline:e=>u.get(e)?.headline,toggleGroup(e){e.manual=!0,e.groupOpen=!e.groupOpen},toggleCall(e){e.open=!e.open},markStopping:B,opensByDefault:b}}function qe(e,t){return e.lastAt===null||e.lastAtWall===null?null:e.lastAt+(t-e.lastAtWall)}function Je(e,t){return{now:n=>e.serverNow+(n-t),elapsedMs(t){return M(e,this.now(t))??0},elapsedAt(t){return M({receivedAt:e.receivedAt,startedAt:e.startedAt,finishedAt:t})??0}}}function Ye(e){if(typeof e!=`string`)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!=`object`||!t)return{};let{sealedAt:n,replyOk:r}=t;return{...typeof n==`number`&&Number.isFinite(n)&&n>0?{sealedAt:n}:{},...typeof r==`boolean`?{replyOk:r}:{}}}function Xe(e){return e.replyOk===!1?`reply failed`:e.replyOk!==!0||e.finishedAt===void 0||e.sealedAt===void 0?``:`delivered in ${O(Math.max(0,e.sealedAt-e.finishedAt),`clock`)}`}function Ze(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{finishedAt:n}=t;return typeof n==`number`&&Number.isFinite(n)&&n>0?{finishedAt:n}:null}var Qe=Symbol(`sb-runner-clock`),$e=Symbol(`sb-artifact-links`),et=Symbol(`sb-reply-landed`);function tt(e,t){return e===t||!e.includes(`/`)!=!t.includes(`/`)&&Z(e)===Z(t)}function Z(e){if(!e)return`model`;let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1))||e}var nt=6e4;function rt(e,t,n){let r=qe(e,n);if(r===null||e.lastAt===null)return{kind:`starting`};if(t)return{kind:`call`,call:t,elapsedMs:Math.max(0,r-(t.startedAt??e.lastAt))};let i=Math.max(0,r-e.lastAt);return{kind:`thinking`,elapsedMs:i,slow:i>=nt}}var it=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),at=65536,ot=new Set([`application/json`,`application/x-ndjson`,`application/xml`,`application/yaml`]);function st(e){return it.has(e)?`image`:e.startsWith(`video/`)?`video`:e.startsWith(`audio/`)?`audio`:e.startsWith(`text/`)||ot.has(e)?`text`:`other`}var ct=[`data-open-images`],lt={class:`mb-1.5 flex items-baseline gap-2 font-mono text-[0.68rem] font-medium uppercase tracking-wider text-dimmed`},ut={class:`count font-normal normal-case tracking-normal`},dt={class:`m-0 flex list-none flex-col gap-1.5 p-0`},ft=[`data-direction`,`data-kind`,`data-open`,`data-expired`],pt={class:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 font-mono text-xs`},mt=[`title`],ht=[`aria-expanded`,`aria-controls`,`onClick`],gt={key:1,class:`name font-medium text-toned`},_t={class:`fact text-dimmed`},vt={class:`fact text-dimmed`},yt={key:2,class:`expired text-warn`},bt=[`id`,`aria-hidden`],xt={class:`min-h-0 overflow-hidden`},St=[`src`,`alt`,`onError`],Ct=[`src`,`onError`],wt=[`src`,`onError`],Tt={key:3,class:`mt-1.5`},Et={key:0,class:`text max-h-96 overflow-auto rounded border border-(--ui-border) bg-elevated p-2.5 font-mono text-xs whitespace-pre-wrap break-words text-toned`},Dt={key:1,class:`text-xs text-bad`},Ot={key:2,class:`mt-1 text-xs text-dimmed`},kt={key:4,class:`other mt-1.5 flex flex-wrap items-baseline gap-x-3 gap-y-1 font-mono text-xs text-dimmed`},At=[`href`,`download`],jt=0,Mt=C({__name:`MessageFiles`,props:{files:{},openImages:{type:Boolean,default:!0}},setup(e){let t=e,r=o($e,null),a=h(new Set),s=h(new Set),l=h(new Set),u=h(new Map);function d(){for(let e of t.files)t.openImages&&st(e.contentType)===`image`&&!s.has(e.key)&&!l.has(e.key)&&(s.add(e.key),l.add(e.key))}d(),i(()=>[t.files,t.files.length],d),jt+=1;let f=`files-${jt}`,C=g(()=>t.files.map((e,t)=>({...e,href:r?ze(r,e.key):null,kind:st(e.contentType),open:s.has(e.key),mounted:l.has(e.key),expired:a.has(e.key),panelId:`${f}-file-${t}`})));function w(e){if(e.href&&!e.expired){if(s.has(e.key)){s.delete(e.key);return}s.add(e.key),l.add(e.key),e.kind===`text`&&!u.has(e.key)&&T(e.key,e.href)}}async function T(e,t){u.set(e,{text:``,truncated:!1});try{let n=await fetch(t,{credentials:`same-origin`});if(n.status===410){a.add(e),u.delete(e);return}if(!n.ok||!n.body)throw Error(`HTTP ${n.status}`);let r=n.body.getReader(),i=new TextDecoder,o=``,s=0,c=!1;for(;;){let{value:e,done:t}=await r.read();if(t)break;let n=at-s,a=e.byteLength>n?e.subarray(0,n):e;if(o+=i.decode(a,{stream:!0}),s+=a.byteLength,s>=65536){c=e.byteLength>n||!(await r.read()).done,await r.cancel();break}}u.set(e,{text:o,truncated:c})}catch(t){u.set(e,{text:``,truncated:!1,error:t instanceof Error?t.message:String(t)})}}function E(e){a.add(e),s.delete(e)}let D=e=>e===`out`?`↑ sent`:`↓ received`,O=e=>e===`out`?`sent by the run`:`received from the thread`;return(t,i)=>(p(),v(`div`,{class:`files mt-3 border-t border-(--ui-border) pt-2`,"data-open-images":e.openImages?`1`:`0`},[_(`h3`,lt,[i[0]||=_(`span`,null,`Files`,-1),_(`span`,ut,`· `+x(e.files.length)+` file`+x(e.files.length===1?``:`s`),1)]),_(`ul`,dt,[(p(!0),v(c,null,y(C.value,e=>(p(),v(`li`,{key:e.key,class:`artifact`,"data-direction":e.direction,"data-kind":e.kind,"data-open":e.open?`1`:`0`,"data-expired":e.expired?`1`:`0`},[_(`div`,pt,[_(`span`,{class:`dir shrink-0 select-none text-dimmed`,title:O(e.direction)},x(D(e.direction)),9,mt),e.href&&!e.expired?(p(),v(`button`,{key:0,type:`button`,class:`name flex cursor-pointer items-baseline gap-1.5 border-0 bg-transparent p-0 font-mono text-xs font-medium text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":e.open?`true`:`false`,"aria-controls":e.panelId,onClick:t=>w(e)},[_(`span`,{class:S([`chev inline-block select-none text-[0.65rem] text-dimmed transition-transform motion-reduce:transition-none`,e.open?`rotate-90`:``]),"aria-hidden":`true`},`❯`,2),_(`span`,null,x(e.name),1)],8,ht)):(p(),v(`span`,gt,x(e.name),1)),_(`span`,_t,x(b(H)(e.size)),1),_(`span`,vt,x(e.contentType),1),e.expired&&b(r)?(p(),v(`span`,yt,`expired after `+x(b(r).retentionDays)+` days`,1)):m(``,!0)]),e.href&&!e.expired?(p(),v(`div`,{key:0,id:e.panelId,class:`panel grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`,style:n({gridTemplateRows:e.open?`1fr`:`0fr`}),"aria-hidden":e.open?`false`:`true`},[_(`div`,xt,[e.mounted?(p(),v(c,{key:0},[e.kind===`image`?(p(),v(`img`,{key:0,class:`preview mt-1.5 max-h-96 max-w-full rounded border border-(--ui-border)`,src:e.href,alt:e.name,loading:`lazy`,onError:t=>E(e.key)},null,40,St)):e.kind===`video`?(p(),v(`video`,{key:1,class:`preview mt-1.5 max-h-96 max-w-full rounded border border-(--ui-border) bg-black`,src:e.href,controls:``,playsinline:``,preload:`auto`,onError:t=>E(e.key)},null,40,Ct)):e.kind===`audio`?(p(),v(`audio`,{key:2,class:`preview mt-1.5 w-full max-w-xl`,src:e.href,controls:``,preload:`auto`,onError:t=>E(e.key)},null,40,wt)):e.kind===`text`?(p(),v(`div`,Tt,[u.get(e.key)&&!u.get(e.key).error?(p(),v(`pre`,Et,x(u.get(e.key).text),1)):m(``,!0),u.get(e.key)?.error?(p(),v(`p`,Dt,` could not read the file: `+x(u.get(e.key).error),1)):u.get(e.key)?.truncated?(p(),v(`p`,Ot,` showing the first `+x(b(H)(b(at)))+` of `+x(b(H)(e.size)),1)):m(``,!0)])):(p(),v(`div`,kt,[_(`span`,null,`no preview for `+x(e.contentType),1),_(`a`,{class:`download inline-block rounded border border-default px-2 py-0.5 font-medium text-toned no-underline hover:bg-accented hover:text-primary focus-visible:outline-2 focus-visible:outline-primary`,href:e.href,download:e.name},`Download `+x(b(H)(e.size)),9,At)]))],64)):m(``,!0)])],12,bt)):m(``,!0)],8,ft))),128))])],8,ct))}}),Nt=[`id`,`open`,`title`,`data-status`,`data-heat`],Pt={key:0,class:`spin inline-block size-[0.7em] shrink-0 animate-spin self-center rounded-full border-2 border-accented border-t-info motion-reduce:animate-none`,role:`img`,"aria-label":`running`},Ft={key:2,class:`dollar shrink-0 select-none text-dimmed`},It={key:3,class:`tool shrink-0 rounded bg-accented px-1.5 text-xs leading-normal text-muted`},Lt={key:0,class:`cmd brief min-w-0 flex-1 truncate text-info`},Rt={key:1,class:`cmd full min-w-0 flex-1 whitespace-pre-wrap break-words text-info max-sm:order-last max-sm:basis-full`},zt={key:5,class:`cmd min-w-0 flex-1`},Bt={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs tabular-nums text-muted`},Vt={key:0,class:`fact elapsed`,title:`since this call started (runner clock)`},Ht={key:0,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},Ut={key:1,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},Wt={class:`body`},Gt={key:1,class:`none px-3 py-1.5 text-xs italic text-dimmed`},Kt={key:2,class:`none px-3 py-1.5 text-xs italic text-dimmed`},qt=C({__name:`CallCard`,props:{call:{}},setup(e){let t=e,r=o(Qe,null),i=o(et,null),a=g(()=>{let e=r?.value;return t.call.status!==`running`||typeof e!=`number`||t.call.startedAt===void 0?``:O(Math.max(0,e-t.call.startedAt),`clock`)}),l=g(()=>A(t.call.durationMs,`tool`,t.call.timedOut)),u=g(()=>k(l.value)),f=g(()=>t.call.durationMs===void 0?-1:t.call.facts.length-1);function h(){t.call.open=!t.call.open}return(t,r)=>(p(),v(`details`,{id:`call-${e.call.id}`,class:S([`call rounded-lg border border-default bg-elevated font-mono open:bg-accented`,e.call.status]),open:e.call.open,title:typeof e.call.startedAt==`number`?`started ${b(V)(e.call.startedAt)}`:void 0,"data-status":e.call.status,"data-heat":l.value.level},[_(`summary`,{class:S([`flex min-w-0 cursor-pointer list-none items-baseline gap-3 rounded-lg pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 hover:bg-accented/60 focus-visible:outline-2 focus-visible:outline-primary max-sm:flex-wrap [&::-webkit-details-marker]:hidden`,e.call.open?`rounded-b-none border-b border-default`:``]),onClick:s(h,[`prevent`])},[_(`span`,{class:S([`chev shrink-0 select-none text-xs text-dimmed transition-transform motion-reduce:transition-none`,e.call.open?`rotate-90`:``])},`❯`,2),e.call.status===`running`?(p(),v(`span`,Pt)):(p(),v(`span`,{key:1,class:S([`glyph w-[1em] shrink-0 text-center font-medium`,e.call.status===`ok`?`text-ok`:e.call.status===`failed`?`text-bad`:`text-warn`])},x(e.call.status===`ok`?`✓`:e.call.status===`failed`?`✗`:`⚠`),3)),e.call.shell?(p(),v(`span`,Ft,`$`)):(p(),v(`span`,It,x(e.call.tool),1)),e.call.chipOnly?(p(),v(`span`,zt)):(p(),v(c,{key:4},[e.call.open?(p(),v(`code`,Rt,x(e.call.title),1)):(p(),v(`code`,Lt,x(e.call.headline),1))],64)),_(`span`,Bt,[a.value?(p(),v(`span`,Vt,x(a.value),1)):m(``,!0),(p(!0),v(c,null,y(e.call.facts,(t,r)=>(p(),v(c,{key:r},[r===f.value&&l.value.over?(p(),v(`span`,Ht,`timed out`)):m(``,!0),_(`span`,{class:S([`fact`,[e.call.status!==`ok`&&r===0?`text-bad`:``,r===f.value&&l.value.over?`font-medium text-bad`:``,r===f.value&&u.value?`heat`:``,r===f.value&&l.value.level>=2&&!l.value.over?`font-medium`:``]]),style:n(r===f.value?u.value:void 0)},x(t),7)],64))),128)),l.value.over&&f.value===-1?(p(),v(`span`,Ut,`timed out`)):m(``,!0)])],2),_(`div`,Wt,[e.call.hasResult&&e.call.output?(p(),v(`pre`,{key:0,class:S([`out max-h-[28rem] overflow-auto whitespace-pre-wrap break-words px-3.5 py-2.5 font-mono leading-normal`,e.call.status===`failed`?`text-bad`:`text-toned`])},x(e.call.output),3)):e.call.hasResult?(p(),v(`div`,Gt,`no output`)):(p(),v(`div`,Kt,`no output yet`)),e.call.files&&e.call.files.length>0?(p(),d(Mt,{key:3,class:`mx-3.5 mb-2.5`,files:e.call.files,"open-images":!b(i)},null,8,[`files`,`open-images`])):m(``,!0)])],10,Nt))}}),Jt=[`title`],Yt=[`title`],Xt={class:`skillname whitespace-nowrap font-mono font-medium text-skill`},Zt={key:0,class:`skilldesc min-w-0 flex-1 truncate text-xs text-muted`},Qt={class:`facts ml-auto flex shrink-0 gap-2.5 font-mono text-xs text-muted`},$t=[`href`],en={class:`fact`},tn=C({__name:`StepItems`,props:{items:{}},setup(e){return(t,n)=>(p(!0),v(c,null,y(e.items,(e,t)=>(p(),v(c,{key:t},[e.kind===`call`?(p(),d(qt,{key:0,call:e.call},null,8,[`call`])):e.kind===`quiet`?(p(),v(`div`,{key:1,class:`quiet flex items-baseline gap-3 pl-3 pr-(--sb-gutter) py-0.5 font-mono text-xs text-dimmed`,title:e.at===void 0?void 0:b(V)(e.at)},[_(`span`,null,x(e.text),1)],8,Jt)):(p(),v(`div`,{key:2,class:`skill flex items-baseline gap-2.5 pl-3 pr-(--sb-gutter) py-0.5`,title:e.skill.at===void 0?void 0:b(V)(e.skill.at)},[n[0]||=_(`span`,{class:`skillmark shrink-0 select-none text-xs`},`📚`,-1),_(`span`,Xt,`skill `+x(e.skill.name),1),e.skill.description?(p(),v(`span`,Zt,x(e.skill.description),1)):m(``,!0),_(`span`,Qt,[e.skill.source?(p(),v(`a`,{key:0,class:`fact text-primary hover:underline`,href:e.skill.source,target:`_blank`,rel:`noopener noreferrer`},`source`,8,$t)):m(``,!0),_(`span`,en,x(b(H)(e.skill.bodyBytes))+` into context`,1)])],8,Yt))],64))),128))}}),nn=[`id`,`data-live`],rn={class:`head flex items-baseline gap-x-6 pb-1.5 pr-(--sb-gutter)`},an={class:`min-w-0 flex-1`},on={key:0,class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 font-mono text-xs tabular-nums text-dimmed`},sn=[`data-heat`,`title`],cn=[`title`],ln=[`title`],un={key:2,class:`nonar font-sans text-sm italic text-dimmed`},dn=[`title`],fn={key:0,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},pn={key:1,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},mn={class:`nonar flex-1 font-sans text-sm italic text-dimmed`},hn={class:`calls flex flex-col gap-2`},gn=[`open`,`data-group-open`],_n=[`title`],vn=[`data-ok`,`data-bad`,`data-infra`,`data-running`],yn=[`data-heat`],bn={class:`gbody flex flex-col gap-2 pb-1 pt-1.5`},xn=C({__name:`StepBlock`,props:{step:{}},emits:[`toggleGroup`],setup(e,{emit:t}){let r=e,i=t,a=g(()=>r.step.items.filter(e=>e.kind===`call`)),o=g(()=>a.value.length>=2),u=g(()=>{let e=0,t=0,n=0,r=0,i=0;for(let o of a.value){if(o.kind!==`call`)continue;let a=o.call;a.status===`ok`?e++:a.status===`failed`?t++:a.status===`infra`?n++:r++,typeof a.durationMs==`number`&&(i+=a.durationMs)}return{n:e+t+n+r,ok:e,bad:t,infra:n,running:r,ms:i}}),h=g(()=>Ue(u.value)),C=g(()=>a.value.some(e=>e.kind===`call`&&e.call.timedOut)),w=g(()=>A(u.value.ms,`tool`,C.value)),T=g(()=>k(w.value)),E=g(()=>r.step.turn?A(r.step.turn.durationMs,`turn`):void 0),D=g(()=>E.value?k(E.value):void 0),j=g(()=>{let e=a.value[0];return e?.kind===`call`?e.call.startedAt:void 0});return(t,r)=>(p(),v(`li`,{id:e.step.turn?`span-${e.step.turn.spanId}`:void 0,class:S([`step relative border-l-2 pb-3 pl-3 pt-2`,e.step.live?`border-ok/40`:`border-(--ui-border-accented)/50`]),"data-live":e.step.live?`1`:void 0},[_(`div`,rn,[_(`div`,an,[e.step.turn?(p(),v(`div`,on,[_(`span`,{class:S([`thought`,[D.value?`heat`:``,E.value&&E.value.level>=2?`font-medium`:``]]),style:n(D.value),"data-heat":E.value?.level,title:e.step.turn.label},`thought `+x(e.step.turn.chip),15,sn),e.step.turn.switched?(p(),v(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-medium text-warn`,title:`model changed: this turn ran on ${e.step.turn.model}`},`⇄ `+x(b(Z)(e.step.turn.model)),9,cn)):e.step.turn.showModel?(p(),v(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:e.step.turn.model},x(b(Z)(e.step.turn.model)),9,ln)):m(``,!0),(p(!0),v(c,null,y(e.step.turn.facts,(e,t)=>(p(),v(`span`,{key:t,class:`fact`},x(e),1))),128))])):e.step.narration===null?(p(),v(`span`,un,x(e.step.note),1)):(p(),d(U,{key:1,text:e.step.narration},null,8,[`text`]))]),e.step.at===void 0?m(``,!0):(p(),v(`span`,{key:0,class:`ts shrink-0 select-none font-mono text-xs tabular-nums text-dimmed`,title:b(V)(e.step.at)},x(b(re)(e.step.at)),9,dn))]),e.step.turn&&e.step.narration!==null?(p(),v(`div`,fn,[l(U,{text:e.step.narration},null,8,[`text`])])):e.step.turn&&e.step.narration===null&&!e.step.turn.facts.length?(p(),v(`div`,pn,[_(`span`,mn,x(e.step.note),1)])):m(``,!0),_(`div`,hn,[o.value?(p(),v(`details`,{key:1,class:`grp`,open:e.step.groupOpen,"data-group-open":e.step.groupOpen?`1`:`0`},[_(`summary`,{class:`gsummary flex cursor-pointer list-none items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1 font-mono text-xs text-dimmed hover:bg-accented/40 hover:text-muted focus-visible:outline-2 focus-visible:outline-primary [&::-webkit-details-marker]:hidden`,title:typeof j.value==`number`?`calls began ${b(V)(j.value)}`:void 0,onClick:r[0]||=s(e=>i(`toggleGroup`),[`prevent`])},[_(`span`,{class:S([`gchev shrink-0 select-none transition-transform motion-reduce:transition-none`,e.step.groupOpen?`rotate-90`:``])},`❯`,2),_(`span`,{class:S([`gcount`,u.value.bad||u.value.infra?`text-bad`:``]),"data-ok":u.value.ok,"data-bad":u.value.bad,"data-infra":u.value.infra,"data-running":u.value.running},x(h.value),11,vn),u.value.ms>0?(p(),v(`span`,{key:0,class:S([`gtime ml-auto tabular-nums`,[T.value?`heat`:``,w.value.over?`font-medium text-bad`:w.value.level>=2?`font-medium`:``]]),style:n(T.value),"data-heat":w.value.level},[w.value.over?(p(),v(c,{key:0},[f(`timed out · `)],64)):m(``,!0),f(x(b(O)(u.value.ms,`clock`)),1)],14,yn)):m(``,!0)],8,_n),_(`div`,bn,[l(tn,{items:e.step.items},null,8,[`items`])])],8,gn)):(p(),d(tn,{key:0,items:e.step.items},null,8,[`items`]))])],10,nn))}}),Q={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},Sn={getting_ready:`getting ready`,finishing_up:`finishing up`};function Cn(e){return Q[Sn[e]]}var wn={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},Tn={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},En={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},Dn=[`href`],On={class:`lede font-mono text-sm text-toned`},kn={class:`shape tabular-nums`},An={key:0,class:`current text-muted`},jn={key:0,class:`note mt-0.5 text-xs text-muted`},Mn=[`aria-label`],Nn=[`title`,`data-term`],Pn={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},Fn=[`title`,`data-term`],In={class:`term text-muted`},Ln={class:`ms tabular-nums text-toned`},Rn=[`title`],zn={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},Bn={class:`ms w-14 shrink-0 tabular-nums text-toned`},Vn=[`href`,`data-anchor`,`onClick`],Hn=C({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(t,{emit:r}){let i=t,a=r;function o(e){return`${O(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function l(){e.copyText(JSON.stringify(i.vm.debug,null,2))}return(e,r)=>(p(),v(`section`,wn,[_(`h2`,Tn,[r[0]||=_(`span`,null,`Where the time went`,-1),_(`span`,En,[t.eventsHref?(p(),v(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:t.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,Dn)):m(``,!0),_(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:l},` Copy debug JSON `)])]),_(`p`,On,[_(`span`,kn,x(t.vm.shown?t.vm.total:t.vm.lede),1),t.vm.current?(p(),v(`span`,An,` · `+x(t.vm.current),1)):m(``,!0)]),(p(!0),v(c,null,y(t.vm.captions,e=>(p(),v(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},x(e),1))),128)),t.vm.note?(p(),v(`p`,jn,x(t.vm.note),1)):m(``,!0),t.vm.shown?(p(),v(c,{key:1},[_(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":t.vm.lede},[(p(!0),v(c,null,y(t.vm.bar,(e,t)=>(p(),v(`div`,{key:t,class:S([`seg h-full`,[b(Q)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:n({width:`${e.pct}%`}),title:o(e),"data-term":e.term},null,14,Nn))),128))],8,Mn),_(`ul`,Pn,[(p(!0),v(c,null,y(t.vm.legend,e=>(p(),v(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[_(`span`,{class:S([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,b(Q)[e.term]])},null,2),_(`span`,In,x(e.term),1),_(`span`,Ln,x(e.text),1)],8,Fn))),128))]),t.vm.ranked.length>0?(p(),v(c,{key:0},[_(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:t.vm.rankedNote},` Longest steps `,8,Rn),_(`ol`,zn,[(p(!0),v(c,null,y(t.vm.ranked,(e,t)=>(p(),v(`li`,{key:t,class:`flex items-baseline gap-2`},[_(`span`,Bn,x(b(O)(e.ms,`clock`)),1),_(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:s(t=>a(`reveal`,e.anchor),[`prevent`])},x(e.label),9,Vn),(p(!0),v(c,null,y(e.facts,e=>(p(),v(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},x(e),1))),128))]))),128))])],64)):m(``,!0)],64)):m(``,!0)]))}});function Un(e,t){let{window:n,owner:r,finished:i}=t,a=Math.max(0,n.end-n.start),o=new Map(e.map(e=>[e.spanId,e])),s=new Map,c=e=>{let t=s.get(e.spanId);if(t!==void 0)return t;s.set(e.spanId,1);let n=e.parentSpanId?o.get(e.parentSpanId):void 0,r=n?c(n)+1:1;return s.set(e.spanId,r),r},l=e=>{let t=e,n=new Set;for(;t&&!n.has(t.spanId);){if(n.add(t.spanId),W(t.name,r)?.kind===`background`)return!0;t=t.parentSpanId?o.get(t.parentSpanId):void 0}return!1},u=t.losses.map(e=>Math.max(n.start,e.from)).sort((e,t)=>e-t),d=e=>{if(e.endedAt!==void 0)return Math.min(n.end,e.endedAt);if(!i)return n.end;let t=u.find(t=>t>e.startedAt);return t===void 0?n.end:Math.min(n.end,t)},f=[],p=[];for(let t of e){let e=W(t.name,r);if(!e)continue;let i=Math.max(n.start,t.startedAt);if(e.kind===`background`){let e=Math.min(n.end,t.endedAt??n.end);e>i&&p.push([i,e]);continue}if(e.kind!==`counted`||l(t))continue;let a=d(t);a<=i||f.push({start:i,end:a,bucket:e.bucket,depth:c(t),startedAt:t.startedAt,spanId:t.spanId})}f.sort((e,t)=>t.depth-e.depth||e.startedAt-t.startedAt||(e.spanId<t.spanId?-1:+(e.spanId>t.spanId)));let m=new Set([n.start,n.end]);for(let e of f)m.add(e.start),m.add(e.end);for(let e of t.losses)m.add($(e.from,n)),m.add($(e.to,n));for(let[e,t]of p)m.add(e),m.add(t);let h=[...m].filter(e=>e>=n.start&&e<=n.end).sort((e,t)=>e-t),g={getting_ready:0,thinking:0,tools:0,finishing_up:0},_=0,v=0,y=0;for(let e=0;e+1<h.length;e++){let r=h[e],i=h[e+1],a=i-r;if(a<=0)continue;let o=f.find(e=>e.start<=r&&e.end>=i);if(o){g[o.bucket]+=a;continue}if(t.losses.some(e=>e.kind===`lost`&&$(e.from,n)<=r&&$(e.to,n)>=i)){_+=a;continue}if(t.losses.some(e=>e.kind===`elided`&&$(e.from,n)<=r&&$(e.to,n)>=i)){v+=a;continue}p.some(([e,t])=>e<=r&&t>=i)&&(y+=a)}let b=g.getting_ready+g.thinking+g.tools+g.finishing_up;return{windowMs:a,gettingReadyMs:g.getting_ready,thinkingMs:g.thinking,toolsMs:g.tools,finishingUpMs:g.finishing_up,overheadMs:Math.max(0,a-b-_-v),notRecordedMs:_,notLoadedMs:v,backgroundOnlyMs:y}}function $(e,t){return Math.min(t.end,Math.max(t.start,e))}function Wn(e){let t=Math.floor(e.windowMs/1e3),n=[[`getting ready`,Math.floor(e.gettingReadyMs/1e3)],[`thinking`,Math.floor(e.thinkingMs/1e3)],[`in tools`,Math.floor(e.toolsMs/1e3)],[`finishing up`,Math.floor(e.finishingUpMs/1e3)],[`not recorded`,Math.floor(e.notRecordedMs/1e3)],[`not loaded`,Math.floor(e.notLoadedMs/1e3)]],r=n.reduce((e,[,t])=>e+t,0),i=n.filter(([,e])=>e>0).map(([e,t])=>({term:e,s:t})),a=t-r;a>0&&i.push({term:`Switchboard overhead`,s:a});let o=[`getting ready`,`thinking`,`in tools`,`finishing up`,`Switchboard overhead`,`not recorded`,`not loaded`];return i.sort((e,t)=>o.indexOf(e.term)-o.indexOf(t.term)),{totalS:t,items:i}}function Gn(e){return[e.gettingReadyMs,e.thinkingMs,e.toolsMs,e.finishingUpMs,e.overheadMs,e.notRecordedMs,e.notLoadedMs].filter(t=>t>=2e3||e.windowMs>0&&t/e.windowMs>=.05).length>=2}function Kn(e,t){if(t===void 0||t<6e4)return;let n=O(t,`clock`);return e===`before`?`queued ${n} before we saw it`:`queued ${n} behind the previous run`}var qn={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},Jn=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,Yn=`currently delivering`,Xn=`getting ready: not recorded (too large)`,Zn=`no timing data`,Qn=`not loaded (the record has the full shape)`,$n={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function er(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=Un(t,{window:n,owner:r,finished:i,losses:e.losses}),o=Wn(a),s=O(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?nr(t,r,n):void 0,u=ir(e,l),d=l?K(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:Jn,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Zn};let p={total:s,current:u,openStep:d,captions:[Kn(`before`,tr(c,`queuedBeforeMs`)),Kn(`behind`,tr(c,`queuedBehindMs`))].filter(e=>e!==void 0),rankedNote:Jn,debug:f};if(!c)return{...p,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:i?Xn:``};let m=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?Qn:t,h=Gn(a)&&o.items.length>0,g=h?`${s} — ${o.items.map(({term:e,s:t})=>`${O(t*1e3,`clock`)} ${m(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${m(or(a))}`:s,_=h?o.items.map(({term:t,s:n})=>({term:t,text:O(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${qn[t]} (too large)`:qn[t]})):[];return{...p,lede:g,shown:h,bar:h?sr(a,l):[],legend:_,ranked:h?cr(t,c,r,n,e.callTitle):[],note:``}}function tr(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function nr(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=W(o.name,t);if(e?.kind!==`counted`||rr(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function rr(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),W(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function ir(e,t){return e.phase===`delivering`?Yn:e.phase===`ended`?Xe(e.delivery??{}):t?`currently ${$n[t.bucket]} ${O(t.elapsedMs,`clock`)}`:``}function ar(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function or(e){let t=[`getting ready`,-1];for(let n of ar(e))n[1]>t[1]&&(t=n);return t[0]}function sr(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of ar(e))if(!(a<=0)){if(t&&$n[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function cr(e,t,n,r,i){let a=new Map(e.map(e=>[e.spanId,e])),o=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=o.get(t.parentSpanId);e?e.push(t):o.set(t.parentSpanId,[t])}let s=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],c=[];for(let r of e){if(r===t||r.name===`run.agent`||W(r.name,n)===void 0||rr(r,a,n))continue;let[e,l]=s(r);if(l<=e)continue;let u=(o.get(r.spanId)??[]).map(s).map(([t,n])=>[Math.max(e,t),Math.min(l,n)]).filter(([e,t])=>t>e),d=l-e-lr(u);if(d<=0)continue;let f=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,p=f?i?.(f):void 0;c.push({label:p??K(r.name),ms:d,facts:ur(r),anchor:f?`call-${f}`:`span-${r.spanId}`,startedAt:r.startedAt})}return c.sort((e,t)=>t.ms-e.ms||e.startedAt-t.startedAt),c.slice(0,3).map(({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r}))}function lr(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function ur(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${O(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${O(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function dr(e){let t=[];for(let n of e.split(/\r?\n\r?\n/)){let e=n.split(/\r?\n/);if(e.some(e=>e.startsWith(`event:`)))continue;let r=e.filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).replace(/^ /,``)).join(`
|
|
9
|
+
`);if(r!==``)try{let e=JSON.parse(r);typeof e==`object`&&e&&typeof e.type==`string`&&t.push(e)}catch{}}return t}function fr(e){return e===`command`?`command`:`agent`}var pr=[`data-state`],mr={key:0,class:`loading py-2 font-mono text-xs text-dimmed`},hr={key:1,class:`failed py-2 font-mono text-xs text-warn`},gr=[`href`],_r=[`data-turn`,`data-anchor`],vr={class:`landing-head flex flex-wrap items-baseline gap-x-2 font-mono text-xs text-muted`},yr={class:`turn tabular-nums`},br={class:`what min-w-0 truncate text-toned`},xr=[`href`],Sr={key:0,class:`m-0 mt-1 list-none p-0`},Cr=C({__name:`RunTimeline`,props:{run:{},land:{},fetch:{}},setup(t){let n=t,o=u(`loading`),s=Ke(),d=g(()=>{if(o.value!==`ready`)return null;s.state.traceVersion;let e=n.run,t=e.receivedAt??e.startedAt,r=M(e)??(e.finishedAt===void 0?0:Math.max(0,e.finishedAt-t));return er({spans:s.spanSet(),losses:s.losses(t),window:{start:t,end:t+r},owner:fr(e.agent),totalMs:r,phase:`ended`,delivery:{finishedAt:e.finishedAt,sealedAt:e.sealedAt,replyOk:e.replyOk},...e.truncated===void 0?{}:{truncated:e.truncated},...(e.schema??0)>=2?{}:{untimed:!0},callTitle:s.callHeadline})}),h=g(()=>`/runs/${encodeURIComponent(n.run.id)}/events`),y=e=>`/runs/${encodeURIComponent(n.run.id)}#${e}`;function S(t){e.navigate(y(t))}let C=g(()=>{if(o.value!==`ready`||n.land===void 0)return null;s.state.traceVersion;let e=n.land,t=n.run.session;if(t&&e===t.request)return{anchor:`request`,what:`the request`};let r=t&&t.range!==`broken`?t.range.to:void 0;if(r!==void 0&&e===r&&s.state.reply)return{anchor:`reply`,what:`the reply`};let i=s.landing(e);return i?{anchor:i.anchor,what:w(i.step),step:i.step}:null});function w(e){let t=e.items.find(e=>e.kind===`call`),n=t?.kind===`call`?t.call.headline:void 0;return[e.turn?`thought ${e.turn.chip}`:void 0,n].filter(e=>e!==void 0).join(` · `)||`step ${e.index+1}`}let T=u(null),E=g(()=>C.value?`${n.land}@${C.value.anchor}`:null);return i(E,e=>{e!==null&&r().then(()=>{let e=(C.value?.step?T.value?.querySelector(`li.step`):null)??T.value;e&&(e.scrollIntoView?.({block:`center`}),e.classList.add(`revealed`),setTimeout(()=>e.classList.remove(`revealed`),1500))})}),a(async()=>{let e=n.fetch??((...e)=>globalThis.fetch(...e));try{let t=await e(h.value,{credentials:`same-origin`});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=dr(await t.text()).filter(e=>e.type!==`replay_note`);for(let e of(n.run.schema??0)>=2?xe(r):r)s.handle(e);s.closePhases(),o.value=`ready`}catch{o.value=`failed`}}),(e,n)=>(p(),v(`div`,{class:`runtimeline pl-5`,"data-state":o.value},[o.value===`loading`?(p(),v(`p`,mr,`reading the run's record…`)):o.value===`failed`?(p(),v(`p`,hr,[n[1]||=f(` the run's record could not be read — `,-1),_(`a`,{class:`text-primary no-underline hover:underline`,href:`/runs/${encodeURIComponent(t.run.id)}`},`open the run`,8,gr)])):d.value?(p(),v(c,{key:2},[l(Hn,{vm:d.value,"events-href":h.value,onReveal:S},null,8,[`vm`,`events-href`]),C.value?(p(),v(`div`,{key:0,ref_key:`landingEl`,ref:T,class:`landing mb-4 rounded-lg border border-default px-(--sb-gutter) py-2`,"data-turn":t.land,"data-anchor":C.value.anchor},[_(`p`,vr,[_(`span`,yr,`turn `+x(t.land),1),_(`span`,br,`· `+x(C.value.what),1),_(`a`,{class:`page ml-auto shrink-0 text-primary no-underline hover:underline`,href:y(C.value.anchor),title:`the same step on the run's own page`},`open on the run's page ↗`,8,xr)]),C.value.step?(p(),v(`ol`,Sr,[l(xn,{step:C.value.step,onToggleGroup:n[0]||=e=>b(s).toggleGroup(C.value.step)},null,8,[`step`])])):m(``,!0)],8,_r)):m(``,!0)],64)):m(``,!0)],8,pr))}}),wr=[`id`,`data-run-id`,`data-round`,`data-thread`],Tr=[`open`],Er={class:`row flex min-w-0 cursor-pointer list-none flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted) [&::-webkit-details-marker]:hidden`},Dr={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},Or={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},kr={key:3,class:`scope min-w-0 flex-1 truncate text-toned`},Ar=[`title`],jr=[`data-heat`],Mr={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},Nr=[`href`,`aria-label`],Pr={key:1,class:`row flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted)`},Fr={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},Ir={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},Lr={key:3,class:`scope min-w-0 flex-1 truncate text-highlighted`},Rr=[`title`],zr={class:`elapsed shrink-0 text-right font-mono text-xs tabular-nums text-ok sm:min-w-[4.5em]`,title:`running for`},Br={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},Vr=[`href`,`aria-label`],Hr=C({__name:`RunFoldRow`,props:{run:{},now:{},label:{},open:{type:Boolean},land:{}},setup(e){let t=e,r=u(t.open===!0);i(()=>t.open,e=>{e&&(r.value=!0)});let a=g(()=>E(t.run.label||I(t.run.id))),o=g(()=>ee(t.run)),c=g(()=>R(t.run)),f=g(()=>t.run.finished),h=g(()=>t.run.finished&&t.run.status&&t.run.status!==`completed`?ne(t.run.status):``),y=g(()=>A(t.run.finished&&typeof t.run.finishedAt==`number`?t.run.finishedAt-t.run.startedAt:void 0,`run`)),C=g(()=>k(y.value));function w(e){r.value=e.target.open}return(t,i)=>(p(),v(`li`,{id:`run-${e.run.id}`,class:S([`fold group border-b border-muted`,e.run.finished?`finished`:`live`]),"data-run-id":e.run.id,"data-round":e.run.round,"data-thread":e.run.thread},[f.value?(p(),v(`details`,{key:0,class:`group/fold`,open:r.value,onToggle:w},[_(`summary`,Er,[i[1]||=_(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open/fold:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`},`❯`,-1),l(T,{tone:o.value,label:b(P)(e.run),tip:b(F)(e.run)},null,8,[`tone`,`label`,`tip`]),e.label?(p(),v(`span`,Dr,x(e.label),1)):m(``,!0),a.value.agent?(p(),v(`span`,{key:1,class:S([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider opacity-55`,b(B)[b(N)(a.value.agent)]])},x(a.value.agent),3)):m(``,!0),a.value.snippet===void 0?(p(),v(`span`,kr,x(a.value.scope),1)):(p(),v(`span`,Or,x(a.value.snippet),1)),h.value?(p(),v(`span`,{key:4,class:S([`outcome shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,o.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},x(h.value),3)):m(``,!0),_(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-dimmed`,title:b(te)(e.run)},x(b(D)(e.run.startedAt,e.now)),9,Ar),_(`span`,{class:S([`elapsed shrink-0 text-right font-mono text-xs tabular-nums sm:min-w-[4.5em]`,[C.value?`heat`:`text-muted`,y.value.level>=2?`font-medium`:``]]),style:n(C.value),"data-heat":y.value.level,title:`start to finish`},x(b(L)(e.run,e.now)),15,jr),_(`span`,Mr,x(b(z)(e.run)),1),_(`a`,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,href:c.value,"aria-label":`open run ${e.run.label||b(I)(e.run.id)}`,onClick:i[0]||=s(()=>{},[`stop`])},`open ↗`,8,Nr)]),r.value?(p(),d(Cr,{key:0,run:e.run,land:e.land},null,8,[`run`,`land`])):m(``,!0)],40,Tr)):(p(),v(`div`,Pr,[i[2]||=_(`span`,{class:`chev select-none text-xs text-transparent`,"aria-hidden":`true`},`❯`,-1),l(T,{tone:o.value,label:b(P)(e.run),tip:b(F)(e.run),pulse:``},null,8,[`tone`,`label`,`tip`]),e.label?(p(),v(`span`,Fr,x(e.label),1)):m(``,!0),a.value.agent?(p(),v(`span`,{key:1,class:S([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider`,b(B)[b(N)(a.value.agent)]])},x(a.value.agent),3)):m(``,!0),a.value.snippet===void 0?(p(),v(`span`,Lr,x(a.value.scope),1)):(p(),v(`span`,Ir,x(a.value.snippet),1)),_(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-muted`,title:b(te)(e.run)},x(b(D)(e.run.startedAt,e.now)),9,Rr),_(`span`,zr,x(b(L)(e.run,e.now)),1),_(`span`,Br,x(b(z)(e.run)),1),_(`a`,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,href:c.value,"aria-label":`open run ${e.run.label||b(I)(e.run.id)}`},`open ↗`,8,Vr)]))],10,wr))}});export{re as A,Me as C,Ne as D,je as E,ce as O,qe as S,Y as T,Ze as _,Cn as a,Re as b,$e as c,Je as d,Ke as f,Ye as g,Z as h,Hn as i,U as k,et as l,rt as m,fr as n,xn as o,Xe as p,er as r,Mt as s,Hr as t,Qe as u,Be as v,X as w,We as x,Le as y};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-pOdUzj6D.js","assets/AppShell-lYVcj-k7.js","assets/seed-DeKSHrt2.js","assets/main-D3lG-yQ9.js","assets/main-Dm11o0hc.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{C as e,S as t,_ as n,b as r,c as i,g as a,h as o,m as s,n as c,p as l,r as u,s as d,t as f,v as p,y as m}from"./AppShell-lYVcj-k7.js";import{A as h,B as g,Ci as ee,Dr as _,Gn as te,H as v,Ht as y,J as b,Jn as ne,Lr as x,Mr as S,N as C,Or as w,P as re,Pr as ie,Q as ae,Qn as T,Rn as oe,Si as se,U as E,Ut as ce,Wn as D,Wt as le,Xt as O,_ as k,_n as A,a as ue,at as de,b as fe,ci as j,cn as M,d as pe,di as me,dr as N,et as he,f as ge,ft as _e,g as P,gn as F,h as ve,hi as ye,ir as I,it as be,j as L,kn as xe,ln as R,m as z,mi as Se,nr as Ce,nt as we,oi as Te,on as B,or as Ee,p as V,r as De,sn as H,t as Oe,u as ke,un as U,ur as W,vi as G,wi as K,x as q,xi as J,xr as Ae,y as Y,yn as X,z as je,zr as Me}from"./seed-DeKSHrt2.js";import{t as Ne}from"./Tooltip-B0Ob5MQ4.js";import{r as Pe,t as Fe}from"./main-D3lG-yQ9.js";import{t as Ie}from"./wallClock-61NpVkY6.js";import{t as Le}from"./NotFoundPage-BzWS4Ca1.js";import{t as Re}from"./indexFormat-B-pd4r7Y.js";import{A as ze,D as Be,E as Ve,k as He,y as Ue}from"./indexRow-Bnj883ii.js";import{t as We}from"./localIso-L06jV29p.js";import{A as Ge,C as Ke,D as qe,E as Je,O as Ye,S as Xe,T as Ze,_ as Qe,a as $e,b as et,c as tt,d as nt,f as rt,g as it,h as at,i as ot,k as Z,l as st,m as ct,n as lt,o as ut,p as dt,r as ft,s as pt,t as mt,u as ht,v as gt,w as _t,x as vt,y as yt}from"./RunFoldRow-Cqh8pTXC.js";import{n as bt,r as xt,t as St}from"./favicon-BQsePYv5.js";var[Q,Ct]=g(`DialogRoot`),wt=X({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=de(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=j(),a=j(),{modal:o,unmountOnHide:s}=ye(n);return Ct({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>N(e.$slots,`default`,{open:G(r),close:()=>r.value=!1})}}),Tt=X({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;C();let n=Q();return(e,r)=>(I(),M(G(h),D(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>G(n).onOpenChange(!1)}),{default:x(()=>[N(e.$slots,`default`)]),_:3},16,[`type`]))}}),Et=X({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=t,o=Q(),{forwardRef:s,currentElement:c}=C();return o.titleId||=m(void 0,`reka-dialog-title`),o.descriptionId||=m(void 0,`reka-dialog-description`),T(()=>{o.contentElement=c,je()!==document.body&&(o.triggerElement.value=je())}),(e,t)=>(I(),M(G(n),{"as-child":``,loop:``,trapped:r.trapFocus,present:r.present,onMountAutoFocus:t[5]||=e=>i(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>i(`closeAutoFocus`,e)},{default:x(()=>[A(G(p),D({id:G(o).contentId,ref:G(s),as:e.as,"as-child":e.asChild,present:r.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":G(o).descriptionId,"aria-labelledby":G(o).titleId,"data-state":G(a)(G(o).open.value)},e.$attrs,{onDismiss:t[0]||=e=>G(o).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>i(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>i(`focusOutside`,e),onInteractOutside:t[3]||=e=>i(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>i(`pointerDownOutside`,e)}),{default:x(()=>[N(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),Dt=X({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,i=t,a=Q(),o=re(i),{forwardRef:s,currentElement:c}=C(),l=B(()=>n.present?c.value:void 0);r(l);let u=B(()=>{let{present:e,...t}=n;return t});return S(()=>n.present,(e,t)=>{!e&&t&&a.triggerElement.value?.focus()}),(e,t)=>(I(),M(Et,D({...u.value,...G(o)},{ref:G(s),present:e.present,"trap-focus":G(a).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),G(a).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:x(()=>[N(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),Ot=X({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=re(t);C();let i=Q(),a=j(!1),o=j(!1),s=B(()=>{let{present:e,...t}=n;return t});return S(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(I(),M(Et,D({...s.value,...G(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||G(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;G(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:x(()=>[N(e.$slots,`default`)]),_:3},16,[`present`]))}}),kt=X({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Q(),a=re(r),{forwardRef:o}=C();return(e,t)=>(I(),M(G(L),{present:e.forceMount||G(i).open.value,"force-mount":e.forceMount||!G(i).unmountOnHide.value},{default:x(({present:t})=>[G(i).modal.value?Me((I(),M(Dt,D({key:0,ref:G(o),present:G(i).unmountOnHide.value||t},{...n,...G(a),...e.$attrs}),{default:x(()=>[N(e.$slots,`default`)]),_:2},1040,[`present`])),[[y,G(i).unmountOnHide.value||t]]):Me((I(),M(Ot,D({key:1,ref:G(o),present:G(i).unmountOnHide.value||t},{...n,...G(a),...e.$attrs}),{default:x(()=>[N(e.$slots,`default`)]),_:2},1040,[`present`])),[[y,G(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),At=X({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;C();let n=Q();return(e,r)=>(I(),M(G(h),D(t,{id:G(n).descriptionId}),{default:x(()=>[N(e.$slots,`default`)]),_:3},16,[`id`]))}}),jt=X({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(t){let n=t,r=Q(),i=e(n.present);return S(()=>n.present,e=>i.value=e),C(),(e,t)=>(I(),M(G(h),{as:e.as,"as-child":e.asChild,"data-state":G(r).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=le(()=>{},[`left`,`self`,`prevent`])},{default:x(()=>[N(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),Mt=X({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Q(),{forwardRef:n}=C();return(e,r)=>G(t)?.modal.value?(I(),M(G(L),{key:0,present:e.forceMount||G(t).open.value,"force-mount":e.forceMount||!G(t).unmountOnHide.value},{default:x(({present:r})=>[Me(A(jt,D(e.$attrs,{ref:G(n),as:e.as,"as-child":e.asChild,present:G(t).unmountOnHide.value||r}),{default:x(()=>[N(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[y,G(t).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`])):R(`v-if`,!0)}}),Nt=X({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(I(),M(G(q),se(xe(t)),{default:x(()=>[N(e.$slots,`default`)]),_:3},16))}}),Pt=X({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=Q();return C(),(e,r)=>(I(),M(G(h),D(t,{id:G(n).titleId}),{default:x(()=>[N(e.$slots,`default`)]),_:3},16,[`id`]))}}),Ft=X({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Q(),{forwardRef:r,currentElement:i}=C();return n.contentId||=m(void 0,`reka-dialog-content`),T(()=>{n.triggerElement.value=i.value}),(e,i)=>(I(),M(G(h),D(t,{ref:G(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":G(n).open.value||!1,"aria-controls":G(n).open.value?G(n).contentId:void 0,"data-state":G(n).open.value?`open`:`closed`,onClick:G(n).onOpenToggle}),{default:x(()=>[N(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),It=X({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=i(),r=m(),a=B(()=>t.tabStopId||r),c=B(()=>n.currentTabStopId.value===a.value),{getItems:u,CollectionItem:d}=fe();T(()=>{t.focusable&&n.onFocusableItemAdd()}),Ce(()=>{t.focusable&&n.onFocusableItemRemove()}),S(()=>t.focusable,(e,t)=>{e!==t&&(e?n.onFocusableItemAdd():n.onFocusableItemRemove())});function f(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=s(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...u().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?o(i,t+1):i.slice(t+1)}te(()=>l(i))}}return(e,t)=>(I(),M(G(d),null,{default:x(()=>[A(G(h),{tabindex:c.value?0:-1,"data-orientation":G(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?G(n).onItemFocus(a.value):t.preventDefault()},onFocus:t[1]||=e=>G(n).onItemFocus(a.value),onKeydown:f},{default:x(()=>[N(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[Lt,Rt]=g(`TabsRoot`),zt=X({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,{orientation:a,unmountOnHide:o,dir:s}=ye(r),c=t(s);C();let l=de(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),u=j(),d=me(new Set);return Rt({modelValue:l,changeModelValue:e=>{l.value=e},orientation:a,dir:c,unmountOnHide:o,activationMode:r.activationMode,baseId:m(void 0,`reka-tabs`),tabsList:u,contentIds:d,registerContent:e=>{d.value=new Set([...d.value,e])},unregisterContent:e=>{let t=new Set(d.value);t.delete(e),d.value=t}}),(e,t)=>(I(),M(G(h),{dir:G(c),"data-orientation":G(a),"as-child":e.asChild,as:e.as},{default:x(()=>[N(e.$slots,`default`,{modelValue:G(l)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function Bt(e,t){return`${e}-trigger-${t}`}function Vt(e,t){return`${e}-content-${t}`}var Ht=X({__name:`TabsContent`,props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=C(),r=Lt(),i=B(()=>Bt(r.baseId,t.value)),a=B(()=>Vt(r.baseId,t.value)),o=B(()=>t.value===r.modelValue.value),s=j(o.value);return T(()=>{r.registerContent(t.value),requestAnimationFrame(()=>{s.value=!1})}),ne(()=>{r.unregisterContent(t.value)}),(e,t)=>(I(),M(G(L),{present:e.forceMount||o.value,"force-mount":``},{default:x(({present:t})=>[A(G(h),{id:a.value,ref:G(n),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":o.value?`active`:`inactive`,"data-orientation":G(r).orientation.value,"aria-labelledby":i.value,hidden:!t,tabindex:`0`,style:ee({animationDuration:s.value?`0s`:void 0})},{default:x(()=>[!G(r).unmountOnHide.value||t?N(e.$slots,`default`,{key:0}):R(`v-if`,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),Ut=X({__name:`TabsIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=Lt();t({updateIndicatorStyle:s}),C();let i=we(),a=j({size:null,thickness:null,position:null}),o=j([]);S(()=>[r.modelValue.value,r?.dir.value],()=>{s()},{immediate:!0,flush:`post`}),ie(()=>{o.value=Array.from(r.tabsList.value?.querySelectorAll(`[role="tab"]`)||[])}),be(B(()=>[r.tabsList.value,...o.value]),s);function s(){let e=r.tabsList.value?.querySelector(`[role="tab"][data-state="active"]`);e&&(r.orientation.value===`horizontal`?a.value={size:e.offsetWidth,thickness:e.offsetHeight,position:e.offsetLeft}:a.value={size:e.offsetHeight,thickness:e.offsetWidth,position:e.offsetTop})}return(e,t)=>G(i)&&typeof a.value.size==`number`?(I(),M(G(h),D({key:0},n,{style:{"--reka-tabs-indicator-size":`${a.value.size}px`,"--reka-tabs-indicator-thickness":`${a.value.thickness}px`,"--reka-tabs-indicator-position":`${a.value.position}px`}}),{default:x(()=>[N(e.$slots,`default`)]),_:3},16,[`style`])):R(`v-if`,!0)}}),Wt=X({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=ye(e),{forwardRef:n,currentElement:r}=C(),i=Lt();return i.tabsList=r,(e,r)=>(I(),M(G(d),{"as-child":``,orientation:G(i).orientation.value,dir:G(i).dir.value,loop:G(t)},{default:x(()=>[A(G(h),{ref:G(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":G(i).orientation.value},{default:x(()=>[N(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),Gt=X({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=C(),r=Lt(),i=B(()=>Bt(r.baseId,t.value)),a=B(()=>r.contentIds.value.has(t.value)?Vt(r.baseId,t.value):void 0),o=B(()=>t.value===r.modelValue.value);return(e,t)=>(I(),M(G(It),{"as-child":``,focusable:!e.disabled,active:o.value},{default:x(()=>[A(G(h),{id:i.value,ref:G(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":G(r).orientation.value,onMousedown:t[0]||=le(t=>{!e.disabled&&t.ctrlKey===!1?G(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=ce(t=>G(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=G(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&G(r).changeModelValue(e.value)}},{default:x(()=>[N(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}});function Kt(e,t={}){let n=e.detail.originalEvent,r=n.target;if(!r?.isConnected){e.preventDefault();return}t.scrollable&&(n.offsetX>r.clientWidth||n.offsetY>r.clientHeight)&&e.preventDefault()}var qt={slots:{overlay:`fixed inset-0 bg-elevated/75`,content:`fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none`,header:`flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)`,wrapper:``,body:`flex-1 overflow-y-auto p-4 sm:p-6`,footer:`flex items-center gap-1.5 p-4 sm:px-6`,title:`text-highlighted font-semibold`,description:`mt-1 text-muted text-sm`,close:`absolute top-4 end-4`},variants:{side:{top:{content:``},right:{content:`max-w-md`},bottom:{content:``},left:{content:`max-w-md`}},inset:{true:{content:`rounded-lg`}},transition:{true:{overlay:`data-[state=open]:animate-[fade-in_200ms_var(--ease-out)] data-[state=closed]:animate-[fade-out_200ms_var(--ease-out)]`}}},compoundVariants:[{side:`top`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 top-4`}},{side:`top`,inset:!1,class:{content:`max-h-full inset-x-0 top-0`}},{side:`right`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 right-4`}},{side:`right`,inset:!1,class:{content:`w-full inset-y-0 right-0`}},{side:`bottom`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 bottom-4`}},{side:`bottom`,inset:!1,class:{content:`max-h-full inset-x-0 bottom-0`}},{side:`left`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 left-4`}},{side:`left`,inset:!1,class:{content:`w-full inset-y-0 left-0`}},{transition:!0,side:`top`,class:{content:`data-[state=open]:animate-[slide-in-from-top_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-top_200ms_var(--ease-out)]`}},{transition:!0,side:`right`,class:{content:`data-[state=open]:animate-[slide-in-from-right_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-right_200ms_var(--ease-out)]`}},{transition:!0,side:`bottom`,class:{content:`data-[state=open]:animate-[slide-in-from-bottom_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-bottom_200ms_var(--ease-out)]`}},{transition:!0,side:`left`,class:{content:`data-[state=open]:animate-[slide-in-from-left_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-left_200ms_var(--ease-out)]`}}]},Jt={__name:`Slideover`,props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:`right`},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:[`leave`,`after:leave`,`enter`,`after:enter`,`close:prevent`,`update:open`],setup(e,{emit:t}){let n=e,r=t,i=_(),a=k(`slideover`,n),{t:o}=v(),s=b(),c=P(_e(a,`open`,`defaultOpen`,`modal`,`unmountOnHide`),r),l=Y(Se(()=>a.portal)),u=Se(()=>a.content),d=B(()=>a.dismissible?{pointerDownOutside:Kt}:[`interactOutside`,`escapeKeyDown`].reduce((e,t)=>(e[t]=e=>{e.preventDefault(),r(`close:prevent`)},e),{})),f=B(()=>ve({extend:qt,...s.ui?.slideover||{}})({transition:a.transition,side:a.side,inset:a.inset}));return(e,t)=>(I(),M(G(wt),se(xe(G(c))),{default:x(({open:n,close:c})=>[i.default?(I(),M(G(Ft),{key:0,"as-child":``,class:J(G(a).class)},{default:x(()=>[N(e.$slots,`default`,{open:n})]),_:2},1032,[`class`])):R(``,!0),A(G(Nt),D(G(l),{"force-mount":G(l).disabled&&G(a).unmountOnHide===!1||void 0}),{default:x(()=>[A(G(ke),null,{default:x(()=>[G(a).overlay?(I(),M(G(Mt),{key:0,"data-slot":`overlay`,class:J(f.value.overlay({class:G(a).ui?.overlay}))},null,8,[`class`])):R(``,!0),A(G(kt),D({"data-side":G(a).side,"data-slot":`content`,class:f.value.content({class:[!i.default&&G(a).class,G(a).ui?.content]})},u.value,{onEnter:t[0]||=e=>r(`enter`),onAfterEnter:t[1]||=e=>r(`after:enter`),onLeave:t[2]||=e=>r(`leave`),onAfterLeave:t[3]||=e=>r(`after:leave`)},Ae(d.value)),{default:x(()=>[!G(a).title&&!i.title||!G(a).description&&!i.description||i.content?(I(),M(G(Pe),{key:0},{default:x(()=>[!G(a).title&&!i.title?(I(),M(G(Pt),{key:0})):i.content?(I(),M(G(Pt),{key:1},{default:x(()=>[N(e.$slots,`title`,{},()=>[F(K(G(a).title),1)])]),_:3})):R(``,!0),!G(a).description&&!i.description?(I(),M(G(At),{key:2})):i.content?(I(),M(G(At),{key:3},{default:x(()=>[N(e.$slots,`description`,{},()=>[F(K(G(a).description),1)])]),_:3})):R(``,!0)]),_:3})):R(``,!0),N(e.$slots,`content`,{close:c},()=>[i.header||G(a).title||i.title||G(a).description||i.description||G(a).close||i.close?(I(),U(`div`,{key:0,"data-slot":`header`,class:J(f.value.header({class:G(a).ui?.header}))},[N(e.$slots,`header`,{close:c},()=>[G(a).title||i.title||G(a).description||i.description?(I(),U(`div`,{key:0,"data-slot":`wrapper`,class:J(f.value.wrapper({class:G(a).ui?.wrapper}))},[G(a).title||i.title?(I(),M(G(Pt),{key:0,"data-slot":`title`,class:J(f.value.title({class:G(a).ui?.title}))},{default:x(()=>[N(e.$slots,`title`,{},()=>[F(K(G(a).title),1)])]),_:3},8,[`class`])):R(``,!0),G(a).description||i.description?(I(),M(G(At),{key:1,"data-slot":`description`,class:J(f.value.description({class:G(a).ui?.description}))},{default:x(()=>[N(e.$slots,`description`,{},()=>[F(K(G(a).description),1)])]),_:3},8,[`class`])):R(``,!0)],2)):R(``,!0),N(e.$slots,`actions`),G(a).close||i.close?(I(),M(G(Tt),{key:1,"as-child":``},{default:x(()=>[N(e.$slots,`close`,{ui:f.value},()=>[G(a).close?(I(),M(ue,D({key:0,icon:G(a).closeIcon||G(s).ui.icons.close,color:`neutral`,variant:`ghost`,"aria-label":G(o)(`slideover.close`)},typeof G(a).close==`object`?G(a).close:{},{"data-slot":`close`,class:f.value.close({class:G(a).ui?.close})}),null,16,[`icon`,`aria-label`,`class`])):R(``,!0)])]),_:2},1024)):R(``,!0)])],2)):R(``,!0),H(`div`,{"data-slot":`body`,class:J(f.value.body({class:G(a).ui?.body}))},[N(e.$slots,`body`,{close:c})],2),i.footer?(I(),U(`div`,{key:1,"data-slot":`footer`,class:J(f.value.footer({class:G(a).ui?.footer}))},[N(e.$slots,`footer`,{close:c})],2)):R(``,!0)])]),_:2},1040,[`data-side`,`class`])]),_:2},1024)]),_:2},1040,[`force-mount`])]),_:3},16))}},Yt=[`data-expanded`,`data-overflowing`],Xt={key:0,class:`fade pointer-events-none absolute inset-x-0 bottom-6 h-10`},Zt={key:1,class:`mt-1 flex justify-start`},Qt=[`aria-expanded`],$t=u(X({__name:`ExpandableText`,props:{lines:{default:5}},setup(e){let t=e,n=j(!1),r=j(!1),i=j(null),a=`expandable-${Math.random().toString(36).slice(2,8)}`;function o(){let e=i.value;e&&!n.value&&(r.value=e.scrollHeight>e.clientHeight+1)}let s=null;T(()=>{o(),typeof ResizeObserver<`u`&&i.value&&(s=new ResizeObserver(()=>o()),s.observe(i.value))}),ne(()=>s?.disconnect()),S(n,e=>{e||Promise.resolve().then(o)});function c(){n.value=!n.value}function l(e){!n.value&&r.value&&(e.target?.closest?.(`a`)||(n.value=!0))}return(e,o)=>(I(),U(`div`,{class:J([`expandable group relative`,!n.value&&r.value?`cursor-pointer`:``]),"data-expanded":n.value?`1`:`0`,"data-overflowing":r.value?`1`:`0`,onClick:l},[H(`div`,{id:a,ref_key:`body`,ref:i,class:J([`body`,n.value?``:`clamped`]),style:ee(n.value?void 0:{"--expandable-lines":String(t.lines)})},[N(e.$slots,`default`,{},void 0,!0)],6),!n.value&&r.value?(I(),U(`div`,Xt)):R(``,!0),r.value||n.value?(I(),U(`div`,Zt,[H(`button`,{type:`button`,class:`more cursor-pointer text-xs text-dimmed group-hover:text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":n.value?`true`:`false`,"aria-controls":a,onClick:le(c,[`stop`])},K(n.value?`Show less`:`Show more`),9,Qt)])):R(``,!0)],10,Yt))}}),[[`__scopeId`,`data-v-ce3bfa89`]]),en=[`id`],tn={class:`what`},nn={key:0,class:`text-dimmed`},rn={key:1,class:`dur tabular-nums text-dimmed`},an=[`title`],on=X({__name:`SpanRow`,props:{item:{}},setup(e){return(t,n)=>(I(),U(`li`,{id:`span-${e.item.spanId}`,class:`span flex items-baseline gap-2 py-0.5 pr-(--sb-gutter) font-mono text-xs text-muted`},[H(`span`,{class:J([`glyph select-none`,e.item.status===`error`?`text-bad`:`text-dimmed`])},K(e.item.open?`◌`:e.item.status===`error`?`✗`:`◷`),3),H(`span`,tn,K(e.item.text),1),e.item.open?(I(),U(`span`,nn,`…`)):e.item.durationMs===void 0?R(``,!0):(I(),U(`span`,rn,K(G(ze)(e.item.durationMs,`precise`)),1)),e.item.at===void 0?R(``,!0):(I(),U(`span`,{key:2,class:`ts ml-auto select-none text-dimmed`,title:G(We)(e.item.at)},K(G(Ge)(e.item.at)),9,an))],8,en))}}),sn=[`data-position`],cn={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-ok`},ln=[`href`],un={key:1,class:`caption font-normal normal-case tracking-normal text-dimmed`},dn=[`title`],fn=X({__name:`ReplyBlock`,props:{text:{},caption:{},when:{},whenTitle:{},position:{},files:{}},setup(e){return(t,n)=>(I(),U(`section`,{id:`reply`,class:J([`block rounded-lg border border-ok/40 bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,e.position===`first`?`mb-4`:`mt-6`]),"data-position":e.position},[H(`h2`,cn,[n[0]||=H(`span`,null,`Reply`,-1),e.caption.href?(I(),U(`a`,{key:0,class:`caption font-normal normal-case tracking-normal text-dimmed no-underline hover:text-primary hover:underline`,href:e.caption.href,target:`_blank`,rel:`noopener noreferrer`},K(e.caption.text),9,ln)):(I(),U(`span`,un,K(e.caption.text),1)),H(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:e.whenTitle},K(e.when),9,dn)]),A(Z,{text:e.text},null,8,[`text`]),e.files.length>0?(I(),M(pt,{key:0,files:e.files},null,8,[`files`])):R(``,!0)],10,sn))}}),pn={id:`units`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},mn={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},hn={class:`count font-normal normal-case tracking-normal text-dimmed`},gn={class:`m-0 list-none p-0`},_n=[`data-unit`],vn=[`href`],yn=[`href`],bn=[`href`],xn=X({__name:`RunUnitsBlock`,props:{units:{}},setup(e){let t={merged:`border-ok/30 text-ok`,merge_ready:`border-ok/30 text-ok`,done:`border-ok/30 text-ok`};function n(e){return e.ending?e.ending.kind:e.threads.coding===void 0?`not started`:`round ${e.rounds.at(-1)?.index??0} · ${e.rounds.at(-1)?.agent??`in flight`}`}return(r,i)=>(I(),U(`section`,pn,[H(`h2`,mn,[i[0]||=H(`span`,null,`Units`,-1),H(`span`,hn,`· `+K(e.units.length)+` unit`+K(e.units.length===1?``:`s`)+` — each opens to its runs in round order`,1)]),H(`ol`,gn,[(I(!0),U(O,null,W(e.units,e=>(I(),U(`li`,{key:e.unit,class:`unit flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 border-t border-default py-1.5 first:border-t-0`,"data-unit":e.unit},[H(`a`,{class:`key shrink-0 rounded border border-accented px-1.5 font-mono text-[0.72rem] font-medium text-toned no-underline hover:border-primary hover:text-primary`,href:`/runs/unit/${encodeURIComponent(e.unit)}`},K(e.id),9,vn),H(`a`,{class:`title min-w-0 flex-1 truncate text-sm text-highlighted no-underline hover:underline`,href:`/runs/unit/${encodeURIComponent(e.unit)}`},K(e.title??e.branch),9,yn),H(`span`,{class:J([`standing shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,t[e.ending?.kind??``]??`border-accented text-muted`])},K(n(e)),3),e.pr?(I(),U(`a`,{key:0,class:`prlink shrink-0 whitespace-nowrap font-mono text-xs text-primary no-underline hover:underline`,href:e.pr.url,target:`_blank`,rel:`noopener noreferrer`},[A(Ye,{class:`mr-1 align-[-0.125em]`}),F(`#`+K(e.pr.number),1)],8,bn)):R(``,!0)],8,_n))),128))])]))}}),Sn={id:`children`,class:`block mb-4 px-(--sb-gutter)`},Cn={class:`mb-1 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},wn={class:`count font-normal normal-case tracking-normal text-dimmed`},Tn={class:`m-0 list-none border-t border-muted p-0`},En=X({__name:`RunChildrenBlock`,props:{children:{},now:{}},setup(e){return(t,n)=>(I(),U(`section`,Sn,[H(`h2`,Cn,[n[0]||=H(`span`,null,`Spawned runs`,-1),H(`span`,wn,`· `+K(e.children.length)+` run`+K(e.children.length===1?``:`s`)+`, in the order they started`,1)]),H(`ol`,Tn,[(I(!0),U(O,null,W(e.children,t=>(I(),M(mt,{key:t.id,run:t,now:e.now},null,8,[`run`,`now`]))),128))])]))}});function Dn(e){return e.description?.title?e.description.title:e.pr.repo&&e.pr.number!==void 0?`${e.pr.repo}#${e.pr.number}`:e.pr.repo??`PR review`}var On=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,kn=/^[0-9a-f]{7,40}$/;function An(e){if(!e.repo||!On.test(e.repo))return{};let t=`https://github.com/${e.repo}`,n={};return e.number!==void 0&&Number.isInteger(e.number)&&e.number>0&&(n.pr=`${t}/pull/${e.number}`,n.files=`${t}/pull/${e.number}/files`),e.headSha&&kn.test(e.headSha)&&(n.commit=e.number!==void 0&&n.pr?`${t}/pull/${e.number}/commits/${e.headSha}`:`${t}/commit/${e.headSha}`),n}function jn(e){return e.find(e=>e.poweredBy===`meat`)??e.find(e=>e.poweredBy===`git`)??null}function Mn(e){return e===`meat`?`An abridged reading of the change: a model dropped what a reviewer need not read (style, imports, boilerplate) and kept the concepts`:`The complete change, base…head, as git reports it`}function Nn(e){return`The recorded diff was cut at ${e.toLocaleString(`en-US`)} characters; open the full diff on GitHub for the rest`}function Pn(e){return e===`meat`?`reading diff · meat`:`full diff · git`}function Fn(e){let t=[];return e.origin===`parsed`&&!e.complete&&t.push(`read back from the PR body`),e.truncated&&t.push(`the body was cut before it was read`),t.length>0?t.join(`; `):void 0}var In=e=>typeof e==`object`&&!!e,$=e=>typeof e==`string`&&e!==``,Ln=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;function Rn(e){for(let t of e.split(/\n\s*\n/)){let e=t.split(`
|
|
3
|
+
`).map(e=>e.trim()).filter(e=>e!==``);if(!(e.length===0||e.every(e=>e.startsWith(`#`))))return e.join(`
|
|
4
|
+
`)}}function zn(e,t){let n=t.trim().toLowerCase(),r=[],i=!1,a=!1;for(let t of e.split(`
|
|
5
|
+
`)){/^\s*```/.test(t)&&(i=!i);let e=i?null:/^##\s+(.+?)\s*$/.exec(t);if(e){if(a)break;a=e[1].toLowerCase()===n;continue}a&&r.push(t)}let o=r.join(`
|
|
6
|
+
`).trim();return o===``?void 0:o}function Bn(e){if(!$(e.title)||e.origin!==`submitted`&&e.origin!==`parsed`)return;let t=typeof e.body==`string`?e.body:``,n=$(e.tldr)?e.tldr:Rn(t),r=zn(t,`What & why`);return{title:e.title,...n===void 0?{}:{tldr:n},...r===void 0?{}:{whatWhy:r},origin:e.origin,complete:e.complete===!0,truncated:e.truncated===!0}}function Vn(){let e=Te({pr:{},readingDiffs:[],ready:!1});return{state:e,handle(t){if(!In(t))return;let n=t;if(n.type===`run_meta`)$(n.repo)&&(e.pr.repo=n.repo),Ln(n.pr)&&(e.pr.number=n.pr),typeof n.headSha==`string`&&kn.test(n.headSha)&&(e.pr.headSha=n.headSha);else if(n.type===`review_artifact`&&n.artifact===`reading_diff`){if(!$(n.diff)||n.poweredBy!==`git`&&n.poweredBy!==`meat`)return;let t={poweredBy:n.poweredBy,baseRef:$(n.baseRef)?n.baseRef:`HEAD`,diff:n.diff,truncated:n.truncated===!0,...$(n.summary)?{summary:n.summary}:{}},r=e.readingDiffs.findIndex(e=>e.poweredBy===t.poweredBy);r>=0?e.readingDiffs.splice(r,1,t):e.readingDiffs.push(t),e.ready=!0}else if(n.type===`review_artifact`&&n.artifact===`pr_description`){let t=Bn(n);t&&(e.description=t)}}}}var Hn=3e3,Un={fetch:(...e)=>globalThis.fetch(...e),delay:e=>new Promise(t=>setTimeout(t,e))};function Wn(e,t,n={}){let{fetch:r,delay:i}={...Un,...n},a=Te({state:{state:`absent`}}),o=!1,s=!1;async function c(t){let n=await r(`/api/review.abridge`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,...t?{force:!0}:{}})}),i=await n.json().catch(()=>null);if(!n.ok)throw Error(typeof i?.error==`string`?i.error:`HTTP ${n.status}`);return i??{}}async function l(){let n=!1,i;for(let a=0;a<50;a++){let a=`id=${encodeURIComponent(e)}${i===void 0?``:`&after-seq=${i}`}`,s=await r(`/api/runs.events?${a}`,{credentials:`same-origin`});if(o)return`disposed`;if(!s.ok)throw Error(`HTTP ${s.status}`);let c=await s.json();if(o)return`disposed`;for(let e of c.events??[]){t(e);let r=e;r.type===`review_artifact`&&r.artifact===`reading_diff`&&r.poweredBy===`meat`&&(n=!0)}if(typeof c.nextAfterSeq!=`number`)return n?`found`:`missing`;if(i!==void 0&&c.nextAfterSeq<=i)return`stuck`;i=c.nextAfterSeq}return`stuck`}async function u(e){try{let t=await c(e);for(let e=0;t.state===`running`;e++){if(e>=200){s=!1,a.state={state:`failed`,reason:`still running after the page stopped waiting; ask again later`};return}if(await i(Hn),o)return;t=await c(!1)}if(o)return;if(t.state===`failed`)s=!0,a.state={state:`failed`,reason:typeof t.reason==`string`?t.reason:`unknown reason`};else if(t.state===`done`){let e=await l();if(e===`disposed`)return;s=!1,a.state=e===`found`?{state:`done`}:{state:`failed`,reason:e===`stuck`?`the run's record did not page to its end`:`the abridged diff did not appear on the run's record`}}else s=!1,a.state={state:`failed`,reason:`unexpected answer: ${String(t.state)}`}}catch(e){if(o)return;s=!1,a.state={state:`failed`,reason:e instanceof Error?e.message:String(e)}}}return{get state(){return a.state},start(){if(a.state.state===`running`||o)return;let e=a.state.state===`failed`&&s;a.state={state:`running`},u(e)},dispose(){o=!0}}}var Gn={slots:{base:`font-medium inline-flex items-center`,label:`truncate`,leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailingIcon:`shrink-0`},variants:{fieldGroup:{horizontal:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`,vertical:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},variant:{solid:``,outline:``,soft:``,subtle:``},size:{xs:{base:`text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},sm:{base:`text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},md:{base:`text-xs px-2 py-1 gap-1 rounded-md`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`},lg:{base:`text-sm px-2 py-1 gap-1.5 rounded-md`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`},xl:{base:`text-base px-2.5 py-1 gap-1.5 rounded-md`,leadingIcon:`size-6`,leadingAvatarSize:`2xs`,trailingIcon:`size-6`}},square:{true:``}},compoundVariants:[{color:`primary`,variant:`solid`,class:`bg-primary text-inverted`},{color:`secondary`,variant:`solid`,class:`bg-secondary text-inverted`},{color:`success`,variant:`solid`,class:`bg-success text-inverted`},{color:`info`,variant:`solid`,class:`bg-info text-inverted`},{color:`warning`,variant:`solid`,class:`bg-warning text-inverted`},{color:`error`,variant:`solid`,class:`bg-error text-inverted`},{color:`primary`,variant:`outline`,class:`text-primary ring ring-inset ring-primary/50`},{color:`secondary`,variant:`outline`,class:`text-secondary ring ring-inset ring-secondary/50`},{color:`success`,variant:`outline`,class:`text-success ring ring-inset ring-success/50`},{color:`info`,variant:`outline`,class:`text-info ring ring-inset ring-info/50`},{color:`warning`,variant:`outline`,class:`text-warning ring ring-inset ring-warning/50`},{color:`error`,variant:`outline`,class:`text-error ring ring-inset ring-error/50`},{color:`primary`,variant:`soft`,class:`bg-primary/10 text-primary`},{color:`secondary`,variant:`soft`,class:`bg-secondary/10 text-secondary`},{color:`success`,variant:`soft`,class:`bg-success/10 text-success`},{color:`info`,variant:`soft`,class:`bg-info/10 text-info`},{color:`warning`,variant:`soft`,class:`bg-warning/10 text-warning`},{color:`error`,variant:`soft`,class:`bg-error/10 text-error`},{color:`primary`,variant:`subtle`,class:`bg-primary/10 text-primary ring ring-inset ring-primary/25`},{color:`secondary`,variant:`subtle`,class:`bg-secondary/10 text-secondary ring ring-inset ring-secondary/25`},{color:`success`,variant:`subtle`,class:`bg-success/10 text-success ring ring-inset ring-success/25`},{color:`info`,variant:`subtle`,class:`bg-info/10 text-info ring ring-inset ring-info/25`},{color:`warning`,variant:`subtle`,class:`bg-warning/10 text-warning ring ring-inset ring-warning/25`},{color:`error`,variant:`subtle`,class:`bg-error/10 text-error ring ring-inset ring-error/25`},{color:`neutral`,variant:`solid`,class:`text-inverted bg-inverted`},{color:`neutral`,variant:`outline`,class:`ring ring-inset ring-accented text-default bg-default`},{color:`neutral`,variant:`soft`,class:`text-default bg-elevated`},{color:`neutral`,variant:`subtle`,class:`ring ring-inset ring-accented text-default bg-elevated`},{size:`xs`,square:!0,class:`p-0.5`},{size:`sm`,square:!0,class:`p-1`},{size:`md`,square:!0,class:`p-1`},{size:`lg`,square:!0,class:`p-1`},{size:`xl`,square:!0,class:`p-1`}],defaultVariants:{color:`primary`,variant:`solid`,size:`md`}},Kn={__name:`Badge`,props:{as:{type:null,required:!1,default:`span`},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(e){let t=e,n=_(),r=k(`badge`,t),i=b(),{orientation:a,size:o}=pe(t),{isLeading:s,isTrailing:c,leadingIconName:l,trailingIconName:u}=ge(r),d=B(()=>ve({extend:Gn,...i.ui?.badge||{}})({color:r.color,variant:r.variant,size:o.value??r.size,square:r.square||!n.default&&!r.label,fieldGroup:a.value}));return(e,t)=>(I(),M(G(h),{as:G(r).as,"data-slot":`base`,class:J(d.value.base({class:[G(r).ui?.base,G(r).class]}))},{default:x(()=>[N(e.$slots,`leading`,{ui:d.value},()=>[G(s)&&G(l)?(I(),M(z,{key:0,name:G(l),"data-slot":`leadingIcon`,class:J(d.value.leadingIcon({class:G(r).ui?.leadingIcon}))},null,8,[`name`,`class`])):G(r).avatar?(I(),M(V,D({key:1,size:G(r).ui?.leadingAvatarSize||d.value.leadingAvatarSize()},G(r).avatar,{"data-slot":`leadingAvatar`,class:d.value.leadingAvatar({class:G(r).ui?.leadingAvatar})}),null,16,[`size`,`class`])):R(``,!0)]),N(e.$slots,`default`,{ui:d.value},()=>[G(r).label!==void 0&&G(r).label!==null?(I(),U(`span`,{key:0,"data-slot":`label`,class:J(d.value.label({class:G(r).ui?.label}))},K(G(r).label),3)):R(``,!0)]),N(e.$slots,`trailing`,{ui:d.value},()=>[G(c)&&G(u)?(I(),M(z,{key:0,name:G(u),"data-slot":`trailingIcon`,class:J(d.value.trailingIcon({class:G(r).ui?.trailingIcon}))},null,8,[`name`,`class`])):R(``,!0)])]),_:3},8,[`as`,`class`]))}},qn={slots:{root:`flex items-center gap-2`,list:`relative flex p-1 group`,indicator:`absolute transition-[translate,width] duration-200 ease-out motion-reduce:transition-none`,trigger:[`group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,label:`truncate`,trailingBadge:`shrink-0`,trailingBadgeSize:`sm`,content:`w-full rounded-md focus-visible:outline-3`},variants:{color:{primary:{content:`outline-primary/25`},secondary:{content:`outline-secondary/25`},success:{content:`outline-success/25`},info:{content:`outline-info/25`},warning:{content:`outline-warning/25`},error:{content:`outline-error/25`},neutral:{content:`outline-inverted/25`}},variant:{pill:{list:`bg-elevated rounded-lg`,trigger:[`grow`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate`],indicator:`rounded-md shadow-xs`},link:{list:`border-default`,indicator:`rounded-full`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full`}},orientation:{horizontal:{root:`flex-col`,list:`w-full`,indicator:`left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)`,trigger:`justify-center`},vertical:{list:`flex-col`,indicator:`top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)`}},size:{xs:{trigger:`px-2 py-1 text-xs gap-1`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},sm:{trigger:`px-2.5 py-1.5 text-xs gap-1.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},md:{trigger:`px-3 py-1.5 text-sm gap-1.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},lg:{trigger:`px-3 py-2 text-sm gap-2`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},xl:{trigger:`px-3 py-2 text-base gap-2`,leadingIcon:`size-6`,leadingAvatarSize:`xs`}}},compoundVariants:[{orientation:`horizontal`,variant:`pill`,class:{indicator:`inset-y-1`}},{orientation:`horizontal`,variant:`link`,class:{list:`border-b -mb-px`,indicator:`-bottom-px h-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px`}},{orientation:`vertical`,variant:`pill`,class:{indicator:`inset-x-1`,list:`items-center`,trigger:`w-full justify-center`}},{orientation:`vertical`,variant:`link`,class:{list:`border-s -ms-px`,indicator:`-start-px w-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px`}},{color:`primary`,variant:`pill`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary`]}},{color:`secondary`,variant:`pill`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary`]}},{color:`success`,variant:`pill`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success`]}},{color:`info`,variant:`pill`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info`]}},{color:`warning`,variant:`pill`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning`]}},{color:`error`,variant:`pill`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error`]}},{color:`neutral`,variant:`pill`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted`]}},{color:`primary`,variant:`link`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary`]}},{color:`secondary`,variant:`link`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary`]}},{color:`success`,variant:`link`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-success outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success`]}},{color:`info`,variant:`link`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-info outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info`]}},{color:`warning`,variant:`link`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning`]}},{color:`error`,variant:`link`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-error outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error`]}},{color:`neutral`,variant:`link`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted`]}}],defaultVariants:{color:`primary`,variant:`pill`,size:`md`}},Jn={__name:`Tabs`,props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:`value`},labelKey:{type:null,required:!1,default:`label`},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:`0`},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=_(),o=k(`tabs`,r),s=b(),c=P(_e(o,`as`,`unmountOnHide`),i),l=B(()=>ve({extend:qn,...s.ui?.tabs||{}})({color:o.color,variant:o.variant,size:o.size,orientation:o.orientation})),u=j([]);function d(e,t){u.value[e]=t}return t({triggersRef:u}),(e,t)=>(I(),M(G(zt),D(G(c),{"model-value":G(o).modelValue,"default-value":G(o).defaultValue,orientation:G(o).orientation,"activation-mode":G(o).activationMode,"data-slot":`root`,class:l.value.root({class:[G(o).ui?.root,G(o).class]})}),{default:x(()=>[A(G(Wt),{"data-slot":`list`,class:J(l.value.list({class:G(o).ui?.list}))},{default:x(()=>[A(G(Ut),{"data-slot":`indicator`,class:J(l.value.indicator({class:G(o).ui?.indicator}))},null,8,[`class`]),N(e.$slots,`list-leading`),(I(!0),U(O,null,W(G(o).items,(t,n)=>(I(),M(G(Gt),{key:G(E)(t,G(o).valueKey)??n,ref_for:!0,ref:e=>d(n,e),value:G(E)(t,G(o).valueKey)??String(n),disabled:t.disabled,"data-slot":`trigger`,class:J(l.value.trigger({class:[G(o).ui?.trigger,t.ui?.trigger]}))},{default:x(()=>[N(e.$slots,`leading`,{item:t,index:n,ui:l.value},()=>[t.icon?(I(),M(z,{key:0,name:t.icon,"data-slot":`leadingIcon`,class:J(l.value.leadingIcon({class:[G(o).ui?.leadingIcon,t.ui?.leadingIcon]}))},null,8,[`name`,`class`])):t.avatar?(I(),M(V,D({key:1,size:t.ui?.leadingAvatarSize||G(o).ui?.leadingAvatarSize||l.value.leadingAvatarSize()},{ref_for:!0},t.avatar,{"data-slot":`leadingAvatar`,class:l.value.leadingAvatar({class:[G(o).ui?.leadingAvatar,t.ui?.leadingAvatar]})}),null,16,[`size`,`class`])):R(``,!0)]),G(E)(t,G(o).labelKey)||a.default?(I(),U(`span`,{key:0,"data-slot":`label`,class:J(l.value.label({class:[G(o).ui?.label,t.ui?.label]}))},[N(e.$slots,`default`,{item:t,index:n},()=>[F(K(G(E)(t,G(o).labelKey)),1)])],2)):R(``,!0),N(e.$slots,`trailing`,{item:t,index:n,ui:l.value},()=>[t.badge||t.badge===0?(I(),M(Kn,D({key:0,color:`neutral`,variant:`outline`,size:t.ui?.trailingBadgeSize||G(o).ui?.trailingBadgeSize||l.value.trailingBadgeSize()},{ref_for:!0},typeof t.badge==`string`||typeof t.badge==`number`?{label:t.badge}:t.badge,{"data-slot":`trailingBadge`,class:l.value.trailingBadge({class:[G(o).ui?.trailingBadge,t.ui?.trailingBadge]})}),null,16,[`size`,`class`])):R(``,!0)])]),_:2},1032,[`value`,`disabled`,`class`]))),128)),N(e.$slots,`list-trailing`)]),_:3},8,[`class`]),G(o).content?(I(!0),U(O,{key:0},W(G(o).items,(t,n)=>(I(),M(G(Ht),{key:G(E)(t,G(o).valueKey)??n,value:G(E)(t,G(o).valueKey)??String(n),"data-slot":`content`,class:J(l.value.content({class:[G(o).ui?.content,t.ui?.content,t.class]}))},{default:x(()=>[N(e.$slots,t.slot||`content`,{item:t,index:n,ui:l.value},()=>[F(K(t.content),1)])]),_:2},1032,[`value`,`class`]))),128)):R(``,!0)]),_:3},16,[`model-value`,`default-value`,`orientation`,`activation-mode`,`class`]))}},Yn;function Xn(){return Yn??=Fe(()=>import(`./dist-pOdUzj6D.js`),__vite__mapDeps([0,1,2,3,4])),Yn}var Zn={key:0,class:`overflow-x-auto rounded-lg border border-(--ui-border) p-3 font-mono text-xs whitespace-pre text-(--ui-text)`,"data-testid":`diff-raw`},Qn=X({__name:`FileDiffs`,props:{diff:{},theme:{},diffStyle:{}},setup(e){let t=e,n=j(null),r=j(!1),i=[],a=0;function o(){for(let e of i)try{e.cleanUp()}catch{}i=[],n.value&&(n.value.innerHTML=``)}async function s(){let e=++a;r.value=!1;try{let{FileDiff:r,parsePatchFiles:s}=await Xn();if(e!==a||!n.value)return;o();let c=s(t.diff).flatMap(e=>e.files);for(let e of c){let a=document.createElement(`diffs-container`);a.dataset.file=e.name,n.value.appendChild(a);let o=new r({themeType:t.theme,diffStyle:t.diffStyle??`unified`});o.render({fileDiff:e,fileContainer:a}),i.push(o)}}catch{e===a&&(r.value=!0)}}return T(s),S(()=>t.diff,s),S(()=>t.theme,s),S(()=>t.diffStyle,s),Ce(()=>{a++,o()}),(t,i)=>r.value?(I(),U(`pre`,Zn,K(e.diff),1)):(I(),U(`div`,{key:1,ref_key:`container`,ref:n,class:`space-y-4`,"data-testid":`file-diffs`},null,512))}});async function $n(e){let{parsePatchFiles:t}=await Xn(),n=t(e).flatMap(e=>e.files).map(e=>({path:e.name,additions:e.hunks.reduce((e,t)=>e+t.additionLines,0),deletions:e.hunks.reduce((e,t)=>e+t.deletionLines,0)}));return{files:n,additions:n.reduce((e,t)=>e+t.additions,0),deletions:n.reduce((e,t)=>e+t.deletions,0)}}function er(e,t){if(e.length<=t)return e;let n=Math.max(1,t-1),r=Math.ceil(n/2),i=Math.floor(n/2);return`${e.slice(0,r)}…${e.slice(e.length-i)}`}var tr={dockerfile:`docker`,makefile:`makefile`,"go.mod":`go`,"go.sum":`go`,".gitignore":`gitignore`,".dockerignore":`dockerignore`},nr={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,vue:`vue`,svelte:`svelte`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,scala:`scala`,ex:`elixir`,exs:`elixir`,json:`json`,jsonc:`json`,yaml:`yaml`,yml:`yaml`,toml:`toml`,xml:`xml`,html:`html`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,md:`markdown`,mdx:`mdx`,sh:`bash`,bash:`bash`,zsh:`zsh`,sql:`sql`,tf:`terraform`,hcl:`hcl`,dockerfile:`docker`};function rr(e){let t=(e.split(`/`).pop()||e).toLowerCase(),n=tr[t];if(n)return n;let r=t.lastIndexOf(`.`);return r===-1?`text`:nr[t.slice(r+1)]??`text`}var ir={javascript:`i-simple-icons-javascript`,typescript:`i-simple-icons-typescript`,vue:`i-simple-icons-vuedotjs`,jsx:`i-simple-icons-react`,tsx:`i-simple-icons-react`,svelte:`i-simple-icons-svelte`,html:`i-simple-icons-html5`,css:`i-simple-icons-css`,scss:`i-simple-icons-sass`,sass:`i-simple-icons-sass`,less:`i-simple-icons-less`,python:`i-simple-icons-python`,go:`i-simple-icons-go`,rust:`i-simple-icons-rust`,java:`i-simple-icons-openjdk`,c:`i-simple-icons-c`,cpp:`i-simple-icons-cplusplus`,csharp:`i-simple-icons-csharp`,php:`i-simple-icons-php`,ruby:`i-simple-icons-ruby`,elixir:`i-simple-icons-elixir`,scala:`i-simple-icons-scala`,swift:`i-simple-icons-swift`,kotlin:`i-simple-icons-kotlin`,json:`i-simple-icons-json`,yaml:`i-simple-icons-yaml`,toml:`i-simple-icons-toml`,xml:`i-simple-icons-xml`,sql:`i-lucide-database`,markdown:`i-simple-icons-markdown`,mdx:`i-simple-icons-mdx`,bash:`i-simple-icons-gnubash`,zsh:`i-simple-icons-gnubash`,docker:`i-simple-icons-docker`,dockerignore:`i-simple-icons-docker`,terraform:`i-simple-icons-terraform`,hcl:`i-simple-icons-terraform`,makefile:`i-lucide-hammer`,gitignore:`i-simple-icons-git`,text:`i-lucide-file-text`};function ar(e){return ir[e]??ir.text}function or(e){return ar(rr(e))}var sr={key:0,class:`flex items-center gap-2 p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`files-loading`},cr={key:1,class:`p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`no-files`},lr={class:`shrink-0 border-b border-(--ui-border) @2xl:w-72 @2xl:border-b-0 @2xl:border-r`,"data-testid":`file-list`},ur={class:`@2xl:sticky @2xl:top-0 @2xl:max-h-[calc(100dvh-11rem)] @2xl:overflow-y-auto @2xl:py-3`},dr=[`aria-expanded`],fr={class:`ml-auto tabular-nums`,"data-testid":`pr-totals`},pr={class:`text-(--ui-success)`},mr={class:`text-(--ui-error)`},hr={key:1,class:`flex items-center justify-between gap-2 px-3 pb-2 text-xs text-(--ui-text-dimmed)`},gr={"data-testid":`file-count`},_r={class:`tabular-nums`,"data-testid":`pr-totals`},vr={class:`text-(--ui-success)`},yr={class:`text-(--ui-error)`},br=[`title`,`aria-current`,`onClick`],xr={class:`min-w-0 flex-1 whitespace-nowrap`},Sr={class:`shrink-0 text-[11px] tabular-nums`},Cr={class:`text-(--ui-success)`},wr={class:`text-(--ui-error)`},Tr=34,Er=X({__name:`FilesChanged`,props:{diff:{},notes:{},diffStyle:{}},setup(e){let t=e,n=ae(),r=B(()=>n.value===`dark`?`dark`:`light`),i=j([]),a=j(!0),o=j(null),s=w(`panel`),c=w(`root`),{width:l}=he(c);S(c,e=>{e&&(l.value=e.getBoundingClientRect().width)});let u=B(()=>l.value>0&&l.value<672),d=j(!1),f=B(()=>u.value?`unified`:t.diffStyle??`unified`),p=0;async function m(){let e=++p;a.value=!0;let n=await $n(t.diff);e===p&&(i.value=n.files,o.value=null,a.value=!1)}S(()=>t.diff,m,{immediate:!0});let h=B(()=>i.value.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}));function g(e){o.value=e,u.value&&(d.value=!1);let t=s.value?.querySelectorAll(`[data-file]`)??[];Array.from(t).find(t=>t.dataset.file===e)?.scrollIntoView({block:`start`,behavior:`smooth`})}return(t,n)=>{let l=z;return a.value?(I(),U(`div`,sr,[A(l,{name:`i-lucide-loader-circle`,class:`size-4 animate-spin`}),n[1]||=H(`span`,null,`Loading diff…`,-1)])):i.value.length===0?(I(),U(`p`,cr,` Nothing in this diff parsed as a file. `)):(I(),U(`div`,{key:2,ref_key:`root`,ref:c,class:`@container flex min-h-full flex-col @2xl:flex-row`,"data-testid":`files-changed`},[H(`aside`,lr,[H(`div`,ur,[u.value?(I(),U(`button`,{key:0,type:`button`,class:`flex w-full items-center gap-2 px-3 py-2.5 text-xs text-(--ui-text-muted)`,"aria-expanded":d.value,"data-testid":`files-fold`,onClick:n[0]||=e=>d.value=!d.value},[A(l,{name:d.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5 shrink-0 text-(--ui-text-dimmed)`},null,8,[`name`]),H(`span`,null,K(i.value.length)+` `+K(i.value.length===1?`file`:`files`)+` changed`,1),H(`span`,fr,[H(`span`,pr,`+`+K(h.value.additions),1),H(`span`,mr,`−`+K(h.value.deletions),1)])],8,dr)):(I(),U(`div`,hr,[H(`span`,gr,K(i.value.length)+` `+K(i.value.length===1?`file`:`files`),1),H(`span`,_r,[H(`span`,vr,`+`+K(h.value.additions),1),H(`span`,yr,`−`+K(h.value.deletions),1)])])),!u.value||d.value?(I(),U(`ul`,{key:2,class:J([`flex flex-col`,u.value?`pb-2`:``])},[(I(!0),U(O,null,W(i.value,e=>(I(),U(`li`,{key:e.path},[H(`button`,{type:`button`,class:J([`flex w-full min-w-0 items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors hover:bg-accented/50 dark:hover:bg-(--ui-bg)`,o.value===e.path?`bg-accented/50 text-(--ui-text) dark:bg-(--ui-bg)`:`text-(--ui-text-muted)`]),title:e.path,"aria-current":o.value===e.path?`true`:void 0,"data-testid":`file-entry`,onClick:t=>g(e.path)},[A(l,{name:G(or)(e.path),class:`size-3.5 shrink-0`},null,8,[`name`]),H(`span`,xr,K(G(er)(e.path,Tr)),1),H(`span`,Sr,[H(`span`,Cr,`+`+K(e.additions),1),H(`span`,wr,`−`+K(e.deletions),1)])],10,br)]))),128))],2)):R(``,!0)])]),H(`div`,{ref_key:`panel`,ref:s,class:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`diff-column`},[(I(!0),U(O,null,W(e.notes,e=>(I(),U(`p`,{key:e,class:`px-3 pt-3 text-xs text-(--ui-text-muted)`,"data-testid":`diff-note`},K(e),1))),128)),A(Qn,{diff:e.diff,theme:r.value,"diff-style":f.value},null,8,[`diff`,`theme`,`diff-style`])],512)],512))}}}),Dr=X({__name:`LabelTip`,props:{text:{},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let r=Ne;return I(),M(r,{text:e.text,disabled:e.disabled,"delay-duration":250,content:{side:`bottom`,align:`end`,sideOffset:6,collisionPadding:8},ui:{content:`h-auto max-w-[28rem] px-2.5 py-1.5`,text:`text-clip whitespace-normal leading-snug`}},{default:x(()=>[N(t.$slots,`default`)]),_:3},8,[`text`,`disabled`])}}}),Or={class:`pr-review-panel @container flex h-full min-h-0 min-w-0 flex-col`,"data-testid":`pr-review-panel`},kr={class:`shrink-0 border-b border-(--ui-border) px-4 pt-5 pb-4 sm:px-6`},Ar={class:`flex flex-col gap-3 @2xl:flex-row @2xl:items-start @2xl:justify-between @2xl:gap-4`},jr={class:`min-w-0`},Mr={class:`line-clamp-2 text-lg leading-snug font-semibold text-(--ui-text) @2xl:line-clamp-none @2xl:truncate`,"data-testid":`pr-title`},Nr={class:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--ui-text-muted)`,"data-testid":`pr-facts`},Pr=[`href`],Fr={key:1,class:`inline-flex items-center gap-1.5`},Ir=[`href`],Lr={title:`the base the diff is against`},Rr={"data-testid":`producer-label`},zr={class:`inline-flex items-center gap-1 text-(--ui-warning)`,"data-testid":`truncated-label`},Br={class:`flex shrink-0 flex-wrap items-center gap-2`},Vr={key:1,class:`inline-flex shrink-0 items-center gap-1.5 text-xs text-(--ui-text-muted)`,"data-testid":`abridge-running`},Hr={key:2,class:`inline-flex min-w-0 shrink items-center gap-1.5 text-xs text-(--ui-error)`,"data-testid":`abridge-failed`},Ur=[`title`],Wr={key:0,class:`flex shrink-0 items-center justify-between gap-3 border-b border-(--ui-border) px-4 py-2 sm:px-6`},Gr={class:`tabs-scroll min-w-0 overflow-x-auto`},Kr={class:`min-h-0 flex-1 overflow-y-auto`},qr={key:1,class:`mx-auto max-w-3xl p-4 sm:p-6`,"data-testid":`pr-description`},Jr={key:2,class:`mt-4 text-xs text-(--ui-text-dimmed) italic`,"data-testid":`description-origin`},Yr={key:2,class:`px-4 py-3 text-sm text-(--ui-text-muted) sm:px-6`,"data-testid":`no-diff`},Xr=`switchboard:diffStyle`,Zr=`Abridge the full diff with meat.dev: a model keeps the concepts and drops what a reviewer need not read. One model call; usually a minute or three.`,Qr=X({__name:`PrReviewPanel`,props:{data:{},closable:{type:Boolean,default:!1},abridge:{default:void 0}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=B(()=>An(n.data.pr)),a=B(()=>Dn(n.data)),o=B(()=>n.data.readingDiffs),s=B(()=>n.data.description),c=B(()=>o.value.find(e=>e.poweredBy===`git`)),l=B(()=>o.value.find(e=>e.poweredBy===`meat`)),u=B(()=>n.data.pr.headSha?.slice(0,7)),d=B(()=>{let e=[];return c.value&&e.push({label:`Files changed`,value:`files`}),l.value&&e.push({label:`Reading diff`,value:`reading`}),(s.value?.tldr||s.value?.whatWhy)&&e.push({label:`Description`,value:`description`}),e}),f=()=>jn(o.value)?.poweredBy===`meat`?`reading`:`files`,p=j(f());S(()=>jn(o.value),()=>p.value=f()),S(d,e=>{e.some(e=>e.value===p.value)||(p.value=e[0]?.value??`files`)},{immediate:!0});let m=B(()=>p.value===`files`?c.value:p.value===`reading`?l.value:void 0),h=B(()=>{let e=m.value;if(!e)return[];let t=[];return e.summary&&t.push(e.summary),e.truncated&&t.push(`${Nn(e.diff.length)}.`),t}),g=B(()=>s.value?Fn(s.value):void 0),ee=[{label:`Inline`,value:`unified`,icon:`i-lucide-rows-3`},{label:`Side by side`,value:`split`,icon:`i-lucide-columns-2`}],_=j(`unified`);T(()=>{try{localStorage.getItem(Xr)===`split`&&(_.value=`split`)}catch{}});function te(e){_.value=e===`split`?`split`:`unified`;try{localStorage.setItem(Xr,_.value)}catch{}}let v=B(()=>n.abridge!==void 0&&n.abridge.state.state!==`done`&&c.value!==void 0&&!l.value);return(t,n)=>{let o=z,c=ue,l=Jn;return I(),U(`div`,Or,[H(`header`,kr,[H(`div`,Ar,[H(`div`,jr,[H(`h1`,Mr,K(a.value),1),H(`div`,Nr,[i.value.pr?(I(),U(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`inline-flex items-center gap-1.5 hover:text-(--ui-text)`,"data-testid":`pr-link`},[A(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),H(`span`,null,K(e.data.pr.repo)+`#`+K(e.data.pr.number),1)],8,Pr)):e.data.pr.repo?(I(),U(`span`,Fr,[A(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),H(`span`,null,K(e.data.pr.repo),1)])):R(``,!0),i.value.commit?(I(),U(`a`,{key:2,href:i.value.commit,target:`_blank`,rel:`noopener noreferrer`,class:`font-mono hover:text-(--ui-text)`,"data-testid":`commit-link`},K(u.value),9,Ir)):R(``,!0),m.value?(I(),U(O,{key:3},[H(`span`,Lr,`against origin/`+K(m.value.baseRef),1),A(Dr,{text:G(Mn)(m.value.poweredBy)},{default:x(()=>[H(`span`,Rr,K(G(Pn)(m.value.poweredBy)),1)]),_:1},8,[`text`]),m.value.truncated?(I(),M(Dr,{key:0,text:G(Nn)(m.value.diff.length)},{default:x(()=>[H(`span`,zr,[A(o,{name:`i-lucide-scissors`,class:`size-3.5`}),n[4]||=F(`truncated `,-1)])]),_:1},8,[`text`])):R(``,!0)],64)):R(``,!0)])]),H(`div`,Br,[i.value.pr?(I(),M(c,{key:0,label:`View on GitHub`,icon:`i-simple-icons-github`,color:`neutral`,variant:`ghost`,size:`sm`,to:i.value.pr,target:`_blank`,"data-testid":`github-button`},null,8,[`to`])):R(``,!0),v.value&&e.abridge?(I(),U(O,{key:1},[e.abridge.state.state===`absent`?(I(),M(Dr,{key:0,text:Zr},{default:x(()=>[A(c,{label:`Abridge with meat`,icon:`i-lucide-scissors`,size:`sm`,"data-testid":`abridge-button`,onClick:n[0]||=t=>e.abridge.start()})]),_:1})):e.abridge.state.state===`running`?(I(),U(`span`,Vr,[A(o,{name:`i-lucide-loader-circle`,class:`size-3.5 animate-spin`}),n[5]||=F(` Abridging… usually 1–3 minutes `,-1)])):e.abridge.state.state===`failed`?(I(),U(`span`,Hr,[A(o,{name:`i-lucide-circle-alert`,class:`size-3.5 shrink-0`}),H(`span`,{class:`truncate`,title:e.abridge.state.reason},`Abridging failed: `+K(e.abridge.state.reason),9,Ur),A(c,{size:`xs`,color:`neutral`,variant:`outline`,label:`Retry`,"data-testid":`abridge-retry`,onClick:n[1]||=t=>e.abridge.start()})])):R(``,!0)],64)):R(``,!0),e.closable?(I(),M(c,{key:2,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,"aria-label":`Close`,"data-testid":`panel-close`,onClick:n[2]||=e=>r(`close`)})):R(``,!0)])])]),d.value.length>0?(I(),U(`div`,Wr,[H(`div`,Gr,[A(l,{modelValue:p.value,"onUpdate:modelValue":n[3]||=e=>p.value=e,items:d.value,size:`sm`,class:`w-fit gap-0`,content:!1,"data-testid":`panel-tabs`},null,8,[`modelValue`,`items`])]),m.value?(I(),M(l,{key:0,"model-value":_.value,items:ee,color:`neutral`,size:`xs`,content:!1,class:`hidden w-fit @2xl:flex`,"data-testid":`diff-style`,"onUpdate:modelValue":te},null,8,[`model-value`])):R(``,!0)])):R(``,!0),H(`div`,Kr,[m.value?(I(),M(Er,{key:m.value.poweredBy,diff:m.value.diff,notes:h.value,"diff-style":_.value},null,8,[`diff`,`notes`,`diff-style`])):p.value===`description`&&s.value?(I(),U(`div`,qr,[n[7]||=H(`div`,{class:`mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What the pull request says about itself`,-1),s.value.tldr?(I(),M(Z,{key:0,text:s.value.tldr,class:`text-sm`,"data-testid":`description-tldr`},null,8,[`text`])):R(``,!0),s.value.whatWhy?(I(),U(O,{key:1},[n[6]||=H(`div`,{class:`mt-4 mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What & why`,-1),A(Z,{text:s.value.whatWhy,class:`text-sm`,"data-testid":`description-what-why`},null,8,[`text`])],64)):R(``,!0),g.value?(I(),U(`p`,Jr,K(g.value),1)):R(``,!0)])):(I(),U(`p`,Yr,` No reading diff was produced for this review. `))])])}}}),$r={class:`conn flex items-center gap-2 font-mono`},ei={key:0,class:`ok text-ok`,role:`img`,"aria-label":`succeeded`},ti=[`data-heat`],ni={key:2,id:`delivery`,class:`text-xs text-muted`},ri=[`title`],ii={key:0,id:`actions`,class:`actions flex gap-1.5`},ai={class:`mx-auto max-w-6xl`},oi={key:0,id:`runmeta`,class:`runmeta facts mb-3 flex flex-wrap items-baseline gap-x-3 gap-y-1.5 px-(--sb-gutter) font-mono text-xs text-dimmed`},si={class:`agent text-[0.68rem] font-medium uppercase tracking-wider text-toned`},ci={class:`model`},li={key:0,class:`effort`},ui=[`href`],di={key:2,class:`repo`},fi=[`href`],pi={key:4,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned`},mi=[`href`,`title`],hi=[`href`],gi={key:1,id:`request`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},_i={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},vi={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},yi=[`href`],bi={key:1},xi={key:1},Si=[`title`],Ci={key:5,id:`references`,class:`group mb-4 px-(--sb-gutter)`},wi={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},Ti={class:`count font-normal normal-case tracking-normal text-dimmed`},Ei={id:`referencedthreads`,class:`pb-1 pl-5`},Di={class:`flex items-baseline gap-2 font-mono text-xs text-dimmed`},Oi=[`href`],ki=[`title`],Ai={class:`quoted mt-1 whitespace-pre-wrap break-words font-mono text-xs opacity-85`},ji={key:6,id:`context`,class:`group mb-4 px-(--sb-gutter)`},Mi={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},Ni={class:`count font-normal normal-case tracking-normal text-dimmed`},Pi={id:`contextturns`,class:`pb-1 pl-5`},Fi=[`title`],Ii={id:`thisrun`,class:`mb-2 flex items-baseline gap-2.5 px-(--sb-gutter) font-mono text-xs font-medium uppercase tracking-wider text-muted`},Li={key:0,class:`count font-normal normal-case tracking-normal text-dimmed`},Ri=[`aria-pressed`,`data-open`,`title`],zi={id:`log`,class:`m-0 list-none p-0`},Bi={key:0,id:`placeholder`,class:`empty text-muted`},Vi=[`id`],Hi={class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 pr-(--sb-gutter) font-mono text-xs tabular-nums text-dimmed`},Ui=[`title`],Wi=[`title`],Gi=[`title`],Ki=[`href`],qi={key:3,class:`nonar font-sans italic`},Ji=[`title`],Yi=[`data-phase`],Xi=[`aria-expanded`,`onClick`],Zi={class:`glyph select-none text-dimmed`},Qi={class:`what`},$i={key:0,class:`m-0 list-none p-0 pl-4`},ea={key:4,class:`followup block mt-5 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},ta={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},na={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},ra=[`href`],ia={key:1},aa=[`title`],oa={key:5,class:`mt-5`},sa=[`open`],ca={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},la={key:0,class:`font-normal normal-case tracking-normal text-dimmed`},ua=[`title`],da=[`title`],fa={key:1,id:`thinking`,class:`pending ml-3.5 mt-5 flex items-center gap-3 rounded-md border border-dashed border-accented pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 text-sm first:mt-0`,"aria-live":`off`,title:`the model is working on its next turn — nothing back yet (since the last event, runner clock)`},pa=[`title`],ma={class:`verb min-w-0 truncate text-toned`},ha=X({__name:`RunPage`,setup(e){let t=De(`run`),n=t?.mode===`history`,r=n?`Run`:`Live run`,i=n,a=t?.artifacts??null,o=t?.children??[],s=(t?.mode===`history`?t.units:void 0)??[],l=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,u=rt({openTags:l?l.split(`,`).map(e=>e.trim()).filter(Boolean):void 0}),d=u.state,p=j(n?`ended`:`connecting`),m=j(``),h=Ie(),g=t?.mode===`live`?nt(t,h.value):null,_=j(void 0),v=j({}),y=B(()=>{if(n&&t?.mode===`history`)return t.status===`completed`?{ok:!0,cls:``,word:`succeeded`}:{ok:!1,cls:t.status===`failed`||t.status===`stopped_hard`||t.status===`interrupted`?`red`:t.status===`stopped_soft`?`amber`:`grey`,word:t.status?Ue(t.status):`ended`};let e=d.stopMode;return{ok:!1,cls:e===`hard`?`red`:e===`soft`?`amber`:`grey`,word:e===`hard`?`killed`:e===`soft`?`stopped early`:`ended`}}),b=B(()=>n&&t?.mode===`history`?t.durationMs:_.value),ne=B(()=>dt(n&&t?.mode===`history`?{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk}:v.value)),C=B(()=>b.value===void 0?``:ze(b.value,`clock`)),w=B(()=>Ve(b.value,`run`)),re=B(()=>Be(w.value)),ie={red:`border-bad/30 text-bad`,amber:`border-warn/30 text-warn`,grey:`border-accented text-muted`},ae=B(()=>m.value?m.value:p.value===`connecting`?`connecting…`:p.value===`disconnected`?`disconnected`:p.value===`stopping`?`stopping (${d.stopMode??`soft`})`:p.value===`finished`?_.value===void 0?`delivering…`:`delivering… · ${ze(_.value,`clock`)}`:g?`running · ${ze(g.elapsedMs(h.value),`clock`)}`:`running`),oe=B(()=>m.value||p.value===`disconnected`?`text-bad`:p.value===`running`?`text-ok motion-safe:animate-pulse`:p.value===`finished`?`text-ok`:`text-warn motion-safe:animate-pulse`),se=B(()=>{if(!t||t.mode!==`live`&&t.mode!==`history`)return null;d.traceVersion;let e=t.receivedAt??t.startedAt,n=lt(d.meta?.agent);if(t.mode===`history`){let r=t.durationMs??(t.finishedAt===void 0?0:Math.max(0,t.finishedAt-e));return ft({spans:u.spanSet(),losses:u.losses(e),window:{start:e,end:e+r},owner:n,totalMs:r,phase:`ended`,delivery:{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk},...t.truncated===void 0?{}:{truncated:t.truncated},...t.untimed?{untimed:!0}:{},callTitle:u.callHeadline})}if(!g)return null;let r=p.value===`ended`?`ended`:p.value===`finished`?`delivering`:`live`,i=r===`live`?g.elapsedMs(h.value):_.value??g.elapsedMs(h.value);return ft({spans:u.spanSet(),losses:u.losses(e),window:{start:e,end:e+i},owner:n,totalMs:i,phase:r,delivery:v.value,callTitle:u.callHeadline})}),E=n&&t?.mode===`history`?`/runs/${encodeURIComponent(t.id)}/events`:void 0;function ce(e){u.reveal(e)&&te().then(()=>{let t=document.getElementById(e);t&&(t.scrollIntoView?.({block:`center`}),t.classList.add(`revealed`),setTimeout(()=>t.classList.remove(`revealed`),1500))})}let D=j(n),k=j(!1);function de(e){t?.mode===`live`&&(e!==`hard`||c.confirm(`Hard stop: abort the run now with no summary and free its sandbox?`))&&(k.value=!0,fetch(`${t.stopUrl}&mode=${encodeURIComponent(e)}`,{method:`POST`,credentials:`same-origin`}).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status}`);fe(e)}).catch(e=>{k.value=!1,m.value=`stop failed: ${e instanceof Error?e.message:`error`}`}))}function fe(e){u.markStopping(e),D.value=!0,(p.value===`connecting`||p.value===`running`)&&(p.value=`stopping`)}S(()=>d.stopMode,e=>{e&&p.value!==`ended`&&p.value!==`disconnected`&&p.value!==`finished`&&fe(e)}),n||S(p,e=>c.setFavicon(e===`ended`||e===`disconnected`||e===`finished`?St:bt),{immediate:!0});let pe=B(()=>!n&&p.value!==`ended`&&p.value!==`disconnected`&&p.value!==`finished`),me=B(()=>pe.value?Xe(d,h.value):null);Ee(ht,me),Ee(tt,a),Ee(st,B(()=>d.reply!==null));let N=B(()=>pe.value?ct(d,u.pendingCall(),h.value):null),he=[`Thinking`,`Pondering`,`Mulling it over`,`Reasoning`,`Cogitating`,`Weighing options`,`Puzzling`,`Deliberating`,`Noodling`,`Chewing on it`,`Ruminating`,`Reticulating splines`],ge=B(()=>N.value?.kind===`thinking`?se.value?.openStep||he[Math.floor(N.value.elapsedMs/6e3)%he.length]:``);function _e(){u.setAllOpen(!d.allOpen)}let P=B(()=>d.log.filter(e=>e.kind===`step`).length),ve=B(()=>{for(let e=d.log.length-1;e>=0;e--){let t=d.log[e];if(t.kind===`note`&&t.noteKind===`notes`)return t.key}}),ye=j(null);function be(){return window.innerHeight+window.scrollY>=document.body.scrollHeight-60}let L=Vn(),xe=j(!1),Se=t?.mode===`history`&&t.capabilities.readingDiffAbridge?Wn(t.id,e=>L.handle(e)):void 0;Ce(()=>Se?.dispose());function we(e){let t=be();u.handle(e),L.handle(e),t&&requestAnimationFrame(()=>ye.value?.scrollIntoView?.({block:`nearest`}))}let Te=xt(),V=null;if(t?.mode===`history`){for(let e of t.events)u.handle(e),L.handle(e);u.closePhases()}T(()=>{if(t?.mode!==`live`)return;V=Te(t.eventsUrl),V.onopen=()=>{d.stopMode||(p.value=`running`)};let e=0;V.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}if(n.type!==`replay_note`){let n=Number(t.lastEventId);if(n>0){if(n<=e)return;e=n}}we(n)},V.addEventListener(`replay_elided`,e=>{let t=gt(e);t&&u.noteElided(t)}),V.addEventListener(`finished`,e=>{let t=Qe(e);t&&g&&(_.value=g.elapsedAt(t.finishedAt)),t&&(v.value={...v.value,finishedAt:t.finishedAt}),D.value=!0,(p.value===`connecting`||p.value===`running`)&&(p.value=`finished`)}),V.addEventListener(`end`,e=>{u.flushPendingTurn(`the run ended here`),u.closePhases(),D.value=!0,_.value??=g?.elapsedMs(h.value),v.value={...v.value,...it(e)},p.value=`ended`,V?.close()}),V.onerror=()=>{V&&V.readyState===2&&(p.value=`disconnected`)}}),Ce(()=>{V?.close()});function Oe(e){return e&&/^https?:\/\//.test(e)?e:``}let ke=B(()=>Oe(d.request?.source?.url)),q=B(()=>{let e=d.meta;return{repo:Ze(e?.repo),tree:Je(e?.repo,e?.ref),commit:Ke(e?.repo,e?.headSha),pr:_t(e?.repo,e?.pr)}}),Ae=B(()=>vt({meta:d.meta,requestText:d.request?.text??``,prOpened:d.prOpened}));function Y(e){return typeof e==`number`?Re(e,h.value):``}function X(e){return typeof e==`number`?We(e):void 0}return(e,t)=>{let n=ue,a=Ne,c=z,l=Jt;return I(),M(f,{title:G(r),nav:`runs`},{leading:x(()=>[...t[4]||=[H(`a`,{class:`back text-sm text-primary no-underline hover:underline`,href:`/runs`},`← All runs`,-1)]]),status:x(()=>[H(`span`,$r,[p.value===`ended`?(I(),U(O,{key:0},[y.value.ok?(I(),U(`span`,ei,`✓`)):(I(),U(`span`,{key:1,class:J([`chip rounded border px-1.5 text-[0.7rem]`,ie[y.value.cls]])},K(y.value.word),3)),H(`span`,{id:`state`,class:J([`dur text-xs tabular-nums`,[re.value?`heat`:`text-muted`,w.value.level>=2?`font-medium`:``]]),style:ee(re.value),"data-heat":w.value.level},K(C.value),15,ti),ne.value?(I(),U(`span`,ni,`· `+K(ne.value),1)):R(``,!0)],64)):(I(),U(O,{key:1},[H(`span`,{id:`statedot`,class:J([`pulse text-[1.1em] leading-none`,oe.value])},`∿`,2),H(`span`,{id:`state`,class:J([`text-xs tabular-nums`,m.value?`text-bad`:`text-muted`]),title:p.value===`running`&&!m.value?`the whole run, since we received the message`:p.value===`finished`?`the agent stopped; the reply is being posted`:void 0},K(ae.value),11,ri)],64))])]),actions:x(()=>[D.value?R(``,!0):(I(),U(`span`,ii,[A(a,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:x(()=>[A(n,{size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:k.value,onClick:t[0]||=e=>de(`soft`)},null,8,[`disabled`])]),_:1}),A(a,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:x(()=>[A(n,{size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:k.value,onClick:t[1]||=e=>de(`hard`)},null,8,[`disabled`])]),_:1})]))]),default:x(()=>[H(`div`,ai,[G(d).meta?(I(),U(`div`,oi,[H(`span`,si,K(G(d).meta.agent),1),H(`span`,ci,K(G(d).meta.model),1),G(d).meta.effort?(I(),U(`span`,li,K(G(d).meta.effort)+` effort`,1)):R(``,!0),q.value.repo?(I(),U(`a`,{key:1,class:`text-primary no-underline hover:underline`,href:q.value.repo,target:`_blank`,rel:`noopener noreferrer`},K(G(d).meta.repo),9,ui)):G(d).meta.repo?(I(),U(`span`,di,K(G(d).meta.repo),1)):R(``,!0),q.value.tree?(I(),U(`a`,{key:3,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned no-underline hover:border-primary hover:text-primary`,href:q.value.tree,target:`_blank`,rel:`noopener noreferrer`,title:`the branch on GitHub`},K(G(d).meta.ref),9,fi)):G(d).meta.ref?(I(),U(`span`,pi,K(G(d).meta.ref),1)):R(``,!0),q.value.commit&&G(d).meta.headSha?(I(),U(`a`,{key:5,class:`sha tabular-nums text-toned no-underline hover:text-primary hover:underline`,href:q.value.commit,target:`_blank`,rel:`noopener noreferrer`,title:`the head commit ${G(d).meta.headSha}`},K(G(qe)(G(d).meta.headSha)),9,mi)):R(``,!0),q.value.pr?(I(),U(`a`,{key:6,class:`prlink whitespace-nowrap text-primary no-underline hover:underline`,href:q.value.pr,target:`_blank`,rel:`noopener noreferrer`},[A(Ye,{class:`mr-1 align-[-0.125em]`}),F(`#`+K(G(d).meta.pr),1)],8,hi)):R(``,!0),G(L).state.ready?(I(),U(`button`,{key:7,type:`button`,class:`reading-diff ml-auto inline-flex cursor-pointer items-center gap-1 whitespace-nowrap text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"data-testid":`reading-diff-button`,onClick:t[2]||=e=>xe.value=!0},[A(c,{name:`i-lucide-git-compare`,class:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[5]||=F(` Reading diff `,-1)])):R(``,!0)])):R(``,!0),G(d).request?(I(),U(`section`,gi,[H(`h2`,_i,[t[6]||=H(`span`,null,`Request`,-1),G(d).request.source?(I(),U(`span`,vi,[G(d).request.source.channel?(I(),U(O,{key:0},[A(He),ke.value?(I(),U(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:ke.value,target:`_blank`,rel:`noopener noreferrer`,title:`open the thread`},`#`+K(G(d).request.source.channel),9,yi)):(I(),U(`span`,bi,`#`+K(G(d).request.source.channel),1))],64)):R(``,!0),G(d).request.source.user?(I(),U(`span`,xi,K(G(d).request.source.user),1)):R(``,!0)])):R(``,!0),H(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:X(G(d).request.at)},K(Y(G(d).request.at)),9,Si)]),A($t,{lines:3},{default:x(()=>[A(Z,{text:G(d).request.text},null,8,[`text`])]),_:1}),G(d).request.files.length>0?(I(),M(pt,{key:0,files:G(d).request.files},null,8,[`files`])):R(``,!0)])):R(``,!0),G(d).reply&&G(i)?(I(),M(fn,{key:2,position:`first`,text:G(d).reply.text,caption:Ae.value,when:Y(G(d).reply.at),"when-title":X(G(d).reply.at),files:G(d).reply.files},null,8,[`text`,`caption`,`when`,`when-title`,`files`])):R(``,!0),G(s).length>0?(I(),M(xn,{key:3,units:G(s)},null,8,[`units`])):R(``,!0),G(o).length>0?(I(),M(En,{key:4,children:G(o),now:G(h)},null,8,[`children`,`now`])):R(``,!0),G(d).references.length>0?(I(),U(`details`,Ci,[H(`summary`,wi,[t[7]||=H(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),H(`span`,null,`Referenced thread`+K(G(d).references.length===1?``:`s`),1),H(`span`,Ti,`· `+K(G(d).references.length)+` thread`+K(G(d).references.length===1?``:`s`),1)]),H(`div`,Ei,[(I(!0),U(O,null,W(G(d).references,e=>(I(),U(`div`,{key:e.key,class:`reference border-t border-default py-1.5 first-of-type:border-t-0`},[H(`div`,Di,[H(`a`,{class:`text-muted no-underline hover:text-primary hover:underline`,href:e.url,target:`_blank`,rel:`noopener noreferrer`},`#`+K(e.channelName),9,Oi),H(`span`,null,`· `+K(e.messages)+` message`+K(e.messages===1?``:`s`),1),H(`span`,{class:`ts ml-auto shrink-0 select-none`,title:X(e.at)},K(Y(e.at)),9,ki)]),H(`div`,Ai,[(I(!0),U(O,null,W(G(et)(e.text),(e,t)=>(I(),U(`div`,{key:t},K(e),1))),128))])]))),128))])])):R(``,!0),G(d).context.length>0?(I(),U(`details`,ji,[H(`summary`,Mi,[t[8]||=H(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[9]||=H(`span`,null,`Earlier in this thread`,-1),H(`span`,Ni,`· `+K(G(d).context.length)+` turn`+K(G(d).context.length===1?``:`s`),1)]),H(`div`,Pi,[(I(!0),U(O,null,W(G(d).context,e=>(I(),U(`div`,{key:e.key,class:`turn flex items-baseline gap-3 border-t border-default py-1.5 opacity-85 first-of-type:border-t-0`},[A(Z,{text:e.text},null,8,[`text`]),H(`span`,{class:`ts ml-auto shrink-0 select-none font-mono text-xs text-dimmed`,title:X(e.at)},K(Y(e.at)),9,Fi)]))),128))])])):R(``,!0),H(`h2`,Ii,[t[10]||=H(`span`,null,`This run`,-1),P.value>0?(I(),U(`span`,Li,`· `+K(P.value)+` step`+K(P.value===1?``:`s`),1)):R(``,!0),H(`button`,{id:`fold`,type:`button`,class:`ml-auto cursor-pointer font-normal normal-case tracking-normal text-dimmed hover:text-toned focus-visible:outline-2 focus-visible:outline-primary`,"aria-pressed":G(d).allOpen?`true`:`false`,"data-open":G(d).allOpen?`1`:`0`,title:G(d).allOpen?`Close every call card`:`Open every call card`,onClick:_e},K(G(d).allOpen?`Collapse all`:`Expand all`),9,Ri)]),se.value?(I(),M(ot,{key:7,vm:se.value,"events-href":G(E),onReveal:ce},null,8,[`vm`,`events-href`])):R(``,!0),H(`ol`,zi,[G(d).placeholder?(I(),U(`li`,Bi,`Waiting for activity…`)):R(``,!0),(I(!0),U(O,null,W(G(d).log,e=>(I(),U(O,{key:e.key},[e.kind===`step`?(I(),M(ut,{key:0,step:e,class:`mt-5 first:mt-0`,onToggleGroup:t=>G(u).toggleGroup(e)},null,8,[`step`,`onToggleGroup`])):e.kind===`turn`?(I(),U(`li`,{key:1,id:`span-${e.turn.spanId}`,class:`turn mt-5 border-l-2 border-(--ui-border-accented)/50 pb-3 pl-3 pt-2`},[H(`div`,Hi,[H(`span`,{class:J([`thought`,e.turn.quick?``:`text-warn`]),title:e.turn.label},`thought `+K(e.turn.chip),11,Ui),e.turn.switched?(I(),U(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-medium text-warn`,title:`model changed: this turn ran on ${e.turn.model}`},`⇄ `+K(G(at)(e.turn.model)),9,Wi)):e.turn.showModel?(I(),U(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:e.turn.model},K(G(at)(e.turn.model)),9,Gi)):R(``,!0),(I(!0),U(O,null,W(e.turn.facts,(e,t)=>(I(),U(`span`,{key:t,class:`fact`},K(e),1))),128)),e.note&&e.noteHref?(I(),U(`a`,{key:2,class:`nonar font-sans italic text-dimmed no-underline hover:text-primary hover:underline`,href:e.noteHref},K(e.note),9,Ki)):e.note?(I(),U(`span`,qi,K(e.note),1)):R(``,!0),e.turn.at===void 0?R(``,!0):(I(),U(`span`,{key:4,class:`ts ml-auto select-none`,title:G(We)(e.turn.at)},K(G(Ge)(e.turn.at)),9,Ji))])],8,Vi)):e.kind===`span`?(I(),M(on,{key:2,item:e},null,8,[`item`])):e.kind===`phase`?(I(),U(`li`,{key:3,class:`phase py-0.5 font-mono text-xs`,"data-phase":e.phase},[H(`button`,{type:`button`,class:`phase-head flex w-full cursor-pointer items-baseline gap-2 text-left text-muted hover:text-toned`,"aria-expanded":e.open,onClick:le(t=>G(u).togglePhase(e),[`prevent`])},[H(`span`,Zi,K(e.open?`▾`:`▸`),1),H(`span`,{class:J([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,G($e)(e.phase)]),"aria-hidden":`true`},null,2),H(`span`,Qi,K(G(yt)(e)),1)],8,Xi),e.open?(I(),U(`ul`,$i,[(I(!0),U(O,null,W(e.rows,e=>(I(),M(on,{key:e.key,item:e},null,8,[`item`]))),128))])):R(``,!0)],8,Yi)):e.kind===`followup`?(I(),U(`li`,ea,[H(`h2`,ta,[t[11]||=H(`span`,null,`↪ Follow-up`,-1),e.input.source?.user?(I(),U(`span`,na,[Oe(e.input.source.url)?(I(),U(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:e.input.source.url,target:`_blank`,rel:`noopener noreferrer`,title:`open the message`},K(e.input.source.user),9,ra)):(I(),U(`span`,ia,K(e.input.source.user),1))])):R(``,!0),H(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:X(e.input.at)},K(Y(e.input.at)),9,aa)]),A(Z,{text:e.input.text},null,8,[`text`]),e.input.files.length>0?(I(),M(pt,{key:0,files:e.input.files},null,8,[`files`])):R(``,!0)])):e.noteKind===`notes`?(I(),U(`li`,oa,[H(`details`,{class:`notepad group rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-2`,open:e.key===ve.value},[H(`summary`,ca,[t[12]||=H(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[13]||=H(`span`,null,`📝 Notes for this thread`,-1),e.key===ve.value?R(``,!0):(I(),U(`span`,la,`· superseded`)),e.at===void 0?R(``,!0):(I(),U(`span`,{key:1,class:`ts ml-auto select-none font-normal normal-case tracking-normal text-dimmed`,title:G(We)(e.at)},K(G(Ge)(e.at)),9,ua))]),A(Z,{text:e.text,class:`mt-1 [&_h1]:mb-1.5 [&_h1]:mt-4 [&_h1]:font-mono [&_h1]:text-xs [&_h1]:font-medium [&_h1]:uppercase [&_h1]:tracking-wider [&_h1]:text-muted [&_h2]:mb-1.5 [&_h2]:mt-4 [&_h2]:font-mono [&_h2]:text-xs [&_h2]:font-medium [&_h2]:uppercase [&_h2]:tracking-wider [&_h2]:text-muted [&_h3]:mb-1.5 [&_h3]:mt-4 [&_h3]:font-mono [&_h3]:text-xs [&_h3]:font-medium [&_h3]:uppercase [&_h3]:tracking-wider [&_h3]:text-muted [&>:first-child]:mt-1`},null,8,[`text`])],8,sa)])):(I(),U(`li`,{key:6,class:J([`note mt-4 flex items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1.5`,e.replay?`text-dimmed`:`bg-warn/10 text-warn`])},[H(`span`,null,K((e.replay?`… `:`⏱ `)+e.text),1),e.at===void 0?R(``,!0):(I(),U(`span`,{key:0,class:`ts ml-auto select-none font-mono text-xs text-dimmed`,title:G(We)(e.at)},K(G(Ge)(e.at)),9,da))],2))],64))),128)),N.value?.kind===`thinking`?(I(),U(`li`,fa,[t[14]||=H(`span`,{class:`pulse text-[1.1em] leading-none text-info motion-safe:animate-pulse`},`∿`,-1),H(`span`,{class:`badge shrink-0 rounded bg-accented px-1.5 font-mono text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:G(d).model??void 0},K(G(at)(G(d).model)),9,pa),H(`span`,ma,K(ge.value)+`…`,1),H(`span`,{class:J([`since ml-auto shrink-0 font-mono text-xs tabular-nums`,N.value.slow?`text-warn`:`text-dimmed`])},K(G(ze)(N.value.elapsedMs,`clock`)),3)])):R(``,!0),H(`li`,{ref_key:`logEnd`,ref:ye,"aria-hidden":`true`},null,512)]),G(d).reply&&!G(i)?(I(),M(fn,{key:8,position:`last`,text:G(d).reply.text,caption:Ae.value,when:Y(G(d).reply.at),"when-title":X(G(d).reply.at),files:G(d).reply.files},null,8,[`text`,`caption`,`when`,`when-title`,`files`])):R(``,!0)]),A(l,{open:xe.value,"onUpdate:open":t[3]||=e=>xe.value=e,title:G(Dn)(G(L).state),ui:{overlay:`z-30`,content:`z-30 w-[min(96vw,90rem)] max-w-none`}},{content:x(({close:e})=>[A(Qr,{data:G(L).state,abridge:G(Se),closable:``,onClose:t=>e()},null,8,[`data`,`abridge`,`onClose`])]),_:1},8,[`open`,`title`])]),_:1},8,[`title`])}}}),ga=X({__name:`RunRoutePage`,setup(e){let t=oe(Oe,null);return(e,n)=>!G(t)||G(t).page===`runNotFound`?(I(),M(Le,{key:0})):(I(),M(ha,{key:1}))}});export{ga as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./AppShell-lYVcj-k7.js";import{Ci as r,Lr as i,Mr as a,Qn as o,Xt as s,_n as c,a as l,ci as u,cn as d,gn as f,i as p,ir as m,ln as h,nr as g,oi as _,on as v,r as y,sn as b,un as x,ur as S,vi as C,wi as w,xi as T,yn as E}from"./seed-DeKSHrt2.js";import{t as D}from"./Tooltip-qol5Boof.js";import{t as O}from"./wallClock-61NpVkY6.js";import{t as k}from"./RunsTabs-DEICQ4FY.js";import{t as A}from"./StatusDot-Ct6AtHhS.js";import{n as j,r as M,t as N}from"./indexFormat-B-pd4r7Y.js";import{C as P,D as F,E as I,S as L,_ as R,a as z,b as B,c as V,d as H,f as U,g as W,h as G,i as K,k as q,l as J,m as ee,o as te,p as ne,r as Y,s as re,t as ie,u as X,v as ae,w as oe,x as se,y as ce}from"./indexRow-Bnj883ii.js";import{t as le}from"./localIso-L06jV29p.js";import{n as Z,r as Q,t as $}from"./favicon-BQsePYv5.js";var ue={class:`flex items-baseline gap-1.5 whitespace-pre-line px-2 py-1 text-xs`},de={key:1,class:`text-dimmed`},fe=[`data-kind`,`aria-label`,`href`],pe=[`data-kind`,`aria-label`],me=E({__name:`SourceMark`,props:{kind:{},tip:{},url:{}},setup(e){let t=e,n=()=>Y[t.kind]??`○`,r=()=>K[t.kind]??t.kind;return(t,a)=>{let o=D;return m(),d(o,null,{content:i(()=>[b(`span`,ue,[e.kind===`slack`?(m(),d(q,{key:0})):C(Y)[e.kind]?(m(),x(`span`,de,w(n()),1)):h(``,!0),b(`span`,null,w(e.tip),1)])]),default:i(()=>[e.url?(m(),x(`a`,{key:0,class:`source linked pointer-events-auto w-[1.6em] shrink-0 rounded border border-transparent text-center text-[0.8rem] text-toned opacity-0 transition-opacity hover:border-primary/30 hover:bg-primary/10 hover:text-primary focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none`,"data-kind":e.kind,"aria-label":`open the ${r()} thread (new tab)`,href:e.url,target:`_blank`,rel:`noopener noreferrer`},`↗`,8,fe)):(m(),x(`span`,{key:1,class:T([`source pointer-events-auto w-[1.6em] shrink-0 text-center text-[0.8rem] text-dimmed opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none`,e.kind===`cli`?`text-[0.7rem]`:``]),"data-kind":e.kind,"aria-label":`source: ${r()}`},w(n()),11,pe))]),_:1})}}}),he=[`data-run-id`,`data-started-at`,`data-persisted`,`data-expires-at`],ge=[`href`,`aria-label`],_e={class:`pointer-events-auto flex items-center max-sm:order-1`},ve=[`data-agent-hue`],ye=[`href`],be={key:3,class:`snippet min-w-0 truncate text-muted max-sm:order-6 max-sm:basis-full max-sm:whitespace-normal max-sm:pl-5 max-sm:text-[0.8rem] max-sm:leading-snug max-sm:line-clamp-2 sm:flex-1`},xe={class:`hidden sm:contents`},Se={class:`expires pointer-events-auto shrink-0 font-mono text-xs tabular-nums text-warn max-sm:order-11`},Ce=[`data-heat`],we={class:`count shrink-0 text-right font-mono text-xs tabular-nums max-sm:order-9 max-sm:text-dimmed sm:min-w-[6em] sm:text-muted`},Te={class:`actions hidden min-w-[7.6em] shrink-0 justify-end gap-1.5 whitespace-nowrap sm:flex`},Ee=E({__name:`RunRow`,props:{run:{},now:{},retentionMs:{}},setup(n){let a=n,o=v(()=>M(a.run.label||W(a.run.id))),u=v(()=>ne(a.run,o.value.scope)),f=v(()=>ae(a.run)),p=v(()=>ee(a.run)),g=v(()=>P(a.run)),y=v(()=>G(a.run)),S=v(()=>X(a.run,a.retentionMs)),E=v(()=>S.value!==void 0&&S.value-a.now<=864e5),O=v(()=>!a.run.finished&&!a.run.stop),k=v(()=>I(a.run.finished&&typeof a.run.finishedAt==`number`?a.run.finishedAt-a.run.startedAt:void 0,`run`)),H=v(()=>F(k.value)),U=v(()=>a.run.finished&&a.run.status&&a.run.status!==`completed`?ce(a.run.status):``),q=v(()=>a.run.stop&&!(a.run.finished&&a.run.status)?L(a.run.stop):``),Y=_({soft:!1,hard:!1}),Z=v(()=>[...y.value?[{label:`Open ${K[g.value.kind]??g.value.kind} thread`,icon:`i-lucide-external-link`,to:y.value,target:`_blank`}]:[],...O.value?[{label:`Stop (soft)`,icon:`i-lucide-octagon-pause`,onSelect:()=>Q(`soft`)},{label:`Kill (hard)`,icon:`i-lucide-octagon-x`,color:`error`,onSelect:()=>Q(`hard`)}]:[]]);function Q(e){(e!==`hard`||t.confirm(`Hard stop: abort this run now with no summary and free its sandbox?`))&&(Y[e]=!0,fetch(se(a.run,e),{method:`POST`,credentials:`same-origin`}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`)}).catch(()=>{Y[e]=!1}))}function $(e){e.target?.closest(`a, button`)||t.navigate(p.value)}return(t,a)=>{let _=D,v=l,M=e;return m(),x(`li`,{class:T([`run group relative rounded-md border-b border-muted hover:bg-(--ui-bg-muted) focus-within:bg-(--ui-bg-muted)`,[n.run.finished?`finished`:`live`,E.value?`leaving`:``]]),"data-run-id":n.run.id,"data-started-at":String(n.run.startedAt),"data-persisted":n.run.persisted?`1`:void 0,"data-expires-at":S.value===void 0?void 0:String(S.value),onClick:$},[b(`a`,{class:`row absolute inset-0 rounded-md focus-visible:outline-2 focus-visible:outline-primary`,href:p.value,"aria-label":`open run ${n.run.label||C(W)(n.run.id)}`},null,8,ge),b(`div`,{class:T([`body pointer-events-none relative z-[1] flex min-w-0 flex-wrap items-center gap-x-2.5 px-2 max-sm:gap-y-1.5 max-sm:py-3 sm:flex-nowrap sm:py-2`,[n.run.finished?`text-muted`:``,E.value?`opacity-85`:``]])},[b(`span`,_e,[c(A,{tone:f.value,label:C(B)(n.run),tip:C(V)(n.run),pulse:!n.run.finished},null,8,[`tone`,`label`,`tip`,`pulse`])]),c(_,{text:C(oe)(n.run),ui:{text:`whitespace-pre-line`}},{default:i(()=>[b(`span`,{class:T([`when pointer-events-auto shrink-0 font-mono tabular-nums max-sm:order-7 max-sm:pl-5 max-sm:text-xs max-sm:text-dimmed sm:min-w-[8.5em] sm:text-[0.8rem]`,n.run.finished?`text-dimmed`:`text-muted`])},w(C(j)(n.run.startedAt,n.now)),3)]),_:1},8,[`text`]),o.value.agent?(m(),x(`span`,{key:0,class:T([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider max-sm:order-2`,[C(ie)[C(z)(o.value.agent)],n.run.finished?`opacity-55`:``]]),"data-agent-hue":C(z)(o.value.agent)},w(o.value.agent),11,ve)):h(``,!0),u.value?(m(),d(_,{key:1,text:u.value},{default:i(()=>[b(`a`,{class:`repo pointer-events-auto min-w-0 shrink-0 rounded border border-accented bg-accented/50 px-1.5 font-mono text-[0.72rem] font-medium leading-normal text-toned no-underline hover:border-(--ui-text-dimmed) hover:text-highlighted max-sm:order-3`,href:`https://github.com/${u.value}`,target:`_blank`,rel:`noopener noreferrer`},w(u.value.slice(u.value.indexOf(`/`)+1)),9,ye)]),_:1},8,[`text`])):(m(),x(`span`,{key:2,class:T([`scope min-w-0 shrink-0 truncate font-medium max-sm:order-3`,n.run.finished?`text-toned`:`text-highlighted`])},w(o.value.scope),3)),o.value.snippet===void 0?h(``,!0):(m(),x(`span`,be,w(o.value.snippet),1)),U.value?(m(),x(`span`,{key:4,class:T([`outcome shrink-0 rounded border px-1.5 font-mono text-[0.7rem] max-sm:order-10`,f.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},w(U.value),3)):h(``,!0),q.value?(m(),x(`span`,{key:5,class:T([`stopbadge shrink-0 rounded border px-1.5 font-mono text-[0.7rem] max-sm:order-10`,n.run.stop?.state===`stopped`?`border-accented text-muted`:`border-warn/30 text-warn`])},w(q.value),3)):h(``,!0),b(`span`,xe,[c(me,{kind:g.value.kind,tip:C(R)(n.run),url:y.value||void 0},null,8,[`kind`,`tip`,`url`])]),E.value&&S.value!==void 0?(m(),d(_,{key:6,text:`removed at ${C(le)(S.value)}`},{default:i(()=>[b(`span`,Se,`gone `+w(C(N)(S.value,n.now)),1)]),_:1},8,[`text`])):h(``,!0),c(_,{text:n.run.finished?`start to finish`:`running for`},{default:i(()=>[b(`span`,{class:T([`elapsed pointer-events-auto ml-auto shrink-0 text-right font-mono text-xs tabular-nums max-sm:order-4 sm:min-w-[4.5em]`,n.run.finished?[H.value?`heat`:`text-muted`,k.value.level>=2?`font-medium`:``]:`text-ok`]),style:r(n.run.finished?H.value:void 0),"data-heat":n.run.finished?k.value.level:void 0},w(C(J)(n.run,n.now)),15,Ce)]),_:1},8,[`text`]),a[2]||=b(`span`,{class:`hidden text-xs text-dimmed max-sm:order-8 max-sm:inline`,"aria-hidden":`true`},`·`,-1),c(_,{text:C(re)(n.run)},{default:i(()=>[b(`span`,we,w(C(te)(n.run)),1)]),_:1},8,[`text`]),b(`span`,Te,[O.value?(m(),x(s,{key:0},[c(_,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:i(()=>[c(v,{class:`pointer-events-auto`,size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:Y.soft,onClick:a[0]||=e=>Q(`soft`)},null,8,[`disabled`])]),_:1}),c(_,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:i(()=>[c(v,{class:`pointer-events-auto`,size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:Y.hard,onClick:a[1]||=e=>Q(`hard`)},null,8,[`disabled`])]),_:1})],64)):h(``,!0)]),Z.value.length>0?(m(),d(M,{key:7,items:Z.value,content:{align:`end`}},{default:i(()=>[c(v,{class:`pointer-events-auto -my-1.5 -mr-1 max-sm:order-5 sm:hidden`,size:`md`,color:`neutral`,variant:`ghost`,icon:`i-lucide-ellipsis-vertical`,"aria-label":`Run actions`})]),_:1},8,[`items`])):h(``,!0)],2)],10,he)}}}),De={class:`conn flex items-center gap-1.5`},Oe={id:`state`,class:`text-xs text-muted`},ke={class:`toolbar mb-1.5 flex items-center gap-4 px-2 text-xs text-muted`},Ae={id:`livecount`,class:`count font-mono tabular-nums`},je={class:`filter ml-auto inline-flex items-center gap-1.5`},Me={class:`toggle inline-flex cursor-pointer select-none items-center gap-1.5 text-toned hover:text-highlighted`},Ne=[`checked`],Pe={id:`retention`,class:`sr-only`},Fe={key:0,class:`banner mb-3 rounded-md border border-warn px-2.5 py-1.5 text-[0.8rem] text-warn`,role:`status`},Ie={id:`runs`,class:`m-0 list-none border-t border-muted p-0`},Le={key:0,id:`leaving`,class:`divider flex items-baseline gap-2 border-b border-dashed border-warn/40 px-2 pb-1.5 pt-3 font-mono text-[0.72rem] uppercase tracking-wider text-warn`,role:`separator`},Re={key:1,id:`empty`,class:`empty px-2 py-2 text-muted`},ze={key:1,class:`pager mt-3 flex items-baseline gap-2 px-2 text-[0.8rem] text-muted`,"aria-label":`Completed runs pages`},Be={class:`range font-mono tabular-nums text-dimmed`},Ve=[`href`],He=E({__name:`RunsIndexPage`,setup(e){let r=y(`runs`),l=r?.all??!1,T=r?.olderThan!==void 0,E=r?.retentionDays??null,j=E===null?void 0:E*864e5,M=p(E),P=_(new Map);for(let e of r?.rows??[])P.set(e.id,e);let F=O(r?.now),I=u({tone:`amber`,text:`connecting…`}),L=v(()=>[...P.values()].sort((e,t)=>t.startedAt-e.startedAt)),R=v(()=>L.value.filter(e=>!e.finished).length),z=v(()=>j===void 0?-1:L.value.findIndex(e=>{let t=X(e,j);return t!==void 0&&t-F.value<=864e5})),B=v(()=>z.value===-1?L.value:L.value.slice(0,z.value)),V=v(()=>z.value===-1?[]:L.value.slice(z.value)),W=l?`All runs`:`Live runs`;a(R,e=>{t.setTitle((e>0?`(${e}) `:``)+W),t.setFavicon(e>0?Z:$)},{immediate:!0});function G(e){t.navigate(e.target.checked?`/runs?all=1`:`/runs`)}let K=v(()=>r?.olderThan===void 0?``:N(r.olderThan,F.value)),q=Q(),J=null;return o(()=>{J=q(l?`/runs?stream=1&all=1`:`/runs?stream=1`);let e=!1;J.onopen=()=>{if(e){t.reload();return}e=!0,I.value={tone:`green`,text:`connected`}},J.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=t.type===`removed`?t.id:t.run?.id,r=n?P.get(n):void 0;if(T&&!r)return;let i=H(t,l,r?.persisted===!0);i.op===`upsert`?P.set(i.run.id,U(P.get(i.run.id),i.run)):i.op===`remove`&&P.delete(i.id)},J.onerror=()=>{J&&J.readyState===2?I.value={tone:`red`,text:`disconnected`}:I.value={tone:`amber`,text:`connecting…`}}}),g(()=>{J?.close()}),(e,t)=>{let a=D;return m(),d(n,{title:C(W),nav:`runs`},{status:i(()=>[b(`span`,De,[c(A,{tone:I.value.tone,label:I.value.text},null,8,[`tone`,`label`]),b(`span`,Oe,w(I.value.text),1)])]),default:i(()=>[c(k,{current:`runs`}),b(`div`,ke,[b(`span`,Ae,w(R.value)+` running`,1),b(`span`,je,[b(`label`,Me,[b(`input`,{id:`showdone`,type:`checkbox`,class:`accent-(--ui-bg-inverted)`,checked:C(l),"aria-describedby":`retention`,onChange:G},null,40,Ne),t[0]||=f(` Show completed `,-1)]),c(a,{text:C(M)},{default:i(()=>[...t[1]||=[b(`span`,{class:`help inline-flex size-[1.1em] cursor-help items-center justify-center rounded-full border border-accented text-[0.7rem] leading-none text-dimmed hover:border-(--ui-text-dimmed) hover:text-toned`,tabindex:`0`},`?`,-1)]]),_:1},8,[`text`]),b(`span`,Pe,w(C(M)),1)])]),C(r)?.storeUnavailable?(m(),x(`p`,Fe,w(C(r).storeUnavailable),1)):h(``,!0),b(`ul`,Ie,[(m(!0),x(s,null,S(B.value,e=>(m(),d(Ee,{key:e.id,run:e,now:C(F),"retention-ms":C(j)},null,8,[`run`,`now`,`retention-ms`]))),128)),V.value.length>0?(m(),x(`li`,Le,[...t[2]||=[b(`span`,{"aria-hidden":`true`,class:`text-sm tracking-normal`},`⏳`,-1),b(`span`,{class:`whitespace-nowrap`},`Leaving within a day`,-1),b(`span`,{class:`normal-case tracking-normal text-dimmed max-sm:hidden`},`— each row says when it is removed`,-1)]])):h(``,!0),(m(!0),x(s,null,S(V.value,e=>(m(),d(Ee,{key:e.id,run:e,now:C(F),"retention-ms":C(j)},null,8,[`run`,`now`,`retention-ms`]))),128)),L.value.length===0?(m(),x(`li`,Re,w(C(l)?`No runs.`:`No active runs.`),1)):h(``,!0)]),C(l)&&(C(r)?.olderHref||C(r)?.olderThan!==void 0)?(m(),x(`nav`,ze,[C(r)?.olderThan===void 0?h(``,!0):(m(),x(s,{key:0},[t[3]||=b(`a`,{class:`text-primary hover:underline`,href:`/runs?all=1`},`← Newest runs`,-1),b(`span`,Be,`· runs finished before `+w(K.value),1)],64)),C(r)?.olderHref?(m(),x(`a`,{key:1,class:`older ml-auto text-primary hover:underline`,href:C(r).olderHref},`Older runs →`,8,Ve)):h(``,!0)])):h(``,!0)]),_:1},8,[`title`])}}});export{He as default};
|
|
1
|
+
import{a as e,n as t,t as n}from"./AppShell-lYVcj-k7.js";import{Ci as r,Lr as i,Mr as a,Qn as o,Xt as s,_n as c,a as l,ci as u,cn as d,gn as f,i as p,ir as m,ln as h,nr as g,oi as _,on as v,r as y,sn as b,un as x,ur as S,vi as C,wi as w,xi as T,yn as E}from"./seed-DeKSHrt2.js";import{t as D}from"./Tooltip-B0Ob5MQ4.js";import{t as O}from"./wallClock-61NpVkY6.js";import{t as k}from"./RunsTabs-DEICQ4FY.js";import{t as A}from"./StatusDot-D14iJMy7.js";import{n as j,r as M,t as N}from"./indexFormat-B-pd4r7Y.js";import{C as P,D as F,E as I,S as L,_ as R,a as z,b as B,c as V,d as H,f as U,g as W,h as G,i as K,k as q,l as J,m as ee,o as te,p as ne,r as Y,s as re,t as ie,u as X,v as ae,w as oe,x as se,y as ce}from"./indexRow-Bnj883ii.js";import{t as le}from"./localIso-L06jV29p.js";import{n as Z,r as Q,t as $}from"./favicon-BQsePYv5.js";var ue={class:`flex items-baseline gap-1.5 whitespace-pre-line px-2 py-1 text-xs`},de={key:1,class:`text-dimmed`},fe=[`data-kind`,`aria-label`,`href`],pe=[`data-kind`,`aria-label`],me=E({__name:`SourceMark`,props:{kind:{},tip:{},url:{}},setup(e){let t=e,n=()=>Y[t.kind]??`○`,r=()=>K[t.kind]??t.kind;return(t,a)=>{let o=D;return m(),d(o,null,{content:i(()=>[b(`span`,ue,[e.kind===`slack`?(m(),d(q,{key:0})):C(Y)[e.kind]?(m(),x(`span`,de,w(n()),1)):h(``,!0),b(`span`,null,w(e.tip),1)])]),default:i(()=>[e.url?(m(),x(`a`,{key:0,class:`source linked pointer-events-auto w-[1.6em] shrink-0 rounded border border-transparent text-center text-[0.8rem] text-toned opacity-0 transition-opacity hover:border-primary/30 hover:bg-primary/10 hover:text-primary focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none`,"data-kind":e.kind,"aria-label":`open the ${r()} thread (new tab)`,href:e.url,target:`_blank`,rel:`noopener noreferrer`},`↗`,8,fe)):(m(),x(`span`,{key:1,class:T([`source pointer-events-auto w-[1.6em] shrink-0 text-center text-[0.8rem] text-dimmed opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none`,e.kind===`cli`?`text-[0.7rem]`:``]),"data-kind":e.kind,"aria-label":`source: ${r()}`},w(n()),11,pe))]),_:1})}}}),he=[`data-run-id`,`data-started-at`,`data-persisted`,`data-expires-at`],ge=[`href`,`aria-label`],_e={class:`pointer-events-auto flex items-center max-sm:order-1`},ve=[`data-agent-hue`],ye=[`href`],be={key:3,class:`snippet min-w-0 truncate text-muted max-sm:order-6 max-sm:basis-full max-sm:whitespace-normal max-sm:pl-5 max-sm:text-[0.8rem] max-sm:leading-snug max-sm:line-clamp-2 sm:flex-1`},xe={class:`hidden sm:contents`},Se={class:`expires pointer-events-auto shrink-0 font-mono text-xs tabular-nums text-warn max-sm:order-11`},Ce=[`data-heat`],we={class:`count shrink-0 text-right font-mono text-xs tabular-nums max-sm:order-9 max-sm:text-dimmed sm:min-w-[6em] sm:text-muted`},Te={class:`actions hidden min-w-[7.6em] shrink-0 justify-end gap-1.5 whitespace-nowrap sm:flex`},Ee=E({__name:`RunRow`,props:{run:{},now:{},retentionMs:{}},setup(n){let a=n,o=v(()=>M(a.run.label||W(a.run.id))),u=v(()=>ne(a.run,o.value.scope)),f=v(()=>ae(a.run)),p=v(()=>ee(a.run)),g=v(()=>P(a.run)),y=v(()=>G(a.run)),S=v(()=>X(a.run,a.retentionMs)),E=v(()=>S.value!==void 0&&S.value-a.now<=864e5),O=v(()=>!a.run.finished&&!a.run.stop),k=v(()=>I(a.run.finished&&typeof a.run.finishedAt==`number`?a.run.finishedAt-a.run.startedAt:void 0,`run`)),H=v(()=>F(k.value)),U=v(()=>a.run.finished&&a.run.status&&a.run.status!==`completed`?ce(a.run.status):``),q=v(()=>a.run.stop&&!(a.run.finished&&a.run.status)?L(a.run.stop):``),Y=_({soft:!1,hard:!1}),Z=v(()=>[...y.value?[{label:`Open ${K[g.value.kind]??g.value.kind} thread`,icon:`i-lucide-external-link`,to:y.value,target:`_blank`}]:[],...O.value?[{label:`Stop (soft)`,icon:`i-lucide-octagon-pause`,onSelect:()=>Q(`soft`)},{label:`Kill (hard)`,icon:`i-lucide-octagon-x`,color:`error`,onSelect:()=>Q(`hard`)}]:[]]);function Q(e){(e!==`hard`||t.confirm(`Hard stop: abort this run now with no summary and free its sandbox?`))&&(Y[e]=!0,fetch(se(a.run,e),{method:`POST`,credentials:`same-origin`}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`)}).catch(()=>{Y[e]=!1}))}function $(e){e.target?.closest(`a, button`)||t.navigate(p.value)}return(t,a)=>{let _=D,v=l,M=e;return m(),x(`li`,{class:T([`run group relative rounded-md border-b border-muted hover:bg-(--ui-bg-muted) focus-within:bg-(--ui-bg-muted)`,[n.run.finished?`finished`:`live`,E.value?`leaving`:``]]),"data-run-id":n.run.id,"data-started-at":String(n.run.startedAt),"data-persisted":n.run.persisted?`1`:void 0,"data-expires-at":S.value===void 0?void 0:String(S.value),onClick:$},[b(`a`,{class:`row absolute inset-0 rounded-md focus-visible:outline-2 focus-visible:outline-primary`,href:p.value,"aria-label":`open run ${n.run.label||C(W)(n.run.id)}`},null,8,ge),b(`div`,{class:T([`body pointer-events-none relative z-[1] flex min-w-0 flex-wrap items-center gap-x-2.5 px-2 max-sm:gap-y-1.5 max-sm:py-3 sm:flex-nowrap sm:py-2`,[n.run.finished?`text-muted`:``,E.value?`opacity-85`:``]])},[b(`span`,_e,[c(A,{tone:f.value,label:C(B)(n.run),tip:C(V)(n.run),pulse:!n.run.finished},null,8,[`tone`,`label`,`tip`,`pulse`])]),c(_,{text:C(oe)(n.run),ui:{text:`whitespace-pre-line`}},{default:i(()=>[b(`span`,{class:T([`when pointer-events-auto shrink-0 font-mono tabular-nums max-sm:order-7 max-sm:pl-5 max-sm:text-xs max-sm:text-dimmed sm:min-w-[8.5em] sm:text-[0.8rem]`,n.run.finished?`text-dimmed`:`text-muted`])},w(C(j)(n.run.startedAt,n.now)),3)]),_:1},8,[`text`]),o.value.agent?(m(),x(`span`,{key:0,class:T([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider max-sm:order-2`,[C(ie)[C(z)(o.value.agent)],n.run.finished?`opacity-55`:``]]),"data-agent-hue":C(z)(o.value.agent)},w(o.value.agent),11,ve)):h(``,!0),u.value?(m(),d(_,{key:1,text:u.value},{default:i(()=>[b(`a`,{class:`repo pointer-events-auto min-w-0 shrink-0 rounded border border-accented bg-accented/50 px-1.5 font-mono text-[0.72rem] font-medium leading-normal text-toned no-underline hover:border-(--ui-text-dimmed) hover:text-highlighted max-sm:order-3`,href:`https://github.com/${u.value}`,target:`_blank`,rel:`noopener noreferrer`},w(u.value.slice(u.value.indexOf(`/`)+1)),9,ye)]),_:1},8,[`text`])):(m(),x(`span`,{key:2,class:T([`scope min-w-0 shrink-0 truncate font-medium max-sm:order-3`,n.run.finished?`text-toned`:`text-highlighted`])},w(o.value.scope),3)),o.value.snippet===void 0?h(``,!0):(m(),x(`span`,be,w(o.value.snippet),1)),U.value?(m(),x(`span`,{key:4,class:T([`outcome shrink-0 rounded border px-1.5 font-mono text-[0.7rem] max-sm:order-10`,f.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},w(U.value),3)):h(``,!0),q.value?(m(),x(`span`,{key:5,class:T([`stopbadge shrink-0 rounded border px-1.5 font-mono text-[0.7rem] max-sm:order-10`,n.run.stop?.state===`stopped`?`border-accented text-muted`:`border-warn/30 text-warn`])},w(q.value),3)):h(``,!0),b(`span`,xe,[c(me,{kind:g.value.kind,tip:C(R)(n.run),url:y.value||void 0},null,8,[`kind`,`tip`,`url`])]),E.value&&S.value!==void 0?(m(),d(_,{key:6,text:`removed at ${C(le)(S.value)}`},{default:i(()=>[b(`span`,Se,`gone `+w(C(N)(S.value,n.now)),1)]),_:1},8,[`text`])):h(``,!0),c(_,{text:n.run.finished?`start to finish`:`running for`},{default:i(()=>[b(`span`,{class:T([`elapsed pointer-events-auto ml-auto shrink-0 text-right font-mono text-xs tabular-nums max-sm:order-4 sm:min-w-[4.5em]`,n.run.finished?[H.value?`heat`:`text-muted`,k.value.level>=2?`font-medium`:``]:`text-ok`]),style:r(n.run.finished?H.value:void 0),"data-heat":n.run.finished?k.value.level:void 0},w(C(J)(n.run,n.now)),15,Ce)]),_:1},8,[`text`]),a[2]||=b(`span`,{class:`hidden text-xs text-dimmed max-sm:order-8 max-sm:inline`,"aria-hidden":`true`},`·`,-1),c(_,{text:C(re)(n.run)},{default:i(()=>[b(`span`,we,w(C(te)(n.run)),1)]),_:1},8,[`text`]),b(`span`,Te,[O.value?(m(),x(s,{key:0},[c(_,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:i(()=>[c(v,{class:`pointer-events-auto`,size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:Y.soft,onClick:a[0]||=e=>Q(`soft`)},null,8,[`disabled`])]),_:1}),c(_,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:i(()=>[c(v,{class:`pointer-events-auto`,size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:Y.hard,onClick:a[1]||=e=>Q(`hard`)},null,8,[`disabled`])]),_:1})],64)):h(``,!0)]),Z.value.length>0?(m(),d(M,{key:7,items:Z.value,content:{align:`end`}},{default:i(()=>[c(v,{class:`pointer-events-auto -my-1.5 -mr-1 max-sm:order-5 sm:hidden`,size:`md`,color:`neutral`,variant:`ghost`,icon:`i-lucide-ellipsis-vertical`,"aria-label":`Run actions`})]),_:1},8,[`items`])):h(``,!0)],2)],10,he)}}}),De={class:`conn flex items-center gap-1.5`},Oe={id:`state`,class:`text-xs text-muted`},ke={class:`toolbar mb-1.5 flex items-center gap-4 px-2 text-xs text-muted`},Ae={id:`livecount`,class:`count font-mono tabular-nums`},je={class:`filter ml-auto inline-flex items-center gap-1.5`},Me={class:`toggle inline-flex cursor-pointer select-none items-center gap-1.5 text-toned hover:text-highlighted`},Ne=[`checked`],Pe={id:`retention`,class:`sr-only`},Fe={key:0,class:`banner mb-3 rounded-md border border-warn px-2.5 py-1.5 text-[0.8rem] text-warn`,role:`status`},Ie={id:`runs`,class:`m-0 list-none border-t border-muted p-0`},Le={key:0,id:`leaving`,class:`divider flex items-baseline gap-2 border-b border-dashed border-warn/40 px-2 pb-1.5 pt-3 font-mono text-[0.72rem] uppercase tracking-wider text-warn`,role:`separator`},Re={key:1,id:`empty`,class:`empty px-2 py-2 text-muted`},ze={key:1,class:`pager mt-3 flex items-baseline gap-2 px-2 text-[0.8rem] text-muted`,"aria-label":`Completed runs pages`},Be={class:`range font-mono tabular-nums text-dimmed`},Ve=[`href`],He=E({__name:`RunsIndexPage`,setup(e){let r=y(`runs`),l=r?.all??!1,T=r?.olderThan!==void 0,E=r?.retentionDays??null,j=E===null?void 0:E*864e5,M=p(E),P=_(new Map);for(let e of r?.rows??[])P.set(e.id,e);let F=O(r?.now),I=u({tone:`amber`,text:`connecting…`}),L=v(()=>[...P.values()].sort((e,t)=>t.startedAt-e.startedAt)),R=v(()=>L.value.filter(e=>!e.finished).length),z=v(()=>j===void 0?-1:L.value.findIndex(e=>{let t=X(e,j);return t!==void 0&&t-F.value<=864e5})),B=v(()=>z.value===-1?L.value:L.value.slice(0,z.value)),V=v(()=>z.value===-1?[]:L.value.slice(z.value)),W=l?`All runs`:`Live runs`;a(R,e=>{t.setTitle((e>0?`(${e}) `:``)+W),t.setFavicon(e>0?Z:$)},{immediate:!0});function G(e){t.navigate(e.target.checked?`/runs?all=1`:`/runs`)}let K=v(()=>r?.olderThan===void 0?``:N(r.olderThan,F.value)),q=Q(),J=null;return o(()=>{J=q(l?`/runs?stream=1&all=1`:`/runs?stream=1`);let e=!1;J.onopen=()=>{if(e){t.reload();return}e=!0,I.value={tone:`green`,text:`connected`}},J.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=t.type===`removed`?t.id:t.run?.id,r=n?P.get(n):void 0;if(T&&!r)return;let i=H(t,l,r?.persisted===!0);i.op===`upsert`?P.set(i.run.id,U(P.get(i.run.id),i.run)):i.op===`remove`&&P.delete(i.id)},J.onerror=()=>{J&&J.readyState===2?I.value={tone:`red`,text:`disconnected`}:I.value={tone:`amber`,text:`connecting…`}}}),g(()=>{J?.close()}),(e,t)=>{let a=D;return m(),d(n,{title:C(W),nav:`runs`},{status:i(()=>[b(`span`,De,[c(A,{tone:I.value.tone,label:I.value.text},null,8,[`tone`,`label`]),b(`span`,Oe,w(I.value.text),1)])]),default:i(()=>[c(k,{current:`runs`}),b(`div`,ke,[b(`span`,Ae,w(R.value)+` running`,1),b(`span`,je,[b(`label`,Me,[b(`input`,{id:`showdone`,type:`checkbox`,class:`accent-(--ui-bg-inverted)`,checked:C(l),"aria-describedby":`retention`,onChange:G},null,40,Ne),t[0]||=f(` Show completed `,-1)]),c(a,{text:C(M)},{default:i(()=>[...t[1]||=[b(`span`,{class:`help inline-flex size-[1.1em] cursor-help items-center justify-center rounded-full border border-accented text-[0.7rem] leading-none text-dimmed hover:border-(--ui-text-dimmed) hover:text-toned`,tabindex:`0`},`?`,-1)]]),_:1},8,[`text`]),b(`span`,Pe,w(C(M)),1)])]),C(r)?.storeUnavailable?(m(),x(`p`,Fe,w(C(r).storeUnavailable),1)):h(``,!0),b(`ul`,Ie,[(m(!0),x(s,null,S(B.value,e=>(m(),d(Ee,{key:e.id,run:e,now:C(F),"retention-ms":C(j)},null,8,[`run`,`now`,`retention-ms`]))),128)),V.value.length>0?(m(),x(`li`,Le,[...t[2]||=[b(`span`,{"aria-hidden":`true`,class:`text-sm tracking-normal`},`⏳`,-1),b(`span`,{class:`whitespace-nowrap`},`Leaving within a day`,-1),b(`span`,{class:`normal-case tracking-normal text-dimmed max-sm:hidden`},`— each row says when it is removed`,-1)]])):h(``,!0),(m(!0),x(s,null,S(V.value,e=>(m(),d(Ee,{key:e.id,run:e,now:C(F),"retention-ms":C(j)},null,8,[`run`,`now`,`retention-ms`]))),128)),L.value.length===0?(m(),x(`li`,Re,w(C(l)?`No runs.`:`No active runs.`),1)):h(``,!0)]),C(l)&&(C(r)?.olderHref||C(r)?.olderThan!==void 0)?(m(),x(`nav`,ze,[C(r)?.olderThan===void 0?h(``,!0):(m(),x(s,{key:0},[t[3]||=b(`a`,{class:`text-primary hover:underline`,href:`/runs?all=1`},`← Newest runs`,-1),b(`span`,Be,`· runs finished before `+w(K.value),1)],64)),C(r)?.olderHref?(m(),x(`a`,{key:1,class:`older ml-auto text-primary hover:underline`,href:C(r).olderHref},`Older runs →`,8,Ve)):h(``,!0)])):h(``,!0)]),_:1},8,[`title`])}}});export{He as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./AppShell-lYVcj-k7.js";import{Lr as t,Xt as n,_n as r,cn as i,gn as a,ir as o,ln as s,on as c,r as l,sn as u,un as d,ur as f,vi as p,wi as m,xi as h,yn as g}from"./seed-DeKSHrt2.js";import{t as ee}from"./Tooltip-
|
|
1
|
+
import{t as e}from"./AppShell-lYVcj-k7.js";import{Lr as t,Xt as n,_n as r,cn as i,gn as a,ir as o,ln as s,on as c,r as l,sn as u,un as d,ur as f,vi as p,wi as m,xi as h,yn as g}from"./seed-DeKSHrt2.js";import{t as ee}from"./Tooltip-B0Ob5MQ4.js";import{n as te}from"./wallClock-61NpVkY6.js";import{t as _}from"./RunsTabs-DEICQ4FY.js";import{t as v}from"./indexFormat-B-pd4r7Y.js";import{t as y}from"./localIso-L06jV29p.js";function b(e,t){return{kind:`schedule`,id:`schedule:${e}`,grants:t}}b(`self-improvement`,Object.freeze({actions:new Set([`friction:read`,`friction:write`]),channels:`all`,repos:new Set}));function x(e,t){let n=e-t,r=Math.floor(Math.abs(n)/6e4),i=Math.floor(r/60),a=Math.floor(i/24),o=a>0?`${a}d ${i%24}h`:i>0?`${i}h ${r%60}m`:r>0?`${r}m`:`<1m`;return n>=0?`in ${o}`:`${o} ago`}var S={healthz:`container health check`,watchdog:`resident watchdog`},C={completed:`succeeded`,failed:`failed`,stopped_soft:`stopped early`,stopped_hard:`killed`,"no-run":`no run created`,"ingress-error":`ingress error`,misconfigured:`misconfigured — nothing ran`},w={completed:`ok`,failed:`bad`,stopped_soft:`warn`,stopped_hard:`warn`,"no-run":`warn`,"ingress-error":`bad`,misconfigured:`bad`},T=120;function E(e){let t=e.replace(/\s+/g,` `).trim();return t=t.replace(/^[^\p{L}\p{N}*_`<[(]+/u,``),t=t.replace(/^\*[^*]{1,60}\*\s+[—–-]\s+/,``),t=t.replace(/^[^\p{L}\p{N}]+/u,``).trim(),t.length>T?`${t.slice(0,T)}…`:t}var D={key:0,class:`px-2 py-1.5 text-muted`},O={key:1,id:`scheduled`,"aria-label":`Scheduled jobs`},k={class:`m-0 list-none p-0`},A=[`data-schedule`],j={class:`def flex flex-wrap items-baseline gap-x-2 gap-y-1.5 text-[0.8rem] text-toned`},M={class:`name font-medium text-highlighted max-sm:text-[0.9rem]`},N={class:`max-sm:ml-auto`},P={class:`rounded-xs bg-accented px-1.5 py-0.5 text-toned`},F={class:`max-sm:flex max-sm:basis-full max-sm:flex-wrap max-sm:items-baseline max-sm:gap-2 sm:contents`},I={class:`rounded-xs bg-accented px-1.5 py-0.5 text-toned`},L={class:`rounded-xs bg-accented px-1.5 py-0.5 text-toned`},R={key:1,class:`text-dimmed`},z={class:`max-sm:flex max-sm:basis-full max-sm:flex-wrap max-sm:items-baseline max-sm:gap-2 sm:contents`},B={class:`rounded-xs bg-accented px-1.5 py-0.5 text-toned`},V=[`title`],H={class:`max-sm:hidden`},U={class:`font-medium text-highlighted`},W={class:`text-dimmed`},G={class:`text-toned sm:hidden`},K={key:1,class:`text-dimmed`},q={class:`fire mt-1.5 font-mono text-xs text-muted max-sm:flex max-sm:flex-wrap max-sm:items-baseline max-sm:gap-x-1.5 max-sm:gap-y-1 sm:overflow-hidden sm:text-ellipsis sm:whitespace-nowrap`},J=[`title`],Y=[`href`],X=[`title`],Z=[`title`],Q={key:1,class:`text-dimmed`},ne={key:0,class:`mt-2.5 px-2 text-xs text-muted`},$=g({__name:`ScheduledPage`,setup(g){let b=l(`scheduled`),T=c(()=>b?.now??te()),$=c(()=>b?.rows??null),re={ok:`text-ok`,bad:`text-bad`,warn:`text-warn`};return(c,l)=>{let g=ee;return o(),i(e,{title:`Scheduled runs`,nav:`runs`},{default:t(()=>[r(_,{current:`scheduled`}),$.value===null?(o(),d(`p`,D,`No schedule registry configured.`)):(o(),d(`section`,O,[u(`ul`,k,[(o(!0),d(n,null,f($.value,e=>(o(),d(`li`,{key:e.name,class:`border-b border-muted px-2 pb-3 pt-2.5`,"data-schedule":e.name},[u(`div`,j,[r(g,{text:e.description},{default:t(()=>[u(`span`,M,m(e.name),1)]),_:2},1032,[`text`]),l[5]||=u(`span`,{class:`hidden text-accented sm:inline`,"aria-hidden":`true`},`·`,-1),u(`span`,N,[l[0]||=u(`span`,{class:`mr-1 font-mono text-[0.62rem] uppercase tracking-wider text-dimmed`},`on`,-1),u(`code`,P,m(e.worker),1)]),l[6]||=u(`span`,{class:`hidden text-accented sm:inline`,"aria-hidden":`true`},`·`,-1),u(`span`,F,[e.action.type===`run`?(o(),d(n,{key:0},[u(`code`,I,m(e.action.command),1),l[1]||=u(`span`,{class:`text-dimmed`},`as`,-1),u(`code`,L,m(e.action.identity),1)],64)):(o(),d(`span`,R,m(p(S)[e.action.type])+` — not a run`,1))]),l[7]||=u(`span`,{class:`hidden text-accented sm:inline`,"aria-hidden":`true`},`·`,-1),u(`span`,z,[u(`code`,B,m(e.cron),1),l[3]||=u(`span`,{class:`text-dimmed`},`UTC`,-1),l[4]||=u(`span`,{class:`hidden text-accented sm:inline`,"aria-hidden":`true`},`·`,-1),u(`span`,{class:`next font-mono tabular-nums max-sm:ml-auto`,title:e.nextFireAt===void 0?void 0:p(y)(e.nextFireAt)},[l[2]||=u(`span`,{class:`mr-1 font-mono text-[0.62rem] uppercase tracking-wider text-dimmed`},`next`,-1),e.nextFireAt===void 0?(o(),d(`span`,K,`never`)):(o(),d(n,{key:0},[u(`span`,H,[u(`b`,U,m(p(v)(e.nextFireAt,T.value)),1),u(`span`,W,` (`+m(p(x)(e.nextFireAt,T.value))+`)`,1)]),u(`span`,G,m(p(x)(e.nextFireAt,T.value)),1)],64))],8,V)])]),u(`div`,q,[l[12]||=u(`span`,{class:`mr-1 font-mono text-[0.62rem] uppercase tracking-wider text-dimmed`},`last`,-1),e.last?(o(),d(n,{key:0},[u(`span`,{class:h([`outcome`,re[p(w)[e.last.outcome]]])},m(p(C)[e.last.outcome]),3),l[11]||=u(`span`,{class:`mx-1.5 text-accented max-sm:mx-0`,"aria-hidden":`true`},`·`,-1),u(`span`,{class:`when text-toned`,title:p(y)(e.last.firedAt)},m(p(x)(e.last.firedAt,T.value)),9,J),e.last.runId?(o(),d(n,{key:0},[l[8]||=u(`span`,{class:`mx-1.5 text-accented max-sm:mx-0`,"aria-hidden":`true`},`·`,-1),e.last.runHref?(o(),d(`a`,{key:0,class:`text-primary hover:underline`,href:e.last.runHref},`run `+m(e.last.runId.slice(0,8)),9,Y)):(o(),d(n,{key:1},[a(`run `+m(e.last.runId.slice(0,8)),1)],64))],64)):s(``,!0),e.last.traceId?(o(),d(n,{key:1},[l[9]||=u(`span`,{class:`mx-1.5 text-accented max-sm:mx-0`,"aria-hidden":`true`},`·`,-1),u(`span`,{class:`trace text-dimmed`,title:`trace ${e.last.traceId}`},`trace `+m(e.last.traceId.slice(0,8)),9,X)],64)):s(``,!0),e.last.detail&&p(E)(e.last.detail)?(o(),d(n,{key:2},[l[10]||=u(`span`,{class:`mx-1.5 text-accented max-sm:hidden`,"aria-hidden":`true`},`·`,-1),u(`span`,{class:`detail font-sans max-sm:line-clamp-2 max-sm:basis-full max-sm:whitespace-normal`,title:e.last.detail},m(p(E)(e.last.detail)),9,Z)],64)):s(``,!0)],64)):(o(),d(`span`,Q,m(p(b)?.firingsUnavailable?`unknown`:`never fired`),1))])],8,A))),128))]),p(b)?.firingsUnavailable?(o(),d(`p`,ne,` Firing history unavailable: `+m(p(b).firingsUnavailable),1)):s(``,!0)]))]),_:1})}}});export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Lr as e,cn as t,ir as n,sn as r,un as i,xi as a,yn as o}from"./seed-DeKSHrt2.js";import{t as s}from"./Tooltip-
|
|
1
|
+
import{Lr as e,cn as t,ir as n,sn as r,un as i,xi as a,yn as o}from"./seed-DeKSHrt2.js";import{t as s}from"./Tooltip-B0Ob5MQ4.js";var c=[`aria-label`,`data-tone`],l=[`aria-label`,`data-tone`],u=o({__name:`StatusDot`,props:{tone:{},label:{},tip:{},pulse:{type:Boolean}},setup(o){let u={green:`bg-ok`,amber:`bg-warn`,red:`bg-bad`,grey:`bg-(--ui-text-dimmed)`};return(d,f)=>{let p=s;return o.tip?(n(),t(p,{key:0,text:o.tip},{default:e(()=>[r(`span`,{class:a([`inline-block size-[0.6em] shrink-0 rounded-full`,[u[o.tone],o.pulse?`motion-safe:animate-pulse`:``]]),role:`img`,"aria-label":o.label,"data-tone":o.tone},null,10,c)]),_:1},8,[`text`])):(n(),i(`span`,{key:1,class:a([`inline-block size-[0.6em] shrink-0 rounded-full`,[u[o.tone],o.pulse?`motion-safe:animate-pulse`:``]]),role:`img`,"aria-label":o.label,"data-tone":o.tone},null,10,l))}}});export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,f as t,l as n,o as r,u as i,v as a,x as o,y as s}from"./AppShell-lYVcj-k7.js";import{A as c,B as l,Dr as u,J as d,Lr as f,M as p,Mr as m,N as h,Nr as g,Qn as _,Si as v,Wn as y,Wt as b,Xt as x,_ as S,_n as C,_t as ee,at as w,ci as T,cn as E,dr as D,ft as O,g as te,gn as ne,h as re,ht as k,ir as A,j,kn as M,ln as N,mi as P,mr as ie,on as F,ot as I,pt as L,q as R,tt as z,u as B,un as V,ur as H,vi as U,wi as W,x as G,xi as K,xr as q,y as J,yn as Y}from"./seed-DeKSHrt2.js";import{n as X,r as ae}from"./main-CRtlGxRm.js";function oe(e,t){let n=L(!1,300);k(()=>{n.value=!1});let r=T(null),i=I();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=ce(a,se(a,i.getBoundingClientRect()),1),s=le(t.getBoundingClientRect()),c=de([...o,...s]);r.value=c,n.value=!0}return g(n=>{if(e.value&&t.value){let r=e=>o(e,t.value),i=t=>o(t,e.value);e.value.addEventListener(`pointerleave`,r),t.value.addEventListener(`pointerleave`,i),n(()=>{e.value?.removeEventListener(`pointerleave`,r),t.value?.removeEventListener(`pointerleave`,i)})}}),g(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!ue(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())};e.value?.ownerDocument.addEventListener(`pointermove`,o),n(()=>e.value?.ownerDocument.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function se(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function ce(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function le(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ue(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function de(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),fe(t)}function fe(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t.at(-1),n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n.at(-1),t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var pe=Y({__name:`TooltipArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return h(),(e,r)=>(A(),E(U(n),v(M(t)),{default:f(()=>[D(e.$slots,`default`)]),_:3},16))}}),Z=`tooltip.open`,[Q,me]=l(`TooltipRoot`),he=Y({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:n}){let r=e,i=n;h();let a=X(),o=F(()=>r.disableHoverableContent??a.disableHoverableContent.value),s=F(()=>r.disableClosingTrigger??a.disableClosingTrigger.value),c=F(()=>r.disabled??a.disabled.value),l=F(()=>r.delayDuration??a.delayDuration.value),u=F(()=>r.ignoreNonKeyboardFocus??a.ignoreNonKeyboardFocus.value),d=w(r,`open`,i,{defaultValue:r.defaultOpen,passive:r.open===void 0});m(d,e=>{a.onClose&&(e?(a.onOpen(),document.dispatchEvent(new CustomEvent(Z))):a.onClose())});let p=T(!1),g=T(),_=F(()=>d.value?p.value?`delayed-open`:`instant-open`:`closed`),{start:v,stop:y}=ee(()=>{p.value=!0,d.value=!0},l,{immediate:!1});function b(){y(),p.value=!1,d.value=!0}function x(){y(),d.value=!1}function S(){v()}return me({contentId:``,open:d,stateAttribute:_,trigger:g,onTriggerChange(e){g.value=e},onTriggerEnter(){a.isOpenDelayed.value?S():b()},onTriggerLeave(){o.value?x():y()},onOpen:b,onClose:x,disableHoverableContent:o,disableClosingTrigger:s,disabled:c,ignoreNonKeyboardFocus:u}),(e,n)=>(A(),E(U(t),null,{default:f(()=>[D(e.$slots,`default`,{open:U(d)})]),_:3}))}}),$=Y({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,o=Q(),s=X(),{forwardRef:c,currentElement:l}=h(),u=F(()=>n.ariaLabel||l.value?.textContent),d=F(()=>{let{ariaLabel:e,...t}=n;return R(t,s.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return _(()=>{z(window,`scroll`,e=>{e.target?.contains(o.trigger.value)&&o.onClose()},{capture:!0}),z(document,Z,o.onClose)}),(e,t)=>(A(),E(U(a),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{U(o).disableClosingTrigger.value&&U(o).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=b(()=>{},[`prevent`]),onDismiss:t[3]||=e=>U(o).onClose()},{default:f(()=>[C(U(i),y({ref:U(c),"data-state":U(o).stateAttribute.value},{...e.$attrs,...d.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:f(()=>[D(e.$slots,`default`),C(U(ae),{id:U(o).contentId,role:`tooltip`},{default:f(()=>[ne(W(u.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),ge=Y({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=p(e),{forwardRef:n,currentElement:r}=h(),{trigger:i,onClose:a}=Q(),o=X(),{isPointerInTransit:s,onPointerExit:c}=oe(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),(e,r)=>(A(),E($,y({ref:U(n)},U(t)),{default:f(()=>[D(e.$slots,`default`)]),_:3},16))}}),_e=Y({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Q(),a=o(n,r),{forwardRef:s}=h();return(e,t)=>(A(),E(U(j),{present:e.forceMount||U(i).open.value},{default:f(()=>[(A(),E(ie(U(i).disableHoverableContent.value?$:ge),y({ref:U(s)},U(a)),{default:f(()=>[D(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),ve=Y({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(A(),E(U(G),v(M(t)),{default:f(()=>[D(e.$slots,`default`)]),_:3},16))}}),ye=Y({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t,r=Q(),i=X();r.contentId||=s(void 0,`reka-tooltip-content`);let{forwardRef:a,currentElement:o}=h(),l=T(!1),u=T(!1),d=F(()=>r.disabled.value?{}:{click:S,focus:b,pointermove:g,pointerleave:v,pointerdown:m,blur:x});_(()=>{r.onTriggerChange(o.value)});function p(){setTimeout(()=>{l.value=!1},1)}function m(){r.open&&!r.disableClosingTrigger.value&&r.onClose(),l.value=!0,document.addEventListener(`pointerup`,p,{once:!0})}function g(e){e.pointerType!==`touch`&&!u.value&&!i.isPointerInTransitRef.value&&(r.onTriggerEnter(),u.value=!0)}function v(){r.onTriggerLeave(),u.value=!1}function b(e){l.value||(!r.ignoreNonKeyboardFocus.value||e.target.matches?.(`:focus-visible`))&&r.onOpen()}function x(){r.onClose()}function S(){r.disableClosingTrigger.value||r.onClose()}return(t,i)=>(A(),E(U(e),{"as-child":``,reference:t.reference},{default:f(()=>[C(U(c),y({ref:U(a),"aria-describedby":U(r).open.value?U(r).contentId:void 0,"data-state":U(r).stateAttribute.value,as:t.as,"as-child":n.asChild,"data-grace-area-trigger":``},q(d.value)),{default:f(()=>[D(t.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),be={slots:{content:`flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto`,arrow:`fill-bg stroke-default`,text:`truncate`,kbds:`hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5`,kbdsSize:`sm`}},xe={__name:`Tooltip`,props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,i=t,a=u(),o=S(`tooltip`,n),s=d(),c=X(),l=te(O(o,`defaultOpen`,`open`,`delayDuration`,`disableHoverableContent`,`disableClosingTrigger`,`ignoreNonKeyboardFocus`),i),p=J(P(()=>o.portal)),m=P(()=>R(o.content,c.content.value,{side:`bottom`,sideOffset:8,collisionPadding:8})),h=P(()=>R(o.arrow,{rounded:!0})),g=F(()=>re({extend:be,...s.ui?.tooltip||{}})({side:m.value.side}));return(e,t)=>(A(),E(U(he),y(U(l),{disabled:!(U(o).text||U(o).kbds?.length||a.content)||U(o).disabled}),{default:f(({open:t})=>[a.default||U(o).reference?(A(),E(U(ye),y({key:0},e.$attrs,{"as-child":``,reference:U(o).reference,class:U(o).class}),{default:f(()=>[D(e.$slots,`default`,{open:t})]),_:2},1040,[`reference`,`class`])):N(``,!0),C(U(ve),v(M(U(p))),{default:f(()=>[C(U(B),null,{default:f(()=>[C(U(_e),y(m.value,{"data-slot":`content`,class:g.value.content({class:[!a.default&&U(o).class,U(o).ui?.content]})}),{default:f(()=>[D(e.$slots,`content`,{ui:g.value},()=>[U(o).text?(A(),V(`span`,{key:0,"data-slot":`text`,class:K(g.value.text({class:U(o).ui?.text}))},W(U(o).text),3)):N(``,!0),U(o).kbds?.length?(A(),V(`span`,{key:1,"data-slot":`kbds`,class:K(g.value.kbds({class:U(o).ui?.kbds}))},[(A(!0),V(x,null,H(U(o).kbds,(e,t)=>(A(),E(r,y({key:t,size:U(o).ui?.kbdsSize||g.value.kbdsSize()},{ref_for:!0},typeof e==`string`?{value:e}:e),null,16,[`size`]))),128))],2)):N(``,!0)]),U(o).arrow?(A(),E(U(pe),y({key:0},h.value,{"data-slot":`arrow`,class:g.value.arrow({class:U(o).ui?.arrow})}),null,16,[`class`])):N(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`disabled`]))}};export{xe as t};
|
|
1
|
+
import{d as e,f as t,l as n,o as r,u as i,v as a,x as o,y as s}from"./AppShell-lYVcj-k7.js";import{A as c,B as l,Dr as u,J as d,Lr as f,M as p,Mr as m,N as h,Nr as g,Qn as _,Si as v,Wn as y,Wt as b,Xt as x,_ as S,_n as C,_t as ee,at as w,ci as T,cn as E,dr as D,ft as O,g as te,gn as ne,h as re,ht as k,ir as A,j,kn as M,ln as N,mi as P,mr as ie,on as F,ot as I,pt as L,q as R,tt as z,u as B,un as V,ur as H,vi as U,wi as W,x as G,xi as K,xr as q,y as J,yn as Y}from"./seed-DeKSHrt2.js";import{n as X,r as ae}from"./main-D3lG-yQ9.js";function oe(e,t){let n=L(!1,300);k(()=>{n.value=!1});let r=T(null),i=I();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=ce(a,se(a,i.getBoundingClientRect()),1),s=le(t.getBoundingClientRect()),c=de([...o,...s]);r.value=c,n.value=!0}return g(n=>{if(e.value&&t.value){let r=e=>o(e,t.value),i=t=>o(t,e.value);e.value.addEventListener(`pointerleave`,r),t.value.addEventListener(`pointerleave`,i),n(()=>{e.value?.removeEventListener(`pointerleave`,r),t.value?.removeEventListener(`pointerleave`,i)})}}),g(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!ue(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())};e.value?.ownerDocument.addEventListener(`pointermove`,o),n(()=>e.value?.ownerDocument.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function se(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function ce(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function le(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ue(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function de(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),fe(t)}function fe(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t.at(-1),n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n.at(-1),t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var pe=Y({__name:`TooltipArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return h(),(e,r)=>(A(),E(U(n),v(M(t)),{default:f(()=>[D(e.$slots,`default`)]),_:3},16))}}),Z=`tooltip.open`,[Q,me]=l(`TooltipRoot`),he=Y({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:n}){let r=e,i=n;h();let a=X(),o=F(()=>r.disableHoverableContent??a.disableHoverableContent.value),s=F(()=>r.disableClosingTrigger??a.disableClosingTrigger.value),c=F(()=>r.disabled??a.disabled.value),l=F(()=>r.delayDuration??a.delayDuration.value),u=F(()=>r.ignoreNonKeyboardFocus??a.ignoreNonKeyboardFocus.value),d=w(r,`open`,i,{defaultValue:r.defaultOpen,passive:r.open===void 0});m(d,e=>{a.onClose&&(e?(a.onOpen(),document.dispatchEvent(new CustomEvent(Z))):a.onClose())});let p=T(!1),g=T(),_=F(()=>d.value?p.value?`delayed-open`:`instant-open`:`closed`),{start:v,stop:y}=ee(()=>{p.value=!0,d.value=!0},l,{immediate:!1});function b(){y(),p.value=!1,d.value=!0}function x(){y(),d.value=!1}function S(){v()}return me({contentId:``,open:d,stateAttribute:_,trigger:g,onTriggerChange(e){g.value=e},onTriggerEnter(){a.isOpenDelayed.value?S():b()},onTriggerLeave(){o.value?x():y()},onOpen:b,onClose:x,disableHoverableContent:o,disableClosingTrigger:s,disabled:c,ignoreNonKeyboardFocus:u}),(e,n)=>(A(),E(U(t),null,{default:f(()=>[D(e.$slots,`default`,{open:U(d)})]),_:3}))}}),$=Y({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,o=Q(),s=X(),{forwardRef:c,currentElement:l}=h(),u=F(()=>n.ariaLabel||l.value?.textContent),d=F(()=>{let{ariaLabel:e,...t}=n;return R(t,s.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return _(()=>{z(window,`scroll`,e=>{e.target?.contains(o.trigger.value)&&o.onClose()},{capture:!0}),z(document,Z,o.onClose)}),(e,t)=>(A(),E(U(a),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{U(o).disableClosingTrigger.value&&U(o).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=b(()=>{},[`prevent`]),onDismiss:t[3]||=e=>U(o).onClose()},{default:f(()=>[C(U(i),y({ref:U(c),"data-state":U(o).stateAttribute.value},{...e.$attrs,...d.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:f(()=>[D(e.$slots,`default`),C(U(ae),{id:U(o).contentId,role:`tooltip`},{default:f(()=>[ne(W(u.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),ge=Y({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=p(e),{forwardRef:n,currentElement:r}=h(),{trigger:i,onClose:a}=Q(),o=X(),{isPointerInTransit:s,onPointerExit:c}=oe(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),(e,r)=>(A(),E($,y({ref:U(n)},U(t)),{default:f(()=>[D(e.$slots,`default`)]),_:3},16))}}),_e=Y({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Q(),a=o(n,r),{forwardRef:s}=h();return(e,t)=>(A(),E(U(j),{present:e.forceMount||U(i).open.value},{default:f(()=>[(A(),E(ie(U(i).disableHoverableContent.value?$:ge),y({ref:U(s)},U(a)),{default:f(()=>[D(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),ve=Y({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(A(),E(U(G),v(M(t)),{default:f(()=>[D(e.$slots,`default`)]),_:3},16))}}),ye=Y({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t,r=Q(),i=X();r.contentId||=s(void 0,`reka-tooltip-content`);let{forwardRef:a,currentElement:o}=h(),l=T(!1),u=T(!1),d=F(()=>r.disabled.value?{}:{click:S,focus:b,pointermove:g,pointerleave:v,pointerdown:m,blur:x});_(()=>{r.onTriggerChange(o.value)});function p(){setTimeout(()=>{l.value=!1},1)}function m(){r.open&&!r.disableClosingTrigger.value&&r.onClose(),l.value=!0,document.addEventListener(`pointerup`,p,{once:!0})}function g(e){e.pointerType!==`touch`&&!u.value&&!i.isPointerInTransitRef.value&&(r.onTriggerEnter(),u.value=!0)}function v(){r.onTriggerLeave(),u.value=!1}function b(e){l.value||(!r.ignoreNonKeyboardFocus.value||e.target.matches?.(`:focus-visible`))&&r.onOpen()}function x(){r.onClose()}function S(){r.disableClosingTrigger.value||r.onClose()}return(t,i)=>(A(),E(U(e),{"as-child":``,reference:t.reference},{default:f(()=>[C(U(c),y({ref:U(a),"aria-describedby":U(r).open.value?U(r).contentId:void 0,"data-state":U(r).stateAttribute.value,as:t.as,"as-child":n.asChild,"data-grace-area-trigger":``},q(d.value)),{default:f(()=>[D(t.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),be={slots:{content:`flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto`,arrow:`fill-bg stroke-default`,text:`truncate`,kbds:`hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5`,kbdsSize:`sm`}},xe={__name:`Tooltip`,props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,i=t,a=u(),o=S(`tooltip`,n),s=d(),c=X(),l=te(O(o,`defaultOpen`,`open`,`delayDuration`,`disableHoverableContent`,`disableClosingTrigger`,`ignoreNonKeyboardFocus`),i),p=J(P(()=>o.portal)),m=P(()=>R(o.content,c.content.value,{side:`bottom`,sideOffset:8,collisionPadding:8})),h=P(()=>R(o.arrow,{rounded:!0})),g=F(()=>re({extend:be,...s.ui?.tooltip||{}})({side:m.value.side}));return(e,t)=>(A(),E(U(he),y(U(l),{disabled:!(U(o).text||U(o).kbds?.length||a.content)||U(o).disabled}),{default:f(({open:t})=>[a.default||U(o).reference?(A(),E(U(ye),y({key:0},e.$attrs,{"as-child":``,reference:U(o).reference,class:U(o).class}),{default:f(()=>[D(e.$slots,`default`,{open:t})]),_:2},1040,[`reference`,`class`])):N(``,!0),C(U(ve),v(M(U(p))),{default:f(()=>[C(U(B),null,{default:f(()=>[C(U(_e),y(m.value,{"data-slot":`content`,class:g.value.content({class:[!a.default&&U(o).class,U(o).ui?.content]})}),{default:f(()=>[D(e.$slots,`content`,{ui:g.value},()=>[U(o).text?(A(),V(`span`,{key:0,"data-slot":`text`,class:K(g.value.text({class:U(o).ui?.text}))},W(U(o).text),3)):N(``,!0),U(o).kbds?.length?(A(),V(`span`,{key:1,"data-slot":`kbds`,class:K(g.value.kbds({class:U(o).ui?.kbds}))},[(A(!0),V(x,null,H(U(o).kbds,(e,t)=>(A(),E(r,y({key:t,size:U(o).ui?.kbdsSize||g.value.kbdsSize()},{ref_for:!0},typeof e==`string`?{value:e}:e),null,16,[`size`]))),128))],2)):N(``,!0)]),U(o).arrow?(A(),E(U(pe),y({key:0},h.value,{"data-slot":`arrow`,class:g.value.arrow({class:U(o).ui?.arrow})}),null,16,[`class`])):N(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`disabled`]))}};export{xe as t};
|